idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
963,583
private Supplier<Pair<Integer, JsonNode>> handleAddOp(String path, JsonNode patchValue, PatchRequestScope requestScope, PatchAction action) {<NEW_LINE>try {<NEW_LINE>JsonApiDocument value = requestScope.getMapper().readJsonApiPatchExtValue(patchValue);<NEW_LINE>Data<Resource> data = value.getData();<NEW_LINE>if (data == null || data.get() == null) {<NEW_LINE>throw new InvalidEntityBodyException("Expected an entity body but received none.");<NEW_LINE>}<NEW_LINE>Collection<Resource> resources = data.get();<NEW_LINE>if (!path.contains("relationships")) {<NEW_LINE>// Reserved key for relationships<NEW_LINE>String id = getSingleResource(resources).getId();<NEW_LINE>if (StringUtils.isEmpty(id)) {<NEW_LINE>throw new InvalidEntityBodyException("Patch extension requires all objects to have an assigned " + "ID (temporary or permanent) when assigning relationships.");<NEW_LINE>}<NEW_LINE>String fullPath = path + "/" + id;<NEW_LINE>// Defer relationship updating until the end<NEW_LINE>getSingleResource<MASK><NEW_LINE>// Reparse since we mangle it first<NEW_LINE>action.doc = requestScope.getMapper().readJsonApiPatchExtValue(patchValue);<NEW_LINE>action.path = fullPath;<NEW_LINE>action.isPostProcessing = true;<NEW_LINE>}<NEW_LINE>PostVisitor visitor = new PostVisitor(new PatchRequestScope(path, value, requestScope));<NEW_LINE>return visitor.visit(JsonApiParser.parse(path));<NEW_LINE>} catch (HttpStatusException e) {<NEW_LINE>action.cause = e;<NEW_LINE>throw e;<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new InvalidEntityBodyException("Could not parse patch extension value: " + patchValue);<NEW_LINE>}<NEW_LINE>}
(resources).setRelationships(null);
1,311,322
public void run() {<NEW_LINE>boolean addCloseTag;<NEW_LINE>int tag2Start;<NEW_LINE>int tagStart;<NEW_LINE>int tagEnd;<NEW_LINE>String tag;<NEW_LINE>String line = "";<NEW_LINE>try {<NEW_LINE>while (!m_ofx.equals("")) {<NEW_LINE>addCloseTag = false;<NEW_LINE><MASK><NEW_LINE>if (tagStart == -1) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>tagEnd = m_ofx.indexOf('>');<NEW_LINE>if (tagEnd <= tagStart + 1) {<NEW_LINE>throw new IOException("PARSE ERROR: Invalid tag");<NEW_LINE>}<NEW_LINE>tag = m_ofx.substring(tagStart + 1, tagEnd);<NEW_LINE>if (tag.indexOf(' ') != -1) {<NEW_LINE>throw new IOException("PARSE ERROR: Invalid tag");<NEW_LINE>}<NEW_LINE>if (!tag.startsWith("/")) {<NEW_LINE>addCloseTag = (m_ofx.indexOf("</" + tag + ">") == -1);<NEW_LINE>}<NEW_LINE>tag2Start = m_ofx.indexOf("<", tagEnd);<NEW_LINE>if (m_ofx.indexOf("\n", tagEnd) < tag2Start) {<NEW_LINE>tag2Start = m_ofx.indexOf("\n", tagEnd);<NEW_LINE>}<NEW_LINE>if (tag2Start == -1) {<NEW_LINE>tag2Start = m_ofx.length();<NEW_LINE>}<NEW_LINE>String data = m_ofx.substring(tagEnd + 1, tag2Start);<NEW_LINE>line = m_ofx.substring(0, tagEnd + 1) + xmlEncodeTextAsPCDATA(data);<NEW_LINE>m_ofx = m_ofx.substring(tag2Start);<NEW_LINE>if (addCloseTag) {<NEW_LINE>line += "</" + tag + ">";<NEW_LINE>}<NEW_LINE>write(line);<NEW_LINE>}<NEW_LINE>write(m_ofx);<NEW_LINE>m_writer.close();<NEW_LINE>} catch (IOException e) {<NEW_LINE>log.error("Ofx1To2Convertor: IO Exception", e);<NEW_LINE>}<NEW_LINE>}
tagStart = m_ofx.indexOf('<');
1,044,365
private void fillInOnlyRelevantValues(final ClientPerformanceSnapshot snapshot) {<NEW_LINE>List<ClientPerformanceSnapshot.Category<MASK><NEW_LINE>// header<NEW_LINE>LocalDate startDate = snapshot.getStartClientSnapshot().getTime();<NEW_LINE>String header = MessageFormat.format(Messages.PerformanceRelevantTransactionsHeader, Values.Date.format(startDate));<NEW_LINE>labels[0].setText(header);<NEW_LINE>for (int i = 1; i < 7; i++) {<NEW_LINE>ClientPerformanceSnapshot.Category category = categories.get(i);<NEW_LINE>signs[i].setText(category.getSign());<NEW_LINE>labels[i].setText(category.getLabel());<NEW_LINE>values[i].setText(Values.Money.format(category.getValuation(), getClient().getBaseCurrency()));<NEW_LINE>}<NEW_LINE>// footer<NEW_LINE>// $NON-NLS-1$<NEW_LINE>signs[7].setText("=");<NEW_LINE>LocalDate endDate = snapshot.getEndClientSnapshot().getTime();<NEW_LINE>String footer = MessageFormat.format(Messages.PerformanceRelevantTransactionsFooter, Values.Date.format(endDate));<NEW_LINE>labels[7].setText(footer);<NEW_LINE>Money totalRelevantTransactions = sumCategoryValuations(snapshot.getValue(CategoryType.INITIAL_VALUE).getCurrencyCode(), categories.subList(1, 6));<NEW_LINE>values[7].setText(Values.Money.format(totalRelevantTransactions, getClient().getBaseCurrency()));<NEW_LINE>}
> categories = snapshot.getCategories();
769,733
private String nodeToRankingExpression(LightGBMNode node) {<NEW_LINE>if (node.isLeaf()) {<NEW_LINE>return Double.toString(node.getLeaf_value());<NEW_LINE>} else {<NEW_LINE>String condition;<NEW_LINE>String feature = featureNames.get(node.getSplit_feature());<NEW_LINE>if (node.getDecision_type().equals("==")) {<NEW_LINE>String values = transformCategoryIndexesToValues(node);<NEW_LINE>if (node.isDefault_left()) {<NEW_LINE>// means go left (true) when isNan<NEW_LINE>condition = "isNan(" + feature + ") || (" + feature + " in [ " + values + "])";<NEW_LINE>} else {<NEW_LINE>condition = feature + " in [" + values + "]";<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// assumption: all other decision types are <=<NEW_LINE>double value = Double.parseDouble(node.getThreshold());<NEW_LINE>if (node.isDefault_left()) {<NEW_LINE>condition = "!(" + feature + " >= " + value + ")";<NEW_LINE>} else {<NEW_LINE>condition = feature + " < " + value;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>String left = <MASK><NEW_LINE>String right = nodeToRankingExpression(node.getRight_child());<NEW_LINE>return "if (" + condition + ", " + left + ", " + right + ")";<NEW_LINE>}<NEW_LINE>}
nodeToRankingExpression(node.getLeft_child());
1,745,136
final ListSamplesResult executeListSamples(ListSamplesRequest listSamplesRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listSamplesRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListSamplesRequest> request = null;<NEW_LINE>Response<ListSamplesResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListSamplesRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listSamplesRequest));<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, "Device Farm");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListSamples");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListSamplesResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(<MASK><NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
false), new ListSamplesResultJsonUnmarshaller());
1,257,660
protected Set<HighlightFlag> evaluateFlags(final boolean shouldHandleMultiTermQuery, final boolean shouldHighlightPhrasesStrictly, final boolean shouldPassageRelevancyOverSpeed, final boolean shouldEnableWeightMatches) {<NEW_LINE>Set<HighlightFlag> highlightFlags = EnumSet.noneOf(HighlightFlag.class);<NEW_LINE>if (shouldHandleMultiTermQuery) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (shouldHighlightPhrasesStrictly) {<NEW_LINE>highlightFlags.add(HighlightFlag.PHRASES);<NEW_LINE>}<NEW_LINE>if (shouldPassageRelevancyOverSpeed) {<NEW_LINE>highlightFlags.add(HighlightFlag.PASSAGE_RELEVANCY_OVER_SPEED);<NEW_LINE>}<NEW_LINE>// Evaluate if WEIGHT_MATCHES can be added as a flag.<NEW_LINE>final boolean applyWeightMatches = // User can also opt-out of WEIGHT_MATCHES.<NEW_LINE>highlightFlags.contains(HighlightFlag.MULTI_TERM_QUERY) && highlightFlags.contains(HighlightFlag.PHRASES) && highlightFlags.contains(HighlightFlag.PASSAGE_RELEVANCY_OVER_SPEED) && shouldEnableWeightMatches;<NEW_LINE>if (applyWeightMatches) {<NEW_LINE>highlightFlags.add(HighlightFlag.WEIGHT_MATCHES);<NEW_LINE>}<NEW_LINE>return highlightFlags;<NEW_LINE>}
highlightFlags.add(HighlightFlag.MULTI_TERM_QUERY);
808,909
final DescribeOfferingResult executeDescribeOffering(DescribeOfferingRequest describeOfferingRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeOfferingRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeOfferingRequest> request = null;<NEW_LINE>Response<DescribeOfferingResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeOfferingRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeOfferingRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "MediaConnect");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeOffering");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeOfferingResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeOfferingResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
119,677
protected void fillPartitionToKeyData(Set<K> keys, Map<Integer, List<Data>> partitionToKeyData, Map<Object, Data> keyMap, Map<Data, Object> reverseKeyMap) {<NEW_LINE>ClientPartitionService partitionService <MASK><NEW_LINE>for (K key : keys) {<NEW_LINE>Data keyData = toData(key);<NEW_LINE>int partitionId = partitionService.getPartitionId(keyData);<NEW_LINE>List<Data> keyList = partitionToKeyData.get(partitionId);<NEW_LINE>if (keyList == null) {<NEW_LINE>keyList = new ArrayList<>();<NEW_LINE>partitionToKeyData.put(partitionId, keyList);<NEW_LINE>}<NEW_LINE>keyList.add(keyData);<NEW_LINE>if (keyMap != null) {<NEW_LINE>keyMap.put(key, keyData);<NEW_LINE>}<NEW_LINE>if (reverseKeyMap != null) {<NEW_LINE>reverseKeyMap.put(keyData, key);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
= getContext().getPartitionService();
494,113
public List<FsContent> findFilesWhere(String sqlWhereClause) throws TskCoreException {<NEW_LINE><MASK><NEW_LINE>acquireSingleUserCaseReadLock();<NEW_LINE>Statement s = null;<NEW_LINE>ResultSet rs = null;<NEW_LINE>try {<NEW_LINE>s = connection.createStatement();<NEW_LINE>// NON-NLS<NEW_LINE>rs = connection.executeQuery(s, "SELECT * FROM tsk_files WHERE " + sqlWhereClause);<NEW_LINE>List<FsContent> results = new ArrayList<FsContent>();<NEW_LINE>List<AbstractFile> temp = resultSetToAbstractFiles(rs, connection);<NEW_LINE>for (AbstractFile f : temp) {<NEW_LINE>final TSK_DB_FILES_TYPE_ENUM type = f.getType();<NEW_LINE>if (type.equals(TskData.TSK_DB_FILES_TYPE_ENUM.FS)) {<NEW_LINE>results.add((FsContent) f);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return results;<NEW_LINE>} catch (SQLException e) {<NEW_LINE>throw new TskCoreException("SQLException thrown when calling 'SleuthkitCase.findFilesWhere().", e);<NEW_LINE>} finally {<NEW_LINE>closeResultSet(rs);<NEW_LINE>closeStatement(s);<NEW_LINE>connection.close();<NEW_LINE>releaseSingleUserCaseReadLock();<NEW_LINE>}<NEW_LINE>}
CaseDbConnection connection = connections.getConnection();
497,383
public final DoctypedeclContext doctypedecl() throws RecognitionException {<NEW_LINE>DoctypedeclContext _localctx = new DoctypedeclContext(_ctx, getState());<NEW_LINE>enterRule(_localctx, 8, RULE_doctypedecl);<NEW_LINE>int _la;<NEW_LINE>try {<NEW_LINE>enterOuterAlt(_localctx, 1);<NEW_LINE>{<NEW_LINE>setState(59);<NEW_LINE>match(DTD_OPEN);<NEW_LINE>setState(60);<NEW_LINE>match(DOCTYPE);<NEW_LINE>setState(61);<NEW_LINE>match(Name);<NEW_LINE>setState(62);<NEW_LINE>externalid();<NEW_LINE>setState(66);<NEW_LINE>_errHandler.sync(this);<NEW_LINE>_la = _input.LA(1);<NEW_LINE>while (_la == STRING) {<NEW_LINE>{<NEW_LINE>{<NEW_LINE>setState(63);<NEW_LINE>match(STRING);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>setState(68);<NEW_LINE>_errHandler.sync(this);<NEW_LINE>_la = _input.LA(1);<NEW_LINE>}<NEW_LINE>setState(73);<NEW_LINE>_errHandler.sync(this);<NEW_LINE>_la = _input.LA(1);<NEW_LINE>if (_la == DTD_SUBSET_OPEN) {<NEW_LINE>{<NEW_LINE>setState(69);<NEW_LINE>match(DTD_SUBSET_OPEN);<NEW_LINE>setState(70);<NEW_LINE>intsubset();<NEW_LINE>setState(71);<NEW_LINE>match(DTD_SUBSET_CLOSE);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>setState(75);<NEW_LINE>match(DTD_CLOSE);<NEW_LINE>}<NEW_LINE>} catch (RecognitionException re) {<NEW_LINE>_localctx.exception = re;<NEW_LINE><MASK><NEW_LINE>_errHandler.recover(this, re);<NEW_LINE>} finally {<NEW_LINE>exitRule();<NEW_LINE>}<NEW_LINE>return _localctx;<NEW_LINE>}
_errHandler.reportError(this, re);
572,467
public static HttpResult httpPost(String url, List<String> headers, Map<String, String> paramValues, String encoding) {<NEW_LINE>try {<NEW_LINE>HttpPost httpost = new HttpPost(url);<NEW_LINE>RequestConfig requestConfig = RequestConfig.custom().setConnectionRequestTimeout(5000).setConnectTimeout(5000).setSocketTimeout(5000).setRedirectsEnabled(true).setMaxRedirects(5).build();<NEW_LINE>httpost.setConfig(requestConfig);<NEW_LINE>List<NameValuePair> nvps = new ArrayList<NameValuePair>();<NEW_LINE>for (Map.Entry<String, String> entry : paramValues.entrySet()) {<NEW_LINE>nvps.add(new BasicNameValuePair(entry.getKey(), entry.getValue()));<NEW_LINE>}<NEW_LINE>httpost.setEntity(new UrlEncodedFormEntity(nvps, encoding));<NEW_LINE>HttpResponse response = postClient.execute(httpost);<NEW_LINE><MASK><NEW_LINE>String charset = encoding;<NEW_LINE>if (entity.getContentType() != null) {<NEW_LINE>HeaderElement[] headerElements = entity.getContentType().getElements();<NEW_LINE>if (headerElements != null && headerElements.length > 0 && headerElements[0] != null && headerElements[0].getParameterByName("charset") != null) {<NEW_LINE>charset = headerElements[0].getParameterByName("charset").getValue();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new HttpResult(response.getStatusLine().getStatusCode(), IOUtils.toString(entity.getContent(), charset), Collections.<String, String>emptyMap());<NEW_LINE>} catch (Throwable e) {<NEW_LINE>return new HttpResult(500, e.toString(), Collections.<String, String>emptyMap());<NEW_LINE>}<NEW_LINE>}
HttpEntity entity = response.getEntity();
1,019,321
public String serialize(boolean prettyPrint, RequestDefinition... requestDefinitions) {<NEW_LINE>try {<NEW_LINE>if (requestDefinitions != null && requestDefinitions.length > 0) {<NEW_LINE>Object[] requestDefinitionDTOs <MASK><NEW_LINE>for (int i = 0; i < requestDefinitions.length; i++) {<NEW_LINE>if (requestDefinitions[i] instanceof HttpRequest) {<NEW_LINE>requestDefinitionDTOs[i] = prettyPrint ? new HttpRequestPrettyPrintedDTO((HttpRequest) requestDefinitions[i]) : new HttpRequestDTO((HttpRequest) requestDefinitions[i]);<NEW_LINE>} else if (requestDefinitions[i] instanceof OpenAPIDefinition) {<NEW_LINE>requestDefinitionDTOs[i] = new OpenAPIDefinitionDTO((OpenAPIDefinition) requestDefinitions[i]);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return objectWriter.writeValueAsString(requestDefinitionDTOs);<NEW_LINE>} else {<NEW_LINE>return "[]";<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>mockServerLogger.logEvent(new LogEntry().setLogLevel(Level.ERROR).setMessageFormat("exception while serializing RequestDefinition to JSON with value " + Arrays.asList(requestDefinitions)).setThrowable(e));<NEW_LINE>throw new RuntimeException("Exception while serializing RequestDefinition to JSON with value " + Arrays.asList(requestDefinitions), e);<NEW_LINE>}<NEW_LINE>}
= new Object[requestDefinitions.length];
1,313,397
public void loadDefaultValues() {<NEW_LINE>setDefault(CommonClientConfigKey.MaxHttpConnectionsPerHost, getDefaultMaxHttpConnectionsPerHost());<NEW_LINE>setDefault(CommonClientConfigKey.MaxTotalHttpConnections, getDefaultMaxTotalHttpConnections());<NEW_LINE>setDefault(CommonClientConfigKey.EnableConnectionPool, getDefaultEnableConnectionPool());<NEW_LINE>setDefault(CommonClientConfigKey.MaxConnectionsPerHost, getDefaultMaxConnectionsPerHost());<NEW_LINE>setDefault(CommonClientConfigKey.MaxTotalConnections, getDefaultMaxTotalConnections());<NEW_LINE>setDefault(CommonClientConfigKey.ConnectTimeout, getDefaultConnectTimeout());<NEW_LINE>setDefault(CommonClientConfigKey.ConnectionManagerTimeout, getDefaultConnectionManagerTimeout());<NEW_LINE>setDefault(CommonClientConfigKey.ReadTimeout, getDefaultReadTimeout());<NEW_LINE>setDefault(CommonClientConfigKey.MaxAutoRetries, getDefaultMaxAutoRetries());<NEW_LINE>setDefault(CommonClientConfigKey.MaxAutoRetriesNextServer, getDefaultMaxAutoRetriesNextServer());<NEW_LINE>setDefault(CommonClientConfigKey.OkToRetryOnAllOperations, getDefaultOkToRetryOnAllOperations());<NEW_LINE>setDefault(CommonClientConfigKey.FollowRedirects, getDefaultFollowRedirects());<NEW_LINE>setDefault(CommonClientConfigKey.ConnectionPoolCleanerTaskEnabled, getDefaultConnectionPoolCleanerTaskEnabled());<NEW_LINE>setDefault(CommonClientConfigKey.ConnIdleEvictTimeMilliSeconds, getDefaultConnectionidleTimeInMsecs());<NEW_LINE>setDefault(CommonClientConfigKey.ConnectionCleanerRepeatInterval, getDefaultConnectionIdleTimertaskRepeatInMsecs());<NEW_LINE>setDefault(CommonClientConfigKey.EnableGZIPContentEncodingFilter, getDefaultEnableGzipContentEncodingFilter());<NEW_LINE>setDefault(CommonClientConfigKey.ProxyHost, null);<NEW_LINE>setDefault(CommonClientConfigKey.ProxyPort, null);<NEW_LINE>setDefault(CommonClientConfigKey.Port, getDefaultPort());<NEW_LINE>setDefault(CommonClientConfigKey.EnablePrimeConnections, getDefaultEnablePrimeConnections());<NEW_LINE>setDefault(CommonClientConfigKey.MaxRetriesPerServerPrimeConnection, getDefaultMaxRetriesPerServerPrimeConnection());<NEW_LINE>setDefault(CommonClientConfigKey.MaxTotalTimeToPrimeConnections, getDefaultMaxTotalTimeToPrimeConnections());<NEW_LINE>setDefault(CommonClientConfigKey.PrimeConnectionsURI, getDefaultPrimeConnectionsUri());<NEW_LINE>setDefault(CommonClientConfigKey.PoolMinThreads, getDefaultPoolMinThreads());<NEW_LINE>setDefault(CommonClientConfigKey.PoolMaxThreads, getDefaultPoolMaxThreads());<NEW_LINE>setDefault(CommonClientConfigKey.PoolKeepAliveTime, (int) getDefaultPoolKeepAliveTime());<NEW_LINE>setDefault(CommonClientConfigKey.PoolKeepAliveTimeUnits, <MASK><NEW_LINE>setDefault(CommonClientConfigKey.EnableZoneAffinity, getDefaultEnableZoneAffinity());<NEW_LINE>setDefault(CommonClientConfigKey.EnableZoneExclusivity, getDefaultEnableZoneExclusivity());<NEW_LINE>setDefault(CommonClientConfigKey.ClientClassName, getDefaultClientClassname());<NEW_LINE>setDefault(CommonClientConfigKey.NFLoadBalancerClassName, getDefaultNfloadbalancerClassname());<NEW_LINE>setDefault(CommonClientConfigKey.NFLoadBalancerRuleClassName, getDefaultNfloadbalancerRuleClassname());<NEW_LINE>setDefault(CommonClientConfigKey.NFLoadBalancerPingClassName, getDefaultNfloadbalancerPingClassname());<NEW_LINE>setDefault(CommonClientConfigKey.PrioritizeVipAddressBasedServers, getDefaultPrioritizeVipAddressBasedServers());<NEW_LINE>setDefault(CommonClientConfigKey.MinPrimeConnectionsRatio, getDefaultMinPrimeConnectionsRatio());<NEW_LINE>setDefault(CommonClientConfigKey.PrimeConnectionsClassName, getDefaultPrimeConnectionsClass());<NEW_LINE>setDefault(CommonClientConfigKey.NIWSServerListClassName, getDefaultSeverListClass());<NEW_LINE>setDefault(CommonClientConfigKey.VipAddressResolverClassName, getDefaultVipaddressResolverClassname());<NEW_LINE>setDefault(CommonClientConfigKey.IsClientAuthRequired, getDefaultIsClientAuthRequired());<NEW_LINE>setDefault(CommonClientConfigKey.UseIPAddrForServer, getDefaultUseIpAddressForServer());<NEW_LINE>setDefault(CommonClientConfigKey.ListOfServers, "");<NEW_LINE>}
getDefaultPoolKeepAliveTimeUnits().toString());
1,344,761
private List<String> findTsvFiles(Path LeappOutputDir) throws IngestModuleException {<NEW_LINE>List<String> allTsvFiles;<NEW_LINE>List<String> foundTsvFiles = new ArrayList<>();<NEW_LINE>try (Stream<Path> walk = Files.walk(LeappOutputDir)) {<NEW_LINE>allTsvFiles = walk.map(x -> x.toString()).filter(f -> f.toLowerCase().endsWith(".tsv")).collect(Collectors.toList());<NEW_LINE>for (String tsvFile : allTsvFiles) {<NEW_LINE>if (tsvFiles.containsKey(FilenameUtils.getName(tsvFile.toLowerCase()))) {<NEW_LINE>foundTsvFiles.add(tsvFile);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (IOException | UncheckedIOException e) {<NEW_LINE>throw new IngestModuleException(Bundle.LeappFileProcessor_error_reading_Leapp_directory() + <MASK><NEW_LINE>}<NEW_LINE>return foundTsvFiles;<NEW_LINE>}
LeappOutputDir.toString(), e);
1,213,560
/*<NEW_LINE>* @see<NEW_LINE>* com.sitewhere.grpc.service.ScheduleManagementGrpc.ScheduleManagementImplBase#<NEW_LINE>* listSchedules(com.sitewhere.grpc.service.GListSchedulesRequest,<NEW_LINE>* io.grpc.stub.StreamObserver)<NEW_LINE>*/<NEW_LINE>@Override<NEW_LINE>public void listSchedules(GListSchedulesRequest request, StreamObserver<GListSchedulesResponse> responseObserver) {<NEW_LINE>try {<NEW_LINE>GrpcUtils.handleServerMethodEntry(this, ScheduleManagementGrpc.getListSchedulesMethod());<NEW_LINE>ISearchResults<? extends ISchedule> apiResult = getScheduleManagement().listSchedules(ScheduleModelConverter.asApiScheduleSearchCrtieria(request.getCriteria()));<NEW_LINE>GListSchedulesResponse.Builder response = GListSchedulesResponse.newBuilder();<NEW_LINE>GScheduleSearchResults.Builder results = GScheduleSearchResults.newBuilder();<NEW_LINE>for (ISchedule api : apiResult.getResults()) {<NEW_LINE>results.addSchedules<MASK><NEW_LINE>}<NEW_LINE>results.setCount(apiResult.getNumResults());<NEW_LINE>response.setResults(results.build());<NEW_LINE>responseObserver.onNext(response.build());<NEW_LINE>responseObserver.onCompleted();<NEW_LINE>} catch (Throwable e) {<NEW_LINE>GrpcUtils.handleServerMethodException(ScheduleManagementGrpc.getListSchedulesMethod(), e, responseObserver);<NEW_LINE>} finally {<NEW_LINE>GrpcUtils.handleServerMethodExit(ScheduleManagementGrpc.getListSchedulesMethod());<NEW_LINE>}<NEW_LINE>}
(ScheduleModelConverter.asGrpcSchedule(api));
1,621,001
final DeleteClientVpnRouteResult executeDeleteClientVpnRoute(DeleteClientVpnRouteRequest deleteClientVpnRouteRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteClientVpnRouteRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteClientVpnRouteRequest> request = null;<NEW_LINE>Response<DeleteClientVpnRouteResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteClientVpnRouteRequestMarshaller().marshall(super.beforeMarshalling(deleteClientVpnRouteRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "EC2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteClientVpnRoute");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<DeleteClientVpnRouteResult> responseHandler = new StaxResponseHandler<DeleteClientVpnRouteResult>(new DeleteClientVpnRouteResultStaxUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
1,410,286
public void stop() {<NEW_LINE>this.active = false;<NEW_LINE>synchronized (this.connections) {<NEW_LINE>Iterator<Entry<String, TcpConnectionSupport>> iterator = this.connections.entrySet().iterator();<NEW_LINE>while (iterator.hasNext()) {<NEW_LINE>TcpConnectionSupport connection = iterator.next().getValue();<NEW_LINE>connection.close();<NEW_LINE>iterator.remove();<NEW_LINE>if (connection instanceof TcpConnectionInterceptorSupport) {<NEW_LINE>((TcpConnectionInterceptorSupport) connection).removeDeadConnection(connection);<NEW_LINE>} else {<NEW_LINE>connection.getSenders().forEach(sender <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>synchronized (this.lifecycleMonitor) {<NEW_LINE>if (this.privateExecutor) {<NEW_LINE>ExecutorService executorService = (ExecutorService) this.taskExecutor;<NEW_LINE>executorService.shutdown();<NEW_LINE>try {<NEW_LINE>if (!executorService.awaitTermination(10, TimeUnit.SECONDS)) {<NEW_LINE>// NOSONAR magic number<NEW_LINE>logger.debug("Forcing executor shutdown");<NEW_LINE>executorService.shutdownNow();<NEW_LINE>if (!executorService.awaitTermination(10, TimeUnit.SECONDS)) {<NEW_LINE>// NOSONAR magic number<NEW_LINE>logger.debug("Executor failed to shutdown");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (@SuppressWarnings(UNUSED) InterruptedException e) {<NEW_LINE>executorService.shutdownNow();<NEW_LINE>Thread.currentThread().interrupt();<NEW_LINE>} finally {<NEW_LINE>this.taskExecutor = null;<NEW_LINE>this.privateExecutor = false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>logger.info(() -> "stopped " + this);<NEW_LINE>}
-> sender.removeDeadConnection(connection));
1,310,283
public void notifyResponse(V8Request request, V8Response response) {<NEW_LINE>Pair<JSLineBreakpoint, Location> lbLoc;<NEW_LINE>synchronized (submittingBreakpoints) {<NEW_LINE>lbLoc = submittingBreakpoints.remove(request.getArguments());<NEW_LINE>}<NEW_LINE>if (lbLoc == null) {<NEW_LINE>LOG.log(Level.INFO, "Did not find a submitting breakpoint for response {0}, request was {1}", new Object[] { response, request });<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>JSLineBreakpoint lb = lbLoc.first();<NEW_LINE>if (response != null) {<NEW_LINE>SetBreakpoint.ResponseBody sbrb = (SetBreakpoint.ResponseBody) response.getBody();<NEW_LINE>long id = sbrb.getBreakpoint();<NEW_LINE>Location bpLoc = lbLoc.second();<NEW_LINE>SubmittedBreakpoint sb = new SubmittedBreakpoint(lb, id, bpLoc, sbrb.getActualLocations(), dbg);<NEW_LINE>boolean removed;<NEW_LINE>synchronized (submittedBreakpoints) {<NEW_LINE>submittedBreakpoints.put(lb, sb);<NEW_LINE>breakpointsById.put(id, sb);<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (removed) {<NEW_LINE>requestRemove(lb, id);<NEW_LINE>sb.notifyDestroyed();<NEW_LINE>} else {<NEW_LINE>JSBreakpointStatus.setValid(lb, Bundle.MSG_BRKP_Resolved());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>JSBreakpointStatus.setInvalid(lb, response.getErrorMessage());<NEW_LINE>}<NEW_LINE>}
removed = removeAfterSubmit.remove(lb);
699,301
public void restrictFormatting(List<String> allowedStyleNames, boolean removedNotAllowedFormatting, boolean autoFormatOverride, boolean styleLockTheme, boolean styleLockQFSet, String password, HashAlgorithm hashAlgo) throws Docx4JException {<NEW_LINE>if (getPkg().getMainDocumentPart() == null)<NEW_LINE>throw new Docx4JException("No MainDocumentPart in this WordprocessingMLPackage");<NEW_LINE>if (getPkg().getMainDocumentPart().getStyleDefinitionsPart() == null)<NEW_LINE>throw new Docx4JException("No StyleDefinitionsPart in this WordprocessingMLPackage");<NEW_LINE>Set<String> stylesInUse = getPkg().getMainDocumentPart().getStylesInUse();<NEW_LINE>// The styles part<NEW_LINE>StyleDefinitionsPart sdp = getPkg()<MASK><NEW_LINE>sdp.protectRestrictFormatting(allowedStyleNames, removedNotAllowedFormatting, stylesInUse);<NEW_LINE>// TODO: do the same to stylesWithEffects.xml<NEW_LINE>// The main document part (and other content parts)<NEW_LINE>if (removedNotAllowedFormatting) {<NEW_LINE>List<TraversalUtilVisitor> visitors = new ArrayList<TraversalUtilVisitor>();<NEW_LINE>visitors.add(new VisitorRemovePFormatting(sdp, allowedStyleNames));<NEW_LINE>visitors.add(new VisitorRemoveRFormatting(sdp, allowedStyleNames));<NEW_LINE>visitors.add(new VisitorRemoveTableFormatting(sdp, allowedStyleNames));<NEW_LINE>CompoundTraversalUtilVisitorCallback compound = new CompoundTraversalUtilVisitorCallback(visitors);<NEW_LINE>for (Part p : getPkg().getParts().getParts().values()) {<NEW_LINE>if (p instanceof ContentAccessor) {<NEW_LINE>compound.walkJAXBElements(((ContentAccessor) p).getContent());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// The document settings part<NEW_LINE>DocumentSettingsPart documentSettingsPart = getPkg().getMainDocumentPart().getDocumentSettingsPart(true);<NEW_LINE>documentSettingsPart.protectRestrictFormatting(autoFormatOverride, styleLockTheme, styleLockQFSet, password, hashAlgo);<NEW_LINE>// app.xml DocSecurity<NEW_LINE>if (pkg.getDocPropsExtendedPart() == null) {<NEW_LINE>pkg.addDocPropsExtendedPart();<NEW_LINE>}<NEW_LINE>// same as Word 2013<NEW_LINE>this.setDocSecurity(0);<NEW_LINE>}
.getMainDocumentPart().getStyleDefinitionsPart();
789,884
public Object readResolve() throws InvalidRecipeConfigException {<NEW_LINE>if (disabled) {<NEW_LINE>return this;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>super.readResolve();<NEW_LINE>if (!scaler.isPresent()) {<NEW_LINE>throw new InvalidRecipeConfigException("Missing <scaler> or <indexed>");<NEW_LINE>}<NEW_LINE>if (base == Integer.MIN_VALUE) {<NEW_LINE>throw new InvalidRecipeConfigException("'base' is invalid");<NEW_LINE>}<NEW_LINE>if (key.isPresent()) {<NEW_LINE>valid = CapacitorKeyRegistry.contains(get(key));<NEW_LINE>if (required && !valid && active) {<NEW_LINE>throw new InvalidRecipeConfigException("'key' is invalid");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw new InvalidRecipeConfigException("'key' is invalid");<NEW_LINE>}<NEW_LINE>valid = valid && scaler<MASK><NEW_LINE>if (required && !valid && active) {<NEW_LINE>throw new InvalidRecipeConfigException("No valid <scaler> or <indexed>");<NEW_LINE>}<NEW_LINE>} catch (InvalidRecipeConfigException e) {<NEW_LINE>throw new InvalidRecipeConfigException(e, "in <capacitor>");<NEW_LINE>}<NEW_LINE>return this;<NEW_LINE>}
.get().isValid();
1,680,817
public void marshall(ThingDocument thingDocument, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (thingDocument == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(thingDocument.getThingName(), THINGNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(thingDocument.getThingId(), THINGID_BINDING);<NEW_LINE>protocolMarshaller.marshall(thingDocument.getThingTypeName(), THINGTYPENAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(thingDocument.getAttributes(), ATTRIBUTES_BINDING);<NEW_LINE>protocolMarshaller.marshall(thingDocument.getShadow(), SHADOW_BINDING);<NEW_LINE>protocolMarshaller.marshall(thingDocument.getDeviceDefender(), DEVICEDEFENDER_BINDING);<NEW_LINE>protocolMarshaller.marshall(thingDocument.getConnectivity(), CONNECTIVITY_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
thingDocument.getThingGroupNames(), THINGGROUPNAMES_BINDING);
449,051
public static GetNodeGroupResponse unmarshall(GetNodeGroupResponse getNodeGroupResponse, UnmarshallerContext _ctx) {<NEW_LINE>getNodeGroupResponse.setRequestId(_ctx.stringValue("GetNodeGroupResponse.RequestId"));<NEW_LINE>getNodeGroupResponse.setSuccess(_ctx.booleanValue("GetNodeGroupResponse.Success"));<NEW_LINE>Data data = new Data();<NEW_LINE>data.setNodeGroupId(_ctx.stringValue("GetNodeGroupResponse.Data.NodeGroupId"));<NEW_LINE>data.setNodeGroupName(_ctx.stringValue("GetNodeGroupResponse.Data.NodeGroupName"));<NEW_LINE>data.setNodesCnt(_ctx.longValue("GetNodeGroupResponse.Data.NodesCnt"));<NEW_LINE>data.setDataDispatchEnabled(_ctx.booleanValue("GetNodeGroupResponse.Data.DataDispatchEnabled"));<NEW_LINE>data.setJoinPermissionId<MASK><NEW_LINE>data.setJoinPermissionOwnerAliyunId(_ctx.stringValue("GetNodeGroupResponse.Data.JoinPermissionOwnerAliyunId"));<NEW_LINE>data.setJoinEui(_ctx.stringValue("GetNodeGroupResponse.Data.JoinEui"));<NEW_LINE>data.setFreqBandPlanGroupId(_ctx.longValue("GetNodeGroupResponse.Data.FreqBandPlanGroupId"));<NEW_LINE>data.setClassMode(_ctx.stringValue("GetNodeGroupResponse.Data.ClassMode"));<NEW_LINE>data.setJoinPermissionType(_ctx.stringValue("GetNodeGroupResponse.Data.JoinPermissionType"));<NEW_LINE>data.setJoinPermissionEnabled(_ctx.booleanValue("GetNodeGroupResponse.Data.JoinPermissionEnabled"));<NEW_LINE>data.setRxDailySum(_ctx.stringValue("GetNodeGroupResponse.Data.RxDailySum"));<NEW_LINE>data.setRxMonthSum(_ctx.longValue("GetNodeGroupResponse.Data.RxMonthSum"));<NEW_LINE>data.setTxDailySum(_ctx.longValue("GetNodeGroupResponse.Data.TxDailySum"));<NEW_LINE>data.setTxMonthSum(_ctx.longValue("GetNodeGroupResponse.Data.TxMonthSum"));<NEW_LINE>data.setCreateMillis(_ctx.longValue("GetNodeGroupResponse.Data.CreateMillis"));<NEW_LINE>data.setJoinPermissionName(_ctx.stringValue("GetNodeGroupResponse.Data.JoinPermissionName"));<NEW_LINE>data.setMulticastGroupId(_ctx.stringValue("GetNodeGroupResponse.Data.MulticastGroupId"));<NEW_LINE>data.setMulticastEnabled(_ctx.booleanValue("GetNodeGroupResponse.Data.MulticastEnabled"));<NEW_LINE>data.setMulticastNodeCapacity(_ctx.integerValue("GetNodeGroupResponse.Data.MulticastNodeCapacity"));<NEW_LINE>data.setMulticastNodeCount(_ctx.integerValue("GetNodeGroupResponse.Data.MulticastNodeCount"));<NEW_LINE>DataDispatchConfig dataDispatchConfig = new DataDispatchConfig();<NEW_LINE>dataDispatchConfig.setDestination(_ctx.stringValue("GetNodeGroupResponse.Data.DataDispatchConfig.Destination"));<NEW_LINE>IotProduct iotProduct = new IotProduct();<NEW_LINE>iotProduct.setProductName(_ctx.stringValue("GetNodeGroupResponse.Data.DataDispatchConfig.IotProduct.ProductName"));<NEW_LINE>iotProduct.setProductKey(_ctx.stringValue("GetNodeGroupResponse.Data.DataDispatchConfig.IotProduct.ProductKey"));<NEW_LINE>iotProduct.setProductType(_ctx.stringValue("GetNodeGroupResponse.Data.DataDispatchConfig.IotProduct.ProductType"));<NEW_LINE>iotProduct.setDebugSwitch(_ctx.booleanValue("GetNodeGroupResponse.Data.DataDispatchConfig.IotProduct.DebugSwitch"));<NEW_LINE>dataDispatchConfig.setIotProduct(iotProduct);<NEW_LINE>OnsTopics onsTopics = new OnsTopics();<NEW_LINE>onsTopics.setDownlinkRegionName(_ctx.stringValue("GetNodeGroupResponse.Data.DataDispatchConfig.OnsTopics.DownlinkRegionName"));<NEW_LINE>onsTopics.setDownlinkTopic(_ctx.stringValue("GetNodeGroupResponse.Data.DataDispatchConfig.OnsTopics.DownlinkTopic"));<NEW_LINE>onsTopics.setUplinkRegionName(_ctx.stringValue("GetNodeGroupResponse.Data.DataDispatchConfig.OnsTopics.UplinkRegionName"));<NEW_LINE>onsTopics.setUplinkTopic(_ctx.stringValue("GetNodeGroupResponse.Data.DataDispatchConfig.OnsTopics.UplinkTopic"));<NEW_LINE>dataDispatchConfig.setOnsTopics(onsTopics);<NEW_LINE>data.setDataDispatchConfig(dataDispatchConfig);<NEW_LINE>List<LocksItem> locks = new ArrayList<LocksItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("GetNodeGroupResponse.Data.Locks.Length"); i++) {<NEW_LINE>LocksItem locksItem = new LocksItem();<NEW_LINE>locksItem.setLockId(_ctx.stringValue("GetNodeGroupResponse.Data.Locks[" + i + "].LockId"));<NEW_LINE>locksItem.setLockType(_ctx.stringValue("GetNodeGroupResponse.Data.Locks[" + i + "].LockType"));<NEW_LINE>locksItem.setEnabled(_ctx.booleanValue("GetNodeGroupResponse.Data.Locks[" + i + "].Enabled"));<NEW_LINE>locksItem.setCreateMillis(_ctx.longValue("GetNodeGroupResponse.Data.Locks[" + i + "].CreateMillis"));<NEW_LINE>locks.add(locksItem);<NEW_LINE>}<NEW_LINE>data.setLocks(locks);<NEW_LINE>getNodeGroupResponse.setData(data);<NEW_LINE>return getNodeGroupResponse;<NEW_LINE>}
(_ctx.stringValue("GetNodeGroupResponse.Data.JoinPermissionId"));
203,410
public static String exeWholeCmd(String cmd) {<NEW_LINE>// Common apache exec doesn't support piple operation.<NEW_LINE>// It's the shell (e.g. bash) that interprets the pipe and does special processing when you type that<NEW_LINE>// commandline into the shell.<NEW_LINE>// But we could use a ByteArrayInputStream to feed the outuput of one command to another.<NEW_LINE>if (cmd.contains("|")) {<NEW_LINE>String[] cmds = cmd.split("\\|");<NEW_LINE>String out = null;<NEW_LINE>for (int i = 0; i < cmds.length; i++) {<NEW_LINE>CommandLine cmdLine = CommandLine.parse(cmds[i]);<NEW_LINE>if (i == 0) {<NEW_LINE>out = exeCmdWithoutPipe(cmdLine, null, loadEnv());<NEW_LINE>}<NEW_LINE>if (out != null) {<NEW_LINE>out = exeCmdWithoutPipe(cmdLine, new ByteArrayInputStream(out.getBytes(Charset.forName("utf-8"))), loadEnv());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return out;<NEW_LINE>} else {<NEW_LINE>CommandLine <MASK><NEW_LINE>return exeCmdWithoutPipe(cmdLine, null, loadEnv());<NEW_LINE>}<NEW_LINE>}
cmdLine = CommandLine.parse(cmd);
91,013
// Take a DNS queue + admin registrar id as input so that it can be called from the mapper as well<NEW_LINE>private static void softDeleteDomain(DomainBase domain, String registryAdminRegistrarId, DnsQueue localDnsQueue) {<NEW_LINE>DomainBase deletedDomain = domain.asBuilder().setDeletionTime(tm().getTransactionTime()).setStatusValues(null).build();<NEW_LINE>DomainHistory historyEntry = new DomainHistory.Builder().setDomain(domain).setType(DOMAIN_DELETE).setModificationTime(tm().getTransactionTime()).setBySuperuser(true).setReason("Deletion of prober data").<MASK><NEW_LINE>// Note that we don't bother handling grace periods, billing events, pending transfers, poll<NEW_LINE>// messages, or auto-renews because those will all be hard-deleted the next time the job runs<NEW_LINE>// anyway.<NEW_LINE>tm().putAllWithoutBackup(ImmutableList.of(deletedDomain, historyEntry));<NEW_LINE>// updating foreign keys is a no-op in SQL<NEW_LINE>updateForeignKeyIndexDeletionTime(deletedDomain);<NEW_LINE>localDnsQueue.addDomainRefreshTask(deletedDomain.getDomainName());<NEW_LINE>}
setRegistrarId(registryAdminRegistrarId).build();
735,074
public boolean read(java.io.ObjectInputStream p_object_stream) {<NEW_LINE>try {<NEW_LINE>SavedAttributes saved_attributes = (SavedAttributes) p_object_stream.readObject();<NEW_LINE>this.snapshot_count = saved_attributes.snapshot_count;<NEW_LINE>this.list_model = saved_attributes.list_model;<NEW_LINE>this.list.setModel(this.list_model);<NEW_LINE>String next_default_name = "snapshot " + (Integer.valueOf(snapshot_count + 1)).toString();<NEW_LINE>this.name_field.setText(next_default_name);<NEW_LINE><MASK><NEW_LINE>this.setVisible(saved_attributes.is_visible);<NEW_LINE>this.settings_window.read(p_object_stream);<NEW_LINE>return true;<NEW_LINE>} catch (Exception e) {<NEW_LINE>FRLogger.error("VisibilityFrame.read_attriutes: read failed", e);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}
this.setLocation(saved_attributes.location);
475,518
private void doUpdateRanges(int beforeChangedLine1, int beforeChangedLine2, int linesShift, int beforeTotalLines) {<NEW_LINE>LOG.assertTrue(!myReleased);<NEW_LINE>List<Range> <MASK><NEW_LINE>List<Range> rangesAfterChange = new ArrayList<>();<NEW_LINE>List<Range> changedRanges = new ArrayList<>();<NEW_LINE>sortRanges(beforeChangedLine1, beforeChangedLine2, linesShift, rangesBeforeChange, changedRanges, rangesAfterChange);<NEW_LINE>Range firstChangedRange = ContainerUtil.getFirstItem(changedRanges);<NEW_LINE>Range lastChangedRange = ContainerUtil.getLastItem(changedRanges);<NEW_LINE>if (firstChangedRange != null && firstChangedRange.getLine1() < beforeChangedLine1) {<NEW_LINE>beforeChangedLine1 = firstChangedRange.getLine1();<NEW_LINE>}<NEW_LINE>if (lastChangedRange != null && lastChangedRange.getLine2() > beforeChangedLine2) {<NEW_LINE>beforeChangedLine2 = lastChangedRange.getLine2();<NEW_LINE>}<NEW_LINE>doUpdateRanges(beforeChangedLine1, beforeChangedLine2, linesShift, beforeTotalLines, rangesBeforeChange, changedRanges, rangesAfterChange);<NEW_LINE>}
rangesBeforeChange = new ArrayList<>();
766,718
public void write(final Path file, final Distribution configuration, final LoginCallback prompt) throws BackgroundException {<NEW_LINE>final Path container = containerService.getContainer(file);<NEW_LINE>try {<NEW_LINE>if (StringUtils.isNotBlank(configuration.getIndexDocument())) {<NEW_LINE>session.getClient().updateContainerMetadata(regionService.lookup(container), container.getName(), Collections.singletonMap("X-Container-Meta-Web-Index"<MASK><NEW_LINE>}<NEW_LINE>try {<NEW_LINE>final CDNContainer info = session.getClient().getCDNContainerInfo(regionService.lookup(container), container.getName());<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug(String.format("Found existing CDN configuration %s", info));<NEW_LINE>}<NEW_LINE>} catch (NotFoundException e) {<NEW_LINE>// Not found.<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug(String.format("Enable CDN configuration for %s", container));<NEW_LINE>}<NEW_LINE>session.getClient().cdnEnableContainer(regionService.lookup(container), container.getName());<NEW_LINE>}<NEW_LINE>// Toggle content distribution for the container without changing the TTL expiration<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug(String.format("Update CDN configuration for %s", container));<NEW_LINE>}<NEW_LINE>session.getClient().cdnUpdateContainer(regionService.lookup(container), container.getName(), -1, configuration.isEnabled(), configuration.isLogging());<NEW_LINE>} catch (GenericException e) {<NEW_LINE>throw new SwiftExceptionMappingService().map("Cannot write CDN configuration", e);<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new DefaultIOExceptionMappingService().map("Cannot write CDN configuration", e);<NEW_LINE>}<NEW_LINE>}
, configuration.getIndexDocument()));
1,805,819
public void write(DataOutput out) throws IOException {<NEW_LINE>// ATTN: must write type first<NEW_LINE>Text.writeString(out, dataSourceType.name());<NEW_LINE>out.writeLong(id);<NEW_LINE>Text.writeString(out, name);<NEW_LINE>Text.writeString(out, clusterName);<NEW_LINE>out.writeLong(dbId);<NEW_LINE>out.writeLong(tableId);<NEW_LINE>out.writeInt(desireTaskConcurrentNum);<NEW_LINE>Text.writeString(out, state.name());<NEW_LINE>out.writeLong(maxErrorNum);<NEW_LINE>out.writeLong(taskSchedIntervalS);<NEW_LINE>out.writeLong(maxBatchRows);<NEW_LINE>out.writeLong(maxBatchSizeBytes);<NEW_LINE>progress.write(out);<NEW_LINE>out.writeLong(createTimestamp);<NEW_LINE>out.writeLong(pauseTimestamp);<NEW_LINE>out.writeLong(endTimestamp);<NEW_LINE>out.writeLong(currentErrorRows);<NEW_LINE>out.writeLong(currentTotalRows);<NEW_LINE>out.writeLong(errorRows);<NEW_LINE>out.writeLong(totalRows);<NEW_LINE>out.writeLong(unselectedRows);<NEW_LINE>out.writeLong(receivedBytes);<NEW_LINE>out.writeLong(totalTaskExcutionTimeMs);<NEW_LINE>out.writeLong(committedTaskNum);<NEW_LINE>out.writeLong(abortedTaskNum);<NEW_LINE>origStmt.write(out);<NEW_LINE>out.writeInt(jobProperties.size());<NEW_LINE>for (Map.Entry<String, String> entry : jobProperties.entrySet()) {<NEW_LINE>Text.writeString(out, entry.getKey());<NEW_LINE>Text.writeString(out, entry.getValue());<NEW_LINE>}<NEW_LINE>out.writeInt(sessionVariables.size());<NEW_LINE>for (Map.Entry<String, String> entry : sessionVariables.entrySet()) {<NEW_LINE>Text.writeString(<MASK><NEW_LINE>Text.writeString(out, entry.getValue());<NEW_LINE>}<NEW_LINE>}
out, entry.getKey());
245,080
public static ListSlotResponse unmarshall(ListSlotResponse listSlotResponse, UnmarshallerContext _ctx) {<NEW_LINE>listSlotResponse.setRequestId<MASK><NEW_LINE>listSlotResponse.setSuccess(_ctx.booleanValue("ListSlotResponse.Success"));<NEW_LINE>listSlotResponse.setCode(_ctx.stringValue("ListSlotResponse.Code"));<NEW_LINE>listSlotResponse.setMessage(_ctx.stringValue("ListSlotResponse.Message"));<NEW_LINE>listSlotResponse.setPageNumber(_ctx.integerValue("ListSlotResponse.PageNumber"));<NEW_LINE>listSlotResponse.setPageSize(_ctx.integerValue("ListSlotResponse.PageSize"));<NEW_LINE>listSlotResponse.setTotal(_ctx.longValue("ListSlotResponse.Total"));<NEW_LINE>List<AdSlot> model = new ArrayList<AdSlot>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListSlotResponse.Model.Length"); i++) {<NEW_LINE>AdSlot adSlot = new AdSlot();<NEW_LINE>adSlot.setCreateTime(_ctx.longValue("ListSlotResponse.Model[" + i + "].CreateTime"));<NEW_LINE>adSlot.setMediaName(_ctx.stringValue("ListSlotResponse.Model[" + i + "].MediaName"));<NEW_LINE>adSlot.setAdSlotType(_ctx.stringValue("ListSlotResponse.Model[" + i + "].AdSlotType"));<NEW_LINE>adSlot.setAdSlotStatus(_ctx.stringValue("ListSlotResponse.Model[" + i + "].AdSlotStatus"));<NEW_LINE>adSlot.setMediaId(_ctx.stringValue("ListSlotResponse.Model[" + i + "].MediaId"));<NEW_LINE>adSlot.setExtInfo(_ctx.stringValue("ListSlotResponse.Model[" + i + "].ExtInfo"));<NEW_LINE>adSlot.setAdSlotName(_ctx.stringValue("ListSlotResponse.Model[" + i + "].AdSlotName"));<NEW_LINE>adSlot.setInspireScene(_ctx.stringValue("ListSlotResponse.Model[" + i + "].InspireScene"));<NEW_LINE>adSlot.setBlockingRule(_ctx.stringValue("ListSlotResponse.Model[" + i + "].BlockingRule"));<NEW_LINE>adSlot.setVersion(_ctx.longValue("ListSlotResponse.Model[" + i + "].Version"));<NEW_LINE>adSlot.setAdSlotId(_ctx.stringValue("ListSlotResponse.Model[" + i + "].AdSlotId"));<NEW_LINE>adSlot.setAdSlotCorporateStatus(_ctx.stringValue("ListSlotResponse.Model[" + i + "].AdSlotCorporateStatus"));<NEW_LINE>adSlot.setAdSlotTemplateId(_ctx.stringValue("ListSlotResponse.Model[" + i + "].AdSlotTemplateId"));<NEW_LINE>adSlot.setModifyTime(_ctx.longValue("ListSlotResponse.Model[" + i + "].ModifyTime"));<NEW_LINE>adSlot.setTenantId(_ctx.stringValue("ListSlotResponse.Model[" + i + "].TenantId"));<NEW_LINE>model.add(adSlot);<NEW_LINE>}<NEW_LINE>listSlotResponse.setModel(model);<NEW_LINE>return listSlotResponse;<NEW_LINE>}
(_ctx.stringValue("ListSlotResponse.RequestId"));
113,378
static boolean maybeLogLastMountStart(@Nullable MountStartupLoggingInfo loggingInfo, LithoView lithoView) {<NEW_LINE>if (loggingInfo != null && LithoStartupLogger.isEnabled(loggingInfo.startupLogger) && loggingInfo.firstMountLogged != null && loggingInfo.firstMountLogged[0] && loggingInfo.lastMountLogged != null && !loggingInfo.lastMountLogged[0]) {<NEW_LINE>final ViewGroup parent = (ViewGroup) lithoView.getParent();<NEW_LINE>if (parent == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (loggingInfo.isLastAdapterItem || (loggingInfo.isOrientationVertical ? lithoView.getBottom() >= parent.getHeight() - parent.getPaddingBottom() : lithoView.getRight() >= parent.getWidth() - parent.getPaddingRight())) {<NEW_LINE>loggingInfo.startupLogger.markPoint(LithoStartupLogger.LAST_MOUNT, <MASK><NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
LithoStartupLogger.START, loggingInfo.startupLoggerAttribution);
1,147,214
public Request<ModifyDBProxyEndpointRequest> marshall(ModifyDBProxyEndpointRequest modifyDBProxyEndpointRequest) {<NEW_LINE>if (modifyDBProxyEndpointRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>Request<ModifyDBProxyEndpointRequest> request = new DefaultRequest<ModifyDBProxyEndpointRequest>(modifyDBProxyEndpointRequest, "AmazonRDS");<NEW_LINE><MASK><NEW_LINE>request.addParameter("Version", "2014-10-31");<NEW_LINE>request.setHttpMethod(HttpMethodName.POST);<NEW_LINE>if (modifyDBProxyEndpointRequest.getDBProxyEndpointName() != null) {<NEW_LINE>request.addParameter("DBProxyEndpointName", StringUtils.fromString(modifyDBProxyEndpointRequest.getDBProxyEndpointName()));<NEW_LINE>}<NEW_LINE>if (modifyDBProxyEndpointRequest.getNewDBProxyEndpointName() != null) {<NEW_LINE>request.addParameter("NewDBProxyEndpointName", StringUtils.fromString(modifyDBProxyEndpointRequest.getNewDBProxyEndpointName()));<NEW_LINE>}<NEW_LINE>if (!modifyDBProxyEndpointRequest.getVpcSecurityGroupIds().isEmpty() || !((com.amazonaws.internal.SdkInternalList<String>) modifyDBProxyEndpointRequest.getVpcSecurityGroupIds()).isAutoConstruct()) {<NEW_LINE>com.amazonaws.internal.SdkInternalList<String> vpcSecurityGroupIdsList = (com.amazonaws.internal.SdkInternalList<String>) modifyDBProxyEndpointRequest.getVpcSecurityGroupIds();<NEW_LINE>int vpcSecurityGroupIdsListIndex = 1;<NEW_LINE>for (String vpcSecurityGroupIdsListValue : vpcSecurityGroupIdsList) {<NEW_LINE>if (vpcSecurityGroupIdsListValue != null) {<NEW_LINE>request.addParameter("VpcSecurityGroupIds.member." + vpcSecurityGroupIdsListIndex, StringUtils.fromString(vpcSecurityGroupIdsListValue));<NEW_LINE>}<NEW_LINE>vpcSecurityGroupIdsListIndex++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>}
request.addParameter("Action", "ModifyDBProxyEndpoint");
1,498,759
private ReplacedElement replaceImage(Element elem, String uri, int width, int height, UserAgentCallback uac) {<NEW_LINE>ReplacedElement replaced = _sizedImageCache.get(new SizedImageCacheKey(uri, width, height));<NEW_LINE>if (replaced != null) {<NEW_LINE>return replaced;<NEW_LINE>}<NEW_LINE>XRLog.log(Level.FINE, LogMessageId.LogMessageId1Param.LOAD_LOAD_IMMEDIATE_URI, uri);<NEW_LINE>ImageResource ir = uac.getImageResource(uri);<NEW_LINE>if (ir == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>BufferedImage newImg = ((AWTFSImage) awtfsImage).getImage();<NEW_LINE>if (newImg == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (width > -1 || height > -1) {<NEW_LINE>XRLog.log(Level.FINE, LogMessageId.LogMessageId4Param.LOAD_IMAGE_LOADER_SCALING_URI_TO, this, uri, width, height);<NEW_LINE>replaced = new ImageReplacedElement(newImg, width, height);<NEW_LINE>_sizedImageCache.put(new SizedImageCacheKey(uri, width, height), replaced);<NEW_LINE>} else {<NEW_LINE>replaced = new ImageReplacedElement(newImg, width, height);<NEW_LINE>}<NEW_LINE>return replaced;<NEW_LINE>}
FSImage awtfsImage = ir.getImage();
1,621,643
public OsStats osStats() {<NEW_LINE>final long uptime = -1L;<NEW_LINE>final double systemLoadAverage = ManagementFactory.getOperatingSystemMXBean().getSystemLoadAverage();<NEW_LINE>final double[] loadAverage = systemLoadAverage < 0.0d ? new double[0] : new double[] { systemLoadAverage };<NEW_LINE>final Processor processor = Processor.create("Unknown", "Unknown", -1, -1, -1, -1, -1L, (short) -1, (short) -1, (short) -<MASK><NEW_LINE>final Memory memory = Memory.create(-1L, -1L, (short) -1, -1L, (short) -1, -1L, -1L);<NEW_LINE>final Swap swap = Swap.create(-1L, -1L, -1L);<NEW_LINE>return OsStats.create(loadAverage, uptime, processor, memory, swap);<NEW_LINE>}
1, (short) -1);
708,701
public void onMatch(RelOptRuleCall call) {<NEW_LINE>final Filter filter = call.rel(0);<NEW_LINE>final List<RexNode> expList = Lists.newArrayList(filter.getCondition());<NEW_LINE>RexNode newConditionExp;<NEW_LINE>boolean reduced;<NEW_LINE>final RelMetadataQuery mq = call.getMetadataQuery();<NEW_LINE>final RelOptPredicateList predicates = mq.getPulledUpPredicates(filter.getInput());<NEW_LINE>// We want to keep this "IS TRUE" condition<NEW_LINE>// so basically the only modification for this file is this two lines<NEW_LINE>boolean contains_is_true_expr = expList.toString().contains("IS TRUE");<NEW_LINE>if (reduceExpressions(filter, expList, predicates, true, matchNullability) && !contains_is_true_expr) {<NEW_LINE>assert expList.size() == 1;<NEW_LINE>newConditionExp = expList.get(0);<NEW_LINE>reduced = true;<NEW_LINE>} else {<NEW_LINE>// No reduction, but let's still test the original<NEW_LINE>// predicate to see if it was already a constant,<NEW_LINE>// in which case we don't need any runtime decision<NEW_LINE>// about filtering.<NEW_LINE>newConditionExp = filter.getCondition();<NEW_LINE>reduced = false;<NEW_LINE>}<NEW_LINE>// Even if no reduction, let's still test the original<NEW_LINE>// predicate to see if it was already a constant,<NEW_LINE>// in which case we don't need any runtime decision<NEW_LINE>// about filtering.<NEW_LINE>if (newConditionExp.isAlwaysTrue()) {<NEW_LINE>call.transformTo(filter.getInput());<NEW_LINE>} else if (newConditionExp instanceof RexLiteral || RexUtil.isNullLiteral(newConditionExp, true)) {<NEW_LINE>call.transformTo(createEmptyRelOrEquivalent(call, filter));<NEW_LINE>} else if (reduced) {<NEW_LINE>call.transformTo(call.builder().push(filter.getInput()).filter(newConditionExp).build());<NEW_LINE>} else {<NEW_LINE>if (newConditionExp instanceof RexCall) {<NEW_LINE>boolean reverse = newConditionExp.getKind() == SqlKind.NOT;<NEW_LINE>if (reverse) {<NEW_LINE>newConditionExp = ((RexCall) newConditionExp).getOperands().get(0);<NEW_LINE>}<NEW_LINE>reduceNotNullableFilter(<MASK><NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// New plan is absolutely better than old plan.<NEW_LINE>call.getPlanner().prune(filter);<NEW_LINE>}
call, filter, newConditionExp, reverse);
1,256,415
private void parseDocument(boolean updateWebApp) throws IOException {<NEW_LINE>WebAppProxy webAppProxy = (WebAppProxy) webApp;<NEW_LINE>try {<NEW_LINE>// preparsing<NEW_LINE>SAXParseException error = WebParseUtils.parse(new InputSource(createReader()), new EnterpriseCatalog());<NEW_LINE>setSaxError(error);<NEW_LINE>String version = WebParseUtils.getVersion(new InputSource(createReader()));<NEW_LINE>// creating model<NEW_LINE>WebAppProxy app = new WebAppProxy(org.netbeans.modules.j2ee.dd.impl.common.DDUtils.createWebApp(createInputStream<MASK><NEW_LINE>if (updateWebApp) {<NEW_LINE>if (version.equals(webAppProxy.getVersion()) && webAppProxy.getOriginal() != null) {<NEW_LINE>webApp.merge(app, WebApp.MERGE_UPDATE);<NEW_LINE>} else if (app.getOriginal() != null) {<NEW_LINE>webApp = webAppProxy = app;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>webAppProxy.setStatus(error != null ? WebApp.STATE_INVALID_PARSABLE : WebApp.STATE_VALID);<NEW_LINE>webAppProxy.setError(error);<NEW_LINE>} catch (SAXException ex) {<NEW_LINE>webAppProxy.setStatus(WebApp.STATE_INVALID_UNPARSABLE);<NEW_LINE>if (ex instanceof SAXParseException) {<NEW_LINE>webAppProxy.setError((SAXParseException) ex);<NEW_LINE>} else if (ex.getException() instanceof SAXParseException) {<NEW_LINE>webAppProxy.setError((SAXParseException) ex.getException());<NEW_LINE>}<NEW_LINE>setSaxError(ex);<NEW_LINE>} catch (IllegalArgumentException iae) {<NEW_LINE>// see #104180<NEW_LINE>webAppProxy.setStatus(WebApp.STATE_INVALID_UNPARSABLE);<NEW_LINE>// NO18N<NEW_LINE>LOG.log(Level.FINE, "IAE thrown during merge, see #104180.", iae);<NEW_LINE>}<NEW_LINE>}
(), version), version);
11,390
public void run() {<NEW_LINE>try {<NEW_LINE>final Pair<URI, ElementHandle<TypeElement><MASK><NEW_LINE>if (handlePair != null) {<NEW_LINE>final FileObject target = URLMapper.findFileObject(handlePair.first().toURL());<NEW_LINE>if (target != null) {<NEW_LINE>final JavaSource targetJs = JavaSource.forFileObject(target);<NEW_LINE>if (targetJs != null) {<NEW_LINE>history.addToHistory(handlePair);<NEW_LINE>targetJs.runUserActionTask(this, true);<NEW_LINE>((Toolbar) getToolbar()).select(handlePair);<NEW_LINE>} else {<NEW_LINE>clearNodes(true);<NEW_LINE>StatusDisplayer.getDefault().setStatusText(Bundle.ERR_Cannot_Resolve_File(handlePair.second().getQualifiedName()));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>clearNodes(true);<NEW_LINE>StatusDisplayer.getDefault().setStatusText(Bundle.ERR_Cannot_Resolve_File(handlePair.second().getQualifiedName()));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>clearNodes(true);<NEW_LINE>StatusDisplayer.getDefault().setStatusText(Bundle.ERR_Not_Declared_Type());<NEW_LINE>}<NEW_LINE>} catch (InterruptedException ex) {<NEW_LINE>Exceptions.printStackTrace(ex);<NEW_LINE>} catch (ExecutionException ex) {<NEW_LINE>Exceptions.printStackTrace(ex);<NEW_LINE>} catch (IOException ex) {<NEW_LINE>Exceptions.printStackTrace(ex);<NEW_LINE>}<NEW_LINE>}
> handlePair = becomesHandle.get();
420,267
public List<StoragePoolJoinVO> searchByIds(Long... spIds) {<NEW_LINE>// set detail batch query size<NEW_LINE>int DETAILS_BATCH_SIZE = 2000;<NEW_LINE>String batchCfg = _configDao.getValue("detail.batch.query.size");<NEW_LINE>if (batchCfg != null) {<NEW_LINE>DETAILS_BATCH_SIZE = Integer.parseInt(batchCfg);<NEW_LINE>}<NEW_LINE>// query details by batches<NEW_LINE>List<StoragePoolJoinVO> uvList = new ArrayList<StoragePoolJoinVO>();<NEW_LINE>// query details by batches<NEW_LINE>int curr_index = 0;<NEW_LINE>if (spIds.length > DETAILS_BATCH_SIZE) {<NEW_LINE>while ((curr_index + DETAILS_BATCH_SIZE) <= spIds.length) {<NEW_LINE>Long[] ids = new Long[DETAILS_BATCH_SIZE];<NEW_LINE>for (int k = 0, j = curr_index; j < curr_index + DETAILS_BATCH_SIZE; j++, k++) {<NEW_LINE>ids[k] = spIds[j];<NEW_LINE>}<NEW_LINE>SearchCriteria<StoragePoolJoinVO> sc = spSearch.create();<NEW_LINE>sc.setParameters("idIN", ids);<NEW_LINE>List<StoragePoolJoinVO> vms = searchIncludingRemoved(sc, null, null, false);<NEW_LINE>if (vms != null) {<NEW_LINE>uvList.addAll(vms);<NEW_LINE>}<NEW_LINE>curr_index += DETAILS_BATCH_SIZE;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (curr_index < spIds.length) {<NEW_LINE>int batch_size = (spIds.length - curr_index);<NEW_LINE>// set the ids value<NEW_LINE>Long[<MASK><NEW_LINE>for (int k = 0, j = curr_index; j < curr_index + batch_size; j++, k++) {<NEW_LINE>ids[k] = spIds[j];<NEW_LINE>}<NEW_LINE>SearchCriteria<StoragePoolJoinVO> sc = spSearch.create();<NEW_LINE>sc.setParameters("idIN", ids);<NEW_LINE>List<StoragePoolJoinVO> vms = searchIncludingRemoved(sc, null, null, false);<NEW_LINE>if (vms != null) {<NEW_LINE>uvList.addAll(vms);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return uvList;<NEW_LINE>}
] ids = new Long[batch_size];
1,198,103
public void logGeneralColumns(File file) {<NEW_LINE>if (file == null) {<NEW_LINE>sb.append("MediaInfo parsing results for null:\n");<NEW_LINE>} else {<NEW_LINE>sb.append("MediaInfo parsing results for \"").append(file.getAbsolutePath()).append("\":\n");<NEW_LINE>}<NEW_LINE>if (mI == null) {<NEW_LINE>sb.append("ERROR: LibMediaInfo instance is null");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (!mI.isValid()) {<NEW_LINE>sb.append("ERROR: LibMediaInfo instance not valid");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>generalColumns.reset();<NEW_LINE>appendStringNextColumn(generalColumns, "Title", mI.Get(StreamType.General, 0, "Title"), true, true);<NEW_LINE>appendStringNextColumn(generalColumns, "Format", mI.Get(StreamType.General, 0, "Format"), true, false);<NEW_LINE>appendStringNextColumn(generalColumns, "CodecID", mI.Get(StreamType.General, 0, "CodecID"), true, true);<NEW_LINE>Double durationSec = parseDuration(mI.Get(StreamType.General, 0, "Duration"));<NEW_LINE>if (durationSec != null) {<NEW_LINE>appendStringNextColumn(generalColumns, "Duration", StringUtil.formatDLNADuration(durationSec), false, true);<NEW_LINE>}<NEW_LINE>appendStringNextColumn(generalColumns, "Overall Bitrate Mode", mI.Get(StreamType.General, 0, "OverallBitRate_Mode"), false, true);<NEW_LINE>appendStringNextColumn(generalColumns, "Overall Bitrate", mI.Get(StreamType.General, 0, "OverallBitRate"), false, true);<NEW_LINE>appendStringNextColumn(generalColumns, "Overall Bitrate Nom.", mI.Get(StreamType.General, 0, "OverallBitRate_Nominal"), false, true);<NEW_LINE>appendStringNextColumn(generalColumns, "Overall Bitrate Max.", mI.Get(StreamType.General, 0, "OverallBitRate_Maximum"), false, true);<NEW_LINE>appendStringNextColumn(generalColumns, "Stereoscopic", mI.Get(StreamType.General, 0<MASK><NEW_LINE>appendExistsNextColumn(generalColumns, "Cover", mI.Get(StreamType.General, 0, "Cover_Data"), false);<NEW_LINE>appendStringNextColumn(generalColumns, "FPS", mI.Get(StreamType.General, 0, "FrameRate"), false, true);<NEW_LINE>appendStringNextColumn(generalColumns, "Track", mI.Get(StreamType.General, 0, "Track"), true, true);<NEW_LINE>appendStringNextColumn(generalColumns, "Album", mI.Get(StreamType.General, 0, "Album"), true, true);<NEW_LINE>appendStringNextColumn(generalColumns, "Performer", mI.Get(StreamType.General, 0, "Performer"), true, true);<NEW_LINE>appendStringNextColumn(generalColumns, "Genre", mI.Get(StreamType.General, 0, "Genre"), true, true);<NEW_LINE>appendStringNextColumn(generalColumns, "Rec Date", mI.Get(StreamType.General, 0, "Recorded_Date"), true, true);<NEW_LINE>}
, "StereoscopicLayout"), true, true);
821,445
final UpdateSourceLocationResult executeUpdateSourceLocation(UpdateSourceLocationRequest updateSourceLocationRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateSourceLocationRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateSourceLocationRequest> request = null;<NEW_LINE>Response<UpdateSourceLocationResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateSourceLocationRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateSourceLocationRequest));<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, "MediaTailor");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateSourceLocation");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateSourceLocationResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateSourceLocationResultJsonUnmarshaller());<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();
1,630,388
private void configure() {<NEW_LINE>try {<NEW_LINE>Files.createDirectories(configFile.getParent());<NEW_LINE>Files.createDirectories(confPathRepo);<NEW_LINE>Files.createDirectories(confPathData);<NEW_LINE>Files.createDirectories(confPathLogs);<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new UncheckedIOException(e);<NEW_LINE>}<NEW_LINE>LinkedHashMap<String, String> config = new LinkedHashMap<>();<NEW_LINE>String nodeName = safeName(name);<NEW_LINE>config.put("cluster.name", nodeName);<NEW_LINE>config.put("node.name", nodeName);<NEW_LINE>config.put("path.repo", confPathRepo.toAbsolutePath().toString());<NEW_LINE>config.put("path.data", confPathData.toAbsolutePath().toString());<NEW_LINE>config.put("path.logs", confPathLogs.toAbsolutePath().toString());<NEW_LINE>config.put("path.shared_data", workingDir.resolve<MASK><NEW_LINE>config.put("node.attr.testattr", "test");<NEW_LINE>config.put("node.portsfile", "true");<NEW_LINE>config.put("http.port", "0");<NEW_LINE>config.put("transport.tcp.port", "0");<NEW_LINE>// Default the watermarks to absurdly low to prevent the tests from failing on nodes without enough disk space<NEW_LINE>config.put("cluster.routing.allocation.disk.watermark.low", "1b");<NEW_LINE>config.put("cluster.routing.allocation.disk.watermark.high", "1b");<NEW_LINE>// increase script compilation limit since tests can rapid-fire script compilations<NEW_LINE>config.put("script.max_compilations_rate", "2048/1m");<NEW_LINE>if (Version.fromString(version).getMajor() >= 6) {<NEW_LINE>config.put("cluster.routing.allocation.disk.watermark.flood_stage", "1b");<NEW_LINE>}<NEW_LINE>if (Version.fromString(version).getMajor() >= 7) {<NEW_LINE>config.put("cluster.initial_master_nodes", "[" + nodeName + "]");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>Files.write(configFile, config.entrySet().stream().map(entry -> entry.getKey() + ": " + entry.getValue()).collect(Collectors.joining("\n")).getBytes(StandardCharsets.UTF_8));<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new UncheckedIOException("Could not write config file: " + configFile, e);<NEW_LINE>}<NEW_LINE>logger.info("Written config file:{} for {}", configFile, this);<NEW_LINE>}
("sharedData").toString());
526,618
public static RemoveVServerGroupBackendServersResponse unmarshall(RemoveVServerGroupBackendServersResponse removeVServerGroupBackendServersResponse, UnmarshallerContext _ctx) {<NEW_LINE>removeVServerGroupBackendServersResponse.setRequestId(_ctx.stringValue("RemoveVServerGroupBackendServersResponse.RequestId"));<NEW_LINE>removeVServerGroupBackendServersResponse.setVServerGroupId(_ctx.stringValue("RemoveVServerGroupBackendServersResponse.VServerGroupId"));<NEW_LINE>List<BackendServer> backendServers = new ArrayList<BackendServer>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("RemoveVServerGroupBackendServersResponse.BackendServers.Length"); i++) {<NEW_LINE>BackendServer backendServer = new BackendServer();<NEW_LINE>backendServer.setVpcId(_ctx.stringValue("RemoveVServerGroupBackendServersResponse.BackendServers[" + i + "].VpcId"));<NEW_LINE>backendServer.setType(_ctx.stringValue("RemoveVServerGroupBackendServersResponse.BackendServers[" + i + "].Type"));<NEW_LINE>backendServer.setWeight(_ctx.integerValue("RemoveVServerGroupBackendServersResponse.BackendServers[" + i + "].Weight"));<NEW_LINE>backendServer.setDescription(_ctx.stringValue("RemoveVServerGroupBackendServersResponse.BackendServers[" + i + "].Description"));<NEW_LINE>backendServer.setServerRegionId(_ctx.stringValue("RemoveVServerGroupBackendServersResponse.BackendServers[" + i + "].ServerRegionId"));<NEW_LINE>backendServer.setServerIp(_ctx.stringValue<MASK><NEW_LINE>backendServer.setPort(_ctx.integerValue("RemoveVServerGroupBackendServersResponse.BackendServers[" + i + "].Port"));<NEW_LINE>backendServer.setVbrId(_ctx.stringValue("RemoveVServerGroupBackendServersResponse.BackendServers[" + i + "].VbrId"));<NEW_LINE>backendServer.setServerId(_ctx.stringValue("RemoveVServerGroupBackendServersResponse.BackendServers[" + i + "].ServerId"));<NEW_LINE>backendServers.add(backendServer);<NEW_LINE>}<NEW_LINE>removeVServerGroupBackendServersResponse.setBackendServers(backendServers);<NEW_LINE>return removeVServerGroupBackendServersResponse;<NEW_LINE>}
("RemoveVServerGroupBackendServersResponse.BackendServers[" + i + "].ServerIp"));
1,105,039
public void run() {<NEW_LINE>try {<NEW_LINE>String providerData = NetUtils.getContent(new URL(providerListUrl), 5000);<NEW_LINE>ObjectNode provider = objectMapper.readValue(providerData, ObjectNode.class);<NEW_LINE>ArrayNode arryaNode = (ArrayNode) provider.get("services");<NEW_LINE>for (JsonNode jsonNode : arryaNode) {<NEW_LINE>SNewServiceDescriptor serviceDescriptor = new SNewServiceDescriptor();<NEW_LINE>if (jsonNode.has("oauth")) {<NEW_LINE>ObjectNode oauth = (ObjectNode) jsonNode.get("oauth");<NEW_LINE>serviceDescriptor.setRegisterUrl(oauth.get("registerUrl").asText());<NEW_LINE>serviceDescriptor.setTokenUrl(oauth.get("tokenUrl").asText());<NEW_LINE>serviceDescriptor.setAuthorizationUrl(oauth.get("authorizationUrl").asText());<NEW_LINE>}<NEW_LINE>serviceDescriptor.setOid(jsonNode.get("id").asLong());<NEW_LINE>serviceDescriptor.setDescription(jsonNode.get("description").asText());<NEW_LINE>serviceDescriptor.setName(jsonNode.get("name").asText());<NEW_LINE>serviceDescriptor.setProvider(jsonNode.get<MASK><NEW_LINE>serviceDescriptor.setResourceUrl(jsonNode.get("resourceUrl").asText());<NEW_LINE>ArrayNode inputs = (ArrayNode) jsonNode.get("inputs");<NEW_LINE>ArrayNode outputs = (ArrayNode) jsonNode.get("outputs");<NEW_LINE>for (JsonNode inputNode : inputs) {<NEW_LINE>serviceDescriptor.getInputs().add(inputNode.asText());<NEW_LINE>}<NEW_LINE>for (JsonNode outputNode : outputs) {<NEW_LINE>serviceDescriptor.getOutputs().add(outputNode.asText());<NEW_LINE>}<NEW_LINE>list.add(serviceDescriptor);<NEW_LINE>}<NEW_LINE>} catch (MalformedURLException e) {<NEW_LINE>LOGGER.error("", e);<NEW_LINE>} catch (ConnectException e) {<NEW_LINE>// Host probably not up, no errors to be logged<NEW_LINE>} catch (IOException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>}
("provider").asText());
1,767,971
public void write(Fields fields, NormsProducer norms) throws IOException {<NEW_LINE>Map<PostingsFormat, <MASK><NEW_LINE>// Write postings<NEW_LINE>boolean success = false;<NEW_LINE>try {<NEW_LINE>for (Map.Entry<PostingsFormat, FieldsGroup> ent : formatToGroups.entrySet()) {<NEW_LINE>PostingsFormat format = ent.getKey();<NEW_LINE>final FieldsGroup group = ent.getValue();<NEW_LINE>// Exposes only the fields from this group:<NEW_LINE>Fields maskedFields = new FilterFields(fields) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Iterator<String> iterator() {<NEW_LINE>return group.fields.iterator();<NEW_LINE>}<NEW_LINE>};<NEW_LINE>FieldsConsumer consumer = format.fieldsConsumer(group.state);<NEW_LINE>toClose.add(consumer);<NEW_LINE>consumer.write(maskedFields, norms);<NEW_LINE>}<NEW_LINE>success = true;<NEW_LINE>} finally {<NEW_LINE>if (!success) {<NEW_LINE>IOUtils.closeWhileHandlingException(toClose);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
FieldsGroup> formatToGroups = buildFieldsGroupMapping(fields);
79,924
public void migrateHomeWorkParkingToFavorites() {<NEW_LINE>OsmandSettings settings = app.getSettings();<NEW_LINE>FavouritesHelper favorites = app.getFavoritesHelper();<NEW_LINE>SettingsAPI settingsAPI = settings.getSettingsAPI();<NEW_LINE>Object globalPreferences = settings.getGlobalPreferences();<NEW_LINE>LatLon homePoint = null;<NEW_LINE>float lat = settingsAPI.getFloat(globalPreferences, "home_point_lat", 0);<NEW_LINE>float lon = settingsAPI.getFloat(globalPreferences, "home_point_lon", 0);<NEW_LINE>if (lat != 0 || lon != 0) {<NEW_LINE>homePoint <MASK><NEW_LINE>}<NEW_LINE>LatLon workPoint = null;<NEW_LINE>lat = settingsAPI.getFloat(globalPreferences, "work_point_lat", 0);<NEW_LINE>lon = settingsAPI.getFloat(globalPreferences, "work_point_lon", 0);<NEW_LINE>if (lat != 0 || lon != 0) {<NEW_LINE>workPoint = new LatLon(lat, lon);<NEW_LINE>}<NEW_LINE>if (homePoint != null) {<NEW_LINE>favorites.setSpecialPoint(homePoint, SpecialPointType.HOME, null);<NEW_LINE>}<NEW_LINE>if (workPoint != null) {<NEW_LINE>favorites.setSpecialPoint(workPoint, SpecialPointType.WORK, null);<NEW_LINE>}<NEW_LINE>}
= new LatLon(lat, lon);
62,196
public void onAfterAnyExecute(StatementInformation statementInformation, long timeElapsedNanos, SQLException e) {<NEW_LINE>final Span activeSpan = tracingPlugin.getTracer().scopeManager().activeSpan();<NEW_LINE>if (activeSpan != null) {<NEW_LINE>if (statementInformation.getConnectionInformation().getDataSource() instanceof DataSource && jdbcPlugin.isCollectSql()) {<NEW_LINE>MetaData metaData = dataSourceUrlMap.get(statementInformation.getConnectionInformation().getDataSource());<NEW_LINE>Tags.PEER_SERVICE.set(activeSpan, metaData.serviceName);<NEW_LINE>activeSpan.setTag("db.type", metaData.productName);<NEW_LINE>activeSpan.setTag("db.user", metaData.userName);<NEW_LINE>if (StringUtils.isNotEmpty(statementInformation.getSql())) {<NEW_LINE>String sql = getSql(statementInformation.getSql(), statementInformation.getSqlWithValues());<NEW_LINE>Profiler.addIOCall(sql, timeElapsedNanos);<NEW_LINE>activeSpan.setTag(AbstractExternalRequest.EXTERNAL_REQUEST_METHOD, getMethod(sql));<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>tracingPlugin.getRequestMonitor().monitorStop();<NEW_LINE>}
activeSpan.setTag(DB_STATEMENT, sql);
1,696,993
public void deleteLinkedAccount(LinkedAccountType type) throws IOException {<NEW_LINE>try {<NEW_LINE>String authServerRootUrl = config.getKeycloakAuthUrl();<NEW_LINE>String realm = config.getKeycloakRealm();<NEW_LINE><MASK><NEW_LINE>JWTCallerPrincipal principal = (JWTCallerPrincipal) request.getUserPrincipal();<NEW_LINE>AccessToken token = RSATokenVerifier.create(principal.getRawToken()).getToken();<NEW_LINE>String url = KeycloakUriBuilder.fromUri(authServerRootUrl).path("/realms/{realm}/account/federated-identity-update").queryParam("action", "REMOVE").queryParam("provider_id", provider).build(realm).toString();<NEW_LINE>HttpGet get = new HttpGet(url);<NEW_LINE>get.addHeader("Accept", "application/json");<NEW_LINE>get.addHeader("Authorization", "Bearer " + token.toString());<NEW_LINE>try (CloseableHttpResponse response = httpClient.execute(get)) {<NEW_LINE>if (response.getStatusLine().getStatusCode() != 200) {<NEW_LINE>logger.log(Level.DEBUG, "HTTP Response Status Code when deleting identity provider: {}", response.getStatusLine().getStatusCode());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new IOException("Error deleting linked account.", e);<NEW_LINE>}<NEW_LINE>}
String provider = type.alias();
876,603
final CreateStudioResult executeCreateStudio(CreateStudioRequest createStudioRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createStudioRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateStudioRequest> request = null;<NEW_LINE>Response<CreateStudioResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateStudioRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createStudioRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "nimble");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateStudio");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateStudioResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateStudioResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
1,033,921
public final void commit_one_phase() throws XAException {<NEW_LINE>if (tc.isEntryEnabled())<NEW_LINE>Tr.entry(tc, "commit_one_phase", new Object<MASK><NEW_LINE>if (tcSummary.isDebugEnabled())<NEW_LINE>Tr.debug(tcSummary, "commit_one_phase", this);<NEW_LINE>try {<NEW_LINE>_resource.commit(_xid, true);<NEW_LINE>// Record the completion direction and Automatic vote.<NEW_LINE>_completedCommit = true;<NEW_LINE>_vote = JTAResourceVote.commit;<NEW_LINE>destroy();<NEW_LINE>} catch (XAException xae) {<NEW_LINE>_completionXARC = xae.errorCode;<NEW_LINE>// Record the completion XA return code<NEW_LINE>FFDCFilter.processException(xae, "com.ibm.ws.Transaction.JTA.JTAXAResourceImpl.commit_one_phase", "354", this);<NEW_LINE>throw xae;<NEW_LINE>} finally {<NEW_LINE>if (tc.isEntryEnabled())<NEW_LINE>Tr.exit(tc, "commit_one_phase", _completionXARC);<NEW_LINE>if (tcSummary.isDebugEnabled())<NEW_LINE>Tr.debug(tcSummary, "commit_one_phase result: " + XAReturnCodeHelper.convertXACode(_completionXARC));<NEW_LINE>}<NEW_LINE>}
[] { _resource, _xid });
1,423,522
public void validate(HttpAction action) {<NEW_LINE>String method = action.getRequestMethod().toUpperCase(Locale.ROOT);<NEW_LINE>if (HttpNames.METHOD_OPTIONS.equals(method))<NEW_LINE>return;<NEW_LINE>if (!HttpNames.METHOD_POST.equals(method) && !HttpNames.METHOD_GET.equals(method))<NEW_LINE>ServletOps.errorMethodNotAllowed("Not a GET or POST request");<NEW_LINE>if (HttpNames.METHOD_GET.equals(method) && action.getRequestQueryString() == null) {<NEW_LINE>ServletOps.warning(action, "Service Description / SPARQL Query / " + action.getRequestRequestURI());<NEW_LINE>ServletOps.errorNotFound(<MASK><NEW_LINE>}<NEW_LINE>// Use of the dataset describing parameters is checked later.<NEW_LINE>try {<NEW_LINE>Collection<String> x = acceptedParams(action);<NEW_LINE>validateParams(action, x);<NEW_LINE>validateRequest(action);<NEW_LINE>} catch (ActionErrorException ex) {<NEW_LINE>throw ex;<NEW_LINE>}<NEW_LINE>// Query not yet parsed.<NEW_LINE>}
"Service Description: " + action.getRequestRequestURI());
33,548
public static void main(String[] args) {<NEW_LINE>JFrame view = new JFrame("airline1");<NEW_LINE>view.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);<NEW_LINE>SDateField dep = new SDateField();<NEW_LINE>SDateField ret = new SDateField();<NEW_LINE>Cell<Boolean> valid = dep.date.lift(ret.date, (d, r) -> d.compareTo(r) <= 0);<NEW_LINE>SButton ok = new SButton("OK", valid);<NEW_LINE>GridBagLayout gridbag = new GridBagLayout();<NEW_LINE>view.setLayout(gridbag);<NEW_LINE>GridBagConstraints c = new GridBagConstraints();<NEW_LINE>c.fill = GridBagConstraints.HORIZONTAL;<NEW_LINE>c.gridwidth = 1;<NEW_LINE>c.gridheight = 1;<NEW_LINE>c.gridx = 0;<NEW_LINE>c.gridy = 0;<NEW_LINE>c.weightx = 0.0;<NEW_LINE>view.add(new JLabel("departure"), c);<NEW_LINE>c.gridx = 1;<NEW_LINE>c.gridy = 0;<NEW_LINE>c.weightx = 1.0;<NEW_LINE>view.add(dep, c);<NEW_LINE>c.gridwidth = 1;<NEW_LINE>c.gridheight = 1;<NEW_LINE>c.gridx = 0;<NEW_LINE>c.gridy = 1;<NEW_LINE>c.weightx = 0.0;<NEW_LINE>view.add(new JLabel("return"), c);<NEW_LINE>c.gridx = 1;<NEW_LINE>c.gridy = 1;<NEW_LINE>c.weightx = 1.0;<NEW_LINE><MASK><NEW_LINE>c.fill = GridBagConstraints.NONE;<NEW_LINE>c.gridwidth = 2;<NEW_LINE>c.gridx = 0;<NEW_LINE>c.gridy = 2;<NEW_LINE>c.weightx = 1.0;<NEW_LINE>view.add(ok, c);<NEW_LINE>view.setSize(380, 140);<NEW_LINE>view.setVisible(true);<NEW_LINE>}
view.add(ret, c);
569,359
public DecryptionResult decrypt(CertificateValidator validator, byte[] ciphertext, long timestamp) throws InvalidMetadataMessageException, InvalidMetadataVersionException, ProtocolInvalidMessageException, ProtocolInvalidKeyException, ProtocolNoSessionException, ProtocolLegacyMessageException, ProtocolInvalidVersionException, ProtocolDuplicateMessageException, ProtocolInvalidKeyIdException, ProtocolUntrustedIdentityException, SelfSendException {<NEW_LINE>UnidentifiedSenderMessageContent content;<NEW_LINE>try {<NEW_LINE>content = new UnidentifiedSenderMessageContent(Native.SealedSessionCipher_DecryptToUsmc(ciphertext, this.signalProtocolStore, null));<NEW_LINE>validator.validate(content.getSenderCertificate(), timestamp);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new InvalidMetadataMessageException(e);<NEW_LINE>}<NEW_LINE>boolean isLocalE164 = localE164Address != null && localE164Address.equals(content.getSenderCertificate().getSenderE164().orElse(null));<NEW_LINE>boolean isLocalUuid = localUuidAddress.equals(content.<MASK><NEW_LINE>if ((isLocalE164 || isLocalUuid) && content.getSenderCertificate().getSenderDeviceId() == localDeviceId) {<NEW_LINE>throw new SelfSendException();<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>return new DecryptionResult(content.getSenderCertificate().getSenderUuid(), content.getSenderCertificate().getSenderE164(), content.getSenderCertificate().getSenderDeviceId(), content.getType(), content.getGroupId(), decrypt(content));<NEW_LINE>} catch (InvalidMessageException e) {<NEW_LINE>throw new ProtocolInvalidMessageException(e, content);<NEW_LINE>} catch (InvalidKeyException e) {<NEW_LINE>throw new ProtocolInvalidKeyException(e, content);<NEW_LINE>} catch (NoSessionException e) {<NEW_LINE>throw new ProtocolNoSessionException(e, content);<NEW_LINE>} catch (LegacyMessageException e) {<NEW_LINE>throw new ProtocolLegacyMessageException(e, content);<NEW_LINE>} catch (InvalidVersionException e) {<NEW_LINE>throw new ProtocolInvalidVersionException(e, content);<NEW_LINE>} catch (DuplicateMessageException e) {<NEW_LINE>throw new ProtocolDuplicateMessageException(e, content);<NEW_LINE>} catch (InvalidKeyIdException e) {<NEW_LINE>throw new ProtocolInvalidKeyIdException(e, content);<NEW_LINE>} catch (UntrustedIdentityException e) {<NEW_LINE>throw new ProtocolUntrustedIdentityException(e, content);<NEW_LINE>}<NEW_LINE>}
getSenderCertificate().getSenderUuid());
97,140
public void updateConnectedControllers() {<NEW_LINE>logger.config("Updating connected controllers.");<NEW_LINE>if (environment != null) {<NEW_LINE>controllerCount = 0;<NEW_LINE>for (int i = 0; i < VR.k_unMaxTrackedDeviceCount; i++) {<NEW_LINE>int classCallback = VRSystem.VRSystem_GetTrackedDeviceClass(i);<NEW_LINE>if (classCallback == VR.ETrackedDeviceClass_TrackedDeviceClass_Controller || classCallback == VR.ETrackedDeviceClass_TrackedDeviceClass_GenericTracker) {<NEW_LINE>IntBuffer error = BufferUtils.createIntBuffer(1);<NEW_LINE>String controllerName = "Unknown";<NEW_LINE>String manufacturerName = "Unknown";<NEW_LINE>controllerName = VRSystem.VRSystem_GetStringTrackedDeviceProperty(i, VR.ETrackedDeviceProperty_Prop_TrackingSystemName_String, error);<NEW_LINE>manufacturerName = VRSystem.VRSystem_GetStringTrackedDeviceProperty(i, VR.ETrackedDeviceProperty_Prop_ManufacturerName_String, error);<NEW_LINE>if (error.get(0) != 0) {<NEW_LINE>logger.warning("Error getting controller information " + controllerName + " " + manufacturerName + "Code (" + error.get(0) + ")");<NEW_LINE>}<NEW_LINE>controllerIndex[controllerCount] = i;<NEW_LINE>// Adding tracked controller to control.<NEW_LINE>if (trackedControllers == null) {<NEW_LINE>trackedControllers = new ArrayList<VRTrackedController>(VR.k_unMaxTrackedDeviceCount);<NEW_LINE>}<NEW_LINE>trackedControllers.add(new LWJGLOpenVRTrackedController(i, this, controllerName, manufacturerName, environment));<NEW_LINE>// Send a Haptic pulse to the controller<NEW_LINE>triggerHapticPulse(controllerCount, 1.0f);<NEW_LINE>controllerCount++;<NEW_LINE>logger.config(" Tracked controller " + (i + 1) + "/" + VR.k_unMaxTrackedDeviceCount + " " + <MASK><NEW_LINE>} else {<NEW_LINE>logger.config(" Controller " + (i + 1) + "/" + VR.k_unMaxTrackedDeviceCount + " ignored.");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw new IllegalStateException("VR input is not attached to a VR environment.");<NEW_LINE>}<NEW_LINE>}
controllerName + " (" + manufacturerName + ") attached.");
1,288,030
public static GetDesktopGroupDetailResponse unmarshall(GetDesktopGroupDetailResponse getDesktopGroupDetailResponse, UnmarshallerContext _ctx) {<NEW_LINE>getDesktopGroupDetailResponse.setRequestId(_ctx.stringValue("GetDesktopGroupDetailResponse.RequestId"));<NEW_LINE>List<Desktop> desktops = new ArrayList<Desktop>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("GetDesktopGroupDetailResponse.Desktops.Length"); i++) {<NEW_LINE>Desktop desktop = new Desktop();<NEW_LINE>desktop.setCreationTime(_ctx.stringValue("GetDesktopGroupDetailResponse.Desktops[" + i + "].CreationTime"));<NEW_LINE>desktop.setPayType(_ctx.stringValue("GetDesktopGroupDetailResponse.Desktops[" + i + "].PayType"));<NEW_LINE>desktop.setPolicyGroupName(_ctx.stringValue("GetDesktopGroupDetailResponse.Desktops[" + i + "].PolicyGroupName"));<NEW_LINE>desktop.setCreator(_ctx.stringValue("GetDesktopGroupDetailResponse.Desktops[" + i + "].Creator"));<NEW_LINE>desktop.setMaxDesktopsCount(_ctx.integerValue("GetDesktopGroupDetailResponse.Desktops[" + i + "].MaxDesktopsCount"));<NEW_LINE>desktop.setAllowAutoSetup(_ctx.integerValue("GetDesktopGroupDetailResponse.Desktops[" + i + "].AllowAutoSetup"));<NEW_LINE>desktop.setResType(_ctx.integerValue("GetDesktopGroupDetailResponse.Desktops[" + i + "].ResType"));<NEW_LINE>desktop.setSystemDiskSize(_ctx.integerValue("GetDesktopGroupDetailResponse.Desktops[" + i + "].SystemDiskSize"));<NEW_LINE>desktop.setPolicyGroupId(_ctx.stringValue("GetDesktopGroupDetailResponse.Desktops[" + i + "].PolicyGroupId"));<NEW_LINE>desktop.setOwnBundleId(_ctx.stringValue("GetDesktopGroupDetailResponse.Desktops[" + i + "].OwnBundleId"));<NEW_LINE>desktop.setGpuCount(_ctx.floatValue("GetDesktopGroupDetailResponse.Desktops[" + i + "].GpuCount"));<NEW_LINE>desktop.setAllowBufferCount(_ctx.integerValue("GetDesktopGroupDetailResponse.Desktops[" + i + "].AllowBufferCount"));<NEW_LINE>desktop.setMemory(_ctx.longValue("GetDesktopGroupDetailResponse.Desktops[" + i + "].Memory"));<NEW_LINE>desktop.setGpuSpec(_ctx.stringValue("GetDesktopGroupDetailResponse.Desktops[" + i + "].GpuSpec"));<NEW_LINE>desktop.setDirectoryId(_ctx.stringValue("GetDesktopGroupDetailResponse.Desktops[" + i + "].DirectoryId"));<NEW_LINE>desktop.setOwnBundleName(_ctx.stringValue("GetDesktopGroupDetailResponse.Desktops[" + i + "].OwnBundleName"));<NEW_LINE>desktop.setDataDiskCategory(_ctx.stringValue("GetDesktopGroupDetailResponse.Desktops[" + i + "].DataDiskCategory"));<NEW_LINE>desktop.setDesktopGroupName(_ctx.stringValue("GetDesktopGroupDetailResponse.Desktops[" + i + "].DesktopGroupName"));<NEW_LINE>desktop.setSystemDiskCategory(_ctx.stringValue("GetDesktopGroupDetailResponse.Desktops[" + i + "].SystemDiskCategory"));<NEW_LINE>desktop.setOfficeSiteId(_ctx.stringValue("GetDesktopGroupDetailResponse.Desktops[" + i + "].OfficeSiteId"));<NEW_LINE>desktop.setKeepDuration(_ctx.longValue("GetDesktopGroupDetailResponse.Desktops[" + i + "].KeepDuration"));<NEW_LINE>desktop.setMinDesktopsCount(_ctx.integerValue("GetDesktopGroupDetailResponse.Desktops[" + i + "].MinDesktopsCount"));<NEW_LINE>desktop.setDataDiskSize(_ctx.stringValue("GetDesktopGroupDetailResponse.Desktops[" + i + "].DataDiskSize"));<NEW_LINE>desktop.setDesktopGroupId(_ctx.stringValue("GetDesktopGroupDetailResponse.Desktops[" + i + "].DesktopGroupId"));<NEW_LINE>desktop.setOfficeSiteName(_ctx.stringValue("GetDesktopGroupDetailResponse.Desktops[" + i + "].OfficeSiteName"));<NEW_LINE>desktop.setDirectoryType(_ctx.stringValue("GetDesktopGroupDetailResponse.Desktops[" + i + "].DirectoryType"));<NEW_LINE>desktop.setCpu(_ctx.integerValue("GetDesktopGroupDetailResponse.Desktops[" + i + "].Cpu"));<NEW_LINE>desktop.setExpiredTime(_ctx.stringValue("GetDesktopGroupDetailResponse.Desktops[" + i + "].ExpiredTime"));<NEW_LINE>desktop.setComments(_ctx.stringValue<MASK><NEW_LINE>desktop.setOfficeSiteType(_ctx.stringValue("GetDesktopGroupDetailResponse.Desktops[" + i + "].OfficeSiteType"));<NEW_LINE>desktop.setStatus(_ctx.integerValue("GetDesktopGroupDetailResponse.Desktops[" + i + "].Status"));<NEW_LINE>desktop.setResetType(_ctx.longValue("GetDesktopGroupDetailResponse.Desktops[" + i + "].ResetType"));<NEW_LINE>desktops.add(desktop);<NEW_LINE>}<NEW_LINE>getDesktopGroupDetailResponse.setDesktops(desktops);<NEW_LINE>return getDesktopGroupDetailResponse;<NEW_LINE>}
("GetDesktopGroupDetailResponse.Desktops[" + i + "].Comments"));
384,770
public Mono<Response<RoleDefinitionInner>> createOrUpdateWithResponseAsync(String scope, String roleDefinitionId, RoleDefinitionInner roleDefinition) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (scope == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>if (roleDefinitionId == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter roleDefinitionId is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (roleDefinition == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter roleDefinition is required and cannot be null."));<NEW_LINE>} else {<NEW_LINE>roleDefinition.validate();<NEW_LINE>}<NEW_LINE>final String accept = "application/json";<NEW_LINE>return FluxUtil.withContext(context -> service.createOrUpdate(this.client.getEndpoint(), scope, roleDefinitionId, this.client.getApiVersion(), roleDefinition, accept, context)).contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));<NEW_LINE>}
error(new IllegalArgumentException("Parameter scope is required and cannot be null."));
61,759
private Collection<String> validateReadQueueSize(Collection<String> canonicalKeys, EVCache.Call call) throws EVCacheException {<NEW_LINE>if (evcacheMemcachedClient.getNodeLocator() == null)<NEW_LINE>return canonicalKeys;<NEW_LINE>final Collection<String> retKeys = new ArrayList<>(canonicalKeys.size());<NEW_LINE>for (String key : canonicalKeys) {<NEW_LINE>final MemcachedNode node = evcacheMemcachedClient.<MASK><NEW_LINE>if (node instanceof EVCacheNode) {<NEW_LINE>final EVCacheNode evcNode = (EVCacheNode) node;<NEW_LINE>if (!evcNode.isAvailable(call)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>final int size = evcNode.getReadQueueSize();<NEW_LINE>final boolean canAddToOpQueue = size < (maxReadQueueSize.get() * 2);<NEW_LINE>// if (log.isDebugEnabled()) log.debug("Bulk Current Read Queue<NEW_LINE>// Size - " + size + " for app " + appName + " & zone " + zone +<NEW_LINE>// " ; node " + node);<NEW_LINE>if (!canAddToOpQueue) {<NEW_LINE>final String hostName;<NEW_LINE>if (evcNode.getSocketAddress() instanceof InetSocketAddress) {<NEW_LINE>hostName = ((InetSocketAddress) evcNode.getSocketAddress()).getHostName();<NEW_LINE>} else {<NEW_LINE>hostName = evcNode.getSocketAddress().toString();<NEW_LINE>}<NEW_LINE>incrementFailure(EVCacheMetricsFactory.READ_QUEUE_FULL, call, hostName);<NEW_LINE>if (log.isDebugEnabled())<NEW_LINE>log.debug("Read Queue Full on Bulk Operation for app : " + appName + "; zone : " + zone + "; Current Size : " + size + "; Max Size : " + maxReadQueueSize.get() * 2);<NEW_LINE>} else {<NEW_LINE>retKeys.add(key);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return retKeys;<NEW_LINE>}
getNodeLocator().getPrimary(key);
665,805
public Object calculate(Context ctx) {<NEW_LINE>if (param == null || !param.isLeaf()) {<NEW_LINE>MessageManager mm = EngineMessage.get();<NEW_LINE>throw new RQException("long" + mm.getMessage("function.invalidParam"));<NEW_LINE>}<NEW_LINE>Object result = param.getLeafExpression().calculate(ctx);<NEW_LINE>if (result instanceof Long) {<NEW_LINE>return result;<NEW_LINE>} else if (result instanceof Number) {<NEW_LINE>return new Long(((Number) result).longValue());<NEW_LINE>} else if (result instanceof String) {<NEW_LINE>try {<NEW_LINE>return Long.parseLong((String) result);<NEW_LINE>} catch (NumberFormatException e) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>} else if (result instanceof Date) {<NEW_LINE>return new Long(((Date) result).getTime());<NEW_LINE>} else if (result == null) {<NEW_LINE>return null;<NEW_LINE>} else {<NEW_LINE>MessageManager mm = EngineMessage.get();<NEW_LINE>throw new RQException("long" <MASK><NEW_LINE>}<NEW_LINE>}
+ mm.getMessage("function.paramTypeError"));
1,618,599
void tryInitUserObject(CommandLine commandLine) throws Exception {<NEW_LINE>Tracer tracer = commandLine.tracer;<NEW_LINE>if (typeInfo() != null) {<NEW_LINE>tracer.debug("Creating new user object of type %s for group %s%n", typeInfo().getAuxiliaryTypes()[0], synopsis());<NEW_LINE>Object userObject = DefaultFactory.create(commandLine.factory, typeInfo().getAuxiliaryTypes()[0]);<NEW_LINE>tracer.debug("Created %s, invoking setter %s with scope %s%n", userObject, setter(), scope());<NEW_LINE><MASK><NEW_LINE>for (ArgSpec arg : args()) {<NEW_LINE>tracer.debug("Initializing %s in group %s: setting scope to user object %s and initializing initial and default values%n", ArgSpec.describe(arg, "="), synopsis(), userObject);<NEW_LINE>// flip the actual user object for the arg (and all other args in this group; they share the same IScope instance)<NEW_LINE>arg.scope().set(userObject);<NEW_LINE>commandLine.interpreter.parseResultBuilder.isInitializingDefaultValues = true;<NEW_LINE>arg.applyInitialValue(tracer);<NEW_LINE>commandLine.interpreter.applyDefault(commandLine.getCommandSpec().defaultValueProvider(), arg);<NEW_LINE>commandLine.interpreter.parseResultBuilder.isInitializingDefaultValues = false;<NEW_LINE>}<NEW_LINE>for (ArgGroupSpec subgroup : subgroups()) {<NEW_LINE>tracer.debug("Setting scope for subgroup %s with setter=%s in group %s to user object %s%n", subgroup.synopsis(), subgroup.setter(), synopsis(), userObject);<NEW_LINE>// flip the actual user object for the arg (and all other args in this group; they share the same IScope instance)<NEW_LINE>subgroup.scope().set(userObject);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>tracer.debug("No type information available for group %s: cannot create new user object. Scope for arg setters is not changed.%n", synopsis());<NEW_LINE>}<NEW_LINE>tracer.debug("Initialization complete for group %s%n", synopsis());<NEW_LINE>}
setUserObject(userObject, commandLine.factory);
591,797
private static final void selfTestKey(RSAPrivateCrtKey privateKey, JwtRsaSsaPkcs1PrivateKey keyProto) throws GeneralSecurityException {<NEW_LINE>java.security.KeyFactory kf = EngineFactory.KEY_FACTORY.getInstance("RSA");<NEW_LINE>RSAPublicKey publicKey = (RSAPublicKey) kf.generatePublic(new RSAPublicKeySpec(new BigInteger(1, keyProto.getPublicKey().getN().toByteArray()), new BigInteger(1, keyProto.getPublicKey().getE().toByteArray())));<NEW_LINE>// Sign and verify a test message to make sure that the key is correct.<NEW_LINE>JwtRsaSsaPkcs1Algorithm algorithm = keyProto<MASK><NEW_LINE>Enums.HashType hash = JwtRsaSsaPkcs1VerifyKeyManager.hashForPkcs1Algorithm(algorithm);<NEW_LINE>SelfKeyTestValidators.validateRsaSsaPkcs1(privateKey, publicKey, hash);<NEW_LINE>}
.getPublicKey().getAlgorithm();
1,176,812
private void assertIsUnmodifiable() {<NEW_LINE>expectUnsupportedOperationException(() -> actual.add(null), "Collection.add(null)");<NEW_LINE>expectUnsupportedOperationException(() -> actual.addAll(emptyCollection()), "Collection.addAll(emptyCollection())");<NEW_LINE>expectUnsupportedOperationException(() -> actual.clear(), "Collection.clear()");<NEW_LINE>expectUnsupportedOperationException(() -> actual.iterator().remove(), "Collection.iterator().remove()");<NEW_LINE>expectUnsupportedOperationException(() -> actual.remove(null), "Collection.remove(null)");<NEW_LINE>expectUnsupportedOperationException(() -> actual.removeAll(emptyCollection()), "Collection.removeAll(emptyCollection())");<NEW_LINE>expectUnsupportedOperationException(() -> actual.removeIf(element -> true), "Collection.removeIf(element -> true)");<NEW_LINE>expectUnsupportedOperationException(() -> actual.retainAll(emptyCollection()), "Collection.retainAll(emptyCollection())");<NEW_LINE>if (actual instanceof List) {<NEW_LINE>List<ELEMENT> list = (List<ELEMENT>) actual;<NEW_LINE>expectUnsupportedOperationException(() -> list.add(0, null), "List.add(0, null)");<NEW_LINE>expectUnsupportedOperationException(() -> list.addAll(0, emptyCollection()), "List.addAll(0, emptyCollection())");<NEW_LINE>expectUnsupportedOperationException(() -> list.listIterator().add(null), "List.listIterator().add(null)");<NEW_LINE>expectUnsupportedOperationException(() -> list.listIterator().remove(), "List.listIterator().remove()");<NEW_LINE>expectUnsupportedOperationException(() -> list.listIterator()<MASK><NEW_LINE>expectUnsupportedOperationException(() -> list.remove(0), "List.remove(0)");<NEW_LINE>expectUnsupportedOperationException(() -> list.replaceAll(identity()), "List.replaceAll(identity())");<NEW_LINE>expectUnsupportedOperationException(() -> list.set(0, null), "List.set(0, null)");<NEW_LINE>expectUnsupportedOperationException(() -> list.sort((o1, o2) -> 0), "List.sort((o1, o2) -> 0)");<NEW_LINE>}<NEW_LINE>if (actual instanceof NavigableSet) {<NEW_LINE>NavigableSet<ELEMENT> set = (NavigableSet<ELEMENT>) actual;<NEW_LINE>expectUnsupportedOperationException(() -> set.descendingIterator().remove(), "NavigableSet.descendingIterator().remove()");<NEW_LINE>expectUnsupportedOperationException(() -> set.pollFirst(), "NavigableSet.pollFirst()");<NEW_LINE>expectUnsupportedOperationException(() -> set.pollLast(), "NavigableSet.pollLast()");<NEW_LINE>}<NEW_LINE>}
.set(null), "List.listIterator().set(null)");
1,489,665
public DataSerializableFactory createFactory() {<NEW_LINE>ConstructorFunction<Integer, IdentifiedDataSerializable>[<MASK><NEW_LINE>constructors[JSON_QUERY] = arg -> new JsonQueryFunction();<NEW_LINE>constructors[JSON_PARSE] = arg -> new JsonParseFunction();<NEW_LINE>constructors[JSON_VALUE] = arg -> new JsonValueFunction<>();<NEW_LINE>constructors[JSON_OBJECT] = arg -> new JsonObjectFunction();<NEW_LINE>constructors[JSON_ARRAY] = arg -> new JsonArrayFunction();<NEW_LINE>constructors[MAP_INDEX_SCAN_METADATA] = arg -> new MapIndexScanMetadata();<NEW_LINE>constructors[ROW_PROJECTOR_PROCESSOR_SUPPLIER] = arg -> new RowProjectorProcessorSupplier();<NEW_LINE>constructors[KV_ROW_PROJECTOR_SUPPLIER] = arg -> new KvRowProjector.Supplier();<NEW_LINE>constructors[ROOT_RESULT_CONSUMER_SINK_SUPPLIER] = arg -> new RootResultConsumerSink.Supplier();<NEW_LINE>constructors[SQL_ROW_COMPARATOR] = arg -> new ExpressionUtil.SqlRowComparator();<NEW_LINE>constructors[FIELD_COLLATION] = arg -> new FieldCollation();<NEW_LINE>constructors[ROW_GET_MAYBE_SERIALIZED_FN] = arg -> new AggregateAbstractPhysicalRule.RowGetMaybeSerializedFn();<NEW_LINE>constructors[NULL_FUNCTION] = arg -> AggregateAbstractPhysicalRule.NullFunction.INSTANCE;<NEW_LINE>constructors[ROW_GET_FN] = arg -> new AggregateAbstractPhysicalRule.RowGetFn();<NEW_LINE>constructors[AGGREGATE_CREATE_SUPPLIER] = arg -> new AggregateAbstractPhysicalRule.AggregateCreateSupplier();<NEW_LINE>constructors[AGGREGATE_ACCUMULATE_FUNCTION] = arg -> new AggregateAbstractPhysicalRule.AggregateAccumulateFunction();<NEW_LINE>constructors[AGGREGATE_COMBINE_FUNCTION] = arg -> AggregateAbstractPhysicalRule.AggregateCombineFunction.INSTANCE;<NEW_LINE>constructors[AGGREGATE_EXPORT_FINISH_FUNCTION] = arg -> AggregateAbstractPhysicalRule.AggregateExportFinishFunction.INSTANCE;<NEW_LINE>constructors[AGGREGATE_SUM_SUPPLIER] = arg -> new AggregateAbstractPhysicalRule.AggregateSumSupplier();<NEW_LINE>constructors[AGGREGATE_AVG_SUPPLIER] = arg -> new AggregateAbstractPhysicalRule.AggregateAvgSupplier();<NEW_LINE>constructors[AGGREGATE_COUNT_SUPPLIER] = arg -> new AggregateAbstractPhysicalRule.AggregateCountSupplier();<NEW_LINE>return new ArrayDataSerializableFactory(constructors);<NEW_LINE>}
] constructors = new ConstructorFunction[LEN];
161,849
private JPanel makeParameterPanel() {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>expressionField = new JLabeledTextField(JMeterUtils.getResString("expression_field"));<NEW_LINE>// $NON-NLS-1$<NEW_LINE>attributeField = new JLabeledTextField(JMeterUtils.getResString("attribute_field"));<NEW_LINE>// $NON-NLS-1$<NEW_LINE>refNameField = new JLabeledTextField(JMeterUtils.getResString("ref_name_field"));<NEW_LINE>// $NON-NLS-1$<NEW_LINE>matchNumberField = new JLabeledTextField(JMeterUtils.getResString("match_num_field"));<NEW_LINE>JPanel panel = new JPanel(new GridBagLayout());<NEW_LINE>GridBagConstraints gbc = new GridBagConstraints();<NEW_LINE>initConstraints(gbc);<NEW_LINE>addField(panel, refNameField, gbc);<NEW_LINE>resetContraints(gbc);<NEW_LINE>addField(panel, expressionField, gbc);<NEW_LINE>resetContraints(gbc);<NEW_LINE><MASK><NEW_LINE>resetContraints(gbc);<NEW_LINE>addField(panel, matchNumberField, gbc);<NEW_LINE>resetContraints(gbc);<NEW_LINE>gbc.weighty = 1;<NEW_LINE>// $NON-NLS-1$<NEW_LINE>defaultField = new JLabeledTextField(JMeterUtils.getResString("default_value_field"));<NEW_LINE>List<JComponent> item = defaultField.getComponentList();<NEW_LINE>panel.add(item.get(0), gbc.clone());<NEW_LINE>JPanel p = new JPanel(new BorderLayout());<NEW_LINE>p.add(item.get(1), BorderLayout.WEST);<NEW_LINE>emptyDefaultValue = new JCheckBox(JMeterUtils.getResString("cssjquery_empty_default_value"));<NEW_LINE>emptyDefaultValue.addItemListener(evt -> {<NEW_LINE>if (emptyDefaultValue.isSelected()) {<NEW_LINE>defaultField.setText("");<NEW_LINE>}<NEW_LINE>defaultField.setEnabled(!emptyDefaultValue.isSelected());<NEW_LINE>});<NEW_LINE>p.add(emptyDefaultValue, BorderLayout.CENTER);<NEW_LINE>gbc.gridx++;<NEW_LINE>gbc.weightx = 1;<NEW_LINE>gbc.fill = GridBagConstraints.HORIZONTAL;<NEW_LINE>panel.add(p, gbc.clone());<NEW_LINE>return panel;<NEW_LINE>}
addField(panel, attributeField, gbc);
390,942
public void start() {<NEW_LINE>if (config.isRunMigration() && TenantMode.DB != config.getTenantMode()) {<NEW_LINE>final AutoMigrationRunner migrationRunner = ServiceUtil.service(AutoMigrationRunner.class);<NEW_LINE>if (migrationRunner == null) {<NEW_LINE>throw new IllegalStateException("No AutoMigrationRunner found. Probably ebean-migration is not in the classpath?");<NEW_LINE>}<NEW_LINE>final String dbSchema = config.getDbSchema();<NEW_LINE>if (dbSchema != null) {<NEW_LINE>migrationRunner.setDefaultDbSchema(dbSchema);<NEW_LINE>}<NEW_LINE>migrationRunner.setName(config.getName());<NEW_LINE>Platform platform = config.getDatabasePlatform().getPlatform();<NEW_LINE>migrationRunner.setBasePlatform(platform.base().name().toLowerCase());<NEW_LINE>migrationRunner.setPlatform(platform.name().toLowerCase());<NEW_LINE>migrationRunner.loadProperties(config.getProperties());<NEW_LINE>migrationRunner.<MASK><NEW_LINE>}<NEW_LINE>startQueryPlanCapture();<NEW_LINE>}
run(config.getDataSource());
1,163,437
protected Map<String, ParameterDescription<?>> computeParameters() {<NEW_LINE>HashMap<String, ParameterDescription<?>> map = new HashMap<String, ParameterDescription<?>>();<NEW_LINE>ParameterDescription<String> address = ParameterDescription.create(String.class, "Address", true, "", "Address", "starting address");<NEW_LINE>ParameterDescription<Long> size = ParameterDescription.create(Long.class, "Size", true, 1L, "Size", "size to scan");<NEW_LINE>ParameterDescription<String> onAccess = ParameterDescription.create(String.class, "OnAccess", true, "", "onAccess file", "JS file with onAccess implemenation");<NEW_LINE>ParameterDescription<String> name = ParameterDescription.create(String.class, "Name", false, "watch", "name", "name for future unload");<NEW_LINE>ParameterDescription<String> script = ParameterDescription.create(String.class, "Script", false, "", "script", "script to execute on result");<NEW_LINE>map.put("Address", address);<NEW_LINE>map.put("Size", size);<NEW_LINE>map.put("OnAccess", onAccess);<NEW_LINE><MASK><NEW_LINE>map.put("Script", script);<NEW_LINE>return map;<NEW_LINE>}
map.put("Name", name);
891,494
public void read(org.apache.thrift.protocol.TProtocol prot, TaskSummary struct) throws org.apache.thrift.TException {<NEW_LINE>TTupleProtocol iprot = (TTupleProtocol) prot;<NEW_LINE>struct.taskId = iprot.readI32();<NEW_LINE>struct.set_taskId_isSet(true);<NEW_LINE>struct.uptime = iprot.readI32();<NEW_LINE>struct.set_uptime_isSet(true);<NEW_LINE>struct.status = iprot.readString();<NEW_LINE>struct.set_status_isSet(true);<NEW_LINE>struct.host = iprot.readString();<NEW_LINE>struct.set_host_isSet(true);<NEW_LINE>struct.port = iprot.readI32();<NEW_LINE>struct.set_port_isSet(true);<NEW_LINE>BitSet incoming = iprot.readBitSet(1);<NEW_LINE>if (incoming.get(0)) {<NEW_LINE>{<NEW_LINE>org.apache.thrift.protocol.TList _list175 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.<MASK><NEW_LINE>struct.errors = new ArrayList<ErrorInfo>(_list175.size);<NEW_LINE>ErrorInfo _elem176;<NEW_LINE>for (int _i177 = 0; _i177 < _list175.size; ++_i177) {<NEW_LINE>_elem176 = new ErrorInfo();<NEW_LINE>_elem176.read(iprot);<NEW_LINE>struct.errors.add(_elem176);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>struct.set_errors_isSet(true);<NEW_LINE>}<NEW_LINE>}
STRUCT, iprot.readI32());
1,719,913
private String callWebservice(String BASE_URL, String[] XAResouces, int expectedDirection, int sleepTimeServer, boolean clearXAResource) throws MalformedURLException {<NEW_LINE>final int timeout = 300 * 1000;<NEW_LINE>URL wsdlLocation = new URL(BASE_URL + "/simpleServer/WSATSimpleService?wsdl");<NEW_LINE>WSATSimpleService service = new WSATSimpleService(wsdlLocation);<NEW_LINE>WSATSimple proxy = service.getWSATSimplePort();<NEW_LINE>BindingProvider bind = (BindingProvider) proxy;<NEW_LINE>bind.getRequestContext().put("javax.xml.ws.service.endpoint.address", BASE_URL + "/simpleServer/WSATSimpleService");<NEW_LINE>bind.getRequestContext().put("com.sun.xml.ws.connect.timeout", timeout);<NEW_LINE>bind.getRequestContext().put("com.sun.xml.ws.request.timeout", timeout);<NEW_LINE>bind.getRequestContext(<MASK><NEW_LINE>bind.getRequestContext().put("javax.xml.ws.client.receiveTimeout", timeout);<NEW_LINE>String response = "";<NEW_LINE>System.out.println("Set expectedDirection in callWebservice: " + expectedDirection);<NEW_LINE>System.out.println("XAResouces.length in callWebservice: " + XAResouces.length);<NEW_LINE>for (int i = 0; i < XAResouces.length; i++) {<NEW_LINE>System.out.println("Vote of XAResouces[" + i + "] in callWebservice: " + XAResouces[i].toString());<NEW_LINE>}<NEW_LINE>switch(XAResouces.length) {<NEW_LINE>case 0:<NEW_LINE>response = proxy.getStatus();<NEW_LINE>break;<NEW_LINE>case 1:<NEW_LINE>response = proxy.enlistOneXAResource(XAResouces[0], expectedDirection, clearXAResource);<NEW_LINE>break;<NEW_LINE>case 2:<NEW_LINE>if (sleepTimeServer > 0) {<NEW_LINE>System.out.println(">>>>>>>>>>Server will sleep " + sleepTimeServer + " seconds.");<NEW_LINE>response = proxy.sleep(sleepTimeServer, expectedDirection);<NEW_LINE>} else {<NEW_LINE>response = proxy.enlistTwoXAResources(XAResouces[0], XAResouces[1], expectedDirection, clearXAResource);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>System.out.println("Reply from server: " + response);<NEW_LINE>return response;<NEW_LINE>}
).put("javax.xml.ws.client.connectionTimeout", timeout);
1,672,199
protected Property buildOfferItemQualifierRuleTypeProperty(Property qualifiersCanBeQualifiers, Property qualifiersCanBeTargets) {<NEW_LINE>String offerItemQualifierRuleType;<NEW_LINE>boolean canBeQualifiers = qualifiersCanBeQualifiers == null ? false : Boolean.parseBoolean(qualifiersCanBeQualifiers.getValue());<NEW_LINE>boolean canBeTargets = qualifiersCanBeTargets == null ? false : Boolean.<MASK><NEW_LINE>if (canBeTargets && canBeQualifiers) {<NEW_LINE>offerItemQualifierRuleType = OfferItemRestrictionRuleType.QUALIFIER_TARGET.getType();<NEW_LINE>} else if (canBeTargets) {<NEW_LINE>offerItemQualifierRuleType = OfferItemRestrictionRuleType.TARGET.getType();<NEW_LINE>} else if (canBeQualifiers) {<NEW_LINE>offerItemQualifierRuleType = OfferItemRestrictionRuleType.QUALIFIER.getType();<NEW_LINE>} else {<NEW_LINE>offerItemQualifierRuleType = OfferItemRestrictionRuleType.NONE.getType();<NEW_LINE>}<NEW_LINE>Property property = new Property();<NEW_LINE>property.setName(OFFER_ITEM_QUALIFIER_RULE_TYPE);<NEW_LINE>property.setValue(offerItemQualifierRuleType);<NEW_LINE>return property;<NEW_LINE>}
parseBoolean(qualifiersCanBeTargets.getValue());
1,297,562
private JComponent buildTopPanel(boolean enablePipette) throws ParseException {<NEW_LINE>final JPanel result = new JPanel(new BorderLayout());<NEW_LINE>final JPanel previewPanel = new JPanel(new BorderLayout());<NEW_LINE>if (enablePipette && ColorPipette.isAvailable()) {<NEW_LINE>final JButton pipette = new JButton();<NEW_LINE>pipette.setUI(new BasicButtonUI());<NEW_LINE>pipette.setRolloverEnabled(true);<NEW_LINE>pipette.setIcon(TargetAWT.to(AllIcons.Ide.Pipette));<NEW_LINE>pipette.setBorder(JBUI.Borders.empty());<NEW_LINE>pipette.setRolloverIcon(TargetAWT.to(AllIcons.Ide.Pipette_rollover));<NEW_LINE>pipette.setFocusable(false);<NEW_LINE>pipette.addActionListener(new ActionListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void actionPerformed(ActionEvent e) {<NEW_LINE>myPicker.myOldColor = getColor();<NEW_LINE>myPicker.pick();<NEW_LINE>// JBPopupFactory.getInstance().createBalloonBuilder(new JLabel("Press ESC button to close pipette"))<NEW_LINE>// .setAnimationCycle(2000)<NEW_LINE>// .setSmallVariant(true)<NEW_LINE>// .createBalloon().show(new RelativePoint(pipette, new Point(pipette.getWidth() / 2, 0)), Balloon.Position.above);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>previewPanel.add(pipette, BorderLayout.WEST);<NEW_LINE>}<NEW_LINE>myPreviewComponent = new ColorPreviewComponent();<NEW_LINE>previewPanel.<MASK><NEW_LINE>result.add(previewPanel, BorderLayout.NORTH);<NEW_LINE>final JPanel rgbPanel = new JPanel();<NEW_LINE>rgbPanel.setLayout(new BoxLayout(rgbPanel, BoxLayout.X_AXIS));<NEW_LINE>if (!UIUtil.isUnderAquaLookAndFeel()) {<NEW_LINE>myR_after.setPreferredSize(new Dimension(14, -1));<NEW_LINE>myG_after.setPreferredSize(new Dimension(14, -1));<NEW_LINE>myB_after.setPreferredSize(new Dimension(14, -1));<NEW_LINE>}<NEW_LINE>rgbPanel.setBorder(JBUI.Borders.empty(10, 0, 0, 0));<NEW_LINE>rgbPanel.add(myR);<NEW_LINE>rgbPanel.add(myRed);<NEW_LINE>if (!UIUtil.isUnderAquaLookAndFeel())<NEW_LINE>rgbPanel.add(myR_after);<NEW_LINE>rgbPanel.add(Box.createHorizontalStrut(JBUI.scale(2)));<NEW_LINE>rgbPanel.add(myG);<NEW_LINE>rgbPanel.add(myGreen);<NEW_LINE>if (!UIUtil.isUnderAquaLookAndFeel())<NEW_LINE>rgbPanel.add(myG_after);<NEW_LINE>rgbPanel.add(Box.createHorizontalStrut(JBUI.scale(2)));<NEW_LINE>rgbPanel.add(myB);<NEW_LINE>rgbPanel.add(myBlue);<NEW_LINE>if (!UIUtil.isUnderAquaLookAndFeel())<NEW_LINE>rgbPanel.add(myB_after);<NEW_LINE>rgbPanel.add(Box.createHorizontalStrut(JBUI.scale(2)));<NEW_LINE>rgbPanel.add(myFormat);<NEW_LINE>result.add(rgbPanel, BorderLayout.WEST);<NEW_LINE>final JPanel hexPanel = new JPanel();<NEW_LINE>hexPanel.setLayout(new BoxLayout(hexPanel, BoxLayout.X_AXIS));<NEW_LINE>hexPanel.setBorder(JBUI.Borders.empty(10, 0, 0, 0));<NEW_LINE>hexPanel.add(new JLabel("#"));<NEW_LINE>hexPanel.add(myHex);<NEW_LINE>result.add(hexPanel, BorderLayout.EAST);<NEW_LINE>return result;<NEW_LINE>}
add(myPreviewComponent, BorderLayout.CENTER);
1,631,571
protected void doXContent(XContentBuilder builder, Params params) throws IOException {<NEW_LINE>builder.startObject(NAME);<NEW_LINE>builder.startObject(fieldName);<NEW_LINE>builder.field(QUERY_FIELD.getPreferredName(), text);<NEW_LINE>builder.field(HIGH_FREQ_OPERATOR_FIELD.getPreferredName(), highFreqOperator.toString());<NEW_LINE>builder.field(LOW_FREQ_OPERATOR_FIELD.getPreferredName(), lowFreqOperator.toString());<NEW_LINE>if (analyzer != null) {<NEW_LINE>builder.field(<MASK><NEW_LINE>}<NEW_LINE>builder.field(CUTOFF_FREQUENCY_FIELD.getPreferredName(), cutoffFrequency);<NEW_LINE>if (lowFreqMinimumShouldMatch != null || highFreqMinimumShouldMatch != null) {<NEW_LINE>builder.startObject(MINIMUM_SHOULD_MATCH_FIELD.getPreferredName());<NEW_LINE>if (lowFreqMinimumShouldMatch != null) {<NEW_LINE>builder.field(LOW_FREQ_FIELD.getPreferredName(), lowFreqMinimumShouldMatch);<NEW_LINE>}<NEW_LINE>if (highFreqMinimumShouldMatch != null) {<NEW_LINE>builder.field(HIGH_FREQ_FIELD.getPreferredName(), highFreqMinimumShouldMatch);<NEW_LINE>}<NEW_LINE>builder.endObject();<NEW_LINE>}<NEW_LINE>printBoostAndQueryName(builder);<NEW_LINE>builder.endObject();<NEW_LINE>builder.endObject();<NEW_LINE>}
ANALYZER_FIELD.getPreferredName(), analyzer);
750,749
private void startPush(String pushURL) {<NEW_LINE>if (sLivePusher != null) {<NEW_LINE>sLivePusher.stopMicrophone();<NEW_LINE>sLivePusher.stopScreenCapture();<NEW_LINE>sLivePusher.stopPush();<NEW_LINE>sLivePusher = null;<NEW_LINE>}<NEW_LINE>sLivePusher = new V2TXLivePusherImpl(mContext, V2TXLiveDef.V2TXLiveMode.TXLiveMode_RTMP);<NEW_LINE>sLivePusher.setObserver(new MyTXLivePusherObserver());<NEW_LINE>sLivePusher.startMicrophone();<NEW_LINE>sLivePusher.startScreenCapture();<NEW_LINE>sVideoEncoderParam.videoResolution = sResolution;<NEW_LINE>sVideoEncoderParam.videoResolutionMode = sResolutionMode;<NEW_LINE>sLivePusher.setVideoQuality(sVideoEncoderParam);<NEW_LINE>sPushURL = pushURL;<NEW_LINE>int result = sLivePusher.startPush(pushURL);<NEW_LINE>if (result == V2TXLIVE_OK) {<NEW_LINE>sHasInitPusher = true;<NEW_LINE>Toast.makeText(ScreenPushEntranceActivity.this, getString(R.string.livepusher_screen_push), Toast.LENGTH_LONG).show();<NEW_LINE>((Button) findViewById(R.id.livepusher_btn_play)).setText(getString<MASK><NEW_LINE>((Button) findViewById(R.id.livepusher_btn_stop)).setVisibility(View.VISIBLE);<NEW_LINE>} else {<NEW_LINE>resetConfig();<NEW_LINE>sHasInitPusher = false;<NEW_LINE>}<NEW_LINE>}
(R.string.livepusher_screen_push_tip));
291,507
protected void refindPaymentScheduleLines(List<PaymentScheduleLine> paymentScheduleLines, int index) {<NEW_LINE>List<Long> idList = paymentScheduleLines.subList(Math.max(index, paymentScheduleLines.size()), paymentScheduleLines.size()).stream().map(PaymentScheduleLine::getId).<MASK><NEW_LINE>if (!idList.isEmpty()) {<NEW_LINE>List<PaymentScheduleLine> foundPaymentScheduleLines = paymentScheduleLineRepo.findByIdList(idList).fetch();<NEW_LINE>if (foundPaymentScheduleLines.size() != idList.size()) {<NEW_LINE>throw new IllegalStateException(String.format("Expected size: %d, got: %d", idList.size(), foundPaymentScheduleLines.size()));<NEW_LINE>}<NEW_LINE>for (int i = 0; i < foundPaymentScheduleLines.size(); ++i) {<NEW_LINE>paymentScheduleLines.set(index + i, foundPaymentScheduleLines.get(i));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
collect(Collectors.toList());
1,290,378
public OpenAPIExpectation[] deserializeArray(String jsonOpenAPIExpectations, boolean allowEmpty) {<NEW_LINE>List<OpenAPIExpectation> expectations = new ArrayList<>();<NEW_LINE>if (isBlank(jsonOpenAPIExpectations)) {<NEW_LINE>throw new IllegalArgumentException("1 error:" + NEW_LINE + " - an expectation or expectation array is required but value was \"" + jsonOpenAPIExpectations + "\"");<NEW_LINE>} else {<NEW_LINE>List<String> jsonOpenAPIExpectationList = jsonArraySerializer.splitJSONArray(jsonOpenAPIExpectations);<NEW_LINE>if (!jsonOpenAPIExpectationList.isEmpty()) {<NEW_LINE>List<String> validationErrorsList = new ArrayList<String>();<NEW_LINE>for (String jsonExpecation : jsonOpenAPIExpectationList) {<NEW_LINE>try {<NEW_LINE>expectations.add(deserialize(jsonExpecation));<NEW_LINE>} catch (IllegalArgumentException iae) {<NEW_LINE>validationErrorsList.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!validationErrorsList.isEmpty()) {<NEW_LINE>if (validationErrorsList.size() > 1) {<NEW_LINE>throw new IllegalArgumentException(("[" + NEW_LINE + Joiner.on("," + NEW_LINE + NEW_LINE).join(validationErrorsList)).replaceAll(NEW_LINE, NEW_LINE + " ") + NEW_LINE + "]");<NEW_LINE>} else {<NEW_LINE>throw new IllegalArgumentException(validationErrorsList.get(0));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else if (!allowEmpty) {<NEW_LINE>throw new IllegalArgumentException("1 error:" + NEW_LINE + " - an expectation or array of expectations is required");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return expectations.toArray(new OpenAPIExpectation[0]);<NEW_LINE>}
add(iae.getMessage());
1,265,822
/* Example usage: */<NEW_LINE>public static void main(String[] args) {<NEW_LINE>int n = 10;<NEW_LINE>List<List<Integer>> graph = createGraph(n);<NEW_LINE>addEdge(graph, 0, 1);<NEW_LINE>addEdge(graph, 0, 2);<NEW_LINE>addEdge(graph, 1, 2);<NEW_LINE>addEdge(graph, 1, 3);<NEW_LINE>addEdge(graph, 2, 3);<NEW_LINE>addEdge(graph, 1, 4);<NEW_LINE>addEdge(graph, 2, 7);<NEW_LINE>addEdge(graph, 4, 6);<NEW_LINE>addEdge(graph, 4, 5);<NEW_LINE>addEdge(graph, 5, 6);<NEW_LINE><MASK><NEW_LINE>addEdge(graph, 7, 9);<NEW_LINE>BridgesAdjacencyListIterative solver = new BridgesAdjacencyListIterative(graph, n);<NEW_LINE>List<Integer> bridges = solver.findBridges();<NEW_LINE>for (int i = 0; i < bridges.size() / 2; i++) {<NEW_LINE>int node1 = bridges.get(2 * i);<NEW_LINE>int node2 = bridges.get(2 * i + 1);<NEW_LINE>System.out.printf("BRIDGE between nodes: %d and %d\n", node1, node2);<NEW_LINE>}<NEW_LINE>}
addEdge(graph, 7, 8);
1,225,068
public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {<NEW_LINE>if ("<clinit>".equals(name)) {<NEW_LINE>// discard static initializers<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (isCandidateApiMember(access, apiIncludesPackagePrivateMembers) || ("<init>".equals(name) && isInnerClass)) {<NEW_LINE>final MethodMember methodMember = new MethodMember(access, name, desc, signature, exceptions);<NEW_LINE>methods.add(methodMember);<NEW_LINE>return new MethodVisitor(Opcodes.ASM7) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public AnnotationVisitor visitAnnotation(String desc, boolean visible) {<NEW_LINE>AnnotationMember ann = new AnnotationMember(desc, visible);<NEW_LINE>methodMember.addAnnotation(ann);<NEW_LINE>return new SortingAnnotationVisitor(ann, super.visitAnnotation(desc, visible));<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public AnnotationVisitor visitParameterAnnotation(int parameter, String desc, boolean visible) {<NEW_LINE>ParameterAnnotationMember ann = new ParameterAnnotationMember(desc, visible, parameter);<NEW_LINE>methodMember.addParameterAnnotation(ann);<NEW_LINE>return new SortingAnnotationVisitor(ann, super.visitParameterAnnotation<MASK><NEW_LINE>}<NEW_LINE>};<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
(parameter, desc, visible));
1,394,435
private void collapseNode(Component c, Transition t) {<NEW_LINE>Container lead = c.getParent().getLeadParent();<NEW_LINE>if (lead != null) {<NEW_LINE>c = lead;<NEW_LINE>}<NEW_LINE>c.putClientProperty(KEY_EXPANDED, null);<NEW_LINE>if (folder == null) {<NEW_LINE>setNodeMaterialIcon(<MASK><NEW_LINE>} else {<NEW_LINE>setNodeIcon(folder, c);<NEW_LINE>}<NEW_LINE>Container p = c.getParent();<NEW_LINE>for (int iter = 0; iter < p.getComponentCount(); iter++) {<NEW_LINE>if (p.getComponentAt(iter) != c) {<NEW_LINE>if (t == null) {<NEW_LINE>p.removeComponent(p.getComponentAt(iter));<NEW_LINE>// there should only be one container with all children<NEW_LINE>break;<NEW_LINE>} else {<NEW_LINE>Component dest = p.getComponentAt(iter);<NEW_LINE>dest.setHidden(true);<NEW_LINE>animateLayoutAndWait(300);<NEW_LINE>p.removeComponent(dest);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
FontImage.MATERIAL_FOLDER, c, 3);
530,223
private String sendRaw(String topicName, Producer<?, ?> producer, ProducerRecord recordToSend, Boolean isAsync) throws InterruptedException, ExecutionException {<NEW_LINE>ProducerRecord qualifiedRecord = prepareRecordToSend(topicName, recordToSend);<NEW_LINE>RecordMetadata metadata;<NEW_LINE>if (Boolean.TRUE.equals(isAsync)) {<NEW_LINE>LOGGER.info("Asynchronous Producer sending record - {}", qualifiedRecord);<NEW_LINE>metadata = (RecordMetadata) producer.send(qualifiedRecord, new ProducerAsyncCallback()).get();<NEW_LINE>} else {<NEW_LINE>LOGGER.info("Synchronous Producer sending record - {}", qualifiedRecord);<NEW_LINE>metadata = (RecordMetadata) producer.send(qualifiedRecord).get();<NEW_LINE>}<NEW_LINE>LOGGER.info("Record was sent to partition- {}, with offset- {} ", metadata.partition(), metadata.offset());<NEW_LINE>// --------------------------------------------------------------<NEW_LINE>// Logs deliveryDetails, which shd be good enough for the caller<NEW_LINE>// TODO- combine deliveryDetails into a list n return (if needed)<NEW_LINE>// --------------------------------------------------------------<NEW_LINE>String deliveryDetails = gson.toJson(new DeliveryDetails(OK, metadata));<NEW_LINE><MASK><NEW_LINE>return deliveryDetails;<NEW_LINE>}
LOGGER.info("deliveryDetails- {}", deliveryDetails);
1,350,772
Object str(VirtualFrame frame, PBaseException self, @Cached BaseExceptionAttrNode attrNode, @Cached CastToJavaStringNode toJavaStringNode, @Cached PyObjectStrAsJavaStringNode strNode) {<NEW_LINE>if (self.getExceptionAttributes() == null) {<NEW_LINE>// Not properly initialized.<NEW_LINE>return "";<NEW_LINE>}<NEW_LINE>// Get reason and encoding as strings, which they might not be if they've been<NEW_LINE>// modified after we were constructed.<NEW_LINE>final String object = toJavaStringNode.execute(attrNode.get(self, IDX_OBJECT, UNICODE_ERROR_ATTR_FACTORY));<NEW_LINE>final int start = attrNode.<MASK><NEW_LINE>final int end = attrNode.getInt(self, IDX_END, UNICODE_ERROR_ATTR_FACTORY);<NEW_LINE>final String encoding = strNode.execute(frame, attrNode.get(self, IDX_ENCODING, UNICODE_ERROR_ATTR_FACTORY));<NEW_LINE>final String reason = strNode.execute(frame, attrNode.get(self, IDX_REASON, UNICODE_ERROR_ATTR_FACTORY));<NEW_LINE>if (start < object.length() && end == start + 1) {<NEW_LINE>String fmt;<NEW_LINE>final int badChar = object.codePointAt(start);<NEW_LINE>if (badChar <= 0xFF) {<NEW_LINE>fmt = "'%s' codec can't encode character '\\x%02x' in position %d: %s";<NEW_LINE>} else if (badChar <= 0xFFFF) {<NEW_LINE>fmt = "'%s' codec can't encode character '\\u%04x' in position %d: %s";<NEW_LINE>} else {<NEW_LINE>fmt = "'%s' codec can't encode character '\\U%08x' in position %d: %s";<NEW_LINE>}<NEW_LINE>return PythonUtils.format(fmt, encoding, badChar, start, reason);<NEW_LINE>} else {<NEW_LINE>return PythonUtils.format("'%s' codec can't encode characters in position %d-%d: %s", encoding, start, end - 1, reason);<NEW_LINE>}<NEW_LINE>}
getInt(self, IDX_START, UNICODE_ERROR_ATTR_FACTORY);
415,287
private LockSettingsParams processLockSettingsParams(Map<String, String> params) {<NEW_LINE>Boolean lockSettingsDisableCam = defaultLockSettingsDisableCam;<NEW_LINE>String lockSettingsDisableCamParam = params.get(ApiParams.LOCK_SETTINGS_DISABLE_CAM);<NEW_LINE>if (!StringUtils.isEmpty(lockSettingsDisableCamParam)) {<NEW_LINE>lockSettingsDisableCam = Boolean.parseBoolean(lockSettingsDisableCamParam);<NEW_LINE>}<NEW_LINE>Boolean lockSettingsDisableMic = defaultLockSettingsDisableMic;<NEW_LINE>String lockSettingsDisableMicParam = params.get(ApiParams.LOCK_SETTINGS_DISABLE_MIC);<NEW_LINE>if (!StringUtils.isEmpty(lockSettingsDisableMicParam)) {<NEW_LINE>lockSettingsDisableMic = Boolean.parseBoolean(lockSettingsDisableMicParam);<NEW_LINE>}<NEW_LINE>Boolean lockSettingsDisablePrivateChat = defaultLockSettingsDisablePrivateChat;<NEW_LINE>String lockSettingsDisablePrivateChatParam = <MASK><NEW_LINE>if (!StringUtils.isEmpty(lockSettingsDisablePrivateChatParam)) {<NEW_LINE>lockSettingsDisablePrivateChat = Boolean.parseBoolean(lockSettingsDisablePrivateChatParam);<NEW_LINE>}<NEW_LINE>Boolean lockSettingsDisablePublicChat = defaultLockSettingsDisablePublicChat;<NEW_LINE>String lockSettingsDisablePublicChatParam = params.get(ApiParams.LOCK_SETTINGS_DISABLE_PUBLIC_CHAT);<NEW_LINE>if (!StringUtils.isEmpty(lockSettingsDisablePublicChatParam)) {<NEW_LINE>lockSettingsDisablePublicChat = Boolean.parseBoolean(lockSettingsDisablePublicChatParam);<NEW_LINE>}<NEW_LINE>Boolean lockSettingsDisableNotes = defaultLockSettingsDisableNotes;<NEW_LINE>String lockSettingsDisableNotesParam = params.get(ApiParams.LOCK_SETTINGS_DISABLE_NOTES);<NEW_LINE>if (!StringUtils.isEmpty(lockSettingsDisableNotesParam)) {<NEW_LINE>lockSettingsDisableNotes = Boolean.parseBoolean(lockSettingsDisableNotesParam);<NEW_LINE>} else {<NEW_LINE>// To be removed after deprecation period<NEW_LINE>lockSettingsDisableNotesParam = params.get(ApiParams.DEPRECATED_LOCK_SETTINGS_DISABLE_NOTES);<NEW_LINE>if (!StringUtils.isEmpty(lockSettingsDisableNotesParam)) {<NEW_LINE>log.warn("[DEPRECATION] use lockSettingsDisableNotes instead of lockSettingsDisableNote");<NEW_LINE>lockSettingsDisableNotes = Boolean.parseBoolean(lockSettingsDisableNotesParam);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Boolean lockSettingsHideUserList = defaultLockSettingsHideUserList;<NEW_LINE>String lockSettingsHideUserListParam = params.get(ApiParams.LOCK_SETTINGS_HIDE_USER_LIST);<NEW_LINE>if (!StringUtils.isEmpty(lockSettingsHideUserListParam)) {<NEW_LINE>lockSettingsHideUserList = Boolean.parseBoolean(lockSettingsHideUserListParam);<NEW_LINE>}<NEW_LINE>Boolean lockSettingsLockedLayout = defaultLockSettingsLockedLayout;<NEW_LINE>String lockSettingsLockedLayoutParam = params.get(ApiParams.LOCK_SETTINGS_LOCKED_LAYOUT);<NEW_LINE>if (!StringUtils.isEmpty(lockSettingsLockedLayoutParam)) {<NEW_LINE>lockSettingsLockedLayout = Boolean.parseBoolean(lockSettingsLockedLayoutParam);<NEW_LINE>}<NEW_LINE>Boolean lockSettingsLockOnJoin = defaultLockSettingsLockOnJoin;<NEW_LINE>String lockSettingsLockOnJoinParam = params.get(ApiParams.LOCK_SETTINGS_LOCK_ON_JOIN);<NEW_LINE>if (!StringUtils.isEmpty(lockSettingsLockOnJoinParam)) {<NEW_LINE>lockSettingsLockOnJoin = Boolean.parseBoolean(lockSettingsLockOnJoinParam);<NEW_LINE>}<NEW_LINE>Boolean lockSettingsLockOnJoinConfigurable = defaultLockSettingsLockOnJoinConfigurable;<NEW_LINE>String lockSettingsLockOnJoinConfigurableParam = params.get(ApiParams.LOCK_SETTINGS_LOCK_ON_JOIN_CONFIGURABLE);<NEW_LINE>if (!StringUtils.isEmpty(lockSettingsLockOnJoinConfigurableParam)) {<NEW_LINE>lockSettingsLockOnJoinConfigurable = Boolean.parseBoolean(lockSettingsLockOnJoinConfigurableParam);<NEW_LINE>}<NEW_LINE>Boolean lockSettingsHideViewersCursor = defaultLockSettingsHideViewersCursor;<NEW_LINE>String lockSettingsHideViewersCursorParam = params.get(ApiParams.LOCK_SETTINGS_HIDE_VIEWERS_CURSOR);<NEW_LINE>if (!StringUtils.isEmpty(lockSettingsHideViewersCursorParam)) {<NEW_LINE>lockSettingsHideViewersCursor = Boolean.parseBoolean(lockSettingsHideViewersCursorParam);<NEW_LINE>}<NEW_LINE>return new LockSettingsParams(lockSettingsDisableCam, lockSettingsDisableMic, lockSettingsDisablePrivateChat, lockSettingsDisablePublicChat, lockSettingsDisableNotes, lockSettingsHideUserList, lockSettingsLockedLayout, lockSettingsLockOnJoin, lockSettingsLockOnJoinConfigurable, lockSettingsHideViewersCursor);<NEW_LINE>}
params.get(ApiParams.LOCK_SETTINGS_DISABLE_PRIVATE_CHAT);
1,607,496
public void applyChanges() {<NEW_LINE>Preferences prefs = EntityCreationMetadataPreferences.get();<NEW_LINE>EntityCreationMetadataPreferencesManager prefsManager = new EntityCreationMetadataPreferencesManager(prefs);<NEW_LINE>try {<NEW_LINE>prefsManager.setCreatedByAnnotationEnabled(createdByAnnotationEnabled.isSelected());<NEW_LINE>Optional<IRI> iri = parseIri(createdByPropertyIriField.getText().trim());<NEW_LINE>if (iri.isPresent()) {<NEW_LINE>prefsManager.setCreatedByAnnotationPropertyIRI(iri.get());<NEW_LINE>}<NEW_LINE>} catch (URISyntaxException e) {<NEW_LINE>logger.warn("Invalid IRI specified for creator annotation property: {}", e.getMessage());<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>prefsManager.setCreationDateAnnotationEnabled(creationDateAnnotationEnabled.isSelected());<NEW_LINE>Optional<IRI> iri = parseIri(creationDatePropertyIriField.getText().trim());<NEW_LINE>if (iri.isPresent()) {<NEW_LINE>prefsManager.setCreationDateAnnotationPropertyIRI(iri.get());<NEW_LINE>} else {<NEW_LINE>prefsManager.setCreationDateAnnotationPropertyIRI(DublinCoreVocabulary.DATE.getIRI());<NEW_LINE>}<NEW_LINE>} catch (URISyntaxException e) {<NEW_LINE>logger.warn("Invalid IRI specified for creation date annotation property: {}", e.getMessage());<NEW_LINE>}<NEW_LINE>if (iso8601Radio.isSelected()) {<NEW_LINE>prefsManager.setDateFormatter(new ISO8601Formatter());<NEW_LINE>} else if (timestampRadio.isSelected()) {<NEW_LINE>prefsManager<MASK><NEW_LINE>}<NEW_LINE>prefsManager.setCreatedByValueOrcid(useOrcid.isSelected());<NEW_LINE>}
.setDateFormatter(new TimestampFormatter());
1,400,977
public SwaggerEntity swaggerJson() {<NEW_LINE>this.DEFINITION_MAP.clear();<NEW_LINE>List<ApiInfo> infos = requestMagicDynamicRegistry.mappings();<NEW_LINE>SwaggerEntity swaggerEntity = new SwaggerEntity();<NEW_LINE>swaggerEntity.setInfo(info);<NEW_LINE>swaggerEntity.setBasePath(this.basePath);<NEW_LINE>for (ApiInfo info : infos) {<NEW_LINE>String groupName = magicResourceService.getGroupName(info.getGroupId()).replace("/", "-");<NEW_LINE>String requestPath = PathUtils.replaceSlash(this.prefix + magicResourceService.getGroupPath(info.getGroupId()) + "/" + info.getPath());<NEW_LINE>SwaggerEntity.Path path = new SwaggerEntity.Path(info.getId());<NEW_LINE>path.addTag(groupName);<NEW_LINE>boolean hasBody = false;<NEW_LINE>try {<NEW_LINE>List<Map<String, Object>> parameters = parseParameters(info);<NEW_LINE>hasBody = parameters.stream().anyMatch(it -> VAR_NAME_REQUEST_BODY.equals(it.get("in")));<NEW_LINE>BaseDefinition baseDefinition = info.getRequestBodyDefinition();<NEW_LINE>if (hasBody && baseDefinition != null) {<NEW_LINE>doProcessDefinition(baseDefinition, info, groupName, "root_", "request", 0);<NEW_LINE>}<NEW_LINE>parameters.forEach(path::addParameter);<NEW_LINE>if (this.persistenceResponseBody) {<NEW_LINE>baseDefinition = info.getResponseBodyDefinition();<NEW_LINE>if (baseDefinition != null) {<NEW_LINE>Map responseMap = parseResponse(info);<NEW_LINE>if (!responseMap.isEmpty()) {<NEW_LINE>path.setResponses(responseMap);<NEW_LINE>doProcessDefinition(baseDefinition, info, groupName, "root_" + baseDefinition.getName(), "response", 0);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>path.addResponse("200", JsonUtils.readValue(Objects.toString(info.getResponseBody(), BODY_EMPTY), Object.class));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Exception ignored) {<NEW_LINE>}<NEW_LINE>if (hasBody) {<NEW_LINE>path.addConsume("application/json");<NEW_LINE>} else {<NEW_LINE>path.addConsume("*/*");<NEW_LINE>}<NEW_LINE>path.addProduce("application/json");<NEW_LINE>path.setSummary(info.getName());<NEW_LINE>path.setDescription(StringUtils.defaultIfBlank(info.getDescription()<MASK><NEW_LINE>swaggerEntity.addPath(requestPath, info.getMethod(), path);<NEW_LINE>}<NEW_LINE>if (this.DEFINITION_MAP.size() > 0) {<NEW_LINE>Set<Map.Entry> entries = ((Map) this.DEFINITION_MAP).entrySet();<NEW_LINE>for (Map.Entry entry : entries) {<NEW_LINE>swaggerEntity.addDefinitions(Objects.toString(entry.getKey()), entry.getValue());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return swaggerEntity;<NEW_LINE>}
, info.getName()));
1,176,045
public List<Record> loadFromMetaData(List<RecordMetaData> recordMetaDatas) throws IOException {<NEW_LINE>Set<Integer> toLoad = new HashSet<>();<NEW_LINE>for (RecordMetaData recordMetaData : recordMetaDatas) {<NEW_LINE>if (!(recordMetaData instanceof RecordMetaDataIndex)) {<NEW_LINE>throw new IllegalArgumentException("Expected RecordMetaDataIndex; got: " + recordMetaData);<NEW_LINE>}<NEW_LINE>long idx = ((<MASK><NEW_LINE>if (idx >= original.size()) {<NEW_LINE>throw new IllegalStateException("Cannot get index " + idx + " from collection: contains " + original + " elements");<NEW_LINE>}<NEW_LINE>toLoad.add((int) idx);<NEW_LINE>}<NEW_LINE>List<Record> out = new ArrayList<>();<NEW_LINE>if (original instanceof List) {<NEW_LINE>List<Collection<Writable>> asList = (List<Collection<Writable>>) original;<NEW_LINE>for (Integer i : toLoad) {<NEW_LINE>List<Writable> l = new ArrayList<>(asList.get(i));<NEW_LINE>Record r = new org.datavec.api.records.impl.Record(l, new RecordMetaDataIndex(i, null, CollectionRecordReader.class));<NEW_LINE>out.add(r);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>Iterator<? extends Collection<Writable>> iter = original.iterator();<NEW_LINE>int i = 0;<NEW_LINE>while (iter.hasNext()) {<NEW_LINE>Collection<Writable> c = iter.next();<NEW_LINE>if (!toLoad.contains(i++)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>List<Writable> l = (c instanceof List ? ((List<Writable>) c) : new ArrayList<>(c));<NEW_LINE>Record r = new org.datavec.api.records.impl.Record(l, new RecordMetaDataIndex(i - 1, null, CollectionRecordReader.class));<NEW_LINE>out.add(r);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return out;<NEW_LINE>}
RecordMetaDataIndex) recordMetaData).getIndex();
1,005,639
public void executeStep(PluginStepContext context, Map<String, Object> configuration) throws StepException {<NEW_LINE>if (null == jobUUID && null == jobName) {<NEW_LINE>throw new StepException("Configuration invalid: jobUUID or jobName is required", StepFailureReason.ConfigurationFailure);<NEW_LINE>}<NEW_LINE>if (null == executionState && null == running) {<NEW_LINE>throw new StepException("Configuration invalid: executionState or running is required", StepFailureReason.ConfigurationFailure);<NEW_LINE>}<NEW_LINE>JobService jobService = context.getExecutionContext().getJobService();<NEW_LINE>final JobState jobState;<NEW_LINE>final JobReference jobReference;<NEW_LINE>try {<NEW_LINE>String project = context.getFrameworkProject();<NEW_LINE>if (null != jobProject) {<NEW_LINE>project = jobProject;<NEW_LINE>}<NEW_LINE>if (null != jobUUID) {<NEW_LINE>jobReference = jobService.jobForID(jobUUID, project);<NEW_LINE>} else {<NEW_LINE>jobReference = jobService.jobForName(jobName, project);<NEW_LINE>}<NEW_LINE>jobState = jobService.getJobState(jobReference);<NEW_LINE>} catch (JobNotFound jobNotFound) {<NEW_LINE>throw new StepException("Job was not found: " + jobNotFound.getMessage(), StepFailureReason.ConfigurationFailure);<NEW_LINE>}<NEW_LINE>// evaluate job state<NEW_LINE>boolean result = false;<NEW_LINE>boolean equality = null == condition || !CON_NOTEQUALS.equalsIgnoreCase(condition);<NEW_LINE>String message = renderOutcome(jobState, jobReference, equality).toString();<NEW_LINE>if (null != running) {<NEW_LINE>result = checkRunning(jobState);<NEW_LINE>finishConditional(context, result, equality, message);<NEW_LINE>}<NEW_LINE>if (null != executionState) {<NEW_LINE>result = checkExecutionState(jobState.getPreviousExecutionState(), jobState.getPreviousExecutionStatusString());<NEW_LINE>finishConditional(<MASK><NEW_LINE>}<NEW_LINE>}
context, result, equality, message);
718,400
void init(BoostingObjs boostingObjs, List<Row> quantileData) {<NEW_LINE>if (quantileData != null && !quantileData.isEmpty()) {<NEW_LINE>quantileModel = new QuantileDiscretizerModelDataConverter().load(quantileData);<NEW_LINE>}<NEW_LINE>useMissing = boostingObjs.params.get(USE_MISSING);<NEW_LINE>useOneHot = boostingObjs.params.get(USE_ONEHOT);<NEW_LINE>featureMetas = boostingObjs.data.getFeatureMetas();<NEW_LINE>maxFeatureBins = 0;<NEW_LINE>allFeatureBins = 0;<NEW_LINE>for (FeatureMeta featureMeta : boostingObjs.data.getFeatureMetas()) {<NEW_LINE>int featureSize = DataUtil.getFeatureCategoricalSize(featureMeta, useMissing);<NEW_LINE>maxFeatureBins = Math.max(maxFeatureBins, featureSize);<NEW_LINE>allFeatureBins += featureSize;<NEW_LINE>}<NEW_LINE>compareIndex4Categorical = new Integer[maxFeatureBins];<NEW_LINE>featureBinOffset = new int[boostingObjs.numBaggingFeatures];<NEW_LINE>nodeIdCache = new int[boostingObjs.data.getM()];<NEW_LINE>maxNodeSize = Math.min(((int) Math.pow(2, boostingObjs.params.get(GbdtTrainParams.MAX_DEPTH) - 1)), boostingObjs.params<MASK><NEW_LINE>baggingFeaturePool = new Bagging.BaggingFeaturePool(maxNodeSize, boostingObjs.numBaggingFeatures);<NEW_LINE>}
.get(GbdtTrainParams.MAX_LEAVES));
1,826,923
private void init(BinaryMessenger messenger) {<NEW_LINE>if (mEventChannel != null) {<NEW_LINE>mEventChannel.setStreamHandler(null);<NEW_LINE>mEventSink.setDelegate(null);<NEW_LINE>}<NEW_LINE>mEventChannel = new EventChannel(messenger, "befovy.com/fijk/event");<NEW_LINE>mEventChannel.setStreamHandler(new EventChannel.StreamHandler() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onListen(Object o, EventChannel.EventSink eventSink) {<NEW_LINE>mEventSink.setDelegate(eventSink);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onCancel(Object o) {<NEW_LINE>mEventSink.setDelegate(null);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>AudioManager audioManager = audioManager();<NEW_LINE>if (audioManager != null) {<NEW_LINE>int max = audioManager.getStreamMaxVolume(AudioManager.STREAM_MUSIC);<NEW_LINE>volStep = Math.max(1.0f <MASK><NEW_LINE>}<NEW_LINE>}
/ (float) max, volStep);
1,235,540
protected void match(List<?> expected, List<?> computed, int col) {<NEW_LINE>if (col >= columnBindings.length) {<NEW_LINE>check(expected, computed);<NEW_LINE>} else if (columnBindings[col] == null) {<NEW_LINE>match(expected, computed, col + 1);<NEW_LINE>} else {<NEW_LINE>Map<Object, Object> <MASK><NEW_LINE>Map<Object, Object> cMap = cSort(computed, col);<NEW_LINE>Set<Object> keys = union(eMap.keySet(), cMap.keySet());<NEW_LINE>for (Object key : keys) {<NEW_LINE>List<?> eList = (List<?>) eMap.get(key);<NEW_LINE>List<?> cList = (List<?>) cMap.get(key);<NEW_LINE>if (eList == null) {<NEW_LINE>surplus.addAll(cList);<NEW_LINE>} else if (cList == null) {<NEW_LINE>missing.addAll(eList);<NEW_LINE>} else if (eList.size() == 1 && cList.size() == 1) {<NEW_LINE>check(eList, cList);<NEW_LINE>} else {<NEW_LINE>match(eList, cList, col + 1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
eMap = eSort(expected, col);
1,203,753
private void allAppsGridView() throws AndroidDeviceException {<NEW_LINE>int x = screenSize.width;<NEW_LINE>int y = screenSize.height;<NEW_LINE>if (x > y) {<NEW_LINE>y = y / 2;<NEW_LINE>x = x - 30;<NEW_LINE>} else {<NEW_LINE>x = x / 2;<NEW_LINE>y = y - 30;<NEW_LINE>}<NEW_LINE>List<String> coordinates <MASK><NEW_LINE>coordinates.add("3 0 " + x);<NEW_LINE>coordinates.add("3 1 " + y);<NEW_LINE>coordinates.add("1 330 1");<NEW_LINE>coordinates.add("0 0 0");<NEW_LINE>coordinates.add("1 330 0");<NEW_LINE>coordinates.add("0 0 0");<NEW_LINE>for (String coordinate : coordinates) {<NEW_LINE>CommandLine event1 = getAdbCommand();<NEW_LINE>event1.addArgument("shell", false);<NEW_LINE>event1.addArgument("sendevent", false);<NEW_LINE>event1.addArgument("dev/input/event0", false);<NEW_LINE>event1.addArgument(coordinate, false);<NEW_LINE>try {<NEW_LINE>ShellCommand.exec(event1);<NEW_LINE>} catch (ShellCommandException e) {<NEW_LINE>throw new AndroidDeviceException(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>Thread.sleep(750);<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>Thread.currentThread().interrupt();<NEW_LINE>}<NEW_LINE>}
= new ArrayList<String>();
35,180
public static void main(String[] args) {<NEW_LINE>// .showFileList(true)<NEW_LINE>Blade.of().get("/", ctx -> ctx.render("index.html")).get("/basic-route-example", ctx -> ctx.text("GET called")).post("/basic-route-example", ctx -> ctx.text("POST called")).put("/basic-route-example", ctx -> ctx.text("PUT called")).delete("/basic-route-example", ctx -> ctx.text("DELETE called")).addStatics("/custom-static").enableCors(true).before("/user/*", ctx -> log.info("[NarrowedHook] Before '/user/*', URL called: " + ctx.uri())).on(EventType.SERVER_STARTED, e -> {<NEW_LINE>String version = WebContext.blade().env<MASK><NEW_LINE>log.info("[Event::serverStarted] Loading 'app.version' from configuration, value: " + version);<NEW_LINE>}).on(EventType.SESSION_CREATED, e -> {<NEW_LINE>Session session = (Session) e.attribute("session");<NEW_LINE>session.attribute("mySessionValue", "Baeldung");<NEW_LINE>}).use(new BaeldungMiddleware()).start(App.class, args);<NEW_LINE>}
("app.version").orElse("N/D");
1,364,021
private static void processSeparatedAttribute(final boolean separated, @NotNull final JavaCodeStyleSettings settings) {<NEW_LINE>PackageEntryTable importTable = new PackageEntryTable();<NEW_LINE>if (settings.IMPORT_LAYOUT_TABLE.getEntryCount() < 1) {<NEW_LINE>// nothing to separate<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>for (PackageEntry entry : settings.IMPORT_LAYOUT_TABLE.getEntries()) {<NEW_LINE>if (entry != PackageEntry.BLANK_LINE_ENTRY) {<NEW_LINE>importTable.addEntry(entry);<NEW_LINE>if (separated) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// remove blank line at the very end if present<NEW_LINE>if (importTable.getEntryAt(importTable.getEntryCount() - 1) == PackageEntry.BLANK_LINE_ENTRY) {<NEW_LINE>importTable.removeEntryAt(importTable.getEntryCount() - 1);<NEW_LINE>}<NEW_LINE>settings.IMPORT_LAYOUT_TABLE.copyFrom(importTable);<NEW_LINE>}
importTable.addEntry(PackageEntry.BLANK_LINE_ENTRY);
652,080
public boolean readResolvedRefs(final UtilImpl_InternMap classNameInternMap, final Set<String> i_resolvedClassNames) {<NEW_LINE>long readStart = System.nanoTime();<NEW_LINE>File refsFile = getResolvedRefsFile();<NEW_LINE>// System.out.println("Refs path [ " + refsFile.getAbsolutePath() + " ]");<NEW_LINE>boolean didRead;<NEW_LINE>if (getUseBinaryFormat()) {<NEW_LINE>Util_Consumer<TargetCacheImpl_ReaderBinary, IOException> readAction = new Util_Consumer<TargetCacheImpl_ReaderBinary, IOException>() {<NEW_LINE><NEW_LINE>public void accept(TargetCacheImpl_ReaderBinary reader) throws IOException {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>};<NEW_LINE>didRead = readBinary(refsFile, !DO_READ_STRINGS, DO_READ_FULL, readAction);<NEW_LINE>} else {<NEW_LINE>TargetCache_Readable refsReadable = new TargetCache_Readable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public List<TargetCache_ParseError> readUsing(TargetCache_Reader reader) throws IOException {<NEW_LINE>return basicReadResolvedRefs(classNameInternMap, i_resolvedClassNames);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>didRead = super.read(refsFile, refsReadable);<NEW_LINE>}<NEW_LINE>@SuppressWarnings("unused")<NEW_LINE>long readDuration = addReadTime(readStart, "Resolved Refs");<NEW_LINE>return didRead;<NEW_LINE>}
reader.readEntireResolvedRefs(i_resolvedClassNames, classNameInternMap);
781,272
public void addEntity(ERDEntity entity, int i, boolean reflect) {<NEW_LINE>DBSEntity object = entity.getObject();<NEW_LINE>if (object == null) {<NEW_LINE>log.debug("Null object passed");<NEW_LINE>return;<NEW_LINE>} else if (object.getDataSource() == null) {<NEW_LINE>log.debug("Object " + object.getName() + " is not connected with datasource");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>synchronized (entities) {<NEW_LINE>if (i < 0) {<NEW_LINE>entities.add(entity);<NEW_LINE>} else {<NEW_LINE>entities.add(i, entity);<NEW_LINE>}<NEW_LINE>entityMap.put(object, entity);<NEW_LINE>DBPDataSourceContainer dataSource = object.getDataSource().getContainer();<NEW_LINE>DataSourceInfo dsInfo = dataSourceMap.computeIfAbsent(dataSource, dsc -> new DataSourceInfo(dataSourceMap.size()));<NEW_LINE>dsInfo.entities.add(entity);<NEW_LINE>DBSObjectContainer container = DBUtils.getParentOfType(DBSObjectContainer.class, entity.getObject());<NEW_LINE>if (container != null) {<NEW_LINE>dataSourceContainerMap.putIfAbsent(dataSource, new LinkedHashMap<>());<NEW_LINE>Map<DBSObjectContainer, Integer> <MASK><NEW_LINE>containerMap.putIfAbsent(container, containerMap.size());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (reflect) {<NEW_LINE>firePropertyChange(PROP_CHILD, null, entity);<NEW_LINE>}<NEW_LINE>resolveRelations(reflect);<NEW_LINE>if (reflect) {<NEW_LINE>for (ERDAssociation rel : entity.getReferences()) {<NEW_LINE>rel.getSourceEntity().firePropertyChange(PROP_OUTPUT, null, rel);<NEW_LINE>}<NEW_LINE>for (ERDAssociation rel : entity.getAssociations()) {<NEW_LINE>rel.getTargetEntity().firePropertyChange(PROP_INPUT, null, rel);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
containerMap = dataSourceContainerMap.get(dataSource);
1,026,925
MemberMoveResult moveMembers(final TreeSet<TypeMember> moveMembers, final int moveDelta) {<NEW_LINE>Preconditions.checkArgument(moveMembers.first().getBitOffset().get() + moveDelta >= 0, "Cannot move members to negative offset.");<NEW_LINE>Preconditions.checkArgument(moveMembers.last().getBitOffset().get() + moveDelta <= members.last().getBitOffset().get() + members.last().getBitSize(), "Cannot move members behind last member.");<NEW_LINE>Preconditions.checkArgument(areMembersConsecutive(moveMembers), "Cannot move members that are not consecutive to each other.");<NEW_LINE>final TypeMember firstMember = moveMembers.first();<NEW_LINE>final TypeMember lastMember = moveMembers.last();<NEW_LINE>final boolean moveTowardsBeginning = moveDelta < 0;<NEW_LINE>final int startOffset = moveTowardsBeginning ? firstMember.getBitOffset().get() + moveDelta : members.higher(lastMember).getBitOffset().get();<NEW_LINE>final int endOffset = moveTowardsBeginning ? firstMember.getBitOffset().get() : members.higher(lastMember).getBitOffset().get() + moveDelta;<NEW_LINE>final List<TypeMember> implicitlyMoved = getMembers(startOffset, endOffset, members);<NEW_LINE>final int implicitMoveDelta = moveTowardsBeginning ? determineOccupiedSize(moveMembers) : -determineOccupiedSize(moveMembers);<NEW_LINE>// Note that we have to remove the members before changing their offsets since the natural order<NEW_LINE>// would be in an inconsistent state otherwise, breaking our internal members TreeSet.<NEW_LINE>members.removeAll(moveMembers);<NEW_LINE>members.removeAll(implicitlyMoved);<NEW_LINE>for (final TypeMember member : implicitlyMoved) {<NEW_LINE>member.setOffset(Optional.<Integer>of(member.getBitOffset()<MASK><NEW_LINE>}<NEW_LINE>for (final TypeMember member : moveMembers) {<NEW_LINE>member.setOffset(Optional.<Integer>of(member.getBitOffset().get() + moveDelta));<NEW_LINE>}<NEW_LINE>members.addAll(moveMembers);<NEW_LINE>members.addAll(implicitlyMoved);<NEW_LINE>return new MemberMoveResult(implicitlyMoved, implicitMoveDelta);<NEW_LINE>}
.get() + implicitMoveDelta));
331,707
private JPanel buildOutgoingConfigurationsTab() {<NEW_LINE>outgoingWssTable = JTableFactory.getInstance().makeJTable(new OutgoingWssTableModel());<NEW_LINE>outgoingWssTable.getSelectionModel().addListSelectionListener(new ListSelectionListener() {<NEW_LINE><NEW_LINE>public void valueChanged(ListSelectionEvent e) {<NEW_LINE>int selectedRow = outgoingWssTable.getSelectedRow();<NEW_LINE>selectedOutgoing = selectedRow == -1 ? null : wssContainer.getOutgoingWssAt(selectedRow);<NEW_LINE>removeOutgoingWssAction.setEnabled(selectedRow != -1);<NEW_LINE>addOutgoingEntryButton.setEnabled(selectedRow != -1);<NEW_LINE>if (selectedOutgoing != null) {<NEW_LINE>entriesListModel.removeAllElements();<NEW_LINE>for (WssEntry entry : selectedOutgoing.getEntries()) {<NEW_LINE>entriesListModel.addElement(entry);<NEW_LINE>}<NEW_LINE>entriesListContainer.getViewport().add(entriesList);<NEW_LINE>entriesSplitPane.setRightComponent(new JPanel());<NEW_LINE>}<NEW_LINE>entriesSplitPane.setDividerLocation(ENTRIES_LIST_COMPONENT_WIDTH);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>outgoingWssTable.getColumnModel().getColumn(2).setCellEditor(new DefaultCellEditor(new JPasswordField()));<NEW_LINE>outgoingWssTable.getColumnModel().getColumn(2).setCellRenderer(new PasswordTableCellRenderer());<NEW_LINE>JPanel outgoingConfigurationSplitPane = new JPanel(new BorderLayout());<NEW_LINE>JSplitPane split = UISupport.createVerticalSplit(new JScrollPane(outgoingWssTable), buildOutgoingWssDetails());<NEW_LINE>split.setDividerLocation(140);<NEW_LINE>outgoingConfigurationSplitPane.add(buildOutgoingWssToolbar(), BorderLayout.NORTH);<NEW_LINE>outgoingConfigurationSplitPane.add(split, BorderLayout.CENTER);<NEW_LINE>JPanel outgoingConfigurationsPanel = new JPanel(new BorderLayout());<NEW_LINE>outgoingConfigurationsPanel.<MASK><NEW_LINE>return outgoingConfigurationsPanel;<NEW_LINE>}
add(outgoingConfigurationSplitPane, BorderLayout.CENTER);
1,376,586
public void save(TeaVMDevServerConfiguration configuration) {<NEW_LINE>configuration.setMainClass(mainClassField.getText().trim());<NEW_LINE>moduleSelector.applyTo(configuration);<NEW_LINE>configuration.setJdkPath(jrePathEditor.getJrePathOrName());<NEW_LINE>configuration.setFileName(fileNameField.getText().trim());<NEW_LINE>configuration.setPathToFile(pathToFileField.getText().trim());<NEW_LINE>configuration.setIndicator(indicatorField.isSelected());<NEW_LINE>configuration.setDeobfuscateStack(deobfuscateStackField.isSelected());<NEW_LINE>configuration.setAutomaticallyReloaded(autoReloadField.isSelected());<NEW_LINE>if (!maxHeapField.getText().trim().isEmpty()) {<NEW_LINE>configuration.setMaxHeap(Integer.parseInt(maxHeapField.getText()));<NEW_LINE>}<NEW_LINE>if (!portField.getText().trim().isEmpty()) {<NEW_LINE>configuration.setPort(Integer.parseInt(portField.getText()));<NEW_LINE>}<NEW_LINE>configuration.setProxyUrl(proxyUrlField.<MASK><NEW_LINE>configuration.setProxyPath(proxyPathField.getText().trim());<NEW_LINE>}
getText().trim());
870,051
public AttributedList<Path> list(final Path directory, final ListProgressListener listener) throws BackgroundException {<NEW_LINE>if (directory.isRoot()) {<NEW_LINE>final AttributedList<Path> list = new AttributedList<>();<NEW_LINE>list.add(DriveHomeFinderService.MYDRIVE_FOLDER);<NEW_LINE><MASK><NEW_LINE>list.add(DriveHomeFinderService.SHARED_DRIVES_NAME);<NEW_LINE>listener.chunk(directory, list);<NEW_LINE>return list;<NEW_LINE>} else {<NEW_LINE>if (DriveHomeFinderService.SHARED_FOLDER_NAME.equals(directory)) {<NEW_LINE>return new DriveSharedFolderListService(session, fileid).list(directory, listener);<NEW_LINE>}<NEW_LINE>if (DriveHomeFinderService.SHARED_DRIVES_NAME.equals(directory)) {<NEW_LINE>return new DriveTeamDrivesListService(session, fileid).list(directory, listener);<NEW_LINE>}<NEW_LINE>return new DriveDefaultListService(session, fileid).list(directory, listener);<NEW_LINE>}<NEW_LINE>}
list.add(DriveHomeFinderService.SHARED_FOLDER_NAME);
1,785,881
public void write(org.apache.thrift.protocol.TProtocol prot, revokeTablePermission_args struct) throws org.apache.thrift.TException {<NEW_LINE>org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;<NEW_LINE>java.util.BitSet optionals = new java.util.BitSet();<NEW_LINE>if (struct.isSetTinfo()) {<NEW_LINE>optionals.set(0);<NEW_LINE>}<NEW_LINE>if (struct.isSetCredentials()) {<NEW_LINE>optionals.set(1);<NEW_LINE>}<NEW_LINE>if (struct.isSetPrincipal()) {<NEW_LINE>optionals.set(2);<NEW_LINE>}<NEW_LINE>if (struct.isSetTableName()) {<NEW_LINE>optionals.set(3);<NEW_LINE>}<NEW_LINE>if (struct.isSetPermission()) {<NEW_LINE>optionals.set(4);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>if (struct.isSetTinfo()) {<NEW_LINE>struct.tinfo.write(oprot);<NEW_LINE>}<NEW_LINE>if (struct.isSetCredentials()) {<NEW_LINE>struct.credentials.write(oprot);<NEW_LINE>}<NEW_LINE>if (struct.isSetPrincipal()) {<NEW_LINE>oprot.writeString(struct.principal);<NEW_LINE>}<NEW_LINE>if (struct.isSetTableName()) {<NEW_LINE>oprot.writeString(struct.tableName);<NEW_LINE>}<NEW_LINE>if (struct.isSetPermission()) {<NEW_LINE>oprot.writeByte(struct.permission);<NEW_LINE>}<NEW_LINE>}
oprot.writeBitSet(optionals, 5);
1,207,042
public static void init(GameContainer container, StateBasedGame game) {<NEW_LINE>input = container.getInput();<NEW_LINE>int width = container.getWidth();<NEW_LINE>int height = container.getHeight();<NEW_LINE>// game settings<NEW_LINE>container.setTargetFrameRate(Options.getTargetFPS());<NEW_LINE>container.setVSync(Options.getTargetFPS() == 60);<NEW_LINE>container.setMusicVolume(Options.getMusicVolume() * Options.getMasterVolume());<NEW_LINE>container.setShowFPS(false);<NEW_LINE>container.getInput().enableKeyRepeat();<NEW_LINE>container.setAlwaysRender(true);<NEW_LINE>container.setUpdateOnlyWhenVisible(false);<NEW_LINE>// record OpenGL version<NEW_LINE>ErrorHandler.setGlString();<NEW_LINE>// calculate UI scale<NEW_LINE>GameImage.init(width, height);<NEW_LINE>// create fonts<NEW_LINE>try {<NEW_LINE>Fonts.init();<NEW_LINE>} catch (Exception e) {<NEW_LINE>ErrorHandler.error("Failed to load fonts.", e, true);<NEW_LINE>}<NEW_LINE>// load skin<NEW_LINE>Options.loadSkin();<NEW_LINE>// initialize game images<NEW_LINE>for (GameImage img : GameImage.values()) {<NEW_LINE>if (img.isPreload())<NEW_LINE>img.setDefaultImage();<NEW_LINE>}<NEW_LINE>// initialize game mods<NEW_LINE>GameMod.init(width, height);<NEW_LINE>// initialize playback buttons<NEW_LINE>PlaybackSpeed.init(width, height);<NEW_LINE>// initialize hit objects<NEW_LINE>HitObject.init(width, height);<NEW_LINE>// initialize download nodes<NEW_LINE>DownloadNode.init(width, height);<NEW_LINE>// initialize UI components<NEW_LINE>UI.init(container, game);<NEW_LINE>// build user list<NEW_LINE>UserList.create();<NEW_LINE>// initialize user button<NEW_LINE><MASK><NEW_LINE>// warn about software mode<NEW_LINE>if (((Container) container).isSoftwareMode()) {<NEW_LINE>UI.getNotificationManager().sendNotification("WARNING:\n" + "Running in OpenGL software mode.\n" + "You may experience severely degraded performance.\n\n" + "This can usually be resolved by updating your graphics drivers.", Color.red);<NEW_LINE>}<NEW_LINE>}
UserButton.init(width, height);
202,865
private // before it if applicable.<NEW_LINE>String buildDayOfWeek() {<NEW_LINE>Time t = new Time(mTimeZone);<NEW_LINE>t.set(mMilliTime);<NEW_LINE>long julianDay = Time.getJulianDay(mMilliTime, t.getGmtOffset());<NEW_LINE>String dayOfWeek;<NEW_LINE>mStringBuilder.setLength(0);<NEW_LINE>if (julianDay == mTodayJulianDay) {<NEW_LINE>dayOfWeek = mContext.getString(R.string.agenda_today, DateUtils.formatDateRange(mContext, mFormatter, mMilliTime, mMilliTime, DateUtils.FORMAT_SHOW_WEEKDAY, mTimeZone).toString());<NEW_LINE>} else if (julianDay == mTodayJulianDay - 1) {<NEW_LINE>dayOfWeek = mContext.getString(R.string.agenda_yesterday, DateUtils.formatDateRange(mContext, mFormatter, mMilliTime, mMilliTime, DateUtils.FORMAT_SHOW_WEEKDAY<MASK><NEW_LINE>} else if (julianDay == mTodayJulianDay + 1) {<NEW_LINE>dayOfWeek = mContext.getString(R.string.agenda_tomorrow, DateUtils.formatDateRange(mContext, mFormatter, mMilliTime, mMilliTime, DateUtils.FORMAT_SHOW_WEEKDAY, mTimeZone).toString());<NEW_LINE>} else {<NEW_LINE>dayOfWeek = DateUtils.formatDateRange(mContext, mFormatter, mMilliTime, mMilliTime, DateUtils.FORMAT_SHOW_WEEKDAY, mTimeZone).toString();<NEW_LINE>}<NEW_LINE>return dayOfWeek;<NEW_LINE>}
, mTimeZone).toString());
270,199
public <T> T doTask(final int hash, final Object key, final Task<T> task) {<NEW_LINE>boolean resize = task.hasOption(TaskOption.RESIZE);<NEW_LINE>if (task.hasOption(TaskOption.RESTRUCTURE_BEFORE)) {<NEW_LINE>restructureIfNecessary(resize);<NEW_LINE>}<NEW_LINE>if (task.hasOption(TaskOption.SKIP_IF_EMPTY) && this.count == 0) {<NEW_LINE>return task.execute(null, null, null);<NEW_LINE>}<NEW_LINE>lock();<NEW_LINE>try {<NEW_LINE>final int index = getIndex(hash, this.references);<NEW_LINE>final Reference<K, V> head = this.references[index];<NEW_LINE>Reference<K, V> reference = findInChain(head, key, hash);<NEW_LINE>Entry<K, V> entry = (reference != null ? reference.get() : null);<NEW_LINE>Entries entries = new Entries() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void add(V value) {<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>Entry<K, V> newEntry = new Entry<>((K) key, value);<NEW_LINE>Reference<K, V> newReference = Segment.this.referenceManager.createReference(newEntry, hash, head);<NEW_LINE>Segment.<MASK><NEW_LINE>Segment.this.count++;<NEW_LINE>}<NEW_LINE>};<NEW_LINE>return task.execute(reference, entry, entries);<NEW_LINE>} finally {<NEW_LINE>unlock();<NEW_LINE>if (task.hasOption(TaskOption.RESTRUCTURE_AFTER)) {<NEW_LINE>restructureIfNecessary(resize);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
this.references[index] = newReference;
1,077,068
public Request<UntagRoleRequest> marshall(UntagRoleRequest untagRoleRequest) {<NEW_LINE>if (untagRoleRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>Request<UntagRoleRequest> request = new DefaultRequest<UntagRoleRequest>(untagRoleRequest, "AmazonIdentityManagement");<NEW_LINE>request.addParameter("Action", "UntagRole");<NEW_LINE>request.addParameter("Version", "2010-05-08");<NEW_LINE><MASK><NEW_LINE>if (untagRoleRequest.getRoleName() != null) {<NEW_LINE>request.addParameter("RoleName", StringUtils.fromString(untagRoleRequest.getRoleName()));<NEW_LINE>}<NEW_LINE>if (!untagRoleRequest.getTagKeys().isEmpty() || !((com.amazonaws.internal.SdkInternalList<String>) untagRoleRequest.getTagKeys()).isAutoConstruct()) {<NEW_LINE>com.amazonaws.internal.SdkInternalList<String> tagKeysList = (com.amazonaws.internal.SdkInternalList<String>) untagRoleRequest.getTagKeys();<NEW_LINE>int tagKeysListIndex = 1;<NEW_LINE>for (String tagKeysListValue : tagKeysList) {<NEW_LINE>if (tagKeysListValue != null) {<NEW_LINE>request.addParameter("TagKeys.member." + tagKeysListIndex, StringUtils.fromString(tagKeysListValue));<NEW_LINE>}<NEW_LINE>tagKeysListIndex++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>}
request.setHttpMethod(HttpMethodName.POST);
850,830
public void addNewFontWizard() {<NEW_LINE>AddResourceDialog addResource = new AddResourceDialog(loadedResources, AddResourceDialog.FONT);<NEW_LINE>if (JOptionPane.OK_OPTION == JOptionPane.showConfirmDialog(mainPanel, addResource, "Add Font", JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE)) {<NEW_LINE>if (addResource.checkName(loadedResources)) {<NEW_LINE>JOptionPane.showMessageDialog(mainPanel, "A resource with that name already exists", "Add Font", JOptionPane.ERROR_MESSAGE);<NEW_LINE>addNewFontWizard();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// show the image editing dialog...<NEW_LINE>FontEditor font = new FontEditor(loadedResources, new EditorFont(com.codename1.ui.Font.createSystemFont(com.codename1.ui.Font.FACE_SYSTEM, com.codename1.ui.Font.STYLE_PLAIN, com.codename1.ui.Font.SIZE_MEDIUM), null, "Arial-plain-12", true, RenderingHints.VALUE_TEXT_ANTIALIAS_ON, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789.,;:!/\\*()[]{}|#$%^&<>?'\"+- "), addResource.getResourceName());<NEW_LINE>font.setFactoryCreation(true);<NEW_LINE>if (JOptionPane.OK_OPTION == JOptionPane.showConfirmDialog(mainPanel, font, "Add Font", JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE)) {<NEW_LINE>loadedResources.setFont(addResource.getResourceName(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
), font.createFont());
901,818
private static Function<ConfiguredAirbyteStream, WriteConfig> toWriteConfig(final NamingConventionTransformer namingResolver, final JsonNode config, final Instant now, final boolean schemaRequired) {<NEW_LINE>return stream -> {<NEW_LINE>Preconditions.checkNotNull(<MASK><NEW_LINE>final AirbyteStream abStream = stream.getStream();<NEW_LINE>final String defaultSchemaName = schemaRequired ? namingResolver.getIdentifier(config.get("schema").asText()) : namingResolver.getIdentifier(config.get("database").asText());<NEW_LINE>final String outputSchema = getOutputSchema(abStream, defaultSchemaName);<NEW_LINE>final String streamName = abStream.getName();<NEW_LINE>final String tableName = namingResolver.getRawTableName(streamName);<NEW_LINE>final String tmpTableName = namingResolver.getTmpTableName(streamName);<NEW_LINE>final DestinationSyncMode syncMode = stream.getDestinationSyncMode();<NEW_LINE>final WriteConfig writeConfig = new WriteConfig(streamName, abStream.getNamespace(), outputSchema, tmpTableName, tableName, syncMode);<NEW_LINE>LOGGER.info("Write config: {}", writeConfig);<NEW_LINE>return writeConfig;<NEW_LINE>};<NEW_LINE>}
stream.getDestinationSyncMode(), "Undefined destination sync mode");