idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
993,027
public void updatePublishAuditStatus(String bundleId, Status newStatus, PublishAuditHistory history, Boolean updateDates) throws DotPublisherException {<NEW_LINE>boolean local = false;<NEW_LINE>try {<NEW_LINE>local = HibernateUtil.startLocalTransactionIfNeeded();<NEW_LINE>DotConnect dc = new DotConnect();<NEW_LINE>if (updateDates) {<NEW_LINE>dc.setSQL(UPDATE_ALL_BY_BUNDLEID);<NEW_LINE>} else {<NEW_LINE>dc.setSQL(UPDATE_STATUS_STATUSPOJO_BY_BUNDLEID);<NEW_LINE>}<NEW_LINE>dc.addParam(newStatus.getCode());<NEW_LINE>if (history != null) {<NEW_LINE>dc.addParam(history.getSerialized());<NEW_LINE>} else {<NEW_LINE>dc.addParam("");<NEW_LINE>}<NEW_LINE>if (updateDates) {<NEW_LINE>dc.addParam(new Date());<NEW_LINE>dc<MASK><NEW_LINE>}<NEW_LINE>dc.addParam(bundleId);<NEW_LINE>dc.loadResult();<NEW_LINE>if (local) {<NEW_LINE>HibernateUtil.closeAndCommitTransaction();<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>if (local) {<NEW_LINE>try {<NEW_LINE>HibernateUtil.rollbackTransaction();<NEW_LINE>} catch (DotHibernateException e1) {<NEW_LINE>Logger.debug(PublishAuditAPIImpl.class, e.getMessage(), e1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Logger.debug(PublishAuditAPIImpl.class, e.getMessage(), e);<NEW_LINE>throw new DotPublisherException("Unable to update element in publish queue audit table:" + "with the following bundle_id " + bundleId + " " + e.getMessage(), e);<NEW_LINE>} finally {<NEW_LINE>if (local) {<NEW_LINE>HibernateUtil.closeSessionSilently();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
.addParam(new Date());
1,615,793
private static Set<String> collectClasspaths(Project prj) throws DependencyResolutionRequiredException {<NEW_LINE>Set<String> toRet = new HashSet<String>();<NEW_LINE>NbMavenProject watcher = prj.getLookup().lookup(NbMavenProject.class);<NEW_LINE>MavenProject mproject = watcher.getMavenProject();<NEW_LINE>// TODO this ought to be really configurable based on what class gets debugged.<NEW_LINE>toRet.<MASK><NEW_LINE>// for poms also include all module projects recursively..<NEW_LINE>boolean isPom = NbMavenProject.TYPE_POM.equals(watcher.getPackagingType());<NEW_LINE>if (isPom) {<NEW_LINE>ProjectContainerProvider subs = prj.getLookup().lookup(ProjectContainerProvider.class);<NEW_LINE>ProjectContainerProvider.Result res = subs.getContainedProjects();<NEW_LINE>for (Project pr : res.getProjects()) {<NEW_LINE>toRet.addAll(collectClasspaths(pr));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return toRet;<NEW_LINE>}
addAll(mproject.getTestClasspathElements());
1,462,489
public FileSystemCommand workerHeartbeat(long workerId, List<Long> persistedFiles, WorkerHeartbeatContext context) throws IOException {<NEW_LINE>List<String> persistedUfsFingerprints = context.getOptions().getPersistedFileFingerprintsList();<NEW_LINE>boolean hasPersistedFingerprints = persistedUfsFingerprints.size() == persistedFiles.size();<NEW_LINE>for (int i = 0; i < persistedFiles.size(); i++) {<NEW_LINE>long fileId = persistedFiles.get(i);<NEW_LINE>String ufsFingerprint = hasPersistedFingerprints ? persistedUfsFingerprints.get(i) : Constants.INVALID_UFS_FINGERPRINT;<NEW_LINE>try {<NEW_LINE>// Permission checking for each file is performed inside setAttribute<NEW_LINE>setAttribute(getPath(fileId), SetAttributeContext.mergeFrom(SetAttributePOptions.newBuilder().setPersisted(true<MASK><NEW_LINE>} catch (FileDoesNotExistException | AccessControlException | InvalidPathException e) {<NEW_LINE>LOG.error("Failed to set file {} as persisted, because {}", fileId, e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// TODO(zac) Clean up master and worker code since this is taken care of by job service now.<NEW_LINE>// Worker should not persist any files. Instead, files are persisted through job service.<NEW_LINE>List<PersistFile> filesToPersist = new ArrayList<>();<NEW_LINE>FileSystemCommandOptions commandOptions = new FileSystemCommandOptions();<NEW_LINE>commandOptions.setPersistOptions(new PersistCommandOptions(filesToPersist));<NEW_LINE>return new FileSystemCommand(CommandType.PERSIST, commandOptions);<NEW_LINE>}
)).setUfsFingerprint(ufsFingerprint));
1,303,806
public DeleteAssetResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>DeleteAssetResult deleteAssetResult = new DeleteAssetResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE><MASK><NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return deleteAssetResult;<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("assetStatus", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>deleteAssetResult.setAssetStatus(AssetStatusJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return deleteAssetResult;<NEW_LINE>}
JsonToken token = context.getCurrentToken();
171,685
private void readKeyFromStorage() {<NEW_LINE>SharedPreferences settings = ContextFactory.getContext().getSharedPreferences(m_strPrefName, Context.MODE_PRIVATE);<NEW_LINE>String strOldKey = settings.getString(m_strDBPartition, "");<NEW_LINE>if (strOldKey != null && strOldKey.length() > 0) {<NEW_LINE>// , Base64.DEFAULT);<NEW_LINE>m_dbKeyData = Base64.decode(strOldKey);<NEW_LINE>// Here we are checking database key length for finding out if it is AES-128 or AES-256<NEW_LINE>m_nKeyLenBit = m_dbKeyData.length * 8;<NEW_LINE><MASK><NEW_LINE>if (DEBUG) {<NEW_LINE>Logger.I(TAG, "Key: " + dumpKey(m_dbKeyData));<NEW_LINE>Logger.I(TAG, "Encoded key: " + strOldKey);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>Logger.I(TAG, "No key is found in Shared Preferences");<NEW_LINE>}<NEW_LINE>}
Logger.I(TAG, "Key is successfully read from Shared Preferences");
1,847,704
public void run() {<NEW_LINE>for (InspectionTreeNode node : myNodesToSuppress) {<NEW_LINE>final Pair<PsiElement, CommonProblemDescriptor> content = getContentToSuppress(node);<NEW_LINE>if (content.first == null)<NEW_LINE>break;<NEW_LINE>final PsiElement element = content.first;<NEW_LINE>RefEntity refEntity = null;<NEW_LINE>if (node instanceof RefElementNode) {<NEW_LINE>refEntity = ((RefElementNode) node).getElement();<NEW_LINE>} else if (node instanceof ProblemDescriptionNode) {<NEW_LINE>refEntity = ((<MASK><NEW_LINE>}<NEW_LINE>if (!suppress(element, content.second, mySuppressAction, refEntity))<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>final Set<GlobalInspectionContextImpl> globalInspectionContexts = myManager.getRunningContexts();<NEW_LINE>for (GlobalInspectionContextImpl context : globalInspectionContexts) {<NEW_LINE>context.refreshViews();<NEW_LINE>}<NEW_LINE>CommandProcessor.getInstance().markCurrentCommandAsGlobal(myProject);<NEW_LINE>}
ProblemDescriptionNode) node).getElement();
959,766
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {<NEW_LINE>Toolbar toolbar = view.findViewById(R.id.payments_recovery_start_fragment_toolbar);<NEW_LINE>TextView title = view.findViewById(R.id.payments_recovery_start_fragment_title);<NEW_LINE>LearnMoreTextView message = view.findViewById(R.id.payments_recovery_start_fragment_message);<NEW_LINE>TextView startButton = view.findViewById(R.id.payments_recovery_start_fragment_start);<NEW_LINE>TextView pasteButton = view.findViewById(R.id.payments_recovery_start_fragment_paste);<NEW_LINE>PaymentsRecoveryStartFragmentArgs args = <MASK><NEW_LINE>if (args.getIsRestore()) {<NEW_LINE>title.setText(R.string.PaymentsRecoveryStartFragment__enter_recovery_phrase);<NEW_LINE>message.setText(getString(R.string.PaymentsRecoveryStartFragment__your_recovery_phrase_is_a, PaymentsConstants.MNEMONIC_LENGTH));<NEW_LINE>message.setLink(getString(R.string.PaymentsRecoveryStartFragment__learn_more__restore));<NEW_LINE>startButton.setOnClickListener(v -> SafeNavigation.safeNavigate(Navigation.findNavController(requireView()), PaymentsRecoveryStartFragmentDirections.actionPaymentsRecoveryStartToPaymentsRecoveryEntry()));<NEW_LINE>startButton.setText(R.string.PaymentsRecoveryStartFragment__enter_manually);<NEW_LINE>pasteButton.setVisibility(View.VISIBLE);<NEW_LINE>pasteButton.setOnClickListener(v -> SafeNavigation.safeNavigate(Navigation.findNavController(v), PaymentsRecoveryStartFragmentDirections.actionPaymentsRecoveryStartToPaymentsRecoveryPaste()));<NEW_LINE>} else {<NEW_LINE>title.setText(R.string.PaymentsRecoveryStartFragment__view_recovery_phrase);<NEW_LINE>message.setText(getString(R.string.PaymentsRecoveryStartFragment__your_balance_will_automatically_restore, PaymentsConstants.MNEMONIC_LENGTH));<NEW_LINE>message.setLink(getString(R.string.PaymentsRecoveryStartFragment__learn_more__view));<NEW_LINE>startButton.setOnClickListener(v -> SafeNavigation.safeNavigate(Navigation.findNavController(requireView()), PaymentsRecoveryStartFragmentDirections.actionPaymentsRecoveryStartToPaymentsRecoveryPhrase(args.getFinishOnConfirm())));<NEW_LINE>startButton.setText(R.string.PaymentsRecoveryStartFragment__start);<NEW_LINE>pasteButton.setVisibility(View.GONE);<NEW_LINE>}<NEW_LINE>toolbar.setNavigationOnClickListener(v -> {<NEW_LINE>if (args.getFinishOnConfirm()) {<NEW_LINE>requireActivity().finish();<NEW_LINE>} else {<NEW_LINE>Navigation.findNavController(requireView()).popBackStack();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>if (args.getFinishOnConfirm()) {<NEW_LINE>requireActivity().getOnBackPressedDispatcher().addCallback(getViewLifecycleOwner(), onBackPressed);<NEW_LINE>}<NEW_LINE>message.setLearnMoreVisible(true);<NEW_LINE>}
PaymentsRecoveryStartFragmentArgs.fromBundle(requireArguments());
663,612
private boolean initInfo() {<NEW_LINE>final IMsgBL msgBL = Services.get(IMsgBL.class);<NEW_LINE>if (!initInfoTable()) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// prepare table<NEW_LINE>final StringBuilder where = new StringBuilder("IsActive='Y'");<NEW_LINE>if (p_whereClause.length() > 0)<NEW_LINE>where.append(" AND ").append(p_whereClause);<NEW_LINE>final String sqlOrderBy = buildSqlOrderBy();<NEW_LINE>prepareTable(m_generalLayout, getTableName(), where.toString(), sqlOrderBy);<NEW_LINE>// Set & enable Fields<NEW_LINE>label1.setText(msgBL.translate(Env.getCtx(), m_queryColumns.get(0).toString()));<NEW_LINE>textField1.addActionListener(this);<NEW_LINE>if (m_queryColumns.size() > 1) {<NEW_LINE>label2.setText(Services.get(IMsgBL.class).translate(Env.getCtx(), m_queryColumns.get(1).toString()));<NEW_LINE>textField2.addActionListener(this);<NEW_LINE>} else {<NEW_LINE>label2.setVisible(false);<NEW_LINE>textField2.setVisible(false);<NEW_LINE>}<NEW_LINE>if (m_queryColumns.size() > 2) {<NEW_LINE>label3.setText(Services.get(IMsgBL.class).translate(Env.getCtx(), m_queryColumns.get(2).toString()));<NEW_LINE>textField3.addActionListener(this);<NEW_LINE>} else {<NEW_LINE>label3.setVisible(false);<NEW_LINE>textField3.setVisible(false);<NEW_LINE>}<NEW_LINE>if (m_queryColumns.size() > 3) {<NEW_LINE>label4.setText(Services.get(IMsgBL.class).translate(Env.getCtx(), m_queryColumns.get(<MASK><NEW_LINE>textField4.addActionListener(this);<NEW_LINE>} else {<NEW_LINE>label4.setVisible(false);<NEW_LINE>textField4.setVisible(false);<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
3).toString()));
1,809,345
protected boolean handleCamelException(Exchange exchange, DelegateExecution execution, boolean isV5Execution) {<NEW_LINE>Exception camelException = exchange.getException();<NEW_LINE>boolean notHandledByCamel = exchange.isFailed() && camelException != null;<NEW_LINE>if (notHandledByCamel) {<NEW_LINE>if (camelException instanceof BpmnError) {<NEW_LINE>if (isV5Execution) {<NEW_LINE><MASK><NEW_LINE>compatibilityHandler.propagateError((BpmnError) camelException, execution);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>ErrorPropagation.propagateError((BpmnError) camelException, execution);<NEW_LINE>return true;<NEW_LINE>} else {<NEW_LINE>if (isV5Execution) {<NEW_LINE>Flowable5CompatibilityHandler ompatibilityHandler = Flowable5Util.getFlowable5CompatibilityHandler();<NEW_LINE>if (ompatibilityHandler.mapException(camelException, execution, mapExceptions)) {<NEW_LINE>return true;<NEW_LINE>} else {<NEW_LINE>throw new FlowableException("Unhandled exception on camel route", camelException);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (ErrorPropagation.mapException(camelException, (ExecutionEntity) execution, mapExceptions)) {<NEW_LINE>return true;<NEW_LINE>} else {<NEW_LINE>throw new FlowableException("Unhandled exception on camel route", camelException);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
Flowable5CompatibilityHandler compatibilityHandler = Flowable5Util.getFlowable5CompatibilityHandler();
845,505
private static void startWorkManagerService(Class<?> serviceClass, List<Class<?>> features, int port, CompletableFuture<Integer> portFuture) {<NEW_LINE>ResourceConfig rcWork = new ResourceConfig(serviceClass).register(ExceptionMapper.class);<NEW_LINE>for (Class<?> feature : features) {<NEW_LINE>_logger.infof("Registering feature %s", feature.getSimpleName());<NEW_LINE>rcWork.register(feature);<NEW_LINE>}<NEW_LINE>HttpServer server;<NEW_LINE>if (_settings.getSslWorkDisable()) {<NEW_LINE>URI workMgrUri = UriBuilder.fromUri("http://" + _settings.getWorkBindHost()).port(port).build();<NEW_LINE>_logger.<MASK><NEW_LINE>server = GrizzlyHttpServerFactory.createHttpServer(workMgrUri, rcWork);<NEW_LINE>} else {<NEW_LINE>URI workMgrUri = UriBuilder.fromUri("https://" + _settings.getWorkBindHost()).port(port).build();<NEW_LINE>_logger.infof("Starting work manager at %s\n", workMgrUri);<NEW_LINE>server = CommonUtil.startSslServer(rcWork, workMgrUri, _settings.getSslWorkKeystoreFile(), _settings.getSslWorkKeystorePassword(), _settings.getSslWorkTrustAllCerts(), _settings.getSslWorkTruststoreFile(), _settings.getSslWorkTruststorePassword(), ConfigurationLocator.class, Main.class);<NEW_LINE>}<NEW_LINE>int selectedListenPort = server.getListeners().iterator().next().getPort();<NEW_LINE>URI actualWorkMgrUri = UriBuilder.fromUri("http://" + _settings.getWorkBindHost()).port(selectedListenPort).build();<NEW_LINE>_logger.infof("Started work manager at %s\n", actualWorkMgrUri);<NEW_LINE>if (!portFuture.isDone()) {<NEW_LINE>portFuture.complete(selectedListenPort);<NEW_LINE>}<NEW_LINE>}
infof("Starting work manager %s at %s\n", serviceClass, workMgrUri);
1,285,979
private void unclose(final I_PP_Order ppOrder) {<NEW_LINE>ModelValidationEngine.get().fireDocValidate(ppOrder, ModelValidator.TIMING_BEFORE_UNCLOSE);<NEW_LINE>//<NEW_LINE>// Unclose PP_Order's Qty<NEW_LINE>ppOrderBL.uncloseQtyOrdered(ppOrder);<NEW_LINE>ppOrdersRepo.save(ppOrder);<NEW_LINE>//<NEW_LINE>// Unclose PP_Order BOM Line's quantities<NEW_LINE>final List<I_PP_Order_BOMLine> lines = ppOrderBOMDAO.retrieveOrderBOMLines(ppOrder);<NEW_LINE>for (final I_PP_Order_BOMLine line : lines) {<NEW_LINE>ppOrderBOMBL.unclose(line);<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// Unclose activities<NEW_LINE>final PPOrderId ppOrderId = PPOrderId.ofRepoId(ppOrder.getPP_Order_ID());<NEW_LINE>ppOrderBL.uncloseActivities(ppOrderId);<NEW_LINE>// firing this before having updated the docstatus. This is how the *real* DocActions like MInvoice do it too.<NEW_LINE>ModelValidationEngine.get().fireDocValidate(ppOrder, ModelValidator.TIMING_AFTER_UNCLOSE);<NEW_LINE>//<NEW_LINE>// Update DocStatus<NEW_LINE><MASK><NEW_LINE>ppOrder.setDocAction(IDocument.ACTION_Close);<NEW_LINE>ppOrdersRepo.save(ppOrder);<NEW_LINE>//<NEW_LINE>// Reverse ALL cost collectors<NEW_LINE>reverseCostCollectorsGeneratedOnClose(ppOrderId);<NEW_LINE>}
ppOrder.setDocStatus(IDocument.STATUS_Completed);
626,801
public boolean decomposeMetricCamera(DMatrixRMaj cameraMatrix, DMatrixRMaj K, Se3_F64 worldToView) {<NEW_LINE>CommonOps_DDRM.extract(cameraMatrix, 0, 3, 0, 3, A, 0, 0);<NEW_LINE>worldToView.T.setTo(cameraMatrix.get(0, 3), cameraMatrix.get(1, 3), cameraMatrix.get(2, 3));<NEW_LINE>CommonOps_DDRM.mult(Pv, A, A_p);<NEW_LINE>CommonOps_DDRM.transpose(A_p);<NEW_LINE>if (!qr.decompose(A_p))<NEW_LINE>return false;<NEW_LINE>// extract the rotation using RQ decomposition (via a pivoted QR)<NEW_LINE>qr.getQ(A, false);<NEW_LINE>CommonOps_DDRM.multTransB(Pv, A, worldToView.R);<NEW_LINE>// extract the calibration matrix<NEW_LINE>qr.getR(K, false);<NEW_LINE>CommonOps_DDRM.multTransB(Pv, K, A);<NEW_LINE>CommonOps_DDRM.<MASK><NEW_LINE>// there are four solutions, massage it so that it's the correct one.<NEW_LINE>// each of these row/column negations produces the same camera matrix<NEW_LINE>for (int i = 0; i < 3; i++) {<NEW_LINE>if (K.get(i, i) < 0) {<NEW_LINE>CommonOps_DDRM.scaleCol(-1, K, i);<NEW_LINE>CommonOps_DDRM.scaleRow(-1, worldToView.R, i);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// rotation matrices have det() == 1<NEW_LINE>if (CommonOps_DDRM.det(worldToView.R) < 0) {<NEW_LINE>CommonOps_DDRM.scale(-1, worldToView.R);<NEW_LINE>worldToView.T.scale(-1);<NEW_LINE>}<NEW_LINE>// save the scale so that T is scaled correctly. This is important when upgrading common projective cameras<NEW_LINE>double scale = K.get(2, 2);<NEW_LINE>// make sure it's a proper camera matrix and this is more numerically stable to invert<NEW_LINE>CommonOps_DDRM.divide(K, scale);<NEW_LINE>// could do a very fast triangulate inverse. EJML doesn't have one for upper triangle, yet.<NEW_LINE>if (!CommonOps_DDRM.invert(K, A))<NEW_LINE>return false;<NEW_LINE>GeometryMath_F64.mult(A, worldToView.T, worldToView.T);<NEW_LINE>worldToView.T.divide(scale);<NEW_LINE>return true;<NEW_LINE>}
mult(A, Pv, K);
407,420
public void add(int index, Dependency dependency) {<NEW_LINE>if (index > size() || index < 0) {<NEW_LINE>throw new IndexOutOfBoundsException("Index: " + index + ", Size: " + size());<NEW_LINE>}<NEW_LINE>int elementIndex = index;<NEW_LINE>if (index > 0) {<NEW_LINE>Element previousElement = ((JDomDependency) get(index - 1)).getJDomElement();<NEW_LINE>elementIndex = 1 + getElementIndex(previousElement, jdomElement);<NEW_LINE>}<NEW_LINE>if (jdomElement.getParent() == null) {<NEW_LINE>addElement(jdomElement, parent.getJDomElement());<NEW_LINE>}<NEW_LINE>if (parent instanceof JDomDependencyManagement) {<NEW_LINE>if (parent.getJDomElement().getParent() == null) {<NEW_LINE>addElement(this.parent.getJDomElement(), ((JDomDependencyManagement) parent).getParent().getJDomElement());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>JDomDependency jdomDependency;<NEW_LINE>if (dependency instanceof JDomDependency) {<NEW_LINE>jdomDependency = (JDomDependency) dependency;<NEW_LINE>addElement(jdomDependency.getJDomElement().clone(), jdomElement, elementIndex);<NEW_LINE>} else {<NEW_LINE>Element newElement = insertNewElement(POM_ELEMENT_DEPENDENCY, jdomElement, elementIndex);<NEW_LINE>jdomDependency = new JDomDependency(newElement, dependency);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>}
super.add(index, jdomDependency);
351,406
private int processBlock192or256(byte[] in, int inOff, byte[] out, int outOff) {<NEW_LINE>int[] state = new int[4];<NEW_LINE>for (int i = 0; i < 4; i++) {<NEW_LINE>state[i] = bytes2int(in, inOff + (i * 4)) ^ kw[i];<NEW_LINE>}<NEW_LINE>camelliaF2(state, subkey, 0);<NEW_LINE>camelliaF2(state, subkey, 4);<NEW_LINE>camelliaF2(state, subkey, 8);<NEW_LINE>camelliaFLs(state, ke, 0);<NEW_LINE>camelliaF2(state, subkey, 12);<NEW_LINE>camelliaF2(state, subkey, 16);<NEW_LINE>camelliaF2(state, subkey, 20);<NEW_LINE>camelliaFLs(state, ke, 4);<NEW_LINE>camelliaF2(state, subkey, 24);<NEW_LINE>camelliaF2(state, subkey, 28);<NEW_LINE>camelliaF2(state, subkey, 32);<NEW_LINE>camelliaFLs(state, ke, 8);<NEW_LINE>camelliaF2(state, subkey, 36);<NEW_LINE>camelliaF2(state, subkey, 40);<NEW_LINE>camelliaF2(state, subkey, 44);<NEW_LINE>state[2] ^= kw[4];<NEW_LINE>state[3] ^= kw[5];<NEW_LINE>state[0] ^= kw[6];<NEW_LINE>state<MASK><NEW_LINE>int2bytes(state[2], out, outOff);<NEW_LINE>int2bytes(state[3], out, outOff + 4);<NEW_LINE>int2bytes(state[0], out, outOff + 8);<NEW_LINE>int2bytes(state[1], out, outOff + 12);<NEW_LINE>return BLOCK_SIZE;<NEW_LINE>}
[1] ^= kw[7];
940,915
public static DescribeInstanceSpecificationsResponse unmarshall(DescribeInstanceSpecificationsResponse describeInstanceSpecificationsResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeInstanceSpecificationsResponse.setRequestId(_ctx.stringValue("DescribeInstanceSpecificationsResponse.RequestId"));<NEW_LINE>describeInstanceSpecificationsResponse.setCode(_ctx.stringValue("DescribeInstanceSpecificationsResponse.Code"));<NEW_LINE>describeInstanceSpecificationsResponse.setMessage(_ctx.stringValue("DescribeInstanceSpecificationsResponse.Message"));<NEW_LINE>describeInstanceSpecificationsResponse.setSuccess(_ctx.booleanValue("DescribeInstanceSpecificationsResponse.Success"));<NEW_LINE>describeInstanceSpecificationsResponse.setErrorCode(_ctx.stringValue("DescribeInstanceSpecificationsResponse.ErrorCode"));<NEW_LINE>describeInstanceSpecificationsResponse.setTraceId(_ctx.stringValue("DescribeInstanceSpecificationsResponse.TraceId"));<NEW_LINE>List<DataItem> data = new ArrayList<DataItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeInstanceSpecificationsResponse.Data.Length"); i++) {<NEW_LINE>DataItem dataItem = new DataItem();<NEW_LINE>dataItem.setCpu(_ctx.integerValue("DescribeInstanceSpecificationsResponse.Data[" + i + "].Cpu"));<NEW_LINE>dataItem.setEnable(_ctx.booleanValue("DescribeInstanceSpecificationsResponse.Data[" + i + "].Enable"));<NEW_LINE>dataItem.setId(_ctx.integerValue("DescribeInstanceSpecificationsResponse.Data[" + i + "].Id"));<NEW_LINE>dataItem.setMemory(_ctx.integerValue<MASK><NEW_LINE>dataItem.setSpecInfo(_ctx.stringValue("DescribeInstanceSpecificationsResponse.Data[" + i + "].SpecInfo"));<NEW_LINE>dataItem.setVersion(_ctx.integerValue("DescribeInstanceSpecificationsResponse.Data[" + i + "].Version"));<NEW_LINE>data.add(dataItem);<NEW_LINE>}<NEW_LINE>describeInstanceSpecificationsResponse.setData(data);<NEW_LINE>return describeInstanceSpecificationsResponse;<NEW_LINE>}
("DescribeInstanceSpecificationsResponse.Data[" + i + "].Memory"));
1,217,679
public void insertConditionalFrequentItems(List<ItemsetWithCount> patterns, int countRequiredForSupport) {<NEW_LINE>Map<Integer, Double> itemCounts = new HashMap<>();<NEW_LINE>for (ItemsetWithCount i : patterns) {<NEW_LINE>for (Integer item : i.getItems()) {<NEW_LINE>itemCounts.compute(item, (k, v) -> v == null ? i.getCount() : v + i.getCount());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (Map.Entry<Integer, Double> e : itemCounts.entrySet()) {<NEW_LINE>if (e.getValue() >= countRequiredForSupport) {<NEW_LINE>frequentItemCounts.put(e.getKey(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>// we have to materialize a canonical order so that items with equal counts<NEW_LINE>// are consistently ordered when they are sorted during transaction insertion<NEW_LINE>List<Map.Entry<Integer, Double>> sortedItemCounts = Lists.newArrayList(frequentItemCounts.entrySet());<NEW_LINE>sortedItemCounts.sort((i1, i2) -> frequentItemCounts.get(i1.getKey()).compareTo(frequentItemCounts.get(i2.getKey())));<NEW_LINE>for (int i = 0; i < sortedItemCounts.size(); ++i) {<NEW_LINE>frequentItemOrder.put(sortedItemCounts.get(i).getKey(), i);<NEW_LINE>}<NEW_LINE>}
), e.getValue());
1,238,223
protected QuantileResult quantile(double level, DoubleArray sample, boolean isExtrapolated) {<NEW_LINE>ArgChecker.isTrue(level > 0, "Quantile should be above 0.");<NEW_LINE>ArgChecker.isTrue(level < 1, "Quantile should be below 1.");<NEW_LINE>int sampleSize = sampleCorrection(sample.size());<NEW_LINE>double adjustedLevel = checkIndex(level * sampleSize + indexCorrection(), sample.size(), isExtrapolated);<NEW_LINE>double[] order = createIndexArray(sample.size());<NEW_LINE>double[] s = sample.toArray();<NEW_LINE>DoubleArrayMath.sortPairs(s, order);<NEW_LINE>int lowerIndex = (int) Math.floor(adjustedLevel);<NEW_LINE>int upperIndex = (<MASK><NEW_LINE>double lowerWeight = upperIndex - adjustedLevel;<NEW_LINE>double upperWeight = 1d - lowerWeight;<NEW_LINE>return QuantileResult.of(lowerWeight * s[lowerIndex - 1] + upperWeight * s[upperIndex - 1], new int[] { (int) order[lowerIndex - 1], (int) order[upperIndex - 1] }, DoubleArray.of(lowerWeight, upperWeight));<NEW_LINE>}
int) Math.ceil(adjustedLevel);
1,351,294
public static void grayToBuffered(GrayF32 src, DataBufferInt buffer, WritableRaster dst) {<NEW_LINE>final float[] srcData = src.data;<NEW_LINE>final int[] dstData = buffer.getData();<NEW_LINE>final <MASK><NEW_LINE>if (numBands == 3) {<NEW_LINE>// CONCURRENT_BELOW BoofConcurrency.loopFor(0, src.height, y -> {<NEW_LINE>for (int y = 0; y < src.height; y++) {<NEW_LINE>int indexSrc = src.startIndex + y * src.stride;<NEW_LINE>int indexDst = y * src.width;<NEW_LINE>for (int x = 0; x < src.width; x++) {<NEW_LINE>int v = (int) srcData[indexSrc++];<NEW_LINE>dstData[indexDst++] = v << 16 | v << 8 | v;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// CONCURRENT_ABOVE });<NEW_LINE>} else if (numBands == 4) {<NEW_LINE>// CONCURRENT_BELOW BoofConcurrency.loopFor(0, src.height, y -> {<NEW_LINE>for (int y = 0; y < src.height; y++) {<NEW_LINE>int indexSrc = src.startIndex + y * src.stride;<NEW_LINE>int indexDst = y * src.width;<NEW_LINE>for (int x = 0; x < src.width; x++) {<NEW_LINE>int v = (int) srcData[indexSrc++];<NEW_LINE>dstData[indexDst++] = 0xFF << 24 | v << 16 | v << 8 | v;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// CONCURRENT_ABOVE });<NEW_LINE>} else {<NEW_LINE>throw new RuntimeException("Code more here");<NEW_LINE>}<NEW_LINE>}
int numBands = dst.getNumBands();
180,147
private void presentActionDone() {<NEW_LINE>switch(model.getOperation()) {<NEW_LINE>case UNINSTALL:<NEW_LINE>component.setHeadAndContent(<MASK><NEW_LINE>break;<NEW_LINE>case ENABLE:<NEW_LINE>component.setHeadAndContent(UninstallStep_Header_ActivateDone_Head(), UninstallStep_Header_ActivateDone_Content());<NEW_LINE>break;<NEW_LINE>case DISABLE:<NEW_LINE>component.setHeadAndContent(UninstallStep_Header_DeactivateDone_Head(), UninstallStep_Header_DeactivateDone_Content());<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>assert false : "Unknown OperationType " + model.getOperation();<NEW_LINE>}<NEW_LINE>model.modifyOptionsForDoClose(wd);<NEW_LINE>switch(model.getOperation()) {<NEW_LINE>case UNINSTALL:<NEW_LINE>panel.setBody(UninstallStep_UninstallDone_Text(), model.getAllVisibleUpdateElements());<NEW_LINE>break;<NEW_LINE>case ENABLE:<NEW_LINE>panel.setBody(UninstallStep_ActivateDone_Text(), model.getAllVisibleUpdateElements());<NEW_LINE>break;<NEW_LINE>case DISABLE:<NEW_LINE>panel.setBody(UninstallStep_DeactivateDone_Text(), model.getAllVisibleUpdateElements());<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>assert false : "Unknown OperationType " + model.getOperation();<NEW_LINE>}<NEW_LINE>}
UninstallStep_Header_UninstallDone_Head(), UninstallStep_Header_UninstallDone_Content());
720,589
private MQTT createClient() throws Exception {<NEW_LINE>LOG.debug("Creating MQTT client to {}", getServerUri());<NEW_LINE>MQTT client = new MQTT();<NEW_LINE>client.setHost(getServerUri());<NEW_LINE>if (getUsername() != null) {<NEW_LINE>LOG.debug("MQTT client uses username {}", getUsername());<NEW_LINE>client.setUserName(getUsername());<NEW_LINE>client.setPassword(getPassword());<NEW_LINE>}<NEW_LINE>if (getClientId() != null) {<NEW_LINE>String clientId = getClientId() + "-" + UUID<MASK><NEW_LINE>clientId = clientId.substring(0, Math.min(clientId.length(), MQTT_3_1_MAX_CLIENT_ID_LENGTH));<NEW_LINE>LOG.debug("MQTT client id set to {}", clientId);<NEW_LINE>client.setClientId(clientId);<NEW_LINE>} else {<NEW_LINE>String clientId = UUID.randomUUID().toString();<NEW_LINE>clientId = clientId.substring(0, Math.min(clientId.length(), MQTT_3_1_MAX_CLIENT_ID_LENGTH));<NEW_LINE>LOG.debug("MQTT client id set to random value {}", clientId);<NEW_LINE>client.setClientId(clientId);<NEW_LINE>}<NEW_LINE>return client;<NEW_LINE>}
.randomUUID().toString();
531,955
private synchronized long offer(final BiFunction<LogBufferPartition, Integer, Integer> claimer, final int fragmentCount, final int length) {<NEW_LINE>long newPosition = -1;<NEW_LINE>if (!isClosed) {<NEW_LINE>final <MASK><NEW_LINE>final int activePartitionId = logBuffer.getActivePartitionIdVolatile();<NEW_LINE>final LogBufferPartition partition = logBuffer.getPartition(activePartitionId);<NEW_LINE>final int partitionOffset = partition.getTailCounterVolatile();<NEW_LINE>final long position = position(activePartitionId, partitionOffset);<NEW_LINE>if (position < limit) {<NEW_LINE>final int newOffset;<NEW_LINE>if (length < maxFragmentLength) {<NEW_LINE>newOffset = claimer.apply(partition, activePartitionId);<NEW_LINE>} else {<NEW_LINE>throw new IllegalArgumentException(String.format(ERROR_MESSAGE_CLAIM_FAILED, length, maxFragmentLength));<NEW_LINE>}<NEW_LINE>newPosition = updatePublisherPosition(activePartitionId, newOffset);<NEW_LINE>// if successful, replace internal publisher position with simple counter and return it<NEW_LINE>if (newPosition > 0) {<NEW_LINE>newPosition = recordPosition;<NEW_LINE>recordPosition += fragmentCount;<NEW_LINE>}<NEW_LINE>signalSubscriptions();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return newPosition;<NEW_LINE>}
long limit = publisherLimit.get();
1,025,494
protected void authenticate(SecurityFilter.FilterContext context, SecurityContext securityContext, AtnTracing atnTracing) {<NEW_LINE>try {<NEW_LINE>SecurityDefinition methodSecurity = context.getMethodSecurity();<NEW_LINE>if (methodSecurity.requiresAuthentication()) {<NEW_LINE>// authenticate request<NEW_LINE>SecurityClientBuilder<AuthenticationResponse> clientBuilder = securityContext.atnClientBuilder().optional(methodSecurity.authenticationOptional()).tracingSpan(atnTracing.findParent().orElse(null));<NEW_LINE>clientBuilder.explicitProvider(methodSecurity.getAuthenticator());<NEW_LINE>processAuthentication(context, clientBuilder, methodSecurity, atnTracing);<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>if (context.isTraceSuccess()) {<NEW_LINE>securityContext.user().ifPresent(atnTracing::logUser);<NEW_LINE>securityContext.service(<MASK><NEW_LINE>atnTracing.finish();<NEW_LINE>} else {<NEW_LINE>Throwable ctxThrowable = context.getTraceThrowable();<NEW_LINE>if (null == ctxThrowable) {<NEW_LINE>atnTracing.error(context.getTraceDescription());<NEW_LINE>} else {<NEW_LINE>atnTracing.error(ctxThrowable);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
).ifPresent(atnTracing::logService);
1,249,416
private double moonCorrection(double jd, double t, double k) {<NEW_LINE>jd += .000325 * SN(299.77 + .107408 * k - .009173 * t * t) + .000165 * SN(251.88 + .016321 * k) + .000164 * SN(251.83 + 26.651886 * k) + .000126 * SN(349.42 + 36.412478 * k) + .00011 * SN(84.66 + 18.206239 * k);<NEW_LINE>jd += .000062 * SN(141.74 + 53.303771 * k) + .00006 * SN(207.14 + 2.453732 * k) + .000056 * SN(154.84 + 7.30686 * k) + .000047 * SN(34.52 + 27.261239 * k) + .000042 * SN(207.19 + .121824 * k) + .00004 * SN(291.34 + 1.844379 * k);<NEW_LINE>jd += .000037 * SN(161.72 + 24.198154 * k) + .000035 * SN(239.56 + 25.513099 * k) + .000023 * <MASK><NEW_LINE>return jd;<NEW_LINE>}
SN(331.55 + 3.592518 * k);
899,735
public void actionPerformed(ActionEvent e) {<NEW_LINE>GhidraFileChooser fileChooser = new GhidraFileChooser(component);<NEW_LINE>fileChooser.setFileSelectionMode(GhidraFileChooser.DIRECTORIES_ONLY);<NEW_LINE>fileChooser.setTitle("Select Directory Containing XML Files");<NEW_LINE>String baseDir = Preferences.getProperty(PATTERN_INFO_DIR);<NEW_LINE>if (baseDir != null) {<NEW_LINE>fileChooser.setCurrentDirectory(new File(baseDir));<NEW_LINE>}<NEW_LINE>File xmlDir = fileChooser.getSelectedFile();<NEW_LINE>if (xmlDir == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Preferences.setProperty(<MASK><NEW_LINE>Preferences.store();<NEW_LINE>patternReader = new FileBitPatternInfoReader(xmlDir, component);<NEW_LINE>if (patternReader.getDataGatheringParams() == null) {<NEW_LINE>Msg.showWarn(this, component, "Missing Data Gathering Parameters", "No Data Gathering Parameters Read");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>dataSourceField.setText(xmlDir.getAbsolutePath());<NEW_LINE>updatePanel();<NEW_LINE>}
PATTERN_INFO_DIR, xmlDir.getAbsolutePath());
791,499
private void generateRSS1(final CreativeCommons module, final Element element) {<NEW_LINE>// throw new RuntimeException( "Generating RSS1 Feeds not currently Supported.");<NEW_LINE>LOG.debug(element.getName());<NEW_LINE>if (element.getName().equals("channel")) {<NEW_LINE>// Do all licenses list.<NEW_LINE>final License[] all = module.getAllLicenses();<NEW_LINE>for (final License element2 : all) {<NEW_LINE>final Element license <MASK><NEW_LINE>license.setAttribute("about", element2.getValue(), RDF);<NEW_LINE>final License.Behaviour[] permits = element2.getPermits();<NEW_LINE>for (int j = 0; permits != null && j < permits.length; j++) {<NEW_LINE>final Element permit = new Element("permits", RSS1);<NEW_LINE>permit.setAttribute("resource", permits[j].toString(), RDF);<NEW_LINE>license.addContent(permit);<NEW_LINE>}<NEW_LINE>final License.Behaviour[] requires = element2.getPermits();<NEW_LINE>for (int j = 0; requires != null && j < requires.length; j++) {<NEW_LINE>final Element permit = new Element("requires", RSS1);<NEW_LINE>permit.setAttribute("resource", permits[j].toString(), RDF);<NEW_LINE>license.addContent(permit);<NEW_LINE>}<NEW_LINE>LOG.debug("Is Root? {}", element.getParentElement());<NEW_LINE>element.getParentElement().addContent(license);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Do local licenses<NEW_LINE>final License[] licenses = module.getLicenses();<NEW_LINE>for (final License license2 : licenses) {<NEW_LINE>final Element license = new Element("license", RSS1);<NEW_LINE>license.setAttribute("resource", license2.getValue(), RDF);<NEW_LINE>element.addContent(license);<NEW_LINE>}<NEW_LINE>}
= new Element("License", RSS1);
1,212,135
public boolean apply(@Nullable PredicateKey input) {<NEW_LINE>if (!enabled.getOrDefault()) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>String serverZone = input.getServer().getZone();<NEW_LINE>if (serverZone == null) {<NEW_LINE>// there is no zone information from the server, we do not want to filter<NEW_LINE>// out this server<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>LoadBalancerStats lbStats = getLBStats();<NEW_LINE>if (lbStats == null) {<NEW_LINE>// no stats available, do not filter<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>if (lbStats.getAvailableZones().size() <= 1) {<NEW_LINE>// only one zone is available, do not filter<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>Map<String, ZoneSnapshot> zoneSnapshot = ZoneAvoidanceRule.createSnapshot(lbStats);<NEW_LINE>if (!zoneSnapshot.keySet().contains(serverZone)) {<NEW_LINE>// The server zone is unknown to the load balancer, do not filter it out<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>Set<String> availableZones = ZoneAvoidanceRule.getAvailableZones(zoneSnapshot, triggeringLoad.getOrDefault(), triggeringBlackoutPercentage.getOrDefault());<NEW_LINE>logger.debug("Available zones: {}", availableZones);<NEW_LINE>if (availableZones != null) {<NEW_LINE>return availableZones.contains(input.getServer().getZone());<NEW_LINE>} else {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}
logger.debug("Zone snapshots: {}", zoneSnapshot);
1,072,254
public void run(RegressionEnvironment env) {<NEW_LINE>// Bean<NEW_LINE>Consumer<Boolean> bean = hasValue -> {<NEW_LINE>env.sendEventBean(new LocalEvent(hasValue ? new LocalInnerEvent() : null));<NEW_LINE>};<NEW_LINE>String beanepl = "@public @buseventtype create schema LocalEvent as " + LocalEvent.class.getName() + ";\n";<NEW_LINE>runAssertion(env, beanepl, bean);<NEW_LINE>// Map<NEW_LINE>Consumer<Boolean> map = hasValue -> {<NEW_LINE>env.sendEventMap(Collections.singletonMap("property", hasValue ? Collections.emptyMap<MASK><NEW_LINE>};<NEW_LINE>String mapepl = "@public @buseventtype create schema LocalInnerEvent();\n" + "@public @buseventtype create schema LocalEvent(property LocalInnerEvent);\n";<NEW_LINE>runAssertion(env, mapepl, map);<NEW_LINE>// Object-array<NEW_LINE>Consumer<Boolean> oa = hasValue -> {<NEW_LINE>env.sendEventObjectArray(new Object[] { hasValue ? new Object[0] : null }, "LocalEvent");<NEW_LINE>};<NEW_LINE>String oaepl = "@public @buseventtype create objectarray schema LocalInnerEvent();\n" + "@public @buseventtype create objectarray schema LocalEvent(property LocalInnerEvent);\n";<NEW_LINE>runAssertion(env, oaepl, oa);<NEW_LINE>// Json<NEW_LINE>Consumer<Boolean> json = hasValue -> {<NEW_LINE>env.sendEventJson(new JsonObject().add("property", hasValue ? new JsonObject() : Json.NULL).toString(), "LocalEvent");<NEW_LINE>};<NEW_LINE>String jsonepl = "@public @buseventtype create json schema LocalInnerEvent();\n" + "@public @buseventtype create json schema LocalEvent(property LocalInnerEvent);\n";<NEW_LINE>runAssertion(env, jsonepl, json);<NEW_LINE>// Json-Class-Provided<NEW_LINE>String jsonprovidedepl = "@JsonSchema(className='" + MyLocalJsonProvided.class.getName() + "') @public @buseventtype create json schema LocalEvent();\n";<NEW_LINE>runAssertion(env, jsonprovidedepl, json);<NEW_LINE>// Avro<NEW_LINE>Consumer<Boolean> avro = hasValue -> {<NEW_LINE>Schema schema = env.runtimeAvroSchemaByDeployment("schema", "LocalEvent");<NEW_LINE>GenericData.Record theEvent = new GenericData.Record(schema);<NEW_LINE>theEvent.put("property", hasValue ? new GenericData.Record(schema.getField("property").schema()) : null);<NEW_LINE>env.sendEventAvro(theEvent, "LocalEvent");<NEW_LINE>};<NEW_LINE>String avroepl = "@public @buseventtype create avro schema LocalInnerEvent();\n" + "@name('schema') @public @buseventtype create avro schema LocalEvent(property LocalInnerEvent);\n";<NEW_LINE>runAssertion(env, avroepl, avro);<NEW_LINE>}
() : null), "LocalEvent");
1,285,333
public static void process_sub(GrayS16 orig, GrayS16 derivX, GrayS16 derivY) {<NEW_LINE>final short[] data = orig.data;<NEW_LINE>final short[] imgX = derivX.data;<NEW_LINE>final short[] imgY = derivY.data;<NEW_LINE>final int width = orig.getWidth();<NEW_LINE>final int height = orig.getHeight() - 1;<NEW_LINE>final int strideSrc = orig.getStride();<NEW_LINE>// CONCURRENT_BELOW BoofConcurrency.loopFor(1,height,y->{<NEW_LINE>for (int y = 1; y < height; y++) {<NEW_LINE>int indexSrc = orig.startIndex + orig.stride * y + 1;<NEW_LINE>final int endX = indexSrc + width - 2;<NEW_LINE>int indexX = derivX.startIndex <MASK><NEW_LINE>int indexY = derivY.startIndex + derivY.stride * y + 1;<NEW_LINE>for (; indexSrc < endX; indexSrc++) {<NEW_LINE>int v = data[indexSrc + strideSrc + 1] - data[indexSrc - strideSrc - 1];<NEW_LINE>int w = data[indexSrc + strideSrc - 1] - data[indexSrc - strideSrc + 1];<NEW_LINE>imgY[indexY++] = (short) ((data[indexSrc + strideSrc] - data[indexSrc - strideSrc]) * 2 + v + w);<NEW_LINE>imgX[indexX++] = (short) ((data[indexSrc + 1] - data[indexSrc - 1]) * 2 + v - w);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// CONCURRENT_ABOVE });<NEW_LINE>}
+ derivX.stride * y + 1;
1,491,222
public static void buildOATypes(EventTypeRepositoryImpl repo, Map<String, ConfigurationCommonEventTypeObjectArray> objectArrayTypeConfigurations, Map<String, Map<String, Object>> nestableObjectArrayNames, BeanEventTypeFactory beanEventTypeFactory, ClasspathImportService classpathImportService) {<NEW_LINE>List<String> creationOrder = EventTypeRepositoryUtil.getCreationOrder(Collections.emptySet(), nestableObjectArrayNames.keySet(), objectArrayTypeConfigurations);<NEW_LINE>for (String objectArrayName : creationOrder) {<NEW_LINE>if (repo.getTypeByName(objectArrayName) != null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>ConfigurationCommonEventTypeObjectArray objectArrayConfig = objectArrayTypeConfigurations.get(objectArrayName);<NEW_LINE>Map<String, Object> propertyTypes = nestableObjectArrayNames.get(objectArrayName);<NEW_LINE><MASK><NEW_LINE>LinkedHashMap<String, Object> propertyTypesCompiled = EventTypeUtility.compileMapTypeProperties(propertyTypes, repo);<NEW_LINE>addNestableObjectArrayType(objectArrayName, propertyTypesCompiled, objectArrayConfig, beanEventTypeFactory, repo);<NEW_LINE>}<NEW_LINE>}
propertyTypes = resolveClassesForStringPropertyTypes(propertyTypes, classpathImportService);
1,511,898
public void marshall(UpdateLaunchProfileRequest updateLaunchProfileRequest, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (updateLaunchProfileRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(updateLaunchProfileRequest.getClientToken(), CLIENTTOKEN_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateLaunchProfileRequest.getDescription(), DESCRIPTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateLaunchProfileRequest.getLaunchProfileId(), LAUNCHPROFILEID_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateLaunchProfileRequest.getLaunchProfileProtocolVersions(), LAUNCHPROFILEPROTOCOLVERSIONS_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateLaunchProfileRequest.getName(), NAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateLaunchProfileRequest.getStreamConfiguration(), STREAMCONFIGURATION_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(updateLaunchProfileRequest.getStudioId(), STUDIOID_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
updateLaunchProfileRequest.getStudioComponentIds(), STUDIOCOMPONENTIDS_BINDING);
1,684,513
final UpdateEventSourceMappingResult executeUpdateEventSourceMapping(UpdateEventSourceMappingRequest updateEventSourceMappingRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateEventSourceMappingRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateEventSourceMappingRequest> request = null;<NEW_LINE>Response<UpdateEventSourceMappingResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateEventSourceMappingRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateEventSourceMappingRequest));<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, "Lambda");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateEventSourceMapping");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateEventSourceMappingResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateEventSourceMappingResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
832,323
protected void onBindRowViewHolder(RowPresenter.ViewHolder holder, Object item) {<NEW_LINE><MASK><NEW_LINE>ViewHolder vh = (ViewHolder) holder;<NEW_LINE>PlaybackControlsRow row = (PlaybackControlsRow) vh.getRow();<NEW_LINE>if (row.getItem() == null) {<NEW_LINE>vh.mDescriptionDock.setVisibility(View.GONE);<NEW_LINE>} else {<NEW_LINE>vh.mDescriptionDock.setVisibility(View.VISIBLE);<NEW_LINE>if (vh.mDescriptionViewHolder != null) {<NEW_LINE>mDescriptionPresenter.onBindViewHolder(vh.mDescriptionViewHolder, row.getItem());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (row.getImageDrawable() == null) {<NEW_LINE>vh.mImageView.setVisibility(View.GONE);<NEW_LINE>} else {<NEW_LINE>vh.mImageView.setVisibility(View.VISIBLE);<NEW_LINE>}<NEW_LINE>vh.mImageView.setImageDrawable(row.getImageDrawable());<NEW_LINE>vh.mControlsBoundData.adapter = row.getPrimaryActionsAdapter();<NEW_LINE>vh.mControlsBoundData.presenter = vh.getPresenter(true);<NEW_LINE>vh.mControlsBoundData.mRowViewHolder = vh;<NEW_LINE>mPlaybackControlsPresenter.onBindViewHolder(vh.mControlsVh, vh.mControlsBoundData);<NEW_LINE>vh.mSecondaryBoundData.adapter = row.getSecondaryActionsAdapter();<NEW_LINE>vh.mSecondaryBoundData.presenter = vh.getPresenter(false);<NEW_LINE>vh.mSecondaryBoundData.mRowViewHolder = vh;<NEW_LINE>mSecondaryControlsPresenter.onBindViewHolder(vh.mSecondaryControlsVh, vh.mSecondaryBoundData);<NEW_LINE>vh.setTotalTime(row.getDuration());<NEW_LINE>vh.setCurrentPosition(row.getCurrentPosition());<NEW_LINE>vh.setBufferedPosition(row.getBufferedPosition());<NEW_LINE>row.setOnPlaybackProgressChangedListener(vh.mListener);<NEW_LINE>}
super.onBindRowViewHolder(holder, item);
372,730
public void buildDestinationRow(@NonNull View view, String timeText, final Spannable title, Spannable secondaryText, LatLon location, LinearLayout imagesContainer, OnClickListener onClickListener) {<NEW_LINE>OsmandApplication app = requireMyApplication();<NEW_LINE>FrameLayout baseItemView = new FrameLayout(view.getContext());<NEW_LINE>FrameLayout.LayoutParams baseViewLayoutParams = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);<NEW_LINE>baseItemView.setLayoutParams(baseViewLayoutParams);<NEW_LINE>LinearLayout baseView = new LinearLayout(view.getContext());<NEW_LINE>baseView.setOrientation(LinearLayout.VERTICAL);<NEW_LINE>baseView.setLayoutParams(baseViewLayoutParams);<NEW_LINE><MASK><NEW_LINE>baseView.setBackgroundResource(AndroidUtils.resolveAttribute(view.getContext(), android.R.attr.selectableItemBackground));<NEW_LINE>baseItemView.addView(baseView);<NEW_LINE>LinearLayout ll = buildHorizontalContainerView(view.getContext(), 48, new OnLongClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean onLongClick(View v) {<NEW_LINE>copyToClipboard(title.toString(), v.getContext());<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>baseView.addView(ll);<NEW_LINE>Drawable destinationIcon = app.getUIUtilities().getIcon(R.drawable.list_destination);<NEW_LINE>ImageView iconView = new ImageView(view.getContext());<NEW_LINE>iconView.setImageDrawable(destinationIcon);<NEW_LINE>FrameLayout.LayoutParams imageViewLayoutParams = new FrameLayout.LayoutParams(dpToPx(24), dpToPx(24));<NEW_LINE>iconView.setLayoutParams(imageViewLayoutParams);<NEW_LINE>iconView.setScaleType(ImageView.ScaleType.CENTER_INSIDE);<NEW_LINE>if (imagesContainer != null) {<NEW_LINE>imagesContainer.addView(iconView);<NEW_LINE>} else {<NEW_LINE>AndroidUtils.setMargins(imageViewLayoutParams, dpToPx(16), 0, dpToPx(24), 0);<NEW_LINE>baseItemView.addView(iconView);<NEW_LINE>}<NEW_LINE>LinearLayout llText = buildTextContainerView(view.getContext());<NEW_LINE>ll.addView(llText);<NEW_LINE>buildDescriptionView(secondaryText, llText, 8, 0);<NEW_LINE>buildTitleView(title, llText);<NEW_LINE>if (location != null) {<NEW_LINE>if (!TextUtils.isEmpty(destinationStreetStr)) {<NEW_LINE>if (!title.toString().equals(destinationStreetStr)) {<NEW_LINE>buildDescriptionView(new SpannableString(destinationStreetStr), llText, 4, 4);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>updateDestinationStreetName(location);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!TextUtils.isEmpty(timeText)) {<NEW_LINE>TextView timeView = new TextView(view.getContext());<NEW_LINE>FrameLayout.LayoutParams timeViewParams = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);<NEW_LINE>timeViewParams.gravity = Gravity.END | Gravity.TOP;<NEW_LINE>AndroidUtils.setMargins(timeViewParams, 0, dpToPx(8), 0, 0);<NEW_LINE>timeView.setLayoutParams(timeViewParams);<NEW_LINE>AndroidUtils.setPadding(timeView, 0, 0, dpToPx(16), 0);<NEW_LINE>timeView.setTextSize(16);<NEW_LINE>timeView.setTextColor(getMainFontColor());<NEW_LINE>timeView.setText(timeText);<NEW_LINE>baseItemView.addView(timeView);<NEW_LINE>}<NEW_LINE>if (onClickListener != null) {<NEW_LINE>ll.setOnClickListener(onClickListener);<NEW_LINE>}<NEW_LINE>((LinearLayout) view).addView(baseItemView);<NEW_LINE>}
baseView.setGravity(Gravity.END);
1,255,436
public void sendCacheEviction(Set<JanusGraphSchemaVertex> updatedTypes, final boolean evictGraphFromCache, List<Callable<Boolean>> updatedTypeTriggers, Set<String> openInstances) {<NEW_LINE>Preconditions.checkArgument(CollectionUtils<MASK><NEW_LINE>long evictionId = evictionTriggerCounter.incrementAndGet();<NEW_LINE>evictionTriggerMap.put(evictionId, new EvictionTrigger(evictionId, updatedTypeTriggers, graph));<NEW_LINE>DataOutput out = graph.getDataSerializer().getDataOutput(128);<NEW_LINE>out.writeObjectNotNull(MgmtLogType.CACHED_TYPE_EVICTION);<NEW_LINE>VariableLong.writePositive(out, evictionId);<NEW_LINE>VariableLong.writePositive(out, updatedTypes.size());<NEW_LINE>for (JanusGraphSchemaVertex type : updatedTypes) {<NEW_LINE>assert type.hasId();<NEW_LINE>VariableLong.writePositive(out, type.longId());<NEW_LINE>}<NEW_LINE>if (evictGraphFromCache) {<NEW_LINE>out.writeObjectNotNull(EVICT);<NEW_LINE>} else {<NEW_LINE>out.writeObjectNotNull(DO_NOT_EVICT);<NEW_LINE>}<NEW_LINE>sysLog.add(out.getStaticBuffer());<NEW_LINE>}
.isNotEmpty(openInstances), "openInstances cannot be null or empty");
261,975
public RenderableNode parse(Token token, Parser parser) {<NEW_LINE>TokenStream stream = parser.getStream();<NEW_LINE><MASK><NEW_LINE>// skip the 'if' token<NEW_LINE>stream.next();<NEW_LINE>List<Pair<Expression<?>, BodyNode>> conditionsWithBodies = new ArrayList<>();<NEW_LINE>Expression<?> expression = parser.getExpressionParser().parseExpression();<NEW_LINE>stream.expect(Token.Type.EXECUTE_END);<NEW_LINE>BodyNode body = parser.subparse(DECIDE_IF_FORK);<NEW_LINE>conditionsWithBodies.add(new Pair<>(expression, body));<NEW_LINE>BodyNode elseBody = null;<NEW_LINE>boolean end = false;<NEW_LINE>while (!end) {<NEW_LINE>if (stream.current().getValue() == null) {<NEW_LINE>throw new ParserException(null, "Unexpected end of template. Pebble was looking for the \"endif\" tag", stream.current().getLineNumber(), stream.getFilename());<NEW_LINE>}<NEW_LINE>switch(stream.current().getValue()) {<NEW_LINE>case "else":<NEW_LINE>stream.next();<NEW_LINE>stream.expect(Token.Type.EXECUTE_END);<NEW_LINE>elseBody = parser.subparse(tkn -> tkn.test(Token.Type.NAME, "endif"));<NEW_LINE>break;<NEW_LINE>case "elseif":<NEW_LINE>stream.next();<NEW_LINE>expression = parser.getExpressionParser().parseExpression();<NEW_LINE>stream.expect(Token.Type.EXECUTE_END);<NEW_LINE>body = parser.subparse(DECIDE_IF_FORK);<NEW_LINE>conditionsWithBodies.add(new Pair<>(expression, body));<NEW_LINE>break;<NEW_LINE>case "endif":<NEW_LINE>stream.next();<NEW_LINE>end = true;<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new ParserException(null, "Unexpected end of template. Pebble was looking for the following tags \"else\", \"elseif\", or \"endif\"", stream.current().getLineNumber(), stream.getFilename());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>stream.expect(Token.Type.EXECUTE_END);<NEW_LINE>return new IfNode(lineNumber, conditionsWithBodies, elseBody);<NEW_LINE>}
int lineNumber = token.getLineNumber();
696,433
public static void hexDump(byte[] buffer, int offset, int length, StringBuffer dest) {<NEW_LINE>int count;<NEW_LINE>for (int index = 0; length > 0; length -= count) {<NEW_LINE>// 4 digit offset<NEW_LINE>appendHexNumber(index, dest, 4);<NEW_LINE>dest.append(" ");<NEW_LINE>// 16 * 2-digit octets<NEW_LINE>count = (length > 16) ? 16 : length;<NEW_LINE>int i;<NEW_LINE>for (i = 0; i < count; i++) {<NEW_LINE>byte b = buffer[offset + i];<NEW_LINE>dest.append(hexDigits[(b >> 4) & 0x0f]);<NEW_LINE>dest.append(hexDigits[b & 0x0f]);<NEW_LINE>dest.append(i == 7 ? ':' : ' ');<NEW_LINE>}<NEW_LINE>for (; i < 16; i++) {<NEW_LINE>dest.append(" ");<NEW_LINE>}<NEW_LINE>dest.append(' ');<NEW_LINE>// string representation of the 16 octets<NEW_LINE>for (i = 0; i < count; i++) {<NEW_LINE>byte b = buffer[offset + i];<NEW_LINE>boolean printable = 32 <= b && b <= 126;<NEW_LINE>dest.append(printable <MASK><NEW_LINE>}<NEW_LINE>dest.append('\n');<NEW_LINE>offset += count;<NEW_LINE>index += count;<NEW_LINE>}<NEW_LINE>}
? (char) b : '.');
80,851
private void expandArg(IntDependency dependency, short valBinDist, double count) {<NEW_LINE>IntTaggedWord headT = getCachedITW(dependency.head.tag);<NEW_LINE>IntTaggedWord argT = getCachedITW(dependency.arg.tag);<NEW_LINE>// dependency.head;<NEW_LINE>IntTaggedWord head = new IntTaggedWord(dependency.head.word, tagBin(dependency.head.tag));<NEW_LINE>// dependency.arg;<NEW_LINE>IntTaggedWord arg = new IntTaggedWord(dependency.arg.word, tagBin(dependency.arg.tag));<NEW_LINE>boolean leftHeaded = dependency.leftHeaded;<NEW_LINE>// argCounter stores stuff in both the original and the reduced tag space???<NEW_LINE>argCounter.incrementCount(intern(head, arg, leftHeaded, valBinDist), count);<NEW_LINE>argCounter.incrementCount(intern(headT, arg, leftHeaded, valBinDist), count);<NEW_LINE>argCounter.incrementCount(intern(head, argT, leftHeaded, valBinDist), count);<NEW_LINE>argCounter.incrementCount(intern(headT, argT, leftHeaded, valBinDist), count);<NEW_LINE>argCounter.incrementCount(intern(head, wildTW, leftHeaded, valBinDist), count);<NEW_LINE>argCounter.incrementCount(intern(headT, wildTW, leftHeaded, valBinDist), count);<NEW_LINE>// the WILD head stats are always directionless and not useDistance!<NEW_LINE>argCounter.incrementCount(intern(wildTW, arg, false, (short) -1), count);<NEW_LINE>argCounter.incrementCount(intern(wildTW, argT, false, (short) -1), count);<NEW_LINE>if (useSmoothTagProjection) {<NEW_LINE>// added stuff to do more smoothing. CDM Jan 2007<NEW_LINE>IntTaggedWord headP = new IntTaggedWord(dependency.head.word, tagProject(dependency.head.tag));<NEW_LINE>IntTaggedWord headTP = new IntTaggedWord(ANY_WORD_INT, tagProject(dependency.head.tag));<NEW_LINE>IntTaggedWord argP = new IntTaggedWord(dependency.arg.word, tagProject(dependency.arg.tag));<NEW_LINE>IntTaggedWord argTP = new IntTaggedWord(ANY_WORD_INT, tagProject(dependency.arg.tag));<NEW_LINE>argCounter.incrementCount(intern(headP, argP, leftHeaded, valBinDist), count);<NEW_LINE>argCounter.incrementCount(intern(headTP, argP, leftHeaded, valBinDist), count);<NEW_LINE>argCounter.incrementCount(intern(headP, argTP, leftHeaded, valBinDist), count);<NEW_LINE>argCounter.incrementCount(intern(headTP, argTP, leftHeaded, valBinDist), count);<NEW_LINE>argCounter.incrementCount(intern(headP, wildTW<MASK><NEW_LINE>argCounter.incrementCount(intern(headTP, wildTW, leftHeaded, valBinDist), count);<NEW_LINE>// the WILD head stats are always directionless and not useDistance!<NEW_LINE>argCounter.incrementCount(intern(wildTW, argP, false, (short) -1), count);<NEW_LINE>argCounter.incrementCount(intern(wildTW, argTP, false, (short) -1), count);<NEW_LINE>argCounter.incrementCount(intern(wildTW, new IntTaggedWord(dependency.head.word, ANY_TAG_INT), false, (short) -1), count);<NEW_LINE>}<NEW_LINE>numWordTokens++;<NEW_LINE>}
, leftHeaded, valBinDist), count);
584,920
public RegisteredClient mapRow(ResultSet rs, int rowNum) throws SQLException {<NEW_LINE>Timestamp clientIdIssuedAt = rs.getTimestamp("client_id_issued_at");<NEW_LINE>Timestamp clientSecretExpiresAt = rs.getTimestamp("client_secret_expires_at");<NEW_LINE>Set<String> clientAuthenticationMethods = StringUtils.commaDelimitedListToSet(rs.getString("client_authentication_methods"));<NEW_LINE>Set<String> authorizationGrantTypes = StringUtils.commaDelimitedListToSet(rs.getString("authorization_grant_types"));<NEW_LINE>Set<String> redirectUris = StringUtils.commaDelimitedListToSet(rs.getString("redirect_uris"));<NEW_LINE>Set<String> clientScopes = StringUtils.commaDelimitedListToSet<MASK><NEW_LINE>// @formatter:off<NEW_LINE>RegisteredClient.Builder builder = RegisteredClient.withId(rs.getString("id")).clientId(rs.getString("client_id")).clientIdIssuedAt(clientIdIssuedAt != null ? clientIdIssuedAt.toInstant() : null).clientSecret(rs.getString("client_secret")).clientSecretExpiresAt(clientSecretExpiresAt != null ? clientSecretExpiresAt.toInstant() : null).clientName(rs.getString("client_name")).clientAuthenticationMethods((authenticationMethods) -> clientAuthenticationMethods.forEach(authenticationMethod -> authenticationMethods.add(resolveClientAuthenticationMethod(authenticationMethod)))).authorizationGrantTypes((grantTypes) -> authorizationGrantTypes.forEach(grantType -> grantTypes.add(resolveAuthorizationGrantType(grantType)))).redirectUris((uris) -> uris.addAll(redirectUris)).scopes((scopes) -> scopes.addAll(clientScopes));<NEW_LINE>// @formatter:on<NEW_LINE>Map<String, Object> clientSettingsMap = parseMap(rs.getString("client_settings"));<NEW_LINE>builder.clientSettings(ClientSettings.withSettings(clientSettingsMap).build());<NEW_LINE>Map<String, Object> tokenSettingsMap = parseMap(rs.getString("token_settings"));<NEW_LINE>TokenSettings.Builder tokenSettingsBuilder = TokenSettings.withSettings(tokenSettingsMap);<NEW_LINE>if (!tokenSettingsMap.containsKey(ConfigurationSettingNames.Token.ACCESS_TOKEN_FORMAT)) {<NEW_LINE>tokenSettingsBuilder.accessTokenFormat(OAuth2TokenFormat.SELF_CONTAINED);<NEW_LINE>}<NEW_LINE>builder.tokenSettings(tokenSettingsBuilder.build());<NEW_LINE>return builder.build();<NEW_LINE>}
(rs.getString("scopes"));
668,690
public void run(InputStream inputStream) {<NEW_LINE>try (Scanner scanner = new Scanner(inputStream)) {<NEW_LINE>while (true) {<NEW_LINE>System.err.print("> ");<NEW_LINE>if (!scanner.hasNextLine()) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>String line = scanner.nextLine();<NEW_LINE>if (line.isEmpty()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (line.equals("stop")) {<NEW_LINE>commandSender.printInfo(TranslatableComponent.of("worldedit.cli.stopping"));<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>CommandEvent event = new CommandEvent(commandSender, line);<NEW_LINE>WorldEdit.getInstance().<MASK><NEW_LINE>if (!event.isCancelled()) {<NEW_LINE>commandSender.printError(TranslatableComponent.of("worldedit.cli.unknown-command"));<NEW_LINE>} else {<NEW_LINE>saveAllWorlds(false);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>saveAllWorlds(false);<NEW_LINE>}<NEW_LINE>}
getEventBus().post(event);
176,388
public Pair<List<MediaFile>, List<String>> handle(SpecificPlaylist inputSpecificPlaylist, Path location) {<NEW_LINE>List<MediaFile> mediaFiles = new ArrayList<>();<NEW_LINE>List<String> errors = new ArrayList<>();<NEW_LINE>try {<NEW_LINE>inputSpecificPlaylist.toPlaylist().acceptDown(new BasePlaylistVisitor() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void beginVisitMedia(Media media) {<NEW_LINE>try {<NEW_LINE>// Cannot use uri directly because it resolves against war root<NEW_LINE>// URI uri = media.getSource().getURI();<NEW_LINE>String uri = media.getSource().toString();<NEW_LINE>List<MediaFile> possibles = getMediaFiles(uri);<NEW_LINE>if (possibles.isEmpty()) {<NEW_LINE>errors.add("Cannot find media file " + uri);<NEW_LINE>} else {<NEW_LINE>mediaFiles.addAll(possibles);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>errors.add(e.getMessage());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} catch (Exception e) {<NEW_LINE>errors.<MASK><NEW_LINE>}<NEW_LINE>return Pair.of(mediaFiles, errors);<NEW_LINE>}
add(e.getMessage());
6,333
protected void putS8(long value, Chunk chunk, long offset) {<NEW_LINE>UNSAFE.putByte(chunk.data, offset + 0, (byte) (value >> 56));<NEW_LINE>UNSAFE.putByte(chunk.data, offset + 1, (byte) (value >> 48));<NEW_LINE>UNSAFE.putByte(chunk.data, offset + 2, (byte<MASK><NEW_LINE>UNSAFE.putByte(chunk.data, offset + 3, (byte) (value >> 32));<NEW_LINE>UNSAFE.putByte(chunk.data, offset + 4, (byte) (value >> 24));<NEW_LINE>UNSAFE.putByte(chunk.data, offset + 5, (byte) (value >> 16));<NEW_LINE>UNSAFE.putByte(chunk.data, offset + 6, (byte) (value >> 8));<NEW_LINE>UNSAFE.putByte(chunk.data, offset + 7, (byte) (value >> 0));<NEW_LINE>}
) (value >> 40));
117,405
private List<URL> createArtificialBinaries(FileObject[] fos) {<NEW_LINE>assert Thread.holdsLock(this);<NEW_LINE>final List<URL> res = new ArrayList<>(fos.length);<NEW_LINE>File artBinaries = null;<NEW_LINE>MessageDigest md5 = null;<NEW_LINE>try {<NEW_LINE>for (FileObject fo : fos) {<NEW_LINE>final URI srcURI = fo.toURI();<NEW_LINE>URL bin = artificalBinariesCache.get(srcURI);<NEW_LINE>if (bin == null) {<NEW_LINE>if (artBinaries == null) {<NEW_LINE>final File projectFolder = FileUtil.<MASK><NEW_LINE>// NOI18N<NEW_LINE>artBinaries = new File(projectFolder, CACHE_FREEFORM_ARTIFICAL_BIN.replace('/', File.separatorChar));<NEW_LINE>// NOI18N<NEW_LINE>md5 = MessageDigest.getInstance("MD5");<NEW_LINE>} else {<NEW_LINE>md5.reset();<NEW_LINE>}<NEW_LINE>final String digest = str(md5.digest(srcURI.toString().getBytes(StandardCharsets.UTF_8)));<NEW_LINE>final File binFile = new File(artBinaries, digest);<NEW_LINE>bin = FileUtil.urlForArchiveOrDir(binFile);<NEW_LINE>artificalBinariesCache.put(srcURI, bin);<NEW_LINE>}<NEW_LINE>res.add(bin);<NEW_LINE>}<NEW_LINE>return res;<NEW_LINE>} catch (NoSuchAlgorithmException e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>}
toFile(helper.getProjectDirectory());
1,822,700
public long[][] queryProcessorCpuLoadTicks() {<NEW_LINE>if (HAS_KSTAT2) {<NEW_LINE>// Use Kstat2 implementation<NEW_LINE>return queryProcessorCpuLoadTicks2(getLogicalProcessorCount());<NEW_LINE>}<NEW_LINE>long[][] ticks = new long[getLogicalProcessorCount()][TickType.values().length];<NEW_LINE>int cpu = -1;<NEW_LINE>try (KstatChain kc = KstatUtil.openChain()) {<NEW_LINE>for (Kstat ksp : kc.lookupAll("cpu", -1, "sys")) {<NEW_LINE>// This is a new CPU<NEW_LINE>if (++cpu >= ticks.length) {<NEW_LINE>// Shouldn't happen<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>if (kc.read(ksp)) {<NEW_LINE>ticks[cpu][TickType.IDLE.getIndex()] = <MASK><NEW_LINE>ticks[cpu][TickType.SYSTEM.getIndex()] = KstatUtil.dataLookupLong(ksp, "cpu_ticks_kernel");<NEW_LINE>ticks[cpu][TickType.USER.getIndex()] = KstatUtil.dataLookupLong(ksp, "cpu_ticks_user");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return ticks;<NEW_LINE>}
KstatUtil.dataLookupLong(ksp, "cpu_ticks_idle");
512,733
private void handleFileUploadValidationAndData(VaadinSession session, InputStream inputStream, StreamVariable streamVariable, String filename, String mimeType, long contentLength, ClientConnector connector, String variableName) throws UploadException {<NEW_LINE>session.lock();<NEW_LINE>try {<NEW_LINE>if (connector == null) {<NEW_LINE>throw new UploadException("File upload ignored because the connector for the stream variable was not found");<NEW_LINE>}<NEW_LINE>if (!connector.isConnectorEnabled()) {<NEW_LINE>throw new UploadException("Warning: file upload ignored for " + connector.getConnectorId() + " because the component was disabled");<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>session.unlock();<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>// Store ui reference so we can do cleanup even if connector is<NEW_LINE>// detached in some event handler<NEW_LINE>UI ui = UI.getCurrent();<NEW_LINE>boolean forgetVariable = streamToReceiver(session, inputStream, streamVariable, filename, mimeType, contentLength);<NEW_LINE>if (forgetVariable) {<NEW_LINE>cleanStreamVariable(session, ui, connector, variableName);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>session.lock();<NEW_LINE>try {<NEW_LINE>session.getCommunicationManager(<MASK><NEW_LINE>} finally {<NEW_LINE>session.unlock();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
).handleConnectorRelatedException(connector, e);
1,805,456
private static String expand(Map<String, String> params, String str, boolean url_decode) {<NEW_LINE>int pos = 0;<NEW_LINE>String result = "";<NEW_LINE>while (true) {<NEW_LINE>int new_pos = str.indexOf('$', pos);<NEW_LINE>if (new_pos == -1) {<NEW_LINE>result += str.substring(pos);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>result += str.substring(pos, new_pos);<NEW_LINE>int end_pos = str.length();<NEW_LINE>for (int i = new_pos + 1; i < end_pos; i++) {<NEW_LINE>char c = str.charAt(i);<NEW_LINE>if (!(Character.isLetterOrDigit(c) || c == '_')) {<NEW_LINE>end_pos = i;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>String param = str.substring(new_pos + 1, end_pos);<NEW_LINE>String value = params.get(param);<NEW_LINE>if (value == null) {<NEW_LINE>pos = new_pos + 1;<NEW_LINE>result += "$";<NEW_LINE>} else {<NEW_LINE>if (url_decode) {<NEW_LINE><MASK><NEW_LINE>} else {<NEW_LINE>result += value;<NEW_LINE>}<NEW_LINE>pos = end_pos;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return (result);<NEW_LINE>}
result += UrlUtils.decode(value);
1,522,597
private void updateCertificateSelector() {<NEW_LINE>if (!mCheckAuto.isChecked()) {<NEW_LINE>mSelectCert.setEnabled(true);<NEW_LINE>mSelectCert.setVisibility(View.VISIBLE);<NEW_LINE>if (mCertEntry != null) {<NEW_LINE>((TextView) mSelectCert.findViewById(android.R.id.text1)).<MASK><NEW_LINE>((TextView) mSelectCert.findViewById(android.R.id.text2)).setText(mCertEntry.getSubjectSecondary());<NEW_LINE>} else {<NEW_LINE>((TextView) mSelectCert.findViewById(android.R.id.text1)).setText(R.string.profile_ca_select_certificate_label);<NEW_LINE>((TextView) mSelectCert.findViewById(android.R.id.text2)).setText(R.string.profile_ca_select_certificate);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>mSelectCert.setEnabled(false);<NEW_LINE>mSelectCert.setVisibility(View.GONE);<NEW_LINE>}<NEW_LINE>}
setText(mCertEntry.getSubjectPrimary());
803,826
public static String sendGetRequest(String urlText, String userNamePassword, StringBuilder responseBody) {<NEW_LINE>try {<NEW_LINE>log.info("GET : " + urlText);<NEW_LINE>HttpURLConnection conn = getHttpURLConnection(urlText);<NEW_LINE>conn.setDoInput(true);<NEW_LINE>conn.setDoOutput(false);<NEW_LINE>conn.setRequestMethod("GET");<NEW_LINE>if (userNamePassword != null) {<NEW_LINE>// $NON-NLS-1$ //$NON-NLS-2$<NEW_LINE>conn.setRequestProperty("Authorization", "Basic " + Base64.encode(userNamePassword));<NEW_LINE>}<NEW_LINE>// $NON-NLS-1$ //$NON-NLS-2$<NEW_LINE>conn.setRequestProperty("User-Agent", "OsmAnd");<NEW_LINE>log.info("Response code and message : " + conn.getResponseCode() + " " + conn.getResponseMessage());<NEW_LINE>if (conn.getResponseCode() != 200) {<NEW_LINE>return conn.getResponseMessage();<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>responseBody.setLength(0);<NEW_LINE>if (is != null) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>BufferedReader in = new BufferedReader(new InputStreamReader(is, "UTF-8"));<NEW_LINE>String s;<NEW_LINE>boolean first = true;<NEW_LINE>while ((s = in.readLine()) != null) {<NEW_LINE>if (first) {<NEW_LINE>first = false;<NEW_LINE>} else {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>responseBody.append("\n");<NEW_LINE>}<NEW_LINE>responseBody.append(s);<NEW_LINE>}<NEW_LINE>is.close();<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} catch (IOException e) {<NEW_LINE>log.error(e.getMessage(), e);<NEW_LINE>return e.getMessage();<NEW_LINE>}<NEW_LINE>}
InputStream is = conn.getInputStream();
329,594
private // and that our WSJdbcConnection properties are in sync with the underlying PostgreSQL connection's properties<NEW_LINE>void verifyClean(Connection con) throws Exception {<NEW_LINE>// Verify WSJdbcConnection values are all at the proper initial state<NEW_LINE>assertTrue("Default auto-commit value on a connection should be 'true'", con.getAutoCommit());<NEW_LINE>assertFalse("Default readOnly value on a connection should be 'false'", con.isReadOnly());<NEW_LINE>assertEquals("Default tx isolation level on a connection should be TRANSACTION_READ_COMMITTED (2)", Connection.TRANSACTION_READ_COMMITTED, con.getTransactionIsolation());<NEW_LINE>assertEquals("Default ResultSet holdability on a connection should be CLOSE_CURSORS_AT_COMMIT (2)", ResultSet.CLOSE_CURSORS_AT_COMMIT, con.getHoldability());<NEW_LINE>assertEquals("Default network timeout on a connection should be 0", 0, con.getNetworkTimeout());<NEW_LINE>assertEquals("Default schema on a connection should be 'public", "public", con.getSchema());<NEW_LINE>// Always "do some work" with the connection before we verify it's underlying state.<NEW_LINE>// The JDBC code intentionally lazily resets connection values, so our wrapper may be out of sync with the underlying<NEW_LINE>// connection between getting the initial connection and actually driving some work on it<NEW_LINE>con.createStatement().close();<NEW_LINE>// Verify the underlying PostgreSQL connection is in a consistent state with our tracking<NEW_LINE>assertEquals("Liberty JDBC connection wrapper auto-commit value did not match the underlying PostgreSQL connection value", con.getAutoCommit(), getUnderlyingPGConnection(con).getAutoCommit());<NEW_LINE>assertEquals("Liberty JDBC connection wrapper isReadOnly value did not match the underlying PostgreSQL connection value", con.isReadOnly(), getUnderlyingPGConnection(con).isReadOnly());<NEW_LINE>assertEquals("Liberty JDBC connection wrapper tx isolation level value did not match the underlying PostgreSQL connection value", con.getTransactionIsolation(), getUnderlyingPGConnection(con).getTransactionIsolation());<NEW_LINE>assertEquals("Liberty JDBC connection wrapper ResultSet holdability value did not match the underlying PostgreSQL connection value", con.getHoldability(), getUnderlyingPGConnection<MASK><NEW_LINE>assertEquals("Liberty JDBC connection wrapper network timeout value did not match the underlying PostgreSQL connection value", con.getNetworkTimeout(), getUnderlyingPGConnection(con).getNetworkTimeout());<NEW_LINE>assertEquals("Liberty JDBC connection wrapper schema value did not match the underlying PostgreSQL connection value", con.getSchema(), getUnderlyingPGConnection(con).getSchema());<NEW_LINE>}
(con).getHoldability());
278,614
public void marshall(RedshiftDestinationUpdate redshiftDestinationUpdate, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (redshiftDestinationUpdate == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(redshiftDestinationUpdate.getRoleARN(), ROLEARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(redshiftDestinationUpdate.getClusterJDBCURL(), CLUSTERJDBCURL_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(redshiftDestinationUpdate.getUsername(), USERNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(redshiftDestinationUpdate.getPassword(), PASSWORD_BINDING);<NEW_LINE>protocolMarshaller.marshall(redshiftDestinationUpdate.getRetryOptions(), RETRYOPTIONS_BINDING);<NEW_LINE>protocolMarshaller.marshall(redshiftDestinationUpdate.getS3Update(), S3UPDATE_BINDING);<NEW_LINE>protocolMarshaller.marshall(redshiftDestinationUpdate.getProcessingConfiguration(), PROCESSINGCONFIGURATION_BINDING);<NEW_LINE>protocolMarshaller.marshall(redshiftDestinationUpdate.getS3BackupMode(), S3BACKUPMODE_BINDING);<NEW_LINE>protocolMarshaller.marshall(redshiftDestinationUpdate.getS3BackupUpdate(), S3BACKUPUPDATE_BINDING);<NEW_LINE>protocolMarshaller.marshall(redshiftDestinationUpdate.getCloudWatchLoggingOptions(), CLOUDWATCHLOGGINGOPTIONS_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
redshiftDestinationUpdate.getCopyCommand(), COPYCOMMAND_BINDING);
1,843,861
static boolean isFinishable(FileSystem fs, String buildContext, String dockerfile) {<NEW_LINE>if (buildContext == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>String realDockerfile;<NEW_LINE>if (dockerfile == null) {<NEW_LINE>realDockerfile = buildContext + "/" + DockerAction.DOCKER_FILE;<NEW_LINE>} else {<NEW_LINE>realDockerfile = buildContext + "/" + dockerfile;<NEW_LINE>}<NEW_LINE>FileObject build = fs.<MASK><NEW_LINE>FileObject fo = fs.getRoot().getFileObject(realDockerfile);<NEW_LINE>// the last check avoids entires like Dockerfile/ to be considered valid files<NEW_LINE>if (fo == null || !fo.isData() || !realDockerfile.endsWith(fo.getNameExt())) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (build == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>return FileUtil.isParentOf(build, fo);<NEW_LINE>}
getRoot().getFileObject(buildContext);
125,099
protected void firePseudoAttributes() {<NEW_LINE>if (m_tracer != null) {<NEW_LINE>try {<NEW_LINE>// flush out the "<elemName" if not already flushed<NEW_LINE>m_writer.flush();<NEW_LINE>// make a StringBuffer to write the name="value" pairs to.<NEW_LINE>StringBuffer sb = new StringBuffer();<NEW_LINE>int nAttrs = m_attributes.getLength();<NEW_LINE>if (nAttrs > 0) {<NEW_LINE>// make a writer that internally appends to the same<NEW_LINE>// StringBuffer<NEW_LINE>java.io.Writer writer <MASK><NEW_LINE>processAttributes(writer, nAttrs);<NEW_LINE>// Don't clear the attributes!<NEW_LINE>// We only want to see what would be written out<NEW_LINE>// at this point, we don't want to loose them.<NEW_LINE>}<NEW_LINE>// the potential > after the attributes.<NEW_LINE>sb.append('>');<NEW_LINE>// convert the StringBuffer to a char array and<NEW_LINE>// emit the trace event that these characters "might"<NEW_LINE>// be written<NEW_LINE>char[] ch = sb.toString().toCharArray();<NEW_LINE>m_tracer.fireGenerateEvent(SerializerTrace.EVENTTYPE_OUTPUT_PSEUDO_CHARACTERS, ch, 0, ch.length);<NEW_LINE>} catch (IOException ioe) {<NEW_LINE>// ignore ?<NEW_LINE>} catch (SAXException se) {<NEW_LINE>// ignore ?<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
= new ToStream.WritertoStringBuffer(sb);
1,558,156
public static ListFileResponse unmarshall(ListFileResponse listFileResponse, UnmarshallerContext _ctx) {<NEW_LINE>listFileResponse.setRequestId(_ctx.stringValue("ListFileResponse.RequestId"));<NEW_LINE>listFileResponse.setHttpStatusCode(_ctx.stringValue("ListFileResponse.HttpStatusCode"));<NEW_LINE>listFileResponse.setSuccess(_ctx.booleanValue("ListFileResponse.Success"));<NEW_LINE>listFileResponse.setCode(_ctx.stringValue("ListFileResponse.Code"));<NEW_LINE>listFileResponse.setMessage(_ctx.stringValue("ListFileResponse.Message"));<NEW_LINE>Paginator paginator = new Paginator();<NEW_LINE>paginator.setPageCount(_ctx.integerValue("ListFileResponse.Paginator.PageCount"));<NEW_LINE>paginator.setPageNum(_ctx.integerValue("ListFileResponse.Paginator.PageNum"));<NEW_LINE>paginator.setPageSize(_ctx.integerValue("ListFileResponse.Paginator.PageSize"));<NEW_LINE>paginator.setTotal(_ctx.integerValue("ListFileResponse.Paginator.Total"));<NEW_LINE>listFileResponse.setPaginator(paginator);<NEW_LINE>List<DataListItem> dataList = new ArrayList<DataListItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListFileResponse.DataList.Length"); i++) {<NEW_LINE>DataListItem dataListItem = new DataListItem();<NEW_LINE>dataListItem.setId(_ctx.stringValue("ListFileResponse.DataList[" + i + "].Id"));<NEW_LINE>dataListItem.setName(_ctx.stringValue<MASK><NEW_LINE>dataListItem.setSize(_ctx.integerValue("ListFileResponse.DataList[" + i + "].Size"));<NEW_LINE>dataListItem.setType(_ctx.stringValue("ListFileResponse.DataList[" + i + "].Type"));<NEW_LINE>dataListItem.setUrl(_ctx.stringValue("ListFileResponse.DataList[" + i + "].Url"));<NEW_LINE>dataListItem.setGmtCreate(_ctx.stringValue("ListFileResponse.DataList[" + i + "].GmtCreate"));<NEW_LINE>dataListItem.setGmtModified(_ctx.stringValue("ListFileResponse.DataList[" + i + "].GmtModified"));<NEW_LINE>dataList.add(dataListItem);<NEW_LINE>}<NEW_LINE>listFileResponse.setDataList(dataList);<NEW_LINE>return listFileResponse;<NEW_LINE>}
("ListFileResponse.DataList[" + i + "].Name"));
115,536
public void onExecute(final Command continuation) {<NEW_LINE>// RStudio Commands<NEW_LINE>appCommands_.loadBindings(new CommandWithArg<EditorKeyBindings>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void execute(final EditorKeyBindings customBindings) {<NEW_LINE>Map<String, AppCommand> commands = commands_.getCommands();<NEW_LINE>for (Map.Entry<String, AppCommand> entry : commands.entrySet()) {<NEW_LINE><MASK><NEW_LINE>if (isExcludedCommand(command))<NEW_LINE>continue;<NEW_LINE>String id = command.getId();<NEW_LINE>String name = getAppCommandName(command);<NEW_LINE>int type = KeyboardShortcutEntry.TYPE_RSTUDIO_COMMAND;<NEW_LINE>boolean isCustom = customBindings.hasKey(id);<NEW_LINE>List<KeySequence> keySequences = new ArrayList<>();<NEW_LINE>if (isCustom)<NEW_LINE>keySequences = customBindings.get(id).getKeyBindings();<NEW_LINE>else<NEW_LINE>keySequences.add(command.getKeySequence());<NEW_LINE>for (KeySequence keys : keySequences) {<NEW_LINE>KeyboardShortcutEntry binding = new KeyboardShortcutEntry(id, name, keys, type, isCustom, command.getContext());<NEW_LINE>bindings.add(binding);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>continuation.execute();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
AppCommand command = entry.getValue();
283,174
protected BaseRestHandler.RestChannelConsumer prepareRequest(RestRequest restRequest, NodeClient client) throws IOException {<NEW_LINE>String calendarId = restRequest.param(Calendar.ID.getPreferredName());<NEW_LINE>GetCalendarEventsAction.Request request;<NEW_LINE>if (restRequest.hasContentOrSourceParam()) {<NEW_LINE>try (XContentParser parser = restRequest.contentOrSourceParamParser()) {<NEW_LINE>request = GetCalendarEventsAction.Request.parseRequest(calendarId, parser);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>request <MASK><NEW_LINE>request.setStart(restRequest.param(GetCalendarEventsAction.Request.START.getPreferredName(), null));<NEW_LINE>request.setEnd(restRequest.param(GetCalendarEventsAction.Request.END.getPreferredName(), null));<NEW_LINE>request.setJobId(restRequest.param(Job.ID.getPreferredName(), null));<NEW_LINE>if (restRequest.hasParam(PageParams.FROM.getPreferredName()) || restRequest.hasParam(PageParams.SIZE.getPreferredName())) {<NEW_LINE>request.setPageParams(new PageParams(restRequest.paramAsInt(PageParams.FROM.getPreferredName(), PageParams.DEFAULT_FROM), restRequest.paramAsInt(PageParams.SIZE.getPreferredName(), PageParams.DEFAULT_SIZE)));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return channel -> client.execute(GetCalendarEventsAction.INSTANCE, request, new RestToXContentListener<>(channel));<NEW_LINE>}
= new GetCalendarEventsAction.Request(calendarId);
1,833,487
public float interpolate(float t) {<NEW_LINE>// Handle the boundary cases.<NEW_LINE>final <MASK><NEW_LINE>if (Float.isNaN(t)) {<NEW_LINE>return t;<NEW_LINE>}<NEW_LINE>if (t <= mT.get(0)) {<NEW_LINE>return mX.get(0);<NEW_LINE>}<NEW_LINE>if (t >= mT.get(n - 1)) {<NEW_LINE>return mX.get(n - 1);<NEW_LINE>}<NEW_LINE>// Find the index 'i' of the last point with smaller t.<NEW_LINE>// We know this will be within the spline due to the boundary tests.<NEW_LINE>int i = 0;<NEW_LINE>while (t >= mT.get(i + 1)) {<NEW_LINE>i += 1;<NEW_LINE>if (t == mT.get(i)) {<NEW_LINE>return mX.get(i);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Perform cubic Hermite spline interpolation.<NEW_LINE>float h = mT.get(i + 1) - mT.get(i);<NEW_LINE>float u = (t - mT.get(i)) / h;<NEW_LINE>return (mX.get(i) * (1 + 2 * u) + h * mM[i] * u) * (1 - u) * (1 - u) + (mX.get(i + 1) * (3 - 2 * u) + h * mM[i + 1] * (u - 1)) * u * u;<NEW_LINE>}
int n = mT.size();
845,611
private void initialize() {<NEW_LINE>View view = View.inflate(getContext(), <MASK><NEW_LINE>// Container uses different View classes so it can't use the same id or we'll get class<NEW_LINE>// cast exception when restoring state.<NEW_LINE>mContainer = view.findViewById(R.id.buttons_container);<NEW_LINE>if (mContainer == null) {<NEW_LINE>mContainer = view.findViewById(R.id.buttons_container_landscape);<NEW_LINE>}<NEW_LINE>initializeButtons(view, R.id.md_h1, R.id.md_h2, R.id.md_h3, R.id.md_bold, R.id.md_italic, R.id.md_strikethrough, R.id.md_bullet_list, R.id.md_number_list, R.id.md_task_list, R.id.md_divider, R.id.md_code, R.id.md_quote, R.id.md_link, R.id.md_image);<NEW_LINE>}
R.layout.markdown_buttons_bar, this);
1,664,716
public static void mul(int[] x, int[] y, int[] zz) {<NEW_LINE>Nat256.mul(x, y, zz);<NEW_LINE>Nat256.mul(x, 8, y, 8, zz, 16);<NEW_LINE>int c24 = Nat256.addToEachOther(zz, 8, zz, 16);<NEW_LINE>int c16 = c24 + Nat256.addTo(zz, 0, zz, 8, 0);<NEW_LINE>c24 += Nat256.addTo(zz, 24, zz, 16, c16);<NEW_LINE>int[] dx = Nat256.create(), dy = Nat256.create();<NEW_LINE>boolean neg = Nat256.diff(x, 8, x, 0, dx, 0) != Nat256.diff(y, 8, y, 0, dy, 0);<NEW_LINE>int[<MASK><NEW_LINE>Nat256.mul(dx, dy, tt);<NEW_LINE>c24 += neg ? Nat.addTo(16, tt, 0, zz, 8) : Nat.subFrom(16, tt, 0, zz, 8);<NEW_LINE>Nat.addWordAt(32, c24, zz, 24);<NEW_LINE>}
] tt = Nat256.createExt();
1,795,237
private void emitVariableDefs(OCLCompilationResultBuilder crb, OCLAssembler asm, LIR lir) {<NEW_LINE>Map<OCLKind, Set<Variable>> kindToVariable = new HashMap<>();<NEW_LINE>final int expectedVariables = lir.numVariables();<NEW_LINE>final AtomicInteger variableCount = new AtomicInteger();<NEW_LINE>for (AbstractBlockBase<?> b : lir.linearScanOrder()) {<NEW_LINE>for (LIRInstruction lirInstruction : lir.getLIRforBlock(b)) {<NEW_LINE>lirInstruction.forEachOutput((instruction, value, mode, flags) -> {<NEW_LINE>if (value instanceof Variable) {<NEW_LINE>Variable variable = (Variable) value;<NEW_LINE>if (variable.getName() != null) {<NEW_LINE>addVariableDef(kindToVariable, variable);<NEW_LINE>variableCount.incrementAndGet();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return value;<NEW_LINE>});<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Logger.traceCodeGen(Logger.BACKEND.OpenCL, "found %d variable, expected (%d)", variableCount.get(), expectedVariables);<NEW_LINE>for (OCLKind type : kindToVariable.keySet()) {<NEW_LINE>asm.indent();<NEW_LINE><MASK><NEW_LINE>for (Variable var : kindToVariable.get(type)) {<NEW_LINE>asm.emitValue(crb, var);<NEW_LINE>asm.emit(", ");<NEW_LINE>}<NEW_LINE>asm.emitByte(';', asm.position() - 2);<NEW_LINE>asm.eol();<NEW_LINE>}<NEW_LINE>}
asm.emit("%s ", type);
1,706,059
private void resolveOrFail(final ClassNode type, final String msg, final ASTNode node, final boolean preferImports) {<NEW_LINE>if (preferImports) {<NEW_LINE>resolveGenericsTypes(type.getGenericsTypes());<NEW_LINE>if (resolveAliasFromModule(type))<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (resolve(type))<NEW_LINE>return;<NEW_LINE>ClassNode temp = type;<NEW_LINE>while (// GROOVY-8715<NEW_LINE>temp.isArray()) temp = temp.getComponentType();<NEW_LINE>final String name = temp.getName();<NEW_LINE>String nameAsType = name.replace('.', '$');<NEW_LINE><MASK><NEW_LINE>if (!name.equals(nameAsType) && module.hasPackageName()) {<NEW_LINE>// check qualified reference for a same-package type<NEW_LINE>temp.setName(module.getPackageName() + nameAsType);<NEW_LINE>if (resolve(temp, false, false, false))<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// check reference for an on-demand imported type<NEW_LINE>for (ImportNode star : module.getStarImports()) {<NEW_LINE>String cName = star.getClassName();<NEW_LINE>if (cName != null) {<NEW_LINE>temp.setName(cName + '$' + nameAsType);<NEW_LINE>if (resolve(temp, false, false, false))<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// check qualified reference<NEW_LINE>if (!name.equals(nameAsType)) {<NEW_LINE>// ... resolved by default imports<NEW_LINE>for (String pack : DEFAULT_IMPORTS) {<NEW_LINE>temp.setName(pack + nameAsType);<NEW_LINE>if (resolve(temp, false, false, false))<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>temp.setName(name);<NEW_LINE>addError("unable to resolve class " + name + msg, temp.getEnd() > 0 ? temp : node);<NEW_LINE>// GRECLIPSE end<NEW_LINE>}
ModuleNode module = currentClass.getModule();
1,806,385
public static String exeCmdWithoutPipe(CommandLine cmdLine, ByteArrayInputStream input, Map<String, String> env) {<NEW_LINE>DefaultExecutor executor = new DefaultExecutor();<NEW_LINE>ExecuteWatchdog dog = new ExecuteWatchdog(3 * 1000);<NEW_LINE>executor.setWatchdog(dog);<NEW_LINE>executor.setExitValue(0);<NEW_LINE>try {<NEW_LINE>ByteArrayOutputStream outputStream = new ByteArrayOutputStream();<NEW_LINE>SaturnLogOutputStream errorOS = new SaturnLogOutputStream(log, SaturnLogOutputStream.LEVEL_ERROR);<NEW_LINE>PumpStreamHandler streamHandler = new PumpStreamHandler(outputStream, errorOS, input);<NEW_LINE>executor.setStreamHandler(streamHandler);<NEW_LINE>LogUtils.info(log, LogEvents.ExecutorEvent.COMMON, "exec command: {}", cmdLine);<NEW_LINE>int value = <MASK><NEW_LINE>if (value == 0) {<NEW_LINE>String out = outputStream.toString();<NEW_LINE>return out;<NEW_LINE>} else {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>LogUtils.error(log, LogEvents.ExecutorEvent.COMMON, e.getMessage(), e);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}
executor.execute(cmdLine, env);
1,834,550
public void marshall(RestoreJobsListMember restoreJobsListMember, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (restoreJobsListMember == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(restoreJobsListMember.getAccountId(), ACCOUNTID_BINDING);<NEW_LINE>protocolMarshaller.marshall(restoreJobsListMember.getRestoreJobId(), RESTOREJOBID_BINDING);<NEW_LINE>protocolMarshaller.marshall(restoreJobsListMember.getRecoveryPointArn(), RECOVERYPOINTARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(restoreJobsListMember.getCreationDate(), CREATIONDATE_BINDING);<NEW_LINE>protocolMarshaller.marshall(restoreJobsListMember.getCompletionDate(), COMPLETIONDATE_BINDING);<NEW_LINE>protocolMarshaller.marshall(restoreJobsListMember.getStatus(), STATUS_BINDING);<NEW_LINE>protocolMarshaller.marshall(restoreJobsListMember.getStatusMessage(), STATUSMESSAGE_BINDING);<NEW_LINE>protocolMarshaller.marshall(restoreJobsListMember.getPercentDone(), PERCENTDONE_BINDING);<NEW_LINE>protocolMarshaller.marshall(restoreJobsListMember.getBackupSizeInBytes(), BACKUPSIZEINBYTES_BINDING);<NEW_LINE>protocolMarshaller.marshall(restoreJobsListMember.getIamRoleArn(), IAMROLEARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(restoreJobsListMember.getExpectedCompletionTimeMinutes(), EXPECTEDCOMPLETIONTIMEMINUTES_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(restoreJobsListMember.getResourceType(), RESOURCETYPE_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
restoreJobsListMember.getCreatedResourceArn(), CREATEDRESOURCEARN_BINDING);
1,031,155
public void moveItem(MountItem item, int oldIndex, int newIndex) {<NEW_LINE>if (item == null && mScrapMountItemsArray != null) {<NEW_LINE>item = mScrapMountItemsArray.get(oldIndex);<NEW_LINE>}<NEW_LINE>if (item == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Check if we're trying to move a mount item from a place where it doesn't exist.<NEW_LINE>// If so, fail early and throw exception with description.<NEW_LINE>if (isIllegalMountItemMove(item, oldIndex)) {<NEW_LINE>final String givenMountItemDescription = item.getRenderTreeNode().generateDebugString(null);<NEW_LINE>final MountItem existingMountItem = mMountItems.get(oldIndex);<NEW_LINE>final String existingMountItemDescription = existingMountItem != null ? existingMountItem.getRenderTreeNode().generateDebugString(null) : "null";<NEW_LINE>throw new IllegalStateException("Attempting to move MountItem from index: " + oldIndex + " to index: " + newIndex + ", but given MountItem does not exist at provided old index.\nGiven MountItem: " + givenMountItemDescription + "\nExisting MountItem at old index: " + existingMountItemDescription);<NEW_LINE>}<NEW_LINE>maybeMoveTouchExpansionIndexes(item, oldIndex, newIndex);<NEW_LINE>final <MASK><NEW_LINE>ensureViewMountItems();<NEW_LINE>if (content instanceof Drawable) {<NEW_LINE>moveDrawableItem(item, oldIndex, newIndex);<NEW_LINE>} else if (content instanceof View) {<NEW_LINE>mIsChildDrawingOrderDirty = true;<NEW_LINE>if (mViewMountItems.get(newIndex) != null) {<NEW_LINE>ensureScrapViewMountItemsArray();<NEW_LINE>ComponentHostUtils.scrapItemAt(newIndex, mViewMountItems, mScrapViewMountItemsArray);<NEW_LINE>}<NEW_LINE>ComponentHostUtils.moveItem(oldIndex, newIndex, mViewMountItems, mScrapViewMountItemsArray);<NEW_LINE>}<NEW_LINE>ensureMountItems();<NEW_LINE>if (mMountItems.get(newIndex) != null) {<NEW_LINE>ensureScrapMountItemsArray();<NEW_LINE>ComponentHostUtils.scrapItemAt(newIndex, mMountItems, mScrapMountItemsArray);<NEW_LINE>}<NEW_LINE>ComponentHostUtils.moveItem(oldIndex, newIndex, mMountItems, mScrapMountItemsArray);<NEW_LINE>releaseScrapDataStructuresIfNeeded();<NEW_LINE>}
Object content = item.getContent();
1,790,204
private int transitionsBetween(ResultPoint from, ResultPoint to) {<NEW_LINE>// See QR Code Detector, sizeOfBlackWhiteBlackRun()<NEW_LINE>int fromX = (int) from.getX();<NEW_LINE>int fromY = (int) from.getY();<NEW_LINE>int toX = <MASK><NEW_LINE>int toY = Math.min(image.getHeight() - 1, (int) to.getY());<NEW_LINE>boolean steep = Math.abs(toY - fromY) > Math.abs(toX - fromX);<NEW_LINE>if (steep) {<NEW_LINE>int temp = fromX;<NEW_LINE>fromX = fromY;<NEW_LINE>fromY = temp;<NEW_LINE>temp = toX;<NEW_LINE>toX = toY;<NEW_LINE>toY = temp;<NEW_LINE>}<NEW_LINE>int dx = Math.abs(toX - fromX);<NEW_LINE>int dy = Math.abs(toY - fromY);<NEW_LINE>int error = -dx / 2;<NEW_LINE>int ystep = fromY < toY ? 1 : -1;<NEW_LINE>int xstep = fromX < toX ? 1 : -1;<NEW_LINE>int transitions = 0;<NEW_LINE>boolean inBlack = image.get(steep ? fromY : fromX, steep ? fromX : fromY);<NEW_LINE>for (int x = fromX, y = fromY; x != toX; x += xstep) {<NEW_LINE>boolean isBlack = image.get(steep ? y : x, steep ? x : y);<NEW_LINE>if (isBlack != inBlack) {<NEW_LINE>transitions++;<NEW_LINE>inBlack = isBlack;<NEW_LINE>}<NEW_LINE>error += dy;<NEW_LINE>if (error > 0) {<NEW_LINE>if (y == toY) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>y += ystep;<NEW_LINE>error -= dx;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return transitions;<NEW_LINE>}
(int) to.getX();
574,521
public void service(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {<NEW_LINE>byte[] imageData = null;<NEW_LINE>String imageMimeType = null;<NEW_LINE>String imageName = request.getParameter(IMAGE_NAME_REQUEST_PARAMETER);<NEW_LINE>if ("px".equals(imageName)) {<NEW_LINE>try {<NEW_LINE>imageData = RepositoryUtil.getInstance(getJasperReportsContext()).getBytesFromLocation(JRImageLoader.PIXEL_IMAGE_RESOURCE);<NEW_LINE>imageMimeType = ImageTypeEnum.GIF.getMimeType();<NEW_LINE>} catch (JRException e) {<NEW_LINE>throw new ServletException(e);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>List<JasperPrint> jasperPrintList = BaseHttpServlet.getJasperPrintList(request);<NEW_LINE>if (jasperPrintList == null) {<NEW_LINE>throw new ServletException("No JasperPrint documents found on the HTTP session.");<NEW_LINE>}<NEW_LINE>JRPrintImage image = HtmlExporter.getImage(jasperPrintList, imageName);<NEW_LINE>Renderable renderer = image.getRenderer();<NEW_LINE>Dimension dimension = new Dimension(image.getWidth(), image.getHeight());<NEW_LINE>Color backcolor = ModeEnum.OPAQUE == image.getModeValue() ? image.getBackcolor() : null;<NEW_LINE>RendererUtil rendererUtil = RendererUtil.getInstance(getJasperReportsContext());<NEW_LINE>try {<NEW_LINE>imageData = process(renderer, dimension, backcolor);<NEW_LINE>} catch (Exception e) {<NEW_LINE>try {<NEW_LINE>Renderable onErrorRenderer = rendererUtil.handleImageError(e, image.getOnErrorTypeValue());<NEW_LINE>if (onErrorRenderer != null) {<NEW_LINE>imageData = process(onErrorRenderer, dimension, backcolor);<NEW_LINE>}<NEW_LINE>} catch (Exception ex) {<NEW_LINE>throw new ServletException(ex);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>imageMimeType = rendererUtil.isSvgData(imageData) ? RendererUtil.SVG_MIME_TYPE : JRTypeSniffer.<MASK><NEW_LINE>}<NEW_LINE>if (imageData != null && imageData.length > 0) {<NEW_LINE>if (imageMimeType != null) {<NEW_LINE>response.setHeader("Content-Type", imageMimeType);<NEW_LINE>}<NEW_LINE>response.setContentLength(imageData.length);<NEW_LINE>ServletOutputStream outputStream = response.getOutputStream();<NEW_LINE>outputStream.write(imageData, 0, imageData.length);<NEW_LINE>outputStream.flush();<NEW_LINE>outputStream.close();<NEW_LINE>}<NEW_LINE>}
getImageTypeValue(imageData).getMimeType();
1,510,014
public void sendAdventureSettings(ProxySession session) {<NEW_LINE>if (opPermissionLevel >= 2) {<NEW_LINE>playerPermission = PlayerPermission.OPERATOR;<NEW_LINE>} else {<NEW_LINE>playerPermission = PlayerPermission.MEMBER;<NEW_LINE>}<NEW_LINE>AdventureSettingsPacket adventureSettingsPacket = new AdventureSettingsPacket();<NEW_LINE>adventureSettingsPacket.setUniqueEntityId(proxyEid);<NEW_LINE>adventureSettingsPacket.setPlayerPermission(playerPermission);<NEW_LINE>adventureSettingsPacket.setCommandPermission(CommandPermission.NORMAL);<NEW_LINE>Set<AdventureSettingsPacket.Flag> flags = new HashSet<>();<NEW_LINE>if (canFly) {<NEW_LINE>flags.add(AdventureSettingsPacket.Flag.MAY_FLY);<NEW_LINE>}<NEW_LINE>if (flying) {<NEW_LINE>flags.add(AdventureSettingsPacket.Flag.FLYING);<NEW_LINE>}<NEW_LINE>if (autoJump) {<NEW_LINE>flags.<MASK><NEW_LINE>}<NEW_LINE>if (worldImmutable) {<NEW_LINE>flags.add(AdventureSettingsPacket.Flag.IMMUTABLE_WORLD);<NEW_LINE>}<NEW_LINE>if (noClip) {<NEW_LINE>flags.add(AdventureSettingsPacket.Flag.NO_CLIP);<NEW_LINE>}<NEW_LINE>adventureSettingsPacket.getFlags().addAll(flags);<NEW_LINE>session.sendPacket(adventureSettingsPacket);<NEW_LINE>}
add(AdventureSettingsPacket.Flag.AUTO_JUMP);
1,801,138
private void doProxyHandshake(Socket s, String hostname, int port, String userauth, int connectTimeout) throws IOException {<NEW_LINE>StringBuilder request = new StringBuilder(128);<NEW_LINE>request.append("CONNECT ").append(hostname).append(':').append(port).append(" HTTP/1.1\r\nHost: ").append(hostname).append(':').append(port);<NEW_LINE>if (userauth != null) {<NEW_LINE>byte[] b = userauth.getBytes("UTF-8");<NEW_LINE>char[] base64 = new char[(b.length + 2) / 3 * 4];<NEW_LINE>Base64.encode(b, 0, b.length, base64, 0);<NEW_LINE>request.append("\r\nProxy-Authorization: basic ").append(base64);<NEW_LINE>}<NEW_LINE>request.append("\r\n\r\n");<NEW_LINE>OutputStream out = s.getOutputStream();<NEW_LINE>out.write(request.toString().getBytes("US-ASCII"));<NEW_LINE>out.flush();<NEW_LINE>s.setSoTimeout(connectTimeout);<NEW_LINE>@SuppressWarnings("resource")<NEW_LINE>String response = new HTTPResponse(s).toString();<NEW_LINE>s.setSoTimeout(0);<NEW_LINE>if (!response.startsWith("HTTP/1.1 2"))<NEW_LINE>throw new IOException("Unable to tunnel through " + <MASK><NEW_LINE>}
s + ". Proxy returns \"" + response + '\"');
562,880
public Answer createVolume(final CreateObjectCommand cmd) {<NEW_LINE>final DataTO data = cmd.getData();<NEW_LINE>final VolumeObjectTO volume = (VolumeObjectTO) data;<NEW_LINE>try {<NEW_LINE>final Connection conn = hypervisorResource.getConnection();<NEW_LINE>final PrimaryDataStoreTO primaryStore = (PrimaryDataStoreTO) data.getDataStore();<NEW_LINE>final SR poolSr = hypervisorResource.getStorageRepository(conn, CitrixHelper.getSRNameLabel(primaryStore.getUuid(), primaryStore.getPoolType(), primaryStore.getPath()));<NEW_LINE>VDI.Record <MASK><NEW_LINE>vdir.nameLabel = volume.getName();<NEW_LINE>vdir.SR = poolSr;<NEW_LINE>vdir.type = Types.VdiType.USER;<NEW_LINE>vdir.virtualSize = volume.getSize();<NEW_LINE>VDI vdi;<NEW_LINE>vdi = VDI.create(conn, vdir);<NEW_LINE>vdir = vdi.getRecord(conn);<NEW_LINE>final VolumeObjectTO newVol = new VolumeObjectTO();<NEW_LINE>newVol.setName(vdir.nameLabel);<NEW_LINE>newVol.setSize(vdir.virtualSize);<NEW_LINE>newVol.setPath(vdir.uuid);<NEW_LINE>return new CreateObjectAnswer(newVol);<NEW_LINE>} catch (final Exception e) {<NEW_LINE>s_logger.debug("create volume failed: " + e.toString());<NEW_LINE>return new CreateObjectAnswer(e.toString());<NEW_LINE>}<NEW_LINE>}
vdir = new VDI.Record();
1,438,325
public Document loadDocumentAsLimitedStream(final DigestURL location, final CacheStrategy cachePolicy, final BlacklistType blacklistType, final ClientIdentification.Agent agent, final int maxLinks, final long maxBytes) throws IOException {<NEW_LINE>// load resource<NEW_LINE>Request request = request(location, true, false);<NEW_LINE>final StreamResponse streamResponse = this.openInputStream(request, cachePolicy, blacklistType, agent, -1);<NEW_LINE>final Response response = streamResponse.getResponse();<NEW_LINE>final <MASK><NEW_LINE>if (response == null)<NEW_LINE>throw new IOException("no Response for url " + url);<NEW_LINE>// if it is still not available, report an error<NEW_LINE>if (streamResponse.getContentStream() == null || response.getResponseHeader() == null) {<NEW_LINE>throw new IOException("no Content available for url " + url);<NEW_LINE>}<NEW_LINE>// parse resource<NEW_LINE>try {<NEW_LINE>Document[] documents = streamResponse.parseWithLimits(maxLinks, maxBytes);<NEW_LINE>Document merged = Document.mergeDocuments(location, response.getMimeType(), documents);<NEW_LINE>String x_robots_tag = response.getResponseHeader().getXRobotsTag();<NEW_LINE>if (x_robots_tag.indexOf("noindex", 0) >= 0) {<NEW_LINE>merged.setIndexingDenied(true);<NEW_LINE>}<NEW_LINE>return merged;<NEW_LINE>} catch (final Parser.Failure e) {<NEW_LINE>throw new IOException(e.getMessage());<NEW_LINE>}<NEW_LINE>}
DigestURL url = request.url();
1,567,450
final DescribeFeatureGroupResult executeDescribeFeatureGroup(DescribeFeatureGroupRequest describeFeatureGroupRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeFeatureGroupRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeFeatureGroupRequest> request = null;<NEW_LINE>Response<DescribeFeatureGroupResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeFeatureGroupRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeFeatureGroupRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "SageMaker");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeFeatureGroup");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeFeatureGroupResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeFeatureGroupResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
HandlerContextKey.SIGNING_REGION, getSigningRegion());
643,085
final AssumeRoleResult executeAssumeRole(AssumeRoleRequest assumeRoleRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(assumeRoleRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<AssumeRoleRequest> request = null;<NEW_LINE>Response<AssumeRoleResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new AssumeRoleRequestMarshaller().marshall(super.beforeMarshalling(assumeRoleRequest));<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, "STS");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "AssumeRole");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<AssumeRoleResult> responseHandler = new StaxResponseHandler<AssumeRoleResult>(new AssumeRoleResultStaxUnmarshaller());<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();
472,977
public static void interleavedToBuffered(InterleavedF32 src, DataBufferByte buffer, WritableRaster dst) {<NEW_LINE>if (src.getNumBands() != dst.getNumBands())<NEW_LINE>throw new IllegalArgumentException("Unequal number of bands src = " + src.getNumBands() + " dst = " + dst.getNumBands());<NEW_LINE>final byte[] dstData = buffer.getData();<NEW_LINE>final int numBands = dst.getNumBands();<NEW_LINE>final <MASK><NEW_LINE>int dstStride = stride(dst);<NEW_LINE>int dstOffset = getOffset(dst);<NEW_LINE>// CONCURRENT_BELOW BoofConcurrency.loopFor(0, src.height, y -> {<NEW_LINE>for (int y = 0; y < src.height; y++) {<NEW_LINE>int indexSrc = src.startIndex + src.stride * y;<NEW_LINE>int indexDst = dstOffset + dstStride * y;<NEW_LINE>int indexSrcEnd = indexSrc + length;<NEW_LINE>while (indexSrc < indexSrcEnd) {<NEW_LINE>dstData[indexDst++] = (byte) src.data[indexSrc++];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// CONCURRENT_ABOVE });<NEW_LINE>}
int length = src.width * numBands;
424,767
public BuiltinIntentSlot unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>BuiltinIntentSlot builtinIntentSlot = new BuiltinIntentSlot();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("name", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>builtinIntentSlot.setName(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 builtinIntentSlot;<NEW_LINE>}
String currentParentElement = context.getCurrentParentElement();
132,398
public static void main(String... args) {<NEW_LINE>// Note that we created two copies of each class to increase variety and avoid potential<NEW_LINE>// optimizations that wouldn't applicable in the real life.<NEW_LINE>autovalue.Main.main(args);<NEW_LINE>ComponentA componentA = new AutoValue_ComponentA(1, false, "hello", 42d, new int[] { 1, 2, 3 });<NEW_LINE>assertEquals(1, componentA.getIntField());<NEW_LINE>assertEquals(false, componentA.getBooleanField());<NEW_LINE>assertEquals(42d, componentA.getDoubleField());<NEW_LINE>assertEquals("hello", componentA.getStringField());<NEW_LINE>assertEquals(2, componentA.getArrayField()[1]);<NEW_LINE>CompositeA compositeA = new AutoValue_CompositeA(10, true, "world", 100d, componentA);<NEW_LINE>assertEquals(10, compositeA.getIntField());<NEW_LINE>assertEquals(<MASK><NEW_LINE>assertEquals("world", compositeA.getStringField());<NEW_LINE>assertEquals(100d, compositeA.getDoubleField());<NEW_LINE>assertEquals(componentA, compositeA.getComponentField());<NEW_LINE>assertEquals(componentA.hashCode(), compositeA.getComponentField().hashCode());<NEW_LINE>assertNotNull(compositeA.toString());<NEW_LINE>ComponentB componentB = new AutoValue_ComponentB(2, false, "hello", 43d, new int[] { 5, 6, 7 });<NEW_LINE>assertEquals(2, componentB.getIntField());<NEW_LINE>assertEquals(false, componentB.getBooleanField());<NEW_LINE>assertEquals(43d, componentB.getDoubleField());<NEW_LINE>assertEquals("hello", componentB.getStringField());<NEW_LINE>assertEquals(6, componentB.getArrayField()[1]);<NEW_LINE>CompositeB parent = new AutoValue_CompositeB(11, true, "world", 101d, componentB);<NEW_LINE>assertEquals(11, parent.getIntField());<NEW_LINE>assertEquals(true, parent.getBooleanField());<NEW_LINE>assertEquals("world", parent.getStringField());<NEW_LINE>assertEquals(101d, parent.getDoubleField());<NEW_LINE>assertEquals(componentB, parent.getComponentField());<NEW_LINE>assertEquals(componentB.hashCode(), parent.getComponentField().hashCode());<NEW_LINE>assertNotNull(parent.toString());<NEW_LINE>}
true, compositeA.getBooleanField());
262,987
ActionResult<List<Wo>> execute(EffectivePerson effectivePerson, Integer page, Integer size, JsonElement jsonElement) throws Exception {<NEW_LINE>try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {<NEW_LINE>Wi wi = this.convertToWrapIn(jsonElement, Wi.class);<NEW_LINE>ActionResult<List<Wo>> result = new ActionResult<>();<NEW_LINE>EntityManager em = emc.get(EmpowerLog.class);<NEW_LINE>CriteriaBuilder cb = em.getCriteriaBuilder();<NEW_LINE>CriteriaQuery<Tuple> cq = cb.createQuery(Tuple.class);<NEW_LINE>Root<EmpowerLog> root = <MASK><NEW_LINE>Predicate p = cb.equal(root.get(EmpowerLog_.toPerson), effectivePerson.getDistinguishedName());<NEW_LINE>if (StringUtils.isNotEmpty(wi.getKey())) {<NEW_LINE>String key = "%" + StringTools.escapeSqlLikeKey(wi.getKey()) + "%";<NEW_LINE>p = cb.and(p, cb.like(root.get(EmpowerLog_.title), key, StringTools.SQL_ESCAPE_CHAR));<NEW_LINE>}<NEW_LINE>List<Wo> wos = emc.fetchDescPaging(EmpowerLog.class, Wo.copier, p, page, size, EmpowerLog.createTime_FIELDNAME);<NEW_LINE>result.setData(wos);<NEW_LINE>result.setCount(emc.count(EmpowerLog.class, p));<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>}
cq.from(EmpowerLog.class);
440,618
public void visit(MethodInvocation node) {<NEW_LINE>if (isCancelled()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Identifier identifier = null;<NEW_LINE>if (node.getMethod().getFunctionName().getName() instanceof Variable) {<NEW_LINE>Variable variable = (Variable) node.getMethod().getFunctionName().getName();<NEW_LINE>if (variable.getName() instanceof Identifier) {<NEW_LINE>identifier = (Identifier) variable.getName();<NEW_LINE>}<NEW_LINE>} else if (node.getMethod().getFunctionName().getName() instanceof Identifier) {<NEW_LINE>identifier = (Identifier) node.getMethod().getFunctionName().getName();<NEW_LINE>}<NEW_LINE>if (identifier != null) {<NEW_LINE>ASTNodeColoring item = privateUnusedMethods.remove(new UnusedIdentifier(identifier.getName().toLowerCase(), typeInfo));<NEW_LINE>if (item != null) {<NEW_LINE>addColoringForNode(<MASK><NEW_LINE>}<NEW_LINE>addColoringForNode(identifier, METHOD_INVOCATION_SET);<NEW_LINE>}<NEW_LINE>super.visit(node);<NEW_LINE>}
item.identifier, item.coloring);
1,552,174
private void renderNotebookv2WithDialog(final DocUpdateSentinel sourceDoc) {<NEW_LINE>// default format<NEW_LINE>String format = sourceDoc.getProperty(NOTEBOOK_FORMAT);<NEW_LINE>if (StringUtil.isNullOrEmpty(format)) {<NEW_LINE>format = state_.compileRMarkdownNotebookPrefs().getValue().getFormat();<NEW_LINE>if (StringUtil.isNullOrEmpty(format))<NEW_LINE>format = CompileNotebookv2Options.FORMAT_DEFAULT;<NEW_LINE>}<NEW_LINE>CompileNotebookv2OptionsDialog dialog = new CompileNotebookv2OptionsDialog(format, new OperationWithInput<CompileNotebookv2Options>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void execute(CompileNotebookv2Options input) {<NEW_LINE>renderNotebookv2(sourceDoc, input.getFormat(), null);<NEW_LINE>// save options for this document<NEW_LINE>HashMap<String, String> changedProperties = new HashMap<>();<NEW_LINE>changedProperties.put(NOTEBOOK_FORMAT, input.getFormat());<NEW_LINE>sourceDoc.modifyProperties(changedProperties, null);<NEW_LINE>// save global prefs<NEW_LINE>CompileNotebookv2Prefs prefs = CompileNotebookv2Prefs.<MASK><NEW_LINE>if (!CompileNotebookv2Prefs.areEqual(prefs, state_.compileRMarkdownNotebookPrefs().getValue().cast())) {<NEW_LINE>state_.compileRMarkdownNotebookPrefs().setGlobalValue(prefs.cast());<NEW_LINE>state_.writeState();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>dialog.showModal();<NEW_LINE>}
create(input.getFormat());
994,476
public ModelAssembler addImport(URL url) {<NEW_LINE>Objects.requireNonNull(url, "The provided url to ModelAssembler#addImport was null");<NEW_LINE>// Format the key used to de-dupe files. Note that a "jar:" prefix<NEW_LINE>// can't be removed since it's needed in order to load files from JARs<NEW_LINE>// and differentiate between top-level JARs and contents of JARs.<NEW_LINE>String key = url.toExternalForm();<NEW_LINE>if (key.startsWith("file:")) {<NEW_LINE>try {<NEW_LINE>// Paths.get ensures paths are normalized for Windows too.<NEW_LINE>key = Paths.get(url.toURI()).toString();<NEW_LINE>} catch (URISyntaxException e) {<NEW_LINE>key = key.substring(5);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>inputStreamModels.put(key, () -> {<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>if (properties.containsKey(ModelAssembler.DISABLE_JAR_CACHE)) {<NEW_LINE>connection.setUseCaches(false);<NEW_LINE>}<NEW_LINE>return connection.getInputStream();<NEW_LINE>} catch (IOException | UncheckedIOException e) {<NEW_LINE>throw new ModelImportException("Unable to open Smithy model import URL: " + url.toExternalForm(), e);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return this;<NEW_LINE>}
URLConnection connection = url.openConnection();
1,354,887
private List<FhirVersionIndependentConcept> extractValueSetCodes(IBaseResource theValueSet) {<NEW_LINE>List<FhirVersionIndependentConcept> retVal = new ArrayList<>();<NEW_LINE>RuntimeResourceDefinition vsDef = myContext.getResourceDefinition("ValueSet");<NEW_LINE>BaseRuntimeChildDefinition expansionChild = vsDef.getChildByName("expansion");<NEW_LINE>Optional<IBase> expansionOpt = expansionChild.getAccessor().getFirstValueOrNull(theValueSet);<NEW_LINE>if (expansionOpt.isPresent()) {<NEW_LINE>IBase expansion = expansionOpt.get();<NEW_LINE>BaseRuntimeElementCompositeDefinition<?> expansionDef = (BaseRuntimeElementCompositeDefinition<?>) myContext.getElementDefinition(expansion.getClass());<NEW_LINE>BaseRuntimeChildDefinition containsChild = expansionDef.getChildByName("contains");<NEW_LINE>List<IBase> contains = containsChild.getAccessor().getValues(expansion);<NEW_LINE>BaseRuntimeChildDefinition.IAccessor systemAccessor = null;<NEW_LINE>BaseRuntimeChildDefinition.IAccessor codeAccessor = null;<NEW_LINE>for (IBase nextContains : contains) {<NEW_LINE>if (systemAccessor == null) {<NEW_LINE>systemAccessor = myContext.getElementDefinition(nextContains.getClass()).getChildByName("system").getAccessor();<NEW_LINE>}<NEW_LINE>if (codeAccessor == null) {<NEW_LINE>codeAccessor = myContext.getElementDefinition(nextContains.getClass()).getChildByName("code").getAccessor();<NEW_LINE>}<NEW_LINE>String system = systemAccessor.getFirstValueOrNull(nextContains).map(t -> (IPrimitiveType<?>) t).map(t -> t.getValueAsString<MASK><NEW_LINE>String code = codeAccessor.getFirstValueOrNull(nextContains).map(t -> (IPrimitiveType<?>) t).map(t -> t.getValueAsString()).orElse(null);<NEW_LINE>if (isNotBlank(system) && isNotBlank(code)) {<NEW_LINE>retVal.add(new FhirVersionIndependentConcept(system, code));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return retVal;<NEW_LINE>}
()).orElse(null);
1,022,938
public void subscribe(final FlowableEmitter<E> emitter) {<NEW_LINE>// If the Realm has been closed, just create an empty Observable because we assume it is going to be disposed shortly.<NEW_LINE>if (realm.isClosed())<NEW_LINE>return;<NEW_LINE>// Gets instance to make sure that the Realm is open for as long as the<NEW_LINE>// Observable is subscribed to it.<NEW_LINE>final Realm observableRealm = Realm.getInstance(realmConfig);<NEW_LINE>objectRefs.get().acquireReference(object);<NEW_LINE>final RealmChangeListener<E> listener = new RealmChangeListener<E>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onChange(E obj) {<NEW_LINE>if (!emitter.isCancelled()) {<NEW_LINE>emitter.onNext(returnFrozenObjects ? RealmObject.freeze(obj) : obj);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>};<NEW_LINE>RealmObject.addChangeListener(object, listener);<NEW_LINE>// Cleanup when stream is disposed<NEW_LINE>emitter.setDisposable(Disposables.fromRunnable(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>if (!observableRealm.isClosed()) {<NEW_LINE>RealmObject.removeChangeListener(object, listener);<NEW_LINE>observableRealm.close();<NEW_LINE>}<NEW_LINE>objectRefs.<MASK><NEW_LINE>}<NEW_LINE>}));<NEW_LINE>// Emit current value immediately<NEW_LINE>emitter.onNext(returnFrozenObjects ? RealmObject.freeze(object) : object);<NEW_LINE>}
get().releaseReference(object);
151,272
public void apply() throws ConfigurationException {<NEW_LINE>if (myEditor != null && myEditor.isModified()) {<NEW_LINE>myModified = true;<NEW_LINE>myEditor.apply();<NEW_LINE>}<NEW_LINE>for (FileTemplateTab list : myTabs) {<NEW_LINE>checkCanApply(list);<NEW_LINE>}<NEW_LINE>updateCache();<NEW_LINE>for (Map.Entry<FileTemplatesScheme, Map<String, FileTemplate[]>> entry : myChangesCache.entrySet()) {<NEW_LINE>myManager.setCurrentScheme(entry.getKey());<NEW_LINE>myManager.setTemplates(DEFAULT_TEMPLATES_CATEGORY, Arrays.asList(entry.getValue().get(DEFAULT_TEMPLATES_CATEGORY)));<NEW_LINE>myManager.setTemplates(INTERNAL_TEMPLATES_CATEGORY, Arrays.asList(entry.getValue().get(INTERNAL_TEMPLATES_CATEGORY)));<NEW_LINE>myManager.setTemplates(INCLUDES_TEMPLATES_CATEGORY, Arrays.asList(entry.getValue().get(INCLUDES_TEMPLATES_CATEGORY)));<NEW_LINE>myManager.setTemplates(CODE_TEMPLATES_CATEGORY, Arrays.asList(entry.getValue(<MASK><NEW_LINE>myManager.setTemplates(J2EE_TEMPLATES_CATEGORY, Arrays.asList(entry.getValue().get(J2EE_TEMPLATES_CATEGORY)));<NEW_LINE>}<NEW_LINE>myChangesCache.clear();<NEW_LINE>myManager.setCurrentScheme(myScheme);<NEW_LINE>if (myEditor != null) {<NEW_LINE>myModified = false;<NEW_LINE>fireListChanged();<NEW_LINE>}<NEW_LINE>}
).get(CODE_TEMPLATES_CATEGORY)));
981,504
private void buildAtlas() {<NEW_LINE>calculateAtlasSizes();<NEW_LINE>int numMipMaps = getNumMipmaps();<NEW_LINE>ByteBuffer[] data = createAtlasMipmaps(numMipMaps, TRANSPARENT_COLOR, tiles, "tiles.png");<NEW_LINE>ByteBuffer[] dataNormal = createAtlasMipmaps(numMipMaps, UNIT_Z_COLOR, tilesNormal, "tilesNormal.png", tilesGloss);<NEW_LINE>ByteBuffer[] dataHeight = createAtlasMipmaps(numMipMaps, MID_RED_COLOR, tilesHeight, "tilesHeight.png");<NEW_LINE>TextureData terrainTexData = new TextureData(atlasSize, atlasSize, data, Texture.WrapMode.CLAMP, Texture.FilterMode.NEAREST);<NEW_LINE>Texture terrainTex = Assets.generateAsset(new ResourceUrn("engine:terrain"), terrainTexData, Texture.class);<NEW_LINE>TextureData terrainNormalData = new TextureData(atlasSize, atlasSize, dataNormal, Texture.WrapMode.CLAMP, Texture.FilterMode.NEAREST);<NEW_LINE>Assets.generateAsset(new ResourceUrn("engine:terrainNormal"), terrainNormalData, Texture.class);<NEW_LINE>TextureData terrainHeightData = new TextureData(atlasSize, atlasSize, dataHeight, Texture.WrapMode.CLAMP, Texture.FilterMode.LINEAR);<NEW_LINE>Assets.generateAsset(new ResourceUrn("engine:terrainHeight"), terrainHeightData, Texture.class);<NEW_LINE>MaterialData terrainMatData = new MaterialData(Assets.getShader("engine:block").get());<NEW_LINE><MASK><NEW_LINE>terrainMatData.setParam("colorOffset", new float[] { 1, 1, 1 });<NEW_LINE>terrainMatData.setParam("textured", true);<NEW_LINE>Assets.generateAsset(new ResourceUrn("engine:terrain"), terrainMatData, Material.class);<NEW_LINE>createTextureAtlas(terrainTex);<NEW_LINE>}
terrainMatData.setParam("textureAtlas", terrainTex);
399,693
public Request<DescribeRegionsRequest> marshall(DescribeRegionsRequest describeRegionsRequest) {<NEW_LINE>if (describeRegionsRequest == null) {<NEW_LINE>throw new AmazonClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>Request<DescribeRegionsRequest> request = new DefaultRequest<DescribeRegionsRequest>(describeRegionsRequest, "AmazonEC2");<NEW_LINE><MASK><NEW_LINE>request.addParameter("Version", "2015-10-01");<NEW_LINE>java.util.List<String> regionNamesList = describeRegionsRequest.getRegionNames();<NEW_LINE>int regionNamesListIndex = 1;<NEW_LINE>for (String regionNamesListValue : regionNamesList) {<NEW_LINE>if (regionNamesListValue != null) {<NEW_LINE>request.addParameter("RegionName." + regionNamesListIndex, StringUtils.fromString(regionNamesListValue));<NEW_LINE>}<NEW_LINE>regionNamesListIndex++;<NEW_LINE>}<NEW_LINE>java.util.List<Filter> filtersList = describeRegionsRequest.getFilters();<NEW_LINE>int filtersListIndex = 1;<NEW_LINE>for (Filter filtersListValue : filtersList) {<NEW_LINE>Filter filterMember = filtersListValue;<NEW_LINE>if (filterMember != null) {<NEW_LINE>if (filterMember.getName() != null) {<NEW_LINE>request.addParameter("Filter." + filtersListIndex + ".Name", StringUtils.fromString(filterMember.getName()));<NEW_LINE>}<NEW_LINE>java.util.List<String> valuesList = filterMember.getValues();<NEW_LINE>int valuesListIndex = 1;<NEW_LINE>for (String valuesListValue : valuesList) {<NEW_LINE>if (valuesListValue != null) {<NEW_LINE>request.addParameter("Filter." + filtersListIndex + ".Value." + valuesListIndex, StringUtils.fromString(valuesListValue));<NEW_LINE>}<NEW_LINE>valuesListIndex++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>filtersListIndex++;<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>}
request.addParameter("Action", "DescribeRegions");
139,447
public Expression<?> visit(TemplateExpression<?> expr, Context context) {<NEW_LINE>Object[] args = new Object[expr.getArgs().size()];<NEW_LINE>for (int i = 0; i < args.length; i++) {<NEW_LINE>Context c = new Context();<NEW_LINE>if (expr.getArg(i) instanceof Expression) {<NEW_LINE>args[i] = ((Expression<?>) expr.getArg(i)).accept(this, c);<NEW_LINE>} else {<NEW_LINE>args[i<MASK><NEW_LINE>}<NEW_LINE>context.add(c);<NEW_LINE>}<NEW_LINE>if (context.replace) {<NEW_LINE>if (expr.getType().equals(Boolean.class)) {<NEW_LINE>Predicate predicate = Expressions.booleanTemplate(expr.getTemplate(), args);<NEW_LINE>return !context.paths.isEmpty() ? exists(context, predicate) : predicate;<NEW_LINE>} else {<NEW_LINE>return ExpressionUtils.template(expr.getType(), expr.getTemplate(), args);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>return expr;<NEW_LINE>}<NEW_LINE>}
] = expr.getArg(i);
1,484,410
private I_M_HU_PI_Item_Product extractHUPIItemProduct(final I_C_Order order, final I_C_OrderLine orderLine) {<NEW_LINE>final I_M_HU_PI_Item_Product materialItemProduct;<NEW_LINE>if (orderLine.getM_HU_PI_Item_Product_ID() > 0) {<NEW_LINE>materialItemProduct = orderLine.getM_HU_PI_Item_Product();<NEW_LINE>} else {<NEW_LINE>final ProductId productId = ProductId.ofRepoId(orderLine.getM_Product_ID());<NEW_LINE>final BPartnerId buyerBPartnerId = BPartnerId.<MASK><NEW_LINE>final ZoneId timeZone = orgDAO.getTimeZone(OrgId.ofRepoId(order.getAD_Org_ID()));<NEW_LINE>materialItemProduct = hupiItemProductDAO.retrieveMaterialItemProduct(productId, buyerBPartnerId, TimeUtil.asZonedDateTime(order.getDateOrdered(), timeZone), X_M_HU_PI_Version.HU_UNITTYPE_TransportUnit, true);<NEW_LINE>}<NEW_LINE>return materialItemProduct;<NEW_LINE>}
ofRepoId(order.getC_BPartner_ID());
1,067,080
public void run() {<NEW_LINE>if (msg == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>ChannelBuffer frameBuffer;<NEW_LINE>if (frameDecoder != null) {<NEW_LINE>try {<NEW_LINE>frameBuffer = frameDecoder.decode((ChannelBuffer) msg);<NEW_LINE>if (frameBuffer == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>frameBuffer = (ChannelBuffer) msg;<NEW_LINE>}<NEW_LINE>int size = frameBuffer.readableBytes();<NEW_LINE><MASK><NEW_LINE>// start to decode<NEW_LINE>IBuffer iBuffer = IBuffer.make(null, size);<NEW_LINE>IPacket iPacket = IPacket.make(iBuffer);<NEW_LINE>iPacket.getByteBuffer().put(frameBuffer.toByteBuffer());<NEW_LINE>// decode the packet<NEW_LINE>if (!iPacket.isComplete()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>IVideoPicture picture = IVideoPicture.make(IPixelFormat.Type.YUV420P, dimension.width, dimension.height);<NEW_LINE>try {<NEW_LINE>// decode the packet into the video picture<NEW_LINE>int postion = 0;<NEW_LINE>int packageSize = iPacket.getSize();<NEW_LINE>while (postion < packageSize) {<NEW_LINE>postion += iStreamCoder.decodeVideo(picture, iPacket, postion);<NEW_LINE>if (postion < 0) {<NEW_LINE>throw new RuntimeException("error " + " decoding video");<NEW_LINE>}<NEW_LINE>// if this is a complete picture, dispatch the picture<NEW_LINE>if (picture.isComplete()) {<NEW_LINE>IConverter converter = ConverterFactory.createConverter(type.getDescriptor(), picture);<NEW_LINE>BufferedImage image = converter.toImage(picture);<NEW_LINE>// BufferedImage convertedImage = ImageUtils.convertToType(image,<NEW_LINE>// BufferedImage.TYPE_3BYTE_BGR);<NEW_LINE>// here ,put out the image<NEW_LINE>if (streamFrameListener != null) {<NEW_LINE>streamFrameListener.onFrameReceived(image);<NEW_LINE>}<NEW_LINE>converter.delete();<NEW_LINE>} else {<NEW_LINE>picture.delete();<NEW_LINE>iPacket.delete();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// clean the picture and reuse it<NEW_LINE>picture.getByteBuffer().clear();<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>if (picture != null) {<NEW_LINE>picture.delete();<NEW_LINE>}<NEW_LINE>iPacket.delete();<NEW_LINE>// ByteBufferUtil.destroy(data);<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}
logger.info("decode the frame size :{}", size);
1,222,819
public void testMPConfigSpecifiesDefaultContextPropagationForThreadContext() throws Exception {<NEW_LINE>// Defaults:<NEW_LINE>// mp.context.ThreadContext.cleared=<NEW_LINE>// mp.context.ThreadContext.propagated=State<NEW_LINE>// mp.context.ThreadContext.unchanged=Remaining<NEW_LINE>ThreadContext threadContext = ThreadContext.builder().build();<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>// Run on same thread to confirm cleared context<NEW_LINE>Runnable test = threadContext.contextualRunnable(() -> {<NEW_LINE>assertEquals("Context type not left unchanged.", "Oskaloosa", CurrentLocation.getCity());<NEW_LINE>assertEquals("Context type not propagated.", "Minnesota", CurrentLocation.getState());<NEW_LINE>CurrentLocation.setLocation("Wasau", "Wisconsin");<NEW_LINE>});<NEW_LINE>CurrentLocation.setLocation("Oskaloosa", "Iowa");<NEW_LINE>test.run();<NEW_LINE>assertEquals("Context type not restored.", "Wasau", CurrentLocation.getCity());<NEW_LINE>assertEquals("Context type not restored.", "Iowa", CurrentLocation.getState());<NEW_LINE>} finally {<NEW_LINE>CurrentLocation.clear();<NEW_LINE>}<NEW_LINE>}
CurrentLocation.setLocation("Owatonna", "Minnesota");
748,192
static CdmTraitReference createCsvTrait(final CsvFormatSettings obj, final CdmCorpusContext ctx) {<NEW_LINE>final CdmTraitReference csvFormatTrait = ctx.getCorpus().makeRef(CdmObjectType.TraitRef, "is.partition.format.CSV", true);<NEW_LINE>csvFormatTrait.setSimpleNamedReference(false);<NEW_LINE>if (obj.isColumnHeaders() != null) {<NEW_LINE>final CdmArgumentDefinition columnHeadersArg = ctx.getCorpus().makeObject(CdmObjectType.ArgumentDef, "columnHeaders");<NEW_LINE>columnHeadersArg.setValue(obj.<MASK><NEW_LINE>csvFormatTrait.getArguments().add(columnHeadersArg);<NEW_LINE>}<NEW_LINE>if (obj.getCsvStyle() != null) {<NEW_LINE>final CdmArgumentDefinition csvStyleArg = ctx.getCorpus().makeObject(CdmObjectType.ArgumentDef, "csvStyle");<NEW_LINE>csvStyleArg.setValue(obj.getCsvStyle());<NEW_LINE>csvFormatTrait.getArguments().add(csvStyleArg);<NEW_LINE>}<NEW_LINE>if (obj.getDelimiter() != null) {<NEW_LINE>final CdmArgumentDefinition delimiterArg = ctx.getCorpus().makeObject(CdmObjectType.ArgumentDef, "delimiter");<NEW_LINE>delimiterArg.setValue(obj.getDelimiter());<NEW_LINE>csvFormatTrait.getArguments().add(delimiterArg);<NEW_LINE>}<NEW_LINE>if (obj.getQuoteStyle() != null) {<NEW_LINE>final CdmArgumentDefinition quoteStyleArg = ctx.getCorpus().makeObject(CdmObjectType.ArgumentDef, "quoteStyle");<NEW_LINE>quoteStyleArg.setValue(obj.getQuoteStyle());<NEW_LINE>csvFormatTrait.getArguments().add(quoteStyleArg);<NEW_LINE>}<NEW_LINE>if (obj.getEncoding() != null) {<NEW_LINE>final CdmArgumentDefinition encodingArg = ctx.getCorpus().makeObject(CdmObjectType.ArgumentDef, "encoding");<NEW_LINE>encodingArg.setValue(obj.getEncoding());<NEW_LINE>csvFormatTrait.getArguments().add(encodingArg);<NEW_LINE>}<NEW_LINE>return csvFormatTrait;<NEW_LINE>}
isColumnHeaders() ? "true" : "false");
751,142
public static List<GiphyMp4ProjectionPlayerHolder> injectVideoViews(@NonNull Context context, @NonNull Lifecycle lifecycle, @NonNull ViewGroup viewGroup, int nPlayers) {<NEW_LINE>List<GiphyMp4ProjectionPlayerHolder> holders <MASK><NEW_LINE>for (int i = 0; i < nPlayers; i++) {<NEW_LINE>FrameLayout container = (FrameLayout) LayoutInflater.from(context).inflate(R.layout.giphy_mp4_player, viewGroup, false);<NEW_LINE>GiphyMp4VideoPlayer player = container.findViewById(R.id.video_player);<NEW_LINE>GiphyMp4ProjectionPlayerHolder holder = new GiphyMp4ProjectionPlayerHolder(container, player);<NEW_LINE>lifecycle.addObserver(holder);<NEW_LINE>player.setResizeMode(AspectRatioFrameLayout.RESIZE_MODE_FILL);<NEW_LINE>holders.add(holder);<NEW_LINE>viewGroup.addView(container);<NEW_LINE>}<NEW_LINE>return holders;<NEW_LINE>}
= new ArrayList<>(nPlayers);
1,818,441
public void deleteById(String id) {<NEW_LINE>String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups");<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id)));<NEW_LINE>}<NEW_LINE>String resourceName = <MASK><NEW_LINE>if (resourceName == null) {<NEW_LINE>throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'signalR'.", id)));<NEW_LINE>}<NEW_LINE>String certificateName = Utils.getValueFromIdByName(id, "customCertificates");<NEW_LINE>if (certificateName == null) {<NEW_LINE>throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'customCertificates'.", id)));<NEW_LINE>}<NEW_LINE>this.deleteWithResponse(resourceGroupName, resourceName, certificateName, Context.NONE);<NEW_LINE>}
Utils.getValueFromIdByName(id, "signalR");
531,561
public GetPolicyResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>GetPolicyResult getPolicyResult = new GetPolicyResult();<NEW_LINE>AwsJsonReader reader = context.getReader();<NEW_LINE>reader.beginObject();<NEW_LINE>while (reader.hasNext()) {<NEW_LINE>String name = reader.nextName();<NEW_LINE>if (name.equals("policyName")) {<NEW_LINE>getPolicyResult.setPolicyName(StringJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>} else if (name.equals("policyArn")) {<NEW_LINE>getPolicyResult.setPolicyArn(StringJsonUnmarshaller.getInstance<MASK><NEW_LINE>} else if (name.equals("policyDocument")) {<NEW_LINE>getPolicyResult.setPolicyDocument(StringJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>} else if (name.equals("defaultVersionId")) {<NEW_LINE>getPolicyResult.setDefaultVersionId(StringJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>} else if (name.equals("creationDate")) {<NEW_LINE>getPolicyResult.setCreationDate(DateJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>} else if (name.equals("lastModifiedDate")) {<NEW_LINE>getPolicyResult.setLastModifiedDate(DateJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>} else if (name.equals("generationId")) {<NEW_LINE>getPolicyResult.setGenerationId(StringJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>} else {<NEW_LINE>reader.skipValue();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>reader.endObject();<NEW_LINE>return getPolicyResult;<NEW_LINE>}
().unmarshall(context));
1,460,900
private StringBuilder buildMergeInfoBasic(boolean useQualifier, TableDef tableDef, List<ColumnDef> allColumns, List<ColumnDef> primaryColumns) {<NEW_LINE>StringBuilder mergeBuilder = new StringBuilder();<NEW_LINE>String finalTableName = tableName(useQualifier, tableDef);<NEW_LINE>mergeBuilder.append("MERGE INTO " + finalTableName + " TMP USING( SELECT ");<NEW_LINE>for (int i = 0; i < allColumns.size(); i++) {<NEW_LINE>ColumnDef columnDef = allColumns.get(i);<NEW_LINE>if (i != 0) {<NEW_LINE>mergeBuilder.append(" , ");<NEW_LINE>}<NEW_LINE>mergeBuilder.append("? " + columnName(useQualifier, tableDef, columnDef));<NEW_LINE>}<NEW_LINE>mergeBuilder.append(" FROM dual) SRC ON (");<NEW_LINE>for (int i = 0; i < primaryColumns.size(); i++) {<NEW_LINE>if (i != 0) {<NEW_LINE>mergeBuilder.append(" AND ");<NEW_LINE>}<NEW_LINE>String pkColumn = columnName(useQualifier, tableDef, primaryColumns.get(i));<NEW_LINE>mergeBuilder.append(<MASK><NEW_LINE>}<NEW_LINE>mergeBuilder.append(")");<NEW_LINE>return mergeBuilder;<NEW_LINE>}
"TMP." + pkColumn + " = SRC." + pkColumn);
1,497,232
final DescribeStandardsControlsResult executeDescribeStandardsControls(DescribeStandardsControlsRequest describeStandardsControlsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeStandardsControlsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeStandardsControlsRequest> request = null;<NEW_LINE>Response<DescribeStandardsControlsResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new DescribeStandardsControlsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeStandardsControlsRequest));<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, "SecurityHub");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeStandardsControls");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeStandardsControlsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeStandardsControlsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
274,701
FSRL findFile(File dir, ExternalDebugInfo debugInfo, TaskMonitor monitor) throws IOException, CancelledException {<NEW_LINE>if (!debugInfo.hasFilename()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>File file = new File(dir, debugInfo.getFilename());<NEW_LINE>if (file.isFile()) {<NEW_LINE>int fileCRC = calcCRC(file);<NEW_LINE>if (fileCRC == debugInfo.getCrc()) {<NEW_LINE>return FileSystemService.<MASK><NEW_LINE>}<NEW_LINE>Msg.info(this, "DWARF external debug file found with mismatching crc, ignored: " + file + ", (" + Integer.toHexString(fileCRC) + ")");<NEW_LINE>}<NEW_LINE>File[] subDirs;<NEW_LINE>if ((subDirs = dir.listFiles(f -> f.isDirectory())) != null) {<NEW_LINE>for (File subDir : subDirs) {<NEW_LINE>FSRL result = findFile(subDir, debugInfo, monitor);<NEW_LINE>if (result != null) {<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
getInstance().getLocalFSRL(file);
232,666
protected void addBlocker(Game game, List<Permanent> blockers, Map<Integer, Combat> engagements) {<NEW_LINE>if (blockers.isEmpty())<NEW_LINE>return;<NEW_LINE>int numGroups = game.getCombat().getGroups().size();<NEW_LINE>// try to block each attacker with each potential blocker<NEW_LINE>Permanent <MASK><NEW_LINE>if (logger.isDebugEnabled())<NEW_LINE>logger.debug("simulating -- block:" + blocker);<NEW_LINE>List<Permanent> remaining = remove(blockers, blocker);<NEW_LINE>for (int i = 0; i < numGroups; i++) {<NEW_LINE>if (game.getCombat().getGroups().get(i).canBlock(blocker, game)) {<NEW_LINE>Game sim = game.copy();<NEW_LINE>sim.getCombat().getGroups().get(i).addBlocker(blocker.getId(), playerId, sim);<NEW_LINE>if (engagements.put(sim.getCombat().getValue().hashCode(), sim.getCombat()) != null)<NEW_LINE>logger.debug("simulating -- found redundant block combination");<NEW_LINE>// and recurse minus the used blocker<NEW_LINE>addBlocker(sim, remaining, engagements);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>addBlocker(game, remaining, engagements);<NEW_LINE>}
blocker = blockers.get(0);
232
public String saveData(List<ListElement> noModel, List<ListElement> yesModel) {<NEW_LINE>//<NEW_LINE>log.fine("");<NEW_LINE>StringBuffer info = new StringBuffer();<NEW_LINE>MTable table = MTable.get(Env.getCtx(), tableId);<NEW_LINE>// noList - Set SortColumn to null and optional YesNo Column to 'N'<NEW_LINE>for (ListElement item : noModel) {<NEW_LINE>if (!item.isUpdateable())<NEW_LINE>continue;<NEW_LINE>if (item.getSortNo() == 0 && (columnYesNoName == null || !item.isYes()))<NEW_LINE>// no changes<NEW_LINE>continue;<NEW_LINE>//<NEW_LINE>PO po = table.getPO(item.getKey(), null);<NEW_LINE>po.set_ValueOfColumn(columnSortName, 0);<NEW_LINE>po.set_ValueOfColumn(columnYesNoName, false);<NEW_LINE>if (po.save()) {<NEW_LINE>item.setSortNo(0);<NEW_LINE>item.setIsYes(false);<NEW_LINE>} else {<NEW_LINE>if (info.length() > 0)<NEW_LINE>info.append(", ");<NEW_LINE>info.append(item.getName());<NEW_LINE>log.log(Level.SEVERE, "NoModel - Not updated: " + keyColumnName + "=" + item.getKey());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// yesList - Set SortColumn to value and optional YesNo Column to 'Y'<NEW_LINE>int index = 0;<NEW_LINE>for (ListElement item : yesModel) {<NEW_LINE>if (!item.isUpdateable())<NEW_LINE>continue;<NEW_LINE>index += 10;<NEW_LINE>if (item.getSortNo() == index && (columnYesNoName == null || item.isYes()))<NEW_LINE>// no changes<NEW_LINE>continue;<NEW_LINE>//<NEW_LINE>PO po = table.getPO(item.getKey(), null);<NEW_LINE>po.set_ValueOfColumn(columnSortName, index);<NEW_LINE><MASK><NEW_LINE>if (po.save()) {<NEW_LINE>item.setSortNo(index);<NEW_LINE>item.setIsYes(true);<NEW_LINE>} else {<NEW_LINE>if (info.length() > 0)<NEW_LINE>info.append(", ");<NEW_LINE>info.append(item.getName());<NEW_LINE>log.log(Level.SEVERE, "YesModel - Not updated: " + keyColumnName + "=" + item.getKey());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// For error<NEW_LINE>if (info.length() > 0) {<NEW_LINE>return info.toString();<NEW_LINE>}<NEW_LINE>//<NEW_LINE>return null;<NEW_LINE>}
po.set_ValueOfColumn(columnYesNoName, true);
274,956
protected void markTargetPermission(OperationPermissionTarget target, String property, EntityOp operation, PermissionVariant permissionVariant) {<NEW_LINE>if (target != null) {<NEW_LINE>target.setValue(property, permissionVariant);<NEW_LINE>String permissionValue = target.getPermissionValue() + Permission.TARGET_PATH_DELIMETER + operation.getId();<NEW_LINE>if (permissionVariant != PermissionVariant.NOTSET) {<NEW_LINE>// Create permission<NEW_LINE>int value = PermissionUiHelper.getPermissionValue(permissionVariant);<NEW_LINE>PermissionUiHelper.createPermissionItem(entityPermissionsDs, roleDs, <MASK><NEW_LINE>} else {<NEW_LINE>// Remove permission<NEW_LINE>Permission permission = null;<NEW_LINE>for (Permission p : entityPermissionsDs.getItems()) {<NEW_LINE>if (Objects.equals(p.getTarget(), permissionValue)) {<NEW_LINE>permission = p;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (permission != null)<NEW_LINE>entityPermissionsDs.removeItem(permission);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
permissionValue, PermissionType.ENTITY_OP, value);
800,103
final ListPublishingDestinationsResult executeListPublishingDestinations(ListPublishingDestinationsRequest listPublishingDestinationsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listPublishingDestinationsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<ListPublishingDestinationsRequest> request = null;<NEW_LINE>Response<ListPublishingDestinationsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListPublishingDestinationsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listPublishingDestinationsRequest));<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, "GuardDuty");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListPublishingDestinations");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListPublishingDestinationsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListPublishingDestinationsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
600,391
public static Element svgWaitIcon(Document document, double x, double y, double w, double h) {<NEW_LINE>Element g = SVGUtil.svgElement(document, SVGConstants.SVG_G_TAG);<NEW_LINE>setAtt(g, SVGConstants.SVG_TRANSFORM_ATTRIBUTE, "translate(" + x + " " + y + ") scale(" + w + " " + h + ")");<NEW_LINE>Element thro = SVGUtil.svgElement(document, SVGConstants.SVG_PATH_TAG);<NEW_LINE>setAtt(thro, SVGConstants.SVG_D_ATTRIBUTE, THROBBER_PATH);<NEW_LINE>setStyle(thro, THROBBER_STYLE);<NEW_LINE>Element anim = SVGUtil.svgElement(document, SVGConstants.SVG_ANIMATE_TRANSFORM_TAG);<NEW_LINE>setAtt(anim, SVGConstants.SVG_ATTRIBUTE_NAME_ATTRIBUTE, SVGConstants.SVG_TRANSFORM_ATTRIBUTE);<NEW_LINE>setAtt(anim, SVGConstants.SVG_ATTRIBUTE_TYPE_ATTRIBUTE, "XML");<NEW_LINE>setAtt(anim, SVGConstants.SVG_TYPE_ATTRIBUTE, SVGConstants.SVG_ROTATE_ATTRIBUTE);<NEW_LINE>setAtt(anim, SVGConstants.SVG_FROM_ATTRIBUTE, "0 .5 .5");<NEW_LINE>setAtt(anim, SVGConstants.SVG_TO_ATTRIBUTE, "360 .5 .5");<NEW_LINE>setAtt(anim, SVGConstants.SVG_BEGIN_ATTRIBUTE, fmt(Math.random() * 2) + "s");<NEW_LINE>setAtt(anim, SVGConstants.SVG_DUR_ATTRIBUTE, "2s");<NEW_LINE>setAtt(<MASK><NEW_LINE>setAtt(anim, SVGConstants.SVG_FILL_ATTRIBUTE, "freeze");<NEW_LINE>thro.appendChild(anim);<NEW_LINE>g.appendChild(thro);<NEW_LINE>return g;<NEW_LINE>}
anim, SVGConstants.SVG_REPEAT_COUNT_ATTRIBUTE, "indefinite");
161,336
List<ZeebePartition> constructPartitions(final RaftPartitionGroup partitionGroup, final List<PartitionListener> partitionListeners, final TopologyManager topologyManager) {<NEW_LINE>final var partitions <MASK><NEW_LINE>final var communicationService = clusterServices.getCommunicationService();<NEW_LINE>final var eventService = clusterServices.getEventService();<NEW_LINE>final var membershipService = clusterServices.getMembershipService();<NEW_LINE>final MemberId nodeId = membershipService.getLocalMember().id();<NEW_LINE>final List<RaftPartition> owningPartitions = partitionGroup.getPartitionsWithMember(nodeId).stream().map(RaftPartition.class::cast).collect(Collectors.toList());<NEW_LINE>final var typedRecordProcessorsFactory = createFactory(topologyManager, localBroker, communicationService, eventService, deploymentRequestHandler);<NEW_LINE>for (final RaftPartition owningPartition : owningPartitions) {<NEW_LINE>final var partitionId = owningPartition.id().id();<NEW_LINE>final ConstructableSnapshotStore constructableSnapshotStore = snapshotStoreFactory.getConstructableSnapshotStore(partitionId);<NEW_LINE>final StateController stateController = createStateController(owningPartition, constructableSnapshotStore, snapshotStoreFactory.getSnapshotStoreConcurrencyControl(partitionId));<NEW_LINE>final PartitionStartupAndTransitionContextImpl partitionStartupAndTransitionContext = new PartitionStartupAndTransitionContextImpl(localBroker.getNodeId(), owningPartition, partitionListeners, new AtomixPartitionMessagingService(communicationService, membershipService, owningPartition.members()), actorSchedulingService, brokerCfg, commandApiService::newCommandResponseWriter, () -> commandApiService.getOnProcessedListener(partitionId), constructableSnapshotStore, snapshotStoreFactory.getReceivableSnapshotStore(partitionId), stateController, typedRecordProcessorsFactory, exporterRepository, new PartitionProcessingState(owningPartition));<NEW_LINE>final PartitionTransition newTransitionBehavior = new PartitionTransitionImpl(TRANSITION_STEPS);<NEW_LINE>final ZeebePartition zeebePartition = new ZeebePartition(partitionStartupAndTransitionContext, newTransitionBehavior, STARTUP_STEPS);<NEW_LINE>healthCheckService.registerMonitoredPartition(zeebePartition.getPartitionId(), zeebePartition);<NEW_LINE>partitions.add(zeebePartition);<NEW_LINE>}<NEW_LINE>return partitions;<NEW_LINE>}
= new ArrayList<ZeebePartition>();
1,684,977
protected ImageWritable doTransform(ImageWritable image, Random random) {<NEW_LINE>if (image == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>// ensure that transform is valid<NEW_LINE>if (image.getFrame().imageHeight < outputHeight || image.getFrame().imageWidth < outputWidth)<NEW_LINE>throw new UnsupportedOperationException("Output height/width cannot be more than the input image. Requested: " + outputHeight + "+x" + outputWidth + ", got " + image.getFrame().imageHeight + "+x" + image.getFrame().imageWidth);<NEW_LINE>// determine boundary to place random offset<NEW_LINE>int cropTop = image.getFrame().imageHeight - outputHeight;<NEW_LINE>int cropLeft = image.getFrame().imageWidth - outputWidth;<NEW_LINE>Mat mat = converter.convert(image.getFrame());<NEW_LINE>int top = rng.nextInt(cropTop + 1);<NEW_LINE>int left = <MASK><NEW_LINE>y = Math.min(top, mat.rows() - 1);<NEW_LINE>x = Math.min(left, mat.cols() - 1);<NEW_LINE>Mat result = mat.apply(new Rect(x, y, outputWidth, outputHeight));<NEW_LINE>return new ImageWritable(converter.convert(result));<NEW_LINE>}
rng.nextInt(cropLeft + 1);