idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
785,559 | public static void enableLoggingOfRequestAndResponseIfValidationFails(LogDetail logDetail) {<NEW_LINE>LogConfig logConfig = LogConfig.<MASK><NEW_LINE>config = RestAssured.config().logConfig(logConfig);<NEW_LINE>// Update request specification if already defined otherwise it'll override the configs.<NEW_LINE>// Note that request spec also influence response spec when it comes to logging if validation fails due to the way filters work<NEW_LINE>if (requestSpecification != null && requestSpecification instanceof RequestSpecificationImpl) {<NEW_LINE>RestAssuredConfig restAssuredConfig = ((RequestSpecificationImpl) requestSpecification).getConfig();<NEW_LINE>if (restAssuredConfig == null) {<NEW_LINE>restAssuredConfig = config;<NEW_LINE>} else {<NEW_LINE>LogConfig logConfigForRequestSpec = restAssuredConfig.getLogConfig().enableLoggingOfRequestAndResponseIfValidationFails(logDetail);<NEW_LINE>restAssuredConfig = restAssuredConfig.logConfig(logConfigForRequestSpec);<NEW_LINE>}<NEW_LINE>requestSpecification.config(restAssuredConfig);<NEW_LINE>}<NEW_LINE>} | logConfig().enableLoggingOfRequestAndResponseIfValidationFails(logDetail); |
139,157 | public void deleteById(String id) {<NEW_LINE>String groupName = Utils.getValueFromIdByName(id, "resourceGroups");<NEW_LINE>if (groupName == 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 serviceName = Utils.getValueFromIdByName(id, "services");<NEW_LINE>if (serviceName == null) {<NEW_LINE>throw logger.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'services'.", id)));<NEW_LINE>}<NEW_LINE>String projectName = Utils.getValueFromIdByName(id, "projects");<NEW_LINE>if (projectName == null) {<NEW_LINE>throw logger.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'projects'.", id)));<NEW_LINE>}<NEW_LINE>String taskName = Utils.getValueFromIdByName(id, "tasks");<NEW_LINE>if (taskName == null) {<NEW_LINE>throw logger.logExceptionAsError(new IllegalArgumentException(String.<MASK><NEW_LINE>}<NEW_LINE>Boolean localDeleteRunningTasks = null;<NEW_LINE>this.deleteWithResponse(groupName, serviceName, projectName, taskName, localDeleteRunningTasks, Context.NONE).getValue();<NEW_LINE>} | format("The resource ID '%s' is not valid. Missing path segment 'tasks'.", id))); |
1,710,997 | public SearchPlaceIndexForPositionResult searchPlaceIndexForPosition(SearchPlaceIndexForPositionRequest searchPlaceIndexForPositionRequest) throws AmazonServiceException, AmazonClientException {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(searchPlaceIndexForPositionRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<SearchPlaceIndexForPositionRequest> request = null;<NEW_LINE>Response<SearchPlaceIndexForPositionResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new SearchPlaceIndexForPositionRequestMarshaller().marshall(searchPlaceIndexForPositionRequest);<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>Unmarshaller<SearchPlaceIndexForPositionResult, JsonUnmarshallerContext> unmarshaller = new SearchPlaceIndexForPositionResultJsonUnmarshaller();<NEW_LINE>JsonResponseHandler<SearchPlaceIndexForPositionResult> responseHandler = new JsonResponseHandler<SearchPlaceIndexForPositionResult>(unmarshaller);<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.ClientExecuteTime);<NEW_LINE>endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC);<NEW_LINE>}<NEW_LINE>} | awsRequestMetrics.endEvent(Field.RequestMarshallTime); |
490,326 | public void onViewCreated(@NonNull View rootView, @Nullable Bundle savedInstanceState) {<NEW_LINE>super.onViewCreated(rootView, savedInstanceState);<NEW_LINE>if (rootView instanceof ViewGroup)<NEW_LINE>this.rootView = (ViewGroup) rootView;<NEW_LINE>dao = new ObjectBoxDAO(requireContext());<NEW_LINE>long nbLibraryBooks = dao.countAllInternalBooks(false);<NEW_LINE>long nbQueueBooks = dao.countAllQueueBooks();<NEW_LINE><MASK><NEW_LINE>libraryChk = requireViewById(rootView, R.id.export_file_library_chk);<NEW_LINE>favsChk = requireViewById(rootView, R.id.export_favs_only);<NEW_LINE>favsChk.setOnCheckedChangeListener((buttonView, isChecked) -> refreshFavsDisplay());<NEW_LINE>if (nbLibraryBooks > 0) {<NEW_LINE>libraryChk.setText(getResources().getQuantityString(R.plurals.export_file_library, (int) nbLibraryBooks, (int) nbLibraryBooks));<NEW_LINE>libraryChk.setOnCheckedChangeListener((buttonView, isChecked) -> refreshDisplay());<NEW_LINE>libraryChk.setVisibility(View.VISIBLE);<NEW_LINE>}<NEW_LINE>groupsChk = requireViewById(rootView, R.id.export_groups);<NEW_LINE>queueChk = requireViewById(rootView, R.id.export_file_queue_chk);<NEW_LINE>if (nbQueueBooks > 0) {<NEW_LINE>queueChk.setText(getResources().getQuantityString(R.plurals.export_file_queue, (int) nbQueueBooks, (int) nbQueueBooks));<NEW_LINE>queueChk.setOnCheckedChangeListener((buttonView, isChecked) -> refreshDisplay());<NEW_LINE>queueChk.setVisibility(View.VISIBLE);<NEW_LINE>}<NEW_LINE>bookmarksChk = requireViewById(rootView, R.id.export_file_bookmarks_chk);<NEW_LINE>if (nbBookmarks > 0) {<NEW_LINE>bookmarksChk.setText(getResources().getQuantityString(R.plurals.export_file_bookmarks, (int) nbBookmarks, (int) nbBookmarks));<NEW_LINE>bookmarksChk.setOnCheckedChangeListener((buttonView, isChecked) -> refreshDisplay());<NEW_LINE>bookmarksChk.setVisibility(View.VISIBLE);<NEW_LINE>}<NEW_LINE>// Open library transfer FAQ<NEW_LINE>requireViewById(rootView, R.id.export_file_help1_text).setOnClickListener(v -> ContextXKt.startBrowserActivity(requireActivity(), getResources().getString(R.string.export_faq_url)));<NEW_LINE>requireViewById(rootView, R.id.info_img).setOnClickListener(v -> ContextXKt.startBrowserActivity(requireActivity(), getResources().getString(R.string.export_faq_url)));<NEW_LINE>runBtn = requireViewById(rootView, R.id.export_run_btn);<NEW_LINE>runBtn.setEnabled(false);<NEW_LINE>if (0 == nbLibraryBooks + nbQueueBooks + nbBookmarks)<NEW_LINE>runBtn.setVisibility(View.GONE);<NEW_LINE>else<NEW_LINE>runBtn.setOnClickListener(v -> runExport(libraryChk.isChecked(), favsChk.isChecked(), groupsChk.isChecked(), queueChk.isChecked(), bookmarksChk.isChecked()));<NEW_LINE>} | long nbBookmarks = dao.countAllBookmarks(); |
1,254,013 | public static void main(String[] args) throws IOException {<NEW_LINE>if (args.length < 2) {<NEW_LINE>_log.error("Usage: PegasusDataTemplateGenerator targetDirectoryPath [sourceFile or sourceDirectory or schemaName]+");<NEW_LINE>System.exit(1);<NEW_LINE>}<NEW_LINE>final String generateImportedProperty = System.getProperty(PegasusDataTemplateGenerator.GENERATOR_GENERATE_IMPORTED);<NEW_LINE>final boolean generateImported = generateImportedProperty == null ? true : Boolean.parseBoolean(generateImportedProperty);<NEW_LINE>final String generateLowercasePathProperty = <MASK><NEW_LINE>final boolean generateLowercasePath = generateLowercasePathProperty == null ? true : Boolean.parseBoolean(generateLowercasePathProperty);<NEW_LINE>final String generateFieldMaskProperty = System.getProperty(PegasusDataTemplateGenerator.GENERATOR_GENERATE_FIELD_MASK);<NEW_LINE>final boolean generateFieldMask = Boolean.parseBoolean(generateFieldMaskProperty);<NEW_LINE>String resolverPath = System.getProperty(AbstractGenerator.GENERATOR_RESOLVER_PATH);<NEW_LINE>if (resolverPath != null && ArgumentFileProcessor.isArgFile(resolverPath)) {<NEW_LINE>// The resolver path is an arg file, prefixed with '@' and containing the actual resolverPath<NEW_LINE>String[] argFileContents = ArgumentFileProcessor.getContentsAsArray(resolverPath);<NEW_LINE>resolverPath = argFileContents.length > 0 ? argFileContents[0] : null;<NEW_LINE>}<NEW_LINE>_log.debug("Resolver Path: " + resolverPath);<NEW_LINE>String[] schemaFiles = Arrays.copyOfRange(args, 1, args.length);<NEW_LINE>PegasusDataTemplateGenerator.run(resolverPath, System.getProperty(JavaCodeGeneratorBase.GENERATOR_DEFAULT_PACKAGE), System.getProperty(JavaCodeGeneratorBase.ROOT_PATH), generateImported, args[0], schemaFiles, generateLowercasePath, generateFieldMask);<NEW_LINE>} | System.getProperty(PegasusDataTemplateGenerator.GENERATOR_GENERATE_LOWERCASE_PATH); |
1,790,913 | synchronized void onRetry(@NonNull Job job, long backoffInterval) {<NEW_LINE>if (backoffInterval <= 0) {<NEW_LINE>throw new IllegalArgumentException("Invalid backoff interval! " + backoffInterval);<NEW_LINE>}<NEW_LINE>int nextRunAttempt = job.getRunAttempt() + 1;<NEW_LINE>long nextRunAttemptTime = System.currentTimeMillis() + backoffInterval;<NEW_LINE>String serializedData = dataSerializer.serialize(job.serialize());<NEW_LINE>jobStorage.updateJobAfterRetry(job.getId(), false, nextRunAttempt, nextRunAttemptTime, serializedData);<NEW_LINE>jobTracker.onStateChange(job, JobTracker.JobState.PENDING);<NEW_LINE>List<Constraint> constraints = Stream.of(jobStorage.getConstraintSpecs(job.getId())).map(ConstraintSpec::getFactoryKey).map(constraintInstantiator::instantiate).toList();<NEW_LINE>long delay = Math.max(0, nextRunAttemptTime - System.currentTimeMillis());<NEW_LINE>Log.i(TAG, JobLogger.format(job, "Scheduling a retry in " + delay + " ms."));<NEW_LINE><MASK><NEW_LINE>notifyAll();<NEW_LINE>} | scheduler.schedule(delay, constraints); |
1,783,172 | private void generateEPL(final int inputColumns, final int outputColumns) {<NEW_LINE>this.script.getProperties().setProperty(<MASK><NEW_LINE>String vars = "";<NEW_LINE>if (inputColumns > 26) {<NEW_LINE>throw new EncogError("More than 26 input variables is not supported for EPL.");<NEW_LINE>} else if (inputColumns <= 3) {<NEW_LINE>StringBuilder temp = new StringBuilder();<NEW_LINE>for (int i = 0; i < inputColumns; i++) {<NEW_LINE>if (temp.length() > 0) {<NEW_LINE>temp.append(',');<NEW_LINE>}<NEW_LINE>temp.append((char) ('x' + i));<NEW_LINE>}<NEW_LINE>vars = temp.toString();<NEW_LINE>} else {<NEW_LINE>StringBuilder temp = new StringBuilder();<NEW_LINE>for (int i = 0; i < inputColumns; i++) {<NEW_LINE>if (temp.length() > 0) {<NEW_LINE>temp.append(',');<NEW_LINE>}<NEW_LINE>temp.append((char) ('a' + i));<NEW_LINE>}<NEW_LINE>vars = temp.toString();<NEW_LINE>}<NEW_LINE>this.script.getProperties().setProperty(ScriptProperties.ML_CONFIG_ARCHITECTURE, "cycles=" + NEATPopulation.DEFAULT_CYCLES + ",vars=\"" + vars + "\"");<NEW_LINE>this.script.getProperties().setProperty(ScriptProperties.ML_TRAIN_TYPE, MLTrainFactory.TYPE_EPL_GA);<NEW_LINE>this.script.getProperties().setProperty(ScriptProperties.ML_TRAIN_TARGET_ERROR, this.maxError);<NEW_LINE>// add in the opcodes<NEW_LINE>EncogProgramContext context = new EncogProgramContext();<NEW_LINE>if (this.getGoal() == AnalystGoal.Regression) {<NEW_LINE>StandardExtensions.createNumericOperators(context);<NEW_LINE>} else {<NEW_LINE>StandardExtensions.createNumericOperators(context);<NEW_LINE>StandardExtensions.createBooleanOperators(context);<NEW_LINE>}<NEW_LINE>for (ProgramExtensionTemplate temp : context.getFunctions().getOpCodes()) {<NEW_LINE>this.script.getOpcodes().add(new ScriptOpcode(temp));<NEW_LINE>}<NEW_LINE>} | ScriptProperties.ML_CONFIG_TYPE, MLMethodFactory.TYPE_EPL); |
743,945 | public int LAPACKE_sggsvp3_work(int arg0, byte arg1, byte arg2, byte arg3, int arg4, int arg5, int arg6, FloatPointer arg7, int arg8, FloatPointer arg9, int arg10, float arg11, float arg12, IntPointer arg13, IntPointer arg14, FloatPointer arg15, int arg16, FloatPointer arg17, int arg18, FloatPointer arg19, int arg20, IntPointer arg21, FloatPointer arg22, FloatPointer arg23, int arg24) {<NEW_LINE>return LAPACKE_sggsvp3_work(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16, arg17, arg18, arg19, arg20, <MASK><NEW_LINE>} | arg21, arg22, arg23, arg24); |
1,824,480 | public void purge(SiteMap map, SiteNode node) {<NEW_LINE>SiteNode child = null;<NEW_LINE>synchronized (map) {<NEW_LINE>while (node.getChildCount() > 0) {<NEW_LINE>try {<NEW_LINE>child = (SiteNode) node.getChildAt(0);<NEW_LINE>purge(map, child);<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.error(e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (node.isRoot()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// delete reference in node<NEW_LINE>removeFromHistoryList(node.getHistoryReference());<NEW_LINE>ExtensionAlert extAlert = Control.getSingleton().getExtensionLoader().getExtension(ExtensionAlert.class);<NEW_LINE>if (node.getHistoryReference() != null) {<NEW_LINE>deleteAlertsFromExtensionAlert(extAlert, node.getHistoryReference());<NEW_LINE>node.getHistoryReference().delete();<NEW_LINE>map.removeHistoryReference(node.<MASK><NEW_LINE>}<NEW_LINE>// delete past reference in node<NEW_LINE>while (node.getPastHistoryReference().size() > 0) {<NEW_LINE>HistoryReference ref = node.getPastHistoryReference().get(0);<NEW_LINE>deleteAlertsFromExtensionAlert(extAlert, ref);<NEW_LINE>removeFromHistoryList(ref);<NEW_LINE>delete(ref);<NEW_LINE>node.getPastHistoryReference().remove(0);<NEW_LINE>map.removeHistoryReference(ref.getHistoryId());<NEW_LINE>}<NEW_LINE>map.removeNodeFromParent(node);<NEW_LINE>}<NEW_LINE>} | getHistoryReference().getHistoryId()); |
990,372 | public void sendGUINetworkData(Container containerEngine, ICrafting iCrafting) {<NEW_LINE>super.sendGUINetworkData(containerEngine, iCrafting);<NEW_LINE>iCrafting.sendProgressBarUpdate(containerEngine, 15, tankFuel.getFluid() != null && tankFuel.getFluid().getFluid() != null ? tankFuel.getFluid().getFluid().getID() : 0);<NEW_LINE>iCrafting.sendProgressBarUpdate(containerEngine, 16, tankCoolant.getFluid() != null && tankCoolant.getFluid().getFluid() != null ? tankCoolant.getFluid().getFluid().getID() : 0);<NEW_LINE>iCrafting.sendProgressBarUpdate(containerEngine, 17, tankResidue.getFluid() != null && tankResidue.getFluid().getFluid() != null ? tankResidue.getFluid().getFluid(<MASK><NEW_LINE>iCrafting.sendProgressBarUpdate(containerEngine, 18, tankFuel.getFluid() != null ? tankFuel.getFluid().amount : 0);<NEW_LINE>iCrafting.sendProgressBarUpdate(containerEngine, 19, tankCoolant.getFluid() != null ? tankCoolant.getFluid().amount : 0);<NEW_LINE>iCrafting.sendProgressBarUpdate(containerEngine, 20, tankResidue.getFluid() != null ? tankResidue.getFluid().amount : 0);<NEW_LINE>iCrafting.sendProgressBarUpdate(containerEngine, 21, tankFuel.colorRenderCache);<NEW_LINE>iCrafting.sendProgressBarUpdate(containerEngine, 22, tankCoolant.colorRenderCache);<NEW_LINE>iCrafting.sendProgressBarUpdate(containerEngine, 23, tankResidue.colorRenderCache);<NEW_LINE>} | ).getID() : 0); |
1,116,572 | public void marshall(FirewallRuleGroupAssociation firewallRuleGroupAssociation, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (firewallRuleGroupAssociation == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(firewallRuleGroupAssociation.getId(), ID_BINDING);<NEW_LINE>protocolMarshaller.marshall(firewallRuleGroupAssociation.getArn(), ARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(firewallRuleGroupAssociation.getFirewallRuleGroupId(), FIREWALLRULEGROUPID_BINDING);<NEW_LINE>protocolMarshaller.marshall(firewallRuleGroupAssociation.getVpcId(), VPCID_BINDING);<NEW_LINE>protocolMarshaller.marshall(firewallRuleGroupAssociation.getName(), NAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(firewallRuleGroupAssociation.getMutationProtection(), MUTATIONPROTECTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(firewallRuleGroupAssociation.getManagedOwnerName(), MANAGEDOWNERNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(firewallRuleGroupAssociation.getStatus(), STATUS_BINDING);<NEW_LINE>protocolMarshaller.marshall(firewallRuleGroupAssociation.getStatusMessage(), STATUSMESSAGE_BINDING);<NEW_LINE>protocolMarshaller.marshall(firewallRuleGroupAssociation.getCreatorRequestId(), CREATORREQUESTID_BINDING);<NEW_LINE>protocolMarshaller.marshall(firewallRuleGroupAssociation.getCreationTime(), CREATIONTIME_BINDING);<NEW_LINE>protocolMarshaller.marshall(firewallRuleGroupAssociation.getModificationTime(), MODIFICATIONTIME_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | firewallRuleGroupAssociation.getPriority(), PRIORITY_BINDING); |
61,193 | protected static Set<String> createRelationshipTypes(Set<String> features) {<NEW_LINE>Set<String> relationshipTypes = new TreeSet<String>();<NEW_LINE>if (features.contains(PP_COMMON_MOVE_BOOKMARKS) || features.contains(PP_COMMON_CONTAINERIZATION) || features.contains(PP_COMMON_COMBINE_FIELDS)) {<NEW_LINE>relationshipTypes.add(Namespaces.DOCUMENT);<NEW_LINE><MASK><NEW_LINE>relationshipTypes.add(Namespaces.FOOTER);<NEW_LINE>// those are probably not affected but get visited by the<NEW_LINE>// default TraversalUtil.<NEW_LINE>relationshipTypes.add(Namespaces.ENDNOTES);<NEW_LINE>relationshipTypes.add(Namespaces.FOOTNOTES);<NEW_LINE>relationshipTypes.add(Namespaces.COMMENTS);<NEW_LINE>}<NEW_LINE>if (features.contains(PP_COMMON_MOVE_PAGEBREAK)) {<NEW_LINE>relationshipTypes.add(Namespaces.DOCUMENT);<NEW_LINE>}<NEW_LINE>return relationshipTypes;<NEW_LINE>} | relationshipTypes.add(Namespaces.HEADER); |
648,691 | protected String doIt() throws Exception {<NEW_LINE>log.info("C_Order_ID=" + p_C_Order_ID + <MASK><NEW_LINE>if (p_C_Order_ID == 0)<NEW_LINE>throw new IllegalArgumentException("No Order");<NEW_LINE>MDocType dt = MDocType.get(getCtx(), p_C_DocType_ID);<NEW_LINE>if (dt.get_ID() == 0)<NEW_LINE>throw new IllegalArgumentException("No DocType");<NEW_LINE>if (p_DateDoc == null)<NEW_LINE>p_DateDoc = new Timestamp(System.currentTimeMillis());<NEW_LINE>//<NEW_LINE>MOrder from = new MOrder(getCtx(), p_C_Order_ID, get_TrxName());<NEW_LINE>MOrder newOrder = // copy ASI<NEW_LINE>MOrder.// copy ASI<NEW_LINE>copyFrom(// copy ASI<NEW_LINE>from, // copy ASI<NEW_LINE>p_DateDoc, // copy ASI<NEW_LINE>dt.getC_DocType_ID(), // copy ASI<NEW_LINE>dt.isSOTrx(), // copy ASI<NEW_LINE>false, // copy ASI<NEW_LINE>true, get_TrxName());<NEW_LINE>newOrder.setC_DocTypeTarget_ID(p_C_DocType_ID);<NEW_LINE>boolean OK = newOrder.save();<NEW_LINE>if (!OK)<NEW_LINE>throw new IllegalStateException("Could not create new Order");<NEW_LINE>//<NEW_LINE>if (p_IsCloseDocument) {<NEW_LINE>MOrder original = new MOrder(getCtx(), p_C_Order_ID, get_TrxName());<NEW_LINE>original.setDocAction(MOrder.DOCACTION_Complete);<NEW_LINE>original.processIt(MOrder.DOCACTION_Complete);<NEW_LINE>original.saveEx();<NEW_LINE>original.setDocAction(MOrder.DOCACTION_Close);<NEW_LINE>original.processIt(MOrder.DOCACTION_Close);<NEW_LINE>original.saveEx();<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// Env.setSOTrx(getCtx(), newOrder.isSOTrx());<NEW_LINE>// return "@C_Order_ID@ " + newOrder.getDocumentNo();<NEW_LINE>return dt.getName() + ": " + newOrder.getDocumentNo();<NEW_LINE>} | ", C_DocType_ID=" + p_C_DocType_ID + ", CloseDocument=" + p_IsCloseDocument); |
1,033,435 | public void applyDiagnosisKeyHourRetentionPolicy(long retentionDays) {<NEW_LINE>Set<String> countries = Set.of(originCountry, euPackageName);<NEW_LINE>countries.forEach(country -> {<NEW_LINE>List<S3Object> diagnosisKeysObjects = objectStoreAccess.getObjectsWithPrefix(getDiagnosisKeyPrefix(country));<NEW_LINE>final LocalDate cutOffDate = getUtcDate().minusDays(retentionDays - 1L);<NEW_LINE>var deletableKeys = diagnosisKeysObjects.stream().filter(diagnosisKeysObject -> isDiagnosisKeyFilePathOlderThan(diagnosisKeysObject, cutOffDate)).filter(this::isDiagnosisKeyFilePathOnHourFolder).<MASK><NEW_LINE>logger.info("Deleting {} diagnosis key files from hourly folders older than {}", deletableKeys.size(), cutOffDate);<NEW_LINE>deletableKeys.forEach(this::deleteS3Object);<NEW_LINE>});<NEW_LINE>} | collect(Collectors.toList()); |
906,120 | public Calc compileCall(ResolvedFunCall call, ExpCompiler compiler) {<NEW_LINE>final Calc calc = compiler.compileAs(call.getArg(0), null, ResultStyle.ITERABLE_ANY);<NEW_LINE>final boolean includeEmpty = call.getArgCount() < 2 || ((Literal) call.getArg(1)).getValue().equals("INCLUDEEMPTY");<NEW_LINE>return new AbstractIntegerCalc(call, new Calc[] { calc }) {<NEW_LINE><NEW_LINE>public int evaluateInteger(Evaluator evaluator) {<NEW_LINE>evaluator.getTiming().markStart(TIMING_NAME);<NEW_LINE>final int savepoint = evaluator.savepoint();<NEW_LINE>try {<NEW_LINE>evaluator.setNonEmpty(false);<NEW_LINE>final int count;<NEW_LINE>if (calc instanceof IterCalc) {<NEW_LINE>IterCalc iterCalc = (IterCalc) calc;<NEW_LINE>TupleIterable iterable = evaluateCurrentIterable(iterCalc, evaluator);<NEW_LINE>count = count(evaluator, iterable, includeEmpty);<NEW_LINE>} else {<NEW_LINE>// must be ListCalc<NEW_LINE>ListCalc listCalc = (ListCalc) calc;<NEW_LINE>TupleList list = evaluateCurrentList(listCalc, evaluator);<NEW_LINE>count = count(evaluator, list, includeEmpty);<NEW_LINE>}<NEW_LINE>return count;<NEW_LINE>} finally {<NEW_LINE>evaluator.restore(savepoint);<NEW_LINE>evaluator.getTiming().markEnd(TIMING_NAME);<NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>public boolean dependsOn(Hierarchy hierarchy) {<NEW_LINE>// COUNT(<set>, INCLUDEEMPTY) is straightforward -- it<NEW_LINE>// depends only on the dimensions that <Set> depends<NEW_LINE>// on.<NEW_LINE>if (super.dependsOn(hierarchy)) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>if (includeEmpty) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// COUNT(<set>, EXCLUDEEMPTY) depends only on the<NEW_LINE>// dimensions that <Set> depends on, plus all<NEW_LINE>// dimensions not masked by the set.<NEW_LINE>return !calc.getType(<MASK><NEW_LINE>}<NEW_LINE>};<NEW_LINE>} | ).usesHierarchy(hierarchy, true); |
499,661 | public boolean start() {<NEW_LINE>QueryBuilder<AccountVO> acntq = QueryBuilder.create(AccountVO.class);<NEW_LINE>acntq.and(acntq.entity().getAccountName(), SearchCriteria.<MASK><NEW_LINE>AccountVO acnt = acntq.find();<NEW_LINE>if (acnt != null) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>acnt = new AccountVO();<NEW_LINE>acnt.setAccountName(BaremetalUtils.BAREMETAL_SYSTEM_ACCOUNT_NAME);<NEW_LINE>acnt.setUuid(UUID.randomUUID().toString());<NEW_LINE>acnt.setState(Account.State.ENABLED);<NEW_LINE>acnt.setDomainId(1);<NEW_LINE>acnt.setType(RoleType.User.getAccountType());<NEW_LINE>acnt.setRoleId(RoleType.User.getId());<NEW_LINE>acnt = acntDao.persist(acnt);<NEW_LINE>UserVO user = new UserVO();<NEW_LINE>user.setState(Account.State.ENABLED);<NEW_LINE>user.setUuid(UUID.randomUUID().toString());<NEW_LINE>user.setAccountId(acnt.getAccountId());<NEW_LINE>user.setUsername(BaremetalUtils.BAREMETAL_SYSTEM_ACCOUNT_NAME);<NEW_LINE>user.setFirstname(BaremetalUtils.BAREMETAL_SYSTEM_ACCOUNT_NAME);<NEW_LINE>user.setLastname(BaremetalUtils.BAREMETAL_SYSTEM_ACCOUNT_NAME);<NEW_LINE>user.setPassword(UUID.randomUUID().toString());<NEW_LINE>user.setSource(User.Source.UNKNOWN);<NEW_LINE>user = userDao.persist(user);<NEW_LINE>String[] keys = acntMgr.createApiKeyAndSecretKey(user.getId());<NEW_LINE>user.setApiKey(keys[0]);<NEW_LINE>user.setSecretKey(keys[1]);<NEW_LINE>userDao.update(user.getId(), user);<NEW_LINE>return true;<NEW_LINE>} | Op.EQ, BaremetalUtils.BAREMETAL_SYSTEM_ACCOUNT_NAME); |
427,021 | protected void scrollY(ScrollBar vBar) {<NEW_LINE>int vSelection = vBar.getSelection();<NEW_LINE>Rectangle bounds = getVirtualBounds();<NEW_LINE>int y = -vSelection;<NEW_LINE>int cellHeight = getCellHeight();<NEW_LINE>if (cellHeight > 0) {<NEW_LINE>int remainder = y % cellHeight;<NEW_LINE>if (remainder < 0) {<NEW_LINE>y -= (cellHeight + remainder);<NEW_LINE>} else {<NEW_LINE>y -= remainder;<NEW_LINE>}<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>if (deltaY != 0) {<NEW_LINE>scrollSmart(0, deltaY);<NEW_LINE>setVirtualOrigin(bounds.x, bounds.y += deltaY);<NEW_LINE>}<NEW_LINE>if (-bounds.y + getRows() * getCellHeight() >= bounds.height) {<NEW_LINE>// scrolled to bottom - need to redraw bottom area<NEW_LINE>Rectangle clientRect = getClientArea();<NEW_LINE>redraw(0, clientRect.height - fCellHeight, clientRect.width, fCellHeight, false);<NEW_LINE>}<NEW_LINE>} | int deltaY = y - bounds.y; |
478,588 | final CreateSpotDatafeedSubscriptionResult executeCreateSpotDatafeedSubscription(CreateSpotDatafeedSubscriptionRequest createSpotDatafeedSubscriptionRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createSpotDatafeedSubscriptionRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateSpotDatafeedSubscriptionRequest> request = null;<NEW_LINE>Response<CreateSpotDatafeedSubscriptionResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateSpotDatafeedSubscriptionRequestMarshaller().marshall(super.beforeMarshalling(createSpotDatafeedSubscriptionRequest));<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, "EC2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateSpotDatafeedSubscription");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>StaxResponseHandler<CreateSpotDatafeedSubscriptionResult> responseHandler = new StaxResponseHandler<CreateSpotDatafeedSubscriptionResult>(new CreateSpotDatafeedSubscriptionResultStaxUnmarshaller());<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); |
958,885 | public void process(Channel channel, Command command) {<NEW_LINE>Preconditions.checkArgument(CommandType.TASK_KILL_REQUEST == command.getType(), String.format("invalid command type : %s", command.getType()));<NEW_LINE>TaskKillRequestCommand killCommand = JSONUtils.parseObject(command.getBody(), TaskKillRequestCommand.class);<NEW_LINE>if (killCommand == null) {<NEW_LINE>logger.error("task kill request command is null");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>logger.info("task kill command : {}", killCommand);<NEW_LINE>Pair<Boolean, List<String>> result = doKill(killCommand);<NEW_LINE>taskCallbackService.addRemoteChannel(killCommand.getTaskInstanceId(), new NettyRemoteChannel(channel, command.getOpaque()));<NEW_LINE>TaskExecutionContext taskExecutionContext = TaskExecutionContextCacheManager.<MASK><NEW_LINE>if (taskExecutionContext == null) {<NEW_LINE>logger.error("taskRequest cache is null, taskInstanceId: {}", killCommand.getTaskInstanceId());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>taskExecutionContext.setCurrentExecutionStatus(result.getLeft() ? ExecutionStatus.SUCCESS : ExecutionStatus.FAILURE);<NEW_LINE>taskExecutionContext.setAppIds(String.join(TaskConstants.COMMA, result.getRight()));<NEW_LINE>taskCallbackService.sendTaskKillResponseCommand(taskExecutionContext);<NEW_LINE>TaskExecutionContextCacheManager.removeByTaskInstanceId(taskExecutionContext.getTaskInstanceId());<NEW_LINE>logger.info("remove REMOTE_CHANNELS, task instance id:{}", killCommand.getTaskInstanceId());<NEW_LINE>} | getByTaskInstanceId(killCommand.getTaskInstanceId()); |
1,583,268 | private void updateBalance(Account account) {<NEW_LINE>transaction2balance.clear();<NEW_LINE>if (account == null)<NEW_LINE>return;<NEW_LINE>List<AccountTransaction> tx = new ArrayList<>(account.getTransactions());<NEW_LINE>Collections.sort(tx, Transaction.BY_DATE);<NEW_LINE>MutableMoney balance = MutableMoney.of(account.getCurrencyCode());<NEW_LINE>for (AccountTransaction t : tx) {<NEW_LINE>switch(t.getType()) {<NEW_LINE>case DEPOSIT:<NEW_LINE>case INTEREST:<NEW_LINE>case DIVIDENDS:<NEW_LINE>case TAX_REFUND:<NEW_LINE>case SELL:<NEW_LINE>case TRANSFER_IN:<NEW_LINE>case FEES_REFUND:<NEW_LINE>balance.add(t.getMonetaryAmount());<NEW_LINE>break;<NEW_LINE>case REMOVAL:<NEW_LINE>case FEES:<NEW_LINE>case INTEREST_CHARGE:<NEW_LINE>case TAXES:<NEW_LINE>case BUY:<NEW_LINE>case TRANSFER_OUT:<NEW_LINE>balance.<MASK><NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new IllegalArgumentException();<NEW_LINE>}<NEW_LINE>transaction2balance.put(t, balance.toMoney());<NEW_LINE>}<NEW_LINE>} | subtract(t.getMonetaryAmount()); |
692,553 | public void exitWccp_id(Wccp_idContext ctx) {<NEW_LINE>if (ctx.group_list != null) {<NEW_LINE>String name = ctx.group_list.getText();<NEW_LINE>int line = ctx.group_list.getStart().getLine();<NEW_LINE>_configuration.referenceStructure(IP_ACCESS_LIST, name, WCCP_GROUP_LIST, line);<NEW_LINE>}<NEW_LINE>if (ctx.redirect_list != null) {<NEW_LINE>String name = ctx.redirect_list.getText();<NEW_LINE>int line = ctx.redirect_list.getStart().getLine();<NEW_LINE>_configuration.referenceStructure(IP_ACCESS_LIST, name, WCCP_REDIRECT_LIST, line);<NEW_LINE>}<NEW_LINE>if (ctx.service_list != null) {<NEW_LINE>String name <MASK><NEW_LINE>int line = ctx.service_list.getStart().getLine();<NEW_LINE>_configuration.referenceStructure(IP_ACCESS_LIST, name, WCCP_SERVICE_LIST, line);<NEW_LINE>}<NEW_LINE>} | = ctx.service_list.getText(); |
681,862 | final DescribeScheduledQueryResult executeDescribeScheduledQuery(DescribeScheduledQueryRequest describeScheduledQueryRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeScheduledQueryRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeScheduledQueryRequest> request = null;<NEW_LINE>Response<DescribeScheduledQueryResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeScheduledQueryRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeScheduledQueryRequest));<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, "Timestream Query");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeScheduledQuery");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>URI cachedEndpoint = null;<NEW_LINE>if (endpointDiscoveryEnabled) {<NEW_LINE>DescribeEndpointsRequest discoveryRequest = new DescribeEndpointsRequest();<NEW_LINE>cachedEndpoint = cache.get(awsCredentialsProvider.getCredentials().getAWSAccessKeyId(), discoveryRequest, true, endpoint);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeScheduledQueryResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeScheduledQueryResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext, cachedEndpoint, null);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | awsRequestMetrics.endEvent(Field.RequestMarshallTime); |
113,061 | private Module registerModule(Path file) {<NEW_LINE>if (!FS.canReadFile(file)) {<NEW_LINE>throw new IllegalStateException("Cannot read file: " + file);<NEW_LINE>}<NEW_LINE>String shortName = _baseHome.toShortForm(file);<NEW_LINE>try {<NEW_LINE>StartLog.debug("Registering Module: %s", shortName);<NEW_LINE>Module module <MASK><NEW_LINE>_modules.add(module);<NEW_LINE>_names.put(module.getName(), module);<NEW_LINE>module.getProvides().forEach(n -> {<NEW_LINE>// Syntax can be :<NEW_LINE>// "<name>" - for a simple provider reference<NEW_LINE>// "<name>|default" - for a provider that is also the default implementation<NEW_LINE>String name = n;<NEW_LINE>boolean isDefaultProvider = false;<NEW_LINE>int idx = n.indexOf('|');<NEW_LINE>if (idx > 0) {<NEW_LINE>name = n.substring(0, idx);<NEW_LINE>isDefaultProvider = n.substring(idx + 1).equalsIgnoreCase("default");<NEW_LINE>}<NEW_LINE>_provided.computeIfAbsent(name, k -> new HashSet<>()).add(module);<NEW_LINE>if (isDefaultProvider) {<NEW_LINE>_providedDefaults.computeIfAbsent(name, k -> module.getName());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return module;<NEW_LINE>} catch (Error | RuntimeException t) {<NEW_LINE>throw t;<NEW_LINE>} catch (Throwable t) {<NEW_LINE>throw new IllegalStateException("Unable to register module: " + shortName, t);<NEW_LINE>}<NEW_LINE>} | = new Module(_baseHome, file); |
283,366 | static Context of(Map<?, ?> map) {<NEW_LINE>int size = Objects.requireNonNull(map, "map").size();<NEW_LINE>if (size == 0)<NEW_LINE>return Context.empty();<NEW_LINE>if (size <= 5) {<NEW_LINE>Map.Entry[] entries = map.entrySet().toArray(new Map.Entry[size]);<NEW_LINE>switch(size) {<NEW_LINE>case 1:<NEW_LINE>return new Context1(entries[0].getKey(), entries[0].getValue());<NEW_LINE>case 2:<NEW_LINE>return new Context2(entries[0].getKey(), entries[0].getValue(), entries[1].getKey(), entries[1].getValue());<NEW_LINE>case 3:<NEW_LINE>return new Context3(entries[0].getKey(), entries[0].getValue(), entries[1].getKey(), entries[1].getValue(), entries[2].getKey(), entries[2].getValue());<NEW_LINE>case 4:<NEW_LINE>return new Context4(entries[0].getKey(), entries[0].getValue(), entries[1].getKey(), entries[1].getValue(), entries[2].getKey(), entries[2].getValue(), entries[3].getKey(), entries[3].getValue());<NEW_LINE>case 5:<NEW_LINE>return new Context5(entries[0].getKey(), entries[0].getValue(), entries[1].getKey(), entries[1].getValue(), entries[2].getKey(), entries[2].getValue(), entries[3].getKey(), entries[3].getValue(), entries[4].getKey(), entries<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Since ContextN(Map) is a low level API that DOES NOT perform null checks,<NEW_LINE>// we need to check every key/value before passing it to ContextN(Map)<NEW_LINE>map.forEach((key, value) -> {<NEW_LINE>Objects.requireNonNull(key, "null key found");<NEW_LINE>if (value == null) {<NEW_LINE>throw new NullPointerException("null value for key " + key);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>final Map<Object, Object> generifiedMap = (Map<Object, Object>) map;<NEW_LINE>return new ContextN(generifiedMap);<NEW_LINE>} | [4].getValue()); |
1,072,575 | protected void customize(SSLEngine sslEngine, Request request) {<NEW_LINE>SSLSession sslSession = sslEngine.getSession();<NEW_LINE>if (isSniRequired() || isSniHostCheck()) {<NEW_LINE>String sniHost = (String) sslSession.getValue(SslContextFactory.Server.SNI_HOST);<NEW_LINE>X509 x509 = (X509) sslSession.getValue(X509_CERT);<NEW_LINE>if (x509 == null) {<NEW_LINE>Certificate[] certificates = sslSession.getLocalCertificates();<NEW_LINE>if (certificates == null || certificates.length == 0 || !(certificates[0] instanceof X509Certificate))<NEW_LINE>throw new BadMessageException(400, "Invalid SNI");<NEW_LINE>x509 = new X509(null, <MASK><NEW_LINE>sslSession.putValue(X509_CERT, x509);<NEW_LINE>}<NEW_LINE>String serverName = request.getServerName();<NEW_LINE>if (LOG.isDebugEnabled())<NEW_LINE>LOG.debug("Host={}, SNI={}, SNI Certificate={}", serverName, sniHost, x509);<NEW_LINE>if (isSniRequired() && (sniHost == null || !x509.matches(sniHost)))<NEW_LINE>throw new BadMessageException(400, "Invalid SNI");<NEW_LINE>if (isSniHostCheck() && !x509.matches(serverName))<NEW_LINE>throw new BadMessageException(400, "Invalid SNI");<NEW_LINE>}<NEW_LINE>request.setAttributes(new SslAttributes(request, sslSession));<NEW_LINE>} | (X509Certificate) certificates[0]); |
1,708,869 | final ExportTransitGatewayRoutesResult executeExportTransitGatewayRoutes(ExportTransitGatewayRoutesRequest exportTransitGatewayRoutesRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(exportTransitGatewayRoutesRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ExportTransitGatewayRoutesRequest> request = null;<NEW_LINE>Response<ExportTransitGatewayRoutesResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new ExportTransitGatewayRoutesRequestMarshaller().marshall(super.beforeMarshalling(exportTransitGatewayRoutesRequest));<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, "EC2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ExportTransitGatewayRoutes");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<ExportTransitGatewayRoutesResult> responseHandler = new StaxResponseHandler<ExportTransitGatewayRoutesResult>(new ExportTransitGatewayRoutesResultStaxUnmarshaller());<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); |
756,367 | public void run() {<NEW_LINE>// get full control of desktop<NEW_LINE>org.zkoss.zk.ui.Desktop desktop = WTask.this.getDesktop();<NEW_LINE>String cmd = Msg.parseTranslation(Env.getCtx(), m_task.<MASK><NEW_LINE>if (cmd == null || cmd.equals(""))<NEW_LINE>info.setContent("Cannot execute '" + m_task.getOS_Command() + "'");<NEW_LINE>OSTask osTask = new OSTask(cmd);<NEW_LINE>osTask.start();<NEW_LINE>while (true) {<NEW_LINE>try {<NEW_LINE>Thread.sleep(500);<NEW_LINE>Executions.activate(desktop, 500);<NEW_LINE>try {<NEW_LINE>StringBuffer sb = new StringBuffer();<NEW_LINE>sb.append(osTask.getOut()).append("<br>-----------<br>").append(osTask.getErr()).append("<br>-----------");<NEW_LINE>info.setContent(sb.toString().replace("\n", "<br>"));<NEW_LINE>if (!osTask.isAlive()) {<NEW_LINE>confirmPanel.getButton(ConfirmPanel.A_CANCEL).setEnabled(false);<NEW_LINE>confirmPanel.getOKButton().setEnabled(true);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>// release full control of desktop<NEW_LINE>Executions.deactivate(desktop);<NEW_LINE>}<NEW_LINE>} catch (DesktopUnavailableException e) {<NEW_LINE>log.log(Level.FINE, e.getLocalizedMessage(), e);<NEW_LINE>osTask.interrupt();<NEW_LINE>break;<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>log.log(Level.FINE, e.getLocalizedMessage(), e);<NEW_LINE>osTask.interrupt();<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | getOS_Command()).trim(); |
546,488 | protected void applyFocusForMetering(@NonNull CaptureRequest.Builder builder) {<NEW_LINE>int[] modesArray = readCharacteristic(CameraCharacteristics.CONTROL_AF_AVAILABLE_MODES, new int[] {});<NEW_LINE>List<Integer> modes = new ArrayList<>();<NEW_LINE>for (int mode : modesArray) {<NEW_LINE>modes.add(mode);<NEW_LINE>}<NEW_LINE>if (modes.contains(CaptureRequest.CONTROL_AF_MODE_AUTO)) {<NEW_LINE>builder.set(<MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (getMode() == Mode.VIDEO && modes.contains(CaptureRequest.CONTROL_AF_MODE_CONTINUOUS_VIDEO)) {<NEW_LINE>builder.set(CaptureRequest.CONTROL_AF_MODE, CaptureRequest.CONTROL_AF_MODE_CONTINUOUS_VIDEO);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (modes.contains(CaptureRequest.CONTROL_AF_MODE_CONTINUOUS_PICTURE)) {<NEW_LINE>builder.set(CaptureRequest.CONTROL_AF_MODE, CaptureRequest.CONTROL_AF_MODE_CONTINUOUS_PICTURE);<NEW_LINE>// noinspection UnnecessaryReturnStatement<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>} | CaptureRequest.CONTROL_AF_MODE, CaptureRequest.CONTROL_AF_MODE_AUTO); |
1,552,616 | final DescribeLoggingConfigurationResult executeDescribeLoggingConfiguration(DescribeLoggingConfigurationRequest describeLoggingConfigurationRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeLoggingConfigurationRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeLoggingConfigurationRequest> request = null;<NEW_LINE>Response<DescribeLoggingConfigurationResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeLoggingConfigurationRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeLoggingConfigurationRequest));<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, "Network Firewall");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeLoggingConfiguration");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeLoggingConfigurationResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeLoggingConfigurationResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} | endClientExecution(awsRequestMetrics, request, response); |
366,524 | public CodegenExpression codegen(EnumForgeCodegenParams premade, CodegenMethodScope codegenMethodScope, CodegenClassScope codegenClassScope) {<NEW_LINE>ExprForgeCodegenSymbol scope <MASK><NEW_LINE>CodegenMethod methodNode = codegenMethodScope.makeChildWithScope(returnType(), this.getClass(), scope, codegenClassScope).addParam(EnumForgeCodegenNames.PARAMSCOLLBEAN);<NEW_LINE>CodegenExpression returnIfEmpty = returnIfEmptyOptional();<NEW_LINE>if (returnIfEmpty != null) {<NEW_LINE>methodNode.getBlock().ifCondition(exprDotMethod(EnumForgeCodegenNames.REF_ENUMCOLL, "isEmpty")).blockReturn(returnIfEmpty);<NEW_LINE>}<NEW_LINE>initBlock(methodNode.getBlock(), methodNode, scope, codegenClassScope);<NEW_LINE>CodegenBlock forEach = methodNode.getBlock().forEach(EventBean.EPTYPE, "next", EnumForgeCodegenNames.REF_ENUMCOLL).assignArrayElement(EnumForgeCodegenNames.REF_EPS, constant(getStreamNumLambda()), ref("next"));<NEW_LINE>forEachBlock(forEach, methodNode, scope, codegenClassScope);<NEW_LINE>returnResult(methodNode.getBlock());<NEW_LINE>return localMethod(methodNode, premade.getEps(), premade.getEnumcoll(), premade.getIsNewData(), premade.getExprCtx());<NEW_LINE>} | = new ExprForgeCodegenSymbol(false, null); |
1,192,462 | public void run(RegressionEnvironment env) {<NEW_LINE>RegressionPath path = new RegressionPath();<NEW_LINE>env.compileDeploy("@public create json schema Book(bookId string, price BigDecimal);\n", path);<NEW_LINE>env.compileDeploy("@public create json schema Shelf(shelfId string, book Book);\n", path);<NEW_LINE>env.compileDeploy("@public create json schema Isle(isleId string, shelf Shelf);\n", path);<NEW_LINE>env.compileDeploy("@public @buseventtype create json schema Library(libraryId string, isle Isle);\n", path);<NEW_LINE>env.compileDeploy("@name('s0') select * from Library;\n", path).addListener("s0");<NEW_LINE>String json;<NEW_LINE>json = "{\n" + " \"libraryId\": \"L\",\n" + " \"isle\": {\n" + " \"isleId\": \"I1\",\n" + " \"shelf\": {\n" + " \"shelfId\": \"S11\",\n" + " \"book\": {\n" + " \"bookId\": \"B111\",\n" + " \"price\": 20\n" + " }\n" + " }\n" + " }\n" + "}";<NEW_LINE>sendAssertLibrary(env, json, "L", "I1", "S11", "B111");<NEW_LINE>json = "{\n" + " \"libraryId\": \"L\",\n" + " \"isle\": null\n" + "}";<NEW_LINE>sendAssertLibrary(env, json, "L", null, null, null);<NEW_LINE>json = "{\n" + " \"libraryId\": \"L\",\n" + " \"isle\": {\n" + " \"isleId\": \"I1\",\n" + " \"shelf\": null\n" + " }\n" + "}";<NEW_LINE>sendAssertLibrary(env, json, "L", "I1", null, null);<NEW_LINE>json = "{\n" + " \"libraryId\": \"L\",\n" + " \"isle\": {\n" + " \"isleId\": \"I1\",\n" + " \"shelf\": {\n" + " \"shelfId\": \"S11\",\n" + " \"book\": null\n" + " }\n" + " }\n" + "}";<NEW_LINE>sendAssertLibrary(env, json, <MASK><NEW_LINE>env.undeployAll();<NEW_LINE>} | "L", "I1", "S11", null); |
570,431 | private void updateIconForChangeIndicator(ArchiveNode node, MultiIcon multiIcon) {<NEW_LINE>DataTypeManager dtm = node.getArchive().getDataTypeManager();<NEW_LINE>if (dtm == null) {<NEW_LINE>// for InvalidArchiveNodes<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>List<SourceArchive> sourceArchives = dtm.getSourceArchives();<NEW_LINE>if (sourceArchives.isEmpty()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>boolean hasLocalChanges = checkForLocalChanges(sourceArchives);<NEW_LINE>boolean hasUpdatesAvailable = checkforUpdates(sourceArchives);<NEW_LINE>if (hasLocalChanges && hasUpdatesAvailable) {<NEW_LINE>multiIcon.addIcon(new TranslateIcon<MASK><NEW_LINE>} else if (hasLocalChanges) {<NEW_LINE>multiIcon.addIcon(new TranslateIcon(LOCAL_DELTA_ICON, 6, 9));<NEW_LINE>} else if (hasUpdatesAvailable) {<NEW_LINE>multiIcon.addIcon(new TranslateIcon(SOURCE_DELTA_ICON, 6, 9));<NEW_LINE>}<NEW_LINE>} | (CONFLICT_ICON, 6, 9)); |
617,655 | public ApplicationClient adapt(Container root, OverlayContainer rootOverlay, ArtifactContainer artifactContainer, Container containerToAdapt) throws UnableToAdaptException {<NEW_LINE>NonPersistentCache cache = containerToAdapt.adapt(NonPersistentCache.class);<NEW_LINE>ApplicationClient appClient = (ApplicationClient) cache.getFromCache(ApplicationClient.class);<NEW_LINE>if (appClient != null) {<NEW_LINE>return appClient;<NEW_LINE>}<NEW_LINE>Entry ddEntry = null;<NEW_LINE>AltDDEntryGetter altDDGetter = (AltDDEntryGetter) cache.getFromCache(AltDDEntryGetter.class);<NEW_LINE>if (altDDGetter != null) {<NEW_LINE>ddEntry = altDDGetter.getAltDDEntry(ContainerInfo.Type.CLIENT_MODULE);<NEW_LINE>}<NEW_LINE>if (ddEntry == null) {<NEW_LINE>ddEntry = <MASK><NEW_LINE>}<NEW_LINE>if (ddEntry == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>return ddEntry.adapt(ApplicationClient.class);<NEW_LINE>} | containerToAdapt.getEntry(ApplicationClient.DD_NAME); |
1,423,856 | public ConfirmPublicVirtualInterfaceResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ConfirmPublicVirtualInterfaceResult confirmPublicVirtualInterfaceResult = new ConfirmPublicVirtualInterfaceResult();<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 confirmPublicVirtualInterfaceResult;<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("virtualInterfaceState", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>confirmPublicVirtualInterfaceResult.setVirtualInterfaceState(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 confirmPublicVirtualInterfaceResult;<NEW_LINE>} | JsonToken token = context.getCurrentToken(); |
487,425 | private Mono<Response<Flux<ByteBuffer>>> listEffectiveNetworkSecurityGroupsWithResponseAsync(String resourceGroupName, String networkInterfaceName, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (networkInterfaceName == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>final String apiVersion = "2021-05-01";<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.listEffectiveNetworkSecurityGroups(this.client.getEndpoint(), resourceGroupName, networkInterfaceName, apiVersion, this.client.getSubscriptionId(), accept, context);<NEW_LINE>} | error(new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null.")); |
1,543,356 | public SigningProfileRevocationRecord unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>SigningProfileRevocationRecord signingProfileRevocationRecord = new SigningProfileRevocationRecord();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE><MASK><NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("revocationEffectiveFrom", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>signingProfileRevocationRecord.setRevocationEffectiveFrom(DateJsonUnmarshallerFactory.getInstance("unixTimestamp").unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("revokedAt", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>signingProfileRevocationRecord.setRevokedAt(DateJsonUnmarshallerFactory.getInstance("unixTimestamp").unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("revokedBy", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>signingProfileRevocationRecord.setRevokedBy(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 signingProfileRevocationRecord;<NEW_LINE>} | JsonToken token = context.getCurrentToken(); |
191,176 | private int calcHitLine(final double y) {<NEW_LINE>final int linecount = m_content.getLineCount();<NEW_LINE>final double lineHeight = m_content.getLineHeight();<NEW_LINE>int hitline = 0;<NEW_LINE>if (y < m_content.getLineContent(0).getBounds().getMinY()) {<NEW_LINE>hitline = 0;<NEW_LINE>} else if (y > (m_content.getLineContent(linecount - 1).getBounds().getMinY() + (linecount * lineHeight))) {<NEW_LINE>hitline = linecount - 1;<NEW_LINE>} else {<NEW_LINE>for (int line = 0; line < linecount; ++line) {<NEW_LINE>Rectangle2D bounds = m_content.getLineContent(line).getBounds();<NEW_LINE>final double boundY = bounds.getY() + (line * lineHeight) + m_content.getPaddingTop();<NEW_LINE>bounds = new Rectangle2D.Double(bounds.getX(), boundY, bounds.getWidth(<MASK><NEW_LINE>if ((bounds.getY() < y) && ((bounds.getY() + lineHeight) > y)) {<NEW_LINE>hitline = line;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return hitline;<NEW_LINE>} | ), bounds.getHeight()); |
1,320,933 | @ExceptionMetered<NEW_LINE>@Path("/{id : [a-zA-Z0-9\\-_]+}")<NEW_LINE>@ApiOperation(value = "Update deploy", notes = "Update deploy given a deploy id and a deploy object. Current only " + "acceptanceStatus and description are allowed to change.")<NEW_LINE>public void update(@Context SecurityContext sc, @ApiParam(value = "Deploy id", required = true) @PathParam("id") String id, @ApiParam(value = "Partially populated deploy object", required = true) DeployBean deployBean) throws Exception {<NEW_LINE>DeployBean originBean = Utils.getDeploy(deployDAO, id);<NEW_LINE>EnvironBean environBean = Utils.getEnvStage(environDAO, originBean.getEnv_id());<NEW_LINE>authorizer.authorize(sc, new Resource(environBean.getEnv_name(), Resource.Type.ENV), Role.OPERATOR);<NEW_LINE>String userName = sc.getUserPrincipal().getName();<NEW_LINE>deployHandler.update(id, deployBean, userName);<NEW_LINE>LOG.info(<MASK><NEW_LINE>} | "{} successfully updated deploy {} with {}", userName, id, deployBean); |
806,597 | public final void typeList() throws RecognitionException, TokenStreamException {<NEW_LINE>returnAST = null;<NEW_LINE>ASTPair currentAST = new ASTPair();<NEW_LINE>PascalAST typeList_AST = null;<NEW_LINE>indexType();<NEW_LINE>astFactory.addASTChild(currentAST, returnAST);<NEW_LINE>{<NEW_LINE>_loop45: do {<NEW_LINE>if ((LA(1) == COMMA)) {<NEW_LINE>match(COMMA);<NEW_LINE>indexType();<NEW_LINE>astFactory.addASTChild(currentAST, returnAST);<NEW_LINE>} else {<NEW_LINE>break _loop45;<NEW_LINE>}<NEW_LINE>} while (true);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>typeList_AST = (PascalAST) astFactory.make((new ASTArray(2)).add((PascalAST) astFactory.create(TYPELIST)).add(typeList_AST));<NEW_LINE>currentAST.root = typeList_AST;<NEW_LINE>currentAST.child = typeList_AST != null && typeList_AST.getFirstChild() != null ? typeList_AST.getFirstChild() : typeList_AST;<NEW_LINE>currentAST.advanceChildToEnd();<NEW_LINE>typeList_AST = (PascalAST) currentAST.root;<NEW_LINE>returnAST = typeList_AST;<NEW_LINE>} | typeList_AST = (PascalAST) currentAST.root; |
437,634 | public void push(final OutputStream out) throws IOException {<NEW_LINE>Runnable r = () -> {<NEW_LINE>InputStream in = null;<NEW_LINE>try {<NEW_LINE>// byte data[] = new byte[65536];<NEW_LINE>RandomAccessFile rf = new RandomAccessFile(file, "r");<NEW_LINE>arc = SevenZip.openInArchive(<MASK><NEW_LINE>ISimpleInArchive simpleInArchive = arc.getSimpleInterface();<NEW_LINE>ISimpleInArchiveItem realItem = null;<NEW_LINE>for (ISimpleInArchiveItem item : simpleInArchive.getArchiveItems()) {<NEW_LINE>if (item.getPath().equals(zeName)) {<NEW_LINE>realItem = item;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (realItem == null) {<NEW_LINE>LOGGER.trace("No such item " + zeName + " found in archive");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>realItem.extractSlow(new ISequentialOutStream() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public int write(byte[] data) throws SevenZipException {<NEW_LINE>try {<NEW_LINE>out.write(data);<NEW_LINE>} catch (IOException e) {<NEW_LINE>LOGGER.debug("Caught exception", e);<NEW_LINE>throw new SevenZipException();<NEW_LINE>}<NEW_LINE>return data.length;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} catch (FileNotFoundException | SevenZipException e) {<NEW_LINE>LOGGER.debug("Unpack error. Possibly harmless.", e.getMessage());<NEW_LINE>} finally {<NEW_LINE>try {<NEW_LINE>if (in != null) {<NEW_LINE>in.close();<NEW_LINE>}<NEW_LINE>arc.close();<NEW_LINE>out.close();<NEW_LINE>} catch (IOException e) {<NEW_LINE>LOGGER.debug("Caught exception", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>};<NEW_LINE>new Thread(r, "7Zip Extractor").start();<NEW_LINE>} | null, new RandomAccessFileInStream(rf)); |
1,632,974 | public static String markMediaFailed(Context context, @NonNull String postContent, String localMediaId, MediaFile mediaFile) {<NEW_LINE>if (mediaFile != null) {<NEW_LINE>// fill in Aztec with the post's content<NEW_LINE>AztecParser parser = getAztecParserWithPlugins();<NEW_LINE>SpannableStringBuilder builder = getCalypsoCompatibleStringBuilder(context, postContent, parser);<NEW_LINE>MediaPredicate predicate = MediaPredicate.getLocalMediaIdPredicate(localMediaId);<NEW_LINE>// remove the uploading class<NEW_LINE>Attributes firstElementAttributes = getFirstElementAttributes(builder, predicate);<NEW_LINE>// let's make sure the element is still there within the content. Sometimes it may happen<NEW_LINE>// this method is called but the element doesn't exist in the post content anymore<NEW_LINE>if (firstElementAttributes != null) {<NEW_LINE>AttributesWithClass attributesWithClass = getAttributesWithClass(firstElementAttributes);<NEW_LINE>attributesWithClass.removeClass(ATTR_STATUS_UPLOADING);<NEW_LINE>if (mediaFile.isVideo()) {<NEW_LINE>attributesWithClass.removeClass(TEMP_VIDEO_UPLOADING_CLASS);<NEW_LINE>}<NEW_LINE>// mark failed<NEW_LINE>attributesWithClass.addClass(ATTR_STATUS_FAILED);<NEW_LINE>updateElementAttributes(builder, predicate, attributesWithClass.getAttributes());<NEW_LINE>// re-set the post content<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>return postContent;<NEW_LINE>} | postContent = toHtml(builder, parser); |
418,432 | public void resolveTable(List<String> names, SqlNameMatcher nameMatcher, Path path, Resolved resolved) {<NEW_LINE>final List<Resolve> imperfectResolves = new ArrayList<>();<NEW_LINE>final List<Resolve> resolves = ((ResolvedImpl) resolved).resolves;<NEW_LINE>if (names.size() == 3) {<NEW_LINE>List<String> finalNames = names;<NEW_LINE>names = new ArrayList<String>() {<NEW_LINE><NEW_LINE>{<NEW_LINE>add(finalNames.get(0) + "." + finalNames.get(1));<NEW_LINE>add(finalNames.get(2));<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}<NEW_LINE>// Look in the default schema, then default catalog, then root schema.<NEW_LINE>for (List<String> schemaPath : validator.catalogReader.getSchemaPaths()) {<NEW_LINE>resolve_(validator.catalogReader.getRootSchema(), names, schemaPath, nameMatcher, path, resolved);<NEW_LINE>for (Resolve resolve : resolves) {<NEW_LINE>if (resolve.remainingNames.isEmpty()) {<NEW_LINE>// There is a full match. Return it as the only match.<NEW_LINE>((<MASK><NEW_LINE>resolves.add(resolve);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>imperfectResolves.addAll(resolves);<NEW_LINE>}<NEW_LINE>// If there were no matches in the last round, restore those found in<NEW_LINE>// previous rounds<NEW_LINE>if (resolves.isEmpty()) {<NEW_LINE>resolves.addAll(imperfectResolves);<NEW_LINE>}<NEW_LINE>} | ResolvedImpl) resolved).clear(); |
1,793,067 | private JPanel createSouthPanel(Table table) {<NEW_LINE>JPanel panel = new JPanel(new BorderLayout());<NEW_LINE>TableModel model = null;<NEW_LINE>GTable gTable = new GTable();<NEW_LINE>if (table.getRecordCount() <= 10000) {<NEW_LINE>model = new DbSmallTableModel(table);<NEW_LINE>} else {<NEW_LINE>model = new DbLargeTableModel(table);<NEW_LINE>}<NEW_LINE>gTable.setModel(model);<NEW_LINE>gTable.setDefaultRenderer(Long.class, new LongRenderer());<NEW_LINE>JScrollPane scroll = new JScrollPane(gTable);<NEW_LINE>panel.add(scroll, BorderLayout.CENTER);<NEW_LINE>TableStatistics<MASK><NEW_LINE>String recCnt = "Records: " + Integer.toString(table.getRecordCount());<NEW_LINE>String intNodeCnt = "";<NEW_LINE>String recNodeCnt = "";<NEW_LINE>String chainBufCnt = "";<NEW_LINE>String size = "";<NEW_LINE>if (stats != null) {<NEW_LINE>intNodeCnt = "Interior Nodes: " + Integer.toString(stats[0].interiorNodeCnt);<NEW_LINE>recNodeCnt = "Record Nodes: " + Integer.toString(stats[0].recordNodeCnt);<NEW_LINE>chainBufCnt = "Chained Buffers: " + Integer.toString(stats[0].chainedBufferCnt);<NEW_LINE>size = "Size (KB): " + Integer.toString(stats[0].size / 1024);<NEW_LINE>if (stats.length > 1) {<NEW_LINE>intNodeCnt += " / " + Integer.toString(stats[1].interiorNodeCnt);<NEW_LINE>recNodeCnt += " / " + Integer.toString(stats[1].recordNodeCnt);<NEW_LINE>chainBufCnt += " / " + Integer.toString(stats[1].chainedBufferCnt);<NEW_LINE>size += " / " + Integer.toString(stats[1].size / 1024);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>panel.add(new GLabel(recCnt + " " + intNodeCnt + " " + recNodeCnt + " " + chainBufCnt + " " + size), BorderLayout.SOUTH);<NEW_LINE>return panel;<NEW_LINE>} | [] stats = getStats(table); |
1,605,056 | private void initialize() {<NEW_LINE>// Try to keep the area approximately 1.0<NEW_LINE>width = <MASK><NEW_LINE>height = 1.0 / width;<NEW_LINE>// TODO: center/arrange visualizations?<NEW_LINE>for (Iterator<VisualizationTask> tit = item.tasks.iterator(); tit.hasNext(); ) {<NEW_LINE>VisualizationTask task = tit.next();<NEW_LINE>if (task.isVisible()) {<NEW_LINE>Visualization v = instantiateVisualization(task);<NEW_LINE>if (v != null) {<NEW_LINE>taskmap.put(task, v);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>double ratio = width / height;<NEW_LINE>getRoot().setAttribute(SVGConstants.SVG_WIDTH_ATTRIBUTE, "20cm");<NEW_LINE>getRoot().setAttribute(SVGConstants.SVG_HEIGHT_ATTRIBUTE, (20 / ratio) + "cm");<NEW_LINE>getRoot().setAttribute(SVGConstants.SVG_VIEW_BOX_ATTRIBUTE, "0 0 " + width + " " + height);<NEW_LINE>refresh();<NEW_LINE>} | Math.sqrt(getRatio()); |
712,804 | final RecordHandlerProgressResult executeRecordHandlerProgress(RecordHandlerProgressRequest recordHandlerProgressRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(recordHandlerProgressRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<RecordHandlerProgressRequest> request = null;<NEW_LINE>Response<RecordHandlerProgressResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new RecordHandlerProgressRequestMarshaller().marshall(super.beforeMarshalling(recordHandlerProgressRequest));<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, "CloudFormation");<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<RecordHandlerProgressResult> responseHandler = new StaxResponseHandler<RecordHandlerProgressResult>(new RecordHandlerProgressResultStaxUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | addHandlerContext(HandlerContextKey.OPERATION_NAME, "RecordHandlerProgress"); |
726,145 | public static void main(String[] args) {<NEW_LINE>Loader.loadNativeLibraries();<NEW_LINE>// [START solver]<NEW_LINE>MPSolver solver = MPSolver.createSolver("GLOP");<NEW_LINE>// [END solver]<NEW_LINE>// [START variables]<NEW_LINE>double infinity = java.lang.Double.POSITIVE_INFINITY;<NEW_LINE>// x and y are continuous non-negative variables.<NEW_LINE>MPVariable x = solver.makeNumVar(0.0, infinity, "x");<NEW_LINE>MPVariable y = solver.makeNumVar(0.0, infinity, "y");<NEW_LINE>System.out.println("Number of variables = " + solver.numVariables());<NEW_LINE>// [END variables]<NEW_LINE>// [START constraints]<NEW_LINE>// x + 2*y <= 14.<NEW_LINE>MPConstraint c0 = solver.makeConstraint(-infinity, 14.0, "c0");<NEW_LINE><MASK><NEW_LINE>c0.setCoefficient(y, 2);<NEW_LINE>// 3*x - y >= 0.<NEW_LINE>MPConstraint c1 = solver.makeConstraint(0.0, infinity, "c1");<NEW_LINE>c1.setCoefficient(x, 3);<NEW_LINE>c1.setCoefficient(y, -1);<NEW_LINE>// x - y <= 2.<NEW_LINE>MPConstraint c2 = solver.makeConstraint(-infinity, 2.0, "c2");<NEW_LINE>c2.setCoefficient(x, 1);<NEW_LINE>c2.setCoefficient(y, -1);<NEW_LINE>System.out.println("Number of constraints = " + solver.numConstraints());<NEW_LINE>// [END constraints]<NEW_LINE>// [START objective]<NEW_LINE>// Maximize 3 * x + 4 * y.<NEW_LINE>MPObjective objective = solver.objective();<NEW_LINE>objective.setCoefficient(x, 3);<NEW_LINE>objective.setCoefficient(y, 4);<NEW_LINE>objective.setMaximization();<NEW_LINE>// [END objective]<NEW_LINE>// [START solve]<NEW_LINE>final MPSolver.ResultStatus resultStatus = solver.solve();<NEW_LINE>// [END solve]<NEW_LINE>// [START print_solution]<NEW_LINE>if (resultStatus == MPSolver.ResultStatus.OPTIMAL) {<NEW_LINE>System.out.println("Solution:");<NEW_LINE>System.out.println("Objective value = " + objective.value());<NEW_LINE>System.out.println("x = " + x.solutionValue());<NEW_LINE>System.out.println("y = " + y.solutionValue());<NEW_LINE>} else {<NEW_LINE>System.err.println("The problem does not have an optimal solution!");<NEW_LINE>}<NEW_LINE>// [END print_solution]<NEW_LINE>// [START advanced]<NEW_LINE>System.out.println("\nAdvanced usage:");<NEW_LINE>System.out.println("Problem solved in " + solver.wallTime() + " milliseconds");<NEW_LINE>System.out.println("Problem solved in " + solver.iterations() + " iterations");<NEW_LINE>// [END advanced]<NEW_LINE>} | c0.setCoefficient(x, 1); |
1,186,430 | public TextChannel createTextChannel(GuildImpl guildObj, DataObject json, long guildId) {<NEW_LINE>boolean playbackCache = false;<NEW_LINE>final long id = json.getLong("id");<NEW_LINE>TextChannelImpl channel = (TextChannelImpl) getJDA().<MASK><NEW_LINE>if (channel == null) {<NEW_LINE>if (guildObj == null)<NEW_LINE>guildObj = (GuildImpl) getJDA().getGuildsView().get(guildId);<NEW_LINE>SnowflakeCacheViewImpl<TextChannel> guildTextView = guildObj.getTextChannelsView(), textView = getJDA().getTextChannelsView();<NEW_LINE>try (UnlockHook glock = guildTextView.writeLock();<NEW_LINE>UnlockHook jlock = textView.writeLock()) {<NEW_LINE>channel = new TextChannelImpl(id, guildObj);<NEW_LINE>guildTextView.getMap().put(id, channel);<NEW_LINE>playbackCache = textView.getMap().put(id, channel) == null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>channel.setParentCategory(json.getLong("parent_id", 0)).setLatestMessageIdLong(json.getLong("last_message_id", 0)).setName(json.getString("name")).setTopic(json.getString("topic", null)).setPosition(json.getInt("position")).setNSFW(json.getBoolean("nsfw")).setSlowmode(json.getInt("rate_limit_per_user", 0));<NEW_LINE>createOverridesPass(channel, json.getArray("permission_overwrites"));<NEW_LINE>if (playbackCache)<NEW_LINE>getJDA().getEventCache().playbackCache(EventCache.Type.CHANNEL, id);<NEW_LINE>return channel;<NEW_LINE>} | getTextChannelsView().get(id); |
1,063,058 | public static DescribeExpressSyncSharesResponse unmarshall(DescribeExpressSyncSharesResponse describeExpressSyncSharesResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeExpressSyncSharesResponse.setRequestId(_ctx.stringValue("DescribeExpressSyncSharesResponse.RequestId"));<NEW_LINE>describeExpressSyncSharesResponse.setMessage(_ctx.stringValue("DescribeExpressSyncSharesResponse.Message"));<NEW_LINE>describeExpressSyncSharesResponse.setCode(_ctx.stringValue("DescribeExpressSyncSharesResponse.Code"));<NEW_LINE>describeExpressSyncSharesResponse.setSuccess(_ctx.booleanValue("DescribeExpressSyncSharesResponse.Success"));<NEW_LINE>List<Share> shares = new ArrayList<Share>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeExpressSyncSharesResponse.Shares.Length"); i++) {<NEW_LINE>Share share = new Share();<NEW_LINE>share.setMnsQueue(_ctx.stringValue("DescribeExpressSyncSharesResponse.Shares[" + i + "].MnsQueue"));<NEW_LINE>share.setExpressSyncId(_ctx.stringValue("DescribeExpressSyncSharesResponse.Shares[" + i + "].ExpressSyncId"));<NEW_LINE>share.setGatewayId(_ctx.stringValue<MASK><NEW_LINE>share.setExpressSyncState(_ctx.stringValue("DescribeExpressSyncSharesResponse.Shares[" + i + "].ExpressSyncState"));<NEW_LINE>share.setGatewayName(_ctx.stringValue("DescribeExpressSyncSharesResponse.Shares[" + i + "].GatewayName"));<NEW_LINE>share.setStorageBundleId(_ctx.stringValue("DescribeExpressSyncSharesResponse.Shares[" + i + "].StorageBundleId"));<NEW_LINE>share.setSyncProgress(_ctx.integerValue("DescribeExpressSyncSharesResponse.Shares[" + i + "].SyncProgress"));<NEW_LINE>share.setGatewayRegion(_ctx.stringValue("DescribeExpressSyncSharesResponse.Shares[" + i + "].GatewayRegion"));<NEW_LINE>share.setShareName(_ctx.stringValue("DescribeExpressSyncSharesResponse.Shares[" + i + "].ShareName"));<NEW_LINE>shares.add(share);<NEW_LINE>}<NEW_LINE>describeExpressSyncSharesResponse.setShares(shares);<NEW_LINE>return describeExpressSyncSharesResponse;<NEW_LINE>} | ("DescribeExpressSyncSharesResponse.Shares[" + i + "].GatewayId")); |
654,445 | public static void main(String[] args) throws IOException {<NEW_LINE>Exchange coingi = CoingiDemoUtils.createExchange();<NEW_LINE>MarketDataService marketDataService = coingi.getMarketDataService();<NEW_LINE>OrderBook orderBook = marketDataService.getOrderBook(CurrencyPair.BTC_EUR);<NEW_LINE>// The following example limits max asks to 10, max bids to 10, and market depth to 32<NEW_LINE>// OrderBook orderBook = marketDataService.getOrderBook(CurrencyPair.BTC_EUR, 10, 10, 32);<NEW_LINE>List<LimitOrder<MASK><NEW_LINE>List<LimitOrder> bids = orderBook.getBids();<NEW_LINE>asks.forEach(System.out::println);<NEW_LINE>bids.forEach(System.out::println);<NEW_LINE>System.out.printf("Received an order book with the latest %d asks and %d bids.\n", asks.size(), bids.size());<NEW_LINE>} | > asks = orderBook.getAsks(); |
509,667 | public static DescribeDomainQpsWithCacheResponse unmarshall(DescribeDomainQpsWithCacheResponse describeDomainQpsWithCacheResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeDomainQpsWithCacheResponse.setRequestId(_ctx.stringValue("DescribeDomainQpsWithCacheResponse.RequestId"));<NEW_LINE>describeDomainQpsWithCacheResponse.setInterval(_ctx.integerValue("DescribeDomainQpsWithCacheResponse.Interval"));<NEW_LINE>describeDomainQpsWithCacheResponse.setStartTime(_ctx.longValue("DescribeDomainQpsWithCacheResponse.StartTime"));<NEW_LINE>List<String> totals = new ArrayList<String>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeDomainQpsWithCacheResponse.Totals.Length"); i++) {<NEW_LINE>totals.add(_ctx.stringValue("DescribeDomainQpsWithCacheResponse.Totals[" + i + "]"));<NEW_LINE>}<NEW_LINE>describeDomainQpsWithCacheResponse.setTotals(totals);<NEW_LINE>List<String> blocks = new ArrayList<String>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeDomainQpsWithCacheResponse.Blocks.Length"); i++) {<NEW_LINE>blocks.add(_ctx.stringValue<MASK><NEW_LINE>}<NEW_LINE>describeDomainQpsWithCacheResponse.setBlocks(blocks);<NEW_LINE>List<String> cacheHits = new ArrayList<String>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeDomainQpsWithCacheResponse.CacheHits.Length"); i++) {<NEW_LINE>cacheHits.add(_ctx.stringValue("DescribeDomainQpsWithCacheResponse.CacheHits[" + i + "]"));<NEW_LINE>}<NEW_LINE>describeDomainQpsWithCacheResponse.setCacheHits(cacheHits);<NEW_LINE>List<String> preciseBlocks = new ArrayList<String>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeDomainQpsWithCacheResponse.PreciseBlocks.Length"); i++) {<NEW_LINE>preciseBlocks.add(_ctx.stringValue("DescribeDomainQpsWithCacheResponse.PreciseBlocks[" + i + "]"));<NEW_LINE>}<NEW_LINE>describeDomainQpsWithCacheResponse.setPreciseBlocks(preciseBlocks);<NEW_LINE>List<String> regionBlocks = new ArrayList<String>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeDomainQpsWithCacheResponse.RegionBlocks.Length"); i++) {<NEW_LINE>regionBlocks.add(_ctx.stringValue("DescribeDomainQpsWithCacheResponse.RegionBlocks[" + i + "]"));<NEW_LINE>}<NEW_LINE>describeDomainQpsWithCacheResponse.setRegionBlocks(regionBlocks);<NEW_LINE>List<String> ipBlockQps = new ArrayList<String>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeDomainQpsWithCacheResponse.IpBlockQps.Length"); i++) {<NEW_LINE>ipBlockQps.add(_ctx.stringValue("DescribeDomainQpsWithCacheResponse.IpBlockQps[" + i + "]"));<NEW_LINE>}<NEW_LINE>describeDomainQpsWithCacheResponse.setIpBlockQps(ipBlockQps);<NEW_LINE>List<String> ccJsQps = new ArrayList<String>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeDomainQpsWithCacheResponse.CcJsQps.Length"); i++) {<NEW_LINE>ccJsQps.add(_ctx.stringValue("DescribeDomainQpsWithCacheResponse.CcJsQps[" + i + "]"));<NEW_LINE>}<NEW_LINE>describeDomainQpsWithCacheResponse.setCcJsQps(ccJsQps);<NEW_LINE>List<String> preciseJsQps = new ArrayList<String>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeDomainQpsWithCacheResponse.PreciseJsQps.Length"); i++) {<NEW_LINE>preciseJsQps.add(_ctx.stringValue("DescribeDomainQpsWithCacheResponse.PreciseJsQps[" + i + "]"));<NEW_LINE>}<NEW_LINE>describeDomainQpsWithCacheResponse.setPreciseJsQps(preciseJsQps);<NEW_LINE>List<String> ccBlockQps = new ArrayList<String>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeDomainQpsWithCacheResponse.CcBlockQps.Length"); i++) {<NEW_LINE>ccBlockQps.add(_ctx.stringValue("DescribeDomainQpsWithCacheResponse.CcBlockQps[" + i + "]"));<NEW_LINE>}<NEW_LINE>describeDomainQpsWithCacheResponse.setCcBlockQps(ccBlockQps);<NEW_LINE>return describeDomainQpsWithCacheResponse;<NEW_LINE>} | ("DescribeDomainQpsWithCacheResponse.Blocks[" + i + "]")); |
585,366 | final UpdateChannelReadMarkerResult executeUpdateChannelReadMarker(UpdateChannelReadMarkerRequest updateChannelReadMarkerRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateChannelReadMarkerRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateChannelReadMarkerRequest> request = null;<NEW_LINE>Response<UpdateChannelReadMarkerResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateChannelReadMarkerRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateChannelReadMarkerRequest));<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, "Chime SDK Messaging");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateChannelReadMarker");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateChannelReadMarkerResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateChannelReadMarkerResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} | endClientExecution(awsRequestMetrics, request, response); |
11,064 | // ----------------//<NEW_LINE>// validateSheets //<NEW_LINE>// ----------------//<NEW_LINE>@Action<NEW_LINE>public void validateSheets(ActionEvent e) {<NEW_LINE>List<Descriptor> sheets = sheetSelector.list.getSelectedValuesList();<NEW_LINE><MASK><NEW_LINE>if (size > 0) {<NEW_LINE>JFrame frame = new JFrame("Sheets " + sheets);<NEW_LINE>ValidationPanel panel = new // false => not TRAIN but Test<NEW_LINE>ValidationPanel(// false => not TRAIN but Test<NEW_LINE>new Trainer.Task(ShapeClassifier.getInstance()), // false => not TRAIN but Test<NEW_LINE>new ConstantSource(sheetSelector.getTestSamples()), false);<NEW_LINE>Panel comp = (Panel) panel.getComponent();<NEW_LINE>// TLBR<NEW_LINE>comp.setInsets(5, 5, 5, 5);<NEW_LINE>frame.add(comp);<NEW_LINE>frame.pack();<NEW_LINE>frame.setVisible(true);<NEW_LINE>}<NEW_LINE>} | int size = sheets.size(); |
689,625 | public static void createExternalSymbols(HashMap<String, ArrayList<Function>> symbolMap) {<NEW_LINE>for (Map.Entry<String, ArrayList<Function>> functions : symbolMap.entrySet()) {<NEW_LINE>ExternSymbol extSym = new ExternSymbol();<NEW_LINE>extSym.setName(functions.getKey());<NEW_LINE>for (Function func : functions.getValue()) {<NEW_LINE>if (HelperFunctions.sameSymbolNameNotCallingCurrentSymbol(func)) {<NEW_LINE>extSym.setTid(new Tid(String.format("sub_%s", func.getEntryPoint().toString()), func.getEntryPoint().toString()));<NEW_LINE>extSym.<MASK><NEW_LINE>extSym.setArguments(createArguments(func));<NEW_LINE>extSym.setCallingConvention(HelperFunctions.funcMan.getDefaultCallingConvention().toString());<NEW_LINE>extSym.setHasVarArgs(func.hasVarArgs());<NEW_LINE>}<NEW_LINE>if (!func.isExternal()) {<NEW_LINE>extSym.getAddresses().add(func.getEntryPoint().toString());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>externalSymbolMap.put(functions.getKey(), extSym);<NEW_LINE>}<NEW_LINE>} | setNoReturn(func.hasNoReturn()); |
859,478 | protected void executeRollbackScript(String rollbackScript, List<ChangeSet> changeSets, Contexts contexts, LabelExpression labelExpression) throws LiquibaseException {<NEW_LINE>final Executor executor = Scope.getCurrentScope().getSingleton(ExecutorService.class).getExecutor("jdbc", database);<NEW_LINE>String rollbackScriptContents;<NEW_LINE>try (InputStreamList streams = resourceAccessor.openStreams(null, rollbackScript)) {<NEW_LINE>if ((streams == null) || streams.isEmpty()) {<NEW_LINE>throw new LiquibaseException("WARNING: The rollback script '" + rollbackScript + "' was not located. Please check your parameters. No rollback was performed");<NEW_LINE>} else if (streams.size() > 1) {<NEW_LINE>throw new LiquibaseException("Found multiple rollbackScripts named " + rollbackScript);<NEW_LINE>}<NEW_LINE>rollbackScriptContents = StreamUtil.readStreamAsString(streams.iterator().next());<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new LiquibaseException("Error reading rollbackScript " + executor + ": " + e.getMessage());<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// Expand changelog properties<NEW_LINE>//<NEW_LINE>changeLogParameters.setContexts(contexts);<NEW_LINE>changeLogParameters.setLabels(labelExpression);<NEW_LINE>DatabaseChangeLog changelog = getDatabaseChangeLog();<NEW_LINE>rollbackScriptContents = changeLogParameters.expandExpressions(rollbackScriptContents, changelog);<NEW_LINE>RawSQLChange rollbackChange = buildRawSQLChange(rollbackScriptContents);<NEW_LINE>try {<NEW_LINE>((HubChangeExecListener<MASK><NEW_LINE>sendRollbackMessages(changeSets, changelog, RollbackMessageType.WILL_ROLLBACK, contexts, labelExpression, null);<NEW_LINE>executor.execute(rollbackChange);<NEW_LINE>sendRollbackMessages(changeSets, changelog, RollbackMessageType.ROLLED_BACK, contexts, labelExpression, null);<NEW_LINE>} catch (DatabaseException e) {<NEW_LINE>Scope.getCurrentScope().getLog(getClass()).warning(e.getMessage());<NEW_LINE>LOG.severe("Error executing rollback script: " + e.getMessage());<NEW_LINE>if (changeExecListener != null) {<NEW_LINE>sendRollbackMessages(changeSets, changelog, RollbackMessageType.ROLLBACK_FAILED, contexts, labelExpression, e);<NEW_LINE>}<NEW_LINE>throw new DatabaseException("Error executing rollback script", e);<NEW_LINE>}<NEW_LINE>database.commit();<NEW_LINE>} | ) changeExecListener).setRollbackScriptContents(rollbackScriptContents); |
82,114 | private static void addRecordFields(List<String> required, List<Node> recordFieldList, Map.Entry<String, Schema> field, Map<String, NonTerminalNode> typeDefinitionNodes, boolean isRecordTypeDescriptor) throws JsonToRecordConverterException {<NEW_LINE>TypeDescriptorNode fieldTypeName = extractOpenApiSchema(field.getValue(), field.<MASK><NEW_LINE>IdentifierToken fieldName = AbstractNodeFactory.createIdentifierToken(escapeIdentifier(field.getKey().trim()));<NEW_LINE>Token questionMarkToken = (required != null && required.contains(field.getKey().trim())) ? null : AbstractNodeFactory.createToken(SyntaxKind.QUESTION_MARK_TOKEN);<NEW_LINE>Token semicolonToken = AbstractNodeFactory.createToken(SyntaxKind.SEMICOLON_TOKEN);<NEW_LINE>RecordFieldNode recordFieldNode = NodeFactory.createRecordFieldNode(null, null, fieldTypeName, fieldName, questionMarkToken, semicolonToken);<NEW_LINE>recordFieldList.add(recordFieldNode);<NEW_LINE>} | getKey(), typeDefinitionNodes, isRecordTypeDescriptor); |
1,552,409 | public void login() {<NEW_LINE>String content = String.format("grant_type=password&username=%1$s&password=%2$s&expires_in=0", urlEncode(username), urlEncode(password));<NEW_LINE>sendCommand(null, "createToken", "particle", "particle", content, new HttpResponseHandler() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void handleResponse(int statusCode, String responseBody) {<NEW_LINE>logger.trace("Processing login: statusCode={}, responseBody={}", statusCode, responseBody);<NEW_LINE>if (statusCode == HttpStatus.SC_OK) {<NEW_LINE>try {<NEW_LINE>tokens = JSON.<MASK><NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.warn("Unable to parse token response.", e);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>logger.warn("Login failure. Status code = {}", statusCode);<NEW_LINE>logger.trace("Failure response: {}", responseBody);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | readValue(responseBody, TokenResponse.class); |
311,122 | public Observable<HttpClientResponse<O>> call(Server server) {<NEW_LINE>HttpClient<I, O> rxClient = getOrCreateRxClient(server);<NEW_LINE>setHostHeader(request, server.getHost());<NEW_LINE>Observable<HttpClientResponse<O>> o;<NEW_LINE>if (rxClientConfig != null) {<NEW_LINE>o = rxClient.submit(request, rxClientConfig);<NEW_LINE>} else {<NEW_LINE>o = rxClient.submit(request);<NEW_LINE>}<NEW_LINE>return o.concatMap(new Func1<HttpClientResponse<O>, Observable<HttpClientResponse<O>>>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Observable<HttpClientResponse<O>> call(HttpClientResponse<O> t1) {<NEW_LINE>if (t1.getStatus().code() / 100 == 4 || t1.getStatus().code() / 100 == 5)<NEW_LINE>return responseToErrorPolicy.call(t1, backoffStrategy.call<MASK><NEW_LINE>else<NEW_LINE>return Observable.just(t1);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | (count.getAndIncrement())); |
138,744 | private StoredValue readSetting(final PwmSetting setting) {<NEW_LINE>if (DomainID.systemId().equals(domainID)) {<NEW_LINE>if (setting.getCategory().getScope() == PwmSettingScope.DOMAIN) {<NEW_LINE>final String msg = "attempt to read domain scope setting '" + setting.toMenuLocationDebug(profileID, null) + "' as system scope";<NEW_LINE>final PwmUnrecoverableException pwmUnrecoverableException = PwmUnrecoverableException.newException(PwmError.ERROR_INTERNAL, msg);<NEW_LINE>throw new IllegalStateException(msg, pwmUnrecoverableException);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (setting.getCategory().getScope() == PwmSettingScope.SYSTEM) {<NEW_LINE>final String msg = "attempt to read system scope setting '" + setting.toMenuLocationDebug(profileID, null) + "' as domain scope";<NEW_LINE>final PwmUnrecoverableException pwmUnrecoverableException = PwmUnrecoverableException.newException(PwmError.ERROR_INTERNAL, msg);<NEW_LINE>throw new IllegalStateException(msg, pwmUnrecoverableException);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (setting.getFlags().contains(PwmSettingFlag.Deprecated)) {<NEW_LINE>LOGGER.warn(() -> "attempt to read deprecated config setting: " + setting<MASK><NEW_LINE>}<NEW_LINE>if (StringUtil.isEmpty(profileID)) {<NEW_LINE>if (setting.getCategory().hasProfiles()) {<NEW_LINE>throw new IllegalStateException("attempt to read profiled setting '" + setting.toMenuLocationDebug(profileID, null) + "' via non-profile");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (!setting.getCategory().hasProfiles()) {<NEW_LINE>throw new IllegalStateException("attempt to read non-profiled setting '" + setting.toMenuLocationDebug(profileID, null) + "' via profile");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final StoredConfigKey key = StoredConfigKey.forSetting(setting, profileID, domainID);<NEW_LINE>return StoredConfigurationUtil.getValueOrDefault(storedConfiguration, key);<NEW_LINE>} | .toMenuLocationDebug(profileID, null)); |
1,130,302 | public Void visitIdentifier(IdentifierTree identifierTree, Void unused) {<NEW_LINE>if (identifierTree.getName().contentEquals("this")) {<NEW_LINE>return super.visitIdentifier(identifierTree, unused);<NEW_LINE>}<NEW_LINE>Symbol symbol = getSymbol(identifierTree);<NEW_LINE>if (symbol == null || ASTHelpers.isLocal(symbol)) {<NEW_LINE>return super.visitIdentifier(identifierTree, unused);<NEW_LINE>}<NEW_LINE>Tree parentNode = getCurrentPath().getParentPath().getLeaf();<NEW_LINE>if (nameUsageDoesntRequireQualificationOrImport(parentNode)) {<NEW_LINE>return super.visitIdentifier(identifierTree, unused);<NEW_LINE>}<NEW_LINE>// TODO(glorioso): This suggestion has the following behavior:<NEW_LINE>// * instance methods: foo() -> this.foo(), no import needed<NEW_LINE>// * static methods in other classes: foo() -> foo(), static import Owner.foo;<NEW_LINE>// * static methods in this class: myFoo() -> Me.myFoo(), import Me;<NEW_LINE>// That seems wrong. Perhaps move the import logic from the other bits here?<NEW_LINE>boolean isMemberOfThisClass = isMemberOfThisClass(symbol, parentNode);<NEW_LINE>boolean nameUsageRequiresNoQualification = nameUsageDoesntRequireQualification(parentNode);<NEW_LINE>if (symbol.isStatic()) {<NEW_LINE>if (isMemberOfThisClass) {<NEW_LINE>addImport(classSymbol.<MASK><NEW_LINE>if (!nameUsageRequiresNoQualification) {<NEW_LINE>qualifications.put(identifierTree, treeMaker.Ident(classSymbol));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (parentNode instanceof NewClassTree) {<NEW_LINE>// This Identifier is the class being constructed<NEW_LINE>addImport(symbol.getQualifiedName().toString());<NEW_LINE>} else {<NEW_LINE>// Regular static methods<NEW_LINE>staticImports.add(symbol.owner.getQualifiedName() + "." + symbol.getQualifiedName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (isMemberOfThisClass) {<NEW_LINE>if (!nameUsageRequiresNoQualification) {<NEW_LINE>qualifications.put(identifierTree, treeMaker.This(classSymbol.type));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>addImport(symbol.getQualifiedName().toString());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return super.visitIdentifier(identifierTree, unused);<NEW_LINE>} | getQualifiedName().toString()); |
1,172,671 | public void success(Object response) {<NEW_LINE>if (response != null) {<NEW_LINE>Map<String, Object> responseMap = (<MASK><NEW_LINE>Integer action = (Integer) responseMap.get("action");<NEW_LINE>if (action != null) {<NEW_LINE>switch(action) {<NEW_LINE>case 1:<NEW_LINE>String username = (String) responseMap.get("username");<NEW_LINE>String password = (String) responseMap.get("password");<NEW_LINE>Boolean permanentPersistence = (Boolean) responseMap.get("permanentPersistence");<NEW_LINE>if (permanentPersistence != null && permanentPersistence) {<NEW_LINE>CredentialDatabase.getInstance(view.getContext()).setHttpAuthCredential(host, protocol, realm, port, username, password);<NEW_LINE>}<NEW_LINE>handler.proceed(username, password);<NEW_LINE>return;<NEW_LINE>case 2:<NEW_LINE>if (credentialsProposed.size() > 0) {<NEW_LINE>URLCredential credential = credentialsProposed.remove(0);<NEW_LINE>handler.proceed(credential.getUsername(), credential.getPassword());<NEW_LINE>} else {<NEW_LINE>handler.cancel();<NEW_LINE>}<NEW_LINE>// used custom CredentialDatabase!<NEW_LINE>// handler.useHttpAuthUsernamePassword();<NEW_LINE>return;<NEW_LINE>case 0:<NEW_LINE>default:<NEW_LINE>credentialsProposed = null;<NEW_LINE>previousAuthRequestFailureCount = 0;<NEW_LINE>handler.cancel();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>InAppWebViewClient.super.onReceivedHttpAuthRequest(view, handler, host, realm);<NEW_LINE>} | Map<String, Object>) response; |
348,474 | int offer(ByteBuffer buffer, int newOffset) {<NEW_LINE>if (newOffset < 0) {<NEW_LINE>throw new IllegalArgumentException("Negative offset: " + newOffset);<NEW_LINE>}<NEW_LINE>if (buffers.length == count) {<NEW_LINE>doubleCapacity();<NEW_LINE>}<NEW_LINE>buffers[endIndex] = buffer.asReadOnlyBuffer();<NEW_LINE>bufferIds[endIndex] = ++nextId;<NEW_LINE>if (nextId == Integer.MAX_VALUE) {<NEW_LINE>nextId = 0;<NEW_LINE>}<NEW_LINE>count++;<NEW_LINE>endIndex = nextBufferIndex(endIndex);<NEW_LINE>vlength = vlength + buffer.limit() - newOffset;<NEW_LINE>// absolute position for current buffer start<NEW_LINE>int pos = 0;<NEW_LINE>// new absolute offset with current buffers<NEW_LINE>int off = voffset + newOffset;<NEW_LINE>boolean found = false;<NEW_LINE>for (int i = startIndex; isBufferIndex(i) && pos <= off; i = nextBufferIndex(i)) {<NEW_LINE>int nextPosition = pos + <MASK><NEW_LINE>if (nextPosition >= off) {<NEW_LINE>voffset = off - pos;<NEW_LINE>found = true;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>pos = nextPosition;<NEW_LINE>// remove<NEW_LINE>buffers[i] = null;<NEW_LINE>bufferIds[i] = 0;<NEW_LINE>count--;<NEW_LINE>startIndex = nextBufferIndex(startIndex);<NEW_LINE>}<NEW_LINE>if (!found) {<NEW_LINE>throw new IllegalStateException("Unable to find new absolute position for offset: " + newOffset);<NEW_LINE>}<NEW_LINE>return nextId;<NEW_LINE>} | buffers[i].limit(); |
1,837,913 | static long doPMmapI64(PMMap mmap, long byteIdx, @Exclusive @Cached LookupInheritedAttributeNode.Dynamic lookupGetItemNode, @Exclusive @Cached CallNode callGetItemNode, @Cached PyLongAsLongNode asLongNode) {<NEW_LINE>long len = mmap.getLength();<NEW_LINE>Object attrGetItem = lookupGetItemNode.execute(mmap, SpecialMethodNames.__GETITEM__);<NEW_LINE>int i = (int) byteIdx;<NEW_LINE>long result = 0;<NEW_LINE>for (int j = 0; j < Long.BYTES; j++) {<NEW_LINE>if (i + j < len) {<NEW_LINE>long shift = Byte.SIZE * j;<NEW_LINE>long mask = 0xFFL << shift;<NEW_LINE>result |= (asLongNode.execute(null, callGetItemNode.execute(attrGetItem, mmap, <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | byteIdx)) << shift) & mask; |
47,584 | public com.squareup.okhttp.Call endpointCertificatesGetCall(String xWSO2Tenant, String alias, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {<NEW_LINE>Object localVarPostBody = null;<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/endpoint-certificates";<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();<NEW_LINE>if (alias != null)<NEW_LINE>localVarQueryParams.addAll(apiClient.parameterToPair("alias", alias));<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>if (xWSO2Tenant != null)<NEW_LINE>localVarHeaderParams.put("xWSO2Tenant", apiClient.parameterToString(xWSO2Tenant));<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>final String[] localVarAccepts = { "application/json" };<NEW_LINE>final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>if (localVarAccept != null)<NEW_LINE>localVarHeaderParams.put("Accept", localVarAccept);<NEW_LINE>final String[] localVarContentTypes = {};<NEW_LINE>final String <MASK><NEW_LINE>localVarHeaderParams.put("Content-Type", localVarContentType);<NEW_LINE>if (progressListener != null) {<NEW_LINE>apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {<NEW_LINE>com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());<NEW_LINE>return originalResponse.newBuilder().body(new ProgressResponseBody(originalResponse.body(), progressListener)).build();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>String[] localVarAuthNames = new String[] {};<NEW_LINE>return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);<NEW_LINE>} | localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); |
671,130 | protected void processVariableAggregationDefinitions(VariableAggregationDefinitions aggregations, ObjectNode propertiesNode) {<NEW_LINE>if (aggregations == null) {<NEW_LINE>propertiesNode.putNull(PROPERTY_MULTIINSTANCE_VARIABLE_AGGREGATIONS);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>ObjectNode aggregationsNode = propertiesNode.putObject(PROPERTY_MULTIINSTANCE_VARIABLE_AGGREGATIONS);<NEW_LINE>Collection<VariableAggregationDefinition> aggregationsCollection = aggregations.getAggregations();<NEW_LINE>ArrayNode itemsArray = aggregationsNode.putArray("aggregations");<NEW_LINE>for (VariableAggregationDefinition aggregation : aggregationsCollection) {<NEW_LINE>ObjectNode aggregationNode = itemsArray.addObject();<NEW_LINE>aggregationNode.put("target", aggregation.getTarget());<NEW_LINE>aggregationNode.put("targetExpression", aggregation.getTarget());<NEW_LINE>String implementationType = aggregation.getImplementationType();<NEW_LINE>if (ImplementationType.IMPLEMENTATION_TYPE_DELEGATEEXPRESSION.equals(implementationType)) {<NEW_LINE>aggregationNode.put("delegateExpression", aggregation.getImplementation());<NEW_LINE>} else if (ImplementationType.IMPLEMENTATION_TYPE_CLASS.equals(implementationType)) {<NEW_LINE>aggregationNode.put("class", aggregation.getImplementation());<NEW_LINE>}<NEW_LINE>aggregationNode.put("storeAsTransient", aggregation.isStoreAsTransientVariable());<NEW_LINE>aggregationNode.put("createOverview", aggregation.isCreateOverviewVariable());<NEW_LINE>ArrayNode definitionsArray = aggregationNode.putArray("definitions");<NEW_LINE>for (VariableAggregationDefinition.Variable definition : aggregation.getDefinitions()) {<NEW_LINE>ObjectNode definitionNode = definitionsArray.addObject();<NEW_LINE>definitionNode.put("source", definition.getSource());<NEW_LINE>definitionNode.put("sourceExpression", definition.getSourceExpression());<NEW_LINE>definitionNode.put(<MASK><NEW_LINE>definitionNode.put("targetExpression", definition.getTargetExpression());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | "target", definition.getTarget()); |
822,007 | /* (non-Javadoc)<NEW_LINE>* @see org.openide.nodes.ChildFactory#createKeys(java.util.List)<NEW_LINE>*/<NEW_LINE>@Override<NEW_LINE>protected boolean createKeys(final List<ResourceNode> keys) {<NEW_LINE>WLDeploymentManager manager = lookup.lookup(WLDeploymentManager.class);<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>support.executeAction(new WLConnectionSupport.JMXRuntimeAction<Void>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Void call(MBeanServerConnection con, ObjectName service) throws Exception {<NEW_LINE>ObjectName domainConfig = (ObjectName) // NOI18N<NEW_LINE>con.// NOI18N<NEW_LINE>getAttribute(// NOI18N<NEW_LINE>service, "DomainConfiguration");<NEW_LINE>ObjectName[] deployments = (ObjectName[]) // NOI18N<NEW_LINE>con.// NOI18N<NEW_LINE>getAttribute(// NOI18N<NEW_LINE>domainConfig, "Deployments");<NEW_LINE>for (ObjectName deployment : deployments) {<NEW_LINE>// NOI18N<NEW_LINE>String type = con.getAttribute(deployment, "Type").toString();<NEW_LINE>ResourceNode node = createNode(con, deployment, type);<NEW_LINE>if (node != null) {<NEW_LINE>keys.add(node);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOGGER.log(Level.INFO, null, e);<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | WLConnectionSupport support = manager.getConnectionSupport(); |
1,817,273 | private List<FrameworkCommand> filter() {<NEW_LINE>List<FrameworkCommand> matching = new ArrayList<>();<NEW_LINE>Pattern pattern = StringUtils.getPattern(filter);<NEW_LINE>if (pattern != null) {<NEW_LINE>for (FrameworkCommand task : tasks) {<NEW_LINE>// NOI18N<NEW_LINE>String command = StringUtils.implode(Arrays.asList(task.getCommands()), " ");<NEW_LINE>Matcher m = pattern.matcher(command);<NEW_LINE>if (m.matches()) {<NEW_LINE>matching.add(task);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>List<FrameworkCommand> exact = new ArrayList<>();<NEW_LINE>for (FrameworkCommand task : tasks) {<NEW_LINE>// NOI18N<NEW_LINE>String command = StringUtils.implode(Arrays.asList(task<MASK><NEW_LINE>String taskLC = command.toLowerCase(Locale.ENGLISH);<NEW_LINE>String filterLC = filter.toLowerCase(Locale.ENGLISH);<NEW_LINE>if (taskLC.startsWith(filterLC)) {<NEW_LINE>// show tasks which start with the filter first<NEW_LINE>exact.add(task);<NEW_LINE>} else if (taskLC.contains(filterLC)) {<NEW_LINE>matching.add(task);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>matching.addAll(0, exact);<NEW_LINE>}<NEW_LINE>return matching;<NEW_LINE>} | .getCommands()), " "); |
127,450 | public void start() {<NEW_LINE>WebClient client = WebClient.create(vertx);<NEW_LINE>vertx.createHttpServer().requestHandler(req -> {<NEW_LINE>switch(req.path()) {<NEW_LINE>case "/hello":<NEW_LINE>client.get(8081, "localhost", "/").expect(ResponsePredicate.SC_OK).send().onSuccess(resp -> req.response().end(resp.body())).onFailure(failure -> {<NEW_LINE>failure.printStackTrace();<NEW_LINE>req.response().setStatusCode(500).end();<NEW_LINE>});<NEW_LINE>break;<NEW_LINE>case "/joke":<NEW_LINE>client.get(8082, "localhost", "/").expect(ResponsePredicate.SC_OK).send().onSuccess(resp -> req.response().end(resp.body())).onFailure(failure -> {<NEW_LINE>failure.printStackTrace();<NEW_LINE>req.response().<MASK><NEW_LINE>});<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>req.response().setStatusCode(404).end();<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}).listen(8080);<NEW_LINE>} | setStatusCode(500).end(); |
521,071 | public void buildCtrLexMatrix(String id, XVariables.XVarInteger[][] matrix, Types.TypeOperatorRel operator) {<NEW_LINE>switch(operator) {<NEW_LINE>case LT:<NEW_LINE>{<NEW_LINE>model.lexChainLess(vars(matrix)).post();<NEW_LINE>XVariables.XVarInteger[][] tmatrix = ArrayUtils.transpose(matrix);<NEW_LINE>model.lexChainLess(vars(tmatrix)).post();<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case LE:<NEW_LINE>{<NEW_LINE>model.lexChainLessEq(vars(matrix)).post();<NEW_LINE>XVariables.XVarInteger[][] tmatrix = ArrayUtils.transpose(matrix);<NEW_LINE>model.lexChainLessEq(vars(tmatrix)).post();<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case GT:<NEW_LINE>{<NEW_LINE>XVariables.XVarInteger[][] rmatrix = matrix.clone();<NEW_LINE>ArrayUtils.reverse(rmatrix);<NEW_LINE>model.lexChainLess(vars(rmatrix)).post();<NEW_LINE>model.lexChainLess(vars(ArrayUtils.transpose(<MASK><NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case GE:<NEW_LINE>{<NEW_LINE>XVariables.XVarInteger[][] rmatrix = matrix.clone();<NEW_LINE>ArrayUtils.reverse(rmatrix);<NEW_LINE>model.lexChainLessEq(vars(rmatrix)).post();<NEW_LINE>model.lexChainLessEq(vars(ArrayUtils.transpose(rmatrix))).post();<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>} | rmatrix))).post(); |
296,092 | public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {<NEW_LINE>HttpServletRequest req = (HttpServletRequest) request;<NEW_LINE>HttpServletResponse resp = (HttpServletResponse) response;<NEW_LINE>String servletPath = servletPathPrefix;<NEW_LINE>if (servletPath == null) {<NEW_LINE>servletPath = req.getServletPath();<NEW_LINE>}<NEW_LINE>String requestUrl = req.getRequestURI().substring(req.getContextPath().length() + servletPath.length());<NEW_LINE>boolean requiresEngineAuthentication = requiresEngineAuthentication(requestUrl);<NEW_LINE>if (!requiresEngineAuthentication) {<NEW_LINE>chain.doFilter(request, response);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String engineName = extractEngineName(requestUrl);<NEW_LINE>ProcessEngine engine = getAddressedEngine(engineName);<NEW_LINE>if (engine == null) {<NEW_LINE>resp.setStatus(Status.NOT_FOUND.getStatusCode());<NEW_LINE>ExceptionDto exceptionDto = new ExceptionDto();<NEW_LINE>exceptionDto.setType(InvalidRequestException.class.getSimpleName());<NEW_LINE>exceptionDto.setMessage("Process engine " + engineName + " not available");<NEW_LINE>ObjectMapper objectMapper = new ObjectMapper();<NEW_LINE><MASK><NEW_LINE>objectMapper.writer().writeValue(resp.getWriter(), exceptionDto);<NEW_LINE>resp.getWriter().flush();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>AuthenticationResult authenticationResult = authenticationProvider.extractAuthenticatedUser(req, engine);<NEW_LINE>if (authenticationResult.isAuthenticated()) {<NEW_LINE>try {<NEW_LINE>String authenticatedUser = authenticationResult.getAuthenticatedUser();<NEW_LINE>List<String> groups = authenticationResult.getGroups();<NEW_LINE>List<String> tenants = authenticationResult.getTenants();<NEW_LINE>setAuthenticatedUser(engine, authenticatedUser, groups, tenants);<NEW_LINE>chain.doFilter(request, response);<NEW_LINE>} finally {<NEW_LINE>clearAuthentication(engine);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>resp.setStatus(Status.UNAUTHORIZED.getStatusCode());<NEW_LINE>authenticationProvider.augmentResponseByAuthenticationChallenge(resp, engine);<NEW_LINE>}<NEW_LINE>} | resp.setContentType(MediaType.APPLICATION_JSON); |
61,899 | public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {<NEW_LINE>app = requireMyApplication();<NEW_LINE>boolean nightMode = !app.getSettings().isLightActionBar();<NEW_LINE>LayoutInflater themedInflater = UiUtilities.getInflater(requireContext(), nightMode);<NEW_LINE>View view = themedInflater.inflate(R.layout.fragment_edit_poi_normal, container, false);<NEW_LINE>InputFilter[] lengthLimit = new InputFilter[] { new LengthFilter(AMENITY_TEXT_LENGTH) };<NEW_LINE>streetEditText = view.findViewById(R.id.streetEditText);<NEW_LINE>houseNumberEditText = view.findViewById(R.id.houseNumberEditText);<NEW_LINE>phoneEditText = view.findViewById(R.id.phoneEditText);<NEW_LINE>webSiteEditText = view.findViewById(R.id.webSiteEditText);<NEW_LINE>descriptionEditText = view.findViewById(R.id.descriptionEditText);<NEW_LINE>addTextWatcher(OSMTagKey.ADDR_STREET.getValue(), streetEditText);<NEW_LINE>addTextWatcher(OSMTagKey.WEBSITE.getValue(), webSiteEditText);<NEW_LINE>addTextWatcher(OSMTagKey.PHONE.getValue(), phoneEditText);<NEW_LINE>addTextWatcher(OSMTagKey.ADDR_HOUSE_NUMBER.getValue(), houseNumberEditText);<NEW_LINE>addTextWatcher(OSMTagKey.DESCRIPTION.getValue(), descriptionEditText);<NEW_LINE>streetEditText.setFilters(lengthLimit);<NEW_LINE>houseNumberEditText.setFilters(lengthLimit);<NEW_LINE>phoneEditText.setFilters(lengthLimit);<NEW_LINE>webSiteEditText.setFilters(lengthLimit);<NEW_LINE>descriptionEditText.setFilters(lengthLimit);<NEW_LINE>AndroidUtils.setTextHorizontalGravity(streetEditText, Gravity.START);<NEW_LINE>AndroidUtils.<MASK><NEW_LINE>AndroidUtils.setTextHorizontalGravity(phoneEditText, Gravity.START);<NEW_LINE>AndroidUtils.setTextHorizontalGravity(webSiteEditText, Gravity.START);<NEW_LINE>AndroidUtils.setTextHorizontalGravity(descriptionEditText, Gravity.START);<NEW_LINE>Button addOpeningHoursButton = view.findViewById(R.id.addOpeningHoursButton);<NEW_LINE>addOpeningHoursButton.setOnClickListener(new View.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(View v) {<NEW_LINE>BasicOpeningHourRule rule = new BasicOpeningHourRule();<NEW_LINE>rule.setStartTime(9 * 60);<NEW_LINE>rule.setEndTime(18 * 60);<NEW_LINE>if (openingHoursAdapter.openingHours.getRules().isEmpty()) {<NEW_LINE>rule.setDays(new boolean[] { true, true, true, true, true, false, false });<NEW_LINE>}<NEW_LINE>OpeningHoursDaysDialogFragment fragment = OpeningHoursDaysDialogFragment.createInstance(rule, -1);<NEW_LINE>fragment.show(getChildFragmentManager(), "OpenTimeDialogFragment");<NEW_LINE>}<NEW_LINE>});<NEW_LINE>int iconColor = ColorUtilities.getSecondaryTextColor(app, nightMode);<NEW_LINE>Drawable clockDrawable = getPaintedContentIcon(R.drawable.ic_action_time, iconColor);<NEW_LINE>Drawable deleteDrawable = getPaintedContentIcon(R.drawable.ic_action_remove_dark, iconColor);<NEW_LINE>LinearLayout openHoursContainer = view.findViewById(R.id.openHoursContainer);<NEW_LINE>if (savedInstanceState != null && savedInstanceState.containsKey(OPENING_HOURS)) {<NEW_LINE>openingHoursAdapter = new OpeningHoursAdapter(app, (OpeningHours) savedInstanceState.getSerializable(OPENING_HOURS), openHoursContainer, getData(), clockDrawable, deleteDrawable);<NEW_LINE>openingHoursAdapter.updateViews();<NEW_LINE>} else {<NEW_LINE>openingHoursAdapter = new OpeningHoursAdapter(app, new OpeningHours(), openHoursContainer, getData(), clockDrawable, deleteDrawable);<NEW_LINE>}<NEW_LINE>onFragmentActivated();<NEW_LINE>return view;<NEW_LINE>} | setTextHorizontalGravity(houseNumberEditText, Gravity.START); |
1,103,223 | public void webSocketHandshakeResponseReceived(InspectorWebSocketResponse response) {<NEW_LINE>NetworkPeerManager peerManager = getPeerManagerIfEnabled();<NEW_LINE>if (peerManager != null) {<NEW_LINE>Network.WebSocketHandshakeResponseReceivedParams params = new Network.WebSocketHandshakeResponseReceivedParams();<NEW_LINE>params.requestId = response.requestId();<NEW_LINE>params.timestamp = stethoNow() / 1000.0;<NEW_LINE>Network.WebSocketResponse <MASK><NEW_LINE>responseJSON.headers = formatHeadersAsJSON(response);<NEW_LINE>responseJSON.headersText = null;<NEW_LINE>if (response.requestHeaders() != null) {<NEW_LINE>responseJSON.requestHeaders = formatHeadersAsJSON(response.requestHeaders());<NEW_LINE>responseJSON.requestHeadersText = null;<NEW_LINE>}<NEW_LINE>responseJSON.status = response.statusCode();<NEW_LINE>responseJSON.statusText = response.reasonPhrase();<NEW_LINE>params.response = responseJSON;<NEW_LINE>peerManager.sendNotificationToPeers("Network.webSocketHandshakeResponseReceived", params);<NEW_LINE>}<NEW_LINE>} | responseJSON = new Network.WebSocketResponse(); |
1,201,102 | final GetEC2RecommendationProjectedMetricsResult executeGetEC2RecommendationProjectedMetrics(GetEC2RecommendationProjectedMetricsRequest getEC2RecommendationProjectedMetricsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getEC2RecommendationProjectedMetricsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetEC2RecommendationProjectedMetricsRequest> request = null;<NEW_LINE>Response<GetEC2RecommendationProjectedMetricsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetEC2RecommendationProjectedMetricsRequestProtocolMarshaller(protocolFactory).marshall<MASK><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, "Compute Optimizer");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetEC2RecommendationProjectedMetrics");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetEC2RecommendationProjectedMetricsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetEC2RecommendationProjectedMetricsResultJsonUnmarshaller());<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>} | (super.beforeMarshalling(getEC2RecommendationProjectedMetricsRequest)); |
1,850,725 | final PutScalingPolicyResult executePutScalingPolicy(PutScalingPolicyRequest putScalingPolicyRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(putScalingPolicyRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<PutScalingPolicyRequest> request = null;<NEW_LINE>Response<PutScalingPolicyResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new PutScalingPolicyRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(putScalingPolicyRequest));<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, "Application Auto Scaling");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "PutScalingPolicy");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<PutScalingPolicyResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new PutScalingPolicyResultJsonUnmarshaller());<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); |
55,129 | protected void onHitEntity(@Nonnull EntityHitResult result) {<NEW_LINE>super.onHitEntity(result);<NEW_LINE>if (level.isClientSide) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Entity entity = result.getEntity();<NEW_LINE>if (entity.getType() == EntityType.GHAST && level.dimension() == Level.OVERWORLD) {<NEW_LINE>level.levelEvent(LevelEvent.PARTICLES_SPELL_POTION_SPLASH, blockPosition(), PARTICLE_COLOR);<NEW_LINE>DamageSource source = DamageSource.thrown(this, getOwner());<NEW_LINE>entity.hurt(source, 0);<NEW_LINE>// Ghasts render as if they are looking straight ahead, but the look y component<NEW_LINE>// can actually be nonzero, correct for that<NEW_LINE>Vec3 lookVec = entity.getLookAngle();<NEW_LINE>Vec3 vec = new Vec3(lookVec.x(), 0, lookVec.z()).normalize();<NEW_LINE>// Position chosen to appear roughly in the ghast's face<NEW_LINE>((ServerLevel) level).sendParticles(new ItemParticleOption(ParticleTypes.ITEM, new ItemStack(Items.GHAST_TEAR)), entity.getX() + (2.3 * vec.x), entity.getY() + vec.y + 2.6, entity.getZ() + (2.3 * vec.z), 40, Math.abs(vec.z) + 0.15, 0.2, Math.abs(vec.x) + 0.15, 0.2);<NEW_LINE>LootTable table = level.getServer().getLootTables().get(GHAST_LOOT_TABLE);<NEW_LINE>LootContext.Builder builder = new LootContext.Builder(((ServerLevel) level));<NEW_LINE>builder.<MASK><NEW_LINE>builder.withParameter(LootContextParams.ORIGIN, entity.position());<NEW_LINE>builder.withParameter(LootContextParams.DAMAGE_SOURCE, source);<NEW_LINE>LootContext context = builder.create(LootContextParamSets.ENTITY);<NEW_LINE>for (ItemStack stack : table.getRandomItems(context)) {<NEW_LINE>ItemEntity item = entity.spawnAtLocation(stack, 2);<NEW_LINE>item.setDeltaMovement(item.getDeltaMovement().add(vec.scale(0.4)));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>convertBlock(new BlockPos(result.getLocation()));<NEW_LINE>}<NEW_LINE>discard();<NEW_LINE>} | withParameter(LootContextParams.THIS_ENTITY, entity); |
643,396 | /* (non-Javadoc)<NEW_LINE>* @see ghidra.framework.main.DataTreeDialog#buildMainPanel()<NEW_LINE>*/<NEW_LINE>@Override<NEW_LINE>protected JPanel buildMainPanel() {<NEW_LINE>mainPanel = super.buildMainPanel();<NEW_LINE>mainPanel.setMinimumSize(<MASK><NEW_LINE>splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);<NEW_LINE>splitPane.setLeftComponent(mainPanel);<NEW_LINE>splitPane.setOneTouchExpandable(true);<NEW_LINE>splitPane.setDividerSize(0);<NEW_LINE>splitPane.setDividerLocation(1.0);<NEW_LINE>splitPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));<NEW_LINE>JPanel outerPanel = new JPanel(new BorderLayout());<NEW_LINE>outerPanel.add(splitPane);<NEW_LINE>String showHistory = Preferences.getProperty(SHOW_HISTORY_PREFERENCES_KEY, Boolean.FALSE.toString(), true);<NEW_LINE>if (Boolean.parseBoolean(showHistory)) {<NEW_LINE>showHistoryPanel(true);<NEW_LINE>}<NEW_LINE>return outerPanel;<NEW_LINE>} | new Dimension(200, HEIGHT)); |
302,097 | public static void showModulesUpdatedNotification() {<NEW_LINE>Intent intent = new Intent(sContext, WelcomeActivity.class);<NEW_LINE>intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);<NEW_LINE>intent.putExtra(FRAGMENT_ID, 0);<NEW_LINE>PendingIntent pInstallTab = PendingIntent.getActivity(sContext, PENDING_INTENT_OPEN_INSTALL, intent, PendingIntent.FLAG_UPDATE_CURRENT);<NEW_LINE>String title = sContext.<MASK><NEW_LINE>String message = sContext.getString(R.string.xposed_module_updated_notification);<NEW_LINE>NotificationCompat.Builder builder = new NotificationCompat.Builder(sContext, MeowCatApplication.TAG).setContentTitle(title).setContentText(message).setTicker(title).setContentIntent(pInstallTab).setVibrate(new long[] { 0 }).setAutoCancel(true).setSmallIcon(R.drawable.ic_notification);<NEW_LINE>if (prefs.getBoolean(HEADS_UP, true)) {<NEW_LINE>builder.setPriority(2);<NEW_LINE>} else {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (prefs.getBoolean(COLORED_NOTIFICATION, false))<NEW_LINE>builder.setColor(XposedApp.getColor(sContext));<NEW_LINE>builder.setChannelId(NOTIFICATION_MODULES_CHANNEL);<NEW_LINE>sNotificationManager.notify(null, NOTIFICATION_MODULES_UPDATED, builder.build());<NEW_LINE>} | getString(R.string.xposed_module_updated_notification_title); |
246,987 | public String apply() {<NEW_LINE>// This function can be called by the migration window, step tab for both<NEW_LINE>// rollback and apply. Determine if we need to apply or rollback the step<NEW_LINE>if (MMigrationStep.STATUSCODE_Applied.equals(getStatusCode()) && MMigrationStep.APPLY_Rollback.equals(getApply())) {<NEW_LINE>apply = false;<NEW_LINE>return rollback();<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>if (MMigrationStep.STATUSCODE_Applied.equals(getStatusCode())) {<NEW_LINE>if (!MMigrationStep.APPLY_Rollback.equals(getApply())) {<NEW_LINE>// Fix the control - should read rollback.<NEW_LINE>setApply(MMigrationStep.APPLY_Rollback);<NEW_LINE>saveEx();<NEW_LINE>}<NEW_LINE>log.log(Level.CONFIG, "Migration step already applied: " + this);<NEW_LINE>return retval + "Already applied";<NEW_LINE>}<NEW_LINE>// Flag that a script is in progress to shut off some validation checks<NEW_LINE>Env.setContext(getCtx(), "MigrationStepApplyInProgress", "Y");<NEW_LINE>log.log(Level.CONFIG, "Applying migration step: " + this.toString());<NEW_LINE>if (MMigrationStep.STEPTYPE_SQLStatement.equals(getStepType()))<NEW_LINE>retval += applySQL(!apply);<NEW_LINE>else if (MMigrationStep.STEPTYPE_ApplicationDictionary.equals(getStepType()))<NEW_LINE>retval += applyPO();<NEW_LINE>else {<NEW_LINE>bailout("Unknown step type.");<NEW_LINE>}<NEW_LINE>// Unset flag that a script is in progress to shut off some validation checks<NEW_LINE>Env.setContext(getCtx(), "MigrationStepApplyInProgress", "");<NEW_LINE>log.log(Level.CONFIG, retval);<NEW_LINE>getParent().updateStatus();<NEW_LINE>getParent().save();<NEW_LINE>return retval;<NEW_LINE>} | String retval = this.toString(); |
247,538 | public void process(double[] input, double[] output) {<NEW_LINE>// given the current value of v, compute P3<NEW_LINE>// P3 = [cross(T31)'*F31 + T31*v' | T31 ]<NEW_LINE>computeP3(input);<NEW_LINE>// [R,T] = [P3*P2 | P3*u]<NEW_LINE>CommonOps_DDRM.mult(P3, P2inv, R);<NEW_LINE>GeometryMath_F64.mult(P3, u, a);<NEW_LINE>// Compute the new fundamental matrix<NEW_LINE>GeometryMath_F64.multCrossA(a, R, F32_est);<NEW_LINE>// TODO sign ambuguity?<NEW_LINE>// Put into a common scale so that it can be compared against F32<NEW_LINE>double n = NormOps_DDRM.normF(F32_est);<NEW_LINE>CommonOps_DDRM.<MASK><NEW_LINE>for (int i = 0; i < 9; i++) {<NEW_LINE>output[i] = F32_est.data[i] - F32.data[i];<NEW_LINE>}<NEW_LINE>} | scale(1.0 / n, F32_est); |
1,462,688 | private void removeUsedParameters(Expression expression, Map<String, ClassNode> availableParams) {<NEW_LINE>if (expression instanceof MethodCall) {<NEW_LINE>// next find out if there are any existing named args<NEW_LINE>MethodCall call = (MethodCall) expression;<NEW_LINE>Expression arguments = call.getArguments();<NEW_LINE>if (arguments instanceof TupleExpression) {<NEW_LINE>for (Expression maybeArg : ((TupleExpression) arguments).getExpressions()) {<NEW_LINE>if (maybeArg instanceof MapExpression) {<NEW_LINE>arguments = maybeArg;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// now remove the arguments that are already written<NEW_LINE>if (arguments instanceof MapExpression) {<NEW_LINE>// Do extra filtering to determine what parameters are still available<NEW_LINE>MapExpression enclosingCallArgs = (MapExpression) arguments;<NEW_LINE>for (MapEntryExpression entry : enclosingCallArgs.getMapEntryExpressions()) {<NEW_LINE>String paramName = entry<MASK><NEW_LINE>availableParams.remove(paramName);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | .getKeyExpression().getText(); |
1,427,481 | public static GetVehicleRepairPlanResponse unmarshall(GetVehicleRepairPlanResponse getVehicleRepairPlanResponse, UnmarshallerContext _ctx) {<NEW_LINE>getVehicleRepairPlanResponse.setRequestId(_ctx.stringValue("GetVehicleRepairPlanResponse.RequestId"));<NEW_LINE>getVehicleRepairPlanResponse.setHttpCode(_ctx.integerValue("GetVehicleRepairPlanResponse.HttpCode"));<NEW_LINE>getVehicleRepairPlanResponse.setErrorMessage(_ctx.stringValue("GetVehicleRepairPlanResponse.ErrorMessage"));<NEW_LINE>getVehicleRepairPlanResponse.setCode(_ctx.stringValue("GetVehicleRepairPlanResponse.Code"));<NEW_LINE>getVehicleRepairPlanResponse.setSuccess(_ctx.booleanValue("GetVehicleRepairPlanResponse.Success"));<NEW_LINE>Data data = new Data();<NEW_LINE>data.setFrameNo(_ctx.stringValue("GetVehicleRepairPlanResponse.Data.FrameNo"));<NEW_LINE>List<RepairItems> repairParts = new ArrayList<RepairItems>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("GetVehicleRepairPlanResponse.Data.RepairParts.Length"); i++) {<NEW_LINE>RepairItems repairItems = new RepairItems();<NEW_LINE>repairItems.setRelationType(_ctx.stringValue("GetVehicleRepairPlanResponse.Data.RepairParts[" + i + "].RelationType"));<NEW_LINE>repairItems.setPartsStdCode(_ctx.stringValue<MASK><NEW_LINE>repairItems.setPartNameMatch(_ctx.booleanValue("GetVehicleRepairPlanResponse.Data.RepairParts[" + i + "].PartNameMatch"));<NEW_LINE>repairItems.setRepairFee(_ctx.stringValue("GetVehicleRepairPlanResponse.Data.RepairParts[" + i + "].RepairFee"));<NEW_LINE>repairItems.setOutStandardPartsName(_ctx.stringValue("GetVehicleRepairPlanResponse.Data.RepairParts[" + i + "].OutStandardPartsName"));<NEW_LINE>repairItems.setPartsStdName(_ctx.stringValue("GetVehicleRepairPlanResponse.Data.RepairParts[" + i + "].PartsStdName"));<NEW_LINE>repairItems.setRepairTypeName(_ctx.stringValue("GetVehicleRepairPlanResponse.Data.RepairParts[" + i + "].RepairTypeName"));<NEW_LINE>repairItems.setRepairType(_ctx.stringValue("GetVehicleRepairPlanResponse.Data.RepairParts[" + i + "].RepairType"));<NEW_LINE>repairItems.setOeMatch(_ctx.booleanValue("GetVehicleRepairPlanResponse.Data.RepairParts[" + i + "].OeMatch"));<NEW_LINE>repairItems.setOutStandardPartsId(_ctx.stringValue("GetVehicleRepairPlanResponse.Data.RepairParts[" + i + "].OutStandardPartsId"));<NEW_LINE>repairItems.setGarageType(_ctx.stringValue("GetVehicleRepairPlanResponse.Data.RepairParts[" + i + "].GarageType"));<NEW_LINE>repairParts.add(repairItems);<NEW_LINE>}<NEW_LINE>data.setRepairParts(repairParts);<NEW_LINE>getVehicleRepairPlanResponse.setData(data);<NEW_LINE>return getVehicleRepairPlanResponse;<NEW_LINE>} | ("GetVehicleRepairPlanResponse.Data.RepairParts[" + i + "].PartsStdCode")); |
1,515,618 | public void runCoref(Document document) {<NEW_LINE>Map<Pair<Integer, Integer>, Boolean> mentionPairs = CorefUtils.getUnlabeledMentionPairs(document);<NEW_LINE>if (mentionPairs.size() == 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Compressor<String> compressor = new Compressor<>();<NEW_LINE>DocumentExamples examples = extractor.extract(0, document, mentionPairs, compressor);<NEW_LINE>Counter<Pair<Integer, Integer>> classificationScores = new ClassicCounter<>();<NEW_LINE>Counter<Pair<Integer, Integer>> rankingScores = new ClassicCounter<>();<NEW_LINE>Counter<Integer> anaphoricityScores = new ClassicCounter<>();<NEW_LINE>for (Example example : examples.examples) {<NEW_LINE>CorefUtils.checkForInterrupt();<NEW_LINE>Pair<Integer, Integer> mentionPair = new Pair<>(example.mentionId1, example.mentionId2);<NEW_LINE>classificationScores.incrementCount(mentionPair, classificationModel.predict(example, examples.mentionFeatures, compressor));<NEW_LINE>rankingScores.incrementCount(mentionPair, rankingModel.predict(example, examples.mentionFeatures, compressor));<NEW_LINE>if (!anaphoricityScores.containsKey(example.mentionId2)) {<NEW_LINE>anaphoricityScores.incrementCount(example.mentionId2, anaphoricityModel.predict(new Example(example, false), examples.mentionFeatures, compressor));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ClustererDoc doc = new ClustererDoc(0, classificationScores, rankingScores, anaphoricityScores, mentionPairs, null, document.predictedMentionsByID.entrySet().stream().collect(Collectors.toMap(Map.Entry::getKey, e -> e.getValue().<MASK><NEW_LINE>for (Pair<Integer, Integer> mentionPair : clusterer.getClusterMerges(doc)) {<NEW_LINE>CorefUtils.mergeCoreferenceClusters(mentionPair, document);<NEW_LINE>}<NEW_LINE>} | mentionType.toString()))); |
388,021 | public static List<Element> fromObject(Document doc, String name, Object o) {<NEW_LINE>if (o instanceof Map) {<NEW_LINE>Map<String, Object> map = (Map) o;<NEW_LINE>Map<String, Object> attribs = (Map) map.get("@");<NEW_LINE>Object value = map.get("_");<NEW_LINE>if (value != null || attribs != null) {<NEW_LINE>List<Element> elements = fromObject(doc, name, value);<NEW_LINE>addAttributes(elements.get(0), attribs);<NEW_LINE>return elements;<NEW_LINE>} else {<NEW_LINE>Element element = createElement(doc, name, null, null);<NEW_LINE>for (Map.Entry<String, Object> entry : map.entrySet()) {<NEW_LINE>String childName = entry.getKey();<NEW_LINE>Object childValue = entry.getValue();<NEW_LINE>List<Element> childNodes = <MASK><NEW_LINE>for (Element e : childNodes) {<NEW_LINE>element.appendChild(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return Collections.singletonList(element);<NEW_LINE>}<NEW_LINE>} else if (o instanceof List) {<NEW_LINE>List list = (List) o;<NEW_LINE>List<Element> elements = new ArrayList(list.size());<NEW_LINE>for (Object child : list) {<NEW_LINE>List<Element> childNodes = fromObject(doc, name, child);<NEW_LINE>for (Element e : childNodes) {<NEW_LINE>elements.add(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return elements;<NEW_LINE>} else {<NEW_LINE>String value = o == null ? null : o.toString();<NEW_LINE>Element element = createElement(doc, name, value, null);<NEW_LINE>return Collections.singletonList(element);<NEW_LINE>}<NEW_LINE>} | fromObject(doc, childName, childValue); |
287,342 | public void saveScripts() {<NEW_LINE>((HierarchicalConfiguration) getConfig()).clearTree(ALL_SCRIPTS_KEY);<NEW_LINE>int i = 0;<NEW_LINE>for (ScriptWrapper script : scripts) {<NEW_LINE>if (script.isLoadOnStart()) {<NEW_LINE>String elementBaseKey = ALL_SCRIPTS_KEY + "(" + i + ").";<NEW_LINE>getConfig().setProperty(elementBaseKey + SCRIPT_NAME_KEY, script.getName());<NEW_LINE>getConfig().setProperty(elementBaseKey + SCRIPT_DESC_KEY, script.getDescription());<NEW_LINE>getConfig().setProperty(elementBaseKey + <MASK><NEW_LINE>getConfig().setProperty(elementBaseKey + SCRIPT_TYPE_KEY, script.getTypeName());<NEW_LINE>getConfig().setProperty(elementBaseKey + SCRIPT_ENABLED_KEY, script.isEnabled());<NEW_LINE>getConfig().setProperty(elementBaseKey + SCRIPT_FILE_KEY, script.getFile().getAbsolutePath());<NEW_LINE>i++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | SCRIPT_ENGINE_KEY, script.getEngineName()); |
1,453,410 | private void performPreAssignmentCleanup(List<DatastreamGroup> datastreamGroups) {<NEW_LINE>// Map between instance to tasks assigned to the instance.<NEW_LINE>Map<String, Set<DatastreamTask>> previousAssignmentByInstance = _adapter.getAllAssignedDatastreamTasks();<NEW_LINE>_log.info("performPreAssignmentCleanup: start");<NEW_LINE>_log.debug("performPreAssignmentCleanup: assignment before cleanup: " + previousAssignmentByInstance);<NEW_LINE>for (String connectorType : _connectors.keySet()) {<NEW_LINE>AssignmentStrategy strategy = _connectors.<MASK><NEW_LINE>List<DatastreamGroup> datastreamsPerConnectorType = datastreamGroups.stream().filter(x -> x.getConnectorName().equals(connectorType)).collect(Collectors.toList());<NEW_LINE>Map<String, List<DatastreamTask>> tasksToCleanupMap = strategy.getTasksToCleanUp(datastreamsPerConnectorType, previousAssignmentByInstance);<NEW_LINE>if (tasksToCleanupMap.size() > 0) {<NEW_LINE>for (String instance : tasksToCleanupMap.keySet()) {<NEW_LINE>List<String> tasksToCleanupList = tasksToCleanupMap.get(instance).stream().map(DatastreamTask::getDatastreamTaskName).collect(Collectors.toList());<NEW_LINE>_log.warn("Tasks to cleanup for connector {} on instance {} : {}", connectorType, instance, tasksToCleanupList);<NEW_LINE>}<NEW_LINE>if (_config.getPerformPreAssignmentCleanup()) {<NEW_LINE>_adapter.removeTaskNodes(tasksToCleanupMap);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>_log.info("performPreAssignmentCleanup: completed");<NEW_LINE>} | get(connectorType).getAssignmentStrategy(); |
1,272,371 | public static JPanel createConfigSectionComponent(String labelText) {<NEW_LINE>JLabel label = new JLabel(labelText);<NEW_LINE>label.setBorder(new EmptyBorder(0, 0, 0, 10));<NEW_LINE>label.setFont(label.getFont()<MASK><NEW_LINE>JPanel pnlSectionName = new TransparentPanel();<NEW_LINE>pnlSectionName.setLayout(new GridBagLayout());<NEW_LINE>GridBagConstraints c = new GridBagConstraints();<NEW_LINE>c.gridx = c.gridy = 0;<NEW_LINE>c.anchor = GridBagConstraints.LINE_START;<NEW_LINE>c.gridwidth = 2;<NEW_LINE>pnlSectionName.add(label, c);<NEW_LINE>c.gridx = 2;<NEW_LINE>c.weightx = 1;<NEW_LINE>c.fill = GridBagConstraints.HORIZONTAL;<NEW_LINE>pnlSectionName.add(new JSeparator(), c);<NEW_LINE>JPanel pnlSection = new TransparentPanel() {<NEW_LINE><NEW_LINE>private static final long serialVersionUID = 0L;<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Component add(Component comp) {<NEW_LINE>if (comp instanceof JComponent)<NEW_LINE>((JComponent) comp).setAlignmentX(LEFT_ALIGNMENT);<NEW_LINE>return super.add(comp);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>pnlSection.setLayout(new BoxLayout(pnlSection, BoxLayout.Y_AXIS));<NEW_LINE>pnlSection.add(pnlSectionName);<NEW_LINE>return pnlSection;<NEW_LINE>} | .deriveFont(Font.BOLD)); |
892,505 | private Map<String, INDArray> toPlaceholderMap(MultiDataSet ds) {<NEW_LINE>Map<String, INDArray> placeholders = new HashMap<>();<NEW_LINE>int count = 0;<NEW_LINE>for (String s : trainingConfig.getDataSetFeatureMapping()) {<NEW_LINE>placeholders.put(s, ds.getFeatures(count++));<NEW_LINE>}<NEW_LINE>count = 0;<NEW_LINE>if (trainingConfig.getDataSetLabelMapping() != null) {<NEW_LINE>// Labels may be null in some models (unsupervised etc)<NEW_LINE>for (String s : trainingConfig.getDataSetLabelMapping()) {<NEW_LINE>placeholders.put(s, ds.getLabels(count++));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (trainingConfig.getDataSetFeatureMaskMapping() != null && trainingConfig.getDataSetFeatureMaskMapping().size() > 0) {<NEW_LINE>count = 0;<NEW_LINE>for (String s : trainingConfig.getDataSetFeatureMaskMapping()) {<NEW_LINE>if (s == null) {<NEW_LINE>count++;<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>placeholders.put(s, <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (trainingConfig.getDataSetLabelMaskMapping() != null && trainingConfig.getDataSetLabelMaskMapping().size() > 0) {<NEW_LINE>count = 0;<NEW_LINE>for (String s : trainingConfig.getDataSetLabelMaskMapping()) {<NEW_LINE>if (s == null) {<NEW_LINE>count++;<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>placeholders.put(s, ds.getLabelsMaskArray(count++));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return placeholders;<NEW_LINE>} | ds.getFeaturesMaskArray(count++)); |
438,547 | private void updateProperties(ForeignKeyColumn column) {<NEW_LINE>PropertySupport ps = new PropertySupport.Name(this);<NEW_LINE>addProperty(ps);<NEW_LINE>try {<NEW_LINE>Column referred = column.getReferredColumn();<NEW_LINE>Column referring = column.getReferringColumn();<NEW_LINE>addProperty(FKPOSITION, FKPOSITIONDESC, Integer.class, false, column.getPosition());<NEW_LINE>addProperty(FKREFERRINGSCHEMA, FKREFERRINGSCHEMADESC, String.class, false, referring.getParent().getParent().getName());<NEW_LINE>addProperty(FKREFERRINGTABLE, FKREFERRINGTABLEDESC, String.class, false, referring.getParent().getName());<NEW_LINE>addProperty(FKREFERRINGCOLUMN, FKREFERRINGCOLUMNDESC, String.class, false, referring.getName());<NEW_LINE>addProperty(FKREFERREDSCHEMA, FKREFERREDSCHEMADESC, String.class, false, referred.getParent().getParent().getName());<NEW_LINE>addProperty(FKREFERREDTABLE, FKREFERREDTABLEDESC, String.class, false, referred.<MASK><NEW_LINE>addProperty(FKREFERREDCOLUMN, FKREFERREDCOLUMNDESC, String.class, false, referred.getName());<NEW_LINE>} catch (Exception e) {<NEW_LINE>Exceptions.printStackTrace(e);<NEW_LINE>}<NEW_LINE>} | getParent().getName()); |
41,142 | private void createJournal(MJournalBatch journalBatch, int conversionTypeId, int calendarId, int budgetId) {<NEW_LINE>int noPeriods = 0;<NEW_LINE>if (getNoOfPeriods() == 0 || getNoOfPeriods() > 12)<NEW_LINE>noPeriods = 12;<NEW_LINE>else<NEW_LINE>noPeriods = getNoOfPeriods();<NEW_LINE>definePeriods(calendarId);<NEW_LINE>if (noPeriods > glPeriods.size())<NEW_LINE>noPeriods = glPeriods.size();<NEW_LINE>for (int periodNo = 0; periodNo < noPeriods; periodNo++) {<NEW_LINE>MJournal journal = new MJournal(getCtx(), 0, journalBatch.get_TrxName());<NEW_LINE>journal.setGL_JournalBatch_ID(journalBatch.getGL_JournalBatch_ID());<NEW_LINE>DateFormat dateFormat = new SimpleDateFormat("yyyy-MM");<NEW_LINE>String formattedDate = dateFormat.format(glPeriods.get(periodNo).getStartDate());<NEW_LINE>journal.setDocumentNo(journalBatch.getDocumentNo() + "-" + formattedDate);<NEW_LINE>journal.setDescription(getBatchDescription());<NEW_LINE>journal.setDateAcct(glPeriodsDates.get(periodNo));<NEW_LINE>journal.setDateDoc(glPeriodsDates.get(periodNo));<NEW_LINE>journal.setC_Period_ID(glPeriods.get(periodNo).getC_Period_ID());<NEW_LINE>journal.setClientOrg(journal.getGL_JournalBatch().getAD_Client_ID(), journal.getGL_JournalBatch().getAD_Org_ID());<NEW_LINE>journal.setPostingType(MJournalBatch.POSTINGTYPE_Budget);<NEW_LINE>journal.setGL_Category_ID(journalBatch.getGL_Category_ID());<NEW_LINE>journal.<MASK><NEW_LINE>journal.setC_DocType_ID(journalBatch.getC_DocType_ID());<NEW_LINE>journal.setCurrencyRate(BigDecimal.ONE);<NEW_LINE>journal.setC_ConversionType_ID(conversionTypeId);<NEW_LINE>journal.setGL_Budget_ID(budgetId);<NEW_LINE>journal.setC_AcctSchema_ID(getAccountingSchemaId());<NEW_LINE>journal.saveEx();<NEW_LINE>createJournalLine(journal, journalBatch.getDocumentNo(), periodNo);<NEW_LINE>}<NEW_LINE>} | setC_Currency_ID(journalBatch.getC_Currency_ID()); |
227,898 | public void readStackMap(LLVMStackMapInfo info, CompilationResult compilation, ResolvedJavaMethod method, int id) {<NEW_LINE>String methodSymbolName = SYMBOL_PREFIX + SubstrateUtil.uniqueShortName(method);<NEW_LINE>long startPatchpointID = compilation.getInfopoints().stream().filter(ip -> ip.reason == InfopointReason.METHOD_START).findFirst().orElseThrow(() -> new GraalError("no method start infopoint: " + methodSymbolName)).pcOffset;<NEW_LINE>int totalFrameSize = NumUtil.safeToInt(info.getFunctionStackSize(startPatchpointID) + LLVMTargetSpecific.<MASK><NEW_LINE>compilation.setTotalFrameSize(totalFrameSize);<NEW_LINE>stackMapDumper.startDumpingFunction(methodSymbolName, id, totalFrameSize);<NEW_LINE>List<Infopoint> newInfopoints = new ArrayList<>();<NEW_LINE>for (Infopoint infopoint : compilation.getInfopoints()) {<NEW_LINE>if (infopoint instanceof Call) {<NEW_LINE>Call call = (Call) infopoint; | get().getCallFrameSeparation()); |
332,693 | public ListInstancesResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ListInstancesResult listInstancesResult = new ListInstancesResult();<NEW_LINE><MASK><NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return listInstancesResult;<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("Instances", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listInstancesResult.setInstances(new ListUnmarshaller<Instance>(InstanceJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("Marker", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listInstancesResult.setMarker(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 listInstancesResult;<NEW_LINE>} | int originalDepth = context.getCurrentDepth(); |
955,497 | private int readFrames(ExtractorInput input, PositionHolder seekPosition) throws IOException {<NEW_LINE>Assertions.checkNotNull(trackOutput);<NEW_LINE>Assertions.checkNotNull(flacStreamMetadata);<NEW_LINE>// Handle pending binary search seek if necessary.<NEW_LINE>if (binarySearchSeeker != null && binarySearchSeeker.isSeeking()) {<NEW_LINE>return binarySearchSeeker.handlePendingSeek(input, seekPosition);<NEW_LINE>}<NEW_LINE>// Set current frame first sample number if it became unknown after seeking.<NEW_LINE>if (currentFrameFirstSampleNumber == SAMPLE_NUMBER_UNKNOWN) {<NEW_LINE>currentFrameFirstSampleNumber = FlacFrameReader.getFirstSampleNumber(input, flacStreamMetadata);<NEW_LINE>return Extractor.RESULT_CONTINUE;<NEW_LINE>}<NEW_LINE>// Copy more bytes into the buffer.<NEW_LINE>int currentLimit = buffer.limit();<NEW_LINE>boolean foundEndOfInput = false;<NEW_LINE>if (currentLimit < BUFFER_LENGTH) {<NEW_LINE>int bytesRead = input.read(buffer.getData(), /* offset= */<NEW_LINE>currentLimit, /* length= */<NEW_LINE>BUFFER_LENGTH - currentLimit);<NEW_LINE>foundEndOfInput = bytesRead == C.RESULT_END_OF_INPUT;<NEW_LINE>if (!foundEndOfInput) {<NEW_LINE>buffer.setLimit(currentLimit + bytesRead);<NEW_LINE>} else if (buffer.bytesLeft() == 0) {<NEW_LINE>outputSampleMetadata();<NEW_LINE>return Extractor.RESULT_END_OF_INPUT;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Search for a frame.<NEW_LINE>int positionBeforeFindingAFrame = buffer.getPosition();<NEW_LINE>// Skip frame search on the bytes within the minimum frame size.<NEW_LINE>if (currentFrameBytesWritten < minFrameSize) {<NEW_LINE>buffer.skipBytes(min(minFrameSize - currentFrameBytesWritten, buffer.bytesLeft()));<NEW_LINE>}<NEW_LINE>long <MASK><NEW_LINE>int numberOfFrameBytes = buffer.getPosition() - positionBeforeFindingAFrame;<NEW_LINE>buffer.setPosition(positionBeforeFindingAFrame);<NEW_LINE>trackOutput.sampleData(buffer, numberOfFrameBytes);<NEW_LINE>currentFrameBytesWritten += numberOfFrameBytes;<NEW_LINE>// Frame found.<NEW_LINE>if (nextFrameFirstSampleNumber != SAMPLE_NUMBER_UNKNOWN) {<NEW_LINE>outputSampleMetadata();<NEW_LINE>currentFrameBytesWritten = 0;<NEW_LINE>currentFrameFirstSampleNumber = nextFrameFirstSampleNumber;<NEW_LINE>}<NEW_LINE>if (buffer.bytesLeft() < FlacConstants.MAX_FRAME_HEADER_SIZE) {<NEW_LINE>// The next frame header may not fit in the rest of the buffer, so put the trailing bytes at<NEW_LINE>// the start of the buffer, and reset the position and limit.<NEW_LINE>int bytesLeft = buffer.bytesLeft();<NEW_LINE>System.arraycopy(buffer.getData(), buffer.getPosition(), buffer.getData(), /* destPos= */<NEW_LINE>0, bytesLeft);<NEW_LINE>buffer.setPosition(0);<NEW_LINE>buffer.setLimit(bytesLeft);<NEW_LINE>}<NEW_LINE>return Extractor.RESULT_CONTINUE;<NEW_LINE>} | nextFrameFirstSampleNumber = findFrame(buffer, foundEndOfInput); |
798,109 | public void marshall(PackageDetails packageDetails, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (packageDetails == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(packageDetails.getPackageID(), PACKAGEID_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(packageDetails.getPackageType(), PACKAGETYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(packageDetails.getPackageDescription(), PACKAGEDESCRIPTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(packageDetails.getPackageStatus(), PACKAGESTATUS_BINDING);<NEW_LINE>protocolMarshaller.marshall(packageDetails.getCreatedAt(), CREATEDAT_BINDING);<NEW_LINE>protocolMarshaller.marshall(packageDetails.getLastUpdatedAt(), LASTUPDATEDAT_BINDING);<NEW_LINE>protocolMarshaller.marshall(packageDetails.getAvailablePackageVersion(), AVAILABLEPACKAGEVERSION_BINDING);<NEW_LINE>protocolMarshaller.marshall(packageDetails.getErrorDetails(), ERRORDETAILS_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | packageDetails.getPackageName(), PACKAGENAME_BINDING); |
12,589 | private static Object updateAttribute(final String key, final Object value, final List<Allele> originalAlleles, final List<Allele> sortedAlleles, final VCFHeaderLineCount count, int ploidy) {<NEW_LINE>if (key.startsWith("AS_")) {<NEW_LINE>return remapASValues(value instanceof List ? String.join(",", ((List<String>) value)) : (String) value, createAlleleIndexMap(originalAlleles, sortedAlleles));<NEW_LINE>} else {<NEW_LINE>switch(count) {<NEW_LINE>case INTEGER:<NEW_LINE>return value;<NEW_LINE>case UNBOUNDED:<NEW_LINE>// doesn't depend on allele ordering<NEW_LINE>return value;<NEW_LINE>case A:<NEW_LINE>return remapATypeValues(attributeToList(value)<MASK><NEW_LINE>case R:<NEW_LINE>return remapRTypeValues(attributeToList(value), createAlleleIndexMap(originalAlleles, sortedAlleles));<NEW_LINE>case G:<NEW_LINE>return remapGTypeValues(attributeToList(value), originalAlleles, ploidy, sortedAlleles);<NEW_LINE>default:<NEW_LINE>throw new GATKException("found unexpected vcf header count type: " + count);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | , createAlleleIndexMap(originalAlleles, sortedAlleles)); |
1,231,479 | public void init() {<NEW_LINE>BlueprintCraftingRecipe.addRecipe("specialBullet", BulletHandler.getBulletStack("terrasteel"), new ItemStack(IEContent.itemBullet, 1, 0), Items.GUNPOWDER, "nuggetTerrasteel", "nuggetTerrasteel");<NEW_LINE>try {<NEW_LINE>Class c_BotaniaAPI = Class.forName("vazkii.botania.api.BotaniaAPI");<NEW_LINE>Method m_blacklistBlockFromMagnet = c_BotaniaAPI.getDeclaredMethod("blacklistBlockFromMagnet", Block.class, int.class);<NEW_LINE>m_blacklistBlockFromMagnet.invoke(null, IEContent.blockConveyor, 0);<NEW_LINE>} catch (Exception e) {<NEW_LINE>IELogger.error("[Botania] Failed to protect IE conveyors against Botania's magnets");<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>rariryRelic = Rarity.valueOf("RELIC");<NEW_LINE>if (rariryRelic != null) {<NEW_LINE>ShaderRegistry.<MASK><NEW_LINE>makeShaderRelic("The Kindled");<NEW_LINE>makeShaderRelic("Dark Fire");<NEW_LINE>ShaderRegistryEntry entry = ItemShader.addShader("Terra", 1, rariryRelic, 0xff3e2d14, 0xff2b1108, 0xff41bd1a, 0xff2e120a).setInfo(null, "Botania", "terra");<NEW_LINE>entry.getCase("immersiveengineering:revolver").addLayers(new ShaderLayer(new ResourceLocation("botania:block/livingwood5"), 0xffffffff).setTextureBounds(17 / 128d, 24 / 128d, 33 / 128d, 40 / 128d));<NEW_LINE>entry.getCase("immersiveengineering:drill").addLayers(new ShaderLayer(new ResourceLocation("botania:block/alfheim_portal_swirl"), 0xffffffff).setTextureBounds(14 / 64d, 10 / 64d, 26 / 64d, 22 / 64d));<NEW_LINE>entry.getCase("immersiveengineering:railgun").addLayers(new ShaderLayer(new ResourceLocation("botania:block/storage1"), 0xff9e83eb).setTextureBounds(55 / 64d, 42 / 64d, 1, 58 / 64d).setCutoutBounds(.1875, 0, .75, 1));<NEW_LINE>entry.getCase("immersiveengineering:shield").addLayers(new ShaderLayer(new ResourceLocation("botania:block/crate_open"), 0xffffffff).setTextureBounds(0 / 32f, 9 / 32f, 14 / 32f, 26 / 32f).setCutoutBounds(.0625, 0, .9375, 1));<NEW_LINE>}<NEW_LINE>if (FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT)<NEW_LINE>MinecraftForge.EVENT_BUS.register(this);<NEW_LINE>} | rarityWeightMap.put(rariryRelic, 2); |
749,427 | public synchronized static void auditPatternInstance(boolean increase, EvalFactoryNode factoryNode, AgentInstanceContext agentInstanceContext) {<NEW_LINE>if (AuditPath.isInfoEnabled()) {<NEW_LINE>if (patternInstanceCounts == null) {<NEW_LINE>patternInstanceCounts = new LRUCache<>(100);<NEW_LINE>}<NEW_LINE>AuditPatternInstanceKey key = new AuditPatternInstanceKey(agentInstanceContext.getRuntimeURI(), agentInstanceContext.getStatementId(), agentInstanceContext.getAgentInstanceId(), factoryNode.getTextForAudit());<NEW_LINE>Integer existing = patternInstanceCounts.get(key);<NEW_LINE>int count;<NEW_LINE>if (existing == null) {<NEW_LINE>count = increase ? 1 : 0;<NEW_LINE>} else {<NEW_LINE>count = existing + (increase ? 1 : -1);<NEW_LINE>}<NEW_LINE>StringWriter writer = new StringWriter();<NEW_LINE><MASK><NEW_LINE>writePatternExpr(factoryNode, writer);<NEW_LINE>if (increase) {<NEW_LINE>writer.write(" increased to " + count);<NEW_LINE>} else {<NEW_LINE>writer.write(" decreased to " + count);<NEW_LINE>}<NEW_LINE>auditLog(agentInstanceContext, AuditEnum.PATTERNINSTANCES, writer.toString());<NEW_LINE>}<NEW_LINE>} | patternInstanceCounts.put(key, count); |
944,705 | private Node createNodeDelegateImpl() {<NEW_LINE>try {<NEW_LINE>if (!getPrimaryFile().getFileSystem().isDefault()) {<NEW_LINE>return new DataNode(this, Children.LEAF);<NEW_LINE>}<NEW_LINE>} catch (FileStateInvalidException ex) {<NEW_LINE>err.log(Level.WARNING, null, ex);<NEW_LINE>return new DataNode(this, Children.LEAF);<NEW_LINE>}<NEW_LINE>if (getPrimaryFile().hasExt(XML_EXT)) {<NEW_LINE>// if lookup does not contain any InstanceCookie then the object<NEW_LINE>// is considered as unregognized<NEW_LINE>if (null == getCookieFromEP(InstanceCookie.class)) {<NEW_LINE>return new CookieAdjustingFilter(new UnrecognizedSettingNode());<NEW_LINE>}<NEW_LINE>Node <MASK><NEW_LINE>if (n != null) {<NEW_LINE>return new CookieAdjustingFilter(n);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Instances of Node or Node.Handle should be used as is.<NEW_LINE>try {<NEW_LINE>if (instanceOf(Node.class)) {<NEW_LINE>Node n = (Node) instanceCreate();<NEW_LINE>if (n != null) {<NEW_LINE>// #161888 robustness<NEW_LINE>return new CookieAdjustingFilter(n);<NEW_LINE>}<NEW_LINE>} else if (instanceOf(Node.Handle.class)) {<NEW_LINE>Node.Handle h = (Node.Handle) instanceCreate();<NEW_LINE>if (h != null) {<NEW_LINE>return new CookieAdjustingFilter(h.getNode());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (IOException ex) {<NEW_LINE>err.log(Level.WARNING, null, ex);<NEW_LINE>} catch (ClassNotFoundException ex) {<NEW_LINE>err.log(Level.WARNING, null, ex);<NEW_LINE>}<NEW_LINE>return new InstanceNode(this);<NEW_LINE>} | n = getCookieFromEP(Node.class); |
1,134,183 | public static LLVMLivenessAnalysisResult computeLiveness(Map<InstructionBlock, List<LLVMPhiManager.Phi>> phis, FunctionDefinition functionDefinition) {<NEW_LINE>LLVMLivenessAnalysis analysis = new LLVMLivenessAnalysis(functionDefinition);<NEW_LINE>List<InstructionBlock> blocks = functionDefinition.getBlocks();<NEW_LINE>BlockInfo[] blockInfos = analysis.initializeGenKill(phis, blocks);<NEW_LINE>ArrayList<InstructionBlock>[] predecessors = computePredecessors(blocks);<NEW_LINE>int processedBlocks = iterateToFixedPoint(blocks, analysis.frameSlots.length, blockInfos, predecessors);<NEW_LINE>if (livenessLoggingEnabled()) {<NEW_LINE>analysis.printIntermediateResult(blocks, blockInfos, processedBlocks);<NEW_LINE>}<NEW_LINE>LLVMLivenessAnalysisResult result = analysis.computeLivenessAnalysisResult(blocks, blockInfos, predecessors);<NEW_LINE>if (livenessLoggingEnabled()) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | analysis.printResult(blocks, result); |
1,812,403 | private boolean sendEmail(SenderEmail senderEmail, AlertTemplate mail, String... mails) throws AlertException {<NEW_LINE>log.info(mail.getSubject());<NEW_LINE>try {<NEW_LINE>Map<String, AlertTemplate> out = new HashMap<>(16);<NEW_LINE>out.put("mail", mail);<NEW_LINE>String html = FreemarkerUtils.format(template, out);<NEW_LINE>HtmlEmail htmlEmail = new HtmlEmail();<NEW_LINE>htmlEmail.setCharset("UTF-8");<NEW_LINE>htmlEmail.setHostName(senderEmail.getSmtpHost());<NEW_LINE>htmlEmail.setAuthentication(senderEmail.getUserName(), senderEmail.getPassword());<NEW_LINE>htmlEmail.<MASK><NEW_LINE>if (senderEmail.isSsl()) {<NEW_LINE>htmlEmail.setSSLOnConnect(true);<NEW_LINE>htmlEmail.setSslSmtpPort(senderEmail.getSmtpPort().toString());<NEW_LINE>} else {<NEW_LINE>htmlEmail.setSmtpPort(senderEmail.getSmtpPort());<NEW_LINE>}<NEW_LINE>htmlEmail.setSubject(mail.getSubject());<NEW_LINE>htmlEmail.setHtmlMsg(html);<NEW_LINE>htmlEmail.addTo(mails);<NEW_LINE>htmlEmail.send();<NEW_LINE>return true;<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new AlertException("Failed send email alert", e);<NEW_LINE>}<NEW_LINE>} | setFrom(senderEmail.getFrom()); |
1,729,360 | private void createDirectory(User loginUser, String fullName, ResourceType type, Result<Object> result) {<NEW_LINE>String tenantCode = tenantMapper.queryById(loginUser.getTenantId()).getTenantCode();<NEW_LINE>String directoryName = storageOperate.getFileName(type, tenantCode, fullName);<NEW_LINE>String resourceRootPath = storageOperate.getDir(type, tenantCode);<NEW_LINE>try {<NEW_LINE>if (!storageOperate.exists(tenantCode, resourceRootPath)) {<NEW_LINE>storageOperate.createTenantDirIfNotExists(tenantCode);<NEW_LINE>}<NEW_LINE>if (!storageOperate.mkdir(tenantCode, directoryName)) {<NEW_LINE>logger.error("create resource directory {} failed", directoryName);<NEW_LINE><MASK><NEW_LINE>throw new ServiceException(String.format("create resource directory: %s failed.", directoryName));<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.error("create resource directory {} failed", directoryName);<NEW_LINE>putMsg(result, Status.STORE_OPERATE_CREATE_ERROR);<NEW_LINE>throw new ServiceException(String.format("create resource directory: %s failed.", directoryName));<NEW_LINE>}<NEW_LINE>} | putMsg(result, Status.STORE_OPERATE_CREATE_ERROR); |
764,895 | public void deserialize(ByteBuffer buffer) throws IllegalPathException {<NEW_LINE>// adapt to old version based on version mark<NEW_LINE>int length = buffer.getInt();<NEW_LINE>boolean isOldVersion = true;<NEW_LINE>if (length == PLAN_SINCE_0_14) {<NEW_LINE>length = buffer.getInt();<NEW_LINE>isOldVersion = false;<NEW_LINE>}<NEW_LINE>byte[] bytes = new byte[length];<NEW_LINE>buffer.get(bytes);<NEW_LINE>prefixPath = new PartialPath(new String(bytes));<NEW_LINE>int size = ReadWriteIOUtils.readInt(buffer);<NEW_LINE>measurements = new ArrayList<>();<NEW_LINE>for (int i = 0; i < size; i++) {<NEW_LINE>measurements.add(ReadWriteIOUtils.readString(buffer));<NEW_LINE>}<NEW_LINE>dataTypes = new ArrayList<>();<NEW_LINE>for (int i = 0; i < size; i++) {<NEW_LINE>dataTypes.add(TSDataType.values()[buffer.get()]);<NEW_LINE>}<NEW_LINE>encodings = new ArrayList<>();<NEW_LINE>for (int i = 0; i < size; i++) {<NEW_LINE>encodings.add(TSEncoding.values()[buffer.get()]);<NEW_LINE>}<NEW_LINE>compressors = new ArrayList<>();<NEW_LINE>for (int i = 0; i < size; i++) {<NEW_LINE>compressors.add(CompressionType.values()[buffer.get()]);<NEW_LINE>}<NEW_LINE>if (!isOldVersion) {<NEW_LINE><MASK><NEW_LINE>for (int i = 0; i < size; i++) {<NEW_LINE>tagOffsets.add(buffer.getLong());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// alias<NEW_LINE>if (buffer.get() == 1) {<NEW_LINE>aliasList = new ArrayList<>();<NEW_LINE>for (int i = 0; i < size; i++) {<NEW_LINE>aliasList.add(ReadWriteIOUtils.readString(buffer));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!isOldVersion) {<NEW_LINE>// tags<NEW_LINE>if (buffer.get() == 1) {<NEW_LINE>tagsList = new ArrayList<>();<NEW_LINE>for (int i = 0; i < size; i++) {<NEW_LINE>tagsList.add(ReadWriteIOUtils.readMap(buffer));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// attributes<NEW_LINE>if (buffer.get() == 1) {<NEW_LINE>attributesList = new ArrayList<>();<NEW_LINE>for (int i = 0; i < size; i++) {<NEW_LINE>attributesList.add(ReadWriteIOUtils.readMap(buffer));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>this.index = buffer.getLong();<NEW_LINE>} | tagOffsets = new ArrayList<>(); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.