idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
277,544 | private void writeTermsIndex(SortedSetDocValues values) throws IOException {<NEW_LINE>final long size = values.getValueCount();<NEW_LINE>meta.writeInt(Lucene80DocValuesFormat.TERMS_DICT_REVERSE_INDEX_SHIFT);<NEW_LINE>long start = data.getFilePointer();<NEW_LINE>long numBlocks = 1L + ((size + Lucene80DocValuesFormat.TERMS_DICT_REVERSE_INDEX_MASK) >>> Lucene80DocValuesFormat.TERMS_DICT_REVERSE_INDEX_SHIFT);<NEW_LINE>ByteBuffersDataOutput addressBuffer = new ByteBuffersDataOutput();<NEW_LINE>LegacyDirectMonotonicWriter writer;<NEW_LINE>try (ByteBuffersIndexOutput addressOutput = new ByteBuffersIndexOutput(addressBuffer, "temp", "temp")) {<NEW_LINE>writer = LegacyDirectMonotonicWriter.getInstance(meta, addressOutput, numBlocks, DIRECT_MONOTONIC_BLOCK_SHIFT);<NEW_LINE><MASK><NEW_LINE>BytesRefBuilder previous = new BytesRefBuilder();<NEW_LINE>long offset = 0;<NEW_LINE>long ord = 0;<NEW_LINE>for (BytesRef term = iterator.next(); term != null; term = iterator.next()) {<NEW_LINE>if ((ord & Lucene80DocValuesFormat.TERMS_DICT_REVERSE_INDEX_MASK) == 0) {<NEW_LINE>writer.add(offset);<NEW_LINE>final int sortKeyLength;<NEW_LINE>if (ord == 0) {<NEW_LINE>// no previous term: no bytes to write<NEW_LINE>sortKeyLength = 0;<NEW_LINE>} else {<NEW_LINE>sortKeyLength = StringHelper.sortKeyLength(previous.get(), term);<NEW_LINE>}<NEW_LINE>offset += sortKeyLength;<NEW_LINE>data.writeBytes(term.bytes, term.offset, sortKeyLength);<NEW_LINE>} else if ((ord & Lucene80DocValuesFormat.TERMS_DICT_REVERSE_INDEX_MASK) == Lucene80DocValuesFormat.TERMS_DICT_REVERSE_INDEX_MASK) {<NEW_LINE>previous.copyBytes(term);<NEW_LINE>}<NEW_LINE>++ord;<NEW_LINE>}<NEW_LINE>writer.add(offset);<NEW_LINE>writer.finish();<NEW_LINE>meta.writeLong(start);<NEW_LINE>meta.writeLong(data.getFilePointer() - start);<NEW_LINE>start = data.getFilePointer();<NEW_LINE>addressBuffer.copyTo(data);<NEW_LINE>meta.writeLong(start);<NEW_LINE>meta.writeLong(data.getFilePointer() - start);<NEW_LINE>}<NEW_LINE>} | TermsEnum iterator = values.termsEnum(); |
1,113,975 | public RelWriter explainTermsForDisplay(RelWriter pw) {<NEW_LINE>pw.item(RelDrdsWriter.REL_NAME, "MysqlSort");<NEW_LINE>assert fieldExps.size() == collation.getFieldCollations().size();<NEW_LINE>if (pw.nest()) {<NEW_LINE>pw.item("collation", collation);<NEW_LINE>} else {<NEW_LINE>List<String> sortList = new ArrayList<String>(fieldExps.size());<NEW_LINE>for (int i = 0; i < fieldExps.size(); i++) {<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>RexExplainVisitor visitor = new RexExplainVisitor(this);<NEW_LINE>fieldExps.get(i).accept(visitor);<NEW_LINE>sb.append(visitor.toSqlString()).append(" ").append(collation.getFieldCollations().get(i).getDirection().shortString);<NEW_LINE>sortList.add(sb.toString());<NEW_LINE>}<NEW_LINE>String sortString = StringUtils.join(sortList, ",");<NEW_LINE>pw.itemIf("sort", sortString, !StringUtils.isEmpty(sortString));<NEW_LINE>}<NEW_LINE>pw.itemIf("offset", offset, offset != null);<NEW_LINE>pw.itemIf("fetch", fetch, fetch != null);<NEW_LINE>Index index = MysqlSort.canUseIndex(this, <MASK><NEW_LINE>if (index != null) {<NEW_LINE>pw.item("index", index.getIndexMeta().getPhysicalIndexName());<NEW_LINE>}<NEW_LINE>return pw;<NEW_LINE>} | getCluster().getMetadataQuery()); |
377,353 | public boolean validate() throws ContractValidateException {<NEW_LINE>if (this.any == null) {<NEW_LINE>throw new ContractValidateException(ActuatorConstant.CONTRACT_NOT_EXIST);<NEW_LINE>}<NEW_LINE>if (chainBaseManager == null) {<NEW_LINE>throw new ContractValidateException(ActuatorConstant.STORE_NOT_EXIST);<NEW_LINE>}<NEW_LINE>AccountStore accountStore = chainBaseManager.getAccountStore();<NEW_LINE>ProposalStore proposalStore = chainBaseManager.getProposalStore();<NEW_LINE><MASK><NEW_LINE>if (!this.any.is(ProposalDeleteContract.class)) {<NEW_LINE>throw new ContractValidateException("contract type error,expected type [ProposalDeleteContract],real type[" + any.getClass() + "]");<NEW_LINE>}<NEW_LINE>final ProposalDeleteContract contract;<NEW_LINE>try {<NEW_LINE>contract = this.any.unpack(ProposalDeleteContract.class);<NEW_LINE>} catch (InvalidProtocolBufferException e) {<NEW_LINE>throw new ContractValidateException(e.getMessage());<NEW_LINE>}<NEW_LINE>byte[] ownerAddress = contract.getOwnerAddress().toByteArray();<NEW_LINE>String readableOwnerAddress = StringUtil.createReadableString(ownerAddress);<NEW_LINE>if (!DecodeUtil.addressValid(ownerAddress)) {<NEW_LINE>throw new ContractValidateException("Invalid address");<NEW_LINE>}<NEW_LINE>if (!accountStore.has(ownerAddress)) {<NEW_LINE>throw new ContractValidateException(ACCOUNT_EXCEPTION_STR + readableOwnerAddress + NOT_EXIST_STR);<NEW_LINE>}<NEW_LINE>long latestProposalNum = dynamicStore.getLatestProposalNum();<NEW_LINE>if (contract.getProposalId() > latestProposalNum) {<NEW_LINE>throw new ContractValidateException(PROPOSAL_EXCEPTION_STR + contract.getProposalId() + NOT_EXIST_STR);<NEW_LINE>}<NEW_LINE>ProposalCapsule proposalCapsule;<NEW_LINE>try {<NEW_LINE>proposalCapsule = proposalStore.get(ByteArray.fromLong(contract.getProposalId()));<NEW_LINE>} catch (ItemNotFoundException ex) {<NEW_LINE>throw new ContractValidateException(PROPOSAL_EXCEPTION_STR + contract.getProposalId() + NOT_EXIST_STR);<NEW_LINE>}<NEW_LINE>long now = dynamicStore.getLatestBlockHeaderTimestamp();<NEW_LINE>if (!proposalCapsule.getProposalAddress().equals(contract.getOwnerAddress())) {<NEW_LINE>throw new ContractValidateException(PROPOSAL_EXCEPTION_STR + contract.getProposalId() + "] " + "is not proposed by " + readableOwnerAddress);<NEW_LINE>}<NEW_LINE>if (now >= proposalCapsule.getExpirationTime()) {<NEW_LINE>throw new ContractValidateException(PROPOSAL_EXCEPTION_STR + contract.getProposalId() + "] expired");<NEW_LINE>}<NEW_LINE>if (proposalCapsule.getState() == State.CANCELED) {<NEW_LINE>throw new ContractValidateException(PROPOSAL_EXCEPTION_STR + contract.getProposalId() + "] canceled");<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | DynamicPropertiesStore dynamicStore = chainBaseManager.getDynamicPropertiesStore(); |
1,690,639 | ActionResult<Wo> execute(EffectivePerson effectivePerson, String flag, String portalFlag) throws Exception {<NEW_LINE>ActionResult<Wo> result = new ActionResult<>();<NEW_LINE>Wo wo = null;<NEW_LINE>try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {<NEW_LINE>Business business = new Business(emc);<NEW_LINE>CacheKey cacheKey = new CacheKey(this.getClass(), flag, portalFlag);<NEW_LINE>Optional<?> optional = CacheManager.get(cache, cacheKey);<NEW_LINE>if (optional.isPresent()) {<NEW_LINE>wo = (Wo) optional.get();<NEW_LINE>Portal portal = business.portal().pick(wo.getPortal());<NEW_LINE>if (!business.portal().visible(effectivePerson, portal)) {<NEW_LINE>throw new ExceptionPortalAccessDenied(effectivePerson.getDistinguishedName(), portal.getName(), portal.getId());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>Portal portal = emc.flag(portalFlag, Portal.class);<NEW_LINE>if (null == portal) {<NEW_LINE>throw new ExceptionPortalNotExist(portalFlag);<NEW_LINE>}<NEW_LINE>if (!business.portal().visible(effectivePerson, portal)) {<NEW_LINE>throw new ExceptionPortalAccessDenied(effectivePerson.getDistinguishedName(), portal.getName(), portal.getId());<NEW_LINE>}<NEW_LINE>Widget widget = emc.restrictFlag(flag, Widget.class, Widget.portal_FIELDNAME, portal.getId());<NEW_LINE>if (null == widget) {<NEW_LINE>throw new ExceptionWidgetNotExist(flag);<NEW_LINE>}<NEW_LINE>wo = Wo.copier.copy(widget);<NEW_LINE>wo.<MASK><NEW_LINE>CacheManager.put(cache, cacheKey, wo);<NEW_LINE>}<NEW_LINE>result.setData(wo);<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>} | setData(widget.getMobileDataOrData()); |
1,028,492 | private Mono<Response<Flux<ByteBuffer>>> deleteWithResponseAsync(String resourceGroupName, String resourceName) {<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 (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceName == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>final String accept = "application/json";<NEW_LINE>return FluxUtil.withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, resourceName, accept, context)).contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));<NEW_LINE>} | error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); |
1,754,935 | public HttpDataSourceConfig unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>HttpDataSourceConfig httpDataSourceConfig = new HttpDataSourceConfig();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("endpoint", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>httpDataSourceConfig.setEndpoint(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("authorizationConfig", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>httpDataSourceConfig.setAuthorizationConfig(AuthorizationConfigJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return httpDataSourceConfig;<NEW_LINE>} | String currentParentElement = context.getCurrentParentElement(); |
98,039 | public void translate(final ITranslationEnvironment environment, final IInstruction instruction, final List<ReilInstruction> instructions) throws InternalTranslationException {<NEW_LINE>TranslationHelpers.checkTranslationArguments(environment, instruction, instructions, "dmultu");<NEW_LINE>final String sourceRegister1 = instruction.getOperands().get(0).getRootNode().getChildren().get(0).getValue();<NEW_LINE>final String sourceRegister2 = instruction.getOperands().get(1).getRootNode().getChildren().get(0).getValue();<NEW_LINE>final OperandSize qw = OperandSize.QWORD;<NEW_LINE>final OperandSize ow = OperandSize.OWORD;<NEW_LINE>final long baseOffset = ReilHelpers.toReilAddress(instruction.getAddress()).toLong();<NEW_LINE>long offset = baseOffset;<NEW_LINE>final <MASK><NEW_LINE>final String tempHiResult = environment.getNextVariableString();<NEW_LINE>instructions.add(ReilHelpers.createMul(offset++, qw, sourceRegister1, qw, sourceRegister2, ow, tempLoResult));<NEW_LINE>instructions.add(ReilHelpers.createAnd(offset++, ow, tempLoResult, qw, String.valueOf(0xFFFFFFFFFFFFFFFFL), qw, "LO"));<NEW_LINE>instructions.add(ReilHelpers.createBsh(offset++, ow, tempLoResult, qw, String.valueOf(-32L), qw, tempHiResult));<NEW_LINE>instructions.add(ReilHelpers.createAnd(offset++, ow, tempHiResult, qw, String.valueOf(0xFFFFFFFFFFFFFFFFL), qw, "HI"));<NEW_LINE>} | String tempLoResult = environment.getNextVariableString(); |
821,891 | private static void logInitial(@Nonnull Editor editor, @Nonnull int[] startOffsets, @Nonnull int[] endOffsets, int indentSymbolsToStrip, int firstLineStartOffset) {<NEW_LINE>if (!LOG.isDebugEnabled()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>StringBuilder buffer = new StringBuilder();<NEW_LINE>Document document = editor.getDocument();<NEW_LINE>CharSequence text = document.getCharsSequence();<NEW_LINE>for (int i = 0; i < startOffsets.length; i++) {<NEW_LINE>int start = startOffsets[i];<NEW_LINE>int lineStart = document.getLineStartOffset(document.getLineNumber(start));<NEW_LINE>int end = endOffsets[i];<NEW_LINE>int lineEnd = document.getLineEndOffset(document.getLineNumber(end));<NEW_LINE>buffer.append(" region #").append(i).append(": ").append(start).append('-').append(end).append(", text at range ").append(lineStart).append('-').append(lineEnd).append(": \n'").append(text.subSequence(lineStart, lineEnd)).append("'\n");<NEW_LINE>}<NEW_LINE>if (buffer.length() > 0) {<NEW_LINE>buffer.setLength(<MASK><NEW_LINE>}<NEW_LINE>LOG.debug(String.format("Preparing syntax-aware text. Given: %s selection, indent symbols to strip=%d, first line start offset=%d, selected text:%n%s", startOffsets.length > 1 ? "block" : "regular", indentSymbolsToStrip, firstLineStartOffset, buffer));<NEW_LINE>} | buffer.length() - 1); |
560,276 | private String toJsonSendMsg(AlertMsg alertMsg) {<NEW_LINE>String jsonResult = "";<NEW_LINE>byte[] byt = StringUtils.getBytesUtf8(formatContent(alertMsg));<NEW_LINE>String contentResult = StringUtils.newStringUtf8(byt);<NEW_LINE>String userIdsToText = mkUserIds(org.apache.commons.lang3.StringUtils.isBlank<MASK><NEW_LINE>if (StringUtils.equals(ShowType.TEXT.getValue(), msgType)) {<NEW_LINE>jsonResult = FeiShuConstants.FEI_SHU_TEXT_TEMPLATE.replace(MSG_TYPE_REGX, msgType).replace(MSG_RESULT_REGX, contentResult).replace(FEI_SHU_USER_REGX, userIdsToText).replaceAll("/n", "\\\\n");<NEW_LINE>} else {<NEW_LINE>jsonResult = FeiShuConstants.FEI_SHU_POST_TEMPLATE.replace(MSG_TYPE_REGX, msgType).replace(FEI_SHU_MSG_TYPE_REGX, keyword).replace(MSG_RESULT_REGX, contentResult).replace(FEI_SHU_USER_REGX, userIdsToText).replaceAll("/n", "\\\\n");<NEW_LINE>}<NEW_LINE>return jsonResult;<NEW_LINE>} | (atUserIds) ? "all" : atUserIds); |
593,546 | private boolean matchPermission(String required) {<NEW_LINE>boolean valid;<NEW_LINE>RequiredPerm requiredPerm;<NEW_LINE>if (!required.startsWith(HugeAuthenticator.KEY_OWNER)) {<NEW_LINE>// Permission format like: "admin"<NEW_LINE>requiredPerm = new RequiredPerm();<NEW_LINE>requiredPerm.owner(required);<NEW_LINE>} else {<NEW_LINE>// The required like: $owner=graph1 $action=vertex_write<NEW_LINE>requiredPerm = RequiredPerm.fromPermission(required);<NEW_LINE>String owner = requiredPerm.owner();<NEW_LINE>if (owner.startsWith(HugeAuthenticator.VAR_PREFIX)) {<NEW_LINE>// Replace `$graph` with graph name like "graph1"<NEW_LINE>int prefixLen = HugeAuthenticator.VAR_PREFIX.length();<NEW_LINE><MASK><NEW_LINE>owner = owner.substring(prefixLen);<NEW_LINE>owner = this.getPathParameter(owner);<NEW_LINE>requiredPerm.owner(owner);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (LOG.isDebugEnabled()) {<NEW_LINE>LOG.debug("Verify permission {} {} for user '{}' with role {}", requiredPerm.action().string(), requiredPerm.resourceObject(), this.user.username(), this.user.role());<NEW_LINE>}<NEW_LINE>// verify role permission<NEW_LINE>valid = RolePerm.match(this.role(), requiredPerm);<NEW_LINE>if (!valid && LOG.isInfoEnabled() && !required.equals(HugeAuthenticator.USER_ADMIN)) {<NEW_LINE>LOG.info("User '{}' is denied to {} {}", this.user.username(), requiredPerm.action().string(), requiredPerm.resourceObject());<NEW_LINE>}<NEW_LINE>return valid;<NEW_LINE>} | assert owner.length() > prefixLen; |
152,093 | private // from https://android.googlesource.com/platform/frameworks/base/+/master/api/current.txt r.style section<NEW_LINE>void fetchSystemStyle() throws IOException {<NEW_LINE>String url = "https://android.googlesource.com/platform/frameworks/base/+/master/api/current.txt";<NEW_LINE>String html = getUrl(url);<NEW_LINE>String code = retrieveCode(html);<NEW_LINE>if (code == null) {<NEW_LINE>System.err.println("code area not found");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int begin = code.indexOf("R.style");<NEW_LINE>int end = code.indexOf("}", begin);<NEW_LINE>String styleCode = <MASK><NEW_LINE>String[] lines = styleCode.split("\n");<NEW_LINE>for (String line : lines) {<NEW_LINE>line = line.trim();<NEW_LINE>if (line.startsWith("field public static final")) {<NEW_LINE>line = Strings.substringBefore(line, ";").replace("deprecated ", "").substring("field public static final int ".length()).replace("_", ".");<NEW_LINE>System.out.println(line);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | code.substring(begin, end); |
1,342,131 | public JMenuItem createAxisMenuItem(final IAxis<?> axis, final int axisDimension, final boolean adaptUI2Chart) {<NEW_LINE>final Chart2D chart = axis.getAccessor().getChart();<NEW_LINE>JMenuItem item;<NEW_LINE>// axis submenu<NEW_LINE>JMenuItem axisMenuItem;<NEW_LINE>if (adaptUI2Chart) {<NEW_LINE>axisMenuItem = new PropertyChangeMenu(chart, "Axis" + axis.getAccessor().toString(), BasicPropertyAdaptSupport.RemoveAsListenerFromComponentNever.getInstance());<NEW_LINE>} else {<NEW_LINE>axisMenuItem = new JMenu("Axis" + axis.<MASK><NEW_LINE>}<NEW_LINE>if ((this.m_showAxisXTypeMenu && axisDimension == Chart2D.X) || (this.m_showAxisYTypeMenu && axisDimension == Chart2D.Y)) {<NEW_LINE>axisMenuItem.add(this.createAxisTypeMenu(chart, axis, axisDimension, adaptUI2Chart));<NEW_LINE>}<NEW_LINE>if (this.m_showAxisFormatterMenu) {<NEW_LINE>axisMenuItem.add(this.createAxisFormatterMenu(chart, axis, axisDimension, adaptUI2Chart));<NEW_LINE>}<NEW_LINE>if ((this.m_showAxisXRangePolicyMenu && axisDimension == Chart2D.X) || this.m_showAxisYRangePolicyMenu && axisDimension == Chart2D.Y) {<NEW_LINE>axisMenuItem.add(this.createAxisRangePolicyMenu(chart, axis, adaptUI2Chart));<NEW_LINE>// Axis -> Range menu<NEW_LINE>if (adaptUI2Chart) {<NEW_LINE>item = new PropertyChangeMenuItem(chart, new AxisActionSetRange(chart, "Range", axisDimension), BasicPropertyAdaptSupport.RemoveAsListenerFromComponentNever.getInstance());<NEW_LINE>} else {<NEW_LINE>item = new JMenuItem(new AxisActionSetRange(chart, "Range", axisDimension));<NEW_LINE>}<NEW_LINE>if (!AxisActionSetRange.RANGE_CHOOSER_SUPPORTED) {<NEW_LINE>item.setToolTipText("This is disabled as bislider.jar is missing on the class path.");<NEW_LINE>}<NEW_LINE>axisMenuItem.add(item);<NEW_LINE>}<NEW_LINE>if ((this.m_showAxisXTitleMenu && axisDimension == Chart2D.X) || (this.m_showAxisYTitleMenu && axisDimension == Chart2D.Y)) {<NEW_LINE>axisMenuItem.add(this.createAxisTitleMenu(chart, axis, axisDimension, adaptUI2Chart));<NEW_LINE>}<NEW_LINE>return axisMenuItem;<NEW_LINE>} | getAccessor().toString()); |
1,340,896 | public Map<HugeKeys, Object> writeIndexLabel(IndexLabel indexLabel) {<NEW_LINE>HugeGraph graph = indexLabel.graph();<NEW_LINE>assert graph != null;<NEW_LINE>Map<HugeKeys, Object> map = new LinkedHashMap<>();<NEW_LINE>map.put(HugeKeys.ID, indexLabel.id().asLong());<NEW_LINE>map.put(HugeKeys.NAME, indexLabel.name());<NEW_LINE>map.put(HugeKeys.BASE_TYPE, indexLabel.baseType());<NEW_LINE>if (indexLabel.baseType() == HugeType.VERTEX_LABEL) {<NEW_LINE>map.put(HugeKeys.BASE_VALUE, graph.vertexLabel(indexLabel.baseValue()).name());<NEW_LINE>} else {<NEW_LINE>assert indexLabel.baseType() == HugeType.EDGE_LABEL;<NEW_LINE>map.put(HugeKeys.BASE_VALUE, graph.edgeLabel(indexLabel.baseValue<MASK><NEW_LINE>}<NEW_LINE>map.put(HugeKeys.INDEX_TYPE, indexLabel.indexType());<NEW_LINE>map.put(HugeKeys.FIELDS, graph.mapPkId2Name(indexLabel.indexFields()));<NEW_LINE>map.put(HugeKeys.STATUS, indexLabel.status());<NEW_LINE>map.put(HugeKeys.USER_DATA, indexLabel.userdata());<NEW_LINE>return map;<NEW_LINE>} | ()).name()); |
1,088,127 | public static String generateOrgString(int content, int[] notesAndContent) {<NEW_LINE>StringBuilder result = new StringBuilder();<NEW_LINE>LoremIpsum loremIpsum = new LoremIpsum();<NEW_LINE>OrgParserWriter parserWriter = new OrgParserWriter();<NEW_LINE>result.append(parserWriter.whiteSpacedFilePreface(loremIpsum.getWords(content / CHARS_PER_WORD)));<NEW_LINE>if (notesAndContent != null) {<NEW_LINE>for (int i = 0; i < notesAndContent.length; i += 2) {<NEW_LINE>OrgHead head = new OrgHead();<NEW_LINE>head.setTitle(loremIpsum.getWords(notesAndContent[i] / CHARS_PER_WORD));<NEW_LINE>head.setContent(loremIpsum.getWords(notesAndContent[i + 1] / CHARS_PER_WORD));<NEW_LINE>result.append(parserWriter.whiteSpacedHead<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result.toString();<NEW_LINE>} | (head, 1, false)); |
669,233 | public void marshall(Provisioned provisioned, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (provisioned == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(provisioned.getBrokerNodeGroupInfo(), BROKERNODEGROUPINFO_BINDING);<NEW_LINE>protocolMarshaller.marshall(provisioned.getCurrentBrokerSoftwareInfo(), CURRENTBROKERSOFTWAREINFO_BINDING);<NEW_LINE>protocolMarshaller.marshall(provisioned.getClientAuthentication(), CLIENTAUTHENTICATION_BINDING);<NEW_LINE>protocolMarshaller.marshall(provisioned.getEncryptionInfo(), ENCRYPTIONINFO_BINDING);<NEW_LINE>protocolMarshaller.marshall(provisioned.getEnhancedMonitoring(), ENHANCEDMONITORING_BINDING);<NEW_LINE>protocolMarshaller.marshall(provisioned.getOpenMonitoring(), OPENMONITORING_BINDING);<NEW_LINE>protocolMarshaller.marshall(provisioned.getLoggingInfo(), LOGGINGINFO_BINDING);<NEW_LINE>protocolMarshaller.marshall(provisioned.getNumberOfBrokerNodes(), NUMBEROFBROKERNODES_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(provisioned.getZookeeperConnectStringTls(), ZOOKEEPERCONNECTSTRINGTLS_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | provisioned.getZookeeperConnectString(), ZOOKEEPERCONNECTSTRING_BINDING); |
1,531,053 | private Mono<Response<Flux<ByteBuffer>>> createOrUpdateWithResponseAsync(String resourceGroupName, String ddosCustomPolicyName, DdosCustomPolicyInner parameters, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (ddosCustomPolicyName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter ddosCustomPolicyName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (parameters == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null."));<NEW_LINE>} else {<NEW_LINE>parameters.validate();<NEW_LINE>}<NEW_LINE>final String apiVersion = "2021-05-01";<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = <MASK><NEW_LINE>return service.createOrUpdate(this.client.getEndpoint(), resourceGroupName, ddosCustomPolicyName, apiVersion, this.client.getSubscriptionId(), parameters, accept, context);<NEW_LINE>} | this.client.mergeContext(context); |
676,963 | public void receiveFileInfo(List<String> phase1FileNames, List<Long> phase1FileSizes, List<String> phase1ExistingFileNames, List<Long> phase1ExistingFileSizes, int totalTranslogOps, ActionListener<Void> listener) {<NEW_LINE>final <MASK><NEW_LINE>RecoveryFilesInfoRequest request = new RecoveryFilesInfoRequest(recoveryId, shardId, phase1FileNames, phase1FileSizes, phase1ExistingFileNames, phase1ExistingFileSizes, totalTranslogOps);<NEW_LINE>final TransportRequestOptions options = TransportRequestOptions.builder().withTimeout(recoverySettings.internalActionTimeout()).build();<NEW_LINE>final Writeable.Reader<TransportResponse.Empty> reader = in -> TransportResponse.Empty.INSTANCE;<NEW_LINE>final ActionListener<TransportResponse.Empty> responseListener = ActionListener.map(listener, r -> null);<NEW_LINE>executeRetryableAction(action, request, options, responseListener, reader);<NEW_LINE>} | String action = PeerRecoveryTargetService.Actions.FILES_INFO; |
1,170,508 | public static Jackson2ConfigurationResolved from(Jackson2Configuration configuration, ClassLoader classLoader) {<NEW_LINE>final Jackson2ConfigurationResolved resolved = new Jackson2ConfigurationResolved();<NEW_LINE>resolved.fieldVisibility = configuration.fieldVisibility;<NEW_LINE>resolved.getterVisibility = configuration.getterVisibility;<NEW_LINE>resolved.isGetterVisibility = configuration.isGetterVisibility;<NEW_LINE>resolved.setterVisibility = configuration.setterVisibility;<NEW_LINE>resolved.creatorVisibility = configuration.creatorVisibility;<NEW_LINE>resolved.fieldVisibility = configuration.fieldVisibility;<NEW_LINE>resolved.shapeConfigOverrides = resolveClassMappings(configuration.shapeConfigOverrides, "shapeConfigOverride", classLoader, Object.<MASK><NEW_LINE>resolved.enumsUsingToString = configuration.enumsUsingToString;<NEW_LINE>resolved.disableObjectIdentityFeature = configuration.disableObjectIdentityFeature;<NEW_LINE>resolved.deserializerTypeMappings = resolveClassMappings(configuration.deserializerTypeMappings, "deserializerTypeMapping", classLoader, JsonDeserializer.class, Function.identity());<NEW_LINE>resolved.serializerTypeMappings = resolveClassMappings(configuration.serializerTypeMappings, "serializerTypeMapping", classLoader, JsonSerializer.class, Function.identity());<NEW_LINE>resolved.view = configuration.view != null ? Settings.loadClass(classLoader, configuration.view, Object.class) : null;<NEW_LINE>return resolved;<NEW_LINE>} | class, JsonFormat.Shape::valueOf); |
691,865 | private void createImageCache(final CreateImageCacheFromVolumeSnapshotMsg msg, final NoErrorCompletion completion) {<NEW_LINE>CreateImageCacheFromVolumeSnapshotReply reply = new CreateImageCacheFromVolumeSnapshotReply();<NEW_LINE>ImageInventory image = ImageInventory.valueOf(dbf.findByUuid(msg.getImageUuid(), ImageVO.class));<NEW_LINE>CreateImageCacheFromVolumeSnapshotOnPrimaryStorageMsg cmsg = new CreateImageCacheFromVolumeSnapshotOnPrimaryStorageMsg();<NEW_LINE>cmsg.setImageInventory(image);<NEW_LINE>cmsg.setVolumeSnapshot(VolumeSnapshotInventory.valueOf(currentRoot));<NEW_LINE>bus.makeTargetServiceIdByResourceUuid(cmsg, PrimaryStorageConstant.SERVICE_ID, cmsg.getPrimaryStorageUuid());<NEW_LINE>bus.send(cmsg, new CloudBusCallBack(completion) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run(MessageReply r) {<NEW_LINE>if (!r.isSuccess()) {<NEW_LINE>reply.setError(r.getError());<NEW_LINE>} else {<NEW_LINE>CreateImageCacheFromVolumeSnapshotOnPrimaryStorageReply cr = r.castReply();<NEW_LINE>reply.<MASK><NEW_LINE>reply.setActualSize(cr.getActualSize());<NEW_LINE>}<NEW_LINE>bus.reply(msg, reply);<NEW_LINE>completion.done();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | setLocationHostUuid(cr.getLocateHostUuid()); |
1,162,878 | protected byte[] doInBackground(String... params) {<NEW_LINE>java.io.File javaFile = new java.io.File(params[0]);<NEW_LINE>FileInputStream stream = null;<NEW_LINE>try {<NEW_LINE>stream = new FileInputStream(javaFile);<NEW_LINE>byte[] result = new byte[(int) javaFile.length()];<NEW_LINE>DataInputStream dataInputStream = new DataInputStream(stream);<NEW_LINE>dataInputStream.readFully(result);<NEW_LINE>return result;<NEW_LINE>} catch (FileNotFoundException e) {<NEW_LINE>Log.e(TAG, "Failed to read file, FileNotFoundException: " + e.getMessage());<NEW_LINE>return null;<NEW_LINE>} catch (IOException e) {<NEW_LINE>Log.e(TAG, "Failed to read file, IOException: " + e.getMessage());<NEW_LINE>return null;<NEW_LINE>} finally {<NEW_LINE>if (stream != null) {<NEW_LINE>try {<NEW_LINE>stream.close();<NEW_LINE>} catch (IOException e) {<NEW_LINE>Log.e(TAG, <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | "Failed to close stream, IOException: " + e.getMessage()); |
897,235 | public static String parseLocalDeadlock(String status, ExecutionContext executionContext) {<NEW_LINE>final Matcher matcher = DEADLOCK_LOG_PATTERN.matcher(status);<NEW_LINE>String deadlockLog = matcher.find() ? matcher.group(1) : null;<NEW_LINE>if (deadlockLog == null) {<NEW_LINE>return NO_DEADLOCKS_DETECTED;<NEW_LINE>}<NEW_LINE>// Remove the connection string in the original deadlock log<NEW_LINE>deadlockLog = removeConnectionString(deadlockLog);<NEW_LINE>// Add a "\n" to make the deadlock log look better<NEW_LINE>deadlockLog = "\n" + deadlockLog;<NEW_LINE>final Map<String, String> physicalToLogical = new TreeMap<>(String.CASE_INSENSITIVE_ORDER);<NEW_LINE>deadlockLog = injectLogicalTables(deadlockLog, physicalToLogical);<NEW_LINE>return checkPrivilege(deadlockLog, <MASK><NEW_LINE>} | physicalToLogical.values(), executionContext); |
657,333 | private void init() {<NEW_LINE>byte[] magic = this.buffer.readByteArray(MAGIC.length);<NEW_LINE>if (CompareUtils.uArrCompare(magic, MAGIC) != 0) {<NEW_LINE>throw new IllegalStateException("bad dex patch file magic: " + Arrays.toString(magic));<NEW_LINE>}<NEW_LINE>this.version = this.buffer.readShort();<NEW_LINE>if (CompareUtils.uCompare(this.version, CURRENT_VERSION) != 0) {<NEW_LINE>throw new IllegalStateException("bad dex patch file version: " + this.version + ", expected: " + CURRENT_VERSION);<NEW_LINE>}<NEW_LINE>this.patchedDexSize = this.buffer.readInt();<NEW_LINE>this.firstChunkOffset = this.buffer.readInt();<NEW_LINE>this.patchedStringIdSectionOffset <MASK><NEW_LINE>this.patchedTypeIdSectionOffset = this.buffer.readInt();<NEW_LINE>this.patchedProtoIdSectionOffset = this.buffer.readInt();<NEW_LINE>this.patchedFieldIdSectionOffset = this.buffer.readInt();<NEW_LINE>this.patchedMethodIdSectionOffset = this.buffer.readInt();<NEW_LINE>this.patchedClassDefSectionOffset = this.buffer.readInt();<NEW_LINE>this.patchedMapListSectionOffset = this.buffer.readInt();<NEW_LINE>this.patchedTypeListSectionOffset = this.buffer.readInt();<NEW_LINE>this.patchedAnnotationSetRefListSectionOffset = this.buffer.readInt();<NEW_LINE>this.patchedAnnotationSetSectionOffset = this.buffer.readInt();<NEW_LINE>this.patchedClassDataSectionOffset = this.buffer.readInt();<NEW_LINE>this.patchedCodeSectionOffset = this.buffer.readInt();<NEW_LINE>this.patchedStringDataSectionOffset = this.buffer.readInt();<NEW_LINE>this.patchedDebugInfoSectionOffset = this.buffer.readInt();<NEW_LINE>this.patchedAnnotationSectionOffset = this.buffer.readInt();<NEW_LINE>this.patchedEncodedArraySectionOffset = this.buffer.readInt();<NEW_LINE>this.patchedAnnotationsDirectorySectionOffset = this.buffer.readInt();<NEW_LINE>this.oldDexSignature = this.buffer.readByteArray(SizeOf.SIGNATURE);<NEW_LINE>this.buffer.position(firstChunkOffset);<NEW_LINE>} | = this.buffer.readInt(); |
1,366,655 | private void connectLastTermsIn(CompositeItem composite) {<NEW_LINE>int items = composite.items().size();<NEW_LINE>if (items < 2)<NEW_LINE>return;<NEW_LINE>Item nextToLast = composite.items().get(items - 2);<NEW_LINE>if (nextToLast instanceof AndSegmentItem) {<NEW_LINE>var subItems = ((AndSegmentItem) nextToLast).items();<NEW_LINE>nextToLast = subItems.get(<MASK><NEW_LINE>}<NEW_LINE>if (!(nextToLast instanceof TermItem))<NEW_LINE>return;<NEW_LINE>Item last = composite.items().get(items - 1);<NEW_LINE>if (last instanceof AndSegmentItem) {<NEW_LINE>last = ((AndSegmentItem) last).items().get(0);<NEW_LINE>}<NEW_LINE>if (last instanceof TaggableItem) {<NEW_LINE>TermItem t1 = (TermItem) nextToLast;<NEW_LINE>t1.setConnectivity(last, 1);<NEW_LINE>}<NEW_LINE>} | subItems.size() - 1); |
1,557,718 | public SinglePassSamProgram makeInstance(final String outbase, final String outext, final File input, final File reference, final Set<MetricAccumulationLevel> metricAccumulationLevel, final File dbSnp, final File intervals, final File refflat, final Set<String> ignoreSequence) {<NEW_LINE>final CollectBaseDistributionByCycle program = new CollectBaseDistributionByCycle();<NEW_LINE>program.output = new RequiredOutputArgumentCollection(new File(outbase + METRICS_EXTENSION + outext));<NEW_LINE>program.CHART_OUTPUT <MASK><NEW_LINE>// Generally programs should not be accessing these directly but it might make things smoother<NEW_LINE>// to just set them anyway. These are set here to make sure that in case of a the derived class<NEW_LINE>// overrides<NEW_LINE>program.INPUT = input;<NEW_LINE>program.setReferenceSequence(reference);<NEW_LINE>return program;<NEW_LINE>} | = new File(outbase + PDF_EXTENSION); |
1,361,703 | public int update(Uri uri, ContentValues values, String where, String[] whereArgs) {<NEW_LINE>deferDaggerInit();<NEW_LINE>String projectId = getProjectId(uri);<NEW_LINE>logServerEvent(projectId, AnalyticsEvents.FORMS_PROVIDER_UPDATE);<NEW_LINE>FormsRepository formsRepository = getFormsRepository(projectId);<NEW_LINE>String formsPath = storagePathProvider.getOdkDirPath(StorageSubdirectory.FORMS, projectId);<NEW_LINE>String cachePath = storagePathProvider.getOdkDirPath(StorageSubdirectory.CACHE, projectId);<NEW_LINE>int count;<NEW_LINE>switch(URI_MATCHER.match(uri)) {<NEW_LINE>case FORMS:<NEW_LINE>try (Cursor cursor = databaseQuery(projectId, null, where, whereArgs, null, null, null)) {<NEW_LINE>while (cursor.moveToNext()) {<NEW_LINE>Form form = getFormFromCurrentCursorPosition(cursor, formsPath, cachePath);<NEW_LINE>ContentValues existingValues = getValuesFromForm(form, formsPath);<NEW_LINE>existingValues.putAll(values);<NEW_LINE>formsRepository.save(getFormFromValues<MASK><NEW_LINE>}<NEW_LINE>count = cursor.getCount();<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case FORM_ID:<NEW_LINE>Form form = formsRepository.get(ContentUriHelper.getIdFromUri(uri));<NEW_LINE>if (form != null) {<NEW_LINE>ContentValues existingValues = getValuesFromForm(form, formsPath);<NEW_LINE>existingValues.putAll(values);<NEW_LINE>formsRepository.save(getFormFromValues(existingValues, formsPath, cachePath));<NEW_LINE>count = 1;<NEW_LINE>} else {<NEW_LINE>count = 0;<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new IllegalArgumentException("Unknown URI " + uri);<NEW_LINE>}<NEW_LINE>getContext().getContentResolver().notifyChange(uri, null);<NEW_LINE>return count;<NEW_LINE>} | (existingValues, formsPath, cachePath)); |
1,743,738 | public GetFindingsResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>GetFindingsResult getFindingsResult = new GetFindingsResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return getFindingsResult;<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("Findings", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>getFindingsResult.setFindings(new ListUnmarshaller<AwsSecurityFinding>(AwsSecurityFindingJsonUnmarshaller.getInstance(<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("NextToken", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>getFindingsResult.setNextToken(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 getFindingsResult;<NEW_LINE>} | )).unmarshall(context)); |
587,699 | private Span createWriteSpan(GenericType<?> type) {<NEW_LINE>Optional<SpanContext> parentSpan = spanContext();<NEW_LINE>if (!parentSpan.isPresent()) {<NEW_LINE>// we only trace write span if there is a parent<NEW_LINE>// (parent is either webserver HTTP Request span, or inherited span<NEW_LINE>// from request<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>SpanTracingConfig spanConfig = TracingConfigUtil.spanConfig(NettyWebServer.TRACING_COMPONENT, TRACING_CONTENT_WRITE);<NEW_LINE>if (spanConfig.enabled()) {<NEW_LINE>String spanName = spanConfig.newName().orElse(TRACING_CONTENT_WRITE);<NEW_LINE>Span.Builder spanBuilder = WebTracingConfig.tracer(webServer()).spanBuilder(spanName).<MASK><NEW_LINE>if (type != null) {<NEW_LINE>spanBuilder.tag("response.type", type.getTypeName());<NEW_LINE>}<NEW_LINE>return spanBuilder.start();<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | parent(parentSpan.get()); |
375,419 | protected void processLink(XMLElement e) {<NEW_LINE>String classAttribute = e.getAttribute("class");<NEW_LINE>if (classAttribute == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Set<Property> properties = VocabUtil.parsePropertyList(classAttribute, ALTCSS_VOCABS, context, EPUBLocation.create(path, parser.getLineNumber(), parser.getColumnNumber()));<NEW_LINE>Set<AltStylesheetVocab.PROPERTIES> altClasses = Property.filter(properties, AltStylesheetVocab.PROPERTIES.class);<NEW_LINE>if (properties.size() == 1) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>boolean vertical = altClasses.<MASK><NEW_LINE>boolean horizontal = altClasses.contains(AltStylesheetVocab.PROPERTIES.HORIZONTAL);<NEW_LINE>boolean day = altClasses.contains(AltStylesheetVocab.PROPERTIES.DAY);<NEW_LINE>boolean night = altClasses.contains(AltStylesheetVocab.PROPERTIES.NIGHT);<NEW_LINE>if (vertical && horizontal || day && night) {<NEW_LINE>report.message(MessageId.CSS_005, EPUBLocation.create(path, parser.getLineNumber(), parser.getColumnNumber()), classAttribute);<NEW_LINE>}<NEW_LINE>} | contains(AltStylesheetVocab.PROPERTIES.VERTICAL); |
16,389 | private static boolean promptToAddTMARowOrColumn(final ImageData<?> imageData, final TMAAddType type) {<NEW_LINE><MASK><NEW_LINE>if (imageData == null) {<NEW_LINE>Dialogs.showNoImageError(NAME);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (imageData.getHierarchy().getTMAGrid() == null) {<NEW_LINE>Dialogs.showErrorMessage(NAME, "No image with dearrayed TMA cores selected!");<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>PathObjectHierarchy hierarchy = imageData.getHierarchy();<NEW_LINE>PathObject selected = hierarchy.getSelectionModel().getSelectedObject();<NEW_LINE>TMACoreObject selectedCore = null;<NEW_LINE>if (selected != null)<NEW_LINE>selectedCore = PathObjectTools.getAncestorTMACore(selected);<NEW_LINE>TMAGrid gridNew = createAugmentedTMAGrid(hierarchy, selectedCore, type);<NEW_LINE>double w = imageData.getServer().getWidth();<NEW_LINE>double h = imageData.getServer().getHeight();<NEW_LINE>// Check if the core centroids all fall within the image or not<NEW_LINE>int outsideCores = 0;<NEW_LINE>for (TMACoreObject core : gridNew.getTMACoreList()) {<NEW_LINE>// Shouldn't happen...<NEW_LINE>if (!core.hasROI())<NEW_LINE>continue;<NEW_LINE>// Check if the centroid for any *new* core falls within the image<NEW_LINE>// (don't fail if an existing core is outside)<NEW_LINE>double x = core.getROI().getCentroidX();<NEW_LINE>double y = core.getROI().getCentroidY();<NEW_LINE>if (x < 0 || x >= w || y < 0 || y >= h) {<NEW_LINE>if (!hierarchy.getTMAGrid().getTMACoreList().contains(core)) {<NEW_LINE>outsideCores++;<NEW_LINE>}<NEW_LINE>// throw new IllegalArgumentException("Cannot update TMA grid - not enough space within image");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (outsideCores > 0) {<NEW_LINE>String label = outsideCores == 1 ? "core" : "cores";<NEW_LINE>if (!Dialogs.showConfirmDialog("Add to TMA Grid", "Not enough space within image to store " + outsideCores + " new " + label + " - proceed anyway?"))<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// If we got this far, update the grid<NEW_LINE>hierarchy.setTMAGrid(gridNew);<NEW_LINE>// Prompt for relabelling<NEW_LINE>TMACommands.promptToRelabelTMAGrid(imageData);<NEW_LINE>return true;<NEW_LINE>} | String NAME = type.commandName(); |
409,108 | public void putDouble(long t, double v) {<NEW_LINE>if (writeCurArrayIndex == capacity) {<NEW_LINE>if (capacity >= CAPACITY_THRESHOLD) {<NEW_LINE>timeRet.<MASK><NEW_LINE>doubleRet.add(new double[capacity]);<NEW_LINE>writeCurListIndex++;<NEW_LINE>writeCurArrayIndex = 0;<NEW_LINE>} else {<NEW_LINE>int newCapacity = capacity << 1;<NEW_LINE>long[] newTimeData = new long[newCapacity];<NEW_LINE>double[] newValueData = new double[newCapacity];<NEW_LINE>System.arraycopy(timeRet.get(0), 0, newTimeData, 0, capacity);<NEW_LINE>System.arraycopy(doubleRet.get(0), 0, newValueData, 0, capacity);<NEW_LINE>timeRet.set(0, newTimeData);<NEW_LINE>doubleRet.set(0, newValueData);<NEW_LINE>capacity = newCapacity;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>timeRet.get(writeCurListIndex)[writeCurArrayIndex] = t;<NEW_LINE>doubleRet.get(writeCurListIndex)[writeCurArrayIndex] = v;<NEW_LINE>writeCurArrayIndex++;<NEW_LINE>count++;<NEW_LINE>} | add(new long[capacity]); |
668,782 | final DeleteStreamingDistributionResult executeDeleteStreamingDistribution(DeleteStreamingDistributionRequest deleteStreamingDistributionRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteStreamingDistributionRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteStreamingDistributionRequest> request = null;<NEW_LINE>Response<DeleteStreamingDistributionResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteStreamingDistributionRequestMarshaller().marshall(super.beforeMarshalling(deleteStreamingDistributionRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteStreamingDistribution");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<DeleteStreamingDistributionResult> responseHandler = new StaxResponseHandler<DeleteStreamingDistributionResult>(new DeleteStreamingDistributionResultStaxUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | addHandlerContext(HandlerContextKey.SERVICE_ID, "CloudFront"); |
65,677 | private int readProcessId(int dft) throws IOException {<NEW_LINE>ByteBuffer bb = ByteBuffer.allocate(128);<NEW_LINE>fileChannel.position(0);<NEW_LINE>int len = fileChannel.read(bb);<NEW_LINE>fileChannel.position(0);<NEW_LINE>if (len == 0)<NEW_LINE>return dft;<NEW_LINE>if (len == 128)<NEW_LINE>// Too much.<NEW_LINE>return dft;<NEW_LINE>// Bug in Jena 3.3.0<NEW_LINE>// byte[] b = ByteBufferLib.bb2array(bb, 0, len);<NEW_LINE>bb.flip();<NEW_LINE>byte[] b = new byte[len];<NEW_LINE>bb.get(b);<NEW_LINE>String <MASK><NEW_LINE>// Remove all leading and trailing (vertical and horizontal) whitespace.<NEW_LINE>pidStr = pidStr.replaceAll("[\\s\\t\\n\\r]+$", "");<NEW_LINE>pidStr = pidStr.replaceAll("^[\\s\\t\\n\\r]+", "");<NEW_LINE>try {<NEW_LINE>// Process id.<NEW_LINE>return Integer.parseInt(pidStr);<NEW_LINE>} catch (NumberFormatException ex) {<NEW_LINE>ex.printStackTrace();<NEW_LINE>Log.warn(this, "Bad process id: file='" + filepath + "': read='" + pidStr + "'");<NEW_LINE>return dft;<NEW_LINE>}<NEW_LINE>} | pidStr = StrUtils.fromUTF8bytes(b); |
1,206,744 | protected static String handleMenu(String menuPrefix, Map<String, Object> submenus, List<String> items, Map<String, String> uuidToName) {<NEW_LINE>if (items == null) {<NEW_LINE>return "";<NEW_LINE>}<NEW_LINE>// Calculate indent from our current one<NEW_LINE>int spaces = menuPrefix.length() - menuPrefix.trim().length();<NEW_LINE>String indent = "";<NEW_LINE>for (int i = 0; i < spaces; i++) {<NEW_LINE>indent += " ";<NEW_LINE>}<NEW_LINE>StringBuilder buffer = new StringBuilder();<NEW_LINE>for (String uuid : items) {<NEW_LINE>if (uuid.contains("-------")) {<NEW_LINE>buffer.append(menuPrefix).append(".separator\n");<NEW_LINE>} else {<NEW_LINE>Map<String, Object> props = (Map<String, Object>) submenus.get(uuid);<NEW_LINE>if (props != null) {<NEW_LINE>// it's a submenu<NEW_LINE>String subMenuName = (<MASK><NEW_LINE>buffer.append(menuPrefix).append(".menu '").append(subMenuName).append("' do |submenu|\n");<NEW_LINE>buffer.append(handleMenu(indent + " submenu", submenus, (List<String>) props.get("items"), uuidToName));<NEW_LINE>buffer.append(indent).append("end\n");<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>// Not a sub-menu, must be an item<NEW_LINE>String commandName = uuidToName.get(uuid);<NEW_LINE>if (commandName == null) {<NEW_LINE>buffer.append("#").append(menuPrefix).append(".command '").append(uuid).append("'\n");<NEW_LINE>} else {<NEW_LINE>buffer.append(menuPrefix).append(".command '").append(commandName).append("'\n");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return buffer.toString();<NEW_LINE>} | String) props.get("name"); |
406,622 | private void walk(TestDescriptor globalLockDescriptor, TestDescriptor testDescriptor, NodeExecutionAdvisor advisor) {<NEW_LINE>Set<ExclusiveResource> exclusiveResources = getExclusiveResources(testDescriptor);<NEW_LINE>if (exclusiveResources.isEmpty()) {<NEW_LINE>advisor.useResourceLock(testDescriptor, globalReadLock);<NEW_LINE>testDescriptor.getChildren().forEach(child -> walk(globalLockDescriptor, child, advisor));<NEW_LINE>} else {<NEW_LINE>Set<ExclusiveResource> allResources <MASK><NEW_LINE>if (isReadOnly(allResources)) {<NEW_LINE>doForChildrenRecursively(testDescriptor, child -> allResources.addAll(getExclusiveResources(child)));<NEW_LINE>if (!isReadOnly(allResources)) {<NEW_LINE>forceDescendantExecutionModeRecursively(advisor, testDescriptor);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>advisor.forceDescendantExecutionMode(testDescriptor, SAME_THREAD);<NEW_LINE>doForChildrenRecursively(testDescriptor, child -> {<NEW_LINE>allResources.addAll(getExclusiveResources(child));<NEW_LINE>advisor.forceDescendantExecutionMode(child, SAME_THREAD);<NEW_LINE>});<NEW_LINE>}<NEW_LINE>if (!globalLockDescriptor.equals(testDescriptor) && allResources.contains(GLOBAL_READ_WRITE)) {<NEW_LINE>forceDescendantExecutionModeRecursively(advisor, globalLockDescriptor);<NEW_LINE>advisor.useResourceLock(globalLockDescriptor, globalReadWriteLock);<NEW_LINE>}<NEW_LINE>if (globalLockDescriptor.equals(testDescriptor) && !allResources.contains(GLOBAL_READ_WRITE)) {<NEW_LINE>allResources.add(GLOBAL_READ);<NEW_LINE>}<NEW_LINE>advisor.useResourceLock(testDescriptor, lockManager.getLockForResources(allResources));<NEW_LINE>}<NEW_LINE>} | = new HashSet<>(exclusiveResources); |
944,348 | private void writeSuperClasses(SplittingSourceWriter w, ConnectorBundle bundle) {<NEW_LINE>List<JClassType> needsSuperclass = new ArrayList<<MASK><NEW_LINE>// Emit in hierarchy order to ensure superclass is defined when<NEW_LINE>// referenced<NEW_LINE>Collections.sort(needsSuperclass, new Comparator<JClassType>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public int compare(JClassType type1, JClassType type2) {<NEW_LINE>int depthDiff = getDepth(type1) - getDepth(type2);<NEW_LINE>if (depthDiff != 0) {<NEW_LINE>return depthDiff;<NEW_LINE>} else {<NEW_LINE>// Just something to get a stable compare<NEW_LINE>return type1.getName().compareTo(type2.getName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>private int getDepth(JClassType type) {<NEW_LINE>int depth = 0;<NEW_LINE>while (type != null) {<NEW_LINE>depth++;<NEW_LINE>type = type.getSuperclass();<NEW_LINE>}<NEW_LINE>return depth;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>for (JClassType jClassType : needsSuperclass) {<NEW_LINE>JClassType superclass = jClassType.getSuperclass();<NEW_LINE>while (superclass != null && !superclass.isPublic()) {<NEW_LINE>superclass = superclass.getSuperclass();<NEW_LINE>}<NEW_LINE>String classLiteralString;<NEW_LINE>if (superclass == null) {<NEW_LINE>classLiteralString = "null";<NEW_LINE>} else {<NEW_LINE>classLiteralString = getClassLiteralString(superclass);<NEW_LINE>}<NEW_LINE>w.println("store.setSuperClass(%s, %s);", getClassLiteralString(jClassType), classLiteralString);<NEW_LINE>}<NEW_LINE>} | >(bundle.getNeedsSuperclass()); |
811,151 | public void run(RegressionEnvironment env) {<NEW_LINE>sendTimer(env, 0);<NEW_LINE>String epl = "@name('s0') select irstream max(price) as maxVol" + " from SupportMarketDataBean#sort(1,volume desc) as s0, " + "SupportBean#keepall as s1 where s1.theString=s0.symbol " + "output every 1.0d seconds";<NEW_LINE>env.compileDeploy(epl).addListener("s0");<NEW_LINE>env.sendEventBean(new SupportBean("JOIN_KEY", -1));<NEW_LINE>sendEvent(env, "JOIN_KEY", 1d);<NEW_LINE>sendEvent(env, "JOIN_KEY", 2d);<NEW_LINE>env.listenerReset("s0");<NEW_LINE>// moves all events out of the window,<NEW_LINE>// newdata is 2 eventa, old data is the same 2 events, therefore the sum is null<NEW_LINE>sendTimer(env, 1000);<NEW_LINE>env.assertListener("s0", listener -> {<NEW_LINE>UniformPair<EventBean[]> result = listener.getDataListsFlattened();<NEW_LINE>assertEquals(2, result.getFirst().length);<NEW_LINE>assertEquals(1.0, result.getFirst()[0].get("maxVol"));<NEW_LINE>assertEquals(2.0, result.getFirst()[1].get("maxVol"));<NEW_LINE>assertEquals(2, result.getSecond().length);<NEW_LINE>assertEquals(null, result.getSecond()[0].get("maxVol"));<NEW_LINE>assertEquals(1.0, result.getSecond()[<MASK><NEW_LINE>});<NEW_LINE>// statement object model test<NEW_LINE>EPStatementObjectModel model = env.eplToModel(epl);<NEW_LINE>SerializableObjectCopier.copyMayFail(model);<NEW_LINE>assertEquals(epl, model.toEPL());<NEW_LINE>env.undeployAll();<NEW_LINE>} | 1].get("maxVol")); |
931,402 | private Mono<Response<VMExtensionPayloadInner>> vMHostPayloadWithResponseAsync(String resourceGroupName, String monitorName) {<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 (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (monitorName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>final String accept = "application/json";<NEW_LINE>return FluxUtil.withContext(context -> service.vMHostPayload(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, monitorName, this.client.getApiVersion(), accept, context)).contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));<NEW_LINE>} | error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); |
591,487 | protected void onBindPreferenceViewHolder(Preference preference, PreferenceViewHolder holder) {<NEW_LINE>super.onBindPreferenceViewHolder(preference, holder);<NEW_LINE>if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR2) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String key = preference.getKey();<NEW_LINE>if (ROUTE_PARAMETERS_INFO.equals(key)) {<NEW_LINE>holder.itemView.setBackgroundColor(ColorUtilities.getActivityBgColor(app, isNightMode()));<NEW_LINE>} else if (ROUTE_PARAMETERS_IMAGE.equals(key)) {<NEW_LINE>ImageView imageView = (ImageView) holder.itemView.findViewById(R.id.device_image);<NEW_LINE>if (imageView != null) {<NEW_LINE>int bgResId = isNightMode() ? R.drawable<MASK><NEW_LINE>Drawable layerDrawable = app.getUIUtilities().getLayeredIcon(bgResId, R.drawable.img_settings_sreen_route_parameters);<NEW_LINE>imageView.setImageDrawable(layerDrawable);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | .img_settings_device_bottom_dark : R.drawable.img_settings_device_bottom_light; |
41,731 | /*<NEW_LINE>* Open a non-asset file as if it were an asset.<NEW_LINE>*<NEW_LINE>* The "fileName" is the partial path starting from the application name.<NEW_LINE>*/<NEW_LINE>public Asset openNonAsset(final String fileName, AccessMode mode, Ref<Integer> outCookie) {<NEW_LINE>synchronized (mLock) {<NEW_LINE>// AutoMutex _l(mLock);<NEW_LINE>LOG_FATAL_IF(mAssetPaths.isEmpty(), "No assets added to AssetManager");<NEW_LINE>int i = mAssetPaths.size();<NEW_LINE>while (i > 0) {<NEW_LINE>i--;<NEW_LINE>ALOGV("Looking for non-asset '%s' in '%s'\n", fileName, mAssetPaths.get(i<MASK><NEW_LINE>Asset pAsset = openNonAssetInPathLocked(fileName, mode, mAssetPaths.get(i));<NEW_LINE>if (pAsset != null) {<NEW_LINE>if (outCookie != null) {<NEW_LINE>outCookie.set(i + 1);<NEW_LINE>}<NEW_LINE>return pAsset != kExcludedAsset ? pAsset : null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>} | ).path.string()); |
564,244 | public Map<String, Object> createParameterMap(NdbOpenJPADomainFieldHandlerImpl domainFieldHandler, QueryDomainType<?> queryDomainObject, Object oid) {<NEW_LINE>Map<String, Object> result = new HashMap<String, Object>();<NEW_LINE>Predicate predicate = null;<NEW_LINE>for (AbstractDomainFieldHandlerImpl localHandler : domainFieldHandler.compositeDomainFieldHandlers) {<NEW_LINE>String name = localHandler.getColumnName();<NEW_LINE>PredicateOperand parameter = queryDomainObject.param(name);<NEW_LINE>PredicateOperand <MASK><NEW_LINE>if (predicate == null) {<NEW_LINE>predicate = field.equal(parameter);<NEW_LINE>} else {<NEW_LINE>predicate.and(field.equal(parameter));<NEW_LINE>}<NEW_LINE>// construct a map of parameter binding to the value in oid<NEW_LINE>Object value = domainFieldHandler.getKeyValue(oid);<NEW_LINE>result.put(name, value);<NEW_LINE>if (logger.isDetailEnabled())<NEW_LINE>logger.detail("Map.Entry key: " + name + ", value: " + value);<NEW_LINE>}<NEW_LINE>queryDomainObject.where(predicate);<NEW_LINE>return result;<NEW_LINE>} | field = queryDomainObject.get(name); |
1,566,287 | final GetNamespaceResult executeGetNamespace(GetNamespaceRequest getNamespaceRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getNamespaceRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetNamespaceRequest> request = null;<NEW_LINE>Response<GetNamespaceResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetNamespaceRequestProtocolMarshaller(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, "ServiceDiscovery");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetNamespace");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetNamespaceResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetNamespaceResultJsonUnmarshaller());<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(getNamespaceRequest)); |
532,565 | public int findElement(int ordinal, Object... hashKey) {<NEW_LINE>int hashCode = SetMapKeyHasher.hash(hashKey, keyDeriver.getFieldTypes());<NEW_LINE>HollowSetTypeDataElements currentData;<NEW_LINE>threadsafe: do {<NEW_LINE>long startBucket;<NEW_LINE>long endBucket;<NEW_LINE>do {<NEW_LINE>currentData = this.currentDataVolatile;<NEW_LINE>startBucket = getAbsoluteBucketStart(currentData, ordinal);<NEW_LINE>endBucket = currentData.setPointerAndSizeData.getElementValue((long) ordinal * currentData.bitsPerFixedLengthSetPortion, currentData.bitsPerSetPointer);<NEW_LINE>} while (readWasUnsafe(currentData));<NEW_LINE>long bucket = startBucket + (hashCode & <MASK><NEW_LINE>int bucketOrdinal = absoluteBucketValue(currentData, bucket);<NEW_LINE>while (bucketOrdinal != currentData.emptyBucketValue) {<NEW_LINE>if (readWasUnsafe(currentData))<NEW_LINE>continue threadsafe;<NEW_LINE>if (keyDeriver.keyMatches(bucketOrdinal, hashKey))<NEW_LINE>return bucketOrdinal;<NEW_LINE>bucket++;<NEW_LINE>if (bucket == endBucket)<NEW_LINE>bucket = startBucket;<NEW_LINE>bucketOrdinal = absoluteBucketValue(currentData, bucket);<NEW_LINE>}<NEW_LINE>} while (readWasUnsafe(currentData));<NEW_LINE>return ORDINAL_NONE;<NEW_LINE>} | (endBucket - startBucket - 1)); |
258,758 | public void render(JasperReportsContext jasperReportsContext, Graphics2D grx, Rectangle2D rectangle) throws JRException {<NEW_LINE>GraphicsNode rootNode = getRootNode(jasperReportsContext);<NEW_LINE>AffineTransform transform = ViewBox.getPreserveAspectRatioTransform(new float[] { 0, 0, (float) documentSize.getWidth(), (float) documentSize.getHeight() }, SVGPreserveAspectRatio.SVG_PRESERVEASPECTRATIO_NONE, true, (float) rectangle.getWidth(), (float) rectangle.getHeight());<NEW_LINE>Graphics2D graphics = (Graphics2D) grx.create();<NEW_LINE>try {<NEW_LINE>graphics.translate(rectangle.getX(<MASK><NEW_LINE>graphics.transform(transform);<NEW_LINE>// CompositeGraphicsNode not thread safe<NEW_LINE>synchronized (rootNode) {<NEW_LINE>rootNode.paint(graphics);<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>graphics.dispose();<NEW_LINE>}<NEW_LINE>} | ), rectangle.getY()); |
231,862 | private void registerListener(AccessServiceConfig accessServiceConfigurationProperties, OMRSTopicConnector enterpriseOMRSTopicConnector, OMRSRepositoryConnector repositoryConnector, AuditLog auditLog) throws OMAGConfigurationErrorException {<NEW_LINE>Connection outTopicConnection = accessServiceConfigurationProperties.getAccessServiceOutTopic();<NEW_LINE>String serviceName = accessServiceConfigurationProperties.getAccessServiceName();<NEW_LINE>OpenMetadataTopicConnector outTopicConnector = super.getOutTopicEventBusConnector(outTopicConnection, <MASK><NEW_LINE>List<String> supportedZones = this.extractSupportedZones(accessServiceConfigurationProperties.getAccessServiceOptions(), serviceName, auditLog);<NEW_LINE>List<String> supportedTypesForSearch = getSupportedTypesForSearchOption(accessServiceConfigurationProperties);<NEW_LINE>AssetCatalogOMRSTopicListener omrsTopicListener = new AssetCatalogOMRSTopicListener(serviceName, auditLog, outTopicConnector, repositoryConnector.getRepositoryHelper(), repositoryConnector.getRepositoryValidator(), serverName, supportedZones, supportedTypesForSearch);<NEW_LINE>super.registerWithEnterpriseTopic(serviceName, serverName, enterpriseOMRSTopicConnector, omrsTopicListener, auditLog);<NEW_LINE>} | accessServiceConfigurationProperties.getAccessServiceName(), auditLog); |
95,410 | private Method extractDefaultFallbackMethod(Invocation inv, String defaultFallback, Class<?>[] locationClass) {<NEW_LINE>if (StringUtil.isBlank(defaultFallback)) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>boolean mustStatic = locationClass != null && locationClass.length >= 1;<NEW_LINE>Class<?> clazz = mustStatic ? locationClass[0] : inv.getTarget().getClass();<NEW_LINE>MethodWrapper m = ResourceMetadataRegistry.lookupDefaultFallback(clazz, defaultFallback);<NEW_LINE>if (m == null) {<NEW_LINE>// First time, resolve the default fallback.<NEW_LINE>Class<?> originReturnType = resolveMethod(inv).getReturnType();<NEW_LINE>// Default fallback allows two kinds of parameter list.<NEW_LINE>// One is empty parameter list.<NEW_LINE>Class<?>[] defaultParamTypes = new Class<?>[0];<NEW_LINE>// The other is a single parameter {@link Throwable} to get relevant exception info.<NEW_LINE>Class<?>[] paramTypeWithException = new Class<?>[] { Throwable.class };<NEW_LINE>// We first find the default fallback with empty parameter list.<NEW_LINE>Method method = findMethod(mustStatic, clazz, defaultFallback, originReturnType, defaultParamTypes);<NEW_LINE>// If default fallback with empty params is absent, we then try to find the other one.<NEW_LINE>if (method == null) {<NEW_LINE>method = findMethod(mustStatic, <MASK><NEW_LINE>}<NEW_LINE>// Cache the method instance.<NEW_LINE>ResourceMetadataRegistry.updateDefaultFallbackFor(clazz, defaultFallback, method);<NEW_LINE>return method;<NEW_LINE>}<NEW_LINE>if (!m.isPresent()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>return m.getMethod();<NEW_LINE>} | clazz, defaultFallback, originReturnType, paramTypeWithException); |
627,389 | private Mono<Response<ExtendedProductInner>> listDetailsWithResponseAsync(String resourceGroup, String registrationName, String productName, 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 (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroup == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>if (registrationName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter registrationName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (productName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter productName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.listDetails(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroup, registrationName, productName, this.client.getApiVersion(), accept, context);<NEW_LINE>} | error(new IllegalArgumentException("Parameter resourceGroup is required and cannot be null.")); |
960,964 | public static DescribeRdsAccountsResponse unmarshall(DescribeRdsAccountsResponse describeRdsAccountsResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeRdsAccountsResponse.setRequestId(_ctx.stringValue("DescribeRdsAccountsResponse.RequestId"));<NEW_LINE>describeRdsAccountsResponse.setCode(_ctx.integerValue("DescribeRdsAccountsResponse.Code"));<NEW_LINE>describeRdsAccountsResponse.setErrMsg(_ctx.stringValue("DescribeRdsAccountsResponse.ErrMsg"));<NEW_LINE>Result result = new Result();<NEW_LINE>List<AccountsItem> accounts <MASK><NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeRdsAccountsResponse.Result.Accounts.Length"); i++) {<NEW_LINE>AccountsItem accountsItem = new AccountsItem();<NEW_LINE>accountsItem.setAccountStatus(_ctx.stringValue("DescribeRdsAccountsResponse.Result.Accounts[" + i + "].AccountStatus"));<NEW_LINE>accountsItem.setAccountDescription(_ctx.stringValue("DescribeRdsAccountsResponse.Result.Accounts[" + i + "].AccountDescription"));<NEW_LINE>accountsItem.setPrivExceeded(_ctx.stringValue("DescribeRdsAccountsResponse.Result.Accounts[" + i + "].PrivExceeded"));<NEW_LINE>accountsItem.setDBInstanceId(_ctx.stringValue("DescribeRdsAccountsResponse.Result.Accounts[" + i + "].DBInstanceId"));<NEW_LINE>accountsItem.setAccountType(_ctx.stringValue("DescribeRdsAccountsResponse.Result.Accounts[" + i + "].AccountType"));<NEW_LINE>accountsItem.setAccountName(_ctx.stringValue("DescribeRdsAccountsResponse.Result.Accounts[" + i + "].AccountName"));<NEW_LINE>List<DatabasePrivilegesItem> databasePrivileges = new ArrayList<DatabasePrivilegesItem>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("DescribeRdsAccountsResponse.Result.Accounts[" + i + "].DatabasePrivileges.Length"); j++) {<NEW_LINE>DatabasePrivilegesItem databasePrivilegesItem = new DatabasePrivilegesItem();<NEW_LINE>databasePrivilegesItem.setDBName(_ctx.stringValue("DescribeRdsAccountsResponse.Result.Accounts[" + i + "].DatabasePrivileges[" + j + "].DBName"));<NEW_LINE>databasePrivilegesItem.setAccountPrivilege(_ctx.stringValue("DescribeRdsAccountsResponse.Result.Accounts[" + i + "].DatabasePrivileges[" + j + "].AccountPrivilege"));<NEW_LINE>databasePrivilegesItem.setAccountPrivilegeDetail(_ctx.stringValue("DescribeRdsAccountsResponse.Result.Accounts[" + i + "].DatabasePrivileges[" + j + "].AccountPrivilegeDetail"));<NEW_LINE>databasePrivileges.add(databasePrivilegesItem);<NEW_LINE>}<NEW_LINE>accountsItem.setDatabasePrivileges(databasePrivileges);<NEW_LINE>accounts.add(accountsItem);<NEW_LINE>}<NEW_LINE>result.setAccounts(accounts);<NEW_LINE>describeRdsAccountsResponse.setResult(result);<NEW_LINE>return describeRdsAccountsResponse;<NEW_LINE>} | = new ArrayList<AccountsItem>(); |
56,501 | private void processRegisterRestClient(BeforeAnalysisContext context) {<NEW_LINE>Class<? extends Annotation> restClientAnnotation = (Class<? extends Annotation>) context.access().findClassByName(AT_REGISTER_REST_CLIENT);<NEW_LINE>if (null == restClientAnnotation) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>tracer.parsing<MASK><NEW_LINE>Set<Class<?>> annotatedSet = util.findAnnotated(AT_REGISTER_REST_CLIENT);<NEW_LINE>DynamicProxyRegistry proxyRegistry = ImageSingletons.lookup(DynamicProxyRegistry.class);<NEW_LINE>Class<?> autoCloseable = context.access().findClassByName("java.lang.AutoCloseable");<NEW_LINE>Class<?> closeable = context.access().findClassByName("java.io.Closeable");<NEW_LINE>annotatedSet.forEach(it -> {<NEW_LINE>if (context.isExcluded(it)) {<NEW_LINE>tracer.parsing(() -> "Class " + it.getName() + " annotated by " + AT_REGISTER_REST_CLIENT + " is excluded");<NEW_LINE>} else {<NEW_LINE>// we need to add it for reflection<NEW_LINE>processClassHierarchy(context, it);<NEW_LINE>// and we also need to create a proxy<NEW_LINE>tracer.parsing(() -> "Registering a proxy for class " + it.getName());<NEW_LINE>proxyRegistry.addProxyClass(it, autoCloseable, closeable);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | (() -> "Looking up annotated by " + AT_REGISTER_REST_CLIENT); |
881,287 | public CreateAppResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>CreateAppResult createAppResult = new CreateAppResult();<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 createAppResult;<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("AppArn", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>createAppResult.setAppArn(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 createAppResult;<NEW_LINE>} | JsonToken token = context.getCurrentToken(); |
1,046,830 | public void initializeRequestQueueMetrics(Map<QuotaResource, LinkedList<RequestInfo>> readQueue, Map<QuotaResource, LinkedList<RequestInfo>> writeQueue) {<NEW_LINE>Supplier<Integer> readQueueSizeSupplier = () -> readQueue.entrySet().stream().flatMap(entry -> Stream.of(entry.getValue())).map(l -> l.size()).<MASK><NEW_LINE>Supplier<Integer> writeQueueSizeSupplier = () -> writeQueue.entrySet().stream().flatMap(entry -> Stream.of(entry.getValue())).map(l -> l.size()).reduce(0, Integer::sum);<NEW_LINE>operationControllerReadQueueSize = () -> readQueueSizeSupplier.get();<NEW_LINE>operationControllerWriteQueueSize = () -> writeQueueSizeSupplier.get();<NEW_LINE>operationControllerQueueSize = () -> Math.addExact(readQueueSizeSupplier.get(), writeQueueSizeSupplier.get());<NEW_LINE>readQueuedQuotaResourceCount = () -> readQueue.size();<NEW_LINE>writeQueuedQuotaResourceCount = () -> writeQueue.size();<NEW_LINE>} | reduce(0, Integer::sum); |
1,604,168 | public static void addGeoHash() {<NEW_LINE>// [START fs_geo_add_hash]<NEW_LINE>// Compute the GeoHash for a lat/lng point<NEW_LINE>double lat = 51.5074;<NEW_LINE>double lng = 0.1278;<NEW_LINE>String hash = GeoFireUtils.getGeoHashForLocation(new GeoLocation(lat, lng));<NEW_LINE>// Add the hash and the lat/lng to the document. We will use the hash<NEW_LINE>// for queries and the lat/lng for distance comparisons.<NEW_LINE>Map<String, Object> updates = new HashMap<>();<NEW_LINE>updates.put("geohash", hash);<NEW_LINE><MASK><NEW_LINE>updates.put("lng", lng);<NEW_LINE>DocumentReference londonRef = db.collection("cities").document("LON");<NEW_LINE>londonRef.update(updates).addOnCompleteListener(new OnCompleteListener<Void>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onComplete(@NonNull Task<Void> task) {<NEW_LINE>// ...<NEW_LINE>}<NEW_LINE>});<NEW_LINE>// [END fs_geo_add_hash]<NEW_LINE>} | updates.put("lat", lat); |
1,016,005 | public DisruptorAutobatcher<I, O> build() {<NEW_LINE>Preconditions.checkArgument(purpose != null, "purpose must be provided");<NEW_LINE>ImmutableEventHandlerParameters.Builder parametersBuilder = ImmutableEventHandlerParameters.builder();<NEW_LINE>bufferSize.ifPresent(parametersBuilder::batchSize);<NEW_LINE>parametersBuilder.safeLoggablePurpose(purpose);<NEW_LINE>Optional<TimeoutOrchestrationContext> timeoutOrchestrationContext = batchFunctionTimeout.map(timeout -> {<NEW_LINE>ImmutableTimeoutOrchestrationContext.Builder timeoutContextBuilder = ImmutableTimeoutOrchestrationContext.builder().batchFunctionTimeout(timeout).exclusiveExecutor(PTExecutors.newCachedThreadPool("autobatcher." + purpose + "-timeout"));<NEW_LINE>timeoutHandler.ifPresent(timeoutContextBuilder::timeoutHandler);<NEW_LINE>return timeoutContextBuilder.build();<NEW_LINE>});<NEW_LINE><MASK><NEW_LINE>EventHandlerParameters parameters = parametersBuilder.build();<NEW_LINE>EventHandler<BatchElement<I, O>> handler = this.handlerFactory.apply(parameters);<NEW_LINE>EventHandler<BatchElement<I, O>> tracingHandler = new TracingEventHandler<>(handler, parameters.batchSize());<NEW_LINE>EventHandler<BatchElement<I, O>> profiledHandler = new ProfilingEventHandler<>(tracingHandler, purpose, safeTags.build());<NEW_LINE>return DisruptorAutobatcher.create(profiledHandler, parameters.batchSize(), purpose, waitStrategy, () -> timeoutOrchestrationContext.ifPresent(context -> context.exclusiveExecutor().shutdown()));<NEW_LINE>} | timeoutOrchestrationContext.ifPresent(parametersBuilder::batchFunctionTimeoutContext); |
1,459,325 | public STATUS postAbstractInit(final PwmApplication pwmApplication, final DomainID domainID) throws PwmException {<NEW_LINE>final AppConfig config = pwmApplication.getConfig();<NEW_LINE>final String classNameString = config.readSettingAsString(PwmSetting.URL_SHORTENER_CLASS);<NEW_LINE>if (classNameString != null && classNameString.length() > 0) {<NEW_LINE>final Properties sConfig = new Properties();<NEW_LINE>final List<String> sConfigList = config.readSettingAsStringArray(PwmSetting.URL_SHORTENER_PARAMETERS);<NEW_LINE>// Parse configuration<NEW_LINE>if (sConfigList != null) {<NEW_LINE>for (final String p : sConfigList) {<NEW_LINE>final List<String> pl = Arrays.asList(p.split("=", 2));<NEW_LINE>if (pl.size() == 2) {<NEW_LINE>sConfig.put(pl.get(0), pl.get(1));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>final Class<?> <MASK><NEW_LINE>theShortener = (BasicUrlShortener) theClass.getDeclaredConstructor().newInstance();<NEW_LINE>theShortener.setConfiguration(sConfig);<NEW_LINE>} catch (final Exception e) {<NEW_LINE>LOGGER.error(() -> "error loading url shortener class " + classNameString + ": " + e.getMessage());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return STATUS.OPEN;<NEW_LINE>} | theClass = Class.forName(classNameString); |
233,292 | private static List<String> makeCodeServerArgs(HostedModeOptions options, int port) {<NEW_LINE>List<String> args = new ArrayList<String>();<NEW_LINE>args.add("-noprecompile");<NEW_LINE>args.add("-port");<NEW_LINE>args.add(String.valueOf(port));<NEW_LINE>args.add("-sourceLevel");<NEW_LINE>args.add(String.valueOf<MASK><NEW_LINE>if (options.getBindAddress() != null) {<NEW_LINE>args.add("-bindAddress");<NEW_LINE>args.add(options.getBindAddress());<NEW_LINE>}<NEW_LINE>if (options.getWorkDir() != null) {<NEW_LINE>args.add("-workDir");<NEW_LINE>args.add(String.valueOf(options.getWorkDir()));<NEW_LINE>}<NEW_LINE>args.add("-launcherDir");<NEW_LINE>args.add(options.getModuleBaseDir().getAbsolutePath());<NEW_LINE>if (options.getLogLevel() != null) {<NEW_LINE>args.add("-logLevel");<NEW_LINE>args.add(String.valueOf(options.getLogLevel()));<NEW_LINE>}<NEW_LINE>if (options.shouldGenerateJsInteropExports()) {<NEW_LINE>args.add("-generateJsInteropExports");<NEW_LINE>}<NEW_LINE>for (String regex : options.getJsInteropExportFilter().getValues()) {<NEW_LINE>if (regex.startsWith("-")) {<NEW_LINE>args.add("-excludeJsInteropExports");<NEW_LINE>args.add(regex.substring(1));<NEW_LINE>} else {<NEW_LINE>args.add("-includeJsInteropExports");<NEW_LINE>args.add(regex);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!options.isIncrementalCompileEnabled()) {<NEW_LINE>args.add("-noincremental");<NEW_LINE>}<NEW_LINE>if (options.getMethodNameDisplayMode() != OptionMethodNameDisplayMode.Mode.NONE) {<NEW_LINE>args.add("-XmethodNameDisplayMode");<NEW_LINE>args.add(options.getMethodNameDisplayMode().name());<NEW_LINE>}<NEW_LINE>args.add("-style");<NEW_LINE>args.add(options.getOutput().name());<NEW_LINE>if (options.isStrict()) {<NEW_LINE>args.add("-strict");<NEW_LINE>}<NEW_LINE>if (options.getProperties().size() > 0) {<NEW_LINE>args.addAll(makeSetPropertyArgs(options.getProperties()));<NEW_LINE>}<NEW_LINE>for (String mod : options.getModuleNames()) {<NEW_LINE>args.add(mod);<NEW_LINE>}<NEW_LINE>return args;<NEW_LINE>} | (options.getSourceLevel())); |
1,206,568 | public Future<Vector[]> asyncGet(int[] rowIds, long[] indices) throws AngelException {<NEW_LINE>checkNotNull(rowIds, "rowIds");<NEW_LINE>checkNotNull(indices, "indices");<NEW_LINE>if (rowIds.length == 0) {<NEW_LINE>LOG.warn("parameter rowIds is empty, you should check it, just return a empty vector array now!!!");<NEW_LINE>FutureResult<Vector[]> <MASK><NEW_LINE>result.set(new Vector[0]);<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>// Return a empty vector<NEW_LINE>if (indices.length == 0) {<NEW_LINE>LOG.warn("parameter indices is empty, you should check it, just return empty vectors now!!!");<NEW_LINE>FutureResult<Vector[]> result = new FutureResult<>();<NEW_LINE>result.set(generateEmptyVecs(rowIds));<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>return PSAgentContext.get().getUserRequestAdapter().get(matrixId, rowIds, indices);<NEW_LINE>} catch (Throwable x) {<NEW_LINE>throw new AngelException(x);<NEW_LINE>}<NEW_LINE>} | result = new FutureResult<>(); |
1,710,351 | public org.python.Object rfind(org.python.Object item, org.python.Object start, org.python.Object end) {<NEW_LINE>if (item == null) {<NEW_LINE>throw new org.python.exceptions.TypeError("rfind() takes at least 1 argument (0 given)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>org.python.Object st = (org.python.types.Str) item;<NEW_LINE>} catch (ClassCastException te) {<NEW_LINE>throw new org.python.exceptions.TypeError("Can't convert '" + item.typeName() + "' object to str implicitly");<NEW_LINE>}<NEW_LINE>if (start == null) {<NEW_LINE>start = org.python.types.Int.getInt(0);<NEW_LINE>}<NEW_LINE>if (end == null) {<NEW_LINE>end = org.python.types.Int.getInt(this.value.length());<NEW_LINE>}<NEW_LINE>org.python.Object index = org.python.types.Int.getInt(-1);<NEW_LINE>org.python.Object temp = (org.python.types.Int) index;<NEW_LINE>while (((org.python.types.Bool) (temp.__lt__(end))).value) {<NEW_LINE>temp = this.find(item, start, end);<NEW_LINE>if (((org.python.types.Int) temp).value < 0) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>index = temp;<NEW_LINE>start = temp.__add__(org.python.types<MASK><NEW_LINE>}<NEW_LINE>return index;<NEW_LINE>} | .Int.getInt(1)); |
1,438,154 | public void run(RegressionEnvironment env) {<NEW_LINE>RegressionPath path = new RegressionPath();<NEW_LINE>env.compileDeploy("@name('typea') @public create schema TypeA()", path);<NEW_LINE>env.compileDeploy("@name('typeb') @public create schema TypeB()", path);<NEW_LINE>env.compileDeploy("@name('typec') @public create schema TypeC(a TypeA, b TypeB)", path);<NEW_LINE>env.compileDeploy("@name('typed') @public create schema TypeD(c TypeC)", path);<NEW_LINE>env.compileDeploy("@name('typee') @public create schema TypeE(c TypeC)", path);<NEW_LINE>String a = env.deploymentId("typea");<NEW_LINE>String b = env.deploymentId("typeb");<NEW_LINE>String c = env.deploymentId("typec");<NEW_LINE>String d = env.deploymentId("typed");<NEW_LINE>String e = env.deploymentId("typee");<NEW_LINE>assertProvided(env, a, makeProvided(EPObjectType<MASK><NEW_LINE>assertConsumed(env, a);<NEW_LINE>assertProvided(env, b, makeProvided(EPObjectType.EVENTTYPE, "TypeB", c));<NEW_LINE>assertConsumed(env, b);<NEW_LINE>assertProvided(env, c, makeProvided(EPObjectType.EVENTTYPE, "TypeC", d, e));<NEW_LINE>assertConsumed(env, c, new EPDeploymentDependencyConsumed.Item(a, EPObjectType.EVENTTYPE, "TypeA"), new EPDeploymentDependencyConsumed.Item(b, EPObjectType.EVENTTYPE, "TypeB"));<NEW_LINE>assertProvided(env, d);<NEW_LINE>assertConsumed(env, d, new EPDeploymentDependencyConsumed.Item(c, EPObjectType.EVENTTYPE, "TypeC"));<NEW_LINE>assertProvided(env, e);<NEW_LINE>assertConsumed(env, e, new EPDeploymentDependencyConsumed.Item(c, EPObjectType.EVENTTYPE, "TypeC"));<NEW_LINE>env.undeployAll();<NEW_LINE>} | .EVENTTYPE, "TypeA", c)); |
1,438,353 | protected void expandDBID(DBIDRef id) {<NEW_LINE>clusterOrder.add(id);<NEW_LINE>PCAFilteredResult pca1 = localPCAs.get(id);<NEW_LINE>NumberVector dv1 = relation.get(id);<NEW_LINE>final int dim = dv1.getDimensionality();<NEW_LINE>DBIDArrayIter iter = tmpIds.iter();<NEW_LINE>for (; iter.valid(); iter.advance()) {<NEW_LINE>if (processedIDs.contains(iter)) {<NEW_LINE>tmpCorrelation.putInt(iter, 0);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>PCAFilteredResult pca2 = localPCAs.get(iter);<NEW_LINE>NumberVector dv2 = relation.get(iter);<NEW_LINE>tmpCorrelation.putInt(iter, correlationDistance(pca1, pca2, dim));<NEW_LINE>tmpDistance.putDouble(iter, EuclideanDistance.STATIC.distance(dv1, dv2));<NEW_LINE>}<NEW_LINE>tmpIds.sort(tmpcomp);<NEW_LINE>// Core-distance of OPTICS:<NEW_LINE>// FIXME: what if there are less than mu points of smallest<NEW_LINE>// dimensionality? Then this distance will not be meaningful.<NEW_LINE>double coredist = tmpDistance.doubleValue(iter.seek(mu - 1));<NEW_LINE>for (iter.seek(0); iter.valid(); iter.advance()) {<NEW_LINE>if (processedIDs.contains(iter)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>int prevcorr = correlationValue.intValue(iter);<NEW_LINE>int curcorr = tmpCorrelation.intValue(iter);<NEW_LINE>if (prevcorr < curcorr) {<NEW_LINE>// No improvement.<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>double currdist = MathUtil.max(tmpDistance.doubleValue(iter), coredist);<NEW_LINE>if (prevcorr == curcorr) {<NEW_LINE>double <MASK><NEW_LINE>if (prevdist <= currdist) {<NEW_LINE>// No improvement.<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>correlationValue.putInt(iter, curcorr);<NEW_LINE>reachability.putDouble(iter, currdist);<NEW_LINE>predecessor.putDBID(iter, id);<NEW_LINE>// Add to candidates if not yet seen:<NEW_LINE>if (prevcorr == Integer.MAX_VALUE) {<NEW_LINE>candidates.add(iter);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | prevdist = reachability.doubleValue(iter); |
776,280 | protected List<Element> expand(List<Element> tokens, String s, int type) {<NEW_LINE>if (tokens == null)<NEW_LINE>throw new NullPointerException("Received null argument");<NEW_LINE>if (tokens.isEmpty())<NEW_LINE>throw new IllegalArgumentException("Received empty list");<NEW_LINE>Document doc = ((Element) tokens.get(0)).getOwnerDocument();<NEW_LINE>// we expect type to be one of the return values of match():<NEW_LINE>List<Element> expanded = null;<NEW_LINE>switch(type) {<NEW_LINE>case 1:<NEW_LINE>expanded = expandTimeHMS(doc, s);<NEW_LINE>break;<NEW_LINE>case 2:<NEW_LINE>expanded = expandTimeHM(doc, s);<NEW_LINE>break;<NEW_LINE>case 3:<NEW_LINE>expanded = expandTimeH(doc, s);<NEW_LINE>break;<NEW_LINE>case 4:<NEW_LINE>expanded = expandTimeHMS12(doc, s);<NEW_LINE>break;<NEW_LINE>case 5:<NEW_LINE><MASK><NEW_LINE>break;<NEW_LINE>}<NEW_LINE>replaceTokens(tokens, expanded);<NEW_LINE>return expanded;<NEW_LINE>} | expanded = expandTimeHMS24(doc, s); |
739,240 | public Request<DescribeRiskConfigurationRequest> marshall(DescribeRiskConfigurationRequest describeRiskConfigurationRequest) {<NEW_LINE>if (describeRiskConfigurationRequest == null) {<NEW_LINE>throw new AmazonClientException("Invalid argument passed to marshall(DescribeRiskConfigurationRequest)");<NEW_LINE>}<NEW_LINE>Request<DescribeRiskConfigurationRequest> request = new DefaultRequest<DescribeRiskConfigurationRequest>(describeRiskConfigurationRequest, "AmazonCognitoIdentityProvider");<NEW_LINE>String target = "AWSCognitoIdentityProviderService.DescribeRiskConfiguration";<NEW_LINE>request.addHeader("X-Amz-Target", target);<NEW_LINE>request.setHttpMethod(HttpMethodName.POST);<NEW_LINE>String uriResourcePath = "/";<NEW_LINE>request.setResourcePath(uriResourcePath);<NEW_LINE>try {<NEW_LINE>StringWriter stringWriter = new StringWriter();<NEW_LINE>AwsJsonWriter jsonWriter = JsonUtils.getJsonWriter(stringWriter);<NEW_LINE>jsonWriter.beginObject();<NEW_LINE>if (describeRiskConfigurationRequest.getUserPoolId() != null) {<NEW_LINE>String userPoolId = describeRiskConfigurationRequest.getUserPoolId();<NEW_LINE>jsonWriter.name("UserPoolId");<NEW_LINE>jsonWriter.value(userPoolId);<NEW_LINE>}<NEW_LINE>if (describeRiskConfigurationRequest.getClientId() != null) {<NEW_LINE>String clientId = describeRiskConfigurationRequest.getClientId();<NEW_LINE>jsonWriter.name("ClientId");<NEW_LINE>jsonWriter.value(clientId);<NEW_LINE>}<NEW_LINE>jsonWriter.endObject();<NEW_LINE>jsonWriter.close();<NEW_LINE>String snippet = stringWriter.toString();<NEW_LINE>byte[] content = snippet.getBytes(UTF8);<NEW_LINE>request.setContent(new StringInputStream(snippet));<NEW_LINE>request.addHeader("Content-Length", Integer<MASK><NEW_LINE>} catch (Throwable t) {<NEW_LINE>throw new AmazonClientException("Unable to marshall request to JSON: " + t.getMessage(), t);<NEW_LINE>}<NEW_LINE>if (!request.getHeaders().containsKey("Content-Type")) {<NEW_LINE>request.addHeader("Content-Type", "application/x-amz-json-1.1");<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>} | .toString(content.length)); |
1,797,401 | public void testPurgeMaxSize_10() throws Exception {<NEW_LINE>RemoteFile binaryLogDir = null;<NEW_LINE>RemoteFile binaryTraceDir = null;<NEW_LINE>NumberFormat nf = NumberFormat.getInstance();<NEW_LINE>server.updateServerConfiguration(new File(server.pathToAutoFVTTestFiles, "server-HPELPurgeMaxSizeTest_4.xml"));<NEW_LINE>server.stopServer();<NEW_LINE>server.updateServerConfiguration(new File(server.pathToAutoFVTTestFiles, "server-HPELPurgeMaxSizeTest_5.xml"));<NEW_LINE>server.startServer();<NEW_LINE>// write enough records to new log repository updated.<NEW_LINE>CommonTasks.writeLogMsg(Level.INFO, "Writing log records to fill binary log repository.");<NEW_LINE>long loopsPerFullRepository = (MAX_DEFAULT_PURGE_SIZE * 1024 * 1024) / 200;<NEW_LINE>logger.info("writting " + nf.format(loopsPerFullRepository) + " log loops to produce " + MAX_DEFAULT_PURGE_SIZE + " MB of data.");<NEW_LINE>logger.info("Writing INFO Level Log entries: ");<NEW_LINE>CommonTasks.createLogEntries(server, loggerName, "Sample log record for the test case " + name.getMethodName() + ".", Level.INFO, (int) loopsPerFullRepository, CommonTasks.LOGS, 0);<NEW_LINE>CommonTasks.writeLogMsg(Level.INFO, "Verifying the repository size ");<NEW_LINE>binaryLogDir = server.getFileFromLibertyServerRoot("logs/logdata");<NEW_LINE><MASK><NEW_LINE>long binaryLogSize = getSizeOfBinaryLogs(binaryLogDir);<NEW_LINE>long binaryTraceSize = getSizeOfBinaryLogs(binaryTraceDir);<NEW_LINE>logger.info("The current size of BinaryLog files in " + binaryLogDir.getAbsolutePath() + " is " + nf.format(binaryLogSize));<NEW_LINE>assertTrue("BinaryLog Repository size should be less than 50 MB ", binaryLogSize < (MAX_DEFAULT_PURGE_SIZE * 1024 * 1024));<NEW_LINE>logger.info("The current size of BinaryTrace files in " + binaryTraceDir.getAbsolutePath() + " is " + nf.format(binaryTraceSize));<NEW_LINE>assertTrue("Binarytrace Repository size should be less than 50 MB ", binaryTraceSize < (MAX_DEFAULT_PURGE_SIZE * 1024 * 1024));<NEW_LINE>} | binaryTraceDir = server.getFileFromLibertyServerRoot("logs/tracedata"); |
374,784 | ActionResult<JsonElement> execute(EffectivePerson effectivePerson, String id, String path0, String path1, String path2, String path3, String path4, String path5, String path6, String path7) throws Exception {<NEW_LINE>try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {<NEW_LINE>ActionResult<JsonElement> result = new ActionResult<>();<NEW_LINE>Business business = new Business(emc);<NEW_LINE>Work work = emc.find(id, Work.class);<NEW_LINE>if (null == work) {<NEW_LINE>throw new ExceptionEntityNotExist(id, Work.class);<NEW_LINE>}<NEW_LINE>WoControl control = business.getControl(effectivePerson, work, WoControl.class);<NEW_LINE>if (BooleanUtils.isNotTrue(control.getAllowVisit())) {<NEW_LINE>throw new ExceptionWorkAccessDenied(effectivePerson.getDistinguishedName(), work.getTitle(<MASK><NEW_LINE>}<NEW_LINE>result.setData(this.getData(business, work.getJob(), path0, path1, path2, path3, path4, path5, path6, path7));<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>} | ), work.getId()); |
955,491 | public CreateContactMethodResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>CreateContactMethodResult createContactMethodResult = new CreateContactMethodResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return createContactMethodResult;<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("operations", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>createContactMethodResult.setOperations(new ListUnmarshaller<Operation>(OperationJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return createContactMethodResult;<NEW_LINE>} | String currentParentElement = context.getCurrentParentElement(); |
1,637,377 | private List<Mutation> saveObject(Op op, Object object, Set<String> includeProperties) {<NEW_LINE>SpannerPersistentEntity<?> persistentEntity = this.spannerMappingContext.getPersistentEntity(object.getClass());<NEW_LINE>List<Mutation> mutations = new ArrayList<>();<NEW_LINE>Mutation.WriteBuilder writeBuilder = writeBuilder(op, persistentEntity.tableName());<NEW_LINE>this.spannerEntityProcessor.write(object, writeBuilder::set, includeProperties);<NEW_LINE>mutations.add(writeBuilder.build());<NEW_LINE>persistentEntity.doWithInterleavedProperties((spannerPersistentProperty) -> {<NEW_LINE>if (includeProperties == null || includeProperties.contains(spannerPersistentProperty.getName())) {<NEW_LINE>Iterable kids = (Iterable) persistentEntity.getPropertyAccessor(object).getProperty(spannerPersistentProperty);<NEW_LINE>if (kids != null && !ConversionUtils.ignoreForWriteLazyProxy(kids)) {<NEW_LINE>for (Object child : kids) {<NEW_LINE>verifyChildHasParentId(persistentEntity, object, this.spannerMappingContext.getPersistentEntity(spannerPersistentProperty.getColumnInnerType()), child);<NEW_LINE>mutations.addAll(saveObject<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return mutations;<NEW_LINE>} | (op, child, includeProperties)); |
1,630,055 | public Request<DistributeDatasetEntriesRequest> marshall(DistributeDatasetEntriesRequest distributeDatasetEntriesRequest) {<NEW_LINE>if (distributeDatasetEntriesRequest == null) {<NEW_LINE>throw new AmazonClientException("Invalid argument passed to marshall(DistributeDatasetEntriesRequest)");<NEW_LINE>}<NEW_LINE>Request<DistributeDatasetEntriesRequest> request = new DefaultRequest<DistributeDatasetEntriesRequest>(distributeDatasetEntriesRequest, "AmazonRekognition");<NEW_LINE>String target = "RekognitionService.DistributeDatasetEntries";<NEW_LINE>request.addHeader("X-Amz-Target", target);<NEW_LINE>request.setHttpMethod(HttpMethodName.POST);<NEW_LINE>String uriResourcePath = "/";<NEW_LINE>request.setResourcePath(uriResourcePath);<NEW_LINE>try {<NEW_LINE>StringWriter stringWriter = new StringWriter();<NEW_LINE>AwsJsonWriter jsonWriter = JsonUtils.getJsonWriter(stringWriter);<NEW_LINE>jsonWriter.beginObject();<NEW_LINE>if (distributeDatasetEntriesRequest.getDatasets() != null) {<NEW_LINE>java.util.List<DistributeDataset> datasets = distributeDatasetEntriesRequest.getDatasets();<NEW_LINE>jsonWriter.name("Datasets");<NEW_LINE>jsonWriter.beginArray();<NEW_LINE>for (DistributeDataset datasetsItem : datasets) {<NEW_LINE>if (datasetsItem != null) {<NEW_LINE>DistributeDatasetJsonMarshaller.getInstance().marshall(datasetsItem, jsonWriter);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>jsonWriter.endArray();<NEW_LINE>}<NEW_LINE>jsonWriter.endObject();<NEW_LINE>jsonWriter.close();<NEW_LINE>String snippet = stringWriter.toString();<NEW_LINE>byte[] content = snippet.getBytes(UTF8);<NEW_LINE>request.<MASK><NEW_LINE>request.addHeader("Content-Length", Integer.toString(content.length));<NEW_LINE>} catch (Throwable t) {<NEW_LINE>throw new AmazonClientException("Unable to marshall request to JSON: " + t.getMessage(), t);<NEW_LINE>}<NEW_LINE>if (!request.getHeaders().containsKey("Content-Type")) {<NEW_LINE>request.addHeader("Content-Type", "application/x-amz-json-1.1");<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>} | setContent(new StringInputStream(snippet)); |
1,324,547 | final DeleteApplicationInputProcessingConfigurationResult executeDeleteApplicationInputProcessingConfiguration(DeleteApplicationInputProcessingConfigurationRequest deleteApplicationInputProcessingConfigurationRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteApplicationInputProcessingConfigurationRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteApplicationInputProcessingConfigurationRequest> request = null;<NEW_LINE>Response<DeleteApplicationInputProcessingConfigurationResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteApplicationInputProcessingConfigurationRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteApplicationInputProcessingConfigurationRequest));<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(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Kinesis Analytics");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteApplicationInputProcessingConfiguration");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteApplicationInputProcessingConfigurationResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteApplicationInputProcessingConfigurationResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden()); |
1,794,059 | private static PackageBufINf showLogSum(ManagerConnection c, ByteBuffer buffer, byte packetId) {<NEW_LINE>PackageBufINf bufINf = new PackageBufINf();<NEW_LINE>File[] logFiles = new File(SystemConfig.getHomePath(), "logs").listFiles();<NEW_LINE>String fileNames = "";<NEW_LINE>for (File f : logFiles) {<NEW_LINE>if (f.isFile()) {<NEW_LINE>fileNames += " " + f.getName();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>File file = getLogFile(DEFAULT_LOGFILE);<NEW_LINE>BufferedReader br = null;<NEW_LINE>int totalLines = 0;<NEW_LINE>CircularArrayList<String> queue = new CircularArrayList<String>(50);<NEW_LINE>try {<NEW_LINE>br = new <MASK><NEW_LINE>String line = null;<NEW_LINE>while ((line = br.readLine()) != null) {<NEW_LINE>totalLines++;<NEW_LINE>if (queue.size() == queue.capacity()) {<NEW_LINE>queue.remove(0);<NEW_LINE>}<NEW_LINE>queue.add(line);<NEW_LINE>}<NEW_LINE>RowDataPacket row = new RowDataPacket(FIELD_COUNT);<NEW_LINE>row.add(StringUtil.encode("files in log dir:" + totalLines + fileNames, c.getCharset()));<NEW_LINE>row.packetId = ++packetId;<NEW_LINE>buffer = row.write(buffer, c, true);<NEW_LINE>row = new RowDataPacket(FIELD_COUNT);<NEW_LINE>row.add(StringUtil.encode("Total lines " + totalLines + " ,tail " + queue.size() + " line is following:", c.getCharset()));<NEW_LINE>row.packetId = ++packetId;<NEW_LINE>buffer = row.write(buffer, c, true);<NEW_LINE>int size = queue.size() - 1;<NEW_LINE>for (int i = size; i >= 0; i--) {<NEW_LINE>String data = queue.get(i);<NEW_LINE>row = new RowDataPacket(FIELD_COUNT);<NEW_LINE>row.add(StringUtil.encode(data, c.getCharset()));<NEW_LINE>row.packetId = ++packetId;<NEW_LINE>buffer = row.write(buffer, c, true);<NEW_LINE>}<NEW_LINE>bufINf.buffer = buffer;<NEW_LINE>bufINf.packetId = packetId;<NEW_LINE>return bufINf;<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOGGER.error("showLogSumError", e);<NEW_LINE>RowDataPacket row = new RowDataPacket(FIELD_COUNT);<NEW_LINE>row.add(StringUtil.encode(e.toString(), c.getCharset()));<NEW_LINE>row.packetId = ++packetId;<NEW_LINE>buffer = row.write(buffer, c, true);<NEW_LINE>bufINf.buffer = buffer;<NEW_LINE>} finally {<NEW_LINE>if (br != null) {<NEW_LINE>try {<NEW_LINE>br.close();<NEW_LINE>} catch (IOException e) {<NEW_LINE>LOGGER.error("showLogSumError", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>bufINf.packetId = packetId;<NEW_LINE>return bufINf;<NEW_LINE>} | BufferedReader(new FileReader(file)); |
677,850 | public void execute() {<NEW_LINE>if (stateManager.getActiveDatabase().isEmpty()) {<NEW_LINE>dialogService.notify(Localization.lang("This operation requires an open library."));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (stateManager.getSelectedEntries().size() != 1) {<NEW_LINE>dialogService.notify(Localization.lang("This operation requires exactly one item to be selected."));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>BibDatabaseContext databaseContext = stateManager.getActiveDatabase().get();<NEW_LINE>BibEntry entry = stateManager.getSelectedEntries().get(0);<NEW_LINE>Path workingDirectory = databaseContext.getFirstExistingFileDir(filePreferences).orElse(filePreferences.getWorkingDirectory());<NEW_LINE>FileDialogConfiguration fileDialogConfiguration = new FileDialogConfiguration.Builder().withInitialDirectory(workingDirectory).build();<NEW_LINE>dialogService.showFileOpenDialog(fileDialogConfiguration).ifPresent(newFile -> {<NEW_LINE>LinkedFile linkedFile = LinkedFilesEditorViewModel.fromFile(newFile, databaseContext.getFileDirectories(filePreferences), ExternalFileTypes.getInstance());<NEW_LINE>LinkedFileEditDialogView dialog = new LinkedFileEditDialogView(linkedFile);<NEW_LINE>dialogService.showCustomDialogAndWait(dialog).ifPresent(editedLinkedFile -> {<NEW_LINE>Optional<FieldChange> fieldChange = entry.addFile(editedLinkedFile);<NEW_LINE>fieldChange.ifPresent(change -> {<NEW_LINE>UndoableFieldChange ce = new UndoableFieldChange(change);<NEW_LINE>libraryTab.<MASK><NEW_LINE>libraryTab.markBaseChanged();<NEW_LINE>});<NEW_LINE>});<NEW_LINE>});<NEW_LINE>} | getUndoManager().addEdit(ce); |
334,674 | public void addAdvancedMsgListener(MethodCall call, final MethodChannel.Result result) {<NEW_LINE>final String listenerUuid = CommonUtil.getParam(call, result, "listenerUuid");<NEW_LINE>listenerUuidList.add(listenerUuid);<NEW_LINE>final V2TIMAdvancedMsgListener advacedMessageListener = new V2TIMAdvancedMsgListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onRecvNewMessage(V2TIMMessage msg) {<NEW_LINE>makeAddAdvancedMsgListenerEventData("onRecvNewMessage", CommonUtil.convertV2TIMMessageToMap(msg), listenerUuid);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onRecvC2CReadReceipt(List<V2TIMMessageReceipt> receiptList) {<NEW_LINE>List<Object> list = new LinkedList<Object>();<NEW_LINE>for (int i = 0; i < receiptList.size(); i++) {<NEW_LINE>list.add(CommonUtil.convertV2TIMMessageReceiptToMap(receiptList.get(i)));<NEW_LINE>}<NEW_LINE>makeAddAdvancedMsgListenerEventData("onRecvC2CReadReceipt", list, listenerUuid);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onRecvMessageRevoked(String msgID) {<NEW_LINE>makeAddAdvancedMsgListenerEventData("onRecvMessageRevoked", msgID, listenerUuid);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onRecvMessageModified(V2TIMMessage msg) {<NEW_LINE>makeAddAdvancedMsgListenerEventData("onRecvMessageModified", CommonUtil.convertV2TIMMessageToMap(msg), listenerUuid);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>advancedMessageListenerList.put(listenerUuid, advacedMessageListener);<NEW_LINE>V2TIMManager.<MASK><NEW_LINE>result.success("add advance msg listener success");<NEW_LINE>} | getMessageManager().addAdvancedMsgListener(advacedMessageListener); |
338,194 | private void checkSnapshotCompatibility(Project project, FileCollection currentFiles, File previousDirectory, FileExtensionFilter filter, List<String> fileArgs) {<NEW_LINE>boolean isCheckRestSpecVsSnapshot = filter.getSuffix().equals(PegasusPlugin.IDL_FILE_SUFFIX);<NEW_LINE>for (File currentFile : currentFiles) {<NEW_LINE>getProject().getLogger().info(<MASK><NEW_LINE>String apiFilename;<NEW_LINE>if (isCheckRestSpecVsSnapshot) {<NEW_LINE>String fileName = currentFile.getName().substring(0, currentFile.getName().length() - PegasusPlugin.SNAPSHOT_FILE_SUFFIX.length());<NEW_LINE>apiFilename = fileName + PegasusPlugin.IDL_FILE_SUFFIX;<NEW_LINE>} else {<NEW_LINE>apiFilename = currentFile.getName();<NEW_LINE>}<NEW_LINE>String apiFilePath = previousDirectory.getPath() + File.separatorChar + apiFilename;<NEW_LINE>File apiFile = project.file(apiFilePath);<NEW_LINE>if (apiFile.exists()) {<NEW_LINE>fileArgs.add(apiFilePath);<NEW_LINE>fileArgs.add(currentFile.getPath());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | "Checking interface file: {}", currentFile.getPath()); |
787,596 | public static StoredLtrQueryBuilder fromXContent(FeatureStoreLoader storeLoader, XContentParser parser) throws IOException {<NEW_LINE>storeLoader = Objects.requireNonNull(storeLoader);<NEW_LINE>final StoredLtrQueryBuilder builder = new StoredLtrQueryBuilder(storeLoader);<NEW_LINE>try {<NEW_LINE>PARSER.<MASK><NEW_LINE>} catch (IllegalArgumentException iae) {<NEW_LINE>throw new ParsingException(parser.getTokenLocation(), iae.getMessage(), iae);<NEW_LINE>}<NEW_LINE>if (builder.modelName() == null && builder.featureSetName() == null) {<NEW_LINE>throw new ParsingException(parser.getTokenLocation(), "Either [" + MODEL_NAME + "] or [" + FEATURESET_NAME + "] must be set.");<NEW_LINE>}<NEW_LINE>if (builder.params() == null) {<NEW_LINE>throw new ParsingException(parser.getTokenLocation(), "Field [" + PARAMS + "] is mandatory.");<NEW_LINE>}<NEW_LINE>return builder;<NEW_LINE>} | parse(parser, builder, null); |
782,801 | final DeleteComponentResult executeDeleteComponent(DeleteComponentRequest deleteComponentRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteComponentRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteComponentRequest> request = null;<NEW_LINE>Response<DeleteComponentResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteComponentRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteComponentRequest));<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(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "imagebuilder");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteComponent");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteComponentResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteComponentResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden()); |
10,852 | public final <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17> MergeImpl columns(Field<T1> field1, Field<T2> field2, Field<T3> field3, Field<T4> field4, Field<T5> field5, Field<T6> field6, Field<T7> field7, Field<T8> field8, Field<T9> field9, Field<T10> field10, Field<T11> field11, Field<T12> field12, Field<T13> field13, Field<T14> field14, Field<T15> field15, Field<T16> field16, Field<T17> field17) {<NEW_LINE>return columns(Arrays.asList(field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12, field13, field14<MASK><NEW_LINE>} | , field15, field16, field17)); |
1,364,224 | public void onReceive(Context context, Intent intent) {<NEW_LINE>String action = intent.getAction();<NEW_LINE>Log.d(TAG, "intent: " + intent);<NEW_LINE>if (Intent.ACTION_POWER_CONNECTED.equals(action)) {<NEW_LINE>Intent cmd = new Intent(UploadService.INTENT_POWER_CONNECTED);<NEW_LINE>cmd.setClass(context, UploadService.class);<NEW_LINE>context.startService(cmd);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (Intent.ACTION_POWER_DISCONNECTED.equals(action)) {<NEW_LINE>Intent cmd = new Intent(UploadService.INTENT_POWER_DISCONNECTED);<NEW_LINE>cmd.setClass(context, UploadService.class);<NEW_LINE>context.startService(cmd);<NEW_LINE>}<NEW_LINE>if (ConnectivityManager.CONNECTIVITY_ACTION.equals(action)) {<NEW_LINE>boolean wifi = onWifi(context);<NEW_LINE>Log.d(TAG, "onWifi = " + wifi);<NEW_LINE>Intent cmd = new Intent(wifi ? UploadService.INTENT_NETWORK_WIFI : UploadService.INTENT_NETWORK_NOT_WIFI);<NEW_LINE>String ssid = getSSID(context);<NEW_LINE>cmd.putExtra("SSID", ssid);<NEW_LINE>Log.d(TAG, "extra ssid (chk)= " <MASK><NEW_LINE>cmd.setClass(context, UploadService.class);<NEW_LINE>context.startService(cmd);<NEW_LINE>}<NEW_LINE>} | + cmd.getStringExtra("SSID")); |
303,107 | Expr indexMethodField(Expr expr) {<NEW_LINE>if (expr == null) {<NEW_LINE>expr = map();<NEW_LINE>}<NEW_LINE>// Expr expr = map();<NEW_LINE>while (true) {<NEW_LINE>Tok tok = peek();<NEW_LINE>// expr [ expr ]<NEW_LINE>if (tok.sym == Sym.LBRACK) {<NEW_LINE>move();<NEW_LINE>Expr index = expr();<NEW_LINE>match(Sym.RBRACK);<NEW_LINE>expr = new <MASK><NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (tok.sym != Sym.DOT) {<NEW_LINE>return expr;<NEW_LINE>}<NEW_LINE>if ((tok = move()).sym != Sym.ID) {<NEW_LINE>resetForward(forward - 1);<NEW_LINE>return expr;<NEW_LINE>}<NEW_LINE>move();<NEW_LINE>if (peek().sym != Sym.LPAREN) {<NEW_LINE>expr = new Field(expr, tok.value(), location);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>move();<NEW_LINE>// expr '.' ID '(' ')'<NEW_LINE>if (peek().sym == Sym.RPAREN) {<NEW_LINE>move();<NEW_LINE>expr = new Method(expr, tok.value(), location);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>// expr '.' ID '(' exprList ')'<NEW_LINE>ExprList exprList = exprList();<NEW_LINE>match(Sym.RPAREN);<NEW_LINE>expr = new Method(expr, tok.value(), exprList, location);<NEW_LINE>}<NEW_LINE>} | Index(expr, index, location); |
81,347 | final ListAssessmentRunAgentsResult executeListAssessmentRunAgents(ListAssessmentRunAgentsRequest listAssessmentRunAgentsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listAssessmentRunAgentsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListAssessmentRunAgentsRequest> request = null;<NEW_LINE>Response<ListAssessmentRunAgentsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListAssessmentRunAgentsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listAssessmentRunAgentsRequest));<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(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Inspector");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListAssessmentRunAgents");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListAssessmentRunAgentsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListAssessmentRunAgentsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden()); |
82,970 | public ListSentimentDetectionJobsResult listSentimentDetectionJobs(ListSentimentDetectionJobsRequest listSentimentDetectionJobsRequest) throws AmazonServiceException, AmazonClientException {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listSentimentDetectionJobsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<ListSentimentDetectionJobsRequest> request = null;<NEW_LINE>Response<ListSentimentDetectionJobsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListSentimentDetectionJobsRequestMarshaller().marshall(listSentimentDetectionJobsRequest);<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>Unmarshaller<ListSentimentDetectionJobsResult, JsonUnmarshallerContext> unmarshaller = new ListSentimentDetectionJobsResultJsonUnmarshaller();<NEW_LINE>JsonResponseHandler<ListSentimentDetectionJobsResult> responseHandler = new JsonResponseHandler<ListSentimentDetectionJobsResult>(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.startEvent(Field.ClientExecuteTime); |
131,970 | public void testCreateAndCancelBeforeExpirationNoTx() {<NEW_LINE>try {<NEW_LINE>svExpiredTimerInfos.clear();<NEW_LINE>ivBean.executeTestNoTx(TstName.TEST_CREATE_TIMER);<NEW_LINE>Collection<String> infos = ivBean.getInfoOfAllTimers();<NEW_LINE>assertEquals("Unexpected number of timers", 1, infos.size());<NEW_LINE>assertTrue("Did not contain expected timer info"<MASK><NEW_LINE>ivBean.executeTestNoTx(TstName.TEST_CANCEL_TIMER);<NEW_LINE>infos = ivBean.getInfoOfAllTimers();<NEW_LINE>assertEquals("Unexpected number of timers", 0, infos.size());<NEW_LINE>assertEquals("Unexpected timer expiration : " + svExpiredTimerInfos, 0, svExpiredTimerInfos.size());<NEW_LINE>FATHelper.sleep(AnnotationTxLocal.DURATION + AnnotationTxLocal.BUFFER);<NEW_LINE>assertEquals("Timeout method invoked after being canceled : " + svExpiredTimerInfos, 0, svExpiredTimerInfos.size());<NEW_LINE>} catch (EJBException ex) {<NEW_LINE>FATHelper.checkForAssertion(ex);<NEW_LINE>}<NEW_LINE>} | , infos.contains(DEFAULT_INFO)); |
419,234 | protected void configure() {<NEW_LINE>// For each CliOption installed at runtime, bind a singleton instance and register the instance<NEW_LINE>// to JCommander for parsing.<NEW_LINE>ImmutableList.Builder<CliOption> cliOptions = ImmutableList.builder();<NEW_LINE>for (ClassInfo classInfo : scanResult.getClassesImplementing(CLI_OPTION_INTERFACE).filter(classInfo -> !classInfo.isInterface())) {<NEW_LINE>logger.atInfo().log("Found CliOption: %s", classInfo.getName());<NEW_LINE>CliOption cliOption = bindCliOption(classInfo<MASK><NEW_LINE>jCommander.addObject(cliOption);<NEW_LINE>cliOptions.add(cliOption);<NEW_LINE>}<NEW_LINE>// Parse command arguments or die.<NEW_LINE>try {<NEW_LINE>jCommander.parse(args);<NEW_LINE>cliOptions.build().forEach(CliOption::validate);<NEW_LINE>} catch (ParameterException e) {<NEW_LINE>jCommander.usage();<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>} | .loadClass(CliOption.class)); |
937,911 | public void marshall(ModelPackage modelPackage, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (modelPackage == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(modelPackage.getModelPackageName(), MODELPACKAGENAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(modelPackage.getModelPackageGroupName(), MODELPACKAGEGROUPNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(modelPackage.getModelPackageVersion(), MODELPACKAGEVERSION_BINDING);<NEW_LINE>protocolMarshaller.marshall(modelPackage.getModelPackageArn(), MODELPACKAGEARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(modelPackage.getModelPackageDescription(), MODELPACKAGEDESCRIPTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(modelPackage.getCreationTime(), CREATIONTIME_BINDING);<NEW_LINE>protocolMarshaller.marshall(modelPackage.getInferenceSpecification(), INFERENCESPECIFICATION_BINDING);<NEW_LINE>protocolMarshaller.marshall(modelPackage.getSourceAlgorithmSpecification(), SOURCEALGORITHMSPECIFICATION_BINDING);<NEW_LINE>protocolMarshaller.marshall(modelPackage.getValidationSpecification(), VALIDATIONSPECIFICATION_BINDING);<NEW_LINE>protocolMarshaller.marshall(modelPackage.getModelPackageStatus(), MODELPACKAGESTATUS_BINDING);<NEW_LINE>protocolMarshaller.marshall(modelPackage.getModelPackageStatusDetails(), MODELPACKAGESTATUSDETAILS_BINDING);<NEW_LINE>protocolMarshaller.marshall(modelPackage.getCertifyForMarketplace(), CERTIFYFORMARKETPLACE_BINDING);<NEW_LINE>protocolMarshaller.marshall(modelPackage.getModelApprovalStatus(), MODELAPPROVALSTATUS_BINDING);<NEW_LINE>protocolMarshaller.marshall(modelPackage.getCreatedBy(), CREATEDBY_BINDING);<NEW_LINE>protocolMarshaller.marshall(modelPackage.getMetadataProperties(), METADATAPROPERTIES_BINDING);<NEW_LINE>protocolMarshaller.marshall(modelPackage.getModelMetrics(), MODELMETRICS_BINDING);<NEW_LINE>protocolMarshaller.marshall(modelPackage.getLastModifiedTime(), LASTMODIFIEDTIME_BINDING);<NEW_LINE>protocolMarshaller.marshall(modelPackage.getLastModifiedBy(), LASTMODIFIEDBY_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(modelPackage.getDomain(), DOMAIN_BINDING);<NEW_LINE>protocolMarshaller.marshall(modelPackage.getTask(), TASK_BINDING);<NEW_LINE>protocolMarshaller.marshall(modelPackage.getSamplePayloadUrl(), SAMPLEPAYLOADURL_BINDING);<NEW_LINE>protocolMarshaller.marshall(modelPackage.getAdditionalInferenceSpecifications(), ADDITIONALINFERENCESPECIFICATIONS_BINDING);<NEW_LINE>protocolMarshaller.marshall(modelPackage.getTags(), TAGS_BINDING);<NEW_LINE>protocolMarshaller.marshall(modelPackage.getCustomerMetadataProperties(), CUSTOMERMETADATAPROPERTIES_BINDING);<NEW_LINE>protocolMarshaller.marshall(modelPackage.getDriftCheckBaselines(), DRIFTCHECKBASELINES_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | modelPackage.getApprovalDescription(), APPROVALDESCRIPTION_BINDING); |
1,775,590 | public static <T> ServerServiceDefinition useMarshalledMessages(final ServerServiceDefinition serviceDef, final MethodDescriptor.Marshaller<T> marshaller) {<NEW_LINE>List<ServerMethodDefinition<?, ?>> wrappedMethods = new ArrayList<>();<NEW_LINE>List<MethodDescriptor<?, ?>> wrappedDescriptors = new ArrayList<>();<NEW_LINE>// Wrap the descriptors<NEW_LINE>for (final ServerMethodDefinition<?, ?> definition : serviceDef.getMethods()) {<NEW_LINE>final MethodDescriptor<?, ?> originalMethodDescriptor = definition.getMethodDescriptor();<NEW_LINE>final MethodDescriptor<T, T> wrappedMethodDescriptor = originalMethodDescriptor.toBuilder(marshaller, marshaller).build();<NEW_LINE>wrappedDescriptors.add(wrappedMethodDescriptor);<NEW_LINE>wrappedMethods.add<MASK><NEW_LINE>}<NEW_LINE>// Build the new service descriptor<NEW_LINE>final ServiceDescriptor.Builder serviceDescriptorBuilder = ServiceDescriptor.newBuilder(serviceDef.getServiceDescriptor().getName()).setSchemaDescriptor(serviceDef.getServiceDescriptor().getSchemaDescriptor());<NEW_LINE>for (MethodDescriptor<?, ?> wrappedDescriptor : wrappedDescriptors) {<NEW_LINE>serviceDescriptorBuilder.addMethod(wrappedDescriptor);<NEW_LINE>}<NEW_LINE>// Create the new service definition.<NEW_LINE>final ServerServiceDefinition.Builder serviceBuilder = ServerServiceDefinition.builder(serviceDescriptorBuilder.build());<NEW_LINE>for (ServerMethodDefinition<?, ?> definition : wrappedMethods) {<NEW_LINE>serviceBuilder.addMethod(definition);<NEW_LINE>}<NEW_LINE>return serviceBuilder.build();<NEW_LINE>} | (wrapMethod(definition, wrappedMethodDescriptor)); |
451,112 | final DeleteBackupVaultLockConfigurationResult executeDeleteBackupVaultLockConfiguration(DeleteBackupVaultLockConfigurationRequest deleteBackupVaultLockConfigurationRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteBackupVaultLockConfigurationRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteBackupVaultLockConfigurationRequest> request = null;<NEW_LINE>Response<DeleteBackupVaultLockConfigurationResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteBackupVaultLockConfigurationRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteBackupVaultLockConfigurationRequest));<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, "Backup");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteBackupVaultLockConfiguration");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteBackupVaultLockConfigurationResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteBackupVaultLockConfigurationResultJsonUnmarshaller());<NEW_LINE>response = <MASK><NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | invoke(request, responseHandler, executionContext); |
1,008,246 | private Mono<Response<Flux<ByteBuffer>>> diagnoseVirtualNetworkWithResponseAsync(String resourceGroupName, String clusterName) {<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 (clusterName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>final String accept = "application/json";<NEW_LINE>return FluxUtil.withContext(context -> service.diagnoseVirtualNetwork(this.client.getEndpoint(), resourceGroupName, clusterName, this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context)).contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));<NEW_LINE>} | error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); |
481,570 | public // added by Gary - ghuang@cs.umass.edu<NEW_LINE>InstanceList sampleWithWeights(java.util.Random r, double[] weights) {<NEW_LINE>if (weights.length != size())<NEW_LINE>throw new IllegalArgumentException("length of weight vector must equal number of instances");<NEW_LINE>if (size() == 0)<NEW_LINE>return cloneEmpty();<NEW_LINE>@Var<NEW_LINE>double sumOfWeights = 0;<NEW_LINE>for (int i = 0; i < size(); i++) {<NEW_LINE>if (weights[i] < 0)<NEW_LINE>throw new IllegalArgumentException("weight vector must be non-negative");<NEW_LINE>sumOfWeights += weights[i];<NEW_LINE>}<NEW_LINE>if (sumOfWeights <= 0)<NEW_LINE>throw new IllegalArgumentException("weights must sum to positive value");<NEW_LINE>InstanceList newList = new InstanceList(getPipe(), size());<NEW_LINE>double[] probabilities <MASK><NEW_LINE>@Var<NEW_LINE>double sumProbs = 0;<NEW_LINE>for (int i = 0; i < size(); i++) {<NEW_LINE>sumProbs += r.nextDouble();<NEW_LINE>probabilities[i] = sumProbs;<NEW_LINE>}<NEW_LINE>MatrixOps.timesEquals(probabilities, sumOfWeights / sumProbs);<NEW_LINE>// make sure rounding didn't mess things up<NEW_LINE>probabilities[size() - 1] = sumOfWeights;<NEW_LINE>// do sampling<NEW_LINE>@Var<NEW_LINE>int a = 0;<NEW_LINE>@Var<NEW_LINE>int b = 0;<NEW_LINE>sumProbs = 0;<NEW_LINE>while (a < size() && b < size()) {<NEW_LINE>sumProbs += weights[b];<NEW_LINE>while (a < size() && probabilities[a] <= sumProbs) {<NEW_LINE>newList.add(get(b));<NEW_LINE>newList.setInstanceWeight(a, 1);<NEW_LINE>a++;<NEW_LINE>}<NEW_LINE>b++;<NEW_LINE>}<NEW_LINE>return newList;<NEW_LINE>} | = new double[size()]; |
1,088,804 | final SearchResult executeSearch(SearchRequest searchRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(searchRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<SearchRequest> request = null;<NEW_LINE>Response<SearchResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new SearchRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(searchRequest));<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, "SageMaker");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "Search");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<SearchResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(<MASK><NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | false), new SearchResultJsonUnmarshaller()); |
784,454 | private Expression<?> parseMapDefinitionExpression() {<NEW_LINE>TokenStream stream = this.parser.getStream();<NEW_LINE>// expect the opening brace and check for an empty map<NEW_LINE>stream.expect(Token.Type.PUNCTUATION, "{");<NEW_LINE>if (stream.current().test(Token.Type.PUNCTUATION, "}")) {<NEW_LINE>stream.next();<NEW_LINE>return new MapExpression(stream.current().getLineNumber());<NEW_LINE>}<NEW_LINE>// there's at least one expression in the map<NEW_LINE>Map<Expression<?>, Expression<?>> <MASK><NEW_LINE>while (true) {<NEW_LINE>// key : value<NEW_LINE>Expression<?> keyExpr = this.parseExpression();<NEW_LINE>stream.expect(Token.Type.PUNCTUATION, ":");<NEW_LINE>Expression<?> valueExpr = this.parseExpression();<NEW_LINE>elements.put(keyExpr, valueExpr);<NEW_LINE>if (stream.current().test(Token.Type.PUNCTUATION, "}")) {<NEW_LINE>// this seems to be the end of the map<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>// expect the comma separator, until we either find a closing brace<NEW_LINE>// or fail the expect<NEW_LINE>stream.expect(Token.Type.PUNCTUATION, ",");<NEW_LINE>}<NEW_LINE>// expect the closing brace<NEW_LINE>stream.expect(Token.Type.PUNCTUATION, "}");<NEW_LINE>return new MapExpression(elements, stream.current().getLineNumber());<NEW_LINE>} | elements = new HashMap<>(); |
1,486,624 | public void insertTodayRowIfNeeded() {<NEW_LINE>int len = mRowInfo.size();<NEW_LINE>int lastDay = -1;<NEW_LINE>int insertIndex = -1;<NEW_LINE>for (int index = 0; index < len; index++) {<NEW_LINE>RowInfo <MASK><NEW_LINE>if (row.mDay == mTodayJulianDay) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (row.mDay > mTodayJulianDay && lastDay < mTodayJulianDay) {<NEW_LINE>insertIndex = index;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>lastDay = row.mDay;<NEW_LINE>}<NEW_LINE>if (insertIndex != -1) {<NEW_LINE>mRowInfo.add(insertIndex, new RowInfo(TYPE_DAY, mTodayJulianDay));<NEW_LINE>} else {<NEW_LINE>mRowInfo.add(new RowInfo(TYPE_DAY, mTodayJulianDay));<NEW_LINE>}<NEW_LINE>} | row = mRowInfo.get(index); |
91,331 | public static void loadModules(final ClasspathJrt jrt) {<NEW_LINE>Set<IModule> cache = ModulesCache.get(jrt.getKey());<NEW_LINE>if (cache == null) {<NEW_LINE>try {<NEW_LINE>final File imageFile <MASK><NEW_LINE>org.eclipse.jdt.internal.compiler.util.JRTUtil.walkModuleImage(imageFile, new org.eclipse.jdt.internal.compiler.util.JRTUtil.JrtFileVisitor<Path>() {<NEW_LINE><NEW_LINE>SimpleSet packageSet = null;<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public FileVisitResult visitPackage(Path dir, Path mod, BasicFileAttributes attrs) throws IOException {<NEW_LINE>ClasspathJar.addToPackageSet(this.packageSet, dir.toString(), true);<NEW_LINE>return FileVisitResult.CONTINUE;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public FileVisitResult visitFile(Path file, Path mod, BasicFileAttributes attrs) throws IOException {<NEW_LINE>return FileVisitResult.CONTINUE;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public FileVisitResult visitModule(Path path, String name) throws IOException {<NEW_LINE>try {<NEW_LINE>jrt.acceptModule(JRTUtil.getClassfileContent(imageFile, IModule.MODULE_INFO_CLASS, name));<NEW_LINE>} catch (ClassFormatException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>return FileVisitResult.SKIP_SUBTREE;<NEW_LINE>}<NEW_LINE>}, JRTUtil.NOTIFY_MODULES);<NEW_LINE>} catch (IOException e) {<NEW_LINE>// TODO: Java 9 Should report better<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// for (IModuleDeclaration iModule : cache) {<NEW_LINE>// jimage.env.acceptModule(iModule, jimage);<NEW_LINE>// }<NEW_LINE>}<NEW_LINE>} | = new File(jrt.zipFilename); |
248,493 | private void fillIDValues() {<NEW_LINE>for (X_I_Movement movementImport : getRecords(false, isImportOnlyNoErrors)) {<NEW_LINE>// if(movementImport.getAD_Org_ID()==0)<NEW_LINE>movementImport.setAD_Org_ID(getID(MOrg.Table_Name, "Value = ?", new Object[] { movementImport.getOrgValue() }));<NEW_LINE>if (movementImport.getM_Product_ID() == 0)<NEW_LINE>movementImport.setM_Product_ID(getID(MProduct.Table_Name, "Value = ?", new Object[] { movementImport.getProductValue() }));<NEW_LINE>// if(imov.getM_Locator_ID()==0)<NEW_LINE>movementImport.setM_Locator_ID(getID(MLocator.Table_Name, "Value = ?", new Object[] { movementImport.getLocatorValue() }));<NEW_LINE>// if(imov.getM_LocatorTo_ID()==0)<NEW_LINE>movementImport.setM_LocatorTo_ID(getID(MLocator.Table_Name, "Value = ?", new Object[] { movementImport.getLocatorToValue() }));<NEW_LINE>if (movementImport.getC_DocType_ID() == 0)<NEW_LINE>movementImport.setC_DocType_ID(getID(MDocType.Table_Name, "Name=?", new Object[] { movementImport.getDocTypeName() }));<NEW_LINE>if (movementImport.getC_BPartner_ID() == 0)<NEW_LINE>movementImport.setC_BPartner_ID(getID(MBPartner.Table_Name, "Value =?", new Object[] { movementImport.getBPartnerValue() }));<NEW_LINE>if (movementImport.getM_Shipper_ID() == 0)<NEW_LINE>movementImport.setM_Shipper_ID(getID(MShipper.Table_Name, "Name = ?", new Object[] { <MASK><NEW_LINE>if (movementImport.getC_Project_ID() == 0)<NEW_LINE>movementImport.setC_Project_ID(getID(MProject.Table_Name, "Value = ?", new Object[] { movementImport.getProjectValue() }));<NEW_LINE>if (movementImport.getC_Campaign_ID() == 0)<NEW_LINE>movementImport.setC_Campaign_ID(getID(MCampaign.Table_Name, "Value = ?", new Object[] { movementImport.getCampaignValue() }));<NEW_LINE>if (movementImport.getAD_OrgTrx_ID() == 0)<NEW_LINE>movementImport.setAD_OrgTrx_ID(getID(MOrg.Table_Name, "Value = ?", new Object[] { movementImport.getOrgTrxValue() }));<NEW_LINE>movementImport.saveEx();<NEW_LINE>StringBuilder err = new StringBuilder("");<NEW_LINE>if (movementImport.getAD_Org_ID() <= 0)<NEW_LINE>err.append(" @AD_Org_ID@ @NotFound@,");<NEW_LINE>if (movementImport.getM_Product_ID() <= 0)<NEW_LINE>err.append(" @M_Product_ID@ @NotFound@,");<NEW_LINE>if (movementImport.getM_Locator_ID() <= 0)<NEW_LINE>err.append(" @M_Locator_ID@ @NotFound@,");<NEW_LINE>if (movementImport.getM_LocatorTo_ID() <= 0)<NEW_LINE>err.append(" @M_LocatorTo_ID@ @NotFound@,");<NEW_LINE>if (movementImport.getC_DocType_ID() <= 0)<NEW_LINE>err.append(" @C_DocType_ID@ @NotFound@,");<NEW_LINE>if (err.toString() != null && err.toString().length() > 0) {<NEW_LINE>notImported++;<NEW_LINE>movementImport.setI_ErrorMsg(Msg.parseTranslation(getCtx(), err.toString()));<NEW_LINE>movementImport.saveEx();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | movementImport.getShipperName() })); |
368,599 | private static String createInsertDataQuery(final String table, final String tempTable, final String[] newCols, final String[] oldCols, final Map<String, String> colAliases, final String[] notNullCols, final OnConflict onConflict) {<NEW_LINE>final SQLInsertQuery.Builder qb = insertInto(onConflict, table);<NEW_LINE>final List<String> newInsertColsList = new ArrayList<>();<NEW_LINE>for (final String newCol : newCols) {<NEW_LINE>final String oldAliasedCol = colAliases != null ? colAliases.get(newCol) : null;<NEW_LINE>if (ArraysKt.contains(oldCols, newCol) || oldAliasedCol != null && ArraysKt.contains(oldCols, oldAliasedCol)) {<NEW_LINE>newInsertColsList.add(newCol);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final String[] newInsertCols = newInsertColsList.toArray(new String[0]);<NEW_LINE>if (!TwidereArrayUtils.contains(newInsertCols, notNullCols))<NEW_LINE>return null;<NEW_LINE>qb.columns(newInsertCols);<NEW_LINE>final Columns.Column[] oldDataCols = new Columns.Column[newInsertCols.length];<NEW_LINE>for (int i = 0, j = oldDataCols.length; i < j; i++) {<NEW_LINE>final String newCol = newInsertCols[i];<NEW_LINE>final String oldAliasedCol = colAliases != null ? <MASK><NEW_LINE>if (oldAliasedCol != null && ArraysKt.contains(oldCols, oldAliasedCol)) {<NEW_LINE>oldDataCols[i] = new Columns.Column(oldAliasedCol, newCol);<NEW_LINE>} else {<NEW_LINE>oldDataCols[i] = new Columns.Column(newCol);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final SQLSelectQuery.Builder selectOldBuilder = select(new Columns(oldDataCols));<NEW_LINE>selectOldBuilder.from(new Tables(tempTable));<NEW_LINE>qb.select(selectOldBuilder.build());<NEW_LINE>return qb.buildSQL();<NEW_LINE>} | colAliases.get(newCol) : null; |
984,739 | private void register() {<NEW_LINE>registry.register(MetricRegistry.name(NettyInternalMetrics.class, "NumberDirectArenas"), (Gauge<Integer>) this::getNumDirectArenas);<NEW_LINE>registry.register(MetricRegistry.name(NettyInternalMetrics.class, "NumberHeapArenas"), (Gauge<Integer>) this::getNumHeapArenas);<NEW_LINE>registry.register(MetricRegistry.name(NettyInternalMetrics.class, "NumberThreadLocalCaches"), (Gauge<Integer>) this::getNumThreadLocalCaches);<NEW_LINE>registry.register(MetricRegistry.name(NettyInternalMetrics.class, "UsedHeapMemory"), (Gauge<Long>) this::getUsedHeapMemory);<NEW_LINE>registry.register(MetricRegistry.name(NettyInternalMetrics.class, "UsedDirectMemory"), (Gauge<MASK><NEW_LINE>registry.register(MetricRegistry.name(NettyInternalMetrics.class, "NumberHeapTotalAllocations"), (Gauge<Long>) this::getNumHeapTotalAllocations);<NEW_LINE>registry.register(MetricRegistry.name(NettyInternalMetrics.class, "NumberHeapTotalDeallocations"), (Gauge<Long>) this::getNumHeapTotalDeallocations);<NEW_LINE>registry.register(MetricRegistry.name(NettyInternalMetrics.class, "NumberHeapTotalActiveAllocations"), (Gauge<Long>) this::getNumHeapTotalActiveAllocations);<NEW_LINE>registry.register(MetricRegistry.name(NettyInternalMetrics.class, "NumberDirectTotalAllocations"), (Gauge<Long>) this::getNumDirectTotalAllocations);<NEW_LINE>registry.register(MetricRegistry.name(NettyInternalMetrics.class, "NumberDirectTotalDeallocations"), (Gauge<Long>) this::getNumDirectTotalDeallocations);<NEW_LINE>registry.register(MetricRegistry.name(NettyInternalMetrics.class, "NumberDirectTotalActiveAllocations"), (Gauge<Long>) this::getNumDirectTotalActiveAllocations);<NEW_LINE>} | <Long>) this::getUsedDirectMemory); |
1,322,080 | private static SimpleSignature createSignature(Operation operation, MetaAccessProvider metaAccess) {<NEW_LINE>ResolvedJavaType objectHandleType = metaAccess.lookupJavaType(JNIObjectHandle.class);<NEW_LINE>ResolvedJavaType intType = metaAccess.lookupJavaType(int.class);<NEW_LINE>ResolvedJavaType returnType;<NEW_LINE>List<JavaType> args = new ArrayList<>();<NEW_LINE>args.add(metaAccess.lookupJavaType(JNIEnvironment.class));<NEW_LINE>// j<PrimitiveType>Array array;<NEW_LINE>args.add(objectHandleType);<NEW_LINE>if (operation == Operation.GET_ELEMENTS) {<NEW_LINE>// jboolean *isCopy;<NEW_LINE>args.add(metaAccess.lookupJavaType(CCharPointer.class));<NEW_LINE>returnType = metaAccess.lookupJavaType(WordPointer.class);<NEW_LINE>} else if (operation == Operation.RELEASE_ELEMENTS) {<NEW_LINE>// NativeType *elems;<NEW_LINE>args.add(metaAccess<MASK><NEW_LINE>// jint mode;<NEW_LINE>args.add(intType);<NEW_LINE>returnType = metaAccess.lookupJavaType(Void.TYPE);<NEW_LINE>} else if (operation == Operation.GET_REGION || operation == Operation.SET_REGION) {<NEW_LINE>// jsize start;<NEW_LINE>args.add(intType);<NEW_LINE>// jsize len;<NEW_LINE>args.add(intType);<NEW_LINE>// NativeType *buf;<NEW_LINE>args.add(metaAccess.lookupJavaType(WordPointer.class));<NEW_LINE>returnType = metaAccess.lookupJavaType(Void.TYPE);<NEW_LINE>} else {<NEW_LINE>throw VMError.shouldNotReachHere();<NEW_LINE>}<NEW_LINE>return new SimpleSignature(args, returnType);<NEW_LINE>} | .lookupJavaType(WordPointer.class)); |
640,176 | public MessageReply call(final NeedReplyMessage msg) {<NEW_LINE>evaluateMessageTimeout(msg);<NEW_LINE>final MessageReply[] replies = new MessageReply[1];<NEW_LINE>replies[0] = null;<NEW_LINE>Envelope e = new Envelope() {<NEW_LINE><NEW_LINE><MASK><NEW_LINE><NEW_LINE>final Envelope self = this;<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public synchronized void ack(MessageReply reply) {<NEW_LINE>count(msg);<NEW_LINE>envelopes.remove(msg.getId());<NEW_LINE>if (!called.compareAndSet(false, true)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>replies[0] = reply;<NEW_LINE>self.notify();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void timeout() {<NEW_LINE>envelopes.remove(msg.getId());<NEW_LINE>called.compareAndSet(false, true);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>List<Message> getRequests() {<NEW_LINE>List<Message> requests = new ArrayList<Message>();<NEW_LINE>requests.add(msg);<NEW_LINE>return requests;<NEW_LINE>}<NEW_LINE>};<NEW_LINE>envelopes.put(msg.getId(), e);<NEW_LINE>send(msg, false);<NEW_LINE>synchronized (e) {<NEW_LINE>if (replies[0] == null) {<NEW_LINE>try {<NEW_LINE>e.wait(msg.getTimeout());<NEW_LINE>} catch (InterruptedException e1) {<NEW_LINE>throw new CloudRuntimeException(e1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (replies[0] == null) {<NEW_LINE>e.timeout();<NEW_LINE>return createTimeoutReply(msg);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return replies[0];<NEW_LINE>} | AtomicBoolean called = new AtomicBoolean(false); |
687,189 | Object execute(Object[] arguments, @Cached HPyAsContextNode asContextNode, @Cached HPyAsPythonObjectNode receiverAsPythonObjectNode, @Cached HPyAsPythonObjectNode keyAsPythonObjectNode, @Cached HPyAsHandleNode asHandleNode, @Cached FromCharPointerNode fromCharPointerNode, @Cached PInteropGetAttributeNode getAttributeNode, @Cached HPyTransformExceptionToNativeNode transformExceptionToNativeNode, @Exclusive @Cached GilNode gil) throws ArityException {<NEW_LINE>boolean mustRelease = gil.acquire();<NEW_LINE>try {<NEW_LINE>checkArity(arguments, 3);<NEW_LINE>GraalHPyContext context = asContextNode.execute(arguments[0]);<NEW_LINE>Object receiver = receiverAsPythonObjectNode.execute(context, arguments[1]);<NEW_LINE>Object key;<NEW_LINE>switch(mode) {<NEW_LINE>case OBJECT:<NEW_LINE>key = keyAsPythonObjectNode.execute<MASK><NEW_LINE>break;<NEW_LINE>case CHAR_PTR:<NEW_LINE>key = fromCharPointerNode.execute(arguments[2]);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>CompilerDirectives.transferToInterpreterAndInvalidate();<NEW_LINE>throw new IllegalStateException("should not be reached");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>return asHandleNode.execute(context, getAttributeNode.execute(receiver, key));<NEW_LINE>} catch (PException e) {<NEW_LINE>transformExceptionToNativeNode.execute(context, e);<NEW_LINE>return GraalHPyHandle.NULL_HANDLE;<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>gil.release(mustRelease);<NEW_LINE>}<NEW_LINE>} | (context, arguments[2]); |
1,269,425 | public boolean sendCurrentId(String collection, long id) {<NEW_LINE>try {<NEW_LINE>HttpPost post = new HttpPost(postURL);<NEW_LINE>post.addHeader("X-Auth-Service-Provider", SERVICE_PROVIDER);<NEW_LINE>post.addHeader("X-Verify-Credentials-Authorization", getAuthrityHeader(twitter));<NEW_LINE>JSONObject json = new JSONObject();<NEW_LINE>json.put("id", id);<NEW_LINE>JSONObject base = new JSONObject();<NEW_LINE>base.put(collection, json);<NEW_LINE>Log.v("talon_tweetmarker", "sending " + id + " to " + screenname);<NEW_LINE>post.setEntity(new ByteArrayEntity(base.toString().getBytes("UTF8")));<NEW_LINE>DefaultHttpClient client = new DefaultHttpClient();<NEW_LINE>HttpResponse response = client.execute(post);<NEW_LINE>int responseCode = response.getStatusLine().getStatusCode();<NEW_LINE>Log.v("talon_tweetmarker", "sending response code: " + responseCode);<NEW_LINE>if (responseCode != 200) {<NEW_LINE>// there was an error, we will retry once<NEW_LINE>// wait first<NEW_LINE>try {<NEW_LINE>Thread.sleep(1500);<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>}<NEW_LINE>response = client.execute(post);<NEW_LINE>responseCode = response<MASK><NEW_LINE>Log.v("talon_tweetmarker", "sending response code: " + responseCode);<NEW_LINE>if (responseCode == 200) {<NEW_LINE>// success, return true<NEW_LINE>int currentVersion = sharedPrefs.getInt("last_version_account_" + currentAccount, 0);<NEW_LINE>sharedPrefs.edit().putInt("last_version_account_" + currentAccount, currentVersion + 1).commit();<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>int currentVersion = sharedPrefs.getInt("last_version_account_" + currentAccount, 0);<NEW_LINE>sharedPrefs.edit().putInt("last_version_account_" + currentAccount, currentVersion + 1).commit();<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | .getStatusLine().getStatusCode(); |
2,379 | public void run(RegressionEnvironment env) {<NEW_LINE>RegressionPath path = new RegressionPath();<NEW_LINE>env.compileDeploy("@name('create') @public create window MyWindow#keepall as SupportBean;\n" + "insert into MyWindow select * from SupportBean", path);<NEW_LINE>// insert X rows<NEW_LINE>// for performance testing change to int maxRows = 100000;<NEW_LINE>int maxRows = 10000;<NEW_LINE>for (int i = 0; i < maxRows; i++) {<NEW_LINE>SupportBean bean = new SupportBean((i < 5000<MASK><NEW_LINE>bean.setLongPrimitive(i);<NEW_LINE>bean.setLongBoxed((long) i + 1);<NEW_LINE>env.sendEventBean(bean);<NEW_LINE>}<NEW_LINE>env.sendEventBean(new SupportBean("B", 100));<NEW_LINE>String eplIdx1One = "on SupportBeanRange sbr select sum(intPrimitive) as sumi from MyWindow where intPrimitive = sbr.rangeStart";<NEW_LINE>runOnDemandAssertion(env, path, eplIdx1One, 1, new SupportBeanRange("R", 5501, 0), 5501);<NEW_LINE>String eplIdx1Two = "on SupportBeanRange sbr select sum(intPrimitive) as sumi from MyWindow where intPrimitive between sbr.rangeStart and sbr.rangeEnd";<NEW_LINE>runOnDemandAssertion(env, path, eplIdx1Two, 1, new SupportBeanRange("R", 5501, 5503), 5501 + 5502 + 5503);<NEW_LINE>String eplIdx1Three = "on SupportBeanRange sbr select sum(intPrimitive) as sumi from MyWindow where theString = key and intPrimitive between sbr.rangeStart and sbr.rangeEnd";<NEW_LINE>runOnDemandAssertion(env, path, eplIdx1Three, 1, new SupportBeanRange("R", "A", 4998, 5503), 4998 + 4999);<NEW_LINE>String eplIdx1Four = "on SupportBeanRange sbr select sum(intPrimitive) as sumi from MyWindow " + "where theString = key and longPrimitive = rangeStart and intPrimitive between rangeStart and rangeEnd " + "and longBoxed between rangeStart and rangeEnd";<NEW_LINE>runOnDemandAssertion(env, path, eplIdx1Four, 1, new SupportBeanRange("R", "A", 4998, 5503), 4998);<NEW_LINE>String eplIdx1Five = "on SupportBeanRange sbr select sum(intPrimitive) as sumi from MyWindow " + "where intPrimitive between rangeStart and rangeEnd " + "and longBoxed between rangeStart and rangeEnd";<NEW_LINE>runOnDemandAssertion(env, path, eplIdx1Five, 1, new SupportBeanRange("R", "A", 4998, 5001), 4998 + 4999 + 5000);<NEW_LINE>env.undeployAll();<NEW_LINE>} | ) ? "A" : "B", i); |
122,206 | // Get join two collection<NEW_LINE>private static void testUnion() {<NEW_LINE>Set<String> set1 = Sets.newHashSet("a1", "a2");<NEW_LINE>Set<String> set2 = Sets.newHashSet("a4");<NEW_LINE>MutableSet<String> mutableSet1 = UnifiedSet.newSetWith("a1", "a2");<NEW_LINE>MutableSet<String> mutableSet2 = UnifiedSet.newSetWith("a4");<NEW_LINE>Collection<String> collection1 = set1;<NEW_LINE>Collection<String> collection2 = set2;<NEW_LINE>// Get join two collection<NEW_LINE>// using JDK<NEW_LINE>Set<String> jdk = new HashSet<>(set1);<NEW_LINE>jdk.addAll(set2);<NEW_LINE>// using guava<NEW_LINE>Set<String> guava = <MASK><NEW_LINE>// using Apache<NEW_LINE>Collection<String> apache = CollectionUtils.union(collection1, collection2);<NEW_LINE>// using GS<NEW_LINE>Set<String> gs = mutableSet1.union(mutableSet2);<NEW_LINE>// print union = [a1, a2, a4]:[a1, a2, a4]:[a1, a2, a4]:[a1, a2, a4]<NEW_LINE>System.out.println("union = " + jdk + ":" + guava + ":" + apache + ":" + gs);<NEW_LINE>} | Sets.union(set1, set2); |
503,585 | public void handleRequest(HttpServerExchange exchange) throws Exception {<NEW_LINE>var <MASK><NEW_LINE>var response = MongoResponse.of(exchange);<NEW_LINE>if (request.isInError()) {<NEW_LINE>next(exchange);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (request.getDBName().isEmpty()) {<NEW_LINE>response.setInError(HttpStatus.SC_NOT_ACCEPTABLE, "db name cannot be empty");<NEW_LINE>next(exchange);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>var _content = request.getContent();<NEW_LINE>if (_content == null) {<NEW_LINE>_content = new BsonDocument();<NEW_LINE>}<NEW_LINE>// cannot PUT an array<NEW_LINE>if (!_content.isDocument()) {<NEW_LINE>response.setInError(HttpStatus.SC_NOT_ACCEPTABLE, "data must be a json object");<NEW_LINE>next(exchange);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>var content = _content.asDocument();<NEW_LINE>var result = // true if updating<NEW_LINE>dbs.// true if updating<NEW_LINE>upsertDB(// true if updating<NEW_LINE>Optional.ofNullable(request.getClientSession()), // true if updating<NEW_LINE>request.getMethod(), request.getDbProps() != null, request.getDBName(), content, request.getETag(), request.isETagCheckRequired());<NEW_LINE>response.setDbOperationResult(result);<NEW_LINE>// inject the etag<NEW_LINE>if (result.getEtag() != null) {<NEW_LINE>ResponseHelper.injectEtagHeader(exchange, result.getEtag());<NEW_LINE>}<NEW_LINE>if (result.getHttpCode() == HttpStatus.SC_CONFLICT) {<NEW_LINE>response.setInError(HttpStatus.SC_CONFLICT, "The database's ETag must be provided using the '" + Headers.IF_MATCH + "' header.");<NEW_LINE>next(exchange);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// invalidate the cache db item<NEW_LINE>MetadataCachesSingleton.getInstance().invalidateDb(request.getDBName());<NEW_LINE>response.setStatusCode(result.getHttpCode());<NEW_LINE>next(exchange);<NEW_LINE>} | request = MongoRequest.of(exchange); |
1,323,547 | public void key(View view) {<NEW_LINE>String key = ((Button) view).getText().toString();<NEW_LINE>if (mUiToString.containsKey(key)) {<NEW_LINE>key = mUiToString.get(key);<NEW_LINE>}<NEW_LINE>switch(key) {<NEW_LINE>case "inv":<NEW_LINE>mIsInInverseMode = !mIsInInverseMode;<NEW_LINE>invertStrings(mIsInInverseMode);<NEW_LINE>int run = mIsInInverseMode ? R.id.inverse : R.id.un_inverse;<NEW_LINE>mMotionLayout.viewTransition(run, findViewById(R.id.adv_inv));<NEW_LINE>return;<NEW_LINE>case "plot":<NEW_LINE>plot();<NEW_LINE>return;<NEW_LINE>case "save":<NEW_LINE>save_plot();<NEW_LINE>return;<NEW_LINE>case "copy":<NEW_LINE>serializeToCopyBuffer();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String str = key;<NEW_LINE>if (mIsInInverseMode && view.getTag() != null) {<NEW_LINE>str = (String) view.getTag();<NEW_LINE>}<NEW_LINE>if (str == null) {<NEW_LINE>Log.w(TAG, Debug.getLoc() + " null! ");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String s = mCalcEngine.key(str);<NEW_LINE>int k = 0;<NEW_LINE>if (s.length() != 0) {<NEW_LINE>mStack[<MASK><NEW_LINE>}<NEW_LINE>for (int i = k; i < mStack.length; i++) {<NEW_LINE>mStack[i].setText(mCalcEngine.getStack(i - k));<NEW_LINE>}<NEW_LINE>view.performHapticFeedback(HapticFeedbackConstants.KEYBOARD_TAP);<NEW_LINE>} | k++].setText(s); |
249,348 | void autoComplete(String text, EditText editText) {<NEW_LINE>if (mAutocompleteListView == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (text == null || text.length() == 0) {<NEW_LINE>mAutocompleteListView.setVisibility(View.GONE);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int currentStart = editText.getSelectionStart();<NEW_LINE><MASK><NEW_LINE>int currentPosition = text.length() - 1;<NEW_LINE>if (currentStart == currentEnd) {<NEW_LINE>currentPosition = currentStart;<NEW_LINE>}<NEW_LINE>if (currentPosition < 0)<NEW_LINE>currentPosition = 0;<NEW_LINE>String lastWholeWord = "";<NEW_LINE>for (int i = currentPosition; i > 0; i--) {<NEW_LINE>String nextChar = text.substring(i - 1, i).toLowerCase();<NEW_LINE>if (nextChar.equals(" ") || nextChar.equals(".")) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>lastWholeWord = nextChar + lastWholeWord;<NEW_LINE>}<NEW_LINE>if (lastWholeWord.startsWith("@")) {<NEW_LINE>List<TwitterUser> autoCompleteMentions = getAutoCompleteMentions(lastWholeWord);<NEW_LINE>mAutocompleteListView.setVisibility(View.VISIBLE);<NEW_LINE>mAutocompleteListView.setAdapter(new AutoCompleteMentionAdapter(this.getActivity(), autoCompleteMentions));<NEW_LINE>mAutocompleteTarget = editText;<NEW_LINE>mAutocompleteListView.setOnItemClickListener(mOnAutoCompleteItemClickListener);<NEW_LINE>} else if (lastWholeWord.startsWith("#")) {<NEW_LINE>List<String> autoCompleteHashtags = getAutoCompleteHashtags(lastWholeWord);<NEW_LINE>mAutocompleteListView.setVisibility(View.VISIBLE);<NEW_LINE>mAutocompleteListView.setAdapter(new AutoCompleteHashtagAdapter(this.getActivity(), autoCompleteHashtags));<NEW_LINE>mAutocompleteTarget = editText;<NEW_LINE>mAutocompleteListView.setOnItemClickListener(mOnAutoCompleteItemClickListener);<NEW_LINE>} else {<NEW_LINE>mAutocompleteListView.setVisibility(View.GONE);<NEW_LINE>}<NEW_LINE>} | int currentEnd = editText.getSelectionEnd(); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.