idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
430,620 | public final void mML_COMMENT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {<NEW_LINE>int _ttype;<NEW_LINE>Token _token = null;<NEW_LINE>int _begin = text.length();<NEW_LINE>_ttype = ML_COMMENT;<NEW_LINE>int _saveIndex;<NEW_LINE>mINCOMPLETE_ML_COMMENT(false);<NEW_LINE>state = CalcScannerTokenTypes.INCOMPLETE_ML_COMMENT;<NEW_LINE>{<NEW_LINE>_loop18: do {<NEW_LINE>if (((LA(1) == '*') && ((LA(2) >= '\u0000' && LA(2) <= '\ufffe')) && ((LA(3) >= '\u0000' && LA(3) <= '\ufffe'))) && (LA(2) != '/')) {<NEW_LINE>match('*');<NEW_LINE>} else if ((_tokenSet_0.member(LA(1)))) {<NEW_LINE>{<NEW_LINE>match(_tokenSet_0);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>break _loop18;<NEW_LINE>}<NEW_LINE>} while (true);<NEW_LINE>}<NEW_LINE>match("*/");<NEW_LINE>state = 0;<NEW_LINE>if (_createToken && _token == null && _ttype != Token.SKIP) {<NEW_LINE>_token = makeToken(_ttype);<NEW_LINE>_token.setText(new String(text.getBuffer(), _begin, text<MASK><NEW_LINE>}<NEW_LINE>_returnToken = _token;<NEW_LINE>} | .length() - _begin)); |
502,671 | /*<NEW_LINE>* (non-Javadoc)<NEW_LINE>* @see freeplane.io.INodeWriter#saveContent(freeplane.io.ITreeWriter,<NEW_LINE>* java.lang.Object, java.lang.String)<NEW_LINE>*/<NEW_LINE>public void writeContent(final ITreeWriter writer, final Object node, final IExtension extension) throws IOException {<NEW_LINE>DetailModel details = (DetailModel) extension;<NEW_LINE>final XMLElement element = new XMLElement();<NEW_LINE>element.setName(NodeTextBuilder.XML_NODE_RICHCONTENT_TAG);<NEW_LINE>String transformedXhtml = "";<NEW_LINE>final boolean forceFormatting = Boolean.TRUE.equals(writer.getHint(MapWriter.WriterHint.FORCE_FORMATTING));<NEW_LINE>if (forceFormatting) {<NEW_LINE>String data = details.getText();<NEW_LINE>if (data != null) {<NEW_LINE>final Object transformed = TextController.getController().getTransformedObjectNoFormattingNoThrow((NodeModel) node, details, data);<NEW_LINE>if (!transformed.equals(data)) {<NEW_LINE>String transformedHtml = HtmlUtils.objectToHtml(transformed);<NEW_LINE>transformedXhtml = HtmlUtils.toXhtml(transformedHtml);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>boolean containsXml = transformedXhtml.isEmpty() && details.getXml() != null;<NEW_LINE>String contentType = details.getContentType();<NEW_LINE>ContentSyntax contentSyntax = containsXml ? ContentSyntax.XML : ContentSyntax.PLAIN;<NEW_LINE>element.setAttribute(NodeTextBuilder.XML_RICHCONTENT_CONTENT_TYPE_ATTRIBUTE, contentSyntax.with(contentType));<NEW_LINE>element.setAttribute(NodeTextBuilder.XML_RICHCONTENT_TYPE_ATTRIBUTE, NodeTextBuilder.XML_RICHCONTENT_TYPE_DETAILS);<NEW_LINE>if (details.isHidden()) {<NEW_LINE>element.setAttribute("HIDDEN", "true");<NEW_LINE>}<NEW_LINE>if (containsXml) {<NEW_LINE>final String content = details.getXml().replace('\0', ' ');<NEW_LINE>writer.addElement(content, element);<NEW_LINE>} else {<NEW_LINE>String text = details.getText();<NEW_LINE>if (text != null) {<NEW_LINE>XMLElement <MASK><NEW_LINE>textElement.setContent(HtmlUtils.htmlToPlain(text));<NEW_LINE>element.addChild(textElement);<NEW_LINE>}<NEW_LINE>writer.addElement(transformedXhtml, element);<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>} | textElement = element.createElement(TEXT_ELEMENT); |
247,201 | protected EJBContextImpl createEjbInstanceAndContext() throws Exception {<NEW_LINE>JCDIService<MASK><NEW_LINE>Object instance = null;<NEW_LINE>EJBContextImpl ctx = _constructEJBContextImpl(null);<NEW_LINE>EjbInvocation ejbInv = null;<NEW_LINE>boolean success = false;<NEW_LINE>try {<NEW_LINE>ejbInv = createEjbInvocation(null, ctx);<NEW_LINE>invocationManager.preInvoke(ejbInv);<NEW_LINE>createEmptyContextAndInterceptors(ctx);<NEW_LINE>if (isJCDIEnabled()) {<NEW_LINE>ctx.setJCDIInjectionContext(_createJCDIInjectionContext(ctx, null, jcdiCtx));<NEW_LINE>jcdiCtx = ctx.getJCDIInjectionContext();<NEW_LINE>if (jcdiCtx != null) {<NEW_LINE>instance = jcdiCtx.getInstance();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>injectEjbInstance(ctx);<NEW_LINE>intercept(CallbackType.AROUND_CONSTRUCT, ctx);<NEW_LINE>instance = ctx.getEJB();<NEW_LINE>}<NEW_LINE>success = true;<NEW_LINE>} catch (Throwable th) {<NEW_LINE>try {<NEW_LINE>if (jcdiCtx != null) {<NEW_LINE>// protecte against memory leak<NEW_LINE>jcdiCtx.cleanup(true);<NEW_LINE>}<NEW_LINE>} catch (Throwable ignore) {<NEW_LINE>}<NEW_LINE>throw new InvocationTargetException(th);<NEW_LINE>} finally {<NEW_LINE>try {<NEW_LINE>if (ejbInv != null) {<NEW_LINE>// Complete the dummy invocation<NEW_LINE>invocationManager.postInvoke(ejbInv);<NEW_LINE>}<NEW_LINE>} catch (Throwable t) {<NEW_LINE>if (success) {<NEW_LINE>throw new InvocationTargetException(t);<NEW_LINE>} else {<NEW_LINE>_logger.log(Level.WARNING, "", t);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ctx.setEJB(instance);<NEW_LINE>return ctx;<NEW_LINE>} | .JCDIInjectionContext<?> jcdiCtx = null; |
802,446 | public InternalAggregation reduce(List<InternalAggregation> aggregations, AggregationReduceContext reduceContext) {<NEW_LINE>// We still need to reduce in case we got the same time series in 2 different indices, but we should be able to optimize<NEW_LINE>// that in the future<NEW_LINE>Map<Map<String, Object>, List<InternalBucket>> bucketsList = null;<NEW_LINE>for (InternalAggregation aggregation : aggregations) {<NEW_LINE>InternalTimeSeries timeSeries = (InternalTimeSeries) aggregation;<NEW_LINE>if (bucketsList != null) {<NEW_LINE>for (InternalBucket bucket : timeSeries.buckets) {<NEW_LINE>bucketsList.compute(bucket.key, (map, list) -> {<NEW_LINE>if (list == null) {<NEW_LINE>list = new ArrayList<>();<NEW_LINE>}<NEW_LINE>list.add(bucket);<NEW_LINE>return list;<NEW_LINE>});<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>bucketsList = new HashMap<>(timeSeries.buckets.size());<NEW_LINE>for (InternalTimeSeries.InternalBucket bucket : timeSeries.buckets) {<NEW_LINE>List<InternalBucket> bucketList = new ArrayList<>();<NEW_LINE>bucketList.add(bucket);<NEW_LINE>bucketsList.put(bucket.key, bucketList);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>reduceContext.consumeBucketsAndMaybeBreak(bucketsList.size());<NEW_LINE>InternalTimeSeries reduced = new InternalTimeSeries(name, new ArrayList<>(bucketsList.size()<MASK><NEW_LINE>for (Map.Entry<Map<String, Object>, List<InternalBucket>> bucketEntry : bucketsList.entrySet()) {<NEW_LINE>reduced.buckets.add(reduceBucket(bucketEntry.getValue(), reduceContext));<NEW_LINE>}<NEW_LINE>return reduced;<NEW_LINE>} | ), keyed, getMetadata()); |
1,293,168 | public void applyAddNode(AddNodeLog addNodeLog) {<NEW_LINE>long startTime = System.currentTimeMillis();<NEW_LINE>Node newNode = addNodeLog.getNewNode();<NEW_LINE>synchronized (allNodes) {<NEW_LINE>if (logger.isDebugEnabled()) {<NEW_LINE>logger.debug("{}: adding a new node {} into {}", name, newNode, allNodes);<NEW_LINE>}<NEW_LINE>if (!allNodes.contains(newNode)) {<NEW_LINE>registerNodeIdentifier(newNode, newNode.getNodeIdentifier());<NEW_LINE>allNodes.add(newNode);<NEW_LINE>}<NEW_LINE>// update the partition table<NEW_LINE>savePartitionTable();<NEW_LINE>// update local data members<NEW_LINE>NodeAdditionResult result = partitionTable.getNodeAdditionResult(newNode);<NEW_LINE>getDataGroupEngine().addNode(newNode, result);<NEW_LINE>if (logger.isDebugEnabled()) {<NEW_LINE>logger.debug("{}: success to add a new node {} into {}", name, newNode, allNodes);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>logger.info("{}: execute adding node {} cost {} ms", name, newNode, (System<MASK><NEW_LINE>} | .currentTimeMillis()) - startTime); |
424,144 | private void takeEstep(final double[] artifactPriors) {<NEW_LINE>for (int i = 0; i < maxDepth; i++) {<NEW_LINE>final int depth = i + 1;<NEW_LINE>refResponsibilities.setRow(i, computeResponsibilities(refAllele, refAllele, 0, 0, depth, artifactPriors, false));<NEW_LINE>}<NEW_LINE>// Compute the responsibilities of alt sites<NEW_LINE>for (int n = 0; n < altDesignMatrix.size(); n++) {<NEW_LINE>final AltSiteRecord example = altDesignMatrix.get(n);<NEW_LINE>final int depth = example.getDepth();<NEW_LINE>final int altDepth = example.getAltCount();<NEW_LINE>final int altF1R2 = example.getAltF1R2();<NEW_LINE>altResponsibilities.setRow(n, computeResponsibilities(refAllele, example.getAltAllele(), altDepth, altF1R2, depth, artifactPriors, false));<NEW_LINE>}<NEW_LINE>// Compute the responsibilities of alt sites with depth=1<NEW_LINE>for (int i = 0; i < maxDepth; i++) {<NEW_LINE>final int depth = i + 1;<NEW_LINE>for (Nucleotide altAllele : Nucleotide.STANDARD_BASES) {<NEW_LINE>for (ReadOrientation orientation : ReadOrientation.values()) {<NEW_LINE>if (altAllele == refAllele) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>final int f1r2Depth = orientation == ReadOrientation.F1R2 ? 1 : 0;<NEW_LINE>final Triple<Integer, Nucleotide, ReadOrientation> key = <MASK><NEW_LINE>responsibilitiesOfAltDepth1Sites.put(key, computeResponsibilities(refAllele, altAllele, 1, f1r2Depth, depth, artifactPriors, false));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | createKey(depth, altAllele, orientation); |
258,771 | public UpdateQualificationTypeResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>UpdateQualificationTypeResult updateQualificationTypeResult = new UpdateQualificationTypeResult();<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 updateQualificationTypeResult;<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("QualificationType", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>updateQualificationTypeResult.setQualificationType(QualificationTypeJsonUnmarshaller.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 updateQualificationTypeResult;<NEW_LINE>} | String currentParentElement = context.getCurrentParentElement(); |
93,738 | private ResponseRef sendWidgetRequest(NodeRequestRef requestRef) throws ExternalOperationFailedException {<NEW_LINE>String url = getBaseUrl() + URLUtils.widgetUrl;<NEW_LINE>VisualisPostAction visualisPostAction = new VisualisPostAction();<NEW_LINE>visualisPostAction.setUser(requestRef.getUserName());<NEW_LINE>visualisPostAction.addRequestPayload("widgetName", requestRef.getName());<NEW_LINE>visualisPostAction.addRequestPayload("projectId", requestRef.getParameter("projectId"));<NEW_LINE>visualisPostAction.addRequestPayload(CSCommonUtils.CONTEXT_ID_STR, requestRef.getJobContent().get(CSCommonUtils.CONTEXT_ID_STR));<NEW_LINE>if (requestRef.getJobContent().get("bindViewKey") != null) {<NEW_LINE>String viewNodeName = requestRef.getJobContent().get("bindViewKey").toString();<NEW_LINE>if (StringUtils.isNotBlank(viewNodeName) && !"empty".equals(viewNodeName)) {<NEW_LINE>viewNodeName = getNodeNameByKey(viewNodeName, (String) requestRef.getJobContent().get("json"));<NEW_LINE>visualisPostAction.addRequestPayload(CSCommonUtils.NODE_NAME_STR, viewNodeName);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>SSOUrlBuilderOperation ssoUrlBuilderOperation = requestRef.getWorkspace().getSSOUrlBuilderOperation().copy();<NEW_LINE>ssoUrlBuilderOperation.setAppName(getAppName());<NEW_LINE>ssoUrlBuilderOperation.setReqUrl(url);<NEW_LINE>ssoUrlBuilderOperation.setWorkspace(requestRef.getWorkspace().getWorkspaceName());<NEW_LINE>ResponseRef responseRef;<NEW_LINE>try {<NEW_LINE>visualisPostAction.setUrl(ssoUrlBuilderOperation.getBuiltUrl());<NEW_LINE>//<NEW_LINE>HttpResult httpResult = (HttpResult) this.ssoRequestOperation.requestWithSSO(ssoUrlBuilderOperation, visualisPostAction);<NEW_LINE>responseRef = new VisualisCommonResponseRef(httpResult.getResponseBody());<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new ExternalOperationFailedException(90177, "Create Widget Exception", e);<NEW_LINE>}<NEW_LINE>if (responseRef.isFailed()) {<NEW_LINE>logger.error(responseRef.getResponseBody());<NEW_LINE>throw new ExternalOperationFailedException(90178, responseRef.getErrorMsg());<NEW_LINE>}<NEW_LINE>// cs<NEW_LINE>VisualisRefUpdateOperation visualisRefUpdateOperation = new VisualisRefUpdateOperation(developmentService);<NEW_LINE>NodeUpdateCSRequestRefImpl visualisUpdateCSRequestRef = new NodeUpdateCSRequestRefImpl();<NEW_LINE>visualisUpdateCSRequestRef.setContextID((String) requestRef.getJobContent().get(CSCommonUtils.CONTEXT_ID_STR));<NEW_LINE>visualisUpdateCSRequestRef.<MASK><NEW_LINE>visualisUpdateCSRequestRef.setUserName(requestRef.getUserName());<NEW_LINE>visualisUpdateCSRequestRef.setNodeType(requestRef.getNodeType());<NEW_LINE>visualisUpdateCSRequestRef.setWorkspace(requestRef.getWorkspace());<NEW_LINE>visualisRefUpdateOperation.updateRef(visualisUpdateCSRequestRef);<NEW_LINE>return responseRef;<NEW_LINE>} | setJobContent(responseRef.toMap()); |
146,898 | public Table metacatToHiveTable(final TableDto dto) {<NEW_LINE>final Table table = new Table();<NEW_LINE>final QualifiedName name = dto.getName();<NEW_LINE>if (name != null) {<NEW_LINE>table.<MASK><NEW_LINE>table.setDbName(name.getDatabaseName());<NEW_LINE>}<NEW_LINE>final StorageDto storageDto = dto.getSerde();<NEW_LINE>if (storageDto != null) {<NEW_LINE>table.setOwner(storageDto.getOwner());<NEW_LINE>}<NEW_LINE>final AuditDto auditDto = dto.getAudit();<NEW_LINE>if (auditDto != null && auditDto.getCreatedDate() != null) {<NEW_LINE>table.setCreateTime(dateToEpochSeconds(auditDto.getCreatedDate()));<NEW_LINE>}<NEW_LINE>Map<String, String> params = new HashMap<>();<NEW_LINE>if (dto.getMetadata() != null) {<NEW_LINE>params = dto.getMetadata();<NEW_LINE>}<NEW_LINE>table.setParameters(params);<NEW_LINE>updateTableTypeAndViewInfo(dto, table);<NEW_LINE>table.setSd(fromStorageDto(storageDto, table.getTableName()));<NEW_LINE>final List<FieldDto> fields = dto.getFields();<NEW_LINE>if (fields == null) {<NEW_LINE>table.setPartitionKeys(Collections.emptyList());<NEW_LINE>table.getSd().setCols(Collections.emptyList());<NEW_LINE>} else {<NEW_LINE>final List<FieldSchema> nonPartitionFields = Lists.newArrayListWithCapacity(fields.size());<NEW_LINE>final List<FieldSchema> partitionFields = Lists.newArrayListWithCapacity(fields.size());<NEW_LINE>for (FieldDto fieldDto : fields) {<NEW_LINE>final FieldSchema f = metacatToHiveField(fieldDto);<NEW_LINE>if (fieldDto.isPartition_key()) {<NEW_LINE>partitionFields.add(f);<NEW_LINE>} else {<NEW_LINE>nonPartitionFields.add(f);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>table.setPartitionKeys(partitionFields);<NEW_LINE>table.getSd().setCols(nonPartitionFields);<NEW_LINE>}<NEW_LINE>return table;<NEW_LINE>} | setTableName(name.getTableName()); |
225,420 | private boolean doLaunch(@Nullable String url, @Nonnull List<String> command, @Nullable final WebBrowser browser, @Nullable final Project project, @Nonnull String[] additionalParameters, @Nullable Runnable launchTask) {<NEW_LINE>if (url != null && url.startsWith("jar:")) {<NEW_LINE>String files = extractFiles(url);<NEW_LINE>if (files == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>url = files;<NEW_LINE>}<NEW_LINE>List<String> commandWithUrl = new ArrayList<>(command);<NEW_LINE>if (url != null) {<NEW_LINE>if (browser != null) {<NEW_LINE>browser.addOpenUrlParameter(commandWithUrl, url);<NEW_LINE>} else {<NEW_LINE>commandWithUrl.add(url);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>GeneralCommandLine commandLine = new GeneralCommandLine(commandWithUrl);<NEW_LINE>addArgs(commandLine, browser == null ? null : browser.getSpecificSettings(), additionalParameters);<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>checkCreatedProcess(browser, project, commandLine, process, launchTask);<NEW_LINE>return true;<NEW_LINE>} catch (ExecutionException e) {<NEW_LINE>doShowError(e.getMessage(), browser, project, null, null);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>} | Process process = commandLine.createProcess(); |
524,403 | public static AutogenEnvironmentVariablesDiff fromProto(ai.verta.modeldb.versioning.EnvironmentVariablesDiff blob) {<NEW_LINE>if (blob == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>AutogenEnvironmentVariablesDiff obj = new AutogenEnvironmentVariablesDiff();<NEW_LINE>{<NEW_LINE>Function<ai.verta.modeldb.versioning.EnvironmentVariablesDiff, AutogenEnvironmentVariablesBlob> f = x -> AutogenEnvironmentVariablesBlob.fromProto(blob.getA());<NEW_LINE>obj.setA(f.apply(blob));<NEW_LINE>}<NEW_LINE>{<NEW_LINE>Function<ai.verta.modeldb.versioning.EnvironmentVariablesDiff, AutogenEnvironmentVariablesBlob> f = x -> AutogenEnvironmentVariablesBlob.fromProto(blob.getB());<NEW_LINE>obj.setB(f.apply(blob));<NEW_LINE>}<NEW_LINE>{<NEW_LINE>Function<ai.verta.modeldb.versioning.EnvironmentVariablesDiff, AutogenEnvironmentVariablesBlob> f = x -> AutogenEnvironmentVariablesBlob.<MASK><NEW_LINE>obj.setC(f.apply(blob));<NEW_LINE>}<NEW_LINE>{<NEW_LINE>Function<ai.verta.modeldb.versioning.EnvironmentVariablesDiff, AutogenDiffStatusEnumDiffStatus> f = x -> AutogenDiffStatusEnumDiffStatus.fromProto(blob.getStatus());<NEW_LINE>obj.setStatus(f.apply(blob));<NEW_LINE>}<NEW_LINE>return obj;<NEW_LINE>} | fromProto(blob.getC()); |
932,667 | protected void updateUninstallUpgrade() {<NEW_LINE>final int[] selected = myPackagesTable.getSelectedRows();<NEW_LINE>boolean upgradeAvailable = false;<NEW_LINE><MASK><NEW_LINE>boolean canInstall = installEnabled();<NEW_LINE>boolean canUpgrade = true;<NEW_LINE>if (myPackageManagementService != null && selected.length != 0) {<NEW_LINE>for (int i = 0; i != selected.length; ++i) {<NEW_LINE>final int index = selected[i];<NEW_LINE>if (index >= myPackagesTable.getRowCount())<NEW_LINE>continue;<NEW_LINE>final Object value = myPackagesTable.getValueAt(index, 0);<NEW_LINE>if (value instanceof InstalledPackage) {<NEW_LINE>final InstalledPackage pkg = (InstalledPackage) value;<NEW_LINE>if (!canUninstallPackage(pkg)) {<NEW_LINE>canUninstall = false;<NEW_LINE>}<NEW_LINE>canInstall = canInstallPackage(pkg);<NEW_LINE>if (!canUpgradePackage(pkg)) {<NEW_LINE>canUpgrade = false;<NEW_LINE>}<NEW_LINE>final String pyPackageName = pkg.getName();<NEW_LINE>final String availableVersion = (String) myPackagesTable.getValueAt(index, 2);<NEW_LINE>if (!upgradeAvailable) {<NEW_LINE>upgradeAvailable = isUpdateAvailable(pkg.getVersion(), availableVersion) && !myCurrentlyInstalling.contains(pyPackageName);<NEW_LINE>}<NEW_LINE>if (!canUninstall && !canUpgrade)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>myUninstallButton.setEnabled(canUninstall);<NEW_LINE>myInstallButton.setEnabled(canInstall);<NEW_LINE>myUpgradeButton.setEnabled(upgradeAvailable && canUpgrade);<NEW_LINE>} | boolean canUninstall = selected.length != 0; |
1,719,312 | public ObservableSource<? extends VectorSchemaRoot> apply(VectorSchemaRoot input) throws Throwable {<NEW_LINE>int rowCount = input.getRowCount();<NEW_LINE>VectorBatchRecord record = new VectorBatchRecord(input);<NEW_LINE>VectorSchemaRoot output = rootContext.getVectorSchemaRoot(schema, rowCount * recordSinks.length);<NEW_LINE>int outputRowId = 0;<NEW_LINE>for (int i = 0; i < recordSinks.length; i++) {<NEW_LINE>RecordSink recordSink = recordSinks[i];<NEW_LINE>for (int rowId = 0; rowId < rowCount; rowId++) {<NEW_LINE>record.setPosition(rowId);<NEW_LINE>MapKey key = map.withKey();<NEW_LINE>RecordSetter recordSinkSPI = <MASK><NEW_LINE>recordSink.copy(record, recordSinkSPI);<NEW_LINE>if (key.create()) {<NEW_LINE>recordSink.copy(record, outputRowId, output);<NEW_LINE>outputRowId++;<NEW_LINE>// output<NEW_LINE>} else {<NEW_LINE>// skip<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (outputRowId == 0) {<NEW_LINE>output.close();<NEW_LINE>return Observable.empty();<NEW_LINE>}<NEW_LINE>output.setRowCount(outputRowId);<NEW_LINE>inputPlan.eachFree(input);<NEW_LINE>return Observable.fromArray(output);<NEW_LINE>} | RecordSinkFactory.INSTANCE.getRecordSinkSPI(key); |
1,766,394 | public static SecretQuestionCredentialModel createFromCredentialModel(CredentialModel credentialModel) {<NEW_LINE>try {<NEW_LINE>SecretQuestionCredentialData credentialData = JsonSerialization.readValue(credentialModel.getCredentialData(), SecretQuestionCredentialData.class);<NEW_LINE>SecretQuestionSecretData secretData = JsonSerialization.readValue(credentialModel.getSecretData(), SecretQuestionSecretData.class);<NEW_LINE>SecretQuestionCredentialModel secretQuestionCredentialModel = new SecretQuestionCredentialModel(credentialData, secretData);<NEW_LINE>secretQuestionCredentialModel.<MASK><NEW_LINE>secretQuestionCredentialModel.setCreatedDate(credentialModel.getCreatedDate());<NEW_LINE>secretQuestionCredentialModel.setType(TYPE);<NEW_LINE>secretQuestionCredentialModel.setId(credentialModel.getId());<NEW_LINE>secretQuestionCredentialModel.setSecretData(credentialModel.getSecretData());<NEW_LINE>secretQuestionCredentialModel.setCredentialData(credentialModel.getCredentialData());<NEW_LINE>return secretQuestionCredentialModel;<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>} | setUserLabel(credentialModel.getUserLabel()); |
934,816 | public void store(Item item, String alias) {<NEW_LINE>if (item.getState() instanceof UnDefType) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (!isProperlyConfigured) {<NEW_LINE>logger.warn("Configuration for influxdb not yet loaded or broken.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (!isConnected()) {<NEW_LINE>logger.warn("InfluxDB is not yet connected");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String realName = item.getName();<NEW_LINE>String name = (alias != null) ? alias : realName;<NEW_LINE>State state = null;<NEW_LINE>if (item.getAcceptedCommandTypes().contains(HSBType.class)) {<NEW_LINE>state = <MASK><NEW_LINE>logger.trace("Tried to get item as {}, state is {}", HSBType.class, state.toString());<NEW_LINE>} else if (item.getAcceptedDataTypes().contains(PercentType.class)) {<NEW_LINE>state = item.getStateAs(PercentType.class);<NEW_LINE>logger.trace("Tried to get item as {}, state is {}", PercentType.class, state.toString());<NEW_LINE>} else {<NEW_LINE>// All other items should return the best format by default<NEW_LINE>state = item.getState();<NEW_LINE>logger.trace("Tried to get item from item class {}, state is {}", item.getClass(), state.toString());<NEW_LINE>}<NEW_LINE>Object value = stateToObject(state);<NEW_LINE>logger.trace("storing {} in influxdb value {}, {}", name, value, item);<NEW_LINE>Point point = Point.measurement(name).field(VALUE_COLUMN_NAME, value).time(System.currentTimeMillis(), timeUnit).build();<NEW_LINE>try {<NEW_LINE>influxDB.write(dbName, retentionPolicy, point);<NEW_LINE>} catch (RuntimeException e) {<NEW_LINE>logger.error("storing failed with exception for item: {}", name);<NEW_LINE>handleDatabaseException(e);<NEW_LINE>}<NEW_LINE>} | item.getStateAs(HSBType.class); |
840,630 | public BaseLastAnalysisResultVO processBiz(ToolLastAnalysisResultVO arg, boolean isLast) {<NEW_LINE>long taskId = arg.getTaskId();<NEW_LINE>String toolName = arg.getToolName();<NEW_LINE>String buildId = arg.getBuildId();<NEW_LINE>CommonStatisticEntity statisticEntity;<NEW_LINE>if (isLast) {<NEW_LINE>statisticEntity = commonStatisticRepository.findFirstByTaskIdAndToolNameOrderByTimeDesc(taskId, toolName);<NEW_LINE>} else {<NEW_LINE>statisticEntity = commonStatisticRepository.findByTaskIdAndToolNameAndBuildId(taskId, toolName, buildId);<NEW_LINE>}<NEW_LINE>CommonLastAnalysisResultVO lastAnalysisResultVO = new CommonLastAnalysisResultVO();<NEW_LINE>if (statisticEntity != null) {<NEW_LINE><MASK><NEW_LINE>if (Objects.isNull(lastAnalysisResultVO.getNewCount())) {<NEW_LINE>lastAnalysisResultVO.setNewCount(0);<NEW_LINE>}<NEW_LINE>if (Objects.isNull(lastAnalysisResultVO.getExcludeCount())) {<NEW_LINE>lastAnalysisResultVO.setExcludeCount(0);<NEW_LINE>}<NEW_LINE>if (Objects.isNull(lastAnalysisResultVO.getFixedCount())) {<NEW_LINE>lastAnalysisResultVO.setFixedCount(0);<NEW_LINE>}<NEW_LINE>if (Objects.isNull(lastAnalysisResultVO.getExistCount())) {<NEW_LINE>lastAnalysisResultVO.setExistCount(0);<NEW_LINE>}<NEW_LINE>if (Objects.isNull(lastAnalysisResultVO.getCloseCount())) {<NEW_LINE>lastAnalysisResultVO.setCloseCount(0);<NEW_LINE>}<NEW_LINE>if (isLast) {<NEW_LINE>setDefectChange(lastAnalysisResultVO, taskId, toolName, buildId);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>lastAnalysisResultVO.setPattern(toolName);<NEW_LINE>return lastAnalysisResultVO;<NEW_LINE>} | BeanUtils.copyProperties(statisticEntity, lastAnalysisResultVO); |
536,108 | public static Loop commonSuperloop(Loop first, Loop second) {<NEW_LINE>if (first == second) {<NEW_LINE>return first;<NEW_LINE>}<NEW_LINE>List<Loop> firstPath = new ArrayList<>();<NEW_LINE>List<Loop> <MASK><NEW_LINE>while (first != null) {<NEW_LINE>firstPath.add(first);<NEW_LINE>first = first.getParent();<NEW_LINE>}<NEW_LINE>firstPath.add(null);<NEW_LINE>while (second != null) {<NEW_LINE>secondPath.add(second);<NEW_LINE>second = second.getParent();<NEW_LINE>}<NEW_LINE>secondPath.add(null);<NEW_LINE>Collections.reverse(firstPath);<NEW_LINE>Collections.reverse(secondPath);<NEW_LINE>int sz = Math.min(firstPath.size(), secondPath.size());<NEW_LINE>for (int i = 1; i < sz; ++i) {<NEW_LINE>if (firstPath.get(i) != secondPath.get(i)) {<NEW_LINE>return firstPath.get(i - 1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return firstPath.get(sz - 1);<NEW_LINE>} | secondPath = new ArrayList<>(); |
1,147,514 | public AuthServiceResult authenticate(AuthServiceCredentials authCredentials) {<NEW_LINE>final Optional<AuthServiceBackend> activeBackend = authServiceConfig.getActiveBackend();<NEW_LINE>if (activeBackend.isPresent()) {<NEW_LINE>AuthenticationServiceUnavailableException caughtException = null;<NEW_LINE>try {<NEW_LINE>final AuthServiceResult result = authenticate(authCredentials, activeBackend.get());<NEW_LINE>if (result.isSuccess()) {<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>} catch (AuthenticationServiceUnavailableException e) {<NEW_LINE>caughtException = e;<NEW_LINE>}<NEW_LINE>// TODO: Do we want the fallback to the default backend here? Maybe it should be configurable?<NEW_LINE>if (LOG.isDebugEnabled()) {<NEW_LINE>final AuthServiceBackend defaultBackend = authServiceConfig.getDefaultBackend();<NEW_LINE>LOG.debug("Couldn't authenticate <{}> against active authentication service <{}/{}/{}>. Trying default backend <{}/{}/{}>.", authCredentials.username(), activeBackend.get().backendId(), activeBackend.get().backendType(), activeBackend.get().backendTitle(), defaultBackend.backendId(), defaultBackend.backendType(), defaultBackend.backendTitle());<NEW_LINE>}<NEW_LINE>final AuthServiceResult result = authenticate(<MASK><NEW_LINE>if (result.isSuccess()) {<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>if (caughtException != null) {<NEW_LINE>throw caughtException;<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} else {<NEW_LINE>return authenticate(authCredentials, authServiceConfig.getDefaultBackend());<NEW_LINE>}<NEW_LINE>} | authCredentials, authServiceConfig.getDefaultBackend()); |
1,069,447 | private Set<Integer> flagDuplicates(final List<Build37ExtendedIlluminaManifestRecord> records) {<NEW_LINE>// Load the cluster file to get the GenTrain scores<NEW_LINE>// load the egt first, and create a map of ilmnid to gentrain score. Save that and use it for deduplicating.<NEW_LINE>log.info("Loading the egt file for duplicate resolution");<NEW_LINE>final InfiniumEGTFile infiniumEGTFile;<NEW_LINE>try {<NEW_LINE>infiniumEGTFile = new InfiniumEGTFile(CLUSTER_FILE);<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new PicardException("Error reading cluster file '" + CLUSTER_FILE.<MASK><NEW_LINE>}<NEW_LINE>final Map<String, Float> nameToGenTrainScore = new HashMap<>();<NEW_LINE>for (String rsName : infiniumEGTFile.rsNameToIndex.keySet()) {<NEW_LINE>nameToGenTrainScore.put(rsName, infiniumEGTFile.totalScore[infiniumEGTFile.rsNameToIndex.get(rsName)]);<NEW_LINE>}<NEW_LINE>return flagDuplicates(records, nameToGenTrainScore);<NEW_LINE>} | getAbsolutePath() + "'", e); |
1,258,032 | protected boolean processKeyValueTokens() {<NEW_LINE>List<WSSecurityEngineResult> tokenResults <MASK><NEW_LINE>for (WSSecurityEngineResult wser : signedResults) {<NEW_LINE>PublicKey publicKey = (PublicKey) wser.get(WSSecurityEngineResult.TAG_PUBLIC_KEY);<NEW_LINE>if (publicKey != null) {<NEW_LINE>tokenResults.add(wser);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (tokenResults.isEmpty()) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (signed && !areTokensSigned(tokenResults)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (encrypted && !areTokensEncrypted(tokenResults)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (endorsed && !checkEndorsed(tokenResults)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (!validateSignedEncryptedPolicies(tokenResults)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | = new ArrayList<WSSecurityEngineResult>(); |
1,139,250 | public int reloadAllSegments(String tableNameWithType, boolean forceDownload) {<NEW_LINE>LOGGER.info("Sending reload message for table: {} with forceDownload: {}", tableNameWithType, forceDownload);<NEW_LINE>if (forceDownload) {<NEW_LINE>TableType tt = TableNameBuilder.getTableTypeFromTableName(tableNameWithType);<NEW_LINE>// TODO: support to force download immutable segments from RealTime table.<NEW_LINE>Preconditions.checkArgument(tt == TableType.OFFLINE, "Table: %s is not an OFFLINE table, which is required to force to download segments", tableNameWithType);<NEW_LINE>}<NEW_LINE>Criteria recipientCriteria = new Criteria();<NEW_LINE>recipientCriteria.setRecipientInstanceType(InstanceType.PARTICIPANT);<NEW_LINE>recipientCriteria.setInstanceName("%");<NEW_LINE>recipientCriteria.setResource(tableNameWithType);<NEW_LINE>recipientCriteria.setSessionSpecific(true);<NEW_LINE>SegmentReloadMessage segmentReloadMessage = new <MASK><NEW_LINE>ClusterMessagingService messagingService = _helixZkManager.getMessagingService();<NEW_LINE>// Infinite timeout on the recipient<NEW_LINE>int timeoutMs = -1;<NEW_LINE>int numMessagesSent = messagingService.send(recipientCriteria, segmentReloadMessage, null, timeoutMs);<NEW_LINE>if (numMessagesSent > 0) {<NEW_LINE>LOGGER.info("Sent {} reload messages for table: {}", numMessagesSent, tableNameWithType);<NEW_LINE>} else {<NEW_LINE>LOGGER.warn("No reload message sent for table: {}", tableNameWithType);<NEW_LINE>}<NEW_LINE>return numMessagesSent;<NEW_LINE>} | SegmentReloadMessage(tableNameWithType, null, forceDownload); |
1,150,640 | private static void convertDocker(org.jreleaser.model.DockerConfiguration d, DockerConfiguration docker) {<NEW_LINE>if (d instanceof org.jreleaser.model.Docker && docker instanceof Docker) {<NEW_LINE>org.jreleaser.model.Docker dd = (org.jreleaser.model.Docker) d;<NEW_LINE>Docker kk = (Docker) docker;<NEW_LINE>if (kk.isContinueOnErrorSet())<NEW_LINE>dd.setContinueOnError(kk.isContinueOnError());<NEW_LINE>dd.setRepository(convertDockerRepository(kk.getRepository()));<NEW_LINE>dd.setCommitAuthor(convertCommitAuthor(kk.getCommitAuthor()));<NEW_LINE>dd.setDownloadUrl(tr(kk.getDownloadUrl()));<NEW_LINE>}<NEW_LINE>d.setActive(tr(docker.resolveActive()));<NEW_LINE>d.setTemplateDirectory(tr(docker.getTemplateDirectory()));<NEW_LINE>d.setSkipTemplates(tr(docker.getSkipTemplates()));<NEW_LINE>d.setExtraProperties(docker.getExtraProperties());<NEW_LINE>d.setBaseImage(tr(docker.getBaseImage()));<NEW_LINE>d.setImageNames(tr(docker.getImageNames()));<NEW_LINE>d.setBuildArgs(tr<MASK><NEW_LINE>d.setPreCommands(tr(docker.getPreCommands()));<NEW_LINE>d.setPostCommands(tr(docker.getPostCommands()));<NEW_LINE>d.setLabels(docker.getLabels());<NEW_LINE>d.setRegistries(convertRegistries(docker.getRegistries()));<NEW_LINE>if (docker.isUseLocalArtifactSet())<NEW_LINE>d.setUseLocalArtifact(docker.isUseLocalArtifact());<NEW_LINE>} | (docker.getBuildArgs())); |
835,176 | public static String open(String wsName, String packageName, String wsdlName) {<NEW_LINE>String title = NbBundle.<MASK><NEW_LINE>DeleteWsDialog delDialog = new DeleteWsDialog(wsName, packageName, wsdlName);<NEW_LINE>NotifyDescriptor desc = new NotifyDescriptor.Confirmation(delDialog, title, NotifyDescriptor.YES_NO_OPTION);<NEW_LINE>Object result = DialogDisplayer.getDefault().notify(desc);<NEW_LINE>if (result.equals(NotifyDescriptor.CLOSED_OPTION)) {<NEW_LINE>return DELETE_NOTHING;<NEW_LINE>} else if (result.equals(NotifyDescriptor.NO_OPTION)) {<NEW_LINE>return DELETE_NOTHING;<NEW_LINE>} else if (delDialog.deletePackage() && delDialog.deleteWsdl()) {<NEW_LINE>return DELETE_ALL;<NEW_LINE>} else if (delDialog.deletePackage()) {<NEW_LINE>return DELETE_PACKAGE;<NEW_LINE>} else if (delDialog.deleteWsdl()) {<NEW_LINE>return DELETE_WSDL;<NEW_LINE>} else<NEW_LINE>return DELETE_WS;<NEW_LINE>} | getMessage(DeleteWsDialog.class, "MSG_ConfirmDeleteObjectTitle"); |
152,418 | public static void execute(ManagerService service) {<NEW_LINE>ByteBuffer buffer = service.allocate();<NEW_LINE>// write header<NEW_LINE>buffer = HEADER.write(buffer, service, true);<NEW_LINE>// write fields<NEW_LINE>for (FieldPacket field : FIELDS) {<NEW_LINE>buffer = field.write(buffer, service, true);<NEW_LINE>}<NEW_LINE>// write eof<NEW_LINE>buffer = EOF.write(buffer, service, true);<NEW_LINE>// write rows<NEW_LINE>byte packetId = EOF.getPacketId();<NEW_LINE>for (IOProcessor process : DbleServer.getInstance().getFrontProcessors()) {<NEW_LINE>for (FrontendConnection front : process.getFrontends().values()) {<NEW_LINE>if (front.isManager()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>RowDataPacket row = getRow(front.getService(), service.getCharset().getResults());<NEW_LINE>if (row != null) {<NEW_LINE>row.setPacketId(++packetId);<NEW_LINE>buffer = row.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// write last eof<NEW_LINE>EOFRowPacket lastEof = new EOFRowPacket();<NEW_LINE>lastEof.setPacketId(++packetId);<NEW_LINE>lastEof.write(buffer, service);<NEW_LINE>} | write(buffer, service, true); |
722,083 | public void testOpenHistory() throws Exception {<NEW_LINE>Project project = env.getProject();<NEW_LINE>ProjectData projectData = project.getProjectData();<NEW_LINE>projectData.getRootFolder().createFile("WinHelloCpp.exe", program, TaskMonitorAdapter.DUMMY_MONITOR);<NEW_LINE>DomainFile df = program.getDomainFile();<NEW_LINE>addItemToVersionControl(df, "Added to Version Control", true);<NEW_LINE>// Make change<NEW_LINE>Program p = (Program) df.getDomainObject(this, false, false, null);<NEW_LINE>changeProgram(p, "aaa");<NEW_LINE>checkinComment = "Version 2";<NEW_LINE>keepCheckedOut = true;<NEW_LINE>assertTrue(df.canCheckin());<NEW_LINE>df.checkin(this, false, null);<NEW_LINE>changeProgram(p, "bbb");<NEW_LINE>checkinComment = "Version 3";<NEW_LINE>keepCheckedOut = true;<NEW_LINE>assertTrue(df.canCheckin());<NEW_LINE>df.checkin(this, false, null);<NEW_LINE>p.release(this);<NEW_LINE>performAction("Open File", "ProgramManagerPlugin", false);<NEW_LINE>final OpenVersionedFileDialog dialog = (OpenVersionedFileDialog) getDialog();<NEW_LINE>waitForSwing();<NEW_LINE>Object treePanel = getInstanceField("treePanel", dialog);<NEW_LINE>final GTree tree = (GTree) getInstanceField("tree", treePanel);<NEW_LINE>GTreeNode rootNode = tree.getViewRoot();<NEW_LINE>GTreeNode child = rootNode.getChild(0);<NEW_LINE>tree.setSelectedNode(child);<NEW_LINE>assertNotNull(dialog);<NEW_LINE>runSwing(() <MASK><NEW_LINE>captureDialog(850, 400);<NEW_LINE>closeAllWindowsAndFrames();<NEW_LINE>} | -> invokeInstanceMethod("advancedButtonCallback", dialog)); |
308,540 | public void startMonitoring() {<NEW_LINE><MASK><NEW_LINE>log.debug("File name obtained from pathOfFileToWatch is [{}]", fileName);<NEW_LINE>if (fileName == null) {<NEW_LINE>throw new IllegalStateException("fileName is 'null'");<NEW_LINE>}<NEW_LINE>Path dirPath = pathOfFileToWatch.getParent();<NEW_LINE>log.debug("dirPath is [{}]", dirPath);<NEW_LINE>if (dirPath == null) {<NEW_LINE>throw new IllegalStateException("The directory containing the file turned out to be 'null`");<NEW_LINE>}<NEW_LINE>FileAlterationObserver observer = new FileAlterationObserver(dirPath.toString(), new FileFilter() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean accept(File file) {<NEW_LINE>if (file == null || file.getName() == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>return file.getName().equals(fileName.toString());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>FileAlterationListener listener = new FileAlterationListenerAdaptor() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onFileChange(File file) {<NEW_LINE>log.info("Detected that the file [{}] has modified", file.getPath());<NEW_LINE>callback.accept(file);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>observer.addListener(listener);<NEW_LINE>monitor.addObserver(observer);<NEW_LINE>try {<NEW_LINE>monitor.start();<NEW_LINE>log.info("Done setting up file modification monitor for file [{}]", this.pathOfFileToWatch);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>} | Path fileName = pathOfFileToWatch.getFileName(); |
1,615,825 | private static boolean optionMatches(BuildOptionDetails options, String optionName, Object expectedValue) {<NEW_LINE>Object <MASK><NEW_LINE>if (actualValue == null) {<NEW_LINE>return expectedValue == null;<NEW_LINE>// Single-value case:<NEW_LINE>} else if (!options.allowsMultipleValues(optionName)) {<NEW_LINE>return actualValue.equals(expectedValue);<NEW_LINE>}<NEW_LINE>// Multi-value case:<NEW_LINE>Preconditions.checkState(actualValue instanceof List);<NEW_LINE>Preconditions.checkState(expectedValue instanceof List);<NEW_LINE>List<?> actualList = (List<?>) actualValue;<NEW_LINE>List<?> expectedList = (List<?>) expectedValue;<NEW_LINE>if (actualList.isEmpty() || expectedList.isEmpty()) {<NEW_LINE>return actualList.isEmpty() && expectedList.isEmpty();<NEW_LINE>}<NEW_LINE>// Multi-value map:<NEW_LINE>if (actualList.get(0) instanceof Map.Entry) {<NEW_LINE>// The config_setting's expected value *must* be a single map entry (see method comments).<NEW_LINE>Object expectedListValue = Iterables.getOnlyElement(expectedList);<NEW_LINE>Map.Entry<?, ?> expectedEntry = (Map.Entry<?, ?>) expectedListValue;<NEW_LINE>for (Object elem : Lists.reverse(actualList)) {<NEW_LINE>Map.Entry<?, ?> actualEntry = (Map.Entry<?, ?>) elem;<NEW_LINE>if (actualEntry.getKey().equals(expectedEntry.getKey())) {<NEW_LINE>// Found a key match!<NEW_LINE>return actualEntry.getValue().equals(expectedEntry.getValue());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// Multi-value list:<NEW_LINE>return actualList.containsAll(expectedList);<NEW_LINE>} | actualValue = options.getOptionValue(optionName); |
1,361,238 | static Optional<String> longestCommonPath(List<ApiDescription> apiDescriptions) {<NEW_LINE>List<String> commons = new ArrayList<>();<NEW_LINE>if (null == apiDescriptions || apiDescriptions.isEmpty()) {<NEW_LINE>return empty();<NEW_LINE>}<NEW_LINE>List<String> firstWords = urlParts(apiDescriptions.get(0));<NEW_LINE>for (int position = 0; position < firstWords.size(); position++) {<NEW_LINE>String word = firstWords.get(position);<NEW_LINE>boolean allContain = true;<NEW_LINE>for (int i = 1; i < apiDescriptions.size(); i++) {<NEW_LINE>List<String> words = urlParts<MASK><NEW_LINE>if (words.size() < position + 1 || !words.get(position).equals(word)) {<NEW_LINE>allContain = false;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (allContain) {<NEW_LINE>commons.add(word);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return of("/" + commons.stream().filter(Objects::nonNull).collect(joining("/")));<NEW_LINE>} | (apiDescriptions.get(i)); |
506,860 | private Mono<PagedResponse<JitNetworkAccessPolicyInner>> listSinglePageAsync() {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>final String apiVersion = "2020-01-01";<NEW_LINE>final String accept = "application/json";<NEW_LINE>return FluxUtil.withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, accept, context)).<PagedResponse<JitNetworkAccessPolicyInner>>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)).contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));<NEW_LINE>} | error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); |
1,143,235 | protected Street readIntersectedStreet(City c, int street24X, int street24Y, List<String> additionalTagsTable) throws IOException {<NEW_LINE>int x = 0;<NEW_LINE>int y = 0;<NEW_LINE>Street s = new Street(c);<NEW_LINE>LinkedList<String> additionalTags = null;<NEW_LINE>while (true) {<NEW_LINE>int t = codedIS.readTag();<NEW_LINE>int tag = WireFormat.getTagFieldNumber(t);<NEW_LINE>switch(tag) {<NEW_LINE>case 0:<NEW_LINE>s.setLocation(MapUtils.getLatitudeFromTile(24, y), MapUtils.getLongitudeFromTile(24, x));<NEW_LINE>return s;<NEW_LINE>case OsmandOdb.BuildingIndex.ID_FIELD_NUMBER:<NEW_LINE>s.setId(codedIS.readUInt64());<NEW_LINE>break;<NEW_LINE>case OsmandOdb.StreetIntersection.NAME_EN_FIELD_NUMBER:<NEW_LINE>s.setEnName(codedIS.readString());<NEW_LINE>break;<NEW_LINE>case OsmandOdb.StreetIntersection.NAME_FIELD_NUMBER:<NEW_LINE>s.setName(codedIS.readString());<NEW_LINE>break;<NEW_LINE>case OsmandOdb.StreetIntersection.ATTRIBUTETAGIDS_FIELD_NUMBER:<NEW_LINE>int tgid = codedIS.readUInt32();<NEW_LINE>if (additionalTags == null) {<NEW_LINE>additionalTags = new LinkedList<String>();<NEW_LINE>}<NEW_LINE>if (additionalTagsTable != null && tgid < additionalTagsTable.size()) {<NEW_LINE>additionalTags.add(additionalTagsTable.get(tgid));<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case OsmandOdb.StreetIntersection.ATTRIBUTEVALUES_FIELD_NUMBER:<NEW_LINE>String nm = codedIS.readString();<NEW_LINE>if (additionalTags != null && additionalTags.size() > 0) {<NEW_LINE>String tg = additionalTags.pollFirst();<NEW_LINE>if (tg.startsWith("name:")) {<NEW_LINE>s.setName(tg.substring("name:"<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case OsmandOdb.StreetIntersection.INTERSECTEDX_FIELD_NUMBER:<NEW_LINE>x = codedIS.readSInt32() + street24X;<NEW_LINE>break;<NEW_LINE>case OsmandOdb.StreetIntersection.INTERSECTEDY_FIELD_NUMBER:<NEW_LINE>y = codedIS.readSInt32() + street24Y;<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>skipUnknownField(t);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | .length()), nm); |
436,886 | final ListDataSourcesResult executeListDataSources(ListDataSourcesRequest listDataSourcesRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listDataSourcesRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListDataSourcesRequest> request = null;<NEW_LINE>Response<ListDataSourcesResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListDataSourcesRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listDataSourcesRequest));<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, "QuickSight");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListDataSources");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListDataSourcesResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListDataSourcesResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} | endClientExecution(awsRequestMetrics, request, response); |
1,062,293 | final UpdateUserPoolDomainResult executeUpdateUserPoolDomain(UpdateUserPoolDomainRequest updateUserPoolDomainRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateUserPoolDomainRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateUserPoolDomainRequest> request = null;<NEW_LINE>Response<UpdateUserPoolDomainResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateUserPoolDomainRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateUserPoolDomainRequest));<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, "UpdateUserPoolDomain");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateUserPoolDomainResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateUserPoolDomainResultJsonUnmarshaller());<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, "Cognito Identity Provider"); |
857,698 | public int onBackPressed() {<NEW_LINE>logDebug("onBackPressed");<NEW_LINE>if (selectFile) {<NEW_LINE>if (((FileExplorerActivity) context).isMultiselect()) {<NEW_LINE>if (adapter.isMultipleSelect()) {<NEW_LINE>hideMultipleSelect();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>MegaNode parentNode = megaApi.getParentNode(megaApi.getNodeByHandle(parentHandle));<NEW_LINE>if (parentNode != null) {<NEW_LINE>if (modeCloud == FileExplorerActivity.SELECT) {<NEW_LINE>activateButton(shouldShowOptionsBar(parentNode));<NEW_LINE>}<NEW_LINE>setParentHandle(parentNode.getHandle());<NEW_LINE>if (parentNode.getType() == MegaNode.TYPE_ROOT) {<NEW_LINE>((FileExplorerActivity) context).hideTabs(false, CLOUD_FRAGMENT);<NEW_LINE>}<NEW_LINE>((FileExplorerActivity) context).changeTitle();<NEW_LINE>if ((modeCloud == FileExplorerActivity.MOVE) || (modeCloud == FileExplorerActivity.COPY)) {<NEW_LINE>MegaNode parent = ((FileExplorerActivity) context).parentMoveCopy();<NEW_LINE>if (parent != null) {<NEW_LINE>activateButton(parent.getHandle() != parentNode.getHandle());<NEW_LINE>} else {<NEW_LINE>activateButton(true);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>recyclerView.setVisibility(View.VISIBLE);<NEW_LINE><MASK><NEW_LINE>emptyTextView.setVisibility(View.GONE);<NEW_LINE>setNodes(megaApi.getChildren(parentNode, order));<NEW_LINE>int lastVisiblePosition = 0;<NEW_LINE>if (!lastPositionStack.empty()) {<NEW_LINE>lastVisiblePosition = lastPositionStack.pop();<NEW_LINE>logDebug("Pop of the stack " + lastVisiblePosition + " position");<NEW_LINE>}<NEW_LINE>logDebug("Scroll to " + lastVisiblePosition + " position");<NEW_LINE>if (lastVisiblePosition >= 0) {<NEW_LINE>if (((FileExplorerActivity) context).isList()) {<NEW_LINE>mLayoutManager.scrollToPositionWithOffset(lastVisiblePosition, 0);<NEW_LINE>} else {<NEW_LINE>gridLayoutManager.scrollToPositionWithOffset(lastVisiblePosition, 0);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return 2;<NEW_LINE>} else {<NEW_LINE>return 0;<NEW_LINE>}<NEW_LINE>} | emptyImageView.setVisibility(View.GONE); |
939,798 | public String serialize(int numberOfSpacesToIndent, HttpRequestModifier request) {<NEW_LINE>StringBuffer output = new StringBuffer();<NEW_LINE>if (request != null) {<NEW_LINE>appendNewLineAndIndent(numberOfSpacesToIndent * INDENT_SIZE, output);<NEW_LINE>output.append("requestModifier()");<NEW_LINE>if (request.getPath() != null) {<NEW_LINE>appendNewLineAndIndent((numberOfSpacesToIndent + 1) * INDENT_SIZE, output);<NEW_LINE>output.append(".withPath(\"").append(request.getPath().getRegex()).append("\",\"").append(request.getPath().getSubstitution()).append("\")");<NEW_LINE>}<NEW_LINE>if (request.getQueryStringParameters() != null) {<NEW_LINE>appendNewLineAndIndent((numberOfSpacesToIndent + 1) * INDENT_SIZE, output).append(".withQueryStringParameters(");<NEW_LINE>outputQueryStringParameters(numberOfSpacesToIndent, output, request.getQueryStringParameters().getAdd());<NEW_LINE>outputQueryStringParameters(numberOfSpacesToIndent, output, request.getQueryStringParameters().getReplace());<NEW_LINE>outputList(numberOfSpacesToIndent, output, request.getQueryStringParameters().getRemove());<NEW_LINE>appendNewLineAndIndent((numberOfSpacesToIndent + 1) * INDENT_SIZE, output).append(")");<NEW_LINE>}<NEW_LINE>if (request.getHeaders() != null) {<NEW_LINE>appendNewLineAndIndent((numberOfSpacesToIndent + 1) * INDENT_SIZE, output).append(".withHeaders(");<NEW_LINE>outputHeaders(numberOfSpacesToIndent, output, request.getHeaders().getAdd());<NEW_LINE>outputHeaders(numberOfSpacesToIndent, output, request.getHeaders().getReplace());<NEW_LINE>outputList(numberOfSpacesToIndent, output, request.getHeaders().getRemove());<NEW_LINE>appendNewLineAndIndent((numberOfSpacesToIndent + 1) * INDENT_SIZE, output).append(")");<NEW_LINE>}<NEW_LINE>if (request.getCookies() != null) {<NEW_LINE>appendNewLineAndIndent((numberOfSpacesToIndent + 1) * INDENT_SIZE, output).append(".withCookies(");<NEW_LINE>outputCookies(numberOfSpacesToIndent, output, request.<MASK><NEW_LINE>outputCookies(numberOfSpacesToIndent, output, request.getCookies().getReplace());<NEW_LINE>outputList(numberOfSpacesToIndent, output, request.getCookies().getRemove());<NEW_LINE>appendNewLineAndIndent((numberOfSpacesToIndent + 1) * INDENT_SIZE, output).append(")");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return output.toString();<NEW_LINE>} | getCookies().getAdd()); |
1,007,964 | private static void writeInt(byte[] b, int startPos, int x, int size) {<NEW_LINE>long v = Integer.toUnsignedLong(x);<NEW_LINE>switch(size) {<NEW_LINE>case 1:<NEW_LINE>b[startPos + 0] = (byte) (x);<NEW_LINE>break;<NEW_LINE>case 2:<NEW_LINE>b[startPos + 0] = (byte) (v >> 8);<NEW_LINE>b[startPos + 1] = (byte) (v);<NEW_LINE>break;<NEW_LINE>case 3:<NEW_LINE>b[startPos + 0] = (<MASK><NEW_LINE>b[startPos + 1] = (byte) (v >> 8);<NEW_LINE>b[startPos + 2] = (byte) (v);<NEW_LINE>break;<NEW_LINE>case 4:<NEW_LINE>default:<NEW_LINE>b[startPos + 0] = (byte) (v >> 24);<NEW_LINE>b[startPos + 1] = (byte) (v >> 16);<NEW_LINE>b[startPos + 2] = (byte) (v >> 8);<NEW_LINE>b[startPos + 3] = (byte) (v);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>} | byte) (v >> 16); |
1,358,946 | private int forwardMedia(data.media.Media media, FlatBufferBuilder fbb) {<NEW_LINE>int uri = fbb.createString(media.uri);<NEW_LINE>int title = media.title != null ? fbb.createString(media.title) : 0;<NEW_LINE>int format = fbb.createString(media.format);<NEW_LINE>int[] persons = new int[media.persons.size()];<NEW_LINE>for (int i = 0; i < media.persons.size(); i++) {<NEW_LINE>persons[i] = fbb.createString(media.persons.get(i));<NEW_LINE>}<NEW_LINE>int person = Media.createPersonsVector(fbb, persons);<NEW_LINE>byte player = forwardPlayer(media.player);<NEW_LINE>int copyright = media.copyright != null ? fbb.<MASK><NEW_LINE>return Media.createMedia(fbb, uri, title, media.width, media.height, format, media.duration, media.size, media.bitrate, person, player, copyright);<NEW_LINE>} | createString(media.copyright) : 0; |
867,492 | public Set<FileObject> extend(PhpModule phpModule) throws ExtendingException {<NEW_LINE>try {<NEW_LINE>unpackSkeleton(phpModule);<NEW_LINE>} catch (IOException ex) {<NEW_LINE>LOGGER.log(Level.INFO, "Cannot unpack Zend Application Skeleton.", ex);<NEW_LINE>throw new ExtendingException(Bundle.Zend2PhpModuleExtender_not_extended(), ex);<NEW_LINE>}<NEW_LINE>// install framework via composer<NEW_LINE>try {<NEW_LINE>Composer.getDefault().install(phpModule).get();<NEW_LINE>} catch (InvalidPhpExecutableException ex) {<NEW_LINE>assert false : "Should not happen since Composer is validated in the wizard panel";<NEW_LINE>LOGGER.log(Level.INFO, "Composer is not valid so no install cannot be done.", ex);<NEW_LINE>} catch (InterruptedException ex) {<NEW_LINE>Thread.currentThread().interrupt();<NEW_LINE>} catch (ExecutionException ex) {<NEW_LINE>UiUtils.<MASK><NEW_LINE>}<NEW_LINE>return getInitialFiles(phpModule);<NEW_LINE>} | processExecutionException(ex, Zend2OptionsPanelController.OPTIONS_SUBPATH); |
723,705 | public Sql[] generateSql(SetTableRemarksStatement statement, Database database, SqlGeneratorChain sqlGeneratorChain) {<NEW_LINE>String sql;<NEW_LINE>String remarksEscaped = database.escapeStringForDatabase(StringUtil.trimToEmpty(statement.getRemarks()));<NEW_LINE>if (database instanceof MySQLDatabase) {<NEW_LINE>sql = "ALTER TABLE " + database.escapeTableName(statement.getCatalogName(), statement.getSchemaName(), statement.getTableName()) + " COMMENT = '" + remarksEscaped + "'";<NEW_LINE>} else if (database instanceof MSSQLDatabase) {<NEW_LINE>String schemaName = statement.getSchemaName();<NEW_LINE>if (schemaName == null) {<NEW_LINE>schemaName = database.getDefaultSchemaName();<NEW_LINE>}<NEW_LINE>if (schemaName == null) {<NEW_LINE>schemaName = "dbo";<NEW_LINE>}<NEW_LINE>sql = "DECLARE @TableName SYSNAME " + "set @TableName = N'" + statement.getTableName() + "'; " + "DECLARE @FullTableName SYSNAME; " + "SET @FullTableName = N'" + schemaName + "." + statement.getTableName() + "';" + "DECLARE @MS_DescriptionValue NVARCHAR(3749); " + "SET @MS_DescriptionValue = N'" + remarksEscaped + "';" + "DECLARE @MS_Description NVARCHAR(3749) " + "set @MS_Description = NULL; " + "SET @MS_Description = (SELECT CAST(Value AS NVARCHAR(3749)) AS [MS_Description] " + "FROM sys.extended_properties AS ep " + "WHERE ep.major_id = OBJECT_ID(@FullTableName) " + "AND ep.name = N'MS_Description' AND ep.minor_id=0); " + "IF @MS_Description IS NULL " + "BEGIN " + "EXEC sys.sp_addextendedproperty " + "@name = N'MS_Description', " + "@value = @MS_DescriptionValue, " + "@level0type = N'SCHEMA', " + "@level0name = N'" + schemaName + "', " + "@level1type = N'TABLE', " + "@level1name = @TableName; " + "END " + "ELSE " + "BEGIN " + "EXEC sys.sp_updateextendedproperty " + "@name = N'MS_Description', " + "@value = @MS_DescriptionValue, " + "@level0type = N'SCHEMA', " + "@level0name = N'" + schemaName + "', " + "@level1type = N'TABLE', " + "@level1name = @TableName; " + "END";<NEW_LINE>} else {<NEW_LINE>sql = "COMMENT ON TABLE " + database.escapeTableName(statement.getCatalogName(), statement.getSchemaName(), statement.getTableName(<MASK><NEW_LINE>}<NEW_LINE>return new Sql[] { new UnparsedSql(sql, getAffectedTable(statement)) };<NEW_LINE>} | )) + " IS '" + remarksEscaped + "'"; |
1,057,719 | public void saveXml(StringBuilder buffer, PcodeInjectLibrary injectLibrary) {<NEW_LINE>if (compatModel != null) {<NEW_LINE>buffer.append("<modelalias");<NEW_LINE>SpecXmlUtils.encodeStringAttribute(buffer, "name", name);<NEW_LINE>SpecXmlUtils.encodeStringAttribute(buffer, "parent", compatModel.name);<NEW_LINE>buffer.append("/>\n");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>buffer.append("<prototype");<NEW_LINE>SpecXmlUtils.encodeStringAttribute(buffer, "name", name);<NEW_LINE>if (extrapop != PrototypeModel.UNKNOWN_EXTRAPOP) {<NEW_LINE>SpecXmlUtils.encodeSignedIntegerAttribute(buffer, "extrapop", extrapop);<NEW_LINE>} else {<NEW_LINE>SpecXmlUtils.encodeStringAttribute(buffer, "extrapop", "unknown");<NEW_LINE>}<NEW_LINE>SpecXmlUtils.encodeSignedIntegerAttribute(buffer, "stackshift", stackshift);<NEW_LINE>GenericCallingConvention nameType = GenericCallingConvention.guessFromName(name);<NEW_LINE>if (nameType != genericCallingConvention) {<NEW_LINE>SpecXmlUtils.encodeStringAttribute(buffer, <MASK><NEW_LINE>}<NEW_LINE>if (hasThis) {<NEW_LINE>SpecXmlUtils.encodeStringAttribute(buffer, "hasthis", "yes");<NEW_LINE>}<NEW_LINE>if (isConstruct) {<NEW_LINE>SpecXmlUtils.encodeStringAttribute(buffer, "constructor", "yes");<NEW_LINE>}<NEW_LINE>if (inputListType != InputListType.STANDARD) {<NEW_LINE>SpecXmlUtils.encodeStringAttribute(buffer, "strategy", "register");<NEW_LINE>}<NEW_LINE>buffer.append(">\n");<NEW_LINE>inputParams.saveXml(buffer, true);<NEW_LINE>buffer.append('\n');<NEW_LINE>outputParams.saveXml(buffer, false);<NEW_LINE>buffer.append('\n');<NEW_LINE>if (hasUponEntry || hasUponReturn) {<NEW_LINE>InjectPayload payload = injectLibrary.getPayload(InjectPayload.CALLMECHANISM_TYPE, getInjectName());<NEW_LINE>payload.saveXml(buffer);<NEW_LINE>}<NEW_LINE>if (unaffected != null) {<NEW_LINE>buffer.append("<unaffected>\n");<NEW_LINE>writeVarnodes(buffer, unaffected);<NEW_LINE>buffer.append("</unaffected>\n");<NEW_LINE>}<NEW_LINE>if (killedbycall != null) {<NEW_LINE>buffer.append("<killedbycall>\n");<NEW_LINE>writeVarnodes(buffer, killedbycall);<NEW_LINE>buffer.append("</killedbycall>\n");<NEW_LINE>}<NEW_LINE>if (likelytrash != null) {<NEW_LINE>buffer.append("<likelytrash>\n");<NEW_LINE>writeVarnodes(buffer, likelytrash);<NEW_LINE>buffer.append("</likelytrash>\n");<NEW_LINE>}<NEW_LINE>if (returnaddress != null) {<NEW_LINE>buffer.append("<returnaddress>\n");<NEW_LINE>writeVarnodes(buffer, returnaddress);<NEW_LINE>buffer.append("</returnaddress>\n");<NEW_LINE>}<NEW_LINE>if (localRange != null && !localRange.isEmpty()) {<NEW_LINE>buffer.append("<localrange>\n");<NEW_LINE>writeAddressSet(buffer, localRange);<NEW_LINE>buffer.append("</localrange>\n");<NEW_LINE>}<NEW_LINE>if (paramRange != null && !paramRange.isEmpty()) {<NEW_LINE>buffer.append("<paramrange>\n");<NEW_LINE>writeAddressSet(buffer, paramRange);<NEW_LINE>buffer.append("</paramrange>\n");<NEW_LINE>}<NEW_LINE>buffer.append("</prototype>\n");<NEW_LINE>} | "type", genericCallingConvention.getDeclarationName()); |
343,919 | public OutlierResult autorun(Database database) {<NEW_LINE>DBIDs ids = database.getRelation(TypeUtil.ANY).getDBIDs();<NEW_LINE>// Run the primary algorithm<NEW_LINE>Clustering<? extends SubspaceModel> clustering = clusteralg.autorun(database);<NEW_LINE>WritableDoubleDataStore score = DataStoreUtil.makeDoubleStorage(ids, DataStoreFactory.HINT_HOT);<NEW_LINE>for (DBIDIter iter = ids.iter(); iter.valid(); iter.advance()) {<NEW_LINE>score.putDouble(iter, 0);<NEW_LINE>}<NEW_LINE>int maxdim = 0, maxsize = 0;<NEW_LINE>// Find maximum dimensionality and cluster size<NEW_LINE>for (Cluster<? extends SubspaceModel> cluster : clustering.getAllClusters()) {<NEW_LINE>maxsize = Math.max(maxsize, cluster.size());<NEW_LINE>maxdim = Math.max(maxdim, BitsUtil.cardinality(cluster.getModel().getDimensions()));<NEW_LINE>}<NEW_LINE>// Iterate over all clusters:<NEW_LINE>DoubleMinMax minmax = new DoubleMinMax();<NEW_LINE>for (Cluster<? extends SubspaceModel> cluster : clustering.getAllClusters()) {<NEW_LINE>double relsize = cluster.size() / (double) maxsize;<NEW_LINE>double reldim = BitsUtil.cardinality(cluster.getModel().getDimensions()) / (double) maxdim;<NEW_LINE>// Process objects in the cluster<NEW_LINE>for (DBIDIter iter = cluster.getIDs().iter(); iter.valid(); iter.advance()) {<NEW_LINE>double newscore = score.doubleValue(iter) + alpha * relsize + (1 - alpha) * reldim;<NEW_LINE>score.putDouble(iter, newscore);<NEW_LINE>minmax.put(newscore);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>DoubleRelation scoreResult = new MaterializedDoubleRelation("OutRank-S1", ids, score);<NEW_LINE>OutlierScoreMeta meta = new InvertedOutlierScoreMeta(minmax.getMin(), minmax.getMax(<MASK><NEW_LINE>OutlierResult res = new OutlierResult(meta, scoreResult);<NEW_LINE>Metadata.hierarchyOf(res).addChild(clustering);<NEW_LINE>return res;<NEW_LINE>} | ), 0, Double.POSITIVE_INFINITY); |
75,017 | private void sendBatch(String dataStructureName, List<Integer> memberPartitions, List<MergingItem>[] entriesPerPartition, SplitBrainMergePolicy<V, MergingItem, Object> mergePolicy) {<NEW_LINE>int size = memberPartitions.size();<NEW_LINE>int[] partitions = new int[size];<NEW_LINE>int index = 0;<NEW_LINE>for (Integer partitionId : memberPartitions) {<NEW_LINE>if (entriesPerPartition[partitionId] != null) {<NEW_LINE>partitions[index++] = partitionId;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (index == 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// trim partition array to real size<NEW_LINE>if (index < size) {<NEW_LINE>partitions = <MASK><NEW_LINE>size = index;<NEW_LINE>}<NEW_LINE>// noinspection unchecked<NEW_LINE>List<MergingItem>[] entries = new List[size];<NEW_LINE>index = 0;<NEW_LINE>int totalSize = 0;<NEW_LINE>for (int partitionId : partitions) {<NEW_LINE>int batchSize = entriesPerPartition[partitionId].size();<NEW_LINE>entries[index++] = entriesPerPartition[partitionId];<NEW_LINE>totalSize += batchSize;<NEW_LINE>entriesPerPartition[partitionId] = null;<NEW_LINE>}<NEW_LINE>if (totalSize == 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>sendMergingData(dataStructureName, mergePolicy, partitions, entries, totalSize);<NEW_LINE>} | Arrays.copyOf(partitions, index); |
180,965 | ActionResult<Wo> execute(EffectivePerson effectivePerson, String flag, String appInfoFlag) throws Exception {<NEW_LINE>try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {<NEW_LINE>ActionResult<Wo> result = new ActionResult<>();<NEW_LINE>Wo wo = null;<NEW_LINE>Cache.CacheKey cacheKey = new Cache.CacheKey(this.getClass(), flag, appInfoFlag);<NEW_LINE>Optional<?> optional = CacheManager.get(cacheCategory, cacheKey);<NEW_LINE>if (optional.isPresent()) {<NEW_LINE>wo = ((Wo) optional.get());<NEW_LINE>} else {<NEW_LINE>Business business = new Business(emc);<NEW_LINE>AppInfo appInfo = business.getAppInfoFactory().pick(appInfoFlag);<NEW_LINE>if (null == appInfo) {<NEW_LINE>throw new ExceptionEntityNotExist(appInfoFlag, AppInfo.class);<NEW_LINE>}<NEW_LINE>String id = this.get(business, appInfo, flag);<NEW_LINE>if (StringUtils.isEmpty(id)) {<NEW_LINE>throw new ExceptionEntityNotExist(flag, File.class);<NEW_LINE>}<NEW_LINE>File file = business.fileFactory().pick(id);<NEW_LINE>byte[] <MASK><NEW_LINE>if (StringUtils.isNotEmpty(file.getData())) {<NEW_LINE>bs = Base64.decodeBase64(file.getData());<NEW_LINE>}<NEW_LINE>wo = new Wo(bs, this.contentType(true, file.getFileName()), this.contentDisposition(true, file.getFileName()));<NEW_LINE>CacheManager.put(cacheCategory, cacheKey, wo);<NEW_LINE>}<NEW_LINE>result.setData(wo);<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>} | bs = new byte[] {}; |
1,507,645 | public Attribute unmarshall(StaxUnmarshallerContext context) throws Exception {<NEW_LINE>Attribute attribute = new Attribute();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>if (context.isStartOfDocument())<NEW_LINE>targetDepth += 1;<NEW_LINE>while (true) {<NEW_LINE>XMLEvent xmlEvent = context.nextEvent();<NEW_LINE>if (xmlEvent.isEndDocument())<NEW_LINE>return attribute;<NEW_LINE>if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) {<NEW_LINE>if (context.testExpression("Name", targetDepth)) {<NEW_LINE>attribute.setName(StringStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("Name/@encoding", targetDepth)) {<NEW_LINE>attribute.setAlternateNameEncoding(StringStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("Value", targetDepth)) {<NEW_LINE>attribute.setValue(StringStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("Value/@encoding", targetDepth)) {<NEW_LINE>attribute.setAlternateValueEncoding(StringStaxUnmarshaller.getInstance<MASK><NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>} else if (xmlEvent.isEndElement()) {<NEW_LINE>if (context.getCurrentDepth() < originalDepth) {<NEW_LINE>return attribute;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ().unmarshall(context)); |
20,348 | final ListRecordsResult executeListRecords(ListRecordsRequest listRecordsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listRecordsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListRecordsRequest> request = null;<NEW_LINE>Response<ListRecordsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListRecordsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listRecordsRequest));<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, "Cognito Sync");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListRecords");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListRecordsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListRecordsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} | endClientExecution(awsRequestMetrics, request, response); |
1,224,326 | public void zoomColumn(String columnId) {<NEW_LINE>double rightTargetSize;<NEW_LINE>ArrayList<Double> <MASK><NEW_LINE>String currentZoomedColumn = getZoomedColumn();<NEW_LINE>boolean unZooming = false;<NEW_LINE>if (StringUtil.equals(currentZoomedColumn, columnId)) {<NEW_LINE>if (widgetSizePriorToZoom_ < 0 || (leftWidgetSizePriorToZoom_.size() != additionalSourceCount_)) {<NEW_LINE>// no prior position to restore to, just show defaults<NEW_LINE>restoreColumnLayout();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>rightTargetSize = widgetSizePriorToZoom_;<NEW_LINE>for (Double s : leftWidgetSizePriorToZoom_) leftTargetSize.add(s);<NEW_LINE>unZooming = true;<NEW_LINE>} else if (StringUtil.equals(columnId, LEFT_COLUMN)) {<NEW_LINE>rightTargetSize = 0.0;<NEW_LINE>} else if (StringUtil.equals(columnId, RIGHT_COLUMN)) {<NEW_LINE>rightTargetSize = panel_.getOffsetWidth();<NEW_LINE>} else {<NEW_LINE>Debug.logWarning("Unexpected column identifier: " + columnId);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Currently we cannot zoom on left widgets<NEW_LINE>if (!unZooming) {<NEW_LINE>for (int i = 0; i < leftList_.size(); i++) leftTargetSize.add(0.0);<NEW_LINE>}<NEW_LINE>if (rightTargetSize < 0)<NEW_LINE>rightTargetSize = 0.0;<NEW_LINE>for (int i = 0; i < leftTargetSize.size(); i++) {<NEW_LINE>if (leftTargetSize.get(i) < 0)<NEW_LINE>leftTargetSize.set(i, 0.0);<NEW_LINE>}<NEW_LINE>if (unZooming) {<NEW_LINE>widgetSizePriorToZoom_ = -1;<NEW_LINE>leftWidgetSizePriorToZoom_.clear();<NEW_LINE>} else {<NEW_LINE>if (widgetSizePriorToZoom_ < 0)<NEW_LINE>widgetSizePriorToZoom_ = panel_.getWidgetSize(right_);<NEW_LINE>if (leftWidgetSizePriorToZoom_.size() != leftList_.size()) {<NEW_LINE>for (Widget w : leftList_) leftWidgetSizePriorToZoom_.add(panel_.getWidgetSize(w));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>resizeHorizontally(rightTargetSize, leftTargetSize, () -> manageLayoutCommands());<NEW_LINE>} | leftTargetSize = new ArrayList<>(); |
1,427,670 | public static void registerType(final ModelBuilder modelBuilder) {<NEW_LINE>final ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(LinkEventDefinition.class, BPMN_ELEMENT_LINK_EVENT_DEFINITION).namespaceUri(BPMN20_NS).extendsType(EventDefinition.class).instanceProvider(new ModelTypeInstanceProvider<LinkEventDefinition>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public LinkEventDefinition newInstance(final ModelTypeInstanceContext instanceContext) {<NEW_LINE>return new LinkEventDefinitionImpl(instanceContext);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>nameAttribute = typeBuilder.stringAttribute(BPMN_ATTRIBUTE_NAME).required().build();<NEW_LINE>final SequenceBuilder sequenceBuilder = typeBuilder.sequence();<NEW_LINE>sourceCollection = sequenceBuilder.elementCollection(Source.class).qNameElementReferenceCollection(LinkEventDefinition.class).build();<NEW_LINE>targetChild = sequenceBuilder.element(Target.class).qNameElementReference(<MASK><NEW_LINE>typeBuilder.build();<NEW_LINE>} | LinkEventDefinition.class).build(); |
329,891 | private List<String> checkOfflineTablesSegmentIntervals(String offlineTableName) {<NEW_LINE>TableConfig tableConfig = ZKMetadataProvider.getOfflineTableConfig(_propertyStore, offlineTableName);<NEW_LINE>List<SegmentZKMetadata> segmentsZKMetadata = ZKMetadataProvider.getSegmentsZKMetadata(_propertyStore, offlineTableName);<NEW_LINE>// Collect segments with invalid start/end time<NEW_LINE>List<String> segmentsWithInvalidIntervals = new ArrayList<>();<NEW_LINE>if (SegmentIntervalUtils.eligibleForSegmentIntervalCheck(tableConfig.getValidationConfig())) {<NEW_LINE>for (SegmentZKMetadata segmentZKMetadata : segmentsZKMetadata) {<NEW_LINE><MASK><NEW_LINE>long endTimeMs = segmentZKMetadata.getEndTimeMs();<NEW_LINE>if (!TimeUtils.timeValueInValidRange(startTimeMs) || !TimeUtils.timeValueInValidRange(endTimeMs)) {<NEW_LINE>segmentsWithInvalidIntervals.add(segmentZKMetadata.getSegmentName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return segmentsWithInvalidIntervals;<NEW_LINE>} | long startTimeMs = segmentZKMetadata.getStartTimeMs(); |
172,574 | public int classifyPathObjects(Collection<PathObject> pathObjects) {<NEW_LINE>int counter = 0;<NEW_LINE>// PathClass classPositive = PathClassFactory.getDefaultPathClass(PathClassFactory.PathClasses.POSITIVE);<NEW_LINE>// PathClass classNegative = PathClassFactory.getDefaultPathClass(PathClassFactory.PathClasses.NEGATIVE);<NEW_LINE>// PathClass classOnePlus = PathClassFactory.getDefaultPathClass(PathClassFactory.PathClasses.ONE_PLUS);<NEW_LINE>// PathClass classTwoPlus = PathClassFactory.getDefaultPathClass(PathClassFactory.PathClasses.TWO_PLUS);<NEW_LINE>// PathClass classThreePlus = PathClassFactory.getDefaultPathClass(PathClassFactory.PathClasses.THREE_PLUS);<NEW_LINE>// If there is no class specified, apply to all<NEW_LINE>if (classSelected == null) {<NEW_LINE>if (singleThreshold)<NEW_LINE>PathClassifierTools.<MASK><NEW_LINE>else<NEW_LINE>PathClassifierTools.setIntensityClassifications(pathObjects, intensityMeasurement, t1, t2, t3);<NEW_LINE>return pathObjects.size();<NEW_LINE>}<NEW_LINE>// Ensure we have the correct singleton class so we can do an equality check<NEW_LINE>classSelected = PathClassFactory.getSingletonPathClass(classSelected);<NEW_LINE>PathClass classPositive = PathClassFactory.getPositive(classSelected);<NEW_LINE>PathClass classNegative = PathClassFactory.getNegative(classSelected);<NEW_LINE>PathClass classOnePlus = PathClassFactory.getOnePlus(classSelected);<NEW_LINE>PathClass classTwoPlus = PathClassFactory.getTwoPlus(classSelected);<NEW_LINE>PathClass classThreePlus = PathClassFactory.getThreePlus(classSelected);<NEW_LINE>// Because the classifications are really sub-classifications, retain the same probability<NEW_LINE>for (PathObject pathObjectTemp : pathObjects) {<NEW_LINE>if (classSelected == null || pathObjectTemp.getPathClass() == null || !(pathObjectTemp.getPathClass().isDerivedFrom(classSelected) || pathObjectTemp.getPathClass().getName().equals(classSelected.getName())))<NEW_LINE>// if (classSelected == null || pathObjectTemp.getPathClass() == null || !pathObjectTemp.getPathClass().getName().equals(classSelected.getName()))<NEW_LINE>continue;<NEW_LINE>Object value = pathObjectTemp.getMeasurementList().getMeasurementValue(intensityMeasurement);<NEW_LINE>if (!(value instanceof Number))<NEW_LINE>continue;<NEW_LINE>double val = ((Number) value).doubleValue();<NEW_LINE>// If measurement is missing, do not change it<NEW_LINE>if (Double.isNaN(val))<NEW_LINE>continue;<NEW_LINE>else if (singleThreshold) {<NEW_LINE>if (val > t1)<NEW_LINE>pathObjectTemp.setPathClass(classPositive, pathObjectTemp.getClassProbability());<NEW_LINE>else<NEW_LINE>pathObjectTemp.setPathClass(classNegative, pathObjectTemp.getClassProbability());<NEW_LINE>} else {<NEW_LINE>if (val > t3)<NEW_LINE>pathObjectTemp.setPathClass(classThreePlus, pathObjectTemp.getClassProbability());<NEW_LINE>else if (val > t2)<NEW_LINE>pathObjectTemp.setPathClass(classTwoPlus, pathObjectTemp.getClassProbability());<NEW_LINE>else if (val > t1)<NEW_LINE>pathObjectTemp.setPathClass(classOnePlus, pathObjectTemp.getClassProbability());<NEW_LINE>else<NEW_LINE>pathObjectTemp.setPathClass(classNegative, pathObjectTemp.getClassProbability());<NEW_LINE>}<NEW_LINE>counter++;<NEW_LINE>}<NEW_LINE>return counter;<NEW_LINE>} | setIntensityClassifications(pathObjects, intensityMeasurement, t1); |
40,271 | public static QueryFaceUserResponse unmarshall(QueryFaceUserResponse queryFaceUserResponse, UnmarshallerContext _ctx) {<NEW_LINE>queryFaceUserResponse.setRequestId(_ctx.stringValue("QueryFaceUserResponse.RequestId"));<NEW_LINE>queryFaceUserResponse.setSuccess(_ctx.booleanValue("QueryFaceUserResponse.Success"));<NEW_LINE>queryFaceUserResponse.setErrorMessage(_ctx.stringValue("QueryFaceUserResponse.ErrorMessage"));<NEW_LINE>queryFaceUserResponse.setCode(_ctx.stringValue("QueryFaceUserResponse.Code"));<NEW_LINE>Data data = new Data();<NEW_LINE>data.setUserId(_ctx.stringValue("QueryFaceUserResponse.Data.UserId"));<NEW_LINE>data.setCustomUserId(_ctx.stringValue("QueryFaceUserResponse.Data.CustomUserId"));<NEW_LINE>data.setName(_ctx.stringValue("QueryFaceUserResponse.Data.Name"));<NEW_LINE>data.setParams(_ctx.stringValue("QueryFaceUserResponse.Data.Params"));<NEW_LINE>List<FacePicListItem> facePicList = new ArrayList<FacePicListItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("QueryFaceUserResponse.Data.FacePicList.Length"); i++) {<NEW_LINE>FacePicListItem facePicListItem = new FacePicListItem();<NEW_LINE>facePicListItem.setFaceMd5(_ctx.stringValue("QueryFaceUserResponse.Data.FacePicList[" + i + "].FaceMd5"));<NEW_LINE>facePicListItem.setFaceUrl(_ctx.stringValue("QueryFaceUserResponse.Data.FacePicList[" + i + "].FaceUrl"));<NEW_LINE>List<FeatureDTO> featureDTOList = new ArrayList<FeatureDTO>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("QueryFaceUserResponse.Data.FacePicList[" + i + "].FeatureDTOList.Length"); j++) {<NEW_LINE>FeatureDTO featureDTO = new FeatureDTO();<NEW_LINE>featureDTO.setAlgorithmName(_ctx.stringValue("QueryFaceUserResponse.Data.FacePicList[" + i + "].FeatureDTOList[" + j + "].AlgorithmName"));<NEW_LINE>featureDTO.setAlgorithmProvider(_ctx.stringValue("QueryFaceUserResponse.Data.FacePicList[" + i + "].FeatureDTOList[" + j + "].AlgorithmProvider"));<NEW_LINE>featureDTO.setAlgorithmVersion(_ctx.stringValue("QueryFaceUserResponse.Data.FacePicList[" + i + "].FeatureDTOList[" + j + "].AlgorithmVersion"));<NEW_LINE>featureDTO.setFaceMd5(_ctx.stringValue("QueryFaceUserResponse.Data.FacePicList[" + i + "].FeatureDTOList[" + j + "].FaceMd5"));<NEW_LINE>featureDTO.setErrorCode(_ctx.stringValue("QueryFaceUserResponse.Data.FacePicList[" + i + "].FeatureDTOList[" + j + "].ErrorCode"));<NEW_LINE>featureDTO.setErrorMessage(_ctx.stringValue("QueryFaceUserResponse.Data.FacePicList[" + i <MASK><NEW_LINE>featureDTOList.add(featureDTO);<NEW_LINE>}<NEW_LINE>facePicListItem.setFeatureDTOList(featureDTOList);<NEW_LINE>facePicList.add(facePicListItem);<NEW_LINE>}<NEW_LINE>data.setFacePicList(facePicList);<NEW_LINE>queryFaceUserResponse.setData(data);<NEW_LINE>return queryFaceUserResponse;<NEW_LINE>} | + "].FeatureDTOList[" + j + "].ErrorMessage")); |
1,187,893 | final CreateTransitGatewayResult executeCreateTransitGateway(CreateTransitGatewayRequest createTransitGatewayRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createTransitGatewayRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateTransitGatewayRequest> request = null;<NEW_LINE>Response<CreateTransitGatewayResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateTransitGatewayRequestMarshaller().marshall(super.beforeMarshalling(createTransitGatewayRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "EC2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateTransitGateway");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>StaxResponseHandler<CreateTransitGatewayResult> responseHandler = new StaxResponseHandler<CreateTransitGatewayResult>(new CreateTransitGatewayResultStaxUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | awsRequestMetrics.endEvent(Field.RequestMarshallTime); |
1,043,283 | public static <T extends IBaseResource> T apply(FhirContext theCtx, T theResourceToUpdate, @Language("JSON") String thePatchBody) {<NEW_LINE>// Parse the patch<NEW_LINE>ObjectMapper mapper = new ObjectMapper();<NEW_LINE>mapper.configure(JsonParser.Feature.INCLUDE_SOURCE_IN_LOCATION, false);<NEW_LINE>JsonFactory factory = mapper.getFactory();<NEW_LINE>final JsonPatch patch;<NEW_LINE>try {<NEW_LINE>com.fasterxml.jackson.core.JsonParser parser = factory.createParser(thePatchBody);<NEW_LINE>JsonNode jsonPatchNode = mapper.readTree(parser);<NEW_LINE>patch = JsonPatch.fromJson(jsonPatchNode);<NEW_LINE>JsonNode originalJsonDocument = mapper.readTree(theCtx.newJsonParser().encodeResourceToString(theResourceToUpdate));<NEW_LINE>JsonNode after = patch.apply(originalJsonDocument);<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>Class<T> clazz = (Class<T>) theResourceToUpdate.getClass();<NEW_LINE>String <MASK><NEW_LINE>IParser fhirJsonParser = theCtx.newJsonParser();<NEW_LINE>fhirJsonParser.setParserErrorHandler(new StrictErrorHandler());<NEW_LINE>T retVal;<NEW_LINE>try {<NEW_LINE>retVal = fhirJsonParser.parseResource(clazz, postPatchedContent);<NEW_LINE>} catch (DataFormatException e) {<NEW_LINE>String resourceId = theResourceToUpdate.getIdElement().toUnqualifiedVersionless().getValue();<NEW_LINE>String resourceType = theCtx.getResourceDefinition(theResourceToUpdate).getName();<NEW_LINE>resourceId = defaultString(resourceId, resourceType);<NEW_LINE>String msg = theCtx.getLocalizer().getMessage(JsonPatchUtils.class, "failedToApplyPatch", resourceId, e.getMessage());<NEW_LINE>throw new InvalidRequestException(Msg.code(1271) + msg);<NEW_LINE>}<NEW_LINE>return retVal;<NEW_LINE>} catch (IOException | JsonPatchException theE) {<NEW_LINE>throw new InvalidRequestException(Msg.code(1272) + theE.getMessage());<NEW_LINE>}<NEW_LINE>} | postPatchedContent = mapper.writeValueAsString(after); |
262,158 | private void handleSignalingMessage(String message) {<NEW_LINE>log.debug("S got signaling message: " + message);<NEW_LINE>var msg = gson.fromJson(message, MessageDto.class);<NEW_LINE>switch(msg.type) {<NEW_LINE>case "login" -><NEW_LINE>{<NEW_LINE>var loginMsg = gson.fromJson(message, LoginMessageDto.class);<NEW_LINE>if (!loginMsg.success) {<NEW_LINE>MapTool.showError("Servername already taken!");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>case "offer" -><NEW_LINE>{<NEW_LINE>var offerMsg = gson.fromJson(message, OfferMessageDto.class);<NEW_LINE>var clientConnection = new WebRTCClientConnection(offerMsg, this);<NEW_LINE>openConnections.put(offerMsg.source, clientConnection);<NEW_LINE>}<NEW_LINE>case "candidate" -><NEW_LINE>{<NEW_LINE>var candidateMessage = gson.fromJson(message, CandidateMessageDto.class);<NEW_LINE>openConnections.get(candidateMessage.source<MASK><NEW_LINE>}<NEW_LINE>default -><NEW_LINE>log.error("S unhandled signaling: " + msg.type);<NEW_LINE>}<NEW_LINE>} | ).addIceCandidate(candidateMessage.candidate); |
1,748,717 | protected Object stringChrAt(Object string, int byteIndex, @CachedLibrary(limit = "LIBSTRING_CACHE") RubyStringLibrary strings, @Cached GetActualEncodingNode getActualEncodingNode, @Cached BytesNode bytesNode, @Cached CalculateCharacterLengthNode calculateCharacterLengthNode, @Cached CodeRangeNode codeRangeNode, @Cached SingleByteOptimizableNode singleByteOptimizableNode, @Cached MakeStringNode makeStringNode) {<NEW_LINE>final Rope rope = strings.getRope(string);<NEW_LINE>final RubyEncoding encoding = getActualEncodingNode.execute(rope, strings.getEncoding(string));<NEW_LINE>final int end = rope.byteLength();<NEW_LINE>final byte[] bytes = bytesNode.execute(rope);<NEW_LINE>final int c = calculateCharacterLengthNode.characterLength(encoding.jcoding, codeRangeNode.execute(rope), Bytes.fromRange(bytes, byteIndex, end));<NEW_LINE>if (!StringSupport.MBCLEN_CHARFOUND_P(c)) {<NEW_LINE>return nil;<NEW_LINE>}<NEW_LINE>if (c + byteIndex > end) {<NEW_LINE>return nil;<NEW_LINE>}<NEW_LINE>return makeStringNode.executeMake(ArrayUtils.extractRange(bytes, byteIndex, byteIndex <MASK><NEW_LINE>} | + c), encoding, CR_UNKNOWN); |
1,370,466 | public ContentHolder onCreateContentViewWithPos(ViewGroup parent, int position, int viewType) {<NEW_LINE>NodeHolder contentHolder = new NodeHolder();<NEW_LINE>// LogUtils.d("HippyListView", "onCreateContentViewWithPos start position " + position);<NEW_LINE>RenderNode contentViewRenderNode = mHippyContext.getRenderManager().getRenderNode(mParentRecyclerView.getId()).getChildAt(position);<NEW_LINE>contentViewRenderNode.setLazy(false);<NEW_LINE><MASK><NEW_LINE>contentHolder.mContentView = view;<NEW_LINE>if (view instanceof HippyPullHeaderView) {<NEW_LINE>((HippyPullHeaderView) view).setParentView(mParentRecyclerView);<NEW_LINE>}<NEW_LINE>if (view instanceof HippyPullFooterView) {<NEW_LINE>((HippyPullFooterView) view).setParentView(mParentRecyclerView);<NEW_LINE>}<NEW_LINE>contentHolder.mBindNode = contentViewRenderNode;<NEW_LINE>contentHolder.isCreated = true;<NEW_LINE>// LogUtils.d("HippyListView", "onCreateContentViewWithPos end position " + position);<NEW_LINE>// LogUtils.d("HippyListView", "onCreateContentViewWithPos" + contentViewRenderNode);<NEW_LINE>return contentHolder;<NEW_LINE>} | View view = contentViewRenderNode.createViewRecursive(); |
273,595 | public void run() {<NEW_LINE>String sessionId = session;<NEW_LINE>while (!Thread.currentThread().isInterrupted()) {<NEW_LINE>try {<NEW_LINE>LOGGER.debug("renew lock of session start:" + sessionId + " " + path);<NEW_LINE>if (!Boolean.TRUE.equals(ClusterHelper.isExist(path))) {<NEW_LINE>log("renew lock of session failure:" + sessionId + " " + path + ", the key is missing ", null);<NEW_LINE>// alert<NEW_LINE>Thread.currentThread().interrupt();<NEW_LINE>} else if (!renewLock(sessionId)) {<NEW_LINE>log("renew lock of session failure:" + sessionId + " " + path, null);<NEW_LINE>// alert<NEW_LINE>} else {<NEW_LINE>LOGGER.debug("renew lock of session success:" + sessionId + " " + path);<NEW_LINE>}<NEW_LINE>LockSupport.parkNanos(TimeUnit<MASK><NEW_LINE>} catch (Exception e) {<NEW_LINE>log("renew lock of session failure:" + sessionId + " " + path, e);<NEW_LINE>LockSupport.parkNanos(TimeUnit.MILLISECONDS.toNanos(5000));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | .MILLISECONDS.toNanos(10000)); |
1,789,700 | protected void storePorts() {<NEW_LINE>final String dasPortStr = dasPortField.getText().trim();<NEW_LINE>final String httpPortStr = httpPortField.getText().trim();<NEW_LINE>try {<NEW_LINE>int dasPort = Integer.parseInt(dasPortStr);<NEW_LINE>if (0 <= dasPort && dasPort < MAX_PORT_VALUE) {<NEW_LINE>// Update value only when values differs.<NEW_LINE>if (instance.getAdminPort() != dasPort) {<NEW_LINE>instance.setAdminPort(dasPort);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>LOGGER.log(Level.INFO, NbBundle.getMessage(InstancePanel.class, "InstanceLocalPanel.storePorts.dasPortRange", dasPortStr));<NEW_LINE>}<NEW_LINE>} catch (NumberFormatException nfe) {<NEW_LINE>LOGGER.log(Level.INFO, NbBundle.getMessage(InstancePanel.class, "InstanceLocalPanel.storePorts.dasPortInvalid", dasPortStr));<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>int <MASK><NEW_LINE>if (0 <= httpPort && httpPort < MAX_PORT_VALUE) {<NEW_LINE>if (instance.getPort() != httpPort) {<NEW_LINE>instance.setHttpPort(httpPort);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>LOGGER.log(Level.INFO, NbBundle.getMessage(InstancePanel.class, "InstanceLocalPanel.storePorts.httpPortRange", dasPortStr));<NEW_LINE>}<NEW_LINE>} catch (NumberFormatException nfe) {<NEW_LINE>LOGGER.log(Level.INFO, NbBundle.getMessage(InstancePanel.class, "InstanceLocalPanel.storePorts.httpPortInvalid", httpPortStr));<NEW_LINE>}<NEW_LINE>} | httpPort = Integer.parseInt(httpPortStr); |
891,366 | private int calculateWraps(int width) {<NEW_LINE>myTooSmall = width < MIN_WIDTH;<NEW_LINE>if (myTooSmall) {<NEW_LINE>return -1;<NEW_LINE>}<NEW_LINE>int result = 0;<NEW_LINE>myWraps = new ArrayList();<NEW_LINE>for (int i = 0; i < myLines.length; i++) {<NEW_LINE>String aLine = myLines[i];<NEW_LINE>int lineFirstChar = 0;<NEW_LINE>int lineLastChar = aLine.length() - 1;<NEW_LINE>int currFirst = lineFirstChar;<NEW_LINE>int printableWidth = width - myTextInsets.left - myTextInsets.right;<NEW_LINE>if (aLine.length() == 0) {<NEW_LINE>myWraps.add(aLine);<NEW_LINE>result++;<NEW_LINE>} else {<NEW_LINE>while (currFirst <= lineLastChar) {<NEW_LINE>int currLast = calculateLastVisibleChar(aLine, printableWidth, currFirst, lineLastChar);<NEW_LINE>if (currLast < lineLastChar) {<NEW_LINE>int currChar = currLast + 1;<NEW_LINE>if (!Character.isWhitespace(aLine.charAt(currChar))) {<NEW_LINE>while (currChar >= currFirst) {<NEW_LINE>if (Character.isWhitespace(aLine.charAt(currChar))) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>currChar--;<NEW_LINE>}<NEW_LINE>if (currChar > currFirst) {<NEW_LINE>currLast = currChar;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>myWraps.add(aLine.substring<MASK><NEW_LINE>currFirst = currLast + 1;<NEW_LINE>while ((currFirst <= lineLastChar) && (Character.isWhitespace(aLine.charAt(currFirst)))) {<NEW_LINE>currFirst++;<NEW_LINE>}<NEW_LINE>result++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | (currFirst, currLast + 1)); |
300,579 | public void prepareWrite(final int recordCount, final int inputSize, final int idealSize) {<NEW_LINE>this.inputCount = inputSize;<NEW_LINE>this.idealCount = idealSize;<NEW_LINE>ZipInputStream zis = null;<NEW_LINE>try {<NEW_LINE>this.fos = new FileOutputStream(this.file);<NEW_LINE>this.zos = new ZipOutputStream(this.fos);<NEW_LINE>final InputStream is = ResourceInputStream.openResourceInputStream("org/encog/data/blank.xlsx");<NEW_LINE>zis = new ZipInputStream(is);<NEW_LINE>ZipEntry theEntry;<NEW_LINE>while (zis.available() > 0) {<NEW_LINE>theEntry = zis.getNextEntry();<NEW_LINE>if ((entry != null) && !"xl/worksheets/sheet1.xml".equals(entry.getName())) {<NEW_LINE>final ZipEntry entry2 = new ZipEntry(theEntry);<NEW_LINE>entry2.setCompressedSize(-1);<NEW_LINE>this.zos.putNextEntry(entry2);<NEW_LINE>final byte[] theBuffer = new byte[(int) entry.getSize()];<NEW_LINE>zis.read(theBuffer);<NEW_LINE>this.zos.write(theBuffer);<NEW_LINE>this.zos.closeEntry();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>zis.close();<NEW_LINE>zis = null;<NEW_LINE>this.buffer = new ByteArrayOutputStream();<NEW_LINE>this.xmlOut = new WriteXML(this.buffer);<NEW_LINE>this.xmlOut.beginDocument();<NEW_LINE>this.xmlOut.addAttribute("xmlns", "http://schemas.openxmlformats.org/spreadsheetml/2006/main");<NEW_LINE>this.<MASK><NEW_LINE>this.xmlOut.beginTag("worksheet");<NEW_LINE>final StringBuilder d = new StringBuilder();<NEW_LINE>d.append(toColumn(this.inputCount + this.idealCount));<NEW_LINE>d.append("" + recordCount);<NEW_LINE>this.xmlOut.addAttribute("ref", "A1:" + d.toString());<NEW_LINE>this.xmlOut.beginTag("dimension");<NEW_LINE>this.xmlOut.endTag();<NEW_LINE>this.xmlOut.beginTag("sheetViews");<NEW_LINE>this.xmlOut.addAttribute("tabSelected", "1");<NEW_LINE>this.xmlOut.addAttribute("workbookViewId", "0");<NEW_LINE>this.xmlOut.beginTag("sheetView");<NEW_LINE>this.xmlOut.endTag();<NEW_LINE>this.xmlOut.endTag();<NEW_LINE>this.xmlOut.addAttribute("defaultRowHeight", "15");<NEW_LINE>this.xmlOut.beginTag("sheetFormatPtr");<NEW_LINE>this.xmlOut.endTag();<NEW_LINE>this.row = 1;<NEW_LINE>this.xmlOut.beginTag("sheetData");<NEW_LINE>} catch (final IOException ex) {<NEW_LINE>throw new BufferedDataError(ex);<NEW_LINE>} finally {<NEW_LINE>if (zis != null) {<NEW_LINE>try {<NEW_LINE>zis.close();<NEW_LINE>} catch (IOException e) {<NEW_LINE>EncogLogging.log(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | xmlOut.addAttribute("xmlns:r", "http://schemas.openxmlformats.org/officeDocument/2006/relationships"); |
1,793,843 | public <V> void addVertexProperty(HugeVertexProperty<V> prop) {<NEW_LINE>// NOTE: this method can also be used to update property<NEW_LINE>HugeVertex vertex = prop.element();<NEW_LINE>E.checkState(vertex != null, "No owner for updating property '%s'", prop.key());<NEW_LINE>// Add property in memory for new created vertex<NEW_LINE>if (vertex.fresh()) {<NEW_LINE>// The owner will do property update<NEW_LINE>vertex.setProperty(prop);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Check is updating property of added/removed vertex<NEW_LINE>E.checkArgument(!this.addedVertices.containsKey(vertex.id()) || this.updatedVertices.containsKey(vertex.id()), <MASK><NEW_LINE>E.checkArgument(!vertex.removed() && !this.removedVertices.containsKey(vertex.id()), "Can't update property '%s' for removing-state vertex", prop.key());<NEW_LINE>// Check is updating primary key<NEW_LINE>List<Id> primaryKeyIds = vertex.schemaLabel().primaryKeys();<NEW_LINE>E.checkArgument(!primaryKeyIds.contains(prop.propertyKey().id()), "Can't update primary key: '%s'", prop.key());<NEW_LINE>// Do property update<NEW_LINE>this.lockForUpdateProperty(vertex.schemaLabel(), prop, () -> {<NEW_LINE>// Update old vertex to remove index (without new property)<NEW_LINE>this.indexTx.updateVertexIndex(vertex, true);<NEW_LINE>// Update(add) vertex property<NEW_LINE>this.propertyUpdated(vertex, prop, vertex.setProperty(prop));<NEW_LINE>});<NEW_LINE>} | "Can't update property '%s' for adding-state vertex", prop.key()); |
1,781,517 | public static void main(String[] args) {<NEW_LINE>BufferedImage orig = UtilImageIO.loadImageNotNull(UtilIO.pathExample("standard/man_mls.jpg"));<NEW_LINE>var bufferedOut = new BufferedImage(orig.getWidth(), orig.getHeight(), BufferedImage.TYPE_INT_RGB);<NEW_LINE>Planar<GrayF32> input = ConvertBufferedImage.convertFrom(orig, true, ImageType.pl(3, GrayF32.class));<NEW_LINE>Planar<GrayF32> output = input.createSameShape();<NEW_LINE>var src = new ArrayList<Point2D_F32>();<NEW_LINE>var dst = new ArrayList<Point2D_F32>();<NEW_LINE>src.add(new Point2D_F32(64, 241));<NEW_LINE>src.add(new Point2D_F32(266, 119));<NEW_LINE>src.add(new Point2D_F32(265, 240));<NEW_LINE>src.add(new Point2D_F32(208, 410));<NEW_LINE>src.add(new Point2D_F32(181, 536));<NEW_LINE>src.add(new Point2D_F32(335, 409));<NEW_LINE>src.add(new Point2D_F32(375, 531));<NEW_LINE>src.add(new Point2D_F32(473, 238));<NEW_LINE>for (Point2D_F32 p : src) {<NEW_LINE>dst.add(p.copy());<NEW_LINE>}<NEW_LINE>var config = new ConfigDeformPointMLS();<NEW_LINE>PointDeformKeyPoints deform = FactoryDistort.deformMls(config);<NEW_LINE>deform.setImageShape(input.width, input.height);<NEW_LINE>ImageDistort<Planar<GrayF32>, Planar<GrayF32>> distorter = FactoryDistort.distort(true, InterpolationType.BILINEAR, BorderType.ZERO, input.getImageType(), input.getImageType());<NEW_LINE>deform.setImageShape(input.width, input.height);<NEW_LINE>deform.setSource(src);<NEW_LINE>deform.setDestination(dst);<NEW_LINE>ConvertBufferedImage.convertTo(output, bufferedOut, true);<NEW_LINE>ImagePanel panel = ShowImages.<MASK><NEW_LINE>int count = 0;<NEW_LINE>while (true) {<NEW_LINE>// specify new locations of key points<NEW_LINE>double theta = count++ * Math.PI / 30;<NEW_LINE>// right arm<NEW_LINE>dst.get(7).y = (float) (238 + Math.sin(theta) * 30);<NEW_LINE>// left arm<NEW_LINE>dst.get(0).y = (float) (241 - Math.sin(theta * 2.0) * 20);<NEW_LINE>// head<NEW_LINE>dst.get(1).x = (float) (266 + Math.sin(theta * 0.25) * 10);<NEW_LINE>// tell the deformation algorithm that destination points have changed<NEW_LINE>deform.setDestination(dst);<NEW_LINE>// Tell the distorter that the model has changed. If cached is set to false you can ignore this step<NEW_LINE>distorter.setModel(new PointToPixelTransform_F32(deform));<NEW_LINE>// distort the image<NEW_LINE>distorter.apply(input, output);<NEW_LINE>// Show the results<NEW_LINE>ConvertBufferedImage.convertTo(output, bufferedOut, true);<NEW_LINE>panel.repaint();<NEW_LINE>BoofMiscOps.sleep(30);<NEW_LINE>}<NEW_LINE>} | showWindow(bufferedOut, "Point Based Distortion Animation", true); |
508,784 | Mono<Response<ShareFileInfo>> createWithResponse(long maxSize, ShareFileHttpHeaders httpHeaders, FileSmbProperties smbProperties, String filePermission, Map<String, String> metadata, ShareRequestConditions requestConditions, Context context) {<NEW_LINE>requestConditions = requestConditions == null ? new ShareRequestConditions() : requestConditions;<NEW_LINE>smbProperties = smbProperties == null ? new FileSmbProperties() : smbProperties;<NEW_LINE>// Checks that file permission and file permission key are valid<NEW_LINE>validateFilePermissionAndKey(filePermission, smbProperties.getFilePermissionKey());<NEW_LINE>// If file permission and file permission key are both not set then set default value<NEW_LINE>filePermission = smbProperties.<MASK><NEW_LINE>String filePermissionKey = smbProperties.getFilePermissionKey();<NEW_LINE>String fileAttributes = smbProperties.setNtfsFileAttributes(FileConstants.FILE_ATTRIBUTES_NONE);<NEW_LINE>String fileCreationTime = smbProperties.setFileCreationTime(FileConstants.FILE_TIME_NOW);<NEW_LINE>String fileLastWriteTime = smbProperties.setFileLastWriteTime(FileConstants.FILE_TIME_NOW);<NEW_LINE>String fileChangeTime = smbProperties.getFileChangeTimeString();<NEW_LINE>return azureFileStorageClient.getFiles().createWithResponseAsync(shareName, filePath, maxSize, fileAttributes, null, metadata, filePermission, filePermissionKey, fileCreationTime, fileLastWriteTime, fileChangeTime, requestConditions.getLeaseId(), httpHeaders, context).map(ShareFileAsyncClient::createFileInfoResponse);<NEW_LINE>} | setFilePermission(filePermission, FileConstants.FILE_PERMISSION_INHERIT); |
1,510,460 | private void shareImage(int page) {<NEW_LINE>if (null == mGalleryProvider) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>File dir = AppConfig.getExternalTempDir();<NEW_LINE>if (null == dir) {<NEW_LINE>Toast.makeText(this, R.string.error_cant_create_temp_file, <MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>UniFile file;<NEW_LINE>if (null == (file = mGalleryProvider.save(page, UniFile.fromFile(dir), mGalleryProvider.getImageFilename(page)))) {<NEW_LINE>Toast.makeText(this, R.string.error_cant_save_image, Toast.LENGTH_SHORT).show();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String filename = file.getName();<NEW_LINE>if (filename == null) {<NEW_LINE>Toast.makeText(this, R.string.error_cant_save_image, Toast.LENGTH_SHORT).show();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String mimeType = MimeTypeMap.getSingleton().getMimeTypeFromExtension(MimeTypeMap.getFileExtensionFromUrl(filename));<NEW_LINE>if (TextUtils.isEmpty(mimeType)) {<NEW_LINE>mimeType = "image/jpeg";<NEW_LINE>}<NEW_LINE>Uri uri = new Uri.Builder().scheme(ContentResolver.SCHEME_CONTENT).authority(BuildConfig.FILE_PROVIDER_AUTHORITY).appendPath("temp").appendPath(filename).build();<NEW_LINE>Intent intent = new Intent();<NEW_LINE>intent.setAction(Intent.ACTION_SEND);<NEW_LINE>intent.putExtra(Intent.EXTRA_STREAM, uri);<NEW_LINE>intent.setType(mimeType);<NEW_LINE>try {<NEW_LINE>startActivity(Intent.createChooser(intent, getString(R.string.share_image)));<NEW_LINE>} catch (Throwable e) {<NEW_LINE>ExceptionUtils.throwIfFatal(e);<NEW_LINE>Toast.makeText(this, R.string.error_cant_find_activity, Toast.LENGTH_SHORT).show();<NEW_LINE>}<NEW_LINE>} | Toast.LENGTH_SHORT).show(); |
428,311 | final DetachSecurityProfileResult executeDetachSecurityProfile(DetachSecurityProfileRequest detachSecurityProfileRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(detachSecurityProfileRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DetachSecurityProfileRequest> request = null;<NEW_LINE>Response<DetachSecurityProfileResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DetachSecurityProfileRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(detachSecurityProfileRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "IoT");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DetachSecurityProfile");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DetachSecurityProfileResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DetachSecurityProfileResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | HandlerContextKey.SIGNING_REGION, getSigningRegion()); |
658,611 | static TLSCertificateKeyPair fromX509CertKeyPair(X509Certificate x509Cert, KeyPair keyPair) throws IOException {<NEW_LINE>ByteArrayOutputStream baos = new ByteArrayOutputStream();<NEW_LINE>OutputStreamWriter writer = new OutputStreamWriter(baos);<NEW_LINE>JcaPEMWriter w = new JcaPEMWriter(writer);<NEW_LINE>w.writeObject(x509Cert);<NEW_LINE>w.flush();<NEW_LINE>w.close();<NEW_LINE>byte[] pemBytes = baos.toByteArray();<NEW_LINE>InputStreamReader isr = new <MASK><NEW_LINE>PemReader pr = new PemReader(isr);<NEW_LINE>PemObject pem = pr.readPemObject();<NEW_LINE>byte[] derBytes = pem.getContent();<NEW_LINE>baos = new ByteArrayOutputStream();<NEW_LINE>writer = new OutputStreamWriter(baos);<NEW_LINE>w = new JcaPEMWriter(writer);<NEW_LINE>JcaPKCS8Generator keygen = new JcaPKCS8Generator(keyPair.getPrivate(), null);<NEW_LINE>w.writeObject(keygen.generate());<NEW_LINE>w.flush();<NEW_LINE>w.close();<NEW_LINE>byte[] keyBytes = baos.toByteArray();<NEW_LINE>return new TLSCertificateKeyPair(pemBytes, derBytes, keyBytes);<NEW_LINE>} | InputStreamReader(new ByteArrayInputStream(pemBytes)); |
1,478,604 | public void computeKilometricExpense(ActionRequest request, ActionResponse response) throws AxelorException {<NEW_LINE>ExpenseLine expenseLine = request.getContext().asType(ExpenseLine.class);<NEW_LINE>if (expenseLine.getKilometricAllowParam() == null || expenseLine.getDistance().compareTo(BigDecimal.ZERO) == 0 || expenseLine.getExpenseDate() == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String userId;<NEW_LINE>String userName;<NEW_LINE>if (expenseLine.getExpense() != null) {<NEW_LINE>setExpense(request, expenseLine);<NEW_LINE>}<NEW_LINE>Expense expense = expenseLine.getExpense();<NEW_LINE>if (expense != null && expenseLine.getUser() != null) {<NEW_LINE>userId = expense.getUser().getId().toString();<NEW_LINE>userName = expense.getUser().getFullName();<NEW_LINE>} else {<NEW_LINE>userId = request.getContext().getParent().asType(Expense.class).getUser().getId().toString();<NEW_LINE>userName = request.getContext().getParent().asType(Expense.class).getUser().getFullName();<NEW_LINE>}<NEW_LINE>Employee employee = Beans.get(EmployeeRepository.class).all().filter("self.user.id = ?1", userId).fetchOne();<NEW_LINE>if (employee == null) {<NEW_LINE>throw new AxelorException(TraceBackRepository.CATEGORY_CONFIGURATION_ERROR, I18n.get(IExceptionMessage.LEAVE_USER_EMPLOYEE), userName);<NEW_LINE>}<NEW_LINE>BigDecimal amount = BigDecimal.ZERO;<NEW_LINE>try {<NEW_LINE>amount = Beans.get(KilometricService.class<MASK><NEW_LINE>} catch (Exception e) {<NEW_LINE>TraceBackService.trace(response, e);<NEW_LINE>}<NEW_LINE>response.setValue("totalAmount", amount);<NEW_LINE>response.setValue("untaxedAmount", amount);<NEW_LINE>} | ).computeKilometricExpense(expenseLine, employee); |
1,127,020 | protected void addContent(RepositoryResourceWritable res, File assetFile, String name, ArtifactMetadata metadata, String contentUrl) throws RepositoryException {<NEW_LINE>String downloadUrl = contentUrl;<NEW_LINE>String linkTypeString = null;<NEW_LINE>if (metadata != null && metadata.properties != null) {<NEW_LINE>if (downloadUrl == null) {<NEW_LINE>downloadUrl = metadata.properties.getProperty(PROP_DOWNLOAD_URL);<NEW_LINE>}<NEW_LINE>linkTypeString = metadata.properties.getProperty(LINK_TYPE_PROPERTY_KEY);<NEW_LINE>}<NEW_LINE>if (downloadUrl != null && !downloadUrl.isEmpty()) {<NEW_LINE>AttachmentLinkType linkType = linkTypeString != null ? AttachmentLinkType.valueOf(linkTypeString) : null;<NEW_LINE>res.addContent(assetFile, name, downloadUrl, linkType);<NEW_LINE>} else if (assetFile != null) {<NEW_LINE>res.addContent(assetFile, name);<NEW_LINE>} else {<NEW_LINE>// No content so set the download policy to installer to hide the<NEW_LINE>// download button in the web UI and display policy hidden to hide it in WDT<NEW_LINE>res.setDownloadPolicy(DownloadPolicy.INSTALLER);<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} | res.setDisplayPolicy(DisplayPolicy.HIDDEN); |
167,661 | private static void addDiscountLine(MOrder order, List<OrderLinePromotionCandidate> candidates) throws Exception {<NEW_LINE>for (OrderLinePromotionCandidate candidate : candidates) {<NEW_LINE>final String rewardMode = candidate.promotionReward.getRewardMode();<NEW_LINE>if (MPromotionReward.REWARDMODE_Charge.equals(rewardMode)) {<NEW_LINE>BigDecimal discount = candidate.orderLine.getPriceActual().multiply(candidate.qty);<NEW_LINE>discount = discount.subtract(<MASK><NEW_LINE>BigDecimal qty = Env.ONE;<NEW_LINE>int C_Charge_ID = candidate.promotionReward.getC_Charge_ID();<NEW_LINE>I_M_Promotion promotion = candidate.promotionReward.getM_Promotion();<NEW_LINE>addDiscountLine(order, null, discount, qty, C_Charge_ID, promotion);<NEW_LINE>} else if (MPromotionReward.REWARDMODE_SplitQuantity.equals(rewardMode)) {<NEW_LINE>if (candidate.promotionReward.getAmount().signum() != 0) {<NEW_LINE>throw new AdempiereException("@NotSupported@ @M_PromotionReward@ @Amount@ (@RewardMode@:" + rewardMode + "@)");<NEW_LINE>}<NEW_LINE>MOrderLine nol = new MOrderLine(order);<NEW_LINE>MOrderLine.copyValues(candidate.orderLine, nol);<NEW_LINE>// task 09358: get rid of this; instead, update qtyReserved at one central place<NEW_LINE>// nol.setQtyReserved(Env.ZERO);<NEW_LINE>nol.setQtyDelivered(Env.ZERO);<NEW_LINE>nol.setQtyInvoiced(Env.ZERO);<NEW_LINE>nol.setQtyLostSales(Env.ZERO);<NEW_LINE>nol.setQty(candidate.qty);<NEW_LINE>nol.setPrice(Env.ZERO);<NEW_LINE>nol.setDiscount(Env.ONEHUNDRED);<NEW_LINE>setPromotion(nol, candidate.promotionReward.getM_Promotion());<NEW_LINE>setNextLineNo(nol);<NEW_LINE>nol.saveEx();<NEW_LINE>} else {<NEW_LINE>throw new AdempiereException("@NotSupported@ @RewardMode@ " + rewardMode);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | candidate.promotionReward.getAmount()); |
354,036 | public boolean validate(@NotNull PsiClass psiClass, @NotNull PsiAnnotation psiAnnotation, @NotNull ProblemBuilder problemBuilder) {<NEW_LINE>boolean result = <MASK><NEW_LINE>if (result) {<NEW_LINE>final Project project = psiAnnotation.getProject();<NEW_LINE>final String builderClassName = getBuilderClassName(psiClass, psiAnnotation);<NEW_LINE>final String buildMethodName = getBuildMethodName(psiAnnotation);<NEW_LINE>final String builderMethodName = getBuilderMethodName(psiAnnotation);<NEW_LINE>result = validateBuilderIdentifier(builderClassName, project, problemBuilder) && validateBuilderIdentifier(buildMethodName, project, problemBuilder) && (builderMethodName.isEmpty() || validateBuilderIdentifier(builderMethodName, project, problemBuilder)) && validateExistingBuilderClass(builderClassName, psiClass, problemBuilder);<NEW_LINE>if (result) {<NEW_LINE>final Collection<BuilderInfo> builderInfos = createBuilderInfos(psiClass, null).collect(Collectors.toList());<NEW_LINE>result = validateBuilderDefault(builderInfos, problemBuilder) && validateSingular(builderInfos, problemBuilder) && validateObtainViaAnnotations(builderInfos.stream(), problemBuilder);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | validateAnnotationOnRightType(psiClass, psiAnnotation, problemBuilder); |
494,402 | protected void postToWASReqURL(HttpServletRequest req, HttpServletResponse resp, String requestUrl, String oidcClientId) throws IOException {<NEW_LINE>String access_token = req.getParameter(Constants.ACCESS_TOKEN);<NEW_LINE>String id_token = req.getParameter(Constants.ID_TOKEN);<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {<NEW_LINE>Tr.debug(tc, "id_token:" + id_token);<NEW_LINE>}<NEW_LINE>StringBuffer sb = new StringBuffer("");<NEW_LINE>// HTTP 1.1.<NEW_LINE><MASK><NEW_LINE>// HTTP 1.0.<NEW_LINE>resp.setHeader("Pragma", "no-cache");<NEW_LINE>// Proxies.<NEW_LINE>resp.setDateHeader("Expires", 0);<NEW_LINE>resp.setContentType("text/html");<NEW_LINE>sb.append("<HTML xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\">");<NEW_LINE>sb.append("<HEAD>");<NEW_LINE>sb.append("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"/>");<NEW_LINE>sb.append("<meta http-equiv=\"Cache-Control\" content=\"no-cache, no-store, must-revalidate\"/>");<NEW_LINE>sb.append("<meta http-equiv=\"Pragma\" content=\"no-cache\"/>");<NEW_LINE>sb.append("<meta http-equiv=\"Expires\" content=\"0\"/>");<NEW_LINE>sb.append("</HEAD>");<NEW_LINE>sb.append("<BODY onload=\"document.forms[0].submit()\">");<NEW_LINE>sb.append("<FORM name=\"redirectform\" id=\"redirectform\" action=\"");<NEW_LINE>sb.append(WebUtils.htmlEncode(requestUrl));<NEW_LINE>sb.append("\" method=\"POST\"><div>");<NEW_LINE>// add oidc_client<NEW_LINE>if (oidcClientId != null) {<NEW_LINE>sb.append("<input type=\"hidden\" name=\"oidc_client\" value=\"" + WebUtils.htmlEncode(oidcClientId) + "\"/>");<NEW_LINE>}<NEW_LINE>if (access_token != null) {<NEW_LINE>sb.append("<input type=\"hidden\" name=\"access_token\" value=\"" + WebUtils.htmlEncode(access_token) + "\"/>");<NEW_LINE>}<NEW_LINE>if (id_token != null) {<NEW_LINE>sb.append("<input type=\"hidden\" name=\"id_token\" value=\"" + WebUtils.htmlEncode(id_token) + "\"/>");<NEW_LINE>}<NEW_LINE>sb.append("</div>");<NEW_LINE>sb.append("<noscript><div>");<NEW_LINE>sb.append("<button type=\"submit\" name=\"redirectform\">Process request</button>");<NEW_LINE>sb.append("</div></noscript>");<NEW_LINE>sb.append("</FORM></BODY></HTML>");<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {<NEW_LINE>Tr.debug(tc, "OIDC _SSO RP redirecting\n" + sb.toString());<NEW_LINE>}<NEW_LINE>PrintWriter out = resp.getWriter();<NEW_LINE>out.println(sb.toString());<NEW_LINE>out.flush();<NEW_LINE>} | resp.setHeader("Cache-Control", "no-cache, no-store, must-revalidate, private, max-age=0"); |
61,855 | public boolean train(InstanceList trainingSet, InstanceList unlabeledSet, int numIterations) {<NEW_LINE>if (hmm.emissionEstimator == null)<NEW_LINE>hmm.reset();<NEW_LINE>converged = false;<NEW_LINE>@Var<NEW_LINE>double threshold = 0.001;<NEW_LINE>@Var<NEW_LINE>double logLikelihood = Double.NEGATIVE_INFINITY, prevLogLikelihood;<NEW_LINE>for (int iter = 0; iter < numIterations; iter++) {<NEW_LINE>prevLogLikelihood = logLikelihood;<NEW_LINE>logLikelihood = 0;<NEW_LINE>for (Instance inst : trainingSet) {<NEW_LINE>FeatureSequence input = <MASK><NEW_LINE>FeatureSequence output = (FeatureSequence) inst.getTarget();<NEW_LINE>double obsLikelihood = new SumLatticeDefault(hmm, input, output, hmm.new Incrementor()).getTotalWeight();<NEW_LINE>logLikelihood += obsLikelihood;<NEW_LINE>}<NEW_LINE>logger.info("getValue() (observed log-likelihood) = " + logLikelihood);<NEW_LINE>if (unlabeledSet != null) {<NEW_LINE>@Var<NEW_LINE>int numEx = 0;<NEW_LINE>for (Instance inst : unlabeledSet) {<NEW_LINE>numEx++;<NEW_LINE>if (numEx % 100 == 0) {<NEW_LINE>System.err.print(numEx + ". ");<NEW_LINE>System.err.flush();<NEW_LINE>}<NEW_LINE>FeatureSequence input = (FeatureSequence) inst.getData();<NEW_LINE>double hiddenLikelihood = new SumLatticeDefault(hmm, input, null, hmm.new Incrementor()).getTotalWeight();<NEW_LINE>logLikelihood += hiddenLikelihood;<NEW_LINE>}<NEW_LINE>System.err.println();<NEW_LINE>}<NEW_LINE>logger.info("getValue() (log-likelihood) = " + logLikelihood);<NEW_LINE>hmm.estimate();<NEW_LINE>iterationCount++;<NEW_LINE>logger.info("HMM finished one iteration of maximizer, i=" + iter);<NEW_LINE>runEvaluators();<NEW_LINE>if (Math.abs(logLikelihood - prevLogLikelihood) < threshold) {<NEW_LINE>converged = true;<NEW_LINE>logger.info("HMM training has converged, i=" + iter);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return converged;<NEW_LINE>} | (FeatureSequence) inst.getData(); |
1,507,775 | public void create(Feature fp) {<NEW_LINE>if (fp == null) {<NEW_LINE>throw new IllegalArgumentException("Feature cannot be null nor empty");<NEW_LINE>}<NEW_LINE>if (exist(fp.getUid())) {<NEW_LINE>throw new FeatureAlreadyExistException(fp.getUid());<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>// Create core<NEW_LINE>graphDb.execute(createQueryNewCoreFeature(fp));<NEW_LINE>// Create Flipping Strategy<NEW_LINE>if (fp.getFlippingStrategy() != null) {<NEW_LINE>graphDb.execute(createQueryFlippingStrategy(fp));<NEW_LINE>}<NEW_LINE>// Create Group<NEW_LINE>if (fp.getGroup() != null && !"".equals(fp.getGroup())) {<NEW_LINE>addToGroup(fp.getUid(), fp.getGroup());<NEW_LINE>}<NEW_LINE>tx.success();<NEW_LINE>// Create Properties<NEW_LINE>if (fp.getCustomProperties() != null && fp.getCustomProperties().size() > 0) {<NEW_LINE>for (String pName : fp.getCustomProperties().keySet()) {<NEW_LINE>createProperty(fp.getProperty(pName), fp.getUid());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | Transaction tx = graphDb.beginTx(); |
25,855 | public Tuple<List<AggregationBuilder>, List<PipelineAggregationBuilder>> aggs(EvaluationParameters parameters, EvaluationFields evaluationFields) {<NEW_LINE>if (result.get() != null) {<NEW_LINE>return Tuple.tuple(List.of(), List.of());<NEW_LINE>}<NEW_LINE>// Store given {@code fields} for the purpose of generating error messages in {@code process}.<NEW_LINE>this.fields.trySet(evaluationFields);<NEW_LINE>double[] percentiles = IntStream.range(1, 100).mapToDouble(v -> (double) v).toArray();<NEW_LINE>AggregationBuilder percentilesAgg = AggregationBuilders.percentiles(PERCENTILES_AGG_NAME).field(evaluationFields.getPredictedProbabilityField()).percentiles(percentiles);<NEW_LINE>AggregationBuilder nestedAgg = AggregationBuilders.nested(NESTED_AGG_NAME, evaluationFields.getTopClassesField()).subAggregation(AggregationBuilders.filter(NESTED_FILTER_AGG_NAME, QueryBuilders.termQuery(evaluationFields.getPredictedClassField(), className)).subAggregation(percentilesAgg));<NEW_LINE>QueryBuilder actualIsTrueQuery = QueryBuilders.termQuery(evaluationFields.getActualField(), className);<NEW_LINE>AggregationBuilder percentilesForClassValueAgg = AggregationBuilders.filter(TRUE_AGG_NAME, actualIsTrueQuery).subAggregation(nestedAgg);<NEW_LINE>AggregationBuilder percentilesForRestAgg = AggregationBuilders.filter(NON_TRUE_AGG_NAME, QueryBuilders.boolQuery().mustNot(actualIsTrueQuery)).subAggregation(nestedAgg);<NEW_LINE>return Tuple.tuple(List.of(percentilesForClassValueAgg, percentilesForRestAgg<MASK><NEW_LINE>} | ), List.of()); |
463,943 | final DescribeAcceleratorOfferingsResult executeDescribeAcceleratorOfferings(DescribeAcceleratorOfferingsRequest describeAcceleratorOfferingsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeAcceleratorOfferingsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeAcceleratorOfferingsRequest> request = null;<NEW_LINE>Response<DescribeAcceleratorOfferingsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeAcceleratorOfferingsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeAcceleratorOfferingsRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Elastic Inference");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeAcceleratorOfferings");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeAcceleratorOfferingsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeAcceleratorOfferingsResultJsonUnmarshaller());<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); |
301,814 | protected Money distributeOrderSavingsToItems(Order order, BigDecimal totalAllItems) {<NEW_LINE>Money returnAmount = new Money(order.getCurrency());<NEW_LINE>BigDecimal orderAdjAmt = order<MASK><NEW_LINE>for (FulfillmentGroup fulfillmentGroup : order.getFulfillmentGroups()) {<NEW_LINE>for (FulfillmentGroupItem fgItem : fulfillmentGroup.getFulfillmentGroupItems()) {<NEW_LINE>BigDecimal fgItemAmount = fgItem.getTotalItemAmount().getAmount();<NEW_LINE>BigDecimal proratedAdjAmt = totalAllItems.compareTo(BigDecimal.ZERO) == 0 ? totalAllItems : orderAdjAmt.multiply(fgItemAmount).divide(totalAllItems, RoundingMode.FLOOR);<NEW_LINE>fgItem.setProratedOrderAdjustmentAmount(new Money(proratedAdjAmt, order.getCurrency()));<NEW_LINE>returnAmount = returnAmount.add(fgItem.getProratedOrderAdjustmentAmount());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return returnAmount;<NEW_LINE>} | .getOrderAdjustmentsValue().getAmount(); |
1,193,529 | protected boolean resolve(final ClassNode type, final boolean testModuleImports, final boolean testDefaultImports, final boolean testStaticInnerClasses) {<NEW_LINE><MASK><NEW_LINE>if (type.isResolved() || type.isPrimaryClassNode())<NEW_LINE>return true;<NEW_LINE>if (type.isArray()) {<NEW_LINE>ClassNode element = type.getComponentType();<NEW_LINE>boolean resolved = resolve(element, testModuleImports, testDefaultImports, testStaticInnerClasses);<NEW_LINE>if (resolved) {<NEW_LINE>ClassNode cn = element.makeArray();<NEW_LINE>type.setRedirect(cn);<NEW_LINE>}<NEW_LINE>return resolved;<NEW_LINE>}<NEW_LINE>// test if vanilla name is current class name<NEW_LINE>if (currentClass == type)<NEW_LINE>return true;<NEW_LINE>String typeName = type.getName();<NEW_LINE>GenericsType genericsType = genericParameterNames.get(new GenericsTypeName(typeName));<NEW_LINE>if (genericsType != null) {<NEW_LINE>type.setRedirect(genericsType.getType());<NEW_LINE>type.setGenericsTypes(new GenericsType[] { genericsType });<NEW_LINE>type.setGenericsPlaceHolder(true);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>if (currentClass.getNameWithoutPackage().equals(typeName)) {<NEW_LINE>type.setRedirect(currentClass);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return (!type.hasPackageName() && resolveNestedClass(type)) || resolveFromModule(type, testModuleImports) || resolveFromCompileUnit(type) || (testDefaultImports && !type.hasPackageName() && resolveFromDefaultImports(type, true)) || resolveToOuter(type) || (testStaticInnerClasses && type.hasPackageName() && resolveFromStaticInnerClasses(type, true));<NEW_LINE>} | resolveGenericsTypes(type.getGenericsTypes()); |
1,203,909 | private void loadNode30() {<NEW_LINE>UaMethodNode node = new UaMethodNode(this.context, Identifiers.ConditionType_AddComment, new QualifiedName(0, "AddComment"), new LocalizedText("en", "AddComment"), LocalizedText.NULL_VALUE, UInteger.valueOf(0), UInteger.valueOf(0), true, true);<NEW_LINE>node.addReference(new Reference(Identifiers.ConditionType_AddComment, Identifiers.HasProperty, Identifiers.ConditionType_AddComment_InputArguments.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.ConditionType_AddComment, Identifiers.AlwaysGeneratesEvent, Identifiers.AuditConditionCommentEventType.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.ConditionType_AddComment, Identifiers.HasModellingRule, Identifiers.ModellingRule_Mandatory.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.ConditionType_AddComment, Identifiers.HasComponent, Identifiers.ConditionType<MASK><NEW_LINE>this.nodeManager.addNode(node);<NEW_LINE>} | .expanded(), false)); |
858,534 | public <V, K extends Exception> V runWithRetryOnServer(CassandraServer specifiedServer, FunctionCheckedException<CassandraClient, V, K> fn) throws K {<NEW_LINE>RetryableCassandraRequest<V, K> req = new RetryableCassandraRequest<>(specifiedServer, fn);<NEW_LINE>while (true) {<NEW_LINE>if (log.isTraceEnabled()) {<NEW_LINE>log.trace("Running function on host {}.", SafeArg.of("server"<MASK><NEW_LINE>}<NEW_LINE>CassandraClientPoolingContainer hostPool = getPreferredHostOrFallBack(req);<NEW_LINE>try {<NEW_LINE>V response = runWithPooledResourceRecordingMetrics(hostPool, req.getFunction());<NEW_LINE>removeFromBlacklistAfterResponse(hostPool.getCassandraServer());<NEW_LINE>return response;<NEW_LINE>} catch (Exception ex) {<NEW_LINE>exceptionHandler.handleExceptionFromRequest(req, hostPool.getCassandraServer(), ex);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | , req.getCassandraServer())); |
975,046 | public synchronized void close() {<NEW_LINE>PROFILER.unregisterHookValue(profilerMetric + ".transmittedBytes");<NEW_LINE>PROFILER.unregisterHookValue(profilerMetric + ".receivedBytes");<NEW_LINE>PROFILER.unregisterHookValue(profilerMetric + ".flushes");<NEW_LINE>try {<NEW_LINE>if (socket != null) {<NEW_LINE>socket.close();<NEW_LINE>socket = null;<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>OLogManager.instance().debug(this, "Error during socket close", e);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>if (inStream != null) {<NEW_LINE>inStream.close();<NEW_LINE>inStream = null;<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>OLogManager.instance().<MASK><NEW_LINE>}<NEW_LINE>try {<NEW_LINE>if (outStream != null) {<NEW_LINE>outStream.close();<NEW_LINE>outStream = null;<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>OLogManager.instance().debug(this, "Error during closing of output stream", e);<NEW_LINE>}<NEW_LINE>for (OChannelListener l : getListenersCopy()) try {<NEW_LINE>l.onChannelClose(this);<NEW_LINE>} catch (Exception e) {<NEW_LINE>OLogManager.instance().debug(this, "Error during closing of channel close listener", e);<NEW_LINE>}<NEW_LINE>lockRead.close();<NEW_LINE>lockWrite.close();<NEW_LINE>resetListeners();<NEW_LINE>} | debug(this, "Error during closing of input stream", e); |
328,627 | AffineTransform doCreateArrowTransform(double arrowPlacementTolerance, Shape edgeShape, Shape vertexShape) {<NEW_LINE>GeneralPath path = new GeneralPath(edgeShape);<NEW_LINE>double[<MASK><NEW_LINE>Point2D p1 = null;<NEW_LINE>Point2D p2 = null;<NEW_LINE>AffineTransform at = new AffineTransform();<NEW_LINE>// Find the line segment whose endpoint is in the end vertex (this handles straight lines<NEW_LINE>// and articulated lines). Use that line's start point to for the arrow position and use<NEW_LINE>// the line's angle to rotate the arrow head.<NEW_LINE>for (PathIterator i = path.getPathIterator(null, 1); !i.isDone(); i.next()) {<NEW_LINE>int type = i.currentSegment(seg);<NEW_LINE>if (type == PathIterator.SEG_MOVETO) {<NEW_LINE>p2 = new Point2D.Double(seg[0], seg[1]);<NEW_LINE>} else if (type == PathIterator.SEG_LINETO) {<NEW_LINE>p1 = p2;<NEW_LINE>p2 = new Point2D.Double(seg[0], seg[1]);<NEW_LINE>if (vertexShape.contains(p2)) {<NEW_LINE>Line2D lineSegment = new Line2D.Double(p1, p2);<NEW_LINE>Line2D line = findClosestLineSegment(arrowPlacementTolerance, lineSegment, vertexShape);<NEW_LINE>return createArrowTransformFromLine(line);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return at;<NEW_LINE>} | ] seg = new double[6]; |
157,645 | private String maybeAlignedRefSpec(Logger logger, String defaultRefSpec) {<NEW_LINE>if (providerFactory.systemProperty("bwc.checkout.align").isPresent() == false) {<NEW_LINE>return defaultRefSpec;<NEW_LINE>}<NEW_LINE>String timeOfCurrent = execInCheckoutDir(execSpec -> {<NEW_LINE>execSpec.commandLine(asList("git", "show", "--no-patch", "--no-notes", "--pretty='%cD'"));<NEW_LINE>execSpec.<MASK><NEW_LINE>});<NEW_LINE>logger.lifecycle("Commit date of current: {}", timeOfCurrent);<NEW_LINE>String mergeCommits = execInCheckoutDir(spec -> spec.commandLine(asList("git", "rev-list", defaultRefSpec, "--after", timeOfCurrent, "--merges")));<NEW_LINE>if (mergeCommits.isEmpty() == false) {<NEW_LINE>throw new IllegalStateException("Found the following merge commits which prevent determining bwc commits: " + mergeCommits);<NEW_LINE>}<NEW_LINE>return execInCheckoutDir(spec -> spec.commandLine(asList("git", "rev-list", defaultRefSpec, "-n", "1", "--before", timeOfCurrent, "--date-order")));<NEW_LINE>} | workingDir(project.getRootDir()); |
713,679 | protected AdminResult handle() {<NEW_LINE>// 1. Increase/decrease the specified proposal execution concurrency.<NEW_LINE>String ongoingConcurrencyChangeRequest = processChangeExecutionConcurrencyRequest();<NEW_LINE>// 2. Enable/disable self-healing for the specified anomaly types.<NEW_LINE>Map<AnomalyType, Boolean> selfHealingBefore = new HashMap<>();<NEW_LINE>Map<AnomalyType, Boolean> selfHealingAfter = new HashMap<>();<NEW_LINE>processUpdateSelfHealingRequest(selfHealingBefore, selfHealingAfter);<NEW_LINE>// 3. Drop selected recently removed/demoted brokers.<NEW_LINE>String dropRecentBrokersRequest = processDropRecentBrokersRequest();<NEW_LINE>// 4. Enable/disable (1) the specified concurrency adjusters and/or (2) the MinISR-based concurrency adjustment.<NEW_LINE>Map<ConcurrencyType, Boolean> concurrencyAdjusterBefore = new HashMap<>();<NEW_LINE>Map<ConcurrencyType, Boolean> <MASK><NEW_LINE>StringBuilder minIsrBasedConcurrencyAdjustmentRequest = new StringBuilder();<NEW_LINE>processUpdateConcurrencyAdjusterRequest(concurrencyAdjusterBefore, concurrencyAdjusterAfter, minIsrBasedConcurrencyAdjustmentRequest);<NEW_LINE>return new AdminResult(selfHealingBefore, selfHealingAfter, ongoingConcurrencyChangeRequest, dropRecentBrokersRequest, concurrencyAdjusterBefore, concurrencyAdjusterAfter, minIsrBasedConcurrencyAdjustmentRequest.toString(), _kafkaCruiseControl.config());<NEW_LINE>} | concurrencyAdjusterAfter = new HashMap<>(); |
3,955 | public ResultCursor sync() {<NEW_LINE>ArrayResultCursor result = new ArrayResultCursor("RULE");<NEW_LINE>result.addColumn("activeConnection", DataTypes.LongType);<NEW_LINE>result.addColumn("aggregateMultiDBCount", DataTypes.LongType);<NEW_LINE>result.addColumn("connectionCount", DataTypes.LongType);<NEW_LINE>result.addColumn("delete", DataTypes.LongType);<NEW_LINE>result.addColumn("errorCount", DataTypes.LongType);<NEW_LINE>result.addColumn("hintCount", DataTypes.LongType);<NEW_LINE>result.addColumn("insert", DataTypes.LongType);<NEW_LINE>result.addColumn("integrityConstraintViolationErrorCount", DataTypes.LongType);<NEW_LINE>result.<MASK><NEW_LINE>result.addColumn("multiDBCount", DataTypes.LongType);<NEW_LINE>result.addColumn("netIn", DataTypes.LongType);<NEW_LINE>result.addColumn("netOut", DataTypes.LongType);<NEW_LINE>result.addColumn("physicalRequest", DataTypes.LongType);<NEW_LINE>result.addColumn("physicalTimeCost", DataTypes.LongType);<NEW_LINE>result.addColumn("query", DataTypes.LongType);<NEW_LINE>result.addColumn("replace", DataTypes.LongType);<NEW_LINE>result.addColumn("request", DataTypes.LongType);<NEW_LINE>result.addColumn("tempTableCount", DataTypes.LongType);<NEW_LINE>result.addColumn("timeCost", DataTypes.LongType);<NEW_LINE>result.addColumn("update", DataTypes.LongType);<NEW_LINE>result.addColumn("recordTime", DataTypes.LongType);<NEW_LINE>result.addColumn("threadRunning", DataTypes.LongType);<NEW_LINE>result.addColumn("slowRequest", DataTypes.LongType);<NEW_LINE>result.addColumn("physicalSlowRequest", DataTypes.LongType);<NEW_LINE>result.addColumn("cpu", DataTypes.DoubleType);<NEW_LINE>result.addColumn("freemem", DataTypes.DoubleType);<NEW_LINE>result.addColumn("fullgcCount", DataTypes.LongType);<NEW_LINE>result.addColumn("fullgcTime", DataTypes.LongType);<NEW_LINE>result.addColumn("transCountXA", DataTypes.LongType);<NEW_LINE>result.addColumn("transCountBestEffort", DataTypes.LongType);<NEW_LINE>result.addColumn("transCountTSO", DataTypes.LongType);<NEW_LINE>result.addColumn("backfillRows", DataTypes.LongType);<NEW_LINE>result.addColumn("checkedRows", DataTypes.LongType);<NEW_LINE>result.initMeta();<NEW_LINE>TDataSource ds = CobarServer.getInstance().getConfig().getSchemas().get(db).getDataSource();<NEW_LINE>MatrixStatistics stats = ds.getStatistics();<NEW_LINE>stats.recordTime = System.currentTimeMillis();<NEW_LINE>result.addRow(getRow(stats, ds));<NEW_LINE>result.addRow(getRow(stats.getPreviosStatistics(), ds));<NEW_LINE>return result;<NEW_LINE>} | addColumn("joinMultiDBCount", DataTypes.LongType); |
1,488,227 | protected void paintTabBorder(Graphics g, int tabIndex, int x, int y, int w, int h, boolean isSelected) {<NEW_LINE>g.translate(x, y);<NEW_LINE>int right = w;<NEW_LINE>int bottom = h;<NEW_LINE>if (isFirstDisplayedTab(tabIndex, x, tabPane.getBounds().x)) {<NEW_LINE>if (isSelected) {<NEW_LINE>g.setColor(selectHighlight);<NEW_LINE>// left<NEW_LINE>g.fillRect(0, 0, 1, bottom);<NEW_LINE>// top<NEW_LINE>g.fillRect(0, 0, right - 1, 1);<NEW_LINE>// right<NEW_LINE>g.fillRect(right - 1, 0, 1, bottom);<NEW_LINE>g.setColor(shadowColor);<NEW_LINE>// top-right corner<NEW_LINE>g.fillRect(right - 1, 0, 1, 1);<NEW_LINE>// right<NEW_LINE>g.fillRect(right, 1, 1, bottom);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (isSelected) {<NEW_LINE>g.setColor(selectHighlight);<NEW_LINE>// left<NEW_LINE>g.fillRect(1, 1, 1, bottom - 1);<NEW_LINE>// top<NEW_LINE>g.fillRect(2, 0, right - 3, 1);<NEW_LINE>// right<NEW_LINE>g.fillRect(right - 1, 1, 1, bottom - 1);<NEW_LINE>g.setColor(shadowColor);<NEW_LINE>// left<NEW_LINE>g.fillRect(0, <MASK><NEW_LINE>// topleft corner<NEW_LINE>g.fillRect(1, 0, 1, 1);<NEW_LINE>// topright corner<NEW_LINE>g.fillRect(right - 1, 0, 1, 1);<NEW_LINE>// right<NEW_LINE>g.fillRect(right, 1, 1, bottom);<NEW_LINE>} else {<NEW_LINE>g.setColor(shadowColor);<NEW_LINE>g.fillRect(0, 0, 1, bottom + 2 - bottom / 2);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>g.translate(-x, -y);<NEW_LINE>} | 1, 1, bottom - 1); |
1,316,501 | private void defineLayout() {<NEW_LINE>component.setLayout(new BorderLayout());<NEW_LINE>component.setNoInsets();<NEW_LINE>component.add(slider, BorderLayout.WEST);<NEW_LINE>component.<MASK><NEW_LINE>component.setName("SheetAssemblyPanel");<NEW_LINE>// Avoid slider to react on (and consume) page up/down keys or arrow keys<NEW_LINE>InputMap inputMap = slider.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);<NEW_LINE>inputMap.put(KeyStroke.getKeyStroke("PAGE_UP"), "none");<NEW_LINE>inputMap.put(KeyStroke.getKeyStroke("PAGE_DOWN"), "none");<NEW_LINE>inputMap.put(KeyStroke.getKeyStroke("LEFT"), "none");<NEW_LINE>inputMap.put(KeyStroke.getKeyStroke("RIGHT"), "none");<NEW_LINE>inputMap.put(KeyStroke.getKeyStroke("UP"), "none");<NEW_LINE>inputMap.put(KeyStroke.getKeyStroke("DOWN"), "none");<NEW_LINE>} | add(viewsPane, BorderLayout.CENTER); |
1,618,371 | public void enterSid_trunk_group(A10Parser.Sid_trunk_groupContext ctx) {<NEW_LINE>TrunkGroup.Type type = ctx.trunk_type() != null ? toType(ctx.trunk_type()) : null;<NEW_LINE>Optional<Integer> maybeNum = toInteger(ctx, ctx.trunk_number());<NEW_LINE>if (!maybeNum.isPresent()) {<NEW_LINE>// dummy<NEW_LINE>_currentTrunkGroup = <MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int num = maybeNum.get();<NEW_LINE>Optional<String> maybeInvalidReason = isTrunkValidForCurrentIface(num, type);<NEW_LINE>if (maybeInvalidReason.isPresent()) {<NEW_LINE>warn(ctx, maybeInvalidReason.get());<NEW_LINE>// dummy<NEW_LINE>_currentTrunkGroup = new TrunkGroup(-1, type);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>setCurrentTrunkGroupAndReferences(num, type, ctx);<NEW_LINE>} | new TrunkGroup(-1, type); |
395,687 | public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {<NEW_LINE>if (((bitField0_ & 0x00000001) == 0x00000001)) {<NEW_LINE>output.writeEnum(1, type_);<NEW_LINE>}<NEW_LINE>if (((bitField0_ & 0x00000002) == 0x00000002)) {<NEW_LINE>output.writeInt64(2, term_);<NEW_LINE>}<NEW_LINE>if (((bitField0_ & 0x00000004) == 0x00000004)) {<NEW_LINE>output.writeInt64(3, index_);<NEW_LINE>}<NEW_LINE>for (int i = 0; i < peers_.size(); i++) {<NEW_LINE>output.writeBytes(4, peers_.get(i));<NEW_LINE>}<NEW_LINE>for (int i = 0; i < oldPeers_.size(); i++) {<NEW_LINE>output.writeBytes(5<MASK><NEW_LINE>}<NEW_LINE>if (((bitField0_ & 0x00000008) == 0x00000008)) {<NEW_LINE>output.writeBytes(6, data_);<NEW_LINE>}<NEW_LINE>if (((bitField0_ & 0x00000010) == 0x00000010)) {<NEW_LINE>output.writeInt64(7, checksum_);<NEW_LINE>}<NEW_LINE>for (int i = 0; i < learners_.size(); i++) {<NEW_LINE>output.writeBytes(8, learners_.get(i));<NEW_LINE>}<NEW_LINE>for (int i = 0; i < oldLearners_.size(); i++) {<NEW_LINE>output.writeBytes(9, oldLearners_.get(i));<NEW_LINE>}<NEW_LINE>unknownFields.writeTo(output);<NEW_LINE>} | , oldPeers_.get(i)); |
1,854,475 | public static String findParameterType(ParameterContext parameterContext) {<NEW_LINE>ResolvedMethodParameter resolvedMethodParameter = parameterContext.resolvedMethodParameter();<NEW_LINE>ResolvedType parameterType = resolvedMethodParameter.getParameterType();<NEW_LINE>parameterType = parameterContext.alternateFor(parameterType);<NEW_LINE>// Multi-part file trumps any other annotations<NEW_LINE>if (isFileType(parameterType) || isListOfFiles(parameterType)) {<NEW_LINE>if (resolvedMethodParameter.hasParameterAnnotation(RequestPart.class)) {<NEW_LINE>parameterContext.requestParameterBuilder().accepts(Collections.singleton(MediaType.MULTIPART_FORM_DATA));<NEW_LINE>return "formData";<NEW_LINE>}<NEW_LINE>parameterContext.requestParameterBuilder().accepts(Collections.singleton(MediaType.APPLICATION_OCTET_STREAM));<NEW_LINE>return "body";<NEW_LINE>}<NEW_LINE>if (resolvedMethodParameter.hasParameterAnnotation(PathVariable.class)) {<NEW_LINE>return "path";<NEW_LINE>} else if (resolvedMethodParameter.hasParameterAnnotation(RequestBody.class)) {<NEW_LINE>return "body";<NEW_LINE>} else if (resolvedMethodParameter.hasParameterAnnotation(RequestPart.class)) {<NEW_LINE>parameterContext.requestParameterBuilder().accepts(Collections.singleton(MediaType.MULTIPART_FORM_DATA));<NEW_LINE>return "formData";<NEW_LINE>} else if (resolvedMethodParameter.hasParameterAnnotation(RequestParam.class)) {<NEW_LINE>return determineScalarParameterType(parameterContext.getOperationContext().consumes(), parameterContext.getOperationContext().httpMethod());<NEW_LINE>} else if (resolvedMethodParameter.hasParameterAnnotation(RequestHeader.class)) {<NEW_LINE>return "header";<NEW_LINE>} else if (resolvedMethodParameter.hasParameterAnnotation(ModelAttribute.class)) {<NEW_LINE>parameterContext.requestParameterBuilder().accepts(Collections.singleton(MediaType.APPLICATION_FORM_URLENCODED));<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (!resolvedMethodParameter.hasParameterAnnotations()) {<NEW_LINE>return determineScalarParameterType(parameterContext.getOperationContext().consumes(), parameterContext.getOperationContext().httpMethod());<NEW_LINE>}<NEW_LINE>return QUERY_ONLY_HTTP_METHODS.contains(parameterContext.getOperationContext().httpMethod()) ? "query" : "body";<NEW_LINE>} | LOGGER.warn("@ModelAttribute annotated parameters should have already been expanded via " + "the ExpandedParameterBuilderPlugin"); |
925,639 | private void createQtyReportEvent(final IContextAware context, final I_PMM_Product pmmProduct, final SyncProductSupply syncProductSupply) {<NEW_LINE>logger.debug("Creating QtyReport event from {} ({})", syncProductSupply, pmmProduct);<NEW_LINE>final List<String> errors = new ArrayList<>();<NEW_LINE>final I_PMM_QtyReport_Event qtyReportEvent = InterfaceWrapperHelper.newInstance(I_PMM_QtyReport_Event.class, context);<NEW_LINE>try {<NEW_LINE>qtyReportEvent.setEvent_UUID(syncProductSupply.getUuid());<NEW_LINE>// Product<NEW_LINE>qtyReportEvent.setProduct_UUID(syncProductSupply.getProduct_uuid());<NEW_LINE>qtyReportEvent.setPMM_Product(pmmProduct);<NEW_LINE>// BPartner<NEW_LINE>final String bpartner_uuid = syncProductSupply.getBpartner_uuid();<NEW_LINE>qtyReportEvent.setPartner_UUID(bpartner_uuid);<NEW_LINE>if (!Check.isEmpty(bpartner_uuid, true)) {<NEW_LINE>final int bpartnerId = SyncUUIDs.getC_BPartner_ID(bpartner_uuid);<NEW_LINE>qtyReportEvent.setC_BPartner_ID(bpartnerId);<NEW_LINE>} else {<NEW_LINE>errors.add("@Missing@ @" + I_C_BPartner.COLUMNNAME_C_BPartner_ID + "@");<NEW_LINE>}<NEW_LINE>// C_FlatrateTerm<NEW_LINE>final String contractLine_uuid = syncProductSupply.getContractLine_uuid();<NEW_LINE>qtyReportEvent.setContractLine_UUID(contractLine_uuid);<NEW_LINE>if (!Check.isEmpty(contractLine_uuid, true)) {<NEW_LINE>final int flatrateTermId = SyncUUIDs.getC_Flatrate_Term_ID(contractLine_uuid);<NEW_LINE>qtyReportEvent.setC_Flatrate_Term_ID(flatrateTermId);<NEW_LINE>}<NEW_LINE>// QtyPromised(CU)<NEW_LINE>final BigDecimal qtyPromised = CoalesceUtil.coalesce(syncProductSupply.getQty(), BigDecimal.ZERO);<NEW_LINE>qtyReportEvent.setQtyPromised(qtyPromised);<NEW_LINE>// DatePromised<NEW_LINE>final Timestamp datePromised = TimeUtil.asTimestamp(syncProductSupply.getDay());<NEW_LINE>qtyReportEvent.setDatePromised(datePromised);<NEW_LINE>// Is a weekly planning record?<NEW_LINE>qtyReportEvent.setIsPlanning(syncProductSupply.isWeekPlanning());<NEW_LINE>//<NEW_LINE>// Update the QtyReport event<NEW_LINE>updateFromPMMProduct(qtyReportEvent, errors);<NEW_LINE>} catch (final Exception e) {<NEW_LINE>logger.error("Failed importing " + syncProductSupply, e);<NEW_LINE>errors.add(e.getLocalizedMessage());<NEW_LINE>} finally {<NEW_LINE>//<NEW_LINE>// check if we have errors to report<NEW_LINE>if (!errors.isEmpty()) {<NEW_LINE>final String errorMsg = Joiner.on("\n").skipNulls().join(errors);<NEW_LINE>final IMsgBL msgBL = Services.get(IMsgBL.class);<NEW_LINE>final Properties ctx = InterfaceWrapperHelper.getCtx(qtyReportEvent);<NEW_LINE>qtyReportEvent.setErrorMsg(msgBL.translate(ctx, errorMsg));<NEW_LINE>qtyReportEvent.setIsError(true);<NEW_LINE>InterfaceWrapperHelper.save(qtyReportEvent);<NEW_LINE>logger.debug("Got following errors while importing {} to {}:\n{}", syncProductSupply, qtyReportEvent, errorMsg);<NEW_LINE>} else {<NEW_LINE>InterfaceWrapperHelper.save(qtyReportEvent);<NEW_LINE>logger.debug("Imported {} to {}", syncProductSupply, qtyReportEvent);<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// Notify agent that we got the message<NEW_LINE>final boolean isInternalGenerated = syncProductSupply.getUuid() == null;<NEW_LINE>if (!isInternalGenerated) {<NEW_LINE>final String serverEventId = String.<MASK><NEW_LINE>SyncConfirmationsSender.forCurrentTransaction(senderToProcurementWebUI).confirm(syncProductSupply, serverEventId);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | valueOf(qtyReportEvent.getPMM_QtyReport_Event_ID()); |
180,689 | protected <T> T cast(Object o, Class<T> clazz) {<NEW_LINE>if (UaEnumeration.class.isAssignableFrom(clazz) && o instanceof Integer) {<NEW_LINE>try {<NEW_LINE>Object enumeration = clazz.getMethod("from", new Class[] { Integer.class }).invoke(null, o);<NEW_LINE>return clazz.cast(enumeration);<NEW_LINE>} catch (IllegalAccessException | InvocationTargetException | NoSuchMethodException e) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>} else if (o instanceof ExtensionObject) {<NEW_LINE>ExtensionObject xo = (ExtensionObject) o;<NEW_LINE>Object decoded = xo.decode(client.getStaticSerializationContext());<NEW_LINE>return clazz.cast(decoded);<NEW_LINE>} else if (o instanceof ExtensionObject[]) {<NEW_LINE>ExtensionObject[] xos = (ExtensionObject[]) o;<NEW_LINE>Class<?> componentType = clazz.getComponentType();<NEW_LINE>Object array = Array.<MASK><NEW_LINE>for (int i = 0; i < xos.length; i++) {<NEW_LINE>ExtensionObject xo = xos[i];<NEW_LINE>Object decoded = xo.decode(client.getStaticSerializationContext());<NEW_LINE>Array.set(array, i, componentType.cast(decoded));<NEW_LINE>}<NEW_LINE>return clazz.cast(array);<NEW_LINE>} else {<NEW_LINE>return clazz.cast(o);<NEW_LINE>}<NEW_LINE>} | newInstance(componentType, xos.length); |
1,205,819 | public boolean canWrite(final File f) {<NEW_LINE>final Boolean[] ret = new Boolean[] { null };<NEW_LINE>for (Iterator<BaseAnnotationProvider> it = annotationProviders.iterator(); it.hasNext(); ) {<NEW_LINE><MASK><NEW_LINE>final InterceptionListener iListener = (provider != null) ? provider.getInterceptionListener() : null;<NEW_LINE>if (iListener instanceof ProvidedExtensions) {<NEW_LINE>runCheckCode(new Runnable() {<NEW_LINE><NEW_LINE>public void run() {<NEW_LINE>ProvidedExtensions extension = (ProvidedExtensions) iListener;<NEW_LINE>if (ProvidedExtensionsAccessor.IMPL != null && ProvidedExtensionsAccessor.IMPL.providesCanWrite(extension)) {<NEW_LINE>ret[0] = ((ProvidedExtensions) iListener).canWrite(f);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>if (ret[0] != null && ret[0]) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return ret[0] != null ? ret[0] : super.canWrite(f);<NEW_LINE>} | BaseAnnotationProvider provider = it.next(); |
1,043,897 | /*<NEW_LINE>* Look for missing type parameters @param tags<NEW_LINE>*/<NEW_LINE>private char[][] missingTypeParameterTags(Binding paramNameRefBinding, Scope scope) {<NEW_LINE>int paramTypeParamLength = this.paramTypeParameters == null ? 0 : this.paramTypeParameters.length;<NEW_LINE>// Verify if there's any type parameter to tag<NEW_LINE>TypeParameter[] parameters = null;<NEW_LINE>TypeVariableBinding[] typeVariables = null;<NEW_LINE>switch(scope.kind) {<NEW_LINE>case Scope.METHOD_SCOPE:<NEW_LINE>AbstractMethodDeclaration methodDeclaration = ((MethodScope) scope).referenceMethod();<NEW_LINE>if (methodDeclaration == null)<NEW_LINE>return null;<NEW_LINE>parameters = methodDeclaration.typeParameters();<NEW_LINE>typeVariables = methodDeclaration.binding.typeVariables;<NEW_LINE>break;<NEW_LINE>case Scope.CLASS_SCOPE:<NEW_LINE>TypeDeclaration typeDeclaration = ((ClassScope) scope).referenceContext;<NEW_LINE>parameters = typeDeclaration.typeParameters;<NEW_LINE>typeVariables = typeDeclaration.binding.typeVariables;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>if (typeVariables == null || typeVariables.length == 0)<NEW_LINE>return null;<NEW_LINE>// Store all type parameters if there's no @param in javadoc<NEW_LINE>if (parameters != null) {<NEW_LINE>int typeParametersLength = parameters.length;<NEW_LINE>if (paramTypeParamLength == 0) {<NEW_LINE>char[][] missingParams = new char[typeParametersLength][];<NEW_LINE>for (int i = 0; i < typeParametersLength; i++) {<NEW_LINE>missingParams[i] = parameters[i].name;<NEW_LINE>}<NEW_LINE>return missingParams;<NEW_LINE>}<NEW_LINE>// Look for missing type parameter<NEW_LINE>char[][] missingParams = new char[typeParametersLength][];<NEW_LINE>int size = 0;<NEW_LINE>for (int i = 0; i < typeParametersLength; i++) {<NEW_LINE>TypeParameter parameter = parameters[i];<NEW_LINE>boolean found = false;<NEW_LINE>int paramNameRefCount = 0;<NEW_LINE>for (int j = 0; j < paramTypeParamLength && !found; j++) {<NEW_LINE>if (TypeBinding.equalsEquals(parameter.binding, this.paramTypeParameters[j].resolvedType)) {<NEW_LINE>if (parameter.binding == paramNameRefBinding) {<NEW_LINE>// do not count first occurence of param nmae reference<NEW_LINE>paramNameRefCount++;<NEW_LINE>found = paramNameRefCount > 1;<NEW_LINE>} else {<NEW_LINE>found = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!found) {<NEW_LINE>missingParams[size++] = parameter.name;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (size > 0) {<NEW_LINE>if (size != typeParametersLength) {<NEW_LINE>System.arraycopy(missingParams, 0, missingParams = new char[size<MASK><NEW_LINE>}<NEW_LINE>return missingParams;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | ][], 0, size); |
1,731,325 | public static ListPhoneNumbersOfSkillGroupResponse unmarshall(ListPhoneNumbersOfSkillGroupResponse listPhoneNumbersOfSkillGroupResponse, UnmarshallerContext _ctx) {<NEW_LINE>listPhoneNumbersOfSkillGroupResponse.setRequestId(_ctx.stringValue("ListPhoneNumbersOfSkillGroupResponse.RequestId"));<NEW_LINE>listPhoneNumbersOfSkillGroupResponse.setCode(_ctx.stringValue("ListPhoneNumbersOfSkillGroupResponse.Code"));<NEW_LINE>listPhoneNumbersOfSkillGroupResponse.setHttpStatusCode(_ctx.integerValue("ListPhoneNumbersOfSkillGroupResponse.HttpStatusCode"));<NEW_LINE>listPhoneNumbersOfSkillGroupResponse.setMessage<MASK><NEW_LINE>Data data = new Data();<NEW_LINE>data.setPageNumber(_ctx.integerValue("ListPhoneNumbersOfSkillGroupResponse.Data.PageNumber"));<NEW_LINE>data.setPageSize(_ctx.integerValue("ListPhoneNumbersOfSkillGroupResponse.Data.PageSize"));<NEW_LINE>data.setTotalCount(_ctx.integerValue("ListPhoneNumbersOfSkillGroupResponse.Data.TotalCount"));<NEW_LINE>List<PhoneNumber> list = new ArrayList<PhoneNumber>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListPhoneNumbersOfSkillGroupResponse.Data.List.Length"); i++) {<NEW_LINE>PhoneNumber phoneNumber = new PhoneNumber();<NEW_LINE>phoneNumber.setActive(_ctx.booleanValue("ListPhoneNumbersOfSkillGroupResponse.Data.List[" + i + "].Active"));<NEW_LINE>phoneNumber.setNumber(_ctx.stringValue("ListPhoneNumbersOfSkillGroupResponse.Data.List[" + i + "].Number"));<NEW_LINE>phoneNumber.setCity(_ctx.stringValue("ListPhoneNumbersOfSkillGroupResponse.Data.List[" + i + "].City"));<NEW_LINE>phoneNumber.setInstanceId(_ctx.stringValue("ListPhoneNumbersOfSkillGroupResponse.Data.List[" + i + "].InstanceId"));<NEW_LINE>phoneNumber.setUsage(_ctx.stringValue("ListPhoneNumbersOfSkillGroupResponse.Data.List[" + i + "].Usage"));<NEW_LINE>phoneNumber.setContactFlowId(_ctx.stringValue("ListPhoneNumbersOfSkillGroupResponse.Data.List[" + i + "].ContactFlowId"));<NEW_LINE>phoneNumber.setProvince(_ctx.stringValue("ListPhoneNumbersOfSkillGroupResponse.Data.List[" + i + "].Province"));<NEW_LINE>list.add(phoneNumber);<NEW_LINE>}<NEW_LINE>data.setList(list);<NEW_LINE>listPhoneNumbersOfSkillGroupResponse.setData(data);<NEW_LINE>return listPhoneNumbersOfSkillGroupResponse;<NEW_LINE>} | (_ctx.stringValue("ListPhoneNumbersOfSkillGroupResponse.Message")); |
35,290 | private static void writeExternal(@Nonnull Element element, @Nonnull ShelvedChangeList shelvedChangeList) throws WriteExternalException {<NEW_LINE>DefaultJDOMExternalizer.writeExternal(shelvedChangeList, element);<NEW_LINE>element.setAttribute(NAME_ATTRIBUTE, shelvedChangeList.getName());<NEW_LINE>element.setAttribute(ATTRIBUTE_DATE, Long.toString(shelvedChangeList<MASK><NEW_LINE>element.setAttribute(ATTRIBUTE_RECYCLED_CHANGELIST, Boolean.toString(shelvedChangeList.isRecycled()));<NEW_LINE>if (shelvedChangeList.isMarkedToDelete()) {<NEW_LINE>element.setAttribute(ATTRIBUTE_TOBE_DELETED_CHANGELIST, Boolean.toString(shelvedChangeList.isMarkedToDelete()));<NEW_LINE>}<NEW_LINE>for (ShelvedBinaryFile file : shelvedChangeList.getBinaryFiles()) {<NEW_LINE>Element child = new Element(ELEMENT_BINARY);<NEW_LINE>file.writeExternal(child);<NEW_LINE>element.addContent(child);<NEW_LINE>}<NEW_LINE>} | .DATE.getTime())); |
67,104 | private void createPackageDeclaration(ModuleNode moduleNode) {<NEW_LINE>if (moduleNode.hasPackageName()) {<NEW_LINE>String packageName = moduleNode.getPackageName();<NEW_LINE>if (packageName.endsWith(".")) {<NEW_LINE>packageName = packageName.substring(0, packageName.length() - 1);<NEW_LINE>}<NEW_LINE>PackageNode packageNode = moduleNode.getPackage();<NEW_LINE>char[][] splits = CharOperation.splitOn('.', packageName.toCharArray());<NEW_LINE>long[] positions = positionsFor(splits, startOffset(packageNode), endOffset(packageNode));<NEW_LINE>ImportReference ref = new ImportReference(splits, positions, true, Flags.AccDefault);<NEW_LINE>ref.annotations = <MASK><NEW_LINE>ref.declarationEnd = ref.sourceEnd + trailerLength(packageNode);<NEW_LINE>ref.declarationSourceStart = Math.max(0, ref.sourceStart - "package ".length());<NEW_LINE>ref.declarationSourceEnd = ref.sourceEnd;<NEW_LINE>unitDeclaration.currentPackage = ref;<NEW_LINE>}<NEW_LINE>} | createAnnotations(packageNode.getAnnotations()); |
1,527,112 | public static DatabaseType fromMetaData(DataSource dataSource) throws MetaDataAccessException {<NEW_LINE>String databaseProductName = JdbcUtils.extractDatabaseMetaData(dataSource, DatabaseMetaData::getDatabaseProductName);<NEW_LINE>if (StringUtils.hasText(databaseProductName) && databaseProductName.startsWith("DB2")) {<NEW_LINE>String databaseProductVersion = JdbcUtils.<MASK><NEW_LINE>if (databaseProductVersion.startsWith("ARI")) {<NEW_LINE>databaseProductName = "DB2VSE";<NEW_LINE>} else if (databaseProductVersion.startsWith("DSN")) {<NEW_LINE>databaseProductName = "DB2ZOS";<NEW_LINE>} else if (databaseProductName.contains("AS") && (databaseProductVersion.startsWith("QSQ") || databaseProductVersion.substring(databaseProductVersion.indexOf('V')).matches("V\\dR\\d[mM]\\d"))) {<NEW_LINE>databaseProductName = "DB2AS400";<NEW_LINE>} else {<NEW_LINE>databaseProductName = JdbcUtils.commonDatabaseName(databaseProductName);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>databaseProductName = JdbcUtils.commonDatabaseName(databaseProductName);<NEW_LINE>}<NEW_LINE>return fromProductName(databaseProductName);<NEW_LINE>} | extractDatabaseMetaData(dataSource, DatabaseMetaData::getDatabaseProductVersion); |
1,261,053 | public static Column createColumn(String name, Operation op, QueryState state, String prefix, String suffix) {<NEW_LINE>if (!name.equals("*")) {<NEW_LINE>name = Heading.findOriginal(state.originalSql(), name, prefix, suffix);<NEW_LINE>}<NEW_LINE>if (name.contains(".")) {<NEW_LINE>String head = name.split("\\.")[0];<NEW_LINE>for (QuerySource tr : state.getSources()) {<NEW_LINE>if (tr.getAlias() != null && head.equals(tr.getAlias())) {<NEW_LINE>if (op != null)<NEW_LINE>return new Column(name.substring(name.indexOf('.') + 1), op).setTable(tr.getSource(), tr.getAlias());<NEW_LINE>return new Column(name.substring(name.indexOf('.') + 1)).setTable(tr.getSource(<MASK><NEW_LINE>} else if (head.equals(tr.getSource())) {<NEW_LINE>if (op != null)<NEW_LINE>return new Column(name.substring(name.indexOf('.') + 1), op).setTable(tr.getSource(), tr.getAlias());<NEW_LINE>return new Column(name.substring(name.indexOf('.') + 1)).setTable(tr.getSource(), tr.getAlias());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (op != null)<NEW_LINE>return new Column(name, op);<NEW_LINE>return new Column(name);<NEW_LINE>} | ), tr.getAlias()); |
1,184,094 | public DescribeAddonResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>DescribeAddonResult describeAddonResult = new DescribeAddonResult();<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 describeAddonResult;<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("addon", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>describeAddonResult.setAddon(AddonJsonUnmarshaller.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 describeAddonResult;<NEW_LINE>} | String currentParentElement = context.getCurrentParentElement(); |
1,338,249 | public void loadFrom(RootNode root) {<NEW_LINE>List<ClassNode> list = root.getClasses(true);<NEW_LINE>Map<String, ClspClass> names = new HashMap<>(list.size());<NEW_LINE>int k = 0;<NEW_LINE>for (ClassNode cls : list) {<NEW_LINE>ArgType clsType = cls.getClassInfo().getType();<NEW_LINE>String clsRawName = clsType.getObject();<NEW_LINE>cls.load();<NEW_LINE>ClspClass nClass = new ClspClass(clsType, k);<NEW_LINE>if (names.put(clsRawName, nClass) != null) {<NEW_LINE>throw new JadxRuntimeException("Duplicate class: " + clsRawName);<NEW_LINE>}<NEW_LINE>k++;<NEW_LINE>nClass.<MASK><NEW_LINE>nClass.setMethods(getMethodsDetails(cls));<NEW_LINE>}<NEW_LINE>classes = new ClspClass[k];<NEW_LINE>k = 0;<NEW_LINE>for (ClassNode cls : list) {<NEW_LINE>ClspClass nClass = getCls(cls, names);<NEW_LINE>if (nClass == null) {<NEW_LINE>throw new JadxRuntimeException("Missing class: " + cls);<NEW_LINE>}<NEW_LINE>nClass.setParents(makeParentsArray(cls));<NEW_LINE>classes[k] = nClass;<NEW_LINE>k++;<NEW_LINE>}<NEW_LINE>} | setTypeParameters(cls.getGenericTypeParameters()); |
1,146,300 | private static Node ReactDatabaseSupplier(final ClassOrInterfaceDeclaration n) {<NEW_LINE>// ReactDatabaseSupplier(Context context)<NEW_LINE>{<NEW_LINE>ConstructorDeclaration c = new ConstructorDeclaration(EnumSet.of<MASK><NEW_LINE>NodeList<Parameter> parameters = NodeList.nodeList(new Parameter(JavaParser.parseClassOrInterfaceType("Context"), "context"));<NEW_LINE>c.setParameters(parameters);<NEW_LINE>BlockStmt block = new BlockStmt();<NEW_LINE>NodeList<Expression> superArgs = NodeList.nodeList(JavaParser.parseExpression("context"), JavaParser.parseExpression("\"RKStorage\""), JavaParser.parseExpression("null"), JavaParser.parseExpression("DATABASE_VERSION"));<NEW_LINE>MethodCallExpr call = new MethodCallExpr(null, "super", superArgs);<NEW_LINE>block.addStatement(call);<NEW_LINE>block.addStatement(JavaParser.parseStatement("mContext = context;"));<NEW_LINE>block.addStatement(JavaParser.parseStatement("DATABASE_NAME = \"RKStorage\";"));<NEW_LINE>c.setBody(block);<NEW_LINE>n.addMember(c);<NEW_LINE>}<NEW_LINE>// ReactDatabaseSupplier(Context context, String databaseName)<NEW_LINE>{<NEW_LINE>ConstructorDeclaration c = new ConstructorDeclaration(EnumSet.of(Modifier.PUBLIC), "ReactDatabaseSupplier");<NEW_LINE>NodeList<Parameter> parameters = NodeList.nodeList(new Parameter(JavaParser.parseClassOrInterfaceType("Context"), "context"), new Parameter(JavaParser.parseClassOrInterfaceType("String"), "databaseName"));<NEW_LINE>c.setParameters(parameters);<NEW_LINE>BlockStmt block = new BlockStmt();<NEW_LINE>NodeList<Expression> superArgs = NodeList.nodeList(JavaParser.parseExpression("context"), JavaParser.parseExpression("databaseName"), JavaParser.parseExpression("null"), JavaParser.parseExpression("DATABASE_VERSION"));<NEW_LINE>MethodCallExpr call = new MethodCallExpr(null, "super", superArgs);<NEW_LINE>block.addStatement(call);<NEW_LINE>block.addStatement(JavaParser.parseStatement("mContext = context;"));<NEW_LINE>block.addStatement(JavaParser.parseStatement("DATABASE_NAME = databaseName;"));<NEW_LINE>c.setBody(block);<NEW_LINE>n.addMember(c);<NEW_LINE>}<NEW_LINE>return n;<NEW_LINE>} | (Modifier.PUBLIC), "ReactDatabaseSupplier"); |
257,502 | final AttachPolicyResult executeAttachPolicy(AttachPolicyRequest attachPolicyRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(attachPolicyRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<AttachPolicyRequest> request = null;<NEW_LINE>Response<AttachPolicyResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new AttachPolicyRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(attachPolicyRequest));<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, "Organizations");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "AttachPolicy");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<AttachPolicyResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new AttachPolicyResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} | endClientExecution(awsRequestMetrics, request, response); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.