idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
962,788
final GetServiceLastAccessedDetailsWithEntitiesResult executeGetServiceLastAccessedDetailsWithEntities(GetServiceLastAccessedDetailsWithEntitiesRequest getServiceLastAccessedDetailsWithEntitiesRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getServiceLastAccessedDetailsWithEntitiesRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetServiceLastAccessedDetailsWithEntitiesRequest> request = null;<NEW_LINE>Response<GetServiceLastAccessedDetailsWithEntitiesResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetServiceLastAccessedDetailsWithEntitiesRequestMarshaller().marshall(super.beforeMarshalling(getServiceLastAccessedDetailsWithEntitiesRequest));<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, "IAM");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetServiceLastAccessedDetailsWithEntities");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<GetServiceLastAccessedDetailsWithEntitiesResult> responseHandler = new StaxResponseHandler<GetServiceLastAccessedDetailsWithEntitiesResult>(new GetServiceLastAccessedDetailsWithEntitiesResultStaxUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
763,843
public String createIdentifier(DvObject dvObject) throws Throwable {<NEW_LINE>logger.log(Level.FINE, "createIdentifier");<NEW_LINE>if (dvObject.getIdentifier() == null || dvObject.getIdentifier().isEmpty()) {<NEW_LINE>dvObject = generateIdentifier(dvObject);<NEW_LINE>}<NEW_LINE>String identifier = getIdentifier(dvObject);<NEW_LINE>Map<String, String> metadata = getMetadataForCreateIndicator(dvObject);<NEW_LINE>String objMetadata = getMetadataFromDvObject(identifier, metadata, dvObject);<NEW_LINE>Map<String, String> dcMetadata;<NEW_LINE>dcMetadata = new HashMap<>();<NEW_LINE>dcMetadata.put("datacite", objMetadata);<NEW_LINE>dcMetadata.put("datacite.resourcetype", "Dataset");<NEW_LINE>dcMetadata.put("_status", "reserved");<NEW_LINE>try {<NEW_LINE>String retString = ezidService.createIdentifier(identifier, asHashMap(dcMetadata));<NEW_LINE>logger.log(Level.FINE, "create DOI identifier retString : {0}", retString);<NEW_LINE>return retString;<NEW_LINE>} catch (EZIDException e) {<NEW_LINE>logger.log(Level.WARNING, "Identifier not created: create failed");<NEW_LINE>logger.log(Level.WARNING, "String {0}", e.toString());<NEW_LINE>logger.log(Level.WARNING, "localized message {0}", e.getLocalizedMessage());<NEW_LINE>logger.log(Level.WARNING, "cause", e.getCause());<NEW_LINE>logger.log(Level.WARNING, "message {0}", e.getMessage());<NEW_LINE>logger.log(<MASK><NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>}
Level.WARNING, "identifier: ", identifier);
296,912
static List<PathSegment> parse(String path) {<NEW_LINE>requireNonNull(path, "path");<NEW_LINE>checkArgument(!path.isEmpty(), "path is empty.");<NEW_LINE>final <MASK><NEW_LINE>checkArgument(context.read() == '/', "path: %s (must start with '/')", context.path());<NEW_LINE>final ImmutableList.Builder<PathSegment> segments = ImmutableList.builder();<NEW_LINE>// Parse 'Segments' until the start symbol of 'Verb' part.<NEW_LINE>// Basically, 'parse*' methods stop reading path characters if they see a delimiter. Also, they don't<NEW_LINE>// consume the delimiter so that a caller can check the delimiter.<NEW_LINE>segments.addAll(parseSegments(context, new Delimiters(':')));<NEW_LINE>if (context.hasNext()) {<NEW_LINE>// Consume the start symbol ':'.<NEW_LINE>checkArgument(context.read() == ':', "path: %s (invalid verb part at index %s)", context.path(), context.index());<NEW_LINE>// We don't check 'Verb' part because we don't use it when generating a corresponding path pattern.<NEW_LINE>segments.add(new VerbPathSegment(context.readAll()));<NEW_LINE>}<NEW_LINE>final List<PathSegment> pathSegments = segments.build();<NEW_LINE>checkArgument(!pathSegments.isEmpty(), "path: %s (must contain at least one segment)", context.path());<NEW_LINE>return pathSegments;<NEW_LINE>}
Context context = new Context(path);
729,241
public void tableChanged(WTableModelEvent e) {<NEW_LINE>if (e.getColumn() != 0)<NEW_LINE>return;<NEW_LINE>log.config("Row=" + e.getFirstRow() + "-" + e.getLastRow() + ", Col=" + e.getColumn() + ", Type=" + e.getType());<NEW_LINE>// Matched From<NEW_LINE>int matchedRow = xMatchedTable.getSelectedRow();<NEW_LINE>KeyNamePair Product = (KeyNamePair) <MASK><NEW_LINE>// Matched To<NEW_LINE>Optional<BigDecimal> qty = Optional.ofNullable(Env.ZERO);<NEW_LINE>int noRows = 0;<NEW_LINE>for (int row = 0; row < xMatchedToTable.getRowCount(); row++) {<NEW_LINE>IDColumn id = (IDColumn) xMatchedToTable.getValueAt(row, 0);<NEW_LINE>if (id != null && id.isSelected()) {<NEW_LINE>KeyNamePair ProductCompare = (KeyNamePair) xMatchedToTable.getValueAt(row, 5);<NEW_LINE>if (Product.getKey() != ProductCompare.getKey()) {<NEW_LINE>id.setSelected(false);<NEW_LINE>} else {<NEW_LINE>Optional<BigDecimal> docQty = Optional.ofNullable((BigDecimal) xMatchedToTable.getValueAt(row, I_QTY));<NEW_LINE>Optional<BigDecimal> matchedQty = Optional.ofNullable((BigDecimal) xMatchedToTable.getValueAt(row, I_MATCHED));<NEW_LINE>if (matchMode.getSelectedIndex() == MODE_NOTMATCHED)<NEW_LINE>// doc<NEW_LINE>qty = Optional.ofNullable(qty.orElse(Env.ZERO).add(docQty.orElse(Env.ZERO)));<NEW_LINE>// matched<NEW_LINE>qty = Optional.ofNullable(qty.orElse(Env.ZERO).subtract(matchedQty.orElse(Env.ZERO)));<NEW_LINE>noRows++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// update qualtities<NEW_LINE>m_xMatchedTo = qty.orElse(Env.ZERO);<NEW_LINE>xMatchedTo.setValue(m_xMatchedTo);<NEW_LINE>difference.setValue(m_xMatched.subtract(m_xMatchedTo));<NEW_LINE>bProcess.setEnabled(noRows != 0);<NEW_LINE>// Status<NEW_LINE>statusBar.setStatusDB(noRows + "");<NEW_LINE>}
xMatchedTable.getValueAt(matchedRow, 5);
1,013,190
protected void addCommonTaskFields(TaskEntity task, ObjectNode data) {<NEW_LINE>putIfNotNull(data, CmmnAsyncHistoryConstants.FIELD_ID, task.getId());<NEW_LINE>putIfNotNull(data, CmmnAsyncHistoryConstants.FIELD_REVISION, task.getRevision());<NEW_LINE>putIfNotNull(data, CmmnAsyncHistoryConstants.FIELD_NAME, task.getName());<NEW_LINE>putIfNotNull(data, CmmnAsyncHistoryConstants.FIELD_PARENT_TASK_ID, task.getParentTaskId());<NEW_LINE>putIfNotNull(data, CmmnAsyncHistoryConstants.FIELD_DESCRIPTION, task.getDescription());<NEW_LINE>putIfNotNull(data, CmmnAsyncHistoryConstants.FIELD_OWNER, task.getOwner());<NEW_LINE>putIfNotNull(data, CmmnAsyncHistoryConstants.FIELD_ASSIGNEE, task.getAssignee());<NEW_LINE>putIfNotNull(data, CmmnAsyncHistoryConstants.FIELD_CREATE_TIME, task.getCreateTime());<NEW_LINE>putIfNotNull(data, CmmnAsyncHistoryConstants.FIELD_TASK_DEFINITION_KEY, task.getTaskDefinitionKey());<NEW_LINE>putIfNotNull(data, CmmnAsyncHistoryConstants.<MASK><NEW_LINE>putIfNotNull(data, CmmnAsyncHistoryConstants.FIELD_PRIORITY, task.getPriority());<NEW_LINE>putIfNotNull(data, CmmnAsyncHistoryConstants.FIELD_DUE_DATE, task.getDueDate());<NEW_LINE>putIfNotNull(data, CmmnAsyncHistoryConstants.FIELD_CATEGORY, task.getCategory());<NEW_LINE>putIfNotNull(data, CmmnAsyncHistoryConstants.FIELD_FORM_KEY, task.getFormKey());<NEW_LINE>putIfNotNull(data, CmmnAsyncHistoryConstants.FIELD_TENANT_ID, task.getTenantId());<NEW_LINE>putIfNotNull(data, CmmnAsyncHistoryConstants.FIELD_CLAIM_TIME, task.getClaimTime());<NEW_LINE>putIfNotNull(data, CmmnAsyncHistoryConstants.FIELD_CASE_INSTANCE_ID, task.getScopeId());<NEW_LINE>putIfNotNull(data, CmmnAsyncHistoryConstants.FIELD_SCOPE_ID, task.getScopeId());<NEW_LINE>putIfNotNull(data, CmmnAsyncHistoryConstants.FIELD_CASE_INSTANCE_ID, task.getScopeId());<NEW_LINE>putIfNotNull(data, CmmnAsyncHistoryConstants.FIELD_SUB_SCOPE_ID, task.getSubScopeId());<NEW_LINE>putIfNotNull(data, CmmnAsyncHistoryConstants.FIELD_PLAN_ITEM_INSTANCE_ID, task.getSubScopeId());<NEW_LINE>putIfNotNull(data, CmmnAsyncHistoryConstants.FIELD_SCOPE_TYPE, task.getScopeType());<NEW_LINE>putIfNotNull(data, CmmnAsyncHistoryConstants.FIELD_SCOPE_DEFINITION_ID, task.getScopeDefinitionId());<NEW_LINE>if (task.getScopeDefinitionId() != null) {<NEW_LINE>addCaseDefinitionFields(data, CaseDefinitionUtil.getCaseDefinition(task.getScopeDefinitionId()));<NEW_LINE>}<NEW_LINE>}
FIELD_TASK_DEFINITION_ID, task.getTaskDefinitionId());
603,203
public void init(Map<String, Object> parameters) throws Exception {<NEW_LINE>dataSource = null;<NEW_LINE>tableName = null;<NEW_LINE>geomColumn = null;<NEW_LINE>String value = (String) parameters.get("table_name");<NEW_LINE>if (Helper.isEmpty(value))<NEW_LINE>throw new InternalServerException(IsochronesErrorCodes.UNKNOWN, "'table_name' parameter can not be null or empty.");<NEW_LINE>else<NEW_LINE>tableName = value;<NEW_LINE>value = (<MASK><NEW_LINE>if (Helper.isEmpty(value))<NEW_LINE>throw new InternalServerException(IsochronesErrorCodes.UNKNOWN, "'geometry_column' parameter can not be null or empty.");<NEW_LINE>else<NEW_LINE>geomColumn = value;<NEW_LINE>// https://github.com/pgjdbc/pgjdbc/pull/772<NEW_LINE>org.postgresql.Driver.isRegistered();<NEW_LINE>HikariConfig config = new HikariConfig();<NEW_LINE>String port = "5432";<NEW_LINE>if (parameters.containsKey("port"))<NEW_LINE>port = Integer.toString((Integer) parameters.get("port"));<NEW_LINE>config.setJdbcUrl(String.format("jdbc:postgresql://%s:%s/%s", parameters.get("host"), port, parameters.get("db_name")));<NEW_LINE>config.setDataSourceClassName(PGSimpleDataSource.class.getName());<NEW_LINE>config.addDataSourceProperty("databaseName", parameters.get("db_name"));<NEW_LINE>config.addDataSourceProperty("user", parameters.get("user"));<NEW_LINE>if (parameters.containsKey(PARAM_KEY_PASS))<NEW_LINE>config.addDataSourceProperty(PARAM_KEY_PASS, parameters.get(PARAM_KEY_PASS));<NEW_LINE>config.addDataSourceProperty("serverName", parameters.get("host"));<NEW_LINE>config.addDataSourceProperty("portNumber", parameters.get("port"));<NEW_LINE>if (parameters.containsKey("max_pool_size"))<NEW_LINE>config.setMaximumPoolSize((Integer) parameters.get("max_pool_size"));<NEW_LINE>config.setMinimumIdle(1);<NEW_LINE>config.setConnectionTestQuery("SELECT 1");<NEW_LINE>dataSource = new HikariDataSource(config);<NEW_LINE>}
String) parameters.get("geometry_column");
1,514,615
private Object processTimeoutStage(FaultToleranceInvocation invocation, AsyncFuture asyncAttempt) throws Exception {<NEW_LINE>if (!isTimeoutPresent()) {<NEW_LINE>return processBulkheadStage(invocation);<NEW_LINE>}<NEW_LINE>logger.log(Level.FINER, "Proceeding invocation with timeout semantics");<NEW_LINE>long timeoutDuration = Duration.of(timeout.value, timeout.unit).toMillis();<NEW_LINE>long timeoutTime <MASK><NEW_LINE>Thread current = Thread.currentThread();<NEW_LINE>AtomicBoolean timedOut = new AtomicBoolean(false);<NEW_LINE>Future<?> timeout = invocation.context.runDelayed(timeoutDuration, () -> {<NEW_LINE>logger.log(Level.FINE, "Interrupting attempt due to timeout.");<NEW_LINE>timedOut.set(true);<NEW_LINE>current.interrupt();<NEW_LINE>invocation.metrics.incrementTimeoutCallsTimedOutTotal();<NEW_LINE>if (asyncAttempt != null) {<NEW_LINE>// we do this since interrupting not necessarily returns directly or ever but the attempt should timeout now<NEW_LINE>asyncAttempt.setExceptionThrown(true);<NEW_LINE>asyncAttempt.completeExceptionally(new TimeoutException());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>long executionStartTime = System.nanoTime();<NEW_LINE>try {<NEW_LINE>Object resultValue = processBulkheadStage(invocation);<NEW_LINE>if (current.isInterrupted()) {<NEW_LINE>// clear the flag<NEW_LINE>Thread.interrupted();<NEW_LINE>}<NEW_LINE>if (timedOut.get() || System.currentTimeMillis() > timeoutTime) {<NEW_LINE>throw new TimeoutException();<NEW_LINE>}<NEW_LINE>invocation.metrics.incrementTimeoutCallsNotTimedOutTotal();<NEW_LINE>return resultValue;<NEW_LINE>} catch (TimeoutException ex) {<NEW_LINE>logger.log(Level.FINE, "Execution timed out.");<NEW_LINE>throw ex;<NEW_LINE>} catch (Exception | Error ex) {<NEW_LINE>if (timedOut.get() || System.currentTimeMillis() > timeoutTime) {<NEW_LINE>logger.log(Level.FINE, "Execution timed out.");<NEW_LINE>throw new TimeoutException(ex);<NEW_LINE>}<NEW_LINE>throw ex;<NEW_LINE>} finally {<NEW_LINE>invocation.metrics.addTimeoutExecutionDuration(System.nanoTime() - executionStartTime);<NEW_LINE>timeout.cancel(true);<NEW_LINE>}<NEW_LINE>}
= System.currentTimeMillis() + timeoutDuration;
1,242,489
private static boolean processSomeFilesWhileUserIsInactive(@Nonnull FileContentQueue queue, @Nonnull ProgressUpdater progressUpdater, @Nonnull ProgressIndicator suspendableIndicator, @Nonnull Project project, @Nonnull Consumer<? super FileContent> fileProcessor) {<NEW_LINE>final ProgressIndicatorBase innerIndicator = new ProgressIndicatorBase() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected boolean isCancelable() {<NEW_LINE>// the inner indicator must be always cancelable<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>};<NEW_LINE>final ApplicationListener canceller = new ApplicationListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void beforeWriteActionStart(@Nonnull Object action) {<NEW_LINE>innerIndicator.cancel();<NEW_LINE>}<NEW_LINE>};<NEW_LINE>final Application application = ApplicationManager.getApplication();<NEW_LINE>Disposable listenerDisposable = Disposable.newDisposable();<NEW_LINE>application.invokeAndWait(() -> application.addApplicationListener(canceller, listenerDisposable), ModalityState.any());<NEW_LINE>final AtomicBoolean isFinished = new AtomicBoolean();<NEW_LINE>try {<NEW_LINE>int threadsCount = indexingThreadCount();<NEW_LINE>if (threadsCount == 1 || application.isWriteAccessAllowed()) {<NEW_LINE>Runnable process = createRunnable(project, queue, progressUpdater, suspendableIndicator, innerIndicator, isFinished, fileProcessor);<NEW_LINE>ProgressManager.getInstance().runProcess(process, innerIndicator);<NEW_LINE>} else {<NEW_LINE>AtomicBoolean[] finishedRefs = new AtomicBoolean[threadsCount];<NEW_LINE>Future<?>[] futures = new Future<?>[threadsCount];<NEW_LINE>for (int i = 0; i < threadsCount; i++) {<NEW_LINE>AtomicBoolean localFinished = new AtomicBoolean();<NEW_LINE>finishedRefs[i] = localFinished;<NEW_LINE>Runnable process = createRunnable(project, queue, progressUpdater, suspendableIndicator, innerIndicator, localFinished, fileProcessor);<NEW_LINE>futures[i<MASK><NEW_LINE>}<NEW_LINE>isFinished.set(waitForAll(finishedRefs, futures));<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>Disposer.dispose(listenerDisposable);<NEW_LINE>}<NEW_LINE>return isFinished.get();<NEW_LINE>}
] = application.executeOnPooledThread(process);
1,718,547
public okhttp3.Call connectGetNamespacedServiceProxyWithPathCall(String name, String namespace, String path, String path2, final ApiCallback _callback) throws ApiException {<NEW_LINE>Object localVarPostBody = null;<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/api/v1/namespaces/{namespace}/services/{name}/proxy/{path}".replaceAll("\\{" + "name" + "\\}", localVarApiClient.escapeString(name.toString())).replaceAll("\\{" + "namespace" + "\\}", localVarApiClient.escapeString(namespace.toString())).replaceAll("\\{" + "path" + "\\}", localVarApiClient.escapeString(path.toString()));<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();<NEW_LINE>if (path2 != null) {<NEW_LINE>localVarQueryParams.addAll(localVarApiClient.parameterToPair("path", path2));<NEW_LINE>}<NEW_LINE>Map<String, String> localVarHeaderParams = new <MASK><NEW_LINE>Map<String, String> localVarCookieParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>final String[] localVarAccepts = { "*/*" };<NEW_LINE>final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>if (localVarAccept != null) {<NEW_LINE>localVarHeaderParams.put("Accept", localVarAccept);<NEW_LINE>}<NEW_LINE>final String[] localVarContentTypes = {};<NEW_LINE>final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>localVarHeaderParams.put("Content-Type", localVarContentType);<NEW_LINE>String[] localVarAuthNames = new String[] { "BearerToken" };<NEW_LINE>return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);<NEW_LINE>}
HashMap<String, String>();
285,687
public static JobLogPo convertJobLog(JobMeta jobMeta) {<NEW_LINE>JobLogPo jobLogPo = new JobLogPo();<NEW_LINE>jobLogPo.setGmtCreated(SystemClock.now());<NEW_LINE>Job job = jobMeta.getJob();<NEW_LINE>jobLogPo.setPriority(job.getPriority());<NEW_LINE>jobLogPo.setExtParams(job.getExtParams());<NEW_LINE>jobLogPo.setInternalExtParams(jobMeta.getInternalExtParams());<NEW_LINE>jobLogPo.setSubmitNodeGroup(job.getSubmitNodeGroup());<NEW_LINE>jobLogPo.setTaskId(job.getTaskId());<NEW_LINE>jobLogPo.setJobType(jobMeta.getJobType());<NEW_LINE>jobLogPo.setRealTaskId(jobMeta.getRealTaskId());<NEW_LINE>jobLogPo.setTaskTrackerNodeGroup(job.getTaskTrackerNodeGroup());<NEW_LINE>jobLogPo.setNeedFeedback(job.isNeedFeedback());<NEW_LINE>jobLogPo.setRetryTimes(jobMeta.getRetryTimes());<NEW_LINE>jobLogPo.setMaxRetryTimes(job.getMaxRetryTimes());<NEW_LINE>jobLogPo.setDepPreCycle(jobMeta.<MASK><NEW_LINE>jobLogPo.setJobId(jobMeta.getJobId());<NEW_LINE>jobLogPo.setCronExpression(job.getCronExpression());<NEW_LINE>jobLogPo.setTriggerTime(job.getTriggerTime());<NEW_LINE>jobLogPo.setRepeatCount(job.getRepeatCount());<NEW_LINE>jobLogPo.setRepeatedCount(jobMeta.getRepeatedCount());<NEW_LINE>jobLogPo.setRepeatInterval(job.getRepeatInterval());<NEW_LINE>return jobLogPo;<NEW_LINE>}
getJob().isRelyOnPrevCycle());
867,811
public AbstractParquetGroupScan build() {<NEW_LINE>AbstractParquetGroupScan newScan = getNewScan();<NEW_LINE>newScan.tableMetadata = tableMetadata;<NEW_LINE>// updates common row count and nulls counts for every column<NEW_LINE>if (newScan.getTableMetadata() != null && rowGroups != null && newScan.getRowGroupsMetadata().size() != rowGroups.size()) {<NEW_LINE>newScan.tableMetadata = TableMetadataUtils.updateRowCount(newScan.getTableMetadata(), rowGroups.values());<NEW_LINE>}<NEW_LINE>newScan.partitions = partitions;<NEW_LINE>newScan.segments = segments;<NEW_LINE>newScan.files = files;<NEW_LINE>newScan.rowGroups = rowGroups;<NEW_LINE>newScan.matchAllMetadata = matchAllMetadata;<NEW_LINE>newScan.nonInterestingColumnsMetadata = nonInterestingColumnsMetadata;<NEW_LINE>newScan.limit = limit;<NEW_LINE>// since builder is used when pruning happens, entries and fileSet should be expanded<NEW_LINE>if (!newScan.getFilesMetadata().isEmpty()) {<NEW_LINE>newScan.entries = newScan.getFilesMetadata().keySet().stream().map(ReadEntryWithPath::new).collect(Collectors.toList());<NEW_LINE>newScan.fileSet = new HashSet<>(newScan.getFilesMetadata().keySet());<NEW_LINE>} else if (!newScan.getRowGroupsMetadata().isEmpty()) {<NEW_LINE>newScan.entries = newScan.getRowGroupsMetadata().keySet().stream().map(ReadEntryWithPath::new).collect(Collectors.toList());<NEW_LINE>newScan.fileSet = new HashSet<>(newScan.<MASK><NEW_LINE>}<NEW_LINE>return newScan;<NEW_LINE>}
getRowGroupsMetadata().keySet());
1,802,561
public Statistics visitIsNullPredicate(IsNullPredicateOperator predicate, Void context) {<NEW_LINE>if (!checkNeedEvalEstimate(predicate)) {<NEW_LINE>return statistics;<NEW_LINE>}<NEW_LINE>double selectivity = 1;<NEW_LINE>List<ColumnRefOperator> children = Utils.extractColumnRef(predicate);<NEW_LINE>if (children.size() != 1) {<NEW_LINE>selectivity = predicate.isNotNull() ? 1 - StatisticsEstimateCoefficient.IS_NULL_PREDICATE_DEFAULT_FILTER_COEFFICIENT : StatisticsEstimateCoefficient.IS_NULL_PREDICATE_DEFAULT_FILTER_COEFFICIENT;<NEW_LINE>double rowCount = statistics.getOutputRowCount() * selectivity;<NEW_LINE>return Statistics.buildFrom(statistics).setOutputRowCount(rowCount).build();<NEW_LINE>}<NEW_LINE>ColumnStatistic isNullColumnStatistic = statistics.getColumnStatistic<MASK><NEW_LINE>if (isNullColumnStatistic.isUnknown()) {<NEW_LINE>selectivity = predicate.isNotNull() ? 1 - StatisticsEstimateCoefficient.IS_NULL_PREDICATE_DEFAULT_FILTER_COEFFICIENT : StatisticsEstimateCoefficient.IS_NULL_PREDICATE_DEFAULT_FILTER_COEFFICIENT;<NEW_LINE>} else {<NEW_LINE>selectivity = predicate.isNotNull() ? 1 - isNullColumnStatistic.getNullsFraction() : isNullColumnStatistic.getNullsFraction();<NEW_LINE>}<NEW_LINE>// avoid estimate selectivity too small because of the error of null fraction<NEW_LINE>selectivity = Math.max(selectivity, StatisticsEstimateCoefficient.IS_NULL_PREDICATE_DEFAULT_FILTER_COEFFICIENT);<NEW_LINE>double rowCount = statistics.getOutputRowCount() * selectivity;<NEW_LINE>return computeStatisticsAfterPredicate(Statistics.buildFrom(statistics).setOutputRowCount(rowCount).addColumnStatistics(ImmutableMap.of(children.get(0), ColumnStatistic.buildFrom(isNullColumnStatistic).setNullsFraction(predicate.isNotNull() ? 0.0 : 1.0).build())).build(), rowCount);<NEW_LINE>}
(children.get(0));
30,095
private void doExperiments() {<NEW_LINE>StdOut.printf("%21s %17s %16s %15s %15s %10s\n", "Method | ", "Data structure |", <MASK><NEW_LINE>int[] initialValues = { 1000, 10000, 100000, 1000000 };<NEW_LINE>int[] bigValues = { 10000000, 100000000, 1000000000 };<NEW_LINE>// Generating integer values<NEW_LINE>countDistinctValues(false, false, false, initialValues);<NEW_LINE>countDistinctValues(true, false, false, initialValues);<NEW_LINE>countDistinctValues(true, true, false, initialValues);<NEW_LINE>countDistinctValues(true, false, false, bigValues);<NEW_LINE>countDistinctValues(true, true, false, bigValues);<NEW_LINE>// Generating long values<NEW_LINE>countDistinctValues(false, false, true, initialValues);<NEW_LINE>countDistinctValues(true, false, true, initialValues);<NEW_LINE>countDistinctValues(true, true, true, initialValues);<NEW_LINE>countDistinctValues(true, false, true, bigValues);<NEW_LINE>countDistinctValues(true, true, true, bigValues);<NEW_LINE>}
"Values type | ", "Values Generated | ", "Max Value | ", "Time spent");
1,831,217
public List<InetRecord> selectTrafficRoutersMiss(final String zoneName, final DeliveryService ds) throws GeolocationException {<NEW_LINE>final List<InetRecord> trafficRouterRecords = new ArrayList<>();<NEW_LINE>if (!isEdgeDNSRouting() && !isEdgeHTTPRouting()) {<NEW_LINE>return trafficRouterRecords;<NEW_LINE>}<NEW_LINE>final List<TrafficRouterLocation> trafficRouterLocations = getCacheRegister().getEdgeTrafficRouterLocations();<NEW_LINE>final List<Node> edgeTrafficRouters = new ArrayList<>();<NEW_LINE>final Map<String, List<Node>> orderedNodes = new HashMap<>();<NEW_LINE>int limit = (getEdgeDNSRoutingLimit() > getEdgeHTTPRoutingLimit(ds)) ? getEdgeDNSRoutingLimit() : getEdgeHTTPRoutingLimit(ds);<NEW_LINE>int index = 0;<NEW_LINE>boolean exhausted = false;<NEW_LINE>// if limits don't exist, or do exist and are higher than the number of edge TRs, use the number of edge TRs as the limit<NEW_LINE>if (limit == 0 || limit > getCacheRegister().getEdgeTrafficRouterCount()) {<NEW_LINE>limit = getCacheRegister().getEdgeTrafficRouterCount();<NEW_LINE>}<NEW_LINE>// grab one TR per location until the limit is reached<NEW_LINE>while (edgeTrafficRouters.size() < limit && !exhausted) {<NEW_LINE>final int initialCount = edgeTrafficRouters.size();<NEW_LINE>for (final TrafficRouterLocation location : trafficRouterLocations) {<NEW_LINE>if (edgeTrafficRouters.size() >= limit) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>if (!orderedNodes.containsKey(location.getId())) {<NEW_LINE>orderedNodes.put(location.getId(), consistentHasher.selectHashables(location.getTrafficRouters(), zoneName));<NEW_LINE>}<NEW_LINE>final List<Node> trafficRouters = orderedNodes.get(location.getId());<NEW_LINE>if (trafficRouters == null || trafficRouters.isEmpty() || index >= trafficRouters.size()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>edgeTrafficRouters.add(trafficRouters.get(index));<NEW_LINE>}<NEW_LINE>if (initialCount == edgeTrafficRouters.size()) {<NEW_LINE>exhausted = true;<NEW_LINE>}<NEW_LINE>index++;<NEW_LINE>}<NEW_LINE>if (!edgeTrafficRouters.isEmpty()) {<NEW_LINE>if (isEdgeDNSRouting()) {<NEW_LINE>trafficRouterRecords.addAll(nsRecordsFromNodes(ds, edgeTrafficRouters));<NEW_LINE>}<NEW_LINE>if (ds != null && !ds.isDns() && isEdgeHTTPRouting()) {<NEW_LINE>// only generate edge routing records for HTTP DSs when necessary<NEW_LINE>trafficRouterRecords.addAll<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>return trafficRouterRecords;<NEW_LINE>}
(inetRecordsFromNodes(ds, edgeTrafficRouters));
132,417
public static double weightedCoefficient(double[] x, double[] y, double[] weights) {<NEW_LINE>final int xdim = x<MASK><NEW_LINE>if (xdim != ydim) {<NEW_LINE>throw new IllegalArgumentException("Invalid arguments: arrays differ in length.");<NEW_LINE>}<NEW_LINE>if (xdim != weights.length) {<NEW_LINE>throw new IllegalArgumentException("Dimensionality doesn't agree to weights.");<NEW_LINE>}<NEW_LINE>if (xdim == 0) {<NEW_LINE>throw new IllegalArgumentException("Empty vector.");<NEW_LINE>}<NEW_LINE>// Inlined computation of Pearson correlation, to avoid allocating objects!<NEW_LINE>// This is a numerically stabilized version, avoiding sum-of-squares.<NEW_LINE>double sumXX = 0., sumYY = 0., sumXY = 0., sumWe = weights[0];<NEW_LINE>double sumX = x[0] * sumWe, sumY = y[0] * sumWe;<NEW_LINE>for (int i = 1; i < xdim; ++i) {<NEW_LINE>final double xv = x[i], yv = y[i], w = weights[i];<NEW_LINE>// Delta to previous mean<NEW_LINE>final double deltaX = xv * sumWe - sumX, deltaY = yv * sumWe - sumY;<NEW_LINE>// Increment count first<NEW_LINE>// Convert to double!<NEW_LINE>final double oldWe = sumWe;<NEW_LINE>sumWe += w;<NEW_LINE>final double f = w / (sumWe * oldWe);<NEW_LINE>// Update<NEW_LINE>sumXX += f * deltaX * deltaX;<NEW_LINE>sumYY += f * deltaY * deltaY;<NEW_LINE>// should equal deltaY * neltaX!<NEW_LINE>sumXY += f * deltaX * deltaY;<NEW_LINE>// Update sums<NEW_LINE>sumX += xv * w;<NEW_LINE>sumY += yv * w;<NEW_LINE>}<NEW_LINE>// One or both series were constant:<NEW_LINE>return //<NEW_LINE>//<NEW_LINE>!(sumXX > 0. && sumYY > 0.) ? sumXX == sumYY ? 1. : 0. : sumXY / Math.sqrt(sumXX * sumYY);<NEW_LINE>}
.length, ydim = y.length;
343,390
public static ImageReference of(String value) {<NEW_LINE>Assert.hasText(value, "Value must not be null");<NEW_LINE>String domain = ImageName.parseDomain(value);<NEW_LINE>String path = (domain != null) ? value.substring(domain.length() + 1) : value;<NEW_LINE>String digest = null;<NEW_LINE>int digestSplit = path.indexOf("@");<NEW_LINE>if (digestSplit != -1) {<NEW_LINE>String remainder = path.substring(digestSplit + 1);<NEW_LINE>Matcher matcher = Regex.DIGEST.matcher(remainder);<NEW_LINE>if (matcher.find()) {<NEW_LINE>digest = remainder.substring(0, matcher.end());<NEW_LINE>remainder = remainder.substring(matcher.end());<NEW_LINE>path = path.substring(0, digestSplit) + remainder;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>String tag = null;<NEW_LINE>int tagSplit = path.lastIndexOf(":");<NEW_LINE>if (tagSplit != -1) {<NEW_LINE>String remainder = path.substring(tagSplit + 1);<NEW_LINE>Matcher matcher = <MASK><NEW_LINE>if (matcher.find()) {<NEW_LINE>tag = remainder.substring(0, matcher.end());<NEW_LINE>remainder = remainder.substring(matcher.end());<NEW_LINE>path = path.substring(0, tagSplit) + remainder;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Assert.isTrue(Regex.PATH.matcher(path).matches(), () -> "Unable to parse image reference \"" + value + "\". " + "Image reference must be in the form '[domainHost:port/][path/]name[:tag][@digest]', " + "with 'path' and 'name' containing only [a-z0-9][.][_][-]");<NEW_LINE>ImageName name = new ImageName(domain, path);<NEW_LINE>return new ImageReference(name, tag, digest);<NEW_LINE>}
Regex.TAG.matcher(remainder);
1,640,900
protected void encodeSuggestionItemsAsList(FacesContext context, AutoComplete ac, Object item, Converter converter, boolean pojo, String var, String key) throws IOException {<NEW_LINE>ResponseWriter writer = context.getResponseWriter();<NEW_LINE>Map<String, Object> requestMap = context.getExternalContext().getRequestMap();<NEW_LINE>UIComponent itemtip = ac.getFacet("itemtip");<NEW_LINE>boolean hasGroupByTooltip = (ac.getValueExpression(AutoComplete.PropertyKeys.groupByTooltip.toString()) != null);<NEW_LINE>writer.startElement("li", null);<NEW_LINE>writer.writeAttribute("class", AutoComplete.ITEM_CLASS, null);<NEW_LINE>if (pojo) {<NEW_LINE>requestMap.put(var, item);<NEW_LINE>String value = converter == null ? String.valueOf(ac.getItemValue()) : converter.getAsString(context, ac, ac.getItemValue());<NEW_LINE>writer.<MASK><NEW_LINE>writer.writeAttribute("data-item-label", ac.getItemLabel(), null);<NEW_LINE>writer.writeAttribute("data-item-class", ac.getItemStyleClass(), null);<NEW_LINE>writer.writeAttribute("data-item-group", ac.getGroupBy(), null);<NEW_LINE>if (key != null) {<NEW_LINE>writer.writeAttribute("data-item-key", key, null);<NEW_LINE>}<NEW_LINE>if (hasGroupByTooltip) {<NEW_LINE>writer.writeAttribute("data-item-group-tooltip", ac.getGroupByTooltip(), null);<NEW_LINE>}<NEW_LINE>writer.writeText(ac.getItemLabel(), null);<NEW_LINE>} else {<NEW_LINE>writer.writeAttribute("data-item-label", item.toString(), null);<NEW_LINE>writer.writeAttribute("data-item-value", item.toString(), null);<NEW_LINE>writer.writeAttribute("data-item-class", ac.getItemStyleClass(), null);<NEW_LINE>if (key != null) {<NEW_LINE>writer.writeAttribute("data-item-key", key, null);<NEW_LINE>}<NEW_LINE>writer.writeText(item, null);<NEW_LINE>}<NEW_LINE>writer.endElement("li");<NEW_LINE>if (ComponentUtils.shouldRenderFacet(itemtip)) {<NEW_LINE>writer.startElement("li", null);<NEW_LINE>writer.writeAttribute("class", AutoComplete.ITEMTIP_CONTENT_CLASS, null);<NEW_LINE>itemtip.encodeAll(context);<NEW_LINE>writer.endElement("li");<NEW_LINE>}<NEW_LINE>}
writeAttribute("data-item-value", value, null);
216,989
public static <T> JPanel createDefaultTableAndActions(JTable table, TableModelExt<T> modelExt) {<NEW_LINE>AbstractTableAndActionsComponent<T> component = new AbstractTableAndActionsComponent<T>(table) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected void onAddEvent() {<NEW_LINE>getTable().editCellAt(modelExt.getRowCount() - 1, 1);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected void onDeleteEvent() {<NEW_LINE>if (getTable().isEditing() && getTable().getCellEditor() != null) {<NEW_LINE>getTable().getCellEditor().stopCellEditing();<NEW_LINE>}<NEW_LINE>modelExt.delete(getTable().getSelectedRows());<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected T getValue(int row) {<NEW_LINE>List<T<MASK><NEW_LINE>return (row >= 0 && row < values.size()) ? values.get(row) : null;<NEW_LINE>}<NEW_LINE>};<NEW_LINE>return createDefaultTableAndActions(table, component.getActionsComponent());<NEW_LINE>}
> values = modelExt.getAllValues();
1,678,869
public Consumer<HttpServerExchange> requestInitializer() {<NEW_LINE>return e -> {<NEW_LINE>try {<NEW_LINE>if (e.getRequestMethod().equalToString(ExchangeKeys.METHOD.POST.name()) || e.getRequestMethod().equalToString(ExchangeKeys.METHOD.OPTIONS.name())) {<NEW_LINE>var cache = AppDefinitionLoadingCache.getInstance();<NEW_LINE>String[] splitPath = e.getRequestPath().split("/");<NEW_LINE>var appUri = String.join("/", Arrays.copyOfRange(splitPath, 2, splitPath.length));<NEW_LINE>var appDef = cache.get(appUri);<NEW_LINE>GraphQLRequest.init(e, appUri, appDef);<NEW_LINE>} else {<NEW_LINE>throw new BadRequestException(HttpStatus.SC_METHOD_NOT_ALLOWED);<NEW_LINE>}<NEW_LINE>} catch (GraphQLAppDefNotFoundException notFoundException) {<NEW_LINE>LOGGER.<MASK><NEW_LINE>throw new BadRequestException(HttpStatus.SC_NOT_FOUND);<NEW_LINE>} catch (GraphQLIllegalAppDefinitionException illegalException) {<NEW_LINE>LOGGER.error(illegalException.getMessage());<NEW_LINE>throw new BadRequestException(illegalException.getMessage(), HttpStatus.SC_BAD_REQUEST);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}
error(notFoundException.getMessage());
291,850
public UpdateAnomalySubscriptionResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>UpdateAnomalySubscriptionResult updateAnomalySubscriptionResult = new UpdateAnomalySubscriptionResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return updateAnomalySubscriptionResult;<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("SubscriptionArn", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>updateAnomalySubscriptionResult.setSubscriptionArn(context.getUnmarshaller(String.<MASK><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 updateAnomalySubscriptionResult;<NEW_LINE>}
class).unmarshall(context));
1,328,426
public void downloadToFile(String url, File file) throws IOException {<NEW_LINE>logger.debug("Downloading file from {} to {}", url, file.getAbsolutePath());<NEW_LINE>Stopwatch stopwatch = Stopwatch.createStarted();<NEW_LINE>Request request = new Request.Builder().url(url).build();<NEW_LINE>try (Response response = requestFactory.getOkHttpClientBuilder(request.url().uri()).build().<MASK><NEW_LINE>ResponseBody body = response.body()) {<NEW_LINE>long contentLength = body.contentLength();<NEW_LINE>if (!response.isSuccessful()) {<NEW_LINE>String error = String.format("URL call to %s returned %d:%s", url, response.code(), response.message());<NEW_LINE>logger.error(error);<NEW_LINE>throw new IOException(error);<NEW_LINE>}<NEW_LINE>try (BufferedSink sink = Okio.buffer(Okio.sink(file))) {<NEW_LINE>sink.writeAll(body.source());<NEW_LINE>sink.flush();<NEW_LINE>}<NEW_LINE>logger.debug(LoggingMarkers.PERFORMANCE, "Took {}ms to download file with {} bytes", stopwatch.elapsed(TimeUnit.MILLISECONDS), contentLength);<NEW_LINE>}<NEW_LINE>}
newCall(request).execute();
1,429,282
private static void tryAssertion17(RegressionEnvironment env, String stmtText, String outputLimit, AtomicInteger milestone) {<NEW_LINE>sendTimer(env, 0);<NEW_LINE>env.compileDeploy<MASK><NEW_LINE>String[] fields = new String[] { "symbol", "sum(price)" };<NEW_LINE>ResultAssertTestResult expected = new ResultAssertTestResult(CATEGORY, outputLimit, fields);<NEW_LINE>expected.addResultInsRem(200, 1, new Object[][] { { "IBM", 25d } }, new Object[][] { { "IBM", null } });<NEW_LINE>expected.addResultInsRem(800, 1, new Object[][] { { "MSFT", 9d } }, new Object[][] { { "MSFT", null } });<NEW_LINE>expected.addResultInsRem(1500, 1, new Object[][] { { "IBM", 49d } }, new Object[][] { { "IBM", 25d } });<NEW_LINE>expected.addResultInsRem(1500, 2, new Object[][] { { "YAH", 1d } }, new Object[][] { { "YAH", null } });<NEW_LINE>expected.addResultInsRem(3500, 1, new Object[][] { { "YAH", 3d } }, new Object[][] { { "YAH", 1d } });<NEW_LINE>expected.addResultInsRem(4300, 1, new Object[][] { { "IBM", 97d } }, new Object[][] { { "IBM", 75d } });<NEW_LINE>expected.addResultInsRem(4900, 1, new Object[][] { { "YAH", 6d } }, new Object[][] { { "YAH", 3d } });<NEW_LINE>expected.addResultInsRem(5700, 0, new Object[][] { { "IBM", 72d } }, new Object[][] { { "IBM", 97d } });<NEW_LINE>expected.addResultInsRem(5900, 1, new Object[][] { { "YAH", 7d } }, new Object[][] { { "YAH", 6d } });<NEW_LINE>expected.addResultInsRem(6300, 0, new Object[][] { { "MSFT", null } }, new Object[][] { { "MSFT", 9d } });<NEW_LINE>expected.addResultInsRem(7000, 0, new Object[][] { { "IBM", 48d }, { "YAH", 6d } }, new Object[][] { { "IBM", 72d }, { "YAH", 7d } });<NEW_LINE>ResultAssertExecution execution = new ResultAssertExecution(stmtText, env, expected);<NEW_LINE>execution.execute(false, milestone);<NEW_LINE>}
(stmtText).addListener("s0");
1,593,314
public void onJsonParsed(@NonNull final JsonValue result, final long timestamp, @NonNull final UUID session, final boolean fromCache) {<NEW_LINE>if (result.asObject() != null && Objects.requireNonNull(result.asObject()).isEmpty()) {<NEW_LINE>responseHandler.onSuccess(Collections.emptyList());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (result.asString() != null && Objects.requireNonNull(result.asString()).equals("{}")) {<NEW_LINE>responseHandler.onSuccess(Collections.emptyList());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final Optional<JsonArray> array = result.getArrayAtPath("choices");<NEW_LINE>if (array.isEmpty()) {<NEW_LINE>final APIResponseHandler<MASK><NEW_LINE>if (failureType != null) {<NEW_LINE>responseHandler.onFailure(failureType, Optional.of(new FailedRequestBody(result)));<NEW_LINE>} else {<NEW_LINE>responseHandler.onFailure(APIResponseHandler.APIFailureType.UNKNOWN, Optional.of(new FailedRequestBody(result)));<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final Optional<List<RedditFlairChoice>> choices = RedditFlairChoice.fromJsonList(array.get());<NEW_LINE>if (choices.isEmpty()) {<NEW_LINE>responseHandler.onFailure(CacheRequest.REQUEST_FAILURE_PARSE, new RuntimeException(), null, "Failed to parse choices list", Optional.of(new FailedRequestBody(result)));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>responseHandler.onSuccess(choices.get());<NEW_LINE>}
.APIFailureType failureType = findFailureType(result);
1,407,924
public void run(RegressionEnvironment env) {<NEW_LINE>String epl = "@name('var') create constant variable string MYVAR = '.*abc.*';\n" + "@name('s0') select * from SupportBean(theString regexp MYVAR);\n" + "" + "@name('ctx') create context MyContext start SupportBean_S0 as s0;\n" + "@name('s1') context MyContext select * from SupportBean(theString regexp context.s0.p00);\n" + "" + "@name('s2') select * from pattern[s0=SupportBean_S0 -> every SupportBean(theString regexp s0.p00)];\n" + "" + "@name('s3') select * from SupportBean(theString regexp '.*' || 'abc' || '.*');\n";<NEW_LINE>env.compileDeploy(epl);<NEW_LINE>EPDeployment deployment = env.deployment().getDeployment<MASK><NEW_LINE>Set<String> statementNames = new LinkedHashSet<>();<NEW_LINE>for (EPStatement stmt : deployment.getStatements()) {<NEW_LINE>if (stmt.getName().startsWith("s")) {<NEW_LINE>stmt.addListener(env.listenerNew());<NEW_LINE>statementNames.add(stmt.getName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>env.milestone(0);<NEW_LINE>env.sendEventBean(new SupportBean_S0(1, ".*abc.*"));<NEW_LINE>sendSBAssert(env, "xabsx", statementNames, false);<NEW_LINE>sendSBAssert(env, "xabcx", statementNames, true);<NEW_LINE>if (hasFilterIndexPlanAdvanced(env)) {<NEW_LINE>Map<String, FilterItem> filters = SupportFilterServiceHelper.getFilterSvcAllStmtForTypeSingleFilter(env.runtime(), "SupportBean");<NEW_LINE>FilterItem s0 = filters.get("s0");<NEW_LINE>for (String name : statementNames) {<NEW_LINE>FilterItem sn = filters.get(name);<NEW_LINE>assertEquals(FilterOperator.REBOOL, sn.getOp());<NEW_LINE>assertNotNull(s0.getOptionalValue());<NEW_LINE>assertNotNull(s0.getIndex());<NEW_LINE>assertSame(s0.getIndex(), sn.getIndex());<NEW_LINE>assertSame(s0.getOptionalValue(), sn.getOptionalValue());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>env.undeployAll();<NEW_LINE>}
(env.deploymentId("s0"));
344,449
public synchronized void unfollow(final String followerId, final String followingId, final int followingType) throws RepositoryException {<NEW_LINE>followRepository.removeByFollowerIdAndFollowingId(followerId, followingId, followingType);<NEW_LINE>if (Follow.FOLLOWING_TYPE_C_TAG == followingType) {<NEW_LINE>final JSONObject tag = tagRepository.get(followingId);<NEW_LINE>if (null == tag) {<NEW_LINE>LOGGER.log(Level.ERROR, "Not found tag [id={}] to unfollow", followingId);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>tag.put(Tag.TAG_FOLLOWER_CNT, tag.optInt(Tag.TAG_FOLLOWER_CNT) - 1);<NEW_LINE>if (tag.optInt(Tag.TAG_FOLLOWER_CNT) < 0) {<NEW_LINE>tag.put(Tag.TAG_FOLLOWER_CNT, 0);<NEW_LINE>}<NEW_LINE>tag.put(Tag.TAG_RANDOM_DOUBLE, Math.random());<NEW_LINE><MASK><NEW_LINE>} else if (Follow.FOLLOWING_TYPE_C_ARTICLE == followingType) {<NEW_LINE>final JSONObject article = articleRepository.get(followingId);<NEW_LINE>if (null == article) {<NEW_LINE>LOGGER.log(Level.ERROR, "Not found article [id={}] to unfollow", followingId);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>article.put(Article.ARTICLE_COLLECT_CNT, article.optInt(Article.ARTICLE_COLLECT_CNT) - 1);<NEW_LINE>if (article.optInt(Article.ARTICLE_COLLECT_CNT) < 0) {<NEW_LINE>article.put(Article.ARTICLE_COLLECT_CNT, 0);<NEW_LINE>}<NEW_LINE>articleRepository.update(followingId, article, Article.ARTICLE_COLLECT_CNT);<NEW_LINE>} else if (Follow.FOLLOWING_TYPE_C_ARTICLE_WATCH == followingType) {<NEW_LINE>final JSONObject article = articleRepository.get(followingId);<NEW_LINE>if (null == article) {<NEW_LINE>LOGGER.log(Level.ERROR, "Not found article [id={}] to unwatch", followingId);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>article.put(Article.ARTICLE_WATCH_CNT, article.optInt(Article.ARTICLE_WATCH_CNT) - 1);<NEW_LINE>if (article.optInt(Article.ARTICLE_WATCH_CNT) < 0) {<NEW_LINE>article.put(Article.ARTICLE_WATCH_CNT, 0);<NEW_LINE>}<NEW_LINE>articleRepository.update(followingId, article, Article.ARTICLE_WATCH_CNT);<NEW_LINE>}<NEW_LINE>}
tagRepository.update(followingId, tag);
759,339
void buildEventPayload(AnalyticsEvent internalEvent, Event event) {<NEW_LINE>final Session session = new Session();<NEW_LINE>session.withId(internalEvent.getSession().getSessionId());<NEW_LINE>session.withStartTimestamp(DateUtils.formatISO8601Date(new Date(internalEvent.getSession(<MASK><NEW_LINE>if (internalEvent.getSession().getSessionStop() != null && internalEvent.getSession().getSessionStop() != 0L) {<NEW_LINE>session.withStopTimestamp(DateUtils.formatISO8601Date(new Date(internalEvent.getSession().getSessionStop())));<NEW_LINE>}<NEW_LINE>if (internalEvent.getSession().getSessionDuration() != null && internalEvent.getSession().getSessionDuration() != 0L) {<NEW_LINE>session.withDuration(internalEvent.getSession().getSessionDuration().intValue());<NEW_LINE>}<NEW_LINE>final AndroidAppDetails appDetails = internalEvent.getAppDetails();<NEW_LINE>event.withAppPackageName(appDetails.packageName()).withAppTitle(appDetails.getAppTitle()).withAppVersionCode(appDetails.versionCode()).withAttributes(internalEvent.getAllAttributes()).withClientSdkVersion(internalEvent.getSdkVersion()).withEventType(internalEvent.getEventType()).withMetrics(internalEvent.getAllMetrics()).withSdkName(internalEvent.getSdkName()).withSession(session).withTimestamp(DateUtils.formatISO8601Date(new Date(internalEvent.getEventTimestamp())));<NEW_LINE>}
).getSessionStart())));
1,077,193
public static String generateCreateTableSqlForLike(SqlCreateTable sqlCreateTable, ExecutionContext executionContext) {<NEW_LINE>SqlIdentifier sourceTableName = (SqlIdentifier) sqlCreateTable.getLikeTableName();<NEW_LINE>String sourceTableSchema = sourceTableName.names.size() > 1 ? sourceTableName.names.get(0) : executionContext.getSchemaName();<NEW_LINE>IRepository sourceTableRepository = ExecutorContext.getContext(sourceTableSchema).getTopologyHandler().getRepositoryHolder().get(Group.GroupType.MYSQL_JDBC.toString());<NEW_LINE><MASK><NEW_LINE>SqlShowCreateTable sqlShowCreateTable = SqlShowCreateTable.create(SqlParserPos.ZERO, sqlCreateTable.getLikeTableName(), true);<NEW_LINE>ExecutionContext copiedContext = executionContext.copy();<NEW_LINE>copiedContext.setSchemaName(sourceTableSchema);<NEW_LINE>PlannerContext plannerContext = PlannerContext.fromExecutionContext(copiedContext);<NEW_LINE>ExecutionPlan showCreateTablePlan = Planner.getInstance().getPlan(sqlShowCreateTable, plannerContext);<NEW_LINE>LogicalShow logicalShowCreateTable = (LogicalShow) showCreateTablePlan.getPlan();<NEW_LINE>Cursor showCreateTableCursor = logicalShowCreateTablesHandler.handle(logicalShowCreateTable, executionContext);<NEW_LINE>String createTableSql = null;<NEW_LINE>Row showCreateResult = showCreateTableCursor.next();<NEW_LINE>if (showCreateResult != null && showCreateResult.getString(1) != null) {<NEW_LINE>createTableSql = showCreateResult.getString(1);<NEW_LINE>} else {<NEW_LINE>GeneralUtil.nestedException("Get reference table architecture failed.");<NEW_LINE>}<NEW_LINE>if (sqlCreateTable.isIfNotExists()) {<NEW_LINE>createTableSql = createTableSql.replace(CREATE_TABLE, CREATE_TABLE_IF_NOT_EXISTS);<NEW_LINE>}<NEW_LINE>return createTableSql;<NEW_LINE>}
LogicalShowCreateTableHandler logicalShowCreateTablesHandler = new LogicalShowCreateTableHandler(sourceTableRepository);
1,202,941
public Set<Permission> fetchAllPermissions(String resouceName) throws IOException, GeneralSecurityException {<NEW_LINE>logger.atInfo().log("Fetching all permissions from " + resouceName);<NEW_LINE>QueryTestablePermissionsRequest requestBody = new QueryTestablePermissionsRequest();<NEW_LINE>requestBody.setFullResourceName(resouceName);<NEW_LINE>Iam iamService = IamClient.getIamClient();<NEW_LINE>Iam.Permissions.QueryTestablePermissions request = iamService.permissions().queryTestablePermissions(requestBody);<NEW_LINE>QueryTestablePermissionsResponse response;<NEW_LINE>Set<Permission> permissionSet = new HashSet<Permission>();<NEW_LINE>do {<NEW_LINE>response = request.execute();<NEW_LINE>if (response.getPermissions() == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>for (Permission permission : response.getPermissions()) {<NEW_LINE>permissionSet.add(permission);<NEW_LINE>}<NEW_LINE>requestBody.setPageToken(response.getNextPageToken());<NEW_LINE>} while (response.getNextPageToken() != null);<NEW_LINE>logger.atInfo().log("Total number of permissions at " + resouceName + <MASK><NEW_LINE>return permissionSet;<NEW_LINE>}
":" + permissionSet.size());
1,674,282
public static DescribeQosPoliciesResponse unmarshall(DescribeQosPoliciesResponse describeQosPoliciesResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeQosPoliciesResponse.setRequestId(_ctx.stringValue("DescribeQosPoliciesResponse.RequestId"));<NEW_LINE>describeQosPoliciesResponse.setTotalCount(_ctx.integerValue("DescribeQosPoliciesResponse.TotalCount"));<NEW_LINE>describeQosPoliciesResponse.setPageSize(_ctx.integerValue("DescribeQosPoliciesResponse.PageSize"));<NEW_LINE>describeQosPoliciesResponse.setPageNumber(_ctx.integerValue("DescribeQosPoliciesResponse.PageNumber"));<NEW_LINE>List<QosPolicy> qosPolicies = new ArrayList<QosPolicy>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeQosPoliciesResponse.QosPolicies.Length"); i++) {<NEW_LINE>QosPolicy qosPolicy = new QosPolicy();<NEW_LINE>qosPolicy.setIpProtocol(_ctx.stringValue("DescribeQosPoliciesResponse.QosPolicies[" + i + "].IpProtocol"));<NEW_LINE>qosPolicy.setQosId(_ctx.stringValue("DescribeQosPoliciesResponse.QosPolicies[" + i + "].QosId"));<NEW_LINE>qosPolicy.setPriority(_ctx.integerValue("DescribeQosPoliciesResponse.QosPolicies[" + i + "].Priority"));<NEW_LINE>qosPolicy.setEndTime(_ctx.stringValue("DescribeQosPoliciesResponse.QosPolicies[" + i + "].EndTime"));<NEW_LINE>qosPolicy.setStartTime(_ctx.stringValue("DescribeQosPoliciesResponse.QosPolicies[" + i + "].StartTime"));<NEW_LINE>qosPolicy.setDescription(_ctx.stringValue("DescribeQosPoliciesResponse.QosPolicies[" + i + "].Description"));<NEW_LINE>qosPolicy.setDestCidr(_ctx.stringValue("DescribeQosPoliciesResponse.QosPolicies[" + i + "].DestCidr"));<NEW_LINE>qosPolicy.setDestPortRange(_ctx.stringValue("DescribeQosPoliciesResponse.QosPolicies[" + i + "].DestPortRange"));<NEW_LINE>qosPolicy.setQosPolicyId(_ctx.stringValue("DescribeQosPoliciesResponse.QosPolicies[" + i + "].QosPolicyId"));<NEW_LINE>qosPolicy.setName(_ctx.stringValue("DescribeQosPoliciesResponse.QosPolicies[" + i + "].Name"));<NEW_LINE>qosPolicy.setSourceCidr(_ctx.stringValue("DescribeQosPoliciesResponse.QosPolicies[" + i + "].SourceCidr"));<NEW_LINE>qosPolicy.setSourcePortRange(_ctx.stringValue<MASK><NEW_LINE>List<String> dpiSignatureIds = new ArrayList<String>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("DescribeQosPoliciesResponse.QosPolicies[" + i + "].DpiSignatureIds.Length"); j++) {<NEW_LINE>dpiSignatureIds.add(_ctx.stringValue("DescribeQosPoliciesResponse.QosPolicies[" + i + "].DpiSignatureIds[" + j + "]"));<NEW_LINE>}<NEW_LINE>qosPolicy.setDpiSignatureIds(dpiSignatureIds);<NEW_LINE>List<String> dpiGroupIds = new ArrayList<String>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("DescribeQosPoliciesResponse.QosPolicies[" + i + "].DpiGroupIds.Length"); j++) {<NEW_LINE>dpiGroupIds.add(_ctx.stringValue("DescribeQosPoliciesResponse.QosPolicies[" + i + "].DpiGroupIds[" + j + "]"));<NEW_LINE>}<NEW_LINE>qosPolicy.setDpiGroupIds(dpiGroupIds);<NEW_LINE>qosPolicies.add(qosPolicy);<NEW_LINE>}<NEW_LINE>describeQosPoliciesResponse.setQosPolicies(qosPolicies);<NEW_LINE>return describeQosPoliciesResponse;<NEW_LINE>}
("DescribeQosPoliciesResponse.QosPolicies[" + i + "].SourcePortRange"));
210,055
public void onReceive(Context context, Intent intent) {<NEW_LINE>// Save usage statistics right now!<NEW_LINE>// We need to use the statics at this moment<NEW_LINE>// for "skipping foreground apps"<NEW_LINE>// No app is foreground after the screen is locked.<NEW_LINE>mScreenLockTime = <MASK><NEW_LINE>if (SettingsManager.getInstance().getSkipForegroundEnabled() && Utility.checkUsageStatsPermission(FreezeService.this)) {<NEW_LINE>UsageStatsManager usm = getSystemService(UsageStatsManager.class);<NEW_LINE>mUsageStats = usm.queryAndAggregateUsageStats(mScreenLockTime - APP_INACTIVE_TIMEOUT, mScreenLockTime);<NEW_LINE>}<NEW_LINE>// Delay the work so that it can be canceled if the screen<NEW_LINE>// gets unlocked before the delay passes<NEW_LINE>mHandler.postDelayed(mFreezeWork, ((long) SettingsManager.getInstance().getAutoFreezeDelay()) * 1000);<NEW_LINE>registerReceiver(mUnlockReceiver, new IntentFilter(Intent.ACTION_SCREEN_ON));<NEW_LINE>}
new Date().getTime();
1,359,257
public void editString(Component cmp, int maxSize, int constraint, String text, int keyCode) {<NEW_LINE>UIManager m = UIManager.getInstance();<NEW_LINE>CONFIRM_COMMAND = new Command(m.localize("ok", "OK"), Command.OK, 1);<NEW_LINE>CANCEL_COMMAND = new Command(m.localize("cancel", "Cancel"), Command.CANCEL, 2);<NEW_LINE>if (mid.getAppProperty("forceBackCommand") != null) {<NEW_LINE>canvas.addCommand(MIDP_BACK_COMMAND);<NEW_LINE>}<NEW_LINE>currentTextBox = new TextBox("", "", maxSize, TextArea.ANY);<NEW_LINE>currentTextBox<MASK><NEW_LINE>currentTextBox.addCommand(CONFIRM_COMMAND);<NEW_LINE>currentTextBox.addCommand(CANCEL_COMMAND);<NEW_LINE>currentTextComponent = cmp;<NEW_LINE>currentTextBox.setMaxSize(maxSize);<NEW_LINE>currentTextBox.setString(text);<NEW_LINE>currentTextBox.setConstraints(constraint);<NEW_LINE>display.setCurrent(currentTextBox);<NEW_LINE>((C) canvas).setDone(false);<NEW_LINE>Display.getInstance().invokeAndBlock(((C) canvas));<NEW_LINE>}
.setCommandListener((CommandListener) canvas);
1,022,170
public static void main(String[] args) throws Exception {<NEW_LINE>ArgP argp = new ArgP();<NEW_LINE>argp.addOption("--help", "Print help information.");<NEW_LINE>CliOptions.addCommon(argp);<NEW_LINE>FsckOptions.addDataOptions(argp);<NEW_LINE>args = CliOptions.parse(argp, args);<NEW_LINE>if (argp.has("--help")) {<NEW_LINE>usage(argp, "", 0);<NEW_LINE>}<NEW_LINE>Config config = CliOptions.getConfig(argp);<NEW_LINE>final FsckOptions options = new FsckOptions(argp, config);<NEW_LINE>final TSDB tsdb = new TSDB(config);<NEW_LINE>final ArrayList<Query> queries = new ArrayList<Query>();<NEW_LINE>if (args != null && args.length > 0) {<NEW_LINE>CliQuery.parseCommandLineQuery(args, tsdb, queries, null, null);<NEW_LINE>}<NEW_LINE>if (queries.isEmpty() && !argp.has("--full-scan")) {<NEW_LINE>usage(argp, "Must supply a query or use the '--full-scan' flag", 1);<NEW_LINE>}<NEW_LINE>tsdb.checkNecessaryTablesExist().joinUninterruptibly();<NEW_LINE>argp = null;<NEW_LINE>final Fsck fsck <MASK><NEW_LINE>try {<NEW_LINE>if (!queries.isEmpty()) {<NEW_LINE>fsck.runQueries(queries);<NEW_LINE>} else {<NEW_LINE>fsck.runFullTable();<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>tsdb.shutdown().joinUninterruptibly();<NEW_LINE>}<NEW_LINE>System.exit(fsck.totalErrors() == 0 ? 0 : 1);<NEW_LINE>}
= new Fsck(tsdb, options);
762,425
protected void onCreate(Bundle savedInstanceState) {<NEW_LINE>super.onCreate(savedInstanceState);<NEW_LINE>setContentView(R.layout.attachments);<NEW_LINE>Bundle bundle = getIntent().getExtras();<NEW_LINE>String s = bundle.getString(getString(R.string.attribute));<NEW_LINE>int noOfAttachments = bundle.getInt(getApplication().getString(R.string.noOfAttachments));<NEW_LINE>// Build a alert dialog with specified style<NEW_LINE>builder = new AlertDialog.Builder(this);<NEW_LINE>// get a reference to the floating action button<NEW_LINE>FloatingActionButton addAttachmentFab = findViewById(R.id.addAttachmentFAB);<NEW_LINE>// select an image to upload as an attachment<NEW_LINE>addAttachmentFab.setOnClickListener(v -> selectAttachment());<NEW_LINE>mServiceFeatureTable = new ServiceFeatureTable(getResources().getString(R.string.sample_service_url));<NEW_LINE>progressDialog = new ProgressDialog(this);<NEW_LINE>// display progress dialog if selected feature has attachments<NEW_LINE>if (noOfAttachments != 0) {<NEW_LINE>progressDialog.setTitle(getApplication().getString(R.string.fetching_attachments));<NEW_LINE>progressDialog.setMessage(getApplication().getString(R.string.wait));<NEW_LINE>progressDialog.show();<NEW_LINE>} else {<NEW_LINE>Toast.makeText(this, getString(R.string.empty_attachment_message), Toast.LENGTH_LONG).show();<NEW_LINE>}<NEW_LINE>// get a reference to the list view<NEW_LINE>listView = findViewById(R.id.listView);<NEW_LINE>// create custom adapter<NEW_LINE>adapter = new CustomList(this, attachmentList);<NEW_LINE>// set custom adapter on the list<NEW_LINE>listView.setAdapter(adapter);<NEW_LINE>fetchAttachmentsFromServer(s);<NEW_LINE>// listener on attachment items to download the attachment<NEW_LINE>listView.setOnItemClickListener((parent, view, position, <MASK><NEW_LINE>// set on long click listener to delete the attachment<NEW_LINE>listView.setOnItemLongClickListener((parent, view, position, id) -> {<NEW_LINE>builder.setMessage(getApplication().getString(R.string.delete_query));<NEW_LINE>builder.setCancelable(true);<NEW_LINE>builder.setPositiveButton(getResources().getString(R.string.yes), (dialog, which) -> {<NEW_LINE>deleteAttachment(position);<NEW_LINE>dialog.dismiss();<NEW_LINE>});<NEW_LINE>builder.setNegativeButton(getResources().getString(R.string.no), (dialog, which) -> dialog.cancel());<NEW_LINE>AlertDialog alert = builder.create();<NEW_LINE>alert.show();<NEW_LINE>return true;<NEW_LINE>});<NEW_LINE>}
id) -> fetchAttachmentAsync(position));
1,215,030
public Response update(T entity) throws StorageException {<NEW_LINE>Context.getPermissionsManager().checkReadonly(getUserId());<NEW_LINE>if (baseClass.equals(Device.class)) {<NEW_LINE>Context.getPermissionsManager().checkDeviceReadonly(getUserId());<NEW_LINE>} else if (baseClass.equals(User.class)) {<NEW_LINE>User before = Context.getPermissionsManager().getUser(entity.getId());<NEW_LINE>Context.getPermissionsManager().checkUserUpdate(getUserId(), before, (User) entity);<NEW_LINE>} else if (baseClass.equals(Command.class)) {<NEW_LINE>Context.getPermissionsManager(<MASK><NEW_LINE>} else if (entity instanceof GroupedModel && ((GroupedModel) entity).getGroupId() != 0) {<NEW_LINE>Context.getPermissionsManager().checkPermission(Group.class, getUserId(), ((GroupedModel) entity).getGroupId());<NEW_LINE>} else if (entity instanceof ScheduledModel && ((ScheduledModel) entity).getCalendarId() != 0) {<NEW_LINE>Context.getPermissionsManager().checkPermission(Calendar.class, getUserId(), ((ScheduledModel) entity).getCalendarId());<NEW_LINE>}<NEW_LINE>Context.getPermissionsManager().checkPermission(baseClass, getUserId(), entity.getId());<NEW_LINE>Context.getManager(baseClass).updateItem(entity);<NEW_LINE>LogAction.edit(getUserId(), entity);<NEW_LINE>if (baseClass.equals(Group.class) || baseClass.equals(Device.class)) {<NEW_LINE>Context.getPermissionsManager().refreshDeviceAndGroupPermissions();<NEW_LINE>Context.getPermissionsManager().refreshAllExtendedPermissions();<NEW_LINE>}<NEW_LINE>return Response.ok(entity).build();<NEW_LINE>}
).checkLimitCommands(getUserId());
504,581
public Cursor handle(VirtualView virtualView, ExecutionContext executionContext, ArrayResultCursor cursor) {<NEW_LINE>ISyncAction showProcesslistSyncAction;<NEW_LINE>try {<NEW_LINE>showProcesslistSyncAction = (ISyncAction) SHOW_PROCESSLIST_SYNC_ACTION_CLASS.getConstructor(boolean.class).newInstance(true);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new TddlRuntimeException(ErrorCode.ERR_CONFIG, e, e.getMessage());<NEW_LINE>}<NEW_LINE>List<List<Map<String, Object>>> results = SyncManagerHelper.sync(showProcesslistSyncAction);<NEW_LINE>for (List<Map<String, Object>> nodeRows : results) {<NEW_LINE>if (nodeRows == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>for (Map<String, Object> row : nodeRows) {<NEW_LINE>cursor.addRow(new Object[] { DataTypes.LongType.convertFrom(row.get("ID")), DataTypes.StringType.convertFrom(row.get("USER")), DataTypes.StringType.convertFrom(row.get("HOST")), DataTypes.StringType.convertFrom(row.get("DB")), DataTypes.StringType.convertFrom(row.get("COMMAND")), DataTypes.LongType.convertFrom(row.get("TIME")), DataTypes.StringType.convertFrom(row.get("STATE")), DataTypes.StringType.convertFrom(row.get("INFO")), DataTypes.StringType.convertFrom(row<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>return cursor;<NEW_LINE>}
.get("SQL_TEMPLATE_ID")) });
395,661
private synchronized void invalidateDevices() {<NEW_LINE>UsbManager usbManager = (UsbManager) mContext.getSystemService(Context.USB_SERVICE);<NEW_LINE>HashMap<String, UsbDevice> devicesMap = usbManager.getDeviceList();<NEW_LINE>List<String> intelDevices = new ArrayList<String>();<NEW_LINE>for (Map.Entry<String, UsbDevice> entry : devicesMap.entrySet()) {<NEW_LINE><MASK><NEW_LINE>if (UsbUtilities.isIntel(usbDevice))<NEW_LINE>intelDevices.add(entry.getKey());<NEW_LINE>}<NEW_LINE>Iterator<Map.Entry<String, UsbDesc>> iter = mDescriptors.entrySet().iterator();<NEW_LINE>while (iter.hasNext()) {<NEW_LINE>Map.Entry<String, UsbDesc> entry = iter.next();<NEW_LINE>if (!intelDevices.contains(entry.getKey())) {<NEW_LINE>removeDevice(entry.getValue());<NEW_LINE>iter.remove();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (String name : intelDevices) {<NEW_LINE>if (!mDescriptors.containsKey(name)) {<NEW_LINE>addDevice(devicesMap.get(name));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
UsbDevice usbDevice = entry.getValue();
214,413
public synchronized String execute(SampleResult previousResult, Sampler currentSampler) throws InvalidVariableException {<NEW_LINE>if (// did we find BeanShell?<NEW_LINE>bshInterpreter == null) {<NEW_LINE>throw new InvalidVariableException("BeanShell not found");<NEW_LINE>}<NEW_LINE>JMeterContext jmctx = JMeterContextService.getContext();<NEW_LINE>JMeterVariables vars = jmctx.getVariables();<NEW_LINE>String script = ((CompoundVariable) values<MASK><NEW_LINE>// $NON-NLS-1$<NEW_LINE>String varName = "";<NEW_LINE>if (values.length > 1) {<NEW_LINE>varName = ((CompoundVariable) values[1]).execute().trim();<NEW_LINE>}<NEW_LINE>// $NON-NLS-1$<NEW_LINE>String resultStr = "";<NEW_LINE>try {<NEW_LINE>// Pass in some variables<NEW_LINE>if (currentSampler != null) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>bshInterpreter.set("Sampler", currentSampler);<NEW_LINE>}<NEW_LINE>if (previousResult != null) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>bshInterpreter.set("SampleResult", previousResult);<NEW_LINE>}<NEW_LINE>// Allow access to context and variables directly<NEW_LINE>// $NON-NLS-1$<NEW_LINE>bshInterpreter.set("ctx", jmctx);<NEW_LINE>// $NON-NLS-1$<NEW_LINE>bshInterpreter.set("vars", vars);<NEW_LINE>// $NON-NLS-1$<NEW_LINE>bshInterpreter.set("props", JMeterUtils.getJMeterProperties());<NEW_LINE>// $NON-NLS-1$<NEW_LINE>bshInterpreter.set("threadName", Thread.currentThread().getName());<NEW_LINE>// Execute the script<NEW_LINE>Object bshOut = bshInterpreter.eval(script);<NEW_LINE>if (bshOut != null) {<NEW_LINE>resultStr = bshOut.toString();<NEW_LINE>}<NEW_LINE>if (vars != null && varName.length() > 0) {<NEW_LINE>// vars will be null on TestPlan<NEW_LINE>vars.put(varName, resultStr);<NEW_LINE>}<NEW_LINE>} catch (// Mainly for bsh.EvalError<NEW_LINE>Exception ex) {<NEW_LINE>log.warn("Error running BSH script", ex);<NEW_LINE>}<NEW_LINE>log.debug("__Beanshell({},{})={}", script, varName, resultStr);<NEW_LINE>return resultStr;<NEW_LINE>}
[0]).execute();
1,515,535
private static // ==========================================================================================================================<NEW_LINE>WebView createWebView(final Context context, final boolean mEnableDarkMode) {<NEW_LINE>final WebView webView = new WebView(context);<NEW_LINE>final <MASK><NEW_LINE>webSettings.setSupportMultipleWindows(true);<NEW_LINE>if (mEnableDarkMode) {<NEW_LINE>if (WebViewFeature.isFeatureSupported(WebViewFeature.FORCE_DARK)) {<NEW_LINE>final int nightFlag = context.getResources().getConfiguration().uiMode & Configuration.UI_MODE_NIGHT_MASK;<NEW_LINE>if (nightFlag == Configuration.UI_MODE_NIGHT_YES) {<NEW_LINE>WebSettingsCompat.setForceDark(webSettings, WebSettingsCompat.FORCE_DARK_ON);<NEW_LINE>} else {<NEW_LINE>WebSettingsCompat.setForceDark(webSettings, WebSettingsCompat.FORCE_DARK_OFF);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>webView.setWebChromeClient(new WebChromeClient() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean onCreateWindow(final WebView view, final boolean isDialog, final boolean isUserGesture, final Message resultMsg) {<NEW_LINE>final WebView.HitTestResult result = view.getHitTestResult();<NEW_LINE>final String data = result.getExtra();<NEW_LINE>if (data != null) {<NEW_LINE>final Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(data));<NEW_LINE>context.startActivity(browserIntent);<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return webView;<NEW_LINE>}
WebSettings webSettings = webView.getSettings();
1,223,501
public int compareTo(TopologyInfo other) {<NEW_LINE>if (!getClass().equals(other.getClass())) {<NEW_LINE>return getClass().getName().compareTo(other.getClass().getName());<NEW_LINE>}<NEW_LINE>int lastComparison = 0;<NEW_LINE>lastComparison = Boolean.valueOf(is_set_topology()).compareTo(other.is_set_topology());<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>if (is_set_topology()) {<NEW_LINE>lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.topology, other.topology);<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>lastComparison = Boolean.valueOf(is_set_components()).compareTo(other.is_set_components());<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>if (is_set_components()) {<NEW_LINE>lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.components, other.components);<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>lastComparison = Boolean.valueOf(is_set_tasks()).compareTo(other.is_set_tasks());<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>if (is_set_tasks()) {<NEW_LINE>lastComparison = org.apache.thrift.TBaseHelper.compareTo(<MASK><NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>lastComparison = Boolean.valueOf(is_set_metrics()).compareTo(other.is_set_metrics());<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>if (is_set_metrics()) {<NEW_LINE>lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.metrics, other.metrics);<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return 0;<NEW_LINE>}
this.tasks, other.tasks);
847,898
protected void onCreate(Bundle savedInstanceState) {<NEW_LINE>super.onCreate(savedInstanceState);<NEW_LINE><MASK><NEW_LINE>ButterKnife.bind(this);<NEW_LINE>initialisationStatus = new InitializationVariable();<NEW_LINE>initialisationDialog = new ProgressDialog(this);<NEW_LINE>initialisationDialog.setMessage(getString(R.string.initialising_wait));<NEW_LINE>initialisationDialog.setIndeterminate(true);<NEW_LINE>initialisationDialog.setCancelable(false);<NEW_LINE>usbManager = (UsbManager) getSystemService(USB_SERVICE);<NEW_LINE>customTabService = new CustomTabService(MainActivity.this, customTabsServiceConnection);<NEW_LINE>mScienceLabCommon = ScienceLabCommon.getInstance();<NEW_LINE>initialisationDialog.show();<NEW_LINE>communicationHandler = new CommunicationHandler(usbManager);<NEW_LINE>attemptToGetUSBPermission();<NEW_LINE>PSLabisConnected = mScienceLabCommon.openDevice(communicationHandler);<NEW_LINE>IntentFilter usbDetachFilter = new IntentFilter();<NEW_LINE>usbDetachFilter.addAction(UsbManager.ACTION_USB_DEVICE_DETACHED);<NEW_LINE>usbDetachReceiver = new USBDetachReceiver(this);<NEW_LINE>registerReceiver(usbDetachReceiver, usbDetachFilter);<NEW_LINE>setSupportActionBar(toolbar);<NEW_LINE>mHandler = new Handler();<NEW_LINE>navHeader = navigationView.getHeaderView(0);<NEW_LINE>txtName = navHeader.findViewById(io.pslab.R.id.name);<NEW_LINE>imgProfile = navHeader.findViewById(io.pslab.R.id.img_profile);<NEW_LINE>activityTitles = getResources().getStringArray(io.pslab.R.array.nav_item_activity_titles);<NEW_LINE>setPSLabVersionIDs();<NEW_LINE>setUpNavigationView();<NEW_LINE>initialisationDialog.dismiss();<NEW_LINE>if (savedInstanceState == null) {<NEW_LINE>navItemIndex = 0;<NEW_LINE>CURRENT_TAG = TAG_INSTRUMENTS;<NEW_LINE>loadHomeFragment();<NEW_LINE>}<NEW_LINE>}
setContentView(R.layout.activity_main);
988,859
private static void v1doc(Path basedir, Path output) throws Exception {<NEW_LINE>Path v1source = basedir.resolve("v1");<NEW_LINE>FileUtils.cleanDirectory(v1source.toFile());<NEW_LINE>Files.createDirectories(v1source);<NEW_LINE>Git git = new Git("jooby-project", "jooby", v1source);<NEW_LINE>git.clone("--single-branch", "--branch", "gh-pages");<NEW_LINE>Path v1target = output.resolve("v1");<NEW_LINE>FileUtils.copyDirectory(v1source.toFile(), v1target.toFile());<NEW_LINE>Collection<File> files = FileUtils.listFiles(v1target.toFile(), new String[] { "html" }, true);<NEW_LINE>for (File index : files) {<NEW_LINE>String content = // remove/replace redirection<NEW_LINE>FileUtils.readFileToString(index, "UTF-8").replace("http://jooby.org", "https://jooby.org").replace("href=\"/resources", "href=\"/v1/resources").replace("src=\"/resources", "src=\"/v1/resources").replace("href=\"https://jooby.org/resources", "href=\"/v1/resources").replace("src=\"https://jooby.org/resources", "src=\"/v1/resources").replace("href=\"resources", "href=\"/v1/resources").replace("src=\"resources", "src=\"/v1/resources").replace("src=\"http://ajax.", "src=\"https://ajax.").replace("<meta http-equiv=\"refresh\" content=\"0; URL=https://jooby.io\" />", "");<NEW_LINE>Document doc = Jsoup.parse(content);<NEW_LINE>doc.select("a").forEach(a -> {<NEW_LINE>String <MASK><NEW_LINE>if (!href.startsWith("http") && !href.startsWith("#")) {<NEW_LINE>href = "/v1" + href;<NEW_LINE>a.attr("href", href);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>FileUtils.writeStringToFile(index, doc.toString(), "UTF-8");<NEW_LINE>}<NEW_LINE>FileUtils.deleteQuietly(v1target.resolve(".git").toFile());<NEW_LINE>FileUtils.deleteQuietly(v1target.resolve(".gitignore").toFile());<NEW_LINE>FileUtils.deleteQuietly(v1target.resolve("CNAME").toFile());<NEW_LINE>}
href = a.attr("href");
795,948
protected void updateShadowCams(Camera viewCam) {<NEW_LINE>if (light == null) {<NEW_LINE>logger.warning("The light can't be null for a " + getClass().getName());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>float zFar = zFarOverride;<NEW_LINE>if (zFar == 0) {<NEW_LINE>zFar = viewCam.getFrustumFar();<NEW_LINE>}<NEW_LINE>// We prevent computing the frustum points and splits with zeroed or negative near clip value<NEW_LINE>float frustumNear = Math.max(viewCam.getFrustumNear(), 0.001f);<NEW_LINE>ShadowUtil.updateFrustumPoints(viewCam, frustumNear, zFar, 1.0f, points);<NEW_LINE>shadowCam.setFrustumFar(zFar);<NEW_LINE>shadowCam.getRotation().lookAt(light.getDirection(), shadowCam.getUp());<NEW_LINE>shadowCam.update();<NEW_LINE>shadowCam.updateViewProjection();<NEW_LINE>PssmShadowUtil.updateFrustumSplits(splitsArray, frustumNear, zFar, lambda);<NEW_LINE>// in parallel projection shadow position goe from 0 to 1<NEW_LINE>if (viewCam.isParallelProjection()) {<NEW_LINE>for (int i = 0; i < nbShadowMaps; i++) {<NEW_LINE>splitsArray[i] = splitsArray[i] / (zFar - frustumNear);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>switch(splitsArray.length) {<NEW_LINE>case 5:<NEW_LINE>splits.a = splitsArray[4];<NEW_LINE>case 4:<NEW_LINE>splits.b = splitsArray[3];<NEW_LINE>case 3:<NEW_LINE><MASK><NEW_LINE>case 2:<NEW_LINE>case 1:<NEW_LINE>splits.r = splitsArray[1];<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}
splits.g = splitsArray[2];
1,595,559
private void hideError() {<NEW_LINE>logDebug("hideError");<NEW_LINE>isErrorShown = false;<NEW_LINE>pinError.setVisibility(View.GONE);<NEW_LINE>firstPin.setTextColor(ContextCompat.getColor(this, R.color.grey_087_white_087));<NEW_LINE>secondPin.setTextColor(ContextCompat.getColor(this, R.color.grey_087_white_087));<NEW_LINE>thirdPin.setTextColor(ContextCompat.getColor(this<MASK><NEW_LINE>fourthPin.setTextColor(ContextCompat.getColor(this, R.color.grey_087_white_087));<NEW_LINE>fifthPin.setTextColor(ContextCompat.getColor(this, R.color.grey_087_white_087));<NEW_LINE>sixthPin.setTextColor(ContextCompat.getColor(this, R.color.grey_087_white_087));<NEW_LINE>}
, R.color.grey_087_white_087));
1,143,870
private OsAccount osAccountFromResultSet(ResultSet rs) throws SQLException {<NEW_LINE>OsAccountType accountType = null;<NEW_LINE>int <MASK><NEW_LINE>if (!rs.wasNull()) {<NEW_LINE>accountType = OsAccount.OsAccountType.fromID(typeId);<NEW_LINE>}<NEW_LINE>// getLong returns 0 if value is null<NEW_LINE>Long creationTime = rs.getLong("created_date");<NEW_LINE>if (rs.wasNull()) {<NEW_LINE>creationTime = null;<NEW_LINE>}<NEW_LINE>return new OsAccount(db, rs.getLong("os_account_obj_id"), rs.getLong("realm_id"), rs.getString("login_name"), rs.getString("addr"), rs.getString("signature"), rs.getString("full_name"), creationTime, accountType, OsAccount.OsAccountStatus.fromID(rs.getInt("status")), OsAccount.OsAccountDbStatus.fromID(rs.getInt("db_status")));<NEW_LINE>}
typeId = rs.getInt("type");
648,282
@Timed<NEW_LINE>@ApiOperation("Add a list of new patterns")<NEW_LINE>@AuditEvent(type = AuditEventTypes.GROK_PATTERN_IMPORT_CREATE)<NEW_LINE>public // deprecated. used to drop all existing patterns before import<NEW_LINE>Response // deprecated. used to drop all existing patterns before import<NEW_LINE>bulkUpdatePatternsFromTextFile(// deprecated. used to drop all existing patterns before import<NEW_LINE>@ApiParam(name = "patterns", required = true) @NotNull InputStream patternsFile, @Deprecated @QueryParam("replace") @DefaultValue("false") boolean deprecatedDropAllExisting, @ApiParam(name = "import-strategy", value = "Strategy to apply when importing.") @QueryParam("import-strategy") ImportStrategy importStrategy) throws ValidationException, IOException {<NEW_LINE>checkPermission(RestPermissions.INPUTS_CREATE);<NEW_LINE>final List<<MASK><NEW_LINE>if (!grokPatterns.isEmpty()) {<NEW_LINE>try {<NEW_LINE>if (!grokPatternService.validateAll(grokPatterns)) {<NEW_LINE>throw new ValidationException("Invalid pattern contained. Did not save any patterns.");<NEW_LINE>}<NEW_LINE>} catch (GrokException | IllegalArgumentException e) {<NEW_LINE>throw new ValidationException("Invalid pattern. Did not save any patterns\n" + e.getMessage());<NEW_LINE>}<NEW_LINE>ImportStrategy resolvedStrategy = importStrategy != null ? importStrategy : deprecatedDropAllExisting ? ImportStrategy.DROP_ALL_EXISTING : ImportStrategy.ABORT_ON_CONFLICT;<NEW_LINE>grokPatternService.saveAll(grokPatterns, resolvedStrategy);<NEW_LINE>}<NEW_LINE>return Response.accepted().build();<NEW_LINE>}
GrokPattern> grokPatterns = readGrokPatterns(patternsFile);
733,312
public static AtlasRestoreService create(AuthHeader authHeader, Refreshable<ServicesConfigBlock> servicesConfigBlock, String serviceName, BackupPersister backupPersister, Function<Namespace, CassandraKeyValueServiceConfig> keyValueServiceConfigFactory, Function<Namespace, KeyValueService> keyValueServiceFactory) {<NEW_LINE>DialogueClients.ReloadingFactory reloadingFactory = DialogueClients.create(servicesConfigBlock).withUserAgent(UserAgent.of(AtlasDbRemotingConstants.ATLASDB_HTTP_CLIENT_AGENT));<NEW_LINE>AtlasRestoreClient atlasRestoreClient = new DialogueAdaptingAtlasRestoreClient(reloadingFactory.get(AtlasRestoreClientBlocking.class, serviceName));<NEW_LINE>TimeLockManagementService timeLockManagementService = new DialogueAdaptingTimeLockManagementService(reloadingFactory.get(TimeLockManagementServiceBlocking.class, serviceName));<NEW_LINE>CassandraRepairHelper cassandraRepairHelper = new CassandraRepairHelper(KvsRunner<MASK><NEW_LINE>return new AtlasRestoreService(authHeader, atlasRestoreClient, timeLockManagementService, backupPersister, cassandraRepairHelper);<NEW_LINE>}
.create(keyValueServiceFactory), keyValueServiceConfigFactory);
408,290
private static void categorizeTreeRules(List<Pair<POMErrorFixBase, FileObject>> rules, FileObject rootFolder, DefaultMutableTreeNode rootNode) {<NEW_LINE>Map<FileObject, DefaultMutableTreeNode> dir2node = new HashMap<FileObject, DefaultMutableTreeNode>();<NEW_LINE>dir2node.put(rootFolder, rootNode);<NEW_LINE>for (Pair<POMErrorFixBase, FileObject> pair : rules) {<NEW_LINE>POMErrorFixBase rule = pair.first();<NEW_LINE>FileObject fo = pair.second();<NEW_LINE>Object nonGuiObject = fo.getAttribute(NON_GUI);<NEW_LINE>boolean toGui = true;<NEW_LINE>if (nonGuiObject != null && nonGuiObject instanceof Boolean && ((Boolean) nonGuiObject).booleanValue()) {<NEW_LINE>toGui = false;<NEW_LINE>}<NEW_LINE>FileObject parent = fo.getParent();<NEW_LINE>DefaultMutableTreeNode category = dir2node.get(parent);<NEW_LINE>if (category == null) {<NEW_LINE>category = new DefaultMutableTreeNode(parent);<NEW_LINE>rootNode.add(category);<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (toGui) {<NEW_LINE>category.add(new DefaultMutableTreeNode(rule, false));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
dir2node.put(parent, category);
162,993
/* Traverseproc implementation */<NEW_LINE>@Override<NEW_LINE>public int traverse(Visitproc visit, Object arg) {<NEW_LINE>int res = 0;<NEW_LINE>if (pointer != null && pointer instanceof PyObject) {<NEW_LINE>res = visit.visit<MASK><NEW_LINE>if (res != 0) {<NEW_LINE>return res;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (dict != null) {<NEW_LINE>res = visit.visit(dict, arg);<NEW_LINE>if (res != 0) {<NEW_LINE>return res;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (restype != null) {<NEW_LINE>res = visit.visit(restype, arg);<NEW_LINE>if (res != 0) {<NEW_LINE>return res;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (argtypes != null) {<NEW_LINE>for (PyObject obj : argtypes) {<NEW_LINE>res = visit.visit(obj, arg);<NEW_LINE>if (res != 0) {<NEW_LINE>return res;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return 0;<NEW_LINE>}
((PyObject) pointer, arg);
1,853,656
public ServerConfiguration load(String issuer) throws Exception {<NEW_LINE>RestTemplate restTemplate = new RestTemplate(httpFactory);<NEW_LINE>// data holder<NEW_LINE>ServerConfiguration conf = new ServerConfiguration();<NEW_LINE>// construct the well-known URI<NEW_LINE>String url = issuer + "/.well-known/openid-configuration";<NEW_LINE>// fetch the value<NEW_LINE>String jsonString = restTemplate.getForObject(url, String.class);<NEW_LINE>JsonElement parsed = parser.parse(jsonString);<NEW_LINE>if (parsed.isJsonObject()) {<NEW_LINE>JsonObject o = parsed.getAsJsonObject();<NEW_LINE>// sanity checks<NEW_LINE>if (!o.has("issuer")) {<NEW_LINE>throw new IllegalStateException("Returned object did not have an 'issuer' field");<NEW_LINE>}<NEW_LINE>if (!issuer.equals(o.get("issuer").getAsString())) {<NEW_LINE>logger.info("Issuer used for discover was " + issuer + " but final issuer is " + o.get("issuer").getAsString());<NEW_LINE>}<NEW_LINE>conf.setIssuer(o.get("issuer").getAsString());<NEW_LINE>conf.setAuthorizationEndpointUri(getAsString(o, "authorization_endpoint"));<NEW_LINE>conf.setTokenEndpointUri(getAsString(o, "token_endpoint"));<NEW_LINE>conf.setJwksUri(getAsString(o, "jwks_uri"));<NEW_LINE>conf.setUserInfoUri(getAsString(o, "userinfo_endpoint"));<NEW_LINE>conf.setRegistrationEndpointUri(getAsString(o, "registration_endpoint"));<NEW_LINE>conf.setIntrospectionEndpointUri(getAsString(o, "introspection_endpoint"));<NEW_LINE>conf.setAcrValuesSupported<MASK><NEW_LINE>conf.setCheckSessionIframe(getAsString(o, "check_session_iframe"));<NEW_LINE>conf.setClaimsLocalesSupported(getAsStringList(o, "claims_locales_supported"));<NEW_LINE>conf.setClaimsParameterSupported(getAsBoolean(o, "claims_parameter_supported"));<NEW_LINE>conf.setClaimsSupported(getAsStringList(o, "claims_supported"));<NEW_LINE>conf.setDisplayValuesSupported(getAsStringList(o, "display_values_supported"));<NEW_LINE>conf.setEndSessionEndpoint(getAsString(o, "end_session_endpoint"));<NEW_LINE>conf.setGrantTypesSupported(getAsStringList(o, "grant_types_supported"));<NEW_LINE>conf.setIdTokenSigningAlgValuesSupported(getAsJwsAlgorithmList(o, "id_token_signing_alg_values_supported"));<NEW_LINE>conf.setIdTokenEncryptionAlgValuesSupported(getAsJweAlgorithmList(o, "id_token_encryption_alg_values_supported"));<NEW_LINE>conf.setIdTokenEncryptionEncValuesSupported(getAsEncryptionMethodList(o, "id_token_encryption_enc_values_supported"));<NEW_LINE>conf.setOpPolicyUri(getAsString(o, "op_policy_uri"));<NEW_LINE>conf.setOpTosUri(getAsString(o, "op_tos_uri"));<NEW_LINE>conf.setRequestObjectEncryptionAlgValuesSupported(getAsJweAlgorithmList(o, "request_object_encryption_alg_values_supported"));<NEW_LINE>conf.setRequestObjectEncryptionEncValuesSupported(getAsEncryptionMethodList(o, "request_object_encryption_enc_values_supported"));<NEW_LINE>conf.setRequestObjectSigningAlgValuesSupported(getAsJwsAlgorithmList(o, "request_object_signing_alg_values_supported"));<NEW_LINE>conf.setRequestParameterSupported(getAsBoolean(o, "request_parameter_supported"));<NEW_LINE>conf.setRequestUriParameterSupported(getAsBoolean(o, "request_uri_parameter_supported"));<NEW_LINE>conf.setResponseTypesSupported(getAsStringList(o, "response_types_supported"));<NEW_LINE>conf.setScopesSupported(getAsStringList(o, "scopes_supported"));<NEW_LINE>conf.setSubjectTypesSupported(getAsStringList(o, "subject_types_supported"));<NEW_LINE>conf.setServiceDocumentation(getAsString(o, "service_documentation"));<NEW_LINE>conf.setTokenEndpointAuthMethodsSupported(getAsStringList(o, "token_endpoint_auth_methods"));<NEW_LINE>conf.setTokenEndpointAuthSigningAlgValuesSupported(getAsJwsAlgorithmList(o, "token_endpoint_auth_signing_alg_values_supported"));<NEW_LINE>conf.setUiLocalesSupported(getAsStringList(o, "ui_locales_supported"));<NEW_LINE>conf.setUserinfoEncryptionAlgValuesSupported(getAsJweAlgorithmList(o, "userinfo_encryption_alg_values_supported"));<NEW_LINE>conf.setUserinfoEncryptionEncValuesSupported(getAsEncryptionMethodList(o, "userinfo_encryption_enc_values_supported"));<NEW_LINE>conf.setUserinfoSigningAlgValuesSupported(getAsJwsAlgorithmList(o, "userinfo_signing_alg_values_supported"));<NEW_LINE>return conf;<NEW_LINE>} else {<NEW_LINE>throw new IllegalStateException("Couldn't parse server discovery results for " + url);<NEW_LINE>}<NEW_LINE>}
(getAsStringList(o, "acr_values_supported"));
594,700
private int encryptColumnContents(final String columnName, final String tableName) {<NEW_LINE>final String idColumnName = InterfaceWrapperHelper.getKeyColumnName(tableName);<NEW_LINE>final String selectSql = "SELECT " + idColumnName + "," + columnName + " FROM " + tableName + " ORDER BY " + idColumnName;<NEW_LINE>final String updateSql = "UPDATE " + tableName + " SET " + columnName + "=? WHERE " + idColumnName + "=?";<NEW_LINE>PreparedStatement selectStmt = null;<NEW_LINE>ResultSet rs = null;<NEW_LINE>PreparedStatement updateStmt = null;<NEW_LINE>try {<NEW_LINE>selectStmt = DB.prepareStatement(selectSql, ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_UPDATABLE, ITrx.TRXNAME_ThreadInherited);<NEW_LINE>updateStmt = DB.prepareStatement(updateSql, ITrx.TRXNAME_ThreadInherited);<NEW_LINE>rs = selectStmt.executeQuery();<NEW_LINE>int recordsEncrypted = 0;<NEW_LINE>while (rs.next()) {<NEW_LINE>final int id = rs.getInt(1);<NEW_LINE>final String valuePlain = rs.getString(2);<NEW_LINE>final String valueEncrypted = SecureEngine.encrypt(valuePlain);<NEW_LINE>// Update the row<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>updateStmt.setInt(2, id);<NEW_LINE>if (updateStmt.executeUpdate() != 1) {<NEW_LINE>throw new AdempiereException("EncryptError: Table=" + tableName + ", ID=" + id);<NEW_LINE>}<NEW_LINE>} catch (SQLException ex) {<NEW_LINE>throw new DBException(ex, updateSql);<NEW_LINE>}<NEW_LINE>//<NEW_LINE>recordsEncrypted++;<NEW_LINE>}<NEW_LINE>return recordsEncrypted;<NEW_LINE>} catch (final SQLException ex) {<NEW_LINE>throw new DBException(ex, selectSql);<NEW_LINE>} finally {<NEW_LINE>DB.close(rs, selectStmt);<NEW_LINE>DB.close(updateStmt);<NEW_LINE>}<NEW_LINE>}
updateStmt.setString(1, valueEncrypted);
1,311,936
public FilteredLogEvent unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>AwsJsonReader reader = context.getReader();<NEW_LINE>if (!reader.isContainer()) {<NEW_LINE>reader.skipValue();<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>FilteredLogEvent filteredLogEvent = new FilteredLogEvent();<NEW_LINE>reader.beginObject();<NEW_LINE>while (reader.hasNext()) {<NEW_LINE>String name = reader.nextName();<NEW_LINE>if (name.equals("logStreamName")) {<NEW_LINE>filteredLogEvent.setLogStreamName(StringJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>} else if (name.equals("timestamp")) {<NEW_LINE>filteredLogEvent.setTimestamp(LongJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>} else if (name.equals("message")) {<NEW_LINE>filteredLogEvent.setMessage(StringJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>} else if (name.equals("ingestionTime")) {<NEW_LINE>filteredLogEvent.setIngestionTime(LongJsonUnmarshaller.getInstance<MASK><NEW_LINE>} else if (name.equals("eventId")) {<NEW_LINE>filteredLogEvent.setEventId(StringJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>} else {<NEW_LINE>reader.skipValue();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>reader.endObject();<NEW_LINE>return filteredLogEvent;<NEW_LINE>}
().unmarshall(context));
370,240
public Object put(Object obj) {<NEW_LINE>if (obj == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>Entry[] tab = data;<NEW_LINE>Entry prev = null;<NEW_LINE><MASK><NEW_LINE>int index = (hash & 0x7FFFFFFF) % tab.length;<NEW_LINE>for (Entry e = tab[index]; e != null; prev = e, e = e.next) {<NEW_LINE>if (e.hash == hash) {<NEW_LINE>Object value = e.value.get();<NEW_LINE>if (value == null) {<NEW_LINE>count--;<NEW_LINE>if (prev == null) {<NEW_LINE>tab[index] = e.next;<NEW_LINE>} else {<NEW_LINE>prev.next = e.next;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (value.equals(obj)) {<NEW_LINE>return value;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (count >= treshold) {<NEW_LINE>rehash();<NEW_LINE>tab = data;<NEW_LINE>index = (hash & 0x7FFFFFFF) % tab.length;<NEW_LINE>}<NEW_LINE>Entry e = new Entry(hash, obj, tab[index]);<NEW_LINE>tab[index] = e;<NEW_LINE>count++;<NEW_LINE>return obj;<NEW_LINE>}
int hash = obj.hashCode();
1,553,869
public void appendHoverText(@Nonnull ItemStack stack, Level world, @Nonnull List<Component> tooltip, @Nonnull TooltipFlag flag) {<NEW_LINE>if (MekKeyHandler.isKeyPressed(MekanismKeyHandler.detailsKey)) {<NEW_LINE>tooltip.add(MekanismLang.CAPABLE_OF_TRANSFERRING.translateColored(EnumColor.DARK_GRAY));<NEW_LINE>tooltip.add(MekanismLang.GASES.translateColored(EnumColor<MASK><NEW_LINE>} else {<NEW_LINE>TubeTier tier = getTier();<NEW_LINE>tooltip.add(MekanismLang.CAPACITY_MB_PER_TICK.translateColored(EnumColor.INDIGO, EnumColor.GRAY, TextUtils.format(tier.getTubeCapacity())));<NEW_LINE>tooltip.add(MekanismLang.PUMP_RATE_MB.translateColored(EnumColor.INDIGO, EnumColor.GRAY, TextUtils.format(tier.getTubePullAmount())));<NEW_LINE>tooltip.add(MekanismLang.HOLD_FOR_DETAILS.translateColored(EnumColor.GRAY, EnumColor.INDIGO, MekanismKeyHandler.detailsKey.getTranslatedKeyMessage()));<NEW_LINE>}<NEW_LINE>}
.PURPLE, MekanismLang.MEKANISM));
272,602
public static DescribeCasterStreamUrlResponse unmarshall(DescribeCasterStreamUrlResponse describeCasterStreamUrlResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeCasterStreamUrlResponse.setRequestId(_ctx.stringValue("DescribeCasterStreamUrlResponse.RequestId"));<NEW_LINE>describeCasterStreamUrlResponse.setCasterId(_ctx.stringValue("DescribeCasterStreamUrlResponse.CasterId"));<NEW_LINE>describeCasterStreamUrlResponse.setTotal(_ctx.integerValue("DescribeCasterStreamUrlResponse.Total"));<NEW_LINE>List<CasterStream> casterStreams = new ArrayList<CasterStream>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeCasterStreamUrlResponse.CasterStreams.Length"); i++) {<NEW_LINE>CasterStream casterStream = new CasterStream();<NEW_LINE>casterStream.setRtsUrl(_ctx.stringValue("DescribeCasterStreamUrlResponse.CasterStreams[" + i + "].RtsUrl"));<NEW_LINE>casterStream.setRtmpUrl(_ctx.stringValue("DescribeCasterStreamUrlResponse.CasterStreams[" + i + "].RtmpUrl"));<NEW_LINE>casterStream.setSceneId(_ctx.stringValue<MASK><NEW_LINE>casterStream.setOutputType(_ctx.integerValue("DescribeCasterStreamUrlResponse.CasterStreams[" + i + "].OutputType"));<NEW_LINE>casterStream.setStreamUrl(_ctx.stringValue("DescribeCasterStreamUrlResponse.CasterStreams[" + i + "].StreamUrl"));<NEW_LINE>List<StreamInfo> streamInfos = new ArrayList<StreamInfo>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("DescribeCasterStreamUrlResponse.CasterStreams[" + i + "].StreamInfos.Length"); j++) {<NEW_LINE>StreamInfo streamInfo = new StreamInfo();<NEW_LINE>streamInfo.setVideoFormat(_ctx.stringValue("DescribeCasterStreamUrlResponse.CasterStreams[" + i + "].StreamInfos[" + j + "].VideoFormat"));<NEW_LINE>streamInfo.setOutputStreamUrl(_ctx.stringValue("DescribeCasterStreamUrlResponse.CasterStreams[" + i + "].StreamInfos[" + j + "].OutputStreamUrl"));<NEW_LINE>streamInfo.setTranscodeConfig(_ctx.stringValue("DescribeCasterStreamUrlResponse.CasterStreams[" + i + "].StreamInfos[" + j + "].TranscodeConfig"));<NEW_LINE>streamInfos.add(streamInfo);<NEW_LINE>}<NEW_LINE>casterStream.setStreamInfos(streamInfos);<NEW_LINE>casterStreams.add(casterStream);<NEW_LINE>}<NEW_LINE>describeCasterStreamUrlResponse.setCasterStreams(casterStreams);<NEW_LINE>return describeCasterStreamUrlResponse;<NEW_LINE>}
("DescribeCasterStreamUrlResponse.CasterStreams[" + i + "].SceneId"));
1,545,334
public BlazeBuildOutputs run(Project project, BlazeCommand.Builder blazeCommandBuilder, BuildResultHelper buildResultHelper, WorkspaceRoot workspaceRoot, BlazeContext context) {<NEW_LINE>int retVal = ExternalTask.builder(workspaceRoot).addBlazeCommand(blazeCommandBuilder.build()).context(context).stderr(LineProcessingOutputStream.of(BlazeConsoleLineProcessorProvider.getAllStderrLineProcessors(context)))<MASK><NEW_LINE>BuildResult buildResult = BuildResult.fromExitCode(retVal);<NEW_LINE>if (buildResult.status == Status.FATAL_ERROR) {<NEW_LINE>return BlazeBuildOutputs.noOutputs(buildResult);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>context.output(PrintOutput.log("Build command finished. Retrieving BEP outputs..."));<NEW_LINE>return BlazeBuildOutputs.fromParsedBepOutput(buildResult, buildResultHelper.getBuildOutput());<NEW_LINE>} catch (GetArtifactsException e) {<NEW_LINE>IssueOutput.error("Failed to get build outputs: " + e.getMessage()).submit(context);<NEW_LINE>return BlazeBuildOutputs.noOutputs(buildResult);<NEW_LINE>}<NEW_LINE>}
.build().run();
1,390,204
public static boolean createOrphanBranch(Repository repository, String branchName, PersonIdent author) {<NEW_LINE>boolean success = false;<NEW_LINE>String message = "Created branch " + branchName;<NEW_LINE>if (author == null) {<NEW_LINE>author = new PersonIdent("Gitblit", "gitblit@localhost");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>ObjectInserter odi = repository.newObjectInserter();<NEW_LINE>try {<NEW_LINE>// Create a blob object to insert into a tree<NEW_LINE>ObjectId blobId = odi.insert(Constants.OBJ_BLOB, message.getBytes(Constants.CHARACTER_ENCODING));<NEW_LINE>// Create a tree object to reference from a commit<NEW_LINE>TreeFormatter tree = new TreeFormatter();<NEW_LINE>tree.append(".branch", FileMode.REGULAR_FILE, blobId);<NEW_LINE>ObjectId treeId = odi.insert(tree);<NEW_LINE>// Create a commit object<NEW_LINE>CommitBuilder commit = new CommitBuilder();<NEW_LINE>commit.setAuthor(author);<NEW_LINE>commit.setCommitter(author);<NEW_LINE><MASK><NEW_LINE>commit.setMessage(message);<NEW_LINE>commit.setTreeId(treeId);<NEW_LINE>// Insert the commit into the repository<NEW_LINE>ObjectId commitId = odi.insert(commit);<NEW_LINE>odi.flush();<NEW_LINE>RevWalk revWalk = new RevWalk(repository);<NEW_LINE>try {<NEW_LINE>RevCommit revCommit = revWalk.parseCommit(commitId);<NEW_LINE>if (!branchName.startsWith("refs/")) {<NEW_LINE>branchName = "refs/heads/" + branchName;<NEW_LINE>}<NEW_LINE>RefUpdate ru = repository.updateRef(branchName);<NEW_LINE>ru.setNewObjectId(commitId);<NEW_LINE>ru.setRefLogMessage("commit: " + revCommit.getShortMessage(), false);<NEW_LINE>Result rc = ru.forceUpdate();<NEW_LINE>switch(rc) {<NEW_LINE>case NEW:<NEW_LINE>case FORCED:<NEW_LINE>case FAST_FORWARD:<NEW_LINE>success = true;<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>success = false;<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>revWalk.close();<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>odi.close();<NEW_LINE>}<NEW_LINE>} catch (Throwable t) {<NEW_LINE>error(t, repository, "Failed to create orphan branch {1} in repository {0}", branchName);<NEW_LINE>}<NEW_LINE>return success;<NEW_LINE>}
commit.setEncoding(Constants.CHARACTER_ENCODING);
479,566
public void enable() {<NEW_LINE>tinkerforgeDevice = new BrickletHumidity(uid, ipConnection);<NEW_LINE>if (tfConfig != null) {<NEW_LINE>if (tfConfig.eIsSet(tfConfig.eClass().getEStructuralFeature("threshold"))) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (tfConfig.eIsSet(tfConfig.eClass().getEStructuralFeature("callbackPeriod"))) {<NEW_LINE>setCallbackPeriod(tfConfig.getCallbackPeriod());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>tinkerforgeDevice.setResponseExpected(BrickletHumidity.FUNCTION_SET_HUMIDITY_CALLBACK_PERIOD, false);<NEW_LINE>tinkerforgeDevice.setHumidityCallbackPeriod(callbackPeriod);<NEW_LINE>listener = new HumidityListener();<NEW_LINE>tinkerforgeDevice.addHumidityListener(listener);<NEW_LINE>fetchSensorValue();<NEW_LINE>} catch (TimeoutException e) {<NEW_LINE>TinkerforgeErrorHandler.handleError(this, TinkerforgeErrorHandler.TF_TIMEOUT_EXCEPTION, e);<NEW_LINE>} catch (NotConnectedException e) {<NEW_LINE>TinkerforgeErrorHandler.handleError(this, TinkerforgeErrorHandler.TF_NOT_CONNECTION_EXCEPTION, e);<NEW_LINE>}<NEW_LINE>}
setThreshold(tfConfig.getThreshold());
1,245,761
public ApiResponse<File> publicSharesGetPublicFileShareFileWithHttpInfo(String id) throws ApiException {<NEW_LINE>Object localVarPostBody = null;<NEW_LINE>// verify the required parameter 'id' is set<NEW_LINE>if (id == null) {<NEW_LINE>throw new ApiException(400, "Missing the required parameter 'id' when calling publicSharesGetPublicFileShareFile");<NEW_LINE>}<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/v4/publicshares/{id}/file".replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));<NEW_LINE>// query params<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>final String[] localVarAccepts = { "application/json", "text/json" };<NEW_LINE>final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>final String[] localVarContentTypes = {};<NEW_LINE>final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>String[] localVarAuthNames <MASK><NEW_LINE>GenericType<File> localVarReturnType = new GenericType<File>() {<NEW_LINE>};<NEW_LINE>return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);<NEW_LINE>}
= new String[] { "oauth2" };
153,843
public Change createPreChange(IProgressMonitor pm) throws CoreException, OperationCanceledException {<NEW_LINE>CompilationUnitChange change = new CompilationUnitChange(cu.getElementName(), cu);<NEW_LINE>change.setKeepPreviewEdits(true);<NEW_LINE>change.setEdit(new MultiTextEdit());<NEW_LINE>// parse javadocs and update references<NEW_LINE>for (ImageReference reference : UmletPluginUtils.collectUxfImgRefs(cu)) {<NEW_LINE>SourceString srcValue = reference.srcAttr.value;<NEW_LINE>if (UmletPluginUtils.isAbsoluteImageRef(srcValue.getValue())) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>IPackageFragment destinationPackage;<NEW_LINE>{<NEW_LINE>Object destination <MASK><NEW_LINE>if (!(destination instanceof IPackageFragment)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>destinationPackage = (IPackageFragment) destination;<NEW_LINE>}<NEW_LINE>IPath parentPath = UmletPluginUtils.getCompilationUnitParentPath(cu);<NEW_LINE>IPath imgPath = parentPath.append(new Path(srcValue.getValue()));<NEW_LINE>IPath destinationPath = UmletPluginUtils.getPackageFragmentRootRelativePath(cu.getJavaProject(), destinationPackage.getCorrespondingResource());<NEW_LINE>String newPath = UmletPluginUtils.calculateImageRef(destinationPath, imgPath);<NEW_LINE>change.addEdit(new ReplaceEdit(srcValue.start, srcValue.length(), newPath));<NEW_LINE>}<NEW_LINE>return change;<NEW_LINE>}
= getArguments().getDestination();
358,688
public okhttp3.Call updateEndpointCertificateByAliasCall(String alias, File certificate, final ApiCallback _callback) throws ApiException {<NEW_LINE>Object localVarPostBody = null;<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/endpoint-certificates/{alias}".replaceAll("\\{" + "alias" + "\\}", localVarApiClient.escapeString(alias.toString()));<NEW_LINE>List<Pair> localVarQueryParams <MASK><NEW_LINE>List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>Map<String, String> localVarCookieParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>if (certificate != null) {<NEW_LINE>localVarFormParams.put("certificate", certificate);<NEW_LINE>}<NEW_LINE>final String[] localVarAccepts = { "application/json" };<NEW_LINE>final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>if (localVarAccept != null) {<NEW_LINE>localVarHeaderParams.put("Accept", localVarAccept);<NEW_LINE>}<NEW_LINE>final String[] localVarContentTypes = { "multipart/form-data" };<NEW_LINE>final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>localVarHeaderParams.put("Content-Type", localVarContentType);<NEW_LINE>String[] localVarAuthNames = new String[] { "OAuth2Security" };<NEW_LINE>return localVarApiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);<NEW_LINE>}
= new ArrayList<Pair>();
1,235,304
public static LogEvent newInstance(PaxLoggingEvent event) {<NEW_LINE>LogEvent answer = new LogEvent();<NEW_LINE>try {<NEW_LINE>answer.setLevel(toString(event.getLevel()));<NEW_LINE>} catch (NoClassDefFoundError error) {<NEW_LINE>// ENTESB-2234, KARAF-3350: Ignore NoClassDefFoundError exceptions<NEW_LINE>// Those exceptions may happen if the underlying pax-logging service<NEW_LINE>// bundle has been refreshed somehow.<NEW_LINE>answer.setLevel("LOG");<NEW_LINE>}<NEW_LINE>answer.setMessage(event.getMessage());<NEW_LINE>answer.setLogger(event.getLoggerName());<NEW_LINE>answer.setTimestamp(new Date(event.getTimeStamp()));<NEW_LINE>answer.setThread(event.getThreadName());<NEW_LINE>answer.setException(addMavenCoord(event.getThrowableStrRep()));<NEW_LINE>Map eventProperties = event.getProperties();<NEW_LINE>if (eventProperties != null && eventProperties.size() > 0) {<NEW_LINE>Map<String, String> properties = new HashMap<String, String>();<NEW_LINE>Set<Map.Entry> set = eventProperties.entrySet();<NEW_LINE>for (Map.Entry entry : set) {<NEW_LINE>Object key = entry.getKey();<NEW_LINE>Object value = entry.getValue();<NEW_LINE>if (key != null && value != null) {<NEW_LINE>properties.put(toString(key), toString(value));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>addMavenCoord(properties);<NEW_LINE>answer.setProperties(properties);<NEW_LINE>}<NEW_LINE>// TODO missing fields...<NEW_LINE>// event.getRenderedMessage()<NEW_LINE>// event.getFQNOfLoggerClass()<NEW_LINE>try {<NEW_LINE>PaxLocationInfo locationInformation = event.getLocationInformation();<NEW_LINE>if (locationInformation != null) {<NEW_LINE>answer.setClassName(locationInformation.getClassName());<NEW_LINE>answer.setFileName(locationInformation.getFileName());<NEW_LINE>answer.setMethodName(locationInformation.getMethodName());<NEW_LINE>answer.<MASK><NEW_LINE>}<NEW_LINE>} catch (NoClassDefFoundError error) {<NEW_LINE>// ENTESB-2234, KARAF-3350: Ignore NoClassDefFoundError exceptions<NEW_LINE>}<NEW_LINE>return answer;<NEW_LINE>}
setLineNumber(locationInformation.getLineNumber());
616,067
private void reassignEarlyHolders8(Context context) {<NEW_LINE>ReflectUtil.field(Annotate.instance(context), TYPES_FIELD).set(this);<NEW_LINE>ReflectUtil.field(Attr.instance(context), TYPES_FIELD).set(this);<NEW_LINE>ReflectUtil.field(Check.instance(context), TYPES_FIELD).set(this);<NEW_LINE>ReflectUtil.field(DeferredAttr.instance(context), TYPES_FIELD).set(this);<NEW_LINE>ReflectUtil.field(Flow.instance(context), TYPES_FIELD).set(this);<NEW_LINE>ReflectUtil.field(Gen.instance(context), TYPES_FIELD).set(this);<NEW_LINE>ReflectUtil.field(Infer.instance(context), TYPES_FIELD).set(this);<NEW_LINE>ReflectUtil.field(JavaCompiler.instance(context), TYPES_FIELD).set(this);<NEW_LINE>ReflectUtil.field(JavacTrees.instance(context), TYPES_FIELD).set(this);<NEW_LINE>ReflectUtil.field(JavacTypes.instance(context), TYPES_FIELD).set(this);<NEW_LINE>ReflectUtil.field(JavacElements.instance(context), TYPES_FIELD).set(this);<NEW_LINE>ReflectUtil.field(LambdaToMethod.instance(context), TYPES_FIELD).set(this);<NEW_LINE>ReflectUtil.field(Lower.instance(context), TYPES_FIELD).set(this);<NEW_LINE>ReflectUtil.field(ManResolve.instance(context), TYPES_FIELD).set(this);<NEW_LINE>ReflectUtil.field(MemberEnter.instance(context), TYPES_FIELD).set(this);<NEW_LINE>ReflectUtil.field(RichDiagnosticFormatter.instance(context)<MASK><NEW_LINE>ReflectUtil.field(TransTypes.instance(context), TYPES_FIELD).set(this);<NEW_LINE>}
, TYPES_FIELD).set(this);
530,108
private void process(File xmlFile, StringBuilder out) throws IOException, SAXException, XPathExpressionException {<NEW_LINE>DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();<NEW_LINE>DocumentBuilder builder = null;<NEW_LINE>try {<NEW_LINE>builder = factory.newDocumentBuilder();<NEW_LINE>} catch (ParserConfigurationException e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>Document doc = builder.parse(new InputSource(new FileReader(xmlFile)));<NEW_LINE>// find all test nodes which contain a child element, which can be a failure or error<NEW_LINE>XPathFactory xpfactory = XPathFactory.newInstance();<NEW_LINE>XPath path = xpfactory.newXPath();<NEW_LINE>XPathExpression xpr = path.compile("//testcase[./*]");<NEW_LINE>Object results = xpr.evaluate(doc, XPathConstants.NODESET);<NEW_LINE>NodeList failures = (NodeList) results;<NEW_LINE>if (failures.getLength() == 0) {<NEW_LINE>// no failures were detected<NEW_LINE>if (verbose) {<NEW_LINE>log("No failures found in " + xmlFile.getCanonicalPath());<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>writeAttribute(doc.getFirstChild(), "Test failure : ", "name", "\n", out);<NEW_LINE>// iterate over failures writing out a summary<NEW_LINE>for (int i = 0; i < failures.getLength(); i++) {<NEW_LINE>Node <MASK><NEW_LINE>writeAttribute(failure, "Test case : ", "name", "\n", out);<NEW_LINE>NodeList children = failure.getChildNodes();<NEW_LINE>for (int j = 0; j < children.getLength(); j++) {<NEW_LINE>Node child = children.item(j);<NEW_LINE>if (child.getNodeName().equals("error")) {<NEW_LINE>writeAttribute(child, "Test error : ", "type", "\n", out);<NEW_LINE>out.append(child.getTextContent());<NEW_LINE>out.append("\n");<NEW_LINE>}<NEW_LINE>if (child.getNodeName().equals("failure")) {<NEW_LINE>writeAttribute(child, "Failure type : ", "type", "\n", out);<NEW_LINE>out.append(child.getTextContent());<NEW_LINE>out.append("\n");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
failure = failures.item(i);
1,260,741
protected TokenFilterFactory create(Version version) {<NEW_LINE>if (useFilterForMultitermQueries) {<NEW_LINE>return new MultiTermAwareTokenFilterFactory() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public String name() {<NEW_LINE>return getName();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public TokenStream create(TokenStream tokenStream) {<NEW_LINE>return create.apply(tokenStream, version);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Object getMultiTermComponent() {<NEW_LINE>return this;<NEW_LINE>}<NEW_LINE><NEW_LINE>public TokenFilterFactory getSynonymFilter() {<NEW_LINE>if (allowForSynonymParsing) {<NEW_LINE>return this;<NEW_LINE>}<NEW_LINE>DEPRECATION_LOGGER.deprecatedAndMaybeLog(name(), "Token filter [" + name() + "] will not be usable to parse synonyms after v7.0");<NEW_LINE>return this;<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}<NEW_LINE>return new TokenFilterFactory() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public String name() {<NEW_LINE>return getName();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public TokenStream create(TokenStream tokenStream) {<NEW_LINE>return <MASK><NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public TokenFilterFactory getSynonymFilter() {<NEW_LINE>if (allowForSynonymParsing) {<NEW_LINE>return this;<NEW_LINE>}<NEW_LINE>DEPRECATION_LOGGER.deprecatedAndMaybeLog(name(), "Token filter [" + name() + "] will not be usable to parse synonyms after v7.0");<NEW_LINE>return this;<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}
create.apply(tokenStream, version);
1,807,533
public GetCanaryResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>GetCanaryResult getCanaryResult = new GetCanaryResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE><MASK><NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return getCanaryResult;<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("Canary", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>getCanaryResult.setCanary(CanaryJsonUnmarshaller.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 getCanaryResult;<NEW_LINE>}
JsonToken token = context.getCurrentToken();
1,137,599
private static void update(AwbBundle awbBundle, Map<String, BundleInfo> bundleInfoMap, AppVariantContext appVariantContext, String apkVersion, String baseVersion) throws DocumentException {<NEW_LINE>String artifactId = awbBundle.getResolvedCoordinates().getArtifactId();<NEW_LINE>BundleInfo bundleInfo = bundleInfoMap.get(artifactId);<NEW_LINE>if (null != bundleInfo) {<NEW_LINE>awbBundle.bundleInfo = bundleInfo;<NEW_LINE>} else {<NEW_LINE>bundleInfo = awbBundle.bundleInfo;<NEW_LINE>}<NEW_LINE>bundleInfo.setIsMBundle(awbBundle.isMBundle);<NEW_LINE>if (appVariantContext.getAtlasExtension().getTBuildConfig().getInsideOfApkBundles().size() > 0) {<NEW_LINE>awbBundle.isRemote = !appVariantContext.getAtlasExtension().getTBuildConfig().getInsideOfApkBundles().contains(artifactId);<NEW_LINE>} else if (appVariantContext.getAtlasExtension().getTBuildConfig().getOutOfApkBundles().size() > 0) {<NEW_LINE>awbBundle.isRemote = appVariantContext.getAtlasExtension().getTBuildConfig().getOutOfApkBundles().contains(artifactId);<NEW_LINE>}<NEW_LINE>bundleInfo.setIsInternal(!awbBundle.isRemote);<NEW_LINE>bundleInfo.setVersion(baseVersion + "@" + awbBundle.getResolvedCoordinates().getVersion());<NEW_LINE>bundleInfo.setPkgName(awbBundle.getPackageName());<NEW_LINE>String applicationName = ManifestFileUtils.getApplicationName(awbBundle.getManifest());<NEW_LINE>if (StringUtils.isNotEmpty(applicationName)) {<NEW_LINE>if (applicationName.startsWith(".")) {<NEW_LINE>applicationName = awbBundle.getPackageName() + applicationName;<NEW_LINE>}<NEW_LINE>bundleInfo.setApplicationName(applicationName);<NEW_LINE>}<NEW_LINE>ManifestHelper.collectBundleInfo(appVariantContext, bundleInfo, awbBundle.getManifest(<MASK><NEW_LINE>}
), awbBundle.getAndroidLibraries());
1,590,851
private static void addNSAwareCompletionItems(AXIComponent axi, CompletionContextImpl context, CompletionModel cm, List<CompletionResultItem> results) {<NEW_LINE>String typedChars = context.getTypedChars();<NEW_LINE>CompletionResultItem item = null;<NEW_LINE>if (!isFormQualified(axi)) {<NEW_LINE>item = <MASK><NEW_LINE>if (item == null)<NEW_LINE>return;<NEW_LINE>if (typedChars == null) {<NEW_LINE>results.add(item);<NEW_LINE>} else if (isResultItemTextStartsWith(item, typedChars)) {<NEW_LINE>results.add(item);<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// namespace aware items<NEW_LINE>List<String> prefixes = getPrefixes(context, axi, cm);<NEW_LINE>if (prefixes.size() == 0) {<NEW_LINE>prefixes.add(null);<NEW_LINE>}<NEW_LINE>for (String prefix : prefixes) {<NEW_LINE>item = createResultItem(axi, prefix, context);<NEW_LINE>if (item == null)<NEW_LINE>continue;<NEW_LINE>if (typedChars == null) {<NEW_LINE>results.add(item);<NEW_LINE>} else if (isResultItemTextStartsWith(item, typedChars)) {<NEW_LINE>results.add(item);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
createResultItem(axi, null, context);
35,976
private boolean saveChangedPrograms(List<Program> openProgramList) {<NEW_LINE>SaveDataDialog saveDataDialog = new SaveDataDialog(tool);<NEW_LINE>// don't modify the original list, as it is used by the caller to perform cleanup<NEW_LINE>List<Program> saveProgramsList <MASK><NEW_LINE>// make sure we have some files to save<NEW_LINE>List<DomainFile> domainFilesToSaveList = new ArrayList<>();<NEW_LINE>Iterator<Program> iter = saveProgramsList.iterator();<NEW_LINE>while (iter.hasNext()) {<NEW_LINE>Program program = iter.next();<NEW_LINE>DomainFile domainFile = program.getDomainFile();<NEW_LINE>if (!domainFile.isChanged()) {<NEW_LINE>iter.remove();<NEW_LINE>} else {<NEW_LINE>domainFilesToSaveList.add(domainFile);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (saveProgramsList.size() == 0) {<NEW_LINE>return true;<NEW_LINE>} else // calling can close here ensures that we use the same dialog for single files<NEW_LINE>if (saveProgramsList.size() == 1) {<NEW_LINE>return canClose(saveProgramsList.get(0));<NEW_LINE>}<NEW_LINE>return saveDataDialog.showDialog(domainFilesToSaveList);<NEW_LINE>}
= new ArrayList<>(openProgramList);
1,268,359
boolean openDialog() {<NEW_LINE>final JButton okButton = new JButton();<NEW_LINE>// NOI18N<NEW_LINE>Mnemonics.setLocalizedText(okButton, NbBundle.getMessage(BranchPicker.class, "LBL_BranchPicker.okButton.text"));<NEW_LINE>DialogDescriptor dd = new // NOI18N<NEW_LINE>// NOI18N<NEW_LINE>DialogDescriptor(// NOI18N<NEW_LINE>panel, NbBundle.getMessage(BranchPicker.class, "LBL_BranchPicker.title"), true, new Object[] { okButton, DialogDescriptor.CANCEL_OPTION }, okButton, DialogDescriptor.DEFAULT_ALIGN, new HelpCtx(BranchPicker.class), null);<NEW_LINE>okButton.setEnabled(false);<NEW_LINE>Dialog dialog = DialogDisplayer.getDefault().createDialog(dd);<NEW_LINE>ListSelectionListener list = new ListSelectionListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void valueChanged(ListSelectionEvent e) {<NEW_LINE>if (!e.getValueIsAdjusting()) {<NEW_LINE>String selected = (String) panel.lstBranches.getSelectedValue();<NEW_LINE>selectedPath = null;<NEW_LINE>if (!FORBIDDEN_SELECTION.contains(selected)) {<NEW_LINE>selectedPath = selected;<NEW_LINE>}<NEW_LINE>okButton.setEnabled(selectedPath != null);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>};<NEW_LINE><MASK><NEW_LINE>initializeItems();<NEW_LINE>dialog.setVisible(true);<NEW_LINE>SvnProgressSupport supp = loadingSupport;<NEW_LINE>if (supp != null) {<NEW_LINE>supp.cancel();<NEW_LINE>}<NEW_LINE>panel.lstBranches.removeListSelectionListener(list);<NEW_LINE>return dd.getValue() == okButton;<NEW_LINE>}
panel.lstBranches.addListSelectionListener(list);
692,859
public Response toResponse(Throwable ex) {<NEW_LINE>LOG.debug(ex.getMessage());<NEW_LINE>if (ex instanceof ProcessingException || ex instanceof IllegalArgumentException) {<NEW_LINE>final Response response = BadRequestException.of().getResponse();<NEW_LINE>return Response.fromResponse(response).type(MediaType.APPLICATION_JSON_TYPE).entity(new ErrorMessage(response.getStatus(), ex.getLocalizedMessage())).build();<NEW_LINE>} else if (ex instanceof UnableToExecuteStatementException) {<NEW_LINE>// TODO remove this<NEW_LINE>if (ex.getCause() instanceof SQLIntegrityConstraintViolationException) {<NEW_LINE>return Response.status(CONFLICT).type(MediaType.APPLICATION_JSON_TYPE).entity(new ErrorMessage(CONFLICT.getStatusCode(), CatalogExceptionMessage.ENTITY_ALREADY_EXISTS)).build();<NEW_LINE>}<NEW_LINE>} else if (ex instanceof EntityNotFoundException) {<NEW_LINE>return Response.status(NOT_FOUND).type(MediaType.APPLICATION_JSON_TYPE).entity(new ErrorMessage(NOT_FOUND.getStatusCode(), ex.getMessage())).build();<NEW_LINE>} else if (ex instanceof AirflowPipelineDeploymentException) {<NEW_LINE>return Response.status(BAD_REQUEST).type(MediaType.APPLICATION_JSON_TYPE).entity(new ErrorMessage(BAD_REQUEST.getStatusCode(), ex.getMessage<MASK><NEW_LINE>} else if (ex instanceof AuthenticationException) {<NEW_LINE>return Response.status(UNAUTHORIZED).type(MediaType.APPLICATION_JSON_TYPE).entity(new ErrorMessage(UNAUTHORIZED.getStatusCode(), ex.getMessage())).build();<NEW_LINE>} else if (ex instanceof AuthorizationException) {<NEW_LINE>return Response.status(FORBIDDEN).type(MediaType.APPLICATION_JSON_TYPE).entity(new ErrorMessage(FORBIDDEN.getStatusCode(), ex.getMessage())).build();<NEW_LINE>} else if (ex instanceof WebServiceException) {<NEW_LINE>final Response response = ((WebServiceException) ex).getResponse();<NEW_LINE>Family family = response.getStatusInfo().getFamily();<NEW_LINE>if (family.equals(Response.Status.Family.REDIRECTION)) {<NEW_LINE>return response;<NEW_LINE>}<NEW_LINE>if (family.equals(Family.SERVER_ERROR)) {<NEW_LINE>throwException(ex);<NEW_LINE>}<NEW_LINE>return Response.fromResponse(response).type(MediaType.APPLICATION_JSON_TYPE).entity(new ErrorMessage(response.getStatus(), ex.getLocalizedMessage())).build();<NEW_LINE>}<NEW_LINE>LOG.info("exception ", ex);<NEW_LINE>logUnhandledException(ex);<NEW_LINE>return new UnhandledServerException(ex.getMessage()).getResponse();<NEW_LINE>}
())).build();
1,629,605
public void run() {<NEW_LINE>List<String> args = new ArrayList<String>();<NEW_LINE>Object o;<NEW_LINE>for (int i = 0; i < paramTable.getRowCount(); ++i) {<NEW_LINE>o = paramTable.data.getValueAt(i, COL_VALUE);<NEW_LINE>args.add(o == null ? "" : o.toString());<NEW_LINE>}<NEW_LINE>String[] cmds;<NEW_LINE>if (GM.isWindowsOS()) {<NEW_LINE>cmds = new String[<MASK><NEW_LINE>cmds[0] = "cmd.exe";<NEW_LINE>cmds[1] = "/c";<NEW_LINE>cmds[2] = "start";<NEW_LINE>cmds[3] = "/b";<NEW_LINE>cmds[4] = " ";<NEW_LINE>cmds[5] = exeFile.getAbsolutePath();<NEW_LINE>cmds[6] = f.getAbsolutePath();<NEW_LINE>for (int i = 0; i < args.size(); i++) {<NEW_LINE>cmds[7 + i] = args.get(i);<NEW_LINE>}<NEW_LINE>} else if (GM.isMacOS()) {<NEW_LINE>cmds = new String[3 + args.size()];<NEW_LINE>cmds[0] = "sh";<NEW_LINE>cmds[1] = exeFile.getAbsolutePath();<NEW_LINE>cmds[2] = f.getAbsolutePath();<NEW_LINE>for (int i = 0; i < args.size(); i++) {<NEW_LINE>cmds[3 + i] = args.get(i);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>cmds = new String[4 + args.size()];<NEW_LINE>cmds[0] = "sh";<NEW_LINE>cmds[1] = "-c";<NEW_LINE>cmds[2] = exeFile.getAbsolutePath();<NEW_LINE>cmds[3] = f.getAbsolutePath();<NEW_LINE>for (int i = 0; i < args.size(); i++) {<NEW_LINE>cmds[4 + i] = args.get(i);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>Process proc = Runtime.getRuntime().exec(cmds);<NEW_LINE>ProcessWatchThread wt = new ProcessWatchThread(proc.getInputStream());<NEW_LINE>wt.start();<NEW_LINE>ProcessWatchThread wt1 = new ProcessWatchThread(proc.getErrorStream());<NEW_LINE>wt1.start();<NEW_LINE>proc.waitFor();<NEW_LINE>wt.setOver(true);<NEW_LINE>wt1.setOver(true);<NEW_LINE>closeDialog(JOptionPane.OK_OPTION);<NEW_LINE>((SPL) GV.appFrame).viewTabConsole();<NEW_LINE>} catch (Exception e1) {<NEW_LINE>GM.showException(e1);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}
7 + args.size()];
1,556,904
protected void reloadIfUnfetched(Set<Entity> resultEntities, CommitContext context) {<NEW_LINE>if (context.getViews().isEmpty())<NEW_LINE>return;<NEW_LINE>List<Entity> entitiesToReload = resultEntities.stream().filter(entity -> {<NEW_LINE>View view = context.getViews().get(entity);<NEW_LINE>return view != null && !<MASK><NEW_LINE>}).collect(Collectors.toList());<NEW_LINE>if (!entitiesToReload.isEmpty()) {<NEW_LINE>try (Transaction tx = getSaveTransaction(storeName, context.isJoinTransaction())) {<NEW_LINE>EntityManager em = persistence.getEntityManager(storeName);<NEW_LINE>for (Entity entity : entitiesToReload) {<NEW_LINE>View view = context.getViews().get(entity);<NEW_LINE>log.debug("Reloading {} according to the requested view", entity);<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>Entity reloadedEntity = em.find(entity.getClass(), entity.getId(), view);<NEW_LINE>resultEntities.remove(entity);<NEW_LINE>if (reloadedEntity != null) {<NEW_LINE>resultEntities.add(reloadedEntity);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>tx.commit();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
entityStates.isLoadedWithView(entity, view);
695,856
private CloseableIterable<ManifestEntry<DataFile>> addedDataFiles(TableMetadata base, Long startingSnapshotId, Expression dataFilter, PartitionSet partitionSet) {<NEW_LINE>// if there is no current table state, no files have been added<NEW_LINE>if (base.currentSnapshot() == null) {<NEW_LINE>return CloseableIterable.empty();<NEW_LINE>}<NEW_LINE>Pair<List<ManifestFile>, Set<Long>> history = validationHistory(base, startingSnapshotId, VALIDATE_ADDED_FILES_OPERATIONS, ManifestContent.DATA);<NEW_LINE>List<ManifestFile<MASK><NEW_LINE>Set<Long> newSnapshots = history.second();<NEW_LINE>ManifestGroup manifestGroup = new ManifestGroup(ops.io(), manifests, ImmutableList.of()).caseSensitive(caseSensitive).filterManifestEntries(entry -> newSnapshots.contains(entry.snapshotId())).specsById(base.specsById()).ignoreDeleted().ignoreExisting();<NEW_LINE>if (dataFilter != null) {<NEW_LINE>manifestGroup = manifestGroup.filterData(dataFilter);<NEW_LINE>}<NEW_LINE>if (partitionSet != null) {<NEW_LINE>manifestGroup = manifestGroup.filterManifestEntries(entry -> partitionSet.contains(entry.file().specId(), entry.file().partition()));<NEW_LINE>}<NEW_LINE>return manifestGroup.entries();<NEW_LINE>}
> manifests = history.first();
1,251,920
public static Cookie[] parseCookieHeader(String header) {<NEW_LINE>if ((header == null) || (header.length() < 1))<NEW_LINE><MASK><NEW_LINE>ArrayList<Cookie> cookies = new ArrayList<Cookie>();<NEW_LINE>while (header.length() > 0) {<NEW_LINE>int semicolon = header.indexOf(';');<NEW_LINE>if (semicolon < 0)<NEW_LINE>semicolon = header.length();<NEW_LINE>if (semicolon == 0)<NEW_LINE>break;<NEW_LINE>String token = header.substring(0, semicolon);<NEW_LINE>if (semicolon < header.length())<NEW_LINE>header = header.substring(semicolon + 1);<NEW_LINE>else<NEW_LINE>header = "";<NEW_LINE>try {<NEW_LINE>int equals = token.indexOf('=');<NEW_LINE>if (equals > 0) {<NEW_LINE>String name = token.substring(0, equals).trim();<NEW_LINE>String value = token.substring(equals + 1).trim();<NEW_LINE>cookies.add(new Cookie(name, value));<NEW_LINE>}<NEW_LINE>} catch (Throwable e) {<NEW_LINE>// Ignore<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return cookies.toArray(new Cookie[cookies.size()]);<NEW_LINE>}
return (new Cookie[0]);
1,726,209
private XmlXtraStationary createXmlXtraStationary(@Nullable final XtraHospitalType xtraHospital) {<NEW_LINE>if (xtraHospital == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>final XtraStationaryType xtraStationaryType = xtraHospital.getStationary();<NEW_LINE>if (xtraStationaryType == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>final XmlXtraStationaryBuilder xXtraStationary = XmlXtraStationary.builder();<NEW_LINE>xXtraStationary.hospitalizationDate(xtraStationaryType.getHospitalizationDate());<NEW_LINE>xXtraStationary.treatmentDays(xtraStationaryType.getTreatmentDays());<NEW_LINE>xXtraStationary.hospitalizationType(xtraStationaryType.getHospitalizationType());<NEW_LINE>xXtraStationary.hospitalizationMode(xtraStationaryType.getHospitalizationMode());<NEW_LINE>xXtraStationary.clazz(xtraStationaryType.getClazz());<NEW_LINE>xXtraStationary.sectionMajor(xtraStationaryType.getSectionMajor());<NEW_LINE>xXtraStationary.hasExpenseLoading(xtraStationaryType.isHasExpenseLoading());<NEW_LINE>xXtraStationary.admissionType(createXmlGrouperData<MASK><NEW_LINE>xXtraStationary.dischargeType(createXmlGrouperData(xtraStationaryType.getDischargeType()));<NEW_LINE>xXtraStationary.providerType(createXmlGrouperData(xtraStationaryType.getProviderType()));<NEW_LINE>xXtraStationary.bfsResidenceBeforeAdmission(createXmlBfsData(xtraStationaryType.getBfsResidenceBeforeAdmission()));<NEW_LINE>xXtraStationary.bfsAdmissionType(createXmlBfsData(xtraStationaryType.getBfsAdmissionType()));<NEW_LINE>xXtraStationary.bfsDecisionForDischarge(createXmlBfsData(xtraStationaryType.getBfsDecisionForDischarge()));<NEW_LINE>xXtraStationary.bfsResidenceAfterDischarge(createXmlBfsData(xtraStationaryType.getBfsResidenceAfterDischarge()));<NEW_LINE>for (final CaseDetailType caseDetail : xtraStationaryType.getCaseDetail()) {<NEW_LINE>xXtraStationary.caseDetail(createXmlCaseDetail(caseDetail));<NEW_LINE>}<NEW_LINE>return xXtraStationary.build();<NEW_LINE>}
(xtraStationaryType.getAdmissionType()));
311,610
public void write(ConnectorSession session, CheckpointEntries entries, Path targetPath) {<NEW_LINE>RowType metadataEntryType = checkpointSchemaManager.getMetadataEntryType();<NEW_LINE><MASK><NEW_LINE>RowType txnEntryType = checkpointSchemaManager.getTxnEntryType();<NEW_LINE>RowType addEntryType = checkpointSchemaManager.getAddEntryType(entries.getMetadataEntry());<NEW_LINE>RowType removeEntryType = checkpointSchemaManager.getRemoveEntryType();<NEW_LINE>List<String> columnNames = ImmutableList.of("metaData", "protocol", "txn", "add", "remove");<NEW_LINE>List<Type> columnTypes = ImmutableList.of(metadataEntryType, protocolEntryType, txnEntryType, addEntryType, removeEntryType);<NEW_LINE>Properties schema = buildSchemaProperties(columnNames, columnTypes);<NEW_LINE>Configuration conf = hdfsEnvironment.getConfiguration(new HdfsEnvironment.HdfsContext(session), targetPath);<NEW_LINE>configureCompression(conf, SNAPPY);<NEW_LINE>JobConf jobConf = toJobConf(conf);<NEW_LINE>RecordFileWriter writer = new RecordFileWriter(targetPath, columnNames, fromHiveStorageFormat(PARQUET), schema, PARQUET.getEstimatedWriterMemoryUsage(), jobConf, typeManager, DateTimeZone.UTC, session);<NEW_LINE>PageBuilder pageBuilder = new PageBuilder(columnTypes);<NEW_LINE>writeMetadataEntry(pageBuilder, metadataEntryType, entries.getMetadataEntry());<NEW_LINE>writeProtocolEntry(pageBuilder, protocolEntryType, entries.getProtocolEntry());<NEW_LINE>for (TransactionEntry transactionEntry : entries.getTransactionEntries()) {<NEW_LINE>writeTransactionEntry(pageBuilder, txnEntryType, transactionEntry);<NEW_LINE>}<NEW_LINE>for (AddFileEntry addFileEntry : entries.getAddFileEntries()) {<NEW_LINE>writeAddFileEntry(pageBuilder, addEntryType, addFileEntry);<NEW_LINE>}<NEW_LINE>for (RemoveFileEntry removeFileEntry : entries.getRemoveFileEntries()) {<NEW_LINE>writeRemoveFileEntry(pageBuilder, removeEntryType, removeFileEntry);<NEW_LINE>}<NEW_LINE>// Not writing commit infos for now. DB does not keep them in the checkpoints by default<NEW_LINE>writer.appendRows(pageBuilder.build());<NEW_LINE>writer.commit();<NEW_LINE>}
RowType protocolEntryType = checkpointSchemaManager.getProtocolEntryType();
362,702
private void updateUVIndexForecastChannel(ChannelUID channelUID, int count) {<NEW_LINE>String channelId = channelUID.getIdWithoutGroup();<NEW_LINE>String channelGroupId = channelUID.getGroupId();<NEW_LINE>if (uvindexForecastData != null && uvindexForecastData.size() >= count) {<NEW_LINE>OpenWeatherMapJsonUVIndexData forecastData = uvindexForecastData.get(count - 1);<NEW_LINE>State state = UnDefType.UNDEF;<NEW_LINE>switch(channelId) {<NEW_LINE>case CHANNEL_TIME_STAMP:<NEW_LINE>state = getDateTimeTypeState(forecastData.getDate());<NEW_LINE>break;<NEW_LINE>case CHANNEL_UVINDEX:<NEW_LINE>state = <MASK><NEW_LINE>break;<NEW_LINE>}<NEW_LINE>logger.debug("Update channel '{}' of group '{}' with new state '{}'.", channelId, channelGroupId, state);<NEW_LINE>updateState(channelUID, state);<NEW_LINE>} else {<NEW_LINE>logger.debug("No UV Index data available to update channel '{}' of group '{}'.", channelId, channelGroupId);<NEW_LINE>}<NEW_LINE>}
getDecimalTypeState(forecastData.getValue());
9,360
private void moveNewBundlesToFelixLoadFolder(final File uploadFolderFile, final String[] pathnames) {<NEW_LINE>final File deployDirectory = new File(this.getFelixDeployPath());<NEW_LINE>try {<NEW_LINE>if (deployDirectory.exists() && deployDirectory.canWrite()) {<NEW_LINE>for (final String pathname : pathnames) {<NEW_LINE>final File bundle <MASK><NEW_LINE>Logger.debug(this, "Moving the bundle: " + bundle + " to " + deployDirectory);<NEW_LINE>final File bundleDestination = new File(deployDirectory, bundle.getName());<NEW_LINE>if (FileUtil.move(bundle, bundleDestination)) {<NEW_LINE>Try.run(() -> APILocator.getSystemEventsAPI().push(SystemEventType.OSGI_BUNDLES_LOADED, new Payload(pathnames))).onFailure(e -> Logger.error(OSGIUtil.this, e.getMessage()));<NEW_LINE>Logger.debug(this, "Moved the bundle: " + bundle + " to " + deployDirectory);<NEW_LINE>} else {<NEW_LINE>Logger.debug(this, "Could not move the bundle: " + bundle + " to " + deployDirectory);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final String messageKey = pathnames.length > 1 ? "new-osgi-plugins-installed" : "new-osgi-plugin-installed";<NEW_LINE>final String successMessage = Try.of(() -> LanguageUtil.get(APILocator.getCompanyAPI().getDefaultCompany().getLocale(), messageKey)).getOrElse(() -> "New OSGi Plugin(s) have been installed");<NEW_LINE>SystemMessageEventUtil.getInstance().pushMessage("OSGI_BUNDLES_LOADED", new SystemMessageBuilder().setMessage(successMessage).setLife(DateUtil.FIVE_SECOND_MILLIS).setSeverity(MessageSeverity.SUCCESS).create(), null);<NEW_LINE>} else {<NEW_LINE>Logger.warn(this, "The directory: " + this.getFelixDeployPath() + " does not exists or can not read");<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>Logger.error(this, e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
= new File(uploadFolderFile, pathname);
636,557
public Object exec(List args) throws TemplateModelException {<NEW_LINE>if (args.size() != 1) {<NEW_LINE>throw new TemplateModelException("There should be a single argument of type string " + "passed to format description method");<NEW_LINE>}<NEW_LINE>SimpleScalar arg1 = (SimpleScalar) args.get(0);<NEW_LINE>String inputString = arg1.getAsString();<NEW_LINE>// Replacing spaces that should not be considered in text wrapping with non breaking spaces<NEW_LINE>inputString = replaceLeadingSpaces(inputString);<NEW_LINE>inputString = inputString.replaceAll("<", "&lt;");<NEW_LINE>inputString = <MASK><NEW_LINE>// Replacing new line characters<NEW_LINE>inputString = replaceNewLines(inputString);<NEW_LINE>inputString = inputString.replaceAll("\t", "&nbsp;&nbsp;&nbsp;&nbsp;");<NEW_LINE>inputString = inputString.replaceAll("```([^```]*)```", "</p><pre>$1</pre><p style=\"word-wrap: break-word;margin: 0;\">");<NEW_LINE>inputString = inputString.replaceAll("`([^`]*)`", "<code>$1</code>");<NEW_LINE>return "<p style=\"word-wrap: break-word;margin: 0;\">" + inputString + "</p>";<NEW_LINE>}
inputString.replaceAll(">", "&gt;");
1,411,731
public Service convertFromSObject(SService input, Service result, DatabaseSession session) throws BimserverDatabaseException {<NEW_LINE>if (input == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>result.setName(input.getName());<NEW_LINE>result.setServiceName(input.getServiceName());<NEW_LINE>result.setServiceIdentifier(input.getServiceIdentifier());<NEW_LINE>result.setProviderName(input.getProviderName());<NEW_LINE>result.setUrl(input.getUrl());<NEW_LINE>result.setToken(input.getToken());<NEW_LINE>result.setNotificationProtocol(AccessMethod.values()[input.getNotificationProtocol().ordinal()]);<NEW_LINE>result.setDescription(input.getDescription());<NEW_LINE>result.setTrigger(Trigger.values()[input.getTrigger().ordinal()]);<NEW_LINE>result.setReadRevision(input.isReadRevision());<NEW_LINE>result.setProfileIdentifier(input.getProfileIdentifier());<NEW_LINE>result.setProfileName(input.getProfileName());<NEW_LINE>result.setProfileDescription(input.getProfileDescription());<NEW_LINE>result.setProfilePublic(input.isProfilePublic());<NEW_LINE>result.setReadExtendedData((ExtendedDataSchema) session.get(StorePackage.eINSTANCE.getExtendedDataSchema(), input.getReadExtendedDataId(), OldQuery.getDefault()));<NEW_LINE>result.setWriteRevision((Project) session.get(StorePackage.eINSTANCE.getProject(), input.getWriteRevisionId()<MASK><NEW_LINE>result.setWriteExtendedData((ExtendedDataSchema) session.get(StorePackage.eINSTANCE.getExtendedDataSchema(), input.getWriteExtendedDataId(), OldQuery.getDefault()));<NEW_LINE>result.setProject((Project) session.get(StorePackage.eINSTANCE.getProject(), input.getProjectId(), OldQuery.getDefault()));<NEW_LINE>result.setUser((User) session.get(StorePackage.eINSTANCE.getUser(), input.getUserId(), OldQuery.getDefault()));<NEW_LINE>result.setInternalService((InternalServicePluginConfiguration) session.get(StorePackage.eINSTANCE.getInternalServicePluginConfiguration(), input.getInternalServiceId(), OldQuery.getDefault()));<NEW_LINE>List<ModelCheckerInstance> listmodelCheckers = result.getModelCheckers();<NEW_LINE>for (long oid : input.getModelCheckers()) {<NEW_LINE>listmodelCheckers.add((ModelCheckerInstance) session.get(StorePackage.eINSTANCE.getModelCheckerInstance(), oid, OldQuery.getDefault()));<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
, OldQuery.getDefault()));
651,531
public static void remove(Level world, ItemStack wand, Player player, BlockPos pos) {<NEW_LINE>BlockState air = Blocks.AIR.defaultBlockState();<NEW_LINE>BlockState ogBlock = world.getBlockState(pos);<NEW_LINE>checkNBT(wand);<NEW_LINE>if (!isEnabled(wand))<NEW_LINE>return;<NEW_LINE>Map<BlockPos, BlockState> blockSet = new HashMap<>();<NEW_LINE>blockSet.put(pos, air);<NEW_LINE>SymmetryMirror symmetry = SymmetryMirror.fromNBT((CompoundTag) wand.getTag().getCompound(SYMMETRY));<NEW_LINE>Vec3 mirrorPos = symmetry.getPosition();<NEW_LINE>if (mirrorPos.distanceTo(Vec3.atLowerCornerOf(pos)) > AllConfigs.SERVER.curiosities.maxSymmetryWandRange.get())<NEW_LINE>return;<NEW_LINE>symmetry.process(blockSet);<NEW_LINE>BlockPos to = new BlockPos(mirrorPos);<NEW_LINE>List<BlockPos> targets = new ArrayList<>();<NEW_LINE>targets.add(pos);<NEW_LINE>for (BlockPos position : blockSet.keySet()) {<NEW_LINE>if (!player.isCreative() && ogBlock.getBlock() != world.getBlockState(position).getBlock())<NEW_LINE>continue;<NEW_LINE>if (position.equals(pos))<NEW_LINE>continue;<NEW_LINE>BlockState blockstate = world.getBlockState(position);<NEW_LINE>if (blockstate.getMaterial() != Material.AIR) {<NEW_LINE>targets.add(position);<NEW_LINE>world.levelEvent(2001, position, Block.getId(blockstate));<NEW_LINE>world.setBlock(position, air, 3);<NEW_LINE>if (!player.isCreative()) {<NEW_LINE>if (!player.getMainHandItem().isEmpty())<NEW_LINE>player.getMainHandItem().mineBlock(world, blockstate, position, player);<NEW_LINE>BlockEntity tileentity = blockstate.hasBlockEntity() ? world.getBlockEntity(position) : null;<NEW_LINE>// Add fortune, silk touch and other loot modifiers<NEW_LINE>Block.dropResources(blockstate, world, pos, tileentity, player, player.getMainHandItem());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>AllPackets.channel.send(PacketDistributor.TRACKING_ENTITY_AND_SELF.with(() -> player), <MASK><NEW_LINE>}
new SymmetryEffectPacket(to, targets));
1,667,946
public void bind() throws MalformedURLException {<NEW_LINE>InstanceInfo myInfo = ApplicationInfoManager.getInstance().getInfo();<NEW_LINE>String myInstanceId = ((AmazonInfo) myInfo.getDataCenterInfo()).get(AmazonInfo.MetaDataKey.instanceId);<NEW_LINE>String myZone = ((AmazonInfo) myInfo.getDataCenterInfo()).get(AmazonInfo.MetaDataKey.availabilityZone);<NEW_LINE>final List<MASK><NEW_LINE>Ordering<NetworkInterface> ipsOrder = Ordering.natural().onResultOf(new Function<NetworkInterface, Integer>() {<NEW_LINE><NEW_LINE>public Integer apply(NetworkInterface networkInterface) {<NEW_LINE>return ips.indexOf(networkInterface.getPrivateIpAddress());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>AmazonEC2 ec2Service = getEC2Service();<NEW_LINE>String subnetId = instanceData(myInstanceId, ec2Service).getSubnetId();<NEW_LINE>DescribeNetworkInterfacesResult result = ec2Service.describeNetworkInterfaces(new DescribeNetworkInterfacesRequest().withFilters(new Filter("private-ip-address", ips)).withFilters(new Filter("status", Lists.newArrayList("available"))).withFilters(new Filter("subnet-id", Lists.newArrayList(subnetId))));<NEW_LINE>if (result.getNetworkInterfaces().isEmpty()) {<NEW_LINE>logger.info("No ip is free to be associated with this instance. Candidate ips are: {} for zone: {}", ips, myZone);<NEW_LINE>} else {<NEW_LINE>NetworkInterface selected = ipsOrder.min(result.getNetworkInterfaces());<NEW_LINE>ec2Service.attachNetworkInterface(new AttachNetworkInterfaceRequest().withNetworkInterfaceId(selected.getNetworkInterfaceId()).withDeviceIndex(1).withInstanceId(myInstanceId));<NEW_LINE>}<NEW_LINE>}
<String> ips = getCandidateIps();
1,426,746
public String rest() {<NEW_LINE>String result = restTemplate.getForObject("http://127.0.0.1:18082/storage/" + COMMODITY_CODE + "/" + ORDER_COUNT, String.class);<NEW_LINE>if (!SUCCESS.equals(result)) {<NEW_LINE>throw new RuntimeException();<NEW_LINE>}<NEW_LINE>String url = "http://127.0.0.1:18083/order";<NEW_LINE>HttpHeaders headers = new HttpHeaders();<NEW_LINE>headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED);<NEW_LINE>MultiValueMap<String, String> map = new LinkedMultiValueMap<String, String>();<NEW_LINE><MASK><NEW_LINE>map.add("commodityCode", COMMODITY_CODE);<NEW_LINE>map.add("orderCount", ORDER_COUNT + "");<NEW_LINE>HttpEntity<MultiValueMap<String, String>> request = new HttpEntity<MultiValueMap<String, String>>(map, headers);<NEW_LINE>ResponseEntity<String> response;<NEW_LINE>try {<NEW_LINE>response = restTemplate.postForEntity(url, request, String.class);<NEW_LINE>} catch (Exception exx) {<NEW_LINE>throw new RuntimeException("mock error");<NEW_LINE>}<NEW_LINE>result = response.getBody();<NEW_LINE>if (!SUCCESS.equals(result)) {<NEW_LINE>throw new RuntimeException();<NEW_LINE>}<NEW_LINE>return SUCCESS;<NEW_LINE>}
map.add("userId", USER_ID);
971,901
protected boolean deleteTimeSeries(DeleteTimeSeriesPlan deleteTimeSeriesPlan) throws QueryProcessException {<NEW_LINE>AUDIT_LOGGER.info("delete timeseries {}", deleteTimeSeriesPlan.getPaths());<NEW_LINE>List<PartialPath> deletePathList = deleteTimeSeriesPlan.getPaths();<NEW_LINE>for (int i = 0; i < deletePathList.size(); i++) {<NEW_LINE>PartialPath path = deletePathList.get(i);<NEW_LINE>try {<NEW_LINE>StorageEngine.getInstance().deleteTimeseries(path, deleteTimeSeriesPlan.getIndex(<MASK><NEW_LINE>if (deleteTimeSeriesPlan.isPrefixMatch()) {<NEW_LINE>// adapt to prefix match of 0.12<NEW_LINE>StorageEngine.getInstance().deleteTimeseries(path.concatNode(MULTI_LEVEL_PATH_WILDCARD), deleteTimeSeriesPlan.getIndex(), deleteTimeSeriesPlan.getPartitionFilter());<NEW_LINE>}<NEW_LINE>String failed = IoTDB.schemaProcessor.deleteTimeseries(path, deleteTimeSeriesPlan.isPrefixMatch());<NEW_LINE>if (failed != null) {<NEW_LINE>deleteTimeSeriesPlan.getResults().put(i, RpcUtils.getStatus(TSStatusCode.NODE_DELETE_FAILED_ERROR, failed));<NEW_LINE>}<NEW_LINE>} catch (StorageEngineException | MetadataException e) {<NEW_LINE>deleteTimeSeriesPlan.getResults().put(i, RpcUtils.getStatus(e.getErrorCode(), e.getMessage()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!deleteTimeSeriesPlan.getResults().isEmpty()) {<NEW_LINE>throw new BatchProcessException(deleteTimeSeriesPlan.getFailingStatus());<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
), deleteTimeSeriesPlan.getPartitionFilter());
805,980
private void handleOccurences(int offset, IAnnotationModel annotationModel, Map<Annotation, Position> occurrences, IDocument document) {<NEW_LINE>try {<NEW_LINE>ITypedRegion partition = document.getPartition(offset);<NEW_LINE>String offsetString = document.get(offset, partition.getLength());<NEW_LINE>// $NON-NLS-1$<NEW_LINE>int startIndex = offsetString.indexOf("id=");<NEW_LINE>// $NON-NLS-1$<NEW_LINE>int endIndex = offsetString.indexOf("\"", startIndex + 4);<NEW_LINE>if (startIndex != -1 && endIndex != -1) {<NEW_LINE>currentSelectedElementId = offsetString.substring(startIndex + 4, endIndex);<NEW_LINE>occurrences.put(new Annotation(IXMLEditorConstants.TAG_PAIR_OCCURRENCE_ID, false, null), new Position(partition.getOffset()<MASK><NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>IdeLog.logWarning(XMLPlugin.getDefault(), e);<NEW_LINE>}<NEW_LINE>for (Map.Entry<Annotation, Position> entry : occurrences.entrySet()) {<NEW_LINE>annotationModel.addAnnotation(entry.getKey(), entry.getValue());<NEW_LINE>}<NEW_LINE>fTagPairOccurrences = occurrences;<NEW_LINE>return;<NEW_LINE>}
, partition.getLength()));
1,555,088
final ListUnsupportedAppVersionResourcesResult executeListUnsupportedAppVersionResources(ListUnsupportedAppVersionResourcesRequest listUnsupportedAppVersionResourcesRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listUnsupportedAppVersionResourcesRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListUnsupportedAppVersionResourcesRequest> request = null;<NEW_LINE>Response<ListUnsupportedAppVersionResourcesResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new ListUnsupportedAppVersionResourcesRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listUnsupportedAppVersionResourcesRequest));<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, "resiliencehub");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListUnsupportedAppVersionResources");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListUnsupportedAppVersionResourcesResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListUnsupportedAppVersionResourcesResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
1,437,511
public Marker[] processImage(IplImage image) {<NEW_LINE>projectiveDevice.imageWidth = image.width();<NEW_LINE>projectiveDevice.imageHeight = image.height();<NEW_LINE>final boolean whiteMarkers = markedPlane.getForegroundColor().magnitude() > markedPlane.getBackgroundColor().magnitude();<NEW_LINE>if (image.depth() > 8) {<NEW_LINE>if (tempImage == null || tempImage.width() != image.width() || tempImage.height() != image.height()) {<NEW_LINE>tempImage = (IplImage) IplImage.create(image.width(), image.height(), IPL_DEPTH_8U, 1, image.origin());<NEW_LINE>}<NEW_LINE>cvConvertScale(image, tempImage, 1.0 / (1 << 8), 0);<NEW_LINE>lastDetectedMarkers = markerDetector.detect(tempImage, whiteMarkers);<NEW_LINE>} else {<NEW_LINE>lastDetectedMarkers = markerDetector.detect(image, whiteMarkers);<NEW_LINE>}<NEW_LINE>// First, check if we detected enough markers<NEW_LINE>if (lastDetectedMarkers.length < markedPlane.getMarkers().length * settings.detectedBoardMin) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>// then check by how much the corners of the calibration board moved<NEW_LINE>markedPlane.getTotalWarp(lastDetectedMarkers, warp);<NEW_LINE>cvPerspectiveTransform(warpSrcPts, warpDstPts, warp);<NEW_LINE>cvPerspectiveTransform(warpSrcPts, tempPts, prevWarp);<NEW_LINE>double rmsePrev = cvNorm(warpDstPts, tempPts);<NEW_LINE>cvPerspectiveTransform(warpSrcPts, tempPts, lastWarp);<NEW_LINE>double <MASK><NEW_LINE>// System.out.println("rmsePrev = " + rmsePrev + " rmseLast = " + rmseLast);<NEW_LINE>// save warp for next iteration...<NEW_LINE>cvCopy(warp, prevWarp);<NEW_LINE>// send upstream our recommendation for addition or not of these markers...<NEW_LINE>int imageSize = (image.width() + image.height()) / 2;<NEW_LINE>if (rmsePrev < settings.patternSteadySize * imageSize && rmseLast > settings.patternMovedSize * imageSize) {<NEW_LINE>return lastDetectedMarkers;<NEW_LINE>} else {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}
rmseLast = cvNorm(warpDstPts, tempPts);
1,383,746
public TrainingConfig build() {<NEW_LINE>if (!skipValidation) {<NEW_LINE>Preconditions.checkState(updater != null, "Updater (optimizer) must not be null. Use updater(IUpdater) to set an updater");<NEW_LINE>Preconditions.checkState(dataSetFeatureMapping != null, "No DataSet feature mapping has been provided. A " + "mapping between DataSet array positions and variables/placeholders must be provided - use dateSetFeatureMapping(...) to set this");<NEW_LINE>Preconditions.checkState(markLabelsUnused || dataSetLabelMapping != null, "No DataSet label mapping has been provided. A " + "mapping between DataSet array positions and variables/placeholders must be provided - use dataSetLabelMapping(...) to set this," + " or use markLabelsUnused() to mark labels as unused (for example, for unsupervised learning)");<NEW_LINE>Preconditions.checkArgument(trainEvaluations.keySet().equals(trainEvaluationLabels.keySet()), "Must specify a label index for each train evaluation. Expected: %s, got: %s", trainEvaluations.keySet(), trainEvaluationLabels.keySet());<NEW_LINE>Preconditions.checkArgument(validationEvaluations.keySet().equals(validationEvaluationLabels.keySet()), "Must specify a label index for each validation evaluation. Expected: %s, got: %s", validationEvaluations.keySet(<MASK><NEW_LINE>}<NEW_LINE>return new TrainingConfig(updater, regularization, minimize, dataSetFeatureMapping, dataSetLabelMapping, dataSetFeatureMaskMapping, dataSetLabelMaskMapping, lossVariables, trainEvaluations, trainEvaluationLabels, validationEvaluations, validationEvaluationLabels, initialLossDataType);<NEW_LINE>}
), validationEvaluationLabels.keySet());
1,810,938
public void debugFile(Lookup context) {<NEW_LINE>// need to fetch these vars _before_ focus changes (can happen in eventuallyUploadFiles() method)<NEW_LINE>URL urlForStartDebugging = null;<NEW_LINE>URL urlForStopDebugging = null;<NEW_LINE>try {<NEW_LINE>final URL urlForContext = getUrlToShow(CommandUtils.urlForContext(project, context));<NEW_LINE>if (urlForContext != null) {<NEW_LINE>urlForStartDebugging = CommandUtils.<MASK><NEW_LINE>urlForStopDebugging = CommandUtils.createDebugUrl(urlForContext, XDebugUrlArguments.XDEBUG_SESSION_STOP_NO_EXEC);<NEW_LINE>}<NEW_LINE>} catch (MalformedURLException ex) {<NEW_LINE>// TODO improve error handling<NEW_LINE>Exceptions.printStackTrace(ex);<NEW_LINE>return;<NEW_LINE>} catch (StopDebuggingException exc) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>preShowUrl(context);<NEW_LINE>debugFile(CommandUtils.fileForContextOrSelectedNodes(context, webRoot), urlForStartDebugging, urlForStopDebugging);<NEW_LINE>}
createDebugUrl(urlForContext, XDebugUrlArguments.XDEBUG_SESSION_START);
1,241,492
public // Label | String | LateBoundDefaultApi | StarlarkFunction<NEW_LINE>Descriptor // Label | String | LateBoundDefaultApi | StarlarkFunction<NEW_LINE>labelAttribute(// Sequence<String> expected<NEW_LINE>Object defaultValue, // Sequence<String> expected<NEW_LINE>String doc, // Sequence<String> expected<NEW_LINE>Boolean executable, // Sequence<String> expected<NEW_LINE>Object allowFiles, // Sequence<String> expected<NEW_LINE>Object allowSingleFile, // Sequence<String> expected<NEW_LINE>Boolean mandatory, // Sequence<String> expected<NEW_LINE>Sequence<?> providers, // Sequence<String> expected<NEW_LINE>Object allowRules, // Sequence<String> expected<NEW_LINE>Object cfg, // Sequence<String> expected<NEW_LINE>Sequence<?> aspects, Object flagsObject, StarlarkThread thread) throws EvalException {<NEW_LINE>BazelStarlarkContext.from<MASK><NEW_LINE>if (flagsObject != Starlark.UNBOUND) {<NEW_LINE>Label label = ((BazelModuleContext) Module.ofInnermostEnclosingStarlarkFunction(thread).getClientData()).label();<NEW_LINE>if (!label.getPackageIdentifier().getRepository().toString().equals("@_builtins")) {<NEW_LINE>throw Starlark.errorf("Rule in '%s' cannot use private API", label.getPackageName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>Sequence<String> flags = flagsObject == Starlark.UNBOUND ? StarlarkList.immutableOf() : ((Sequence<String>) flagsObject);<NEW_LINE>ImmutableAttributeFactory attribute = createAttributeFactory(BuildType.LABEL, doc, optionMap(DEFAULT_ARG, defaultValue, EXECUTABLE_ARG, executable, ALLOW_FILES_ARG, allowFiles, ALLOW_SINGLE_FILE_ARG, allowSingleFile, MANDATORY_ARG, mandatory, PROVIDERS_ARG, providers, ALLOW_RULES_ARG, allowRules, CONFIGURATION_ARG, cfg, ASPECTS_ARG, aspects, FLAGS_ARG, flags), thread, "label");<NEW_LINE>return new Descriptor("label", attribute);<NEW_LINE>}
(thread).checkLoadingOrWorkspacePhase("attr.label");
1,524,169
private boolean testJavaVMPtr(J9JavaVMPointer vmPtr) {<NEW_LINE>try {<NEW_LINE>if (vmPtr.reserved1_identifier().longValue() == J9JavaVM.J9VM_IDENTIFIER) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>} catch (NoSuchFieldError e) {<NEW_LINE>try {<NEW_LINE>Method method = vmPtr.<MASK><NEW_LINE>VoidPointer pointer = (VoidPointer) method.invoke(vmPtr);<NEW_LINE>Long fieldValue = pointer.longValue();<NEW_LINE>if (fieldValue == J9JavaVM.J9VM_IDENTIFIER) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>} catch (NoSuchMethodException e1) {<NEW_LINE>} catch (IllegalAccessException e2) {<NEW_LINE>} catch (IllegalArgumentException e3) {<NEW_LINE>} catch (InvocationTargetException e4) {<NEW_LINE>} catch (CorruptDataException e5) {<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} catch (CorruptDataException e) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
getClass().getMethod("reserved1");
1,602,987
protected Specification<COMMENT> buildSpecByQuery(@NonNull CommentQuery commentQuery) {<NEW_LINE>Assert.notNull(commentQuery, "Comment query must not be null");<NEW_LINE>return (root, query, criteriaBuilder) -> {<NEW_LINE>List<Predicate> predicates = new LinkedList<>();<NEW_LINE>if (commentQuery.getStatus() != null) {<NEW_LINE>predicates.add(criteriaBuilder.equal(root.get("status"), commentQuery.getStatus()));<NEW_LINE>}<NEW_LINE>if (commentQuery.getKeyword() != null) {<NEW_LINE>String likeCondition = String.format("%%%s%%", StringUtils.strip(commentQuery.getKeyword()));<NEW_LINE>Predicate authorLike = criteriaBuilder.like(root.get("author"), likeCondition);<NEW_LINE>Predicate contentLike = criteriaBuilder.like(root<MASK><NEW_LINE>Predicate emailLike = criteriaBuilder.like(root.get("email"), likeCondition);<NEW_LINE>predicates.add(criteriaBuilder.or(authorLike, contentLike, emailLike));<NEW_LINE>}<NEW_LINE>return query.where(predicates.toArray(new Predicate[0])).getRestriction();<NEW_LINE>};<NEW_LINE>}
.get("content"), likeCondition);
1,538,598
public static void export(CurrencyParameterSensitivity sensitivity, double scale, String fileName) {<NEW_LINE>ArgChecker.isTrue(sensitivity.getParameterMetadata().size() > 0, "Parameter metadata must be present");<NEW_LINE><MASK><NEW_LINE>List<ParameterMetadata> pmdl = sensitivity.getParameterMetadata();<NEW_LINE>int nbPts = sensitivity.getSensitivity().size();<NEW_LINE>String output = "Expiry, Tenor, Label, Value\n";<NEW_LINE>for (int looppts = 0; looppts < nbPts; looppts++) {<NEW_LINE>ArgChecker.isTrue(pmdl.get(looppts) instanceof SwaptionSurfaceExpiryTenorParameterMetadata, "tenor expiry");<NEW_LINE>SwaptionSurfaceExpiryTenorParameterMetadata pmd = (SwaptionSurfaceExpiryTenorParameterMetadata) pmdl.get(looppts);<NEW_LINE>double sens = s.get(looppts) * scale;<NEW_LINE>output = output + pmd.getYearFraction() + ", " + pmd.getTenor() + ", " + pmd.getLabel() + ", " + sens + "\n";<NEW_LINE>}<NEW_LINE>export(output, fileName);<NEW_LINE>}
DoubleArray s = sensitivity.getSensitivity();
1,795,621
private static JavaScriptNode createImpl(JavaScriptNode originalNode, JavaScriptNode transferSourcesFrom, Class<? extends Tag> expectedTag, boolean inputTag, NodeObjectDescriptor descriptor, Set<Class<? extends Tag>> materializedTags) {<NEW_LINE>// check if the node has already been tagged<NEW_LINE>JavaScriptNode realOriginal = originalNode;<NEW_LINE>if (originalNode instanceof WrapperNode) {<NEW_LINE>realOriginal = (JavaScriptNode) ((<MASK><NEW_LINE>}<NEW_LINE>assert !(realOriginal instanceof SuperPropertyReferenceNode);<NEW_LINE>if (realOriginal.hasTag(expectedTag) && (!inputTag || realOriginal.hasTag(JSTags.InputNodeTag.class))) {<NEW_LINE>return originalNode;<NEW_LINE>}<NEW_LINE>JavaScriptNode clone = cloneUninitialized(originalNode, materializedTags);<NEW_LINE>JavaScriptNode wrapper = new JSTaggedExecutionNode(clone, expectedTag, inputTag, descriptor);<NEW_LINE>transferSourceSection(transferSourcesFrom, wrapper);<NEW_LINE>return wrapper;<NEW_LINE>}
WrapperNode) originalNode).getDelegateNode();
477,328
public static void main(String[] args) {<NEW_LINE>// Instantiate a client that will be used to call the service.<NEW_LINE>TextAnalyticsAsyncClient client = new TextAnalyticsClientBuilder().credential(new AzureKeyCredential("{key}")).endpoint("{endpoint}").buildAsyncClient();<NEW_LINE>// The document that needs be analyzed.<NEW_LINE>String document = "Old Faithful is a geyser at Yellowstone Park.";<NEW_LINE>client.recognizeLinkedEntities(document).subscribe(linkedEntityCollection -> linkedEntityCollection.forEach(linkedEntity -> {<NEW_LINE>System.out.println("Linked Entities:");<NEW_LINE>System.out.printf("Name: %s, entity ID in data source: %s, URL: %s, data source: %s, " + "Bing Entity Search API ID: %s.%n", linkedEntity.getName(), linkedEntity.getDataSourceEntityId(), linkedEntity.getUrl(), linkedEntity.getDataSource(<MASK><NEW_LINE>linkedEntity.getMatches().forEach(entityMatch -> System.out.printf("Matched entity: %s, confidence score: %f.%n", entityMatch.getText(), entityMatch.getConfidenceScore()));<NEW_LINE>}), error -> System.err.println("There was an error recognizing linked entity of the text." + error), () -> System.out.println("Linked entity recognized."));<NEW_LINE>// The .subscribe() creation and assignment is not a blocking call. For the purpose of this example, we sleep<NEW_LINE>// the thread so the program does not end before the send operation is complete. Using .block() instead of<NEW_LINE>// .subscribe() will turn this into a synchronous call.<NEW_LINE>try {<NEW_LINE>TimeUnit.SECONDS.sleep(5);<NEW_LINE>} catch (InterruptedException ignored) {<NEW_LINE>}<NEW_LINE>}
), linkedEntity.getBingEntitySearchApiId());
1,642,769
public String submitJobs(FlinkInfo flinkInfo) {<NEW_LINE>RestClusterClient<StandaloneClusterId> client = null;<NEW_LINE>String localJarPath = flinkInfo.getLocalJarPath();<NEW_LINE>String[] programArgs = genProgramArgs(flinkInfo);<NEW_LINE>String jobId = "";<NEW_LINE>try {<NEW_LINE>client = getFlinkClient();<NEW_LINE>Configuration configuration = initConfiguration();<NEW_LINE>File jarFile = new File(localJarPath);<NEW_LINE>SavepointRestoreSettings savepointRestoreSettings = SavepointRestoreSettings.none();<NEW_LINE>PackagedProgram program = PackagedProgram.newBuilder().setConfiguration(configuration).setEntryPointClassName(Constants.ENTRYPOINT_CLASS).setJarFile(jarFile).setArguments(programArgs).setSavepointRestoreSettings(savepointRestoreSettings).build();<NEW_LINE>JobGraph jobGraph = PackagedProgramUtils.createJobGraph(program, configuration, parallelism, false);<NEW_LINE>CompletableFuture<JobID> <MASK><NEW_LINE>jobId = result.get().toString();<NEW_LINE>return jobId;<NEW_LINE>} catch (Exception e) {<NEW_LINE>log.error("submit job error", e);<NEW_LINE>}<NEW_LINE>return jobId;<NEW_LINE>}
result = client.submitJob(jobGraph);
526,644
final ListCustomRoutingEndpointGroupsResult executeListCustomRoutingEndpointGroups(ListCustomRoutingEndpointGroupsRequest listCustomRoutingEndpointGroupsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listCustomRoutingEndpointGroupsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListCustomRoutingEndpointGroupsRequest> request = null;<NEW_LINE>Response<ListCustomRoutingEndpointGroupsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListCustomRoutingEndpointGroupsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listCustomRoutingEndpointGroupsRequest));<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, "Global Accelerator");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListCustomRoutingEndpointGroups");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListCustomRoutingEndpointGroupsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListCustomRoutingEndpointGroupsResultJsonUnmarshaller());<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);
750,703
public /*<NEW_LINE>* Parg: replaced above commented out checking with one that verifies that the<NEW_LINE>* requests still exist. As piece-picker activity and peer disconnect logic is multi-threaded<NEW_LINE>* and full of holes, this is a stop-gap measure to prevent a piece from being left with<NEW_LINE>* requests that no longer exist<NEW_LINE>*/<NEW_LINE>void checkRequests() {<NEW_LINE>if (getTimeSinceLastActivity() < 30 * 1000) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int cleared = 0;<NEW_LINE>PEPeerManager manager = piecePicker.getPeerManager();<NEW_LINE>for (int i = 0; i < nbBlocks; i++) {<NEW_LINE>if (!downloaded[i] && !dmPiece.isWritten(i)) {<NEW_LINE>final String requester = requested[i];<NEW_LINE>if (requester != null) {<NEW_LINE>if (!manager.requestExists(requester, getPieceNumber(), i * DiskManager.BLOCK_SIZE, getBlockSize(i))) {<NEW_LINE>clearRequested(i);<NEW_LINE>cleared++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (cleared > 0) {<NEW_LINE>if (Logger.isEnabled())<NEW_LINE>Logger.log(new LogEvent(dmPiece.getManager().getTorrent(), LOGID, LogEvent.LT_WARNING, "checkRequests(): piece #" + getPieceNumber() + " cleared " + cleared + " requests"));<NEW_LINE>} else {<NEW_LINE>if (fully_requested && getNbUnrequested() > 0) {<NEW_LINE>if (Logger.isEnabled())<NEW_LINE>Logger.log(new LogEvent(dmPiece.getManager().getTorrent(), LOGID, LogEvent.LT_WARNING, "checkRequests(): piece #" <MASK><NEW_LINE>fully_requested = false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
+ getPieceNumber() + " reset fully requested"));
1,375,211
private void processAttributes(int item) {<NEW_LINE>do {<NEW_LINE>switch(getAIIState(item)) {<NEW_LINE>case STATE_ATTRIBUTE_U_LN_QN:<NEW_LINE>{<NEW_LINE>final String uri = readStructureString();<NEW_LINE>final String localName = readStructureString();<NEW_LINE>final String <MASK><NEW_LINE>_attributeCache.addAttributeWithPrefix(prefix, uri, localName, readStructureString(), readContentString());<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case STATE_ATTRIBUTE_P_U_LN:<NEW_LINE>_attributeCache.addAttributeWithPrefix(readStructureString(), readStructureString(), readStructureString(), readStructureString(), readContentString());<NEW_LINE>break;<NEW_LINE>case STATE_ATTRIBUTE_U_LN:<NEW_LINE>// _attributeCache follows SAX convention<NEW_LINE>_attributeCache.addAttributeWithPrefix("", readStructureString(), readStructureString(), readStructureString(), readContentString());<NEW_LINE>break;<NEW_LINE>case STATE_ATTRIBUTE_LN:<NEW_LINE>{<NEW_LINE>_attributeCache.addAttributeWithPrefix("", "", readStructureString(), readStructureString(), readContentString());<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>default:<NEW_LINE>assert false : "Internal XSB Error: wrong attribute state, Item=" + item;<NEW_LINE>}<NEW_LINE>readStructure();<NEW_LINE>item = peekStructure();<NEW_LINE>} while ((item & TYPE_MASK) == T_ATTRIBUTE);<NEW_LINE>}
prefix = getPrefixFromQName(readStructureString());
669,350
public int compare1(final PageTreeNode node1, final PageTreeNode node2) {<NEW_LINE>final int cp = viewState.pages.currentIndex;<NEW_LINE>final int viewIndex1 = node1.page.index.viewIndex;<NEW_LINE>final int viewIndex2 = node2.page.index.viewIndex;<NEW_LINE>final boolean v1 = viewState.isNodeVisible(node1, viewState.getBounds(node1.page));<NEW_LINE>final boolean v2 = viewState.isNodeVisible(node2, viewState.getBounds(node2.page));<NEW_LINE>final RectF s1 = node1.pageSliceBounds;<NEW_LINE>final RectF s2 = node2.pageSliceBounds;<NEW_LINE>int res = 0;<NEW_LINE>if (viewIndex1 == cp && viewIndex2 == cp) {<NEW_LINE>res = CompareUtils.compare(s1.top, s2.top);<NEW_LINE>if (res == 0) {<NEW_LINE>res = CompareUtils.compare(s1.left, s2.left);<NEW_LINE>}<NEW_LINE>} else if (v1 && !v2) {<NEW_LINE>res = -1;<NEW_LINE>} else if (!v1 && v2) {<NEW_LINE>res = 1;<NEW_LINE>} else {<NEW_LINE>final float d1 = viewIndex1 + s1.centerY() - (cp + 0.5f);<NEW_LINE>final float d2 = viewIndex2 + s2.centerY() - (cp + 0.5f);<NEW_LINE>final int dist1 = Math.abs((int) (d1 * node1.level.zoom));<NEW_LINE>final int dist2 = Math.abs((int) (d2 * node2.level.zoom));<NEW_LINE>res = CompareUtils.compare(dist1, dist2);<NEW_LINE>if (res == 0) {<NEW_LINE>res = -<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>return res;<NEW_LINE>}
CompareUtils.compare(viewIndex1, viewIndex2);