idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
1,838,543 | private void appendStringify(Writer writer, HollowDataAccess dataAccess, String type, int ordinal, int indentation) throws IOException {<NEW_LINE>if (excludeObjectTypes.contains(type)) {<NEW_LINE>writer.append("null");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>HollowTypeDataAccess typeDataAccess = dataAccess.getTypeDataAccess(type);<NEW_LINE>if (typeDataAccess == null) {<NEW_LINE>writer.append("{ }");<NEW_LINE>} else if (ordinal == ORDINAL_NONE) {<NEW_LINE>writer.append("null");<NEW_LINE>} else {<NEW_LINE>if (typeDataAccess instanceof HollowObjectTypeDataAccess) {<NEW_LINE>appendObjectStringify(writer, dataAccess, (HollowObjectTypeDataAccess) typeDataAccess, ordinal, indentation);<NEW_LINE>} else if (typeDataAccess instanceof HollowListTypeDataAccess) {<NEW_LINE>appendListStringify(writer, dataAccess, (<MASK><NEW_LINE>} else if (typeDataAccess instanceof HollowSetTypeDataAccess) {<NEW_LINE>appendSetStringify(writer, dataAccess, (HollowSetTypeDataAccess) typeDataAccess, ordinal, indentation);<NEW_LINE>} else if (typeDataAccess instanceof HollowMapTypeDataAccess) {<NEW_LINE>appendMapStringify(writer, dataAccess, (HollowMapTypeDataAccess) typeDataAccess, ordinal, indentation);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | HollowListTypeDataAccess) typeDataAccess, ordinal, indentation); |
1,261,634 | private void initMaps(File homophoneOccurrenceFile) throws FileNotFoundException {<NEW_LINE>try (Scanner s = new Scanner(homophoneOccurrenceFile)) {<NEW_LINE>while (s.hasNextLine()) {<NEW_LINE>String line = s.nextLine();<NEW_LINE>String[] parts = line.split("\t");<NEW_LINE>if (parts.length != 3) {<NEW_LINE>throw new <MASK><NEW_LINE>}<NEW_LINE>long occurrenceCount = Integer.parseInt(parts[1]);<NEW_LINE>OccurrenceInfo occurrenceInfo = new OccurrenceInfo(parts[2], occurrenceCount);<NEW_LINE>List<OccurrenceInfo> list;<NEW_LINE>if (occurrenceInfos.containsKey(parts[0])) {<NEW_LINE>list = occurrenceInfos.get(parts[0]);<NEW_LINE>} else {<NEW_LINE>list = new ArrayList<>();<NEW_LINE>}<NEW_LINE>list.add(occurrenceInfo);<NEW_LINE>occurrenceInfos.put(parts[0], list);<NEW_LINE>ngramToOccurrence.put(parts[2], occurrenceCount);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | RuntimeException("Unexpected format: '" + line + "'"); |
270,697 | public static QueryAdvancedDomainListResponse unmarshall(QueryAdvancedDomainListResponse queryAdvancedDomainListResponse, UnmarshallerContext _ctx) {<NEW_LINE>queryAdvancedDomainListResponse.setRequestId(_ctx.stringValue("QueryAdvancedDomainListResponse.RequestId"));<NEW_LINE>queryAdvancedDomainListResponse.setTotalItemNum(_ctx.integerValue("QueryAdvancedDomainListResponse.TotalItemNum"));<NEW_LINE>queryAdvancedDomainListResponse.setCurrentPageNum(_ctx.integerValue("QueryAdvancedDomainListResponse.CurrentPageNum"));<NEW_LINE>queryAdvancedDomainListResponse.setTotalPageNum(_ctx.integerValue("QueryAdvancedDomainListResponse.TotalPageNum"));<NEW_LINE>queryAdvancedDomainListResponse.setPageSize(_ctx.integerValue("QueryAdvancedDomainListResponse.PageSize"));<NEW_LINE>queryAdvancedDomainListResponse.setPrePage(_ctx.booleanValue("QueryAdvancedDomainListResponse.PrePage"));<NEW_LINE>queryAdvancedDomainListResponse.setNextPage(_ctx.booleanValue("QueryAdvancedDomainListResponse.NextPage"));<NEW_LINE>List<Domain> data = new ArrayList<Domain>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("QueryAdvancedDomainListResponse.Data.Length"); i++) {<NEW_LINE>Domain domain = new Domain();<NEW_LINE>domain.setDomainName(_ctx.stringValue("QueryAdvancedDomainListResponse.Data[" + i + "].DomainName"));<NEW_LINE>domain.setInstanceId(_ctx.stringValue<MASK><NEW_LINE>domain.setExpirationDate(_ctx.stringValue("QueryAdvancedDomainListResponse.Data[" + i + "].ExpirationDate"));<NEW_LINE>domain.setRegistrationDate(_ctx.stringValue("QueryAdvancedDomainListResponse.Data[" + i + "].RegistrationDate"));<NEW_LINE>domain.setDomainType(_ctx.stringValue("QueryAdvancedDomainListResponse.Data[" + i + "].DomainType"));<NEW_LINE>domain.setDomainStatus(_ctx.stringValue("QueryAdvancedDomainListResponse.Data[" + i + "].DomainStatus"));<NEW_LINE>domain.setProductId(_ctx.stringValue("QueryAdvancedDomainListResponse.Data[" + i + "].ProductId"));<NEW_LINE>domain.setExpirationDateLong(_ctx.longValue("QueryAdvancedDomainListResponse.Data[" + i + "].ExpirationDateLong"));<NEW_LINE>domain.setRegistrationDateLong(_ctx.longValue("QueryAdvancedDomainListResponse.Data[" + i + "].RegistrationDateLong"));<NEW_LINE>domain.setPremium(_ctx.booleanValue("QueryAdvancedDomainListResponse.Data[" + i + "].Premium"));<NEW_LINE>domain.setDomainAuditStatus(_ctx.stringValue("QueryAdvancedDomainListResponse.Data[" + i + "].DomainAuditStatus"));<NEW_LINE>domain.setExpirationDateStatus(_ctx.stringValue("QueryAdvancedDomainListResponse.Data[" + i + "].ExpirationDateStatus"));<NEW_LINE>domain.setRegistrantType(_ctx.stringValue("QueryAdvancedDomainListResponse.Data[" + i + "].RegistrantType"));<NEW_LINE>domain.setDomainGroupId(_ctx.stringValue("QueryAdvancedDomainListResponse.Data[" + i + "].DomainGroupId"));<NEW_LINE>domain.setRemark(_ctx.stringValue("QueryAdvancedDomainListResponse.Data[" + i + "].Remark"));<NEW_LINE>domain.setDomainGroupName(_ctx.stringValue("QueryAdvancedDomainListResponse.Data[" + i + "].DomainGroupName"));<NEW_LINE>domain.setExpirationCurrDateDiff(_ctx.integerValue("QueryAdvancedDomainListResponse.Data[" + i + "].ExpirationCurrDateDiff"));<NEW_LINE>domain.setEmail(_ctx.stringValue("QueryAdvancedDomainListResponse.Data[" + i + "].Email"));<NEW_LINE>domain.setZhRegistrantOrganization(_ctx.stringValue("QueryAdvancedDomainListResponse.Data[" + i + "].ZhRegistrantOrganization"));<NEW_LINE>domain.setRegistrantOrganization(_ctx.stringValue("QueryAdvancedDomainListResponse.Data[" + i + "].RegistrantOrganization"));<NEW_LINE>List<String> dnsList = new ArrayList<String>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("QueryAdvancedDomainListResponse.Data[" + i + "].DnsList.Length"); j++) {<NEW_LINE>dnsList.add(_ctx.stringValue("QueryAdvancedDomainListResponse.Data[" + i + "].DnsList[" + j + "]"));<NEW_LINE>}<NEW_LINE>domain.setDnsList(dnsList);<NEW_LINE>data.add(domain);<NEW_LINE>}<NEW_LINE>queryAdvancedDomainListResponse.setData(data);<NEW_LINE>return queryAdvancedDomainListResponse;<NEW_LINE>} | ("QueryAdvancedDomainListResponse.Data[" + i + "].InstanceId")); |
546,455 | private void purgeSelectExprsKeepAliases() {<NEW_LINE>List<Token> sublist = findClause(TokenType.SELECT);<NEW_LINE>List<Token> newSelectClause = new ArrayList<Token>();<NEW_LINE>newSelectClause.add(sublist.get(0));<NEW_LINE>int itemStart = 1;<NEW_LINE>for (int i = 1; i < sublist.size(); i++) {<NEW_LINE>Token token = sublist.get(i);<NEW_LINE>if (((i + 1) == sublist.size()) || (sublist.get(i + 1).type == TokenType.COMMA)) {<NEW_LINE>if (token.type == TokenType.ID) {<NEW_LINE>newSelectClause.add(new Token(TokenType.ID, "0"));<NEW_LINE>newSelectClause.add(new Token<MASK><NEW_LINE>newSelectClause.add(token);<NEW_LINE>} else {<NEW_LINE>newSelectClause.addAll(sublist.subList(itemStart, i + 1));<NEW_LINE>}<NEW_LINE>itemStart = i + 2;<NEW_LINE>if ((i + 1) < sublist.size()) {<NEW_LINE>newSelectClause.add(new Token(TokenType.COMMA));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>sublist.clear();<NEW_LINE>sublist.addAll(newSelectClause);<NEW_LINE>} | (TokenType.ID, "AS")); |
1,636,307 | public void exitRedistribute_ospf_bgp_tail(Redistribute_ospf_bgp_tailContext ctx) {<NEW_LINE>BgpProcess proc = currentVrf().getBgpProcess();<NEW_LINE>// Intentional identity comparison<NEW_LINE>if (_currentPeerGroup == proc.getMasterBgpPeerGroup()) {<NEW_LINE>RoutingProtocol sourceProtocol = RoutingProtocol.OSPF;<NEW_LINE>BgpRedistributionPolicy r = new BgpRedistributionPolicy(sourceProtocol);<NEW_LINE>proc.getRedistributionPolicies().put(sourceProtocol, r);<NEW_LINE>if (ctx.metric != null) {<NEW_LINE>int metric = toInteger(ctx.metric);<NEW_LINE>r.setMetric(metric);<NEW_LINE>}<NEW_LINE>if (ctx.map != null) {<NEW_LINE>String map <MASK><NEW_LINE>r.setRouteMap(map);<NEW_LINE>_configuration.referenceStructure(ROUTE_MAP, map, BGP_REDISTRIBUTE_OSPF_MAP, ctx.map.getStart().getLine());<NEW_LINE>}<NEW_LINE>if (!ctx.MATCH().isEmpty()) {<NEW_LINE>Set<RoutingProtocol> protocols = new HashSet<>(ctx.ospf_route_type().size());<NEW_LINE>for (Ospf_route_typeContext ospf_route_typeContext : ctx.ospf_route_type()) {<NEW_LINE>protocols.addAll(toOspfRoutingProtocols(ospf_route_typeContext));<NEW_LINE>}<NEW_LINE>r.getSpecialAttributes().put(BgpRedistributionPolicy.OSPF_ROUTE_TYPES, new MatchProtocol(protocols));<NEW_LINE>}<NEW_LINE>if (ctx.procname != null) {<NEW_LINE>r.getSpecialAttributes().put(BgpRedistributionPolicy.OSPF_PROCESS_NUMBER, ctx.procname.getText());<NEW_LINE>}<NEW_LINE>} else if (_currentIpPeerGroup != null || _currentNamedPeerGroup != null) {<NEW_LINE>throw new BatfishException("do not currently handle per-neighbor redistribution policies");<NEW_LINE>}<NEW_LINE>} | = ctx.map.getText(); |
1,493,771 | public void marshall(ScheduledQueryRunSummary scheduledQueryRunSummary, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (scheduledQueryRunSummary == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(scheduledQueryRunSummary.getInvocationTime(), INVOCATIONTIME_BINDING);<NEW_LINE>protocolMarshaller.marshall(scheduledQueryRunSummary.getTriggerTime(), TRIGGERTIME_BINDING);<NEW_LINE>protocolMarshaller.marshall(scheduledQueryRunSummary.getRunStatus(), RUNSTATUS_BINDING);<NEW_LINE>protocolMarshaller.marshall(scheduledQueryRunSummary.getExecutionStats(), EXECUTIONSTATS_BINDING);<NEW_LINE>protocolMarshaller.marshall(scheduledQueryRunSummary.getErrorReportLocation(), ERRORREPORTLOCATION_BINDING);<NEW_LINE>protocolMarshaller.marshall(scheduledQueryRunSummary.getFailureReason(), FAILUREREASON_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + <MASK><NEW_LINE>}<NEW_LINE>} | e.getMessage(), e); |
1,543,781 | public void runMerge(HoodieTable<T, List<HoodieRecord<T>>, List<HoodieKey>, List<WriteStatus>> table, HoodieMergeHandle<T, List<HoodieRecord<T>>, List<HoodieKey>, List<WriteStatus>> upsertHandle) throws IOException {<NEW_LINE>final boolean externalSchemaTransformation = table.getConfig().shouldUseExternalSchemaTransformation();<NEW_LINE>Configuration cfgForHoodieFile = new Configuration(table.getHadoopConf());<NEW_LINE>HoodieMergeHandle<T, List<HoodieRecord<T>>, List<HoodieKey>, List<WriteStatus>> mergeHandle = upsertHandle;<NEW_LINE>HoodieBaseFile baseFile = mergeHandle.baseFileForMerge();<NEW_LINE>final GenericDatumWriter<GenericRecord> gWriter;<NEW_LINE>final GenericDatumReader<GenericRecord> gReader;<NEW_LINE>Schema readSchema;<NEW_LINE>if (externalSchemaTransformation || baseFile.getBootstrapBaseFile().isPresent()) {<NEW_LINE>readSchema = HoodieFileReaderFactory.getFileReader(table.getHadoopConf(), mergeHandle.getOldFilePath()).getSchema();<NEW_LINE>gWriter = new GenericDatumWriter<>(readSchema);<NEW_LINE>gReader = new GenericDatumReader<>(readSchema, mergeHandle.getWriterSchemaWithMetaFields());<NEW_LINE>} else {<NEW_LINE>gReader = null;<NEW_LINE>gWriter = null;<NEW_LINE>readSchema = mergeHandle.getWriterSchemaWithMetaFields();<NEW_LINE>}<NEW_LINE>BoundedInMemoryExecutor<GenericRecord, GenericRecord, Void> wrapper = null;<NEW_LINE>HoodieFileReader<GenericRecord> reader = HoodieFileReaderFactory.<GenericRecord>getFileReader(cfgForHoodieFile, mergeHandle.getOldFilePath());<NEW_LINE>try {<NEW_LINE>final Iterator<GenericRecord> readerIterator;<NEW_LINE>if (baseFile.getBootstrapBaseFile().isPresent()) {<NEW_LINE>readerIterator = getMergingIterator(table, mergeHandle, baseFile, reader, readSchema, externalSchemaTransformation);<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>ThreadLocal<BinaryEncoder> encoderCache = new ThreadLocal<>();<NEW_LINE>ThreadLocal<BinaryDecoder> decoderCache = new ThreadLocal<>();<NEW_LINE>wrapper = new BoundedInMemoryExecutor<>(table.getConfig().getWriteBufferLimitBytes(), new IteratorBasedQueueProducer<>(readerIterator), Option.of(new UpdateHandler(mergeHandle)), record -> {<NEW_LINE>if (!externalSchemaTransformation) {<NEW_LINE>return record;<NEW_LINE>}<NEW_LINE>return transformRecordBasedOnNewSchema(gReader, gWriter, encoderCache, decoderCache, (GenericRecord) record);<NEW_LINE>});<NEW_LINE>wrapper.execute();<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new HoodieException(e);<NEW_LINE>} finally {<NEW_LINE>// HUDI-2875: mergeHandle is not thread safe, we should totally terminate record inputting<NEW_LINE>// and executor firstly and then close mergeHandle.<NEW_LINE>if (reader != null) {<NEW_LINE>reader.close();<NEW_LINE>}<NEW_LINE>if (null != wrapper) {<NEW_LINE>wrapper.shutdownNow();<NEW_LINE>wrapper.awaitTermination();<NEW_LINE>}<NEW_LINE>mergeHandle.close();<NEW_LINE>}<NEW_LINE>} | readerIterator = reader.getRecordIterator(readSchema); |
583,803 | public void run() {<NEW_LINE>// check state and behave accordingly<NEW_LINE>if (createDataSource() && openDbConn()) {<NEW_LINE>do {<NEW_LINE>PreparedStatement pstmt = null;<NEW_LINE>ResultSet rs = null;<NEW_LINE>try {<NEW_LINE>long maxDBScn = getMaxTxlogSCN(_con);<NEW_LINE>_log.info("Max DB Scn = " + maxDBScn);<NEW_LINE>_dbStats.setMaxDBScn(maxDBScn);<NEW_LINE>for (OracleTriggerMonitoredSourceInfo source : _sources) {<NEW_LINE>String eventQuery = _monitorQueriesBySource.get(source.getSourceId());<NEW_LINE>pstmt = _con.prepareStatement(eventQuery);<NEW_LINE>pstmt.setFetchSize(10);<NEW_LINE>// get max scn - exactly one row;<NEW_LINE>rs = pstmt.executeQuery();<NEW_LINE>if (rs.next()) {<NEW_LINE>long maxScn = rs.getLong(1);<NEW_LINE>_log.info("Source: " + source.getSourceId() + " Max Scn=" + maxScn);<NEW_LINE>_dbStats.setSrcMaxScn(source.getSourceName(), maxScn);<NEW_LINE>}<NEW_LINE>DBHelper.commit(_con);<NEW_LINE>DBHelper.close(rs, pstmt, null);<NEW_LINE>if (_state != MonitorState.SHUT) {<NEW_LINE>Thread.sleep(PER_SRC_MAX_SCN_POLL_TIME);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (_state != MonitorState.SHUT) {<NEW_LINE>Thread.sleep(MAX_SCN_POLL_TIME);<NEW_LINE>}<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>_log.error("Exception trace", e);<NEW_LINE>shutDown();<NEW_LINE>} catch (SQLException e) {<NEW_LINE>try {<NEW_LINE>DBHelper.rollback(_con);<NEW_LINE>} catch (SQLException s) {<NEW_LINE>}<NEW_LINE>_log.error("Exception trace", e);<NEW_LINE>shutDown();<NEW_LINE>} finally {<NEW_LINE>DBHelper.<MASK><NEW_LINE>}<NEW_LINE>} while (_state != MonitorState.SHUT);<NEW_LINE>_log.info("Shutting down dbMonitor thread");<NEW_LINE>DBHelper.close(_con);<NEW_LINE>}<NEW_LINE>} | close(rs, pstmt, null); |
60,436 | private void hbCreateDecodeTables(int[] limit, int[] base, int[] perm, byte[] length, int minLen, int maxLen, int alphaSize) {<NEW_LINE>int i, j, vec;<NEW_LINE>int pp = 0;<NEW_LINE>for (i = minLen; i <= maxLen; i++) {<NEW_LINE>for (j = 0; j < alphaSize; j++) {<NEW_LINE>if ((length[j] & 0xFF) == i) {<NEW_LINE>perm[pp] = j;<NEW_LINE>pp++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (i = 0; i < MAX_CODE_LEN; i++) {<NEW_LINE>base[i] = 0;<NEW_LINE>}<NEW_LINE>for (i = 0; i < alphaSize; i++) {<NEW_LINE>base[(length[i<MASK><NEW_LINE>}<NEW_LINE>for (i = 1; i < MAX_CODE_LEN; i++) {<NEW_LINE>base[i] += base[i - 1];<NEW_LINE>}<NEW_LINE>for (i = 0; i < MAX_CODE_LEN; i++) {<NEW_LINE>limit[i] = 0;<NEW_LINE>}<NEW_LINE>vec = 0;<NEW_LINE>for (i = minLen; i <= maxLen; i++) {<NEW_LINE>vec += (base[i + 1] - base[i]);<NEW_LINE>limit[i] = vec - 1;<NEW_LINE>vec <<= 1;<NEW_LINE>}<NEW_LINE>for (i = minLen + 1; i <= maxLen; i++) {<NEW_LINE>base[i] = ((limit[i - 1] + 1) << 1) - base[i];<NEW_LINE>}<NEW_LINE>} | ] & 0xFF) + 1]++; |
908,885 | public void onCompletion(RecordMetadata md, Exception e) {<NEW_LINE>if (e != null) {<NEW_LINE>this.failedMessageCount.inc();<NEW_LINE>this.failedMessageMeter.mark();<NEW_LINE>LOGGER.error(e.getClass().getSimpleName() + " @ " + position + " -- " + topic + ": " + key);<NEW_LINE>LOGGER.<MASK><NEW_LINE>boolean nonFatal = e instanceof RecordTooLargeException || context.getConfig().ignoreProducerError;<NEW_LINE>if (nonFatal) {<NEW_LINE>if (this.fallbackTopic == null) {<NEW_LINE>cc.markCompleted();<NEW_LINE>} else {<NEW_LINE>publishFallback(md, e);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>context.terminate(e);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>this.succeededMessageCount.inc();<NEW_LINE>this.succeededMessageMeter.mark();<NEW_LINE>if (LOGGER.isDebugEnabled()) {<NEW_LINE>LOGGER.debug("-> key:{}, partition:{}, offset:{}\n" + " {}\n" + " {}\n", key, md.partition(), md.offset(), this.json, position);<NEW_LINE>}<NEW_LINE>cc.markCompleted();<NEW_LINE>}<NEW_LINE>} | error(e.getLocalizedMessage()); |
205,452 | private static void consumeOutput(final String bootstrapServers, final String schemaRegistryUrl) {<NEW_LINE>final Properties consumerProperties = new Properties();<NEW_LINE>consumerProperties.put(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, bootstrapServers);<NEW_LINE>consumerProperties.put(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class);<NEW_LINE>consumerProperties.put(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class);<NEW_LINE>consumerProperties.put(AbstractKafkaSchemaSerDeConfig.SCHEMA_REGISTRY_URL_CONFIG, schemaRegistryUrl);<NEW_LINE>consumerProperties.put(ConsumerConfig.GROUP_ID_CONFIG, "top-articles-lambda-example-consumer");<NEW_LINE>consumerProperties.put(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, "earliest");<NEW_LINE>final Deserializer<Windowed<String>> windowedDeserializer = WindowedSerdes.timeWindowedSerdeFrom(String.class, TopArticlesLambdaExample.windowSize.toMillis()).deserializer();<NEW_LINE>final KafkaConsumer<Windowed<String>, String> consumer = new KafkaConsumer<>(consumerProperties, windowedDeserializer, Serdes.<MASK><NEW_LINE>consumer.subscribe(Collections.singleton(TopArticlesLambdaExample.TOP_NEWS_PER_INDUSTRY_TOPIC));<NEW_LINE>while (true) {<NEW_LINE>final ConsumerRecords<Windowed<String>, String> consumerRecords = consumer.poll(Duration.ofMillis(Long.MAX_VALUE));<NEW_LINE>for (final ConsumerRecord<Windowed<String>, String> consumerRecord : consumerRecords) {<NEW_LINE>System.out.println(consumerRecord.key().key() + "@" + consumerRecord.key().window().start() + "=" + consumerRecord.value());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | String().deserializer()); |
95,630 | final GetAccessPointForObjectLambdaResult executeGetAccessPointForObjectLambda(GetAccessPointForObjectLambdaRequest getAccessPointForObjectLambdaRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getAccessPointForObjectLambdaRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetAccessPointForObjectLambdaRequest> request = null;<NEW_LINE>Response<GetAccessPointForObjectLambdaResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetAccessPointForObjectLambdaRequestMarshaller().marshall(super.beforeMarshalling(getAccessPointForObjectLambdaRequest));<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, "S3 Control");<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>URI endpointTraitHost = null;<NEW_LINE>if (!clientConfiguration.isDisableHostPrefixInjection()) {<NEW_LINE>ValidationUtils.assertStringNotEmpty(getAccessPointForObjectLambdaRequest.getAccountId(), "AccountId");<NEW_LINE>HostnameValidator.validateHostnameCompliant(getAccessPointForObjectLambdaRequest.getAccountId(), "AccountId", "getAccessPointForObjectLambdaRequest");<NEW_LINE>String hostPrefix = "{AccountId}.";<NEW_LINE>String resolvedHostPrefix = String.format("%s.", getAccessPointForObjectLambdaRequest.getAccountId());<NEW_LINE>endpointTraitHost = UriResourcePathUtils.updateUriHost(endpoint, resolvedHostPrefix);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<GetAccessPointForObjectLambdaResult> responseHandler = new com.amazonaws.services.s3control.internal.S3ControlStaxResponseHandler<GetAccessPointForObjectLambdaResult>(new GetAccessPointForObjectLambdaResultStaxUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext, null, endpointTraitHost);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetAccessPointForObjectLambda"); |
1,744,182 | public String resolve(String string, ClassLoader loader) {<NEW_LINE>Matcher matcher;<NEW_LINE>String parsed = string;<NEW_LINE>matcher = Pattern.compile<MASK><NEW_LINE>while (matcher.find()) {<NEW_LINE>String classname = matcher.group(1);<NEW_LINE>String fieldname = matcher.group(2);<NEW_LINE>try {<NEW_LINE>Object object = loader.loadClass(classname).getField(fieldname).get(null);<NEW_LINE>if (object != null) {<NEW_LINE>String value = object.toString();<NEW_LINE>parsed = parsed.replace(matcher.group(), value);<NEW_LINE>}<NEW_LINE>} catch (IllegalArgumentException e) {<NEW_LINE>ErrorManager.notifyDebug(StringUtils.format(ERROR_CANNOT_PARSE_PATTERN, matcher.group()), e);<NEW_LINE>} catch (SecurityException e) {<NEW_LINE>ErrorManager.notifyDebug(StringUtils.format(ERROR_CANNOT_PARSE_PATTERN, matcher.group()), e);<NEW_LINE>} catch (ClassNotFoundException e) {<NEW_LINE>ErrorManager.notifyDebug(StringUtils.format(ERROR_CANNOT_PARSE_PATTERN, matcher.group()), e);<NEW_LINE>} catch (IllegalAccessException e) {<NEW_LINE>ErrorManager.notifyDebug(StringUtils.format(ERROR_CANNOT_PARSE_PATTERN, matcher.group()), e);<NEW_LINE>} catch (NoSuchFieldException e) {<NEW_LINE>ErrorManager.notifyDebug(StringUtils.format(ERROR_CANNOT_PARSE_PATTERN, matcher.group()), e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return parsed;<NEW_LINE>} | ("(?<!\\\\)\\$F\\{((?:[a-zA-Z_][a-zA-Z_0-9]*\\.)+[a-zA-Z_][a-zA-Z_0-9]*)\\.([a-zA-Z_][a-zA-Z_0-9]*)\\}").matcher(parsed); |
1,151,717 | protected CompletableFuture<byte[]> doGetTargetVar(AddressSpace space, long offset, int size, boolean truncateAddressableUnit) {<NEW_LINE>if (space.isMemorySpace()) {<NEW_LINE>Address addr = space.getAddress(truncateOffset(space, offset));<NEW_LINE>AddressSet set = new AddressSet(addr, space.getAddress(offset + size - 1));<NEW_LINE>CompletableFuture<NavigableMap<Address, byte[]>> future = recorder.readMemoryBlocks(set, TaskMonitor.DUMMY, true);<NEW_LINE>return future.thenApply(map -> {<NEW_LINE>return knitFromResults(map, addr, size);<NEW_LINE>});<NEW_LINE>}<NEW_LINE>assert space.isRegisterSpace();<NEW_LINE>Language lang = recorder.getTrace().getBaseLanguage();<NEW_LINE>Register register = lang.getRegister(space, offset, size);<NEW_LINE>if (register == null) {<NEW_LINE>// TODO: Is this too restrictive?<NEW_LINE>throw new IllegalArgumentException("read from register space must be from one register");<NEW_LINE>}<NEW_LINE>Register baseRegister = register.getBaseRegister();<NEW_LINE>CompletableFuture<Map<Register, RegisterValue>> future = recorder.captureThreadRegisters(traceState.getThread(), traceState.getFrame(), Set.of(baseRegister));<NEW_LINE>return future.thenApply(map -> {<NEW_LINE>RegisterValue baseVal = map.get(baseRegister);<NEW_LINE>if (baseVal == null) {<NEW_LINE>return state.getVar(space, offset, size, truncateAddressableUnit);<NEW_LINE>}<NEW_LINE>BigInteger val = baseVal.<MASK><NEW_LINE>return Utils.bigIntegerToBytes(val, size, recorder.getTrace().getBaseLanguage().isBigEndian());<NEW_LINE>});<NEW_LINE>} | getRegisterValue(register).getUnsignedValue(); |
901,118 | private int processBlock128(byte[] in, int inOff, byte[] out, int outOff) {<NEW_LINE>int[] state = new int[4];<NEW_LINE>for (int i = 0; i < 4; i++) {<NEW_LINE>state[i] = bytes2int(in, inOff + (i * 4)) ^ kw[i];<NEW_LINE>}<NEW_LINE>camelliaF2(state, subkey, 0);<NEW_LINE>camelliaF2(state, subkey, 4);<NEW_LINE>camelliaF2(state, subkey, 8);<NEW_LINE>camelliaFLs(state, ke, 0);<NEW_LINE>camelliaF2(state, subkey, 12);<NEW_LINE>camelliaF2(state, subkey, 16);<NEW_LINE>camelliaF2(state, subkey, 20);<NEW_LINE><MASK><NEW_LINE>camelliaF2(state, subkey, 24);<NEW_LINE>camelliaF2(state, subkey, 28);<NEW_LINE>camelliaF2(state, subkey, 32);<NEW_LINE>state[2] ^= kw[4];<NEW_LINE>state[3] ^= kw[5];<NEW_LINE>state[0] ^= kw[6];<NEW_LINE>state[1] ^= kw[7];<NEW_LINE>int2bytes(state[2], out, outOff);<NEW_LINE>int2bytes(state[3], out, outOff + 4);<NEW_LINE>int2bytes(state[0], out, outOff + 8);<NEW_LINE>int2bytes(state[1], out, outOff + 12);<NEW_LINE>return BLOCK_SIZE;<NEW_LINE>} | camelliaFLs(state, ke, 4); |
1,224,598 | public void paint(Graphics g, JComponent c) {<NEW_LINE>JLabel label = (JLabel) c;<NEW_LINE>String text = label.getText();<NEW_LINE>Icon icon = label.isEnabled() ? label.getIcon() : label.getDisabledIcon();<NEW_LINE>if (icon == null && text == null)<NEW_LINE>return;<NEW_LINE>Graphics2D g2 = (Graphics2D) g;<NEW_LINE>AffineTransform transform = null;<NEW_LINE>if (rotation != ROTATE_0) {<NEW_LINE>transform = g2.getTransform();<NEW_LINE>g2.rotate(rotation);<NEW_LINE>if (rotation == ROTATE_90) {<NEW_LINE>g2.translate(0, -c.getWidth());<NEW_LINE>} else if (rotation == ROTATE_180) {<NEW_LINE>g2.translate(-c.getWidth(), -c.getHeight());<NEW_LINE>} else if (rotation == ROTATE_270) {<NEW_LINE>g2.translate(-c.getHeight(), 0);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>FontMetrics fm = g.getFontMetrics();<NEW_LINE>String clippedText = layout(label, fm, c.getWidth(), c.getHeight());<NEW_LINE>if (icon != null)<NEW_LINE>icon.paintIcon(c, g, paintIconR.x, paintIconR.y);<NEW_LINE>if (text != null) {<NEW_LINE>View v = (View) c.getClientProperty(BasicHTML.propertyKey);<NEW_LINE>if (v != null) {<NEW_LINE>v.paint(g, paintTextR);<NEW_LINE>} else {<NEW_LINE>int textX = paintTextR.x;<NEW_LINE>int textY = paintTextR.y + fm.getAscent();<NEW_LINE>if (label.isEnabled()) {<NEW_LINE>paintEnabledText(label, <MASK><NEW_LINE>} else {<NEW_LINE>paintDisabledText(label, g, clippedText, textX, textY);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (transform != null)<NEW_LINE>g2.setTransform(transform);<NEW_LINE>} | g, clippedText, textX, textY); |
921,975 | protected TaskResult run(GcsClient gcs, String projectId) {<NEW_LINE>Optional<String> command = params.getOptional("_command", String.class);<NEW_LINE>Optional<String> bucket = params.getOptional("bucket", String.class);<NEW_LINE>Optional<String> object = params.getOptional("object", String.class);<NEW_LINE>// ToDo implement timeout parameter. Please refer to s3_wait><NEW_LINE>if (command.isPresent() && (bucket.isPresent() || object.isPresent()) || !command.isPresent() && (!bucket.isPresent() || !object.isPresent())) {<NEW_LINE>throw new ConfigException("Either the gcs_wait operator command or both 'bucket' and 'object' parameters must be set");<NEW_LINE>}<NEW_LINE>if (command.isPresent()) {<NEW_LINE>Matcher m = URI_PATTERN.matcher(command.get());<NEW_LINE>if (!m.matches()) {<NEW_LINE>throw new ConfigException("Illegal GCS URI or path: " + command.get());<NEW_LINE>}<NEW_LINE>bucket = Optional.of(m.group("bucket"));<NEW_LINE>object = Optional.of(m.group("object"));<NEW_LINE>}<NEW_LINE>return await(gcs, bucket.get(<MASK><NEW_LINE>} | ), object.get()); |
3,620 | public void keyTyped(InstanceState state, KeyEvent e) {<NEW_LINE>final var c = e.getKeyChar();<NEW_LINE>final var val = Character.digit(e.getKeyChar(), 16);<NEW_LINE>final var data = (MemState) state.getData();<NEW_LINE>if (val >= 0) {<NEW_LINE>curValue = curValue * 16 + val;<NEW_LINE>data.getContents().set(data.getCursor(), curValue);<NEW_LINE>state.fireInvalidated();<NEW_LINE>} else if (c == ' ' || c == '\t') {<NEW_LINE>moveTo(data, <MASK><NEW_LINE>} else if (c == '\r' || c == '\n') {<NEW_LINE>moveTo(data, data.getCursor() + data.getNrOfLineItems());<NEW_LINE>} else if (c == '\u0008' || c == '\u007f') {<NEW_LINE>moveTo(data, data.getCursor() - 1);<NEW_LINE>} else if (c == 'R' || c == 'r') {<NEW_LINE>data.getContents().clear();<NEW_LINE>}<NEW_LINE>} | data.getCursor() + 1); |
476,550 | public void addFormForAddAccount() {<NEW_LINE>// this payment method is currently restricted to United States/USD<NEW_LINE>account.setSingleTradeCurrency(new FiatCurrency("USD"));<NEW_LINE>CountryUtil.findCountryByCode("US").ifPresent(c -> account.setCountry(c));<NEW_LINE>gridRowFrom = gridRow + 1;<NEW_LINE>InputTextField emailField = addInputTextField(gridPane, ++gridRow, Res.get("payment.email"));<NEW_LINE>emailField.setValidator(emailValidator);<NEW_LINE>emailField.textProperty().addListener((ov, oldValue, newValue) -> {<NEW_LINE>account.setEmail(newValue.trim());<NEW_LINE>updateFromInputs();<NEW_LINE>});<NEW_LINE>InputTextField holderNameField = addInputTextField(gridPane, ++gridRow, Res.get("payment.account.owner"));<NEW_LINE>holderNameField.setValidator(inputValidator);<NEW_LINE>holderNameField.textProperty().addListener((ov, oldValue, newValue) -> {<NEW_LINE>account.setHolderName(newValue.trim());<NEW_LINE>updateFromInputs();<NEW_LINE>});<NEW_LINE>String addressLabel = Res.get("payment.account.owner.address") + Res.get("payment.transferwiseUsd.address");<NEW_LINE>TextArea addressTextArea = addTopLabelTextArea(gridPane, ++<MASK><NEW_LINE>addressTextArea.setMinHeight(70);<NEW_LINE>addressTextArea.textProperty().addListener((ov, oldValue, newValue) -> {<NEW_LINE>account.setBeneficiaryAddress(newValue.trim());<NEW_LINE>updateFromInputs();<NEW_LINE>});<NEW_LINE>addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"), account.getSingleTradeCurrency().getNameAndCode());<NEW_LINE>addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.country"), account.getCountry().name);<NEW_LINE>addLimitations(false);<NEW_LINE>addAccountNameTextFieldWithAutoFillToggleButton();<NEW_LINE>} | gridRow, addressLabel, addressLabel).second; |
71,372 | public void loadOneRow() throws IOException {<NEW_LINE>Trip t = new Trip();<NEW_LINE>// offset line number by 1 to account for 0-based row index<NEW_LINE>t.sourceFileLine = row + 1;<NEW_LINE>t.route_id = getStringField("route_id", true);<NEW_LINE>t.service_id = getStringField("service_id", true);<NEW_LINE>t.trip_id = getStringField("trip_id", true);<NEW_LINE>t.trip_headsign = getStringField("trip_headsign", false);<NEW_LINE>t.trip_short_name = getStringField("trip_short_name", false);<NEW_LINE>t.direction_id = getIntField("direction_id", false, 0, 1);<NEW_LINE>// make a blocks multimap<NEW_LINE>t.<MASK><NEW_LINE>t.shape_id = getStringField("shape_id", false);<NEW_LINE>t.bikes_allowed = getIntField("bikes_allowed", false, 0, 2);<NEW_LINE>t.wheelchair_accessible = getIntField("wheelchair_accessible", false, 0, 2);<NEW_LINE>t.feed = feed;<NEW_LINE>t.feed_id = feed.feedId;<NEW_LINE>feed.trips.put(t.trip_id, t);<NEW_LINE>// TODO confirm existence of shape ID<NEW_LINE>getRefField("service_id", true, feed.services);<NEW_LINE>getRefField("route_id", true, feed.routes);<NEW_LINE>} | block_id = getStringField("block_id", false); |
296,658 | // Writes a .SF file with a digest to the manifest.<NEW_LINE>private static void writeSignatureFile(SignatureOutputStream out, Manifest manifest) throws IOException, GeneralSecurityException {<NEW_LINE>Manifest sf = new Manifest();<NEW_LINE>Attributes main = sf.getMainAttributes();<NEW_LINE>main.putValue("Signature-Version", "1.0");<NEW_LINE>main.putValue("Created-By", "1.0 (Android)");<NEW_LINE>Base64.Encoder base64 = Base64.getEncoder();<NEW_LINE>MessageDigest md = MessageDigest.getInstance(DIGEST_ALGORITHM);<NEW_LINE>PrintStream print = new PrintStream(new DigestOutputStream(new ByteArrayOutputStream(), md), true, "UTF-8");<NEW_LINE>// Digest of the entire manifest<NEW_LINE>manifest.write(print);<NEW_LINE>print.flush();<NEW_LINE>main.putValue(DIGEST_MANIFEST_ATTR, base64.encodeToString(md.digest()));<NEW_LINE>Map<String, Attributes> entries = manifest.getEntries();<NEW_LINE>for (Map.Entry<String, Attributes> entry : entries.entrySet()) {<NEW_LINE>// Digest of the manifest stanza for this entry.<NEW_LINE>print.print("Name: " + entry.getKey() + "\r\n");<NEW_LINE>for (Map.Entry<Object, Object> att : entry.getValue().entrySet()) {<NEW_LINE>print.print(att.getKey() + ": " + <MASK><NEW_LINE>}<NEW_LINE>print.print("\r\n");<NEW_LINE>print.flush();<NEW_LINE>Attributes sfAttr = new Attributes();<NEW_LINE>sfAttr.putValue(DIGEST_ATTR, base64.encodeToString(md.digest()));<NEW_LINE>sf.getEntries().put(entry.getKey(), sfAttr);<NEW_LINE>}<NEW_LINE>sf.write(out);<NEW_LINE>// A bug in the java.util.jar implementation of Android platforms<NEW_LINE>// up to version 1.6 will cause a spurious IOException to be thrown<NEW_LINE>// if the length of the signature file is a multiple of 1024 bytes.<NEW_LINE>// As a workaround, add an extra CRLF in this case.<NEW_LINE>if ((out.size() % 1024) == 0) {<NEW_LINE>out.write('\r');<NEW_LINE>out.write('\n');<NEW_LINE>}<NEW_LINE>} | att.getValue() + "\r\n"); |
997,283 | public int compare(T o1, T o2) {<NEW_LINE>Matcher m1 = parts.matcher(converter.apply(o1));<NEW_LINE>Matcher m2 = parts.matcher<MASK><NEW_LINE>while (m1.find() && m2.find()) {<NEW_LINE>int compareCharGroup = m1.group(ALPHA_PART).compareTo(m2.group(ALPHA_PART));<NEW_LINE>if (compareCharGroup != 0) {<NEW_LINE>return compareCharGroup;<NEW_LINE>}<NEW_LINE>String numberPart1 = m1.group(NUM_PART);<NEW_LINE>String numberPart2 = m2.group(NUM_PART);<NEW_LINE>if (numberPart1.isEmpty() || numberPart2.isEmpty()) {<NEW_LINE>return compareOneEmptyPart(numberPart1, numberPart2);<NEW_LINE>}<NEW_LINE>String nonZeroNumberPart1 = trimLeadingZeroes(numberPart1);<NEW_LINE>String nonZeroNumberPart2 = trimLeadingZeroes(numberPart2);<NEW_LINE>int lengthNumber1 = nonZeroNumberPart1.length();<NEW_LINE>int lengthNumber2 = nonZeroNumberPart2.length();<NEW_LINE>if (lengthNumber1 != lengthNumber2) {<NEW_LINE>if (lengthNumber1 < lengthNumber2) {<NEW_LINE>return -1;<NEW_LINE>}<NEW_LINE>return 1;<NEW_LINE>}<NEW_LINE>int compareNumber = nonZeroNumberPart1.compareTo(nonZeroNumberPart2);<NEW_LINE>if (compareNumber != 0) {<NEW_LINE>return compareNumber;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (m1.hitEnd() && m2.hitEnd()) {<NEW_LINE>return 0;<NEW_LINE>}<NEW_LINE>if (m1.hitEnd()) {<NEW_LINE>return -1;<NEW_LINE>}<NEW_LINE>return 1;<NEW_LINE>} | (converter.apply(o2)); |
1,817,485 | private static Response prepareRamIndex(Request request, CheckedBiFunction<QueryShardContext, LeafReaderContext, Response, IOException> handler, IndexService indexService) throws IOException {<NEW_LINE>Analyzer defaultAnalyzer = indexService.getIndexAnalyzers().getDefaultIndexAnalyzer();<NEW_LINE>try (Directory directory = new ByteBuffersDirectory()) {<NEW_LINE>try (IndexWriter indexWriter = new IndexWriter(directory, new IndexWriterConfig(defaultAnalyzer))) {<NEW_LINE>String index = indexService.index().getName();<NEW_LINE>BytesReference document = request.contextSetup.document;<NEW_LINE>XContentType xContentType = request.contextSetup.xContentType;<NEW_LINE>SourceToParse sourceToParse = new SourceToParse(index, "_id", document, xContentType);<NEW_LINE>ParsedDocument parsedDocument = indexService.mapperService().documentMapper().parse(sourceToParse);<NEW_LINE>indexWriter.addDocuments(parsedDocument.docs());<NEW_LINE>try (IndexReader indexReader = DirectoryReader.open(indexWriter)) {<NEW_LINE>final IndexSearcher searcher = new IndexSearcher(indexReader);<NEW_LINE>searcher.setQueryCache(null);<NEW_LINE>final long absoluteStartMillis = System.currentTimeMillis();<NEW_LINE>QueryShardContext context = indexService.newQueryShardContext(0, searcher, () -> absoluteStartMillis, null);<NEW_LINE>return handler.apply(context, indexReader.leaves<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ().get(0)); |
22,941 | public static void colorizeGradient(GrayS16 derivX, GrayS16 derivY, int maxAbsValue, Bitmap output, @Nullable DogArray_I8 _storage) {<NEW_LINE>shapeShape(derivX, derivY, output);<NEW_LINE>_storage = ConvertBitmap.resizeStorage(output, _storage);<NEW_LINE>final byte[] storage = _storage.data;<NEW_LINE>if (maxAbsValue < 0) {<NEW_LINE>maxAbsValue = ImageStatistics.maxAbs(derivX);<NEW_LINE>maxAbsValue = Math.max(maxAbsValue, ImageStatistics.maxAbs(derivY));<NEW_LINE>}<NEW_LINE>if (maxAbsValue == 0)<NEW_LINE>return;<NEW_LINE>int indexDst = 0;<NEW_LINE>for (int y = 0; y < derivX.height; y++) {<NEW_LINE>int indexX = derivX.startIndex + y * derivX.stride;<NEW_LINE>int indexY = derivY.startIndex + y * derivY.stride;<NEW_LINE>for (int x = 0; x < derivX.width; x++) {<NEW_LINE>int valueX = derivX.data[indexX++];<NEW_LINE>int valueY = derivY.data[indexY++];<NEW_LINE>int r = 0, g = 0, b = 0;<NEW_LINE>if (valueX > 0) {<NEW_LINE>r = 255 * valueX / maxAbsValue;<NEW_LINE>} else {<NEW_LINE>g = -255 * valueX / maxAbsValue;<NEW_LINE>}<NEW_LINE>if (valueY > 0) {<NEW_LINE>b = 255 * valueY / maxAbsValue;<NEW_LINE>} else {<NEW_LINE>int <MASK><NEW_LINE>r += v;<NEW_LINE>g += v;<NEW_LINE>if (r > 255)<NEW_LINE>r = 255;<NEW_LINE>if (g > 255)<NEW_LINE>g = 255;<NEW_LINE>}<NEW_LINE>storage[indexDst++] = (byte) r;<NEW_LINE>storage[indexDst++] = (byte) g;<NEW_LINE>storage[indexDst++] = (byte) b;<NEW_LINE>storage[indexDst++] = (byte) 0xFF;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>output.copyPixelsFromBuffer(ByteBuffer.wrap(storage));<NEW_LINE>} | v = -255 * valueY / maxAbsValue; |
1,543,078 | default byte[] writeBatch(BufferAllocator bufferAllocator, List<Map<String, Object>> rows) {<NEW_LINE>try (final VectorSchemaRoot root = VectorSchemaRoot.create(schemaFor(rows), bufferAllocator);<NEW_LINE>final ByteArrayOutputStream out = new ByteArrayOutputStream();<NEW_LINE>final ArrowWriter writer = newArrowWriter(root, out)) {<NEW_LINE>AtomicInteger counter = new AtomicInteger();<NEW_LINE>root.allocateNew();<NEW_LINE>rows.forEach(row -> {<NEW_LINE>final int index = counter.getAndIncrement();<NEW_LINE>root.getFieldVectors().forEach(fe -> {<NEW_LINE>Object value = convertValue(row.get<MASK><NEW_LINE>write(index, value, fe);<NEW_LINE>});<NEW_LINE>});<NEW_LINE>root.setRowCount(counter.get());<NEW_LINE>writer.writeBatch();<NEW_LINE>root.clear();<NEW_LINE>return out.toByteArray();<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>} | (fe.getName())); |
972,626 | final DescribeReservedNodesResult executeDescribeReservedNodes(DescribeReservedNodesRequest describeReservedNodesRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeReservedNodesRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeReservedNodesRequest> request = null;<NEW_LINE>Response<DescribeReservedNodesResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeReservedNodesRequestMarshaller().marshall(super.beforeMarshalling(describeReservedNodesRequest));<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, "Redshift");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeReservedNodes");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<DescribeReservedNodesResult> responseHandler = new StaxResponseHandler<DescribeReservedNodesResult>(new DescribeReservedNodesResultStaxUnmarshaller());<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(); |
166,071 | public static void registerMBeanCatchAndLogExceptions(final Object mbean, final String objectName) {<NEW_LINE>final MBeanServer server = ManagementFactory.getPlatformMBeanServer();<NEW_LINE>try {<NEW_LINE>final ObjectName on = new ObjectName(objectName);<NEW_LINE>try {<NEW_LINE>// throws exception if bean doesn't exist<NEW_LINE>server.getMBeanInfo(on);<NEW_LINE>server.unregisterMBean(on);<NEW_LINE>} catch (final InstanceNotFoundException e) {<NEW_LINE>// if the bean wasn't already there.<NEW_LINE>}<NEW_LINE>server.registerMBean(mbean, on);<NEW_LINE>} catch (InstanceAlreadyExistsException e) {<NEW_LINE>// The bean was registered concurrently; log a warning, but don't fail tests<NEW_LINE>log.warn("Failed to register mbean for name {}", UnsafeArg.of<MASK><NEW_LINE>} catch (Exception e) {<NEW_LINE>log.warn("Unexpected exception registering mbean for name {}", UnsafeArg.of("name", objectName), e);<NEW_LINE>}<NEW_LINE>} | ("name", objectName), e); |
392,342 | public Object readFrom(Class<Object> clazz, Type genericType, Annotation[] anns, MediaType mt, MultivaluedMap<String, String> headers, InputStream entityStream) throws IOException, WebApplicationException {<NEW_LINE>MultipartReader reader = new MultipartReader();<NEW_LINE>reader.workers = providers;<NEW_LINE>MultipartInput multiInput = reader.readFrom(MultipartInput.class, genericType, <MASK><NEW_LINE>if (clazz.equals(IMultipartBody.class)) {<NEW_LINE>return new IMultipartBodyImpl((MultipartInputImpl) multiInput);<NEW_LINE>}<NEW_LINE>if (Collection.class.isAssignableFrom(clazz)) {<NEW_LINE>if (genericType instanceof ParameterizedType && ((ParameterizedType) genericType).getActualTypeArguments()[0].getTypeName().equals(IAttachment.class.getName())) {<NEW_LINE>List<IAttachment> attachments = new ArrayList<>();<NEW_LINE>for (InputPart inputPart : multiInput.getParts()) {<NEW_LINE>attachments.add(new IAttachmentImpl(inputPart));<NEW_LINE>}<NEW_LINE>return attachments;<NEW_LINE>}<NEW_LINE>if (genericType instanceof ParameterizedType && ((ParameterizedType) genericType).getActualTypeArguments()[0].getTypeName().equals(String.class.getName())) {<NEW_LINE>List<String> parts = new ArrayList<>();<NEW_LINE>for (InputPart inputPart : multiInput.getParts()) {<NEW_LINE>parts.add(inputPart.getBodyAsString());<NEW_LINE>}<NEW_LINE>return parts;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>String genericTypeStr = genericType == null ? "null" : genericType.getTypeName();<NEW_LINE>throw new InternalServerErrorException("Unexpected multipart type: " + clazz.getName() + " / " + genericTypeStr);<NEW_LINE>} | anns, mt, headers, entityStream); |
793,799 | public static void chekAndRegisterCommands(DocumentServiceContext context) {<NEW_LINE><MASK><NEW_LINE>LSClientLogger clientLogger = LSClientLogger.getInstance(serverContext);<NEW_LINE>ServerCapabilities serverCapabilities = serverContext.get(ServerCapabilities.class);<NEW_LINE>if (serverCapabilities.getExecuteCommandProvider() == null) {<NEW_LINE>clientLogger.logTrace("Not registering commands: server isn't a execute commands provider");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (!isDynamicCommandRegistrationSupported(serverContext)) {<NEW_LINE>clientLogger.logTrace("Not registering commands: client doesn't support dynamic commands registration");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Optional<PackageCompilation> compilation = context.workspace().waitAndGetPackageCompilation(context.filePath());<NEW_LINE>if (compilation.isEmpty()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>CodeActionManager codeActionManager = compilation.get().getCodeActionManager();<NEW_LINE>Set<String> commands = codeActionManager.getPossibleProviderNames();<NEW_LINE>Set<String> supportedCommands = new HashSet<>(serverCapabilities.getExecuteCommandProvider().getCommands());<NEW_LINE>boolean shouldReRegister = commands.stream().anyMatch(command -> !supportedCommands.contains(command));<NEW_LINE>if (shouldReRegister) {<NEW_LINE>clientLogger.logTrace("Registering new commands");<NEW_LINE>supportedCommands.addAll(commands);<NEW_LINE>unregisterCommands(serverContext);<NEW_LINE>registerCommands(serverContext, new ArrayList<>(supportedCommands));<NEW_LINE>}<NEW_LINE>} | LanguageServerContext serverContext = context.languageServercontext(); |
403,407 | final DeleteReplicationInstanceResult executeDeleteReplicationInstance(DeleteReplicationInstanceRequest deleteReplicationInstanceRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteReplicationInstanceRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteReplicationInstanceRequest> request = null;<NEW_LINE>Response<DeleteReplicationInstanceResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteReplicationInstanceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteReplicationInstanceRequest));<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, "Database Migration Service");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteReplicationInstance");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteReplicationInstanceResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteReplicationInstanceResultJsonUnmarshaller());<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()); |
819,519 | public boolean apply(Game game, Ability source) {<NEW_LINE>Card sourceCard = game.getCard(source.getSourceId());<NEW_LINE>Player controller = game.<MASK><NEW_LINE>if (controller == null || sourceCard == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>Set<String> names = new HashSet<>();<NEW_LINE>while (controller.canRespond() && controller.getLibrary().hasCards()) {<NEW_LINE>Card card = controller.getLibrary().getFromTop(game);<NEW_LINE>if (card != null) {<NEW_LINE>// the card move is sequential, not all at once.<NEW_LINE>controller.moveCards(card, Zone.EXILED, source, game);<NEW_LINE>// Laelia, the Blade Reforged<NEW_LINE>game.getState().processAction(game);<NEW_LINE>// Checks if there was already exiled a card with the same name<NEW_LINE>if (names.contains(card.getName())) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>names.add(card.getName());<NEW_LINE>if (controller.chooseUse(outcome, "Put " + card.getName() + " into your hand?", source, game)) {<NEW_LINE>// Adds the current card to hand if it is chosen.<NEW_LINE>controller.moveCards(card, Zone.HAND, source, game);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | getPlayer(source.getControllerId()); |
252,095 | private void rewriteAllInComment(final String text, final int offset, final String originalName) {<NEW_LINE>for (int index = text.indexOf(originalName); index != -1; index = text.indexOf(originalName, index + 1)) {<NEW_LINE>if (index > 0 && Character.isJavaIdentifierPart(text.charAt(index - 1))) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if ((index + originalName.length() < text.length()) && Character.isJavaIdentifierPart(text.charAt(index + originalName.length()))) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>// at least do not rename html start and end tags.<NEW_LINE>if (text.charAt(index - 1) == '<' || text.charAt(index - 1) == '/') {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>workingCopy.rewriteInComment(offset + index, <MASK><NEW_LINE>}<NEW_LINE>} | originalName.length(), newName); |
1,780,942 | public static void main(String[] args) throws Exception {<NEW_LINE>CommandLine commandLine = parseCommandLine(args);<NEW_LINE>String zookeeper = commandLine.getOptionValue(ZOOKEEPER);<NEW_LINE>String topic = commandLine.getOptionValue(TOPIC);<NEW_LINE>int num_messages = Integer.parseInt(commandLine.getOptionValue(NUM_MESSAGES));<NEW_LINE>Properties properties = OperatorUtil.createKafkaConsumerProperties(zookeeper, "operator_action_commandline", SecurityProtocol.PLAINTEXT, null);<NEW_LINE>KafkaConsumer<byte[], byte[]> consumer = new KafkaConsumer<>(properties);<NEW_LINE>TopicPartition operatorReportTopicPartition <MASK><NEW_LINE>List<TopicPartition> tps = new ArrayList<>();<NEW_LINE>tps.add(operatorReportTopicPartition);<NEW_LINE>consumer.assign(tps);<NEW_LINE>Map<TopicPartition, Long> beginOffsets = consumer.beginningOffsets(tps);<NEW_LINE>Map<TopicPartition, Long> endOffsets = consumer.endOffsets(tps);<NEW_LINE>for (TopicPartition tp : endOffsets.keySet()) {<NEW_LINE>long numMessages = endOffsets.get(tp) - beginOffsets.get(tp);<NEW_LINE>LOG.info("{} : offsets [{}, {}], num messages : {}", tp, beginOffsets.get(tp), endOffsets.get(tp), numMessages);<NEW_LINE>consumer.seek(tp, Math.max(beginOffsets.get(tp), endOffsets.get(tp) - num_messages));<NEW_LINE>}<NEW_LINE>ConsumerRecords<byte[], byte[]> records = consumer.poll(100);<NEW_LINE>List<ConsumerRecord<byte[], byte[]>> recordList = new ArrayList<>();<NEW_LINE>while (!records.isEmpty()) {<NEW_LINE>for (ConsumerRecord<byte[], byte[]> record : records) {<NEW_LINE>recordList.add(record);<NEW_LINE>}<NEW_LINE>for (ConsumerRecord<byte[], byte[]> record : Lists.reverse(recordList)) {<NEW_LINE>try {<NEW_LINE>BinaryDecoder binaryDecoder = avroDecoderFactory.binaryDecoder(record.value(), null);<NEW_LINE>SpecificDatumReader<OperatorAction> reader = new SpecificDatumReader<>(operatorActionSchema);<NEW_LINE>OperatorAction result = new OperatorAction();<NEW_LINE>reader.read(result, binaryDecoder);<NEW_LINE>Date date = new Date(result.getTimestamp());<NEW_LINE>System.out.println(date.toString() + " : " + result);<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOG.info("Fail to decode an message", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>records = consumer.poll(100);<NEW_LINE>}<NEW_LINE>consumer.close();<NEW_LINE>} | = new TopicPartition(topic, 0); |
866,714 | static OpcUaClientConfigBuilder copy(OpcUaClientConfig config) {<NEW_LINE>OpcUaClientConfigBuilder builder = new OpcUaClientConfigBuilder();<NEW_LINE>// UaStackClientConfig values<NEW_LINE>builder.setEndpoint(config.getEndpoint());<NEW_LINE>config.getKeyPair().ifPresent(builder::setKeyPair);<NEW_LINE>config.getCertificate().ifPresent(builder::setCertificate);<NEW_LINE>config.getCertificateChain().ifPresent(builder::setCertificateChain);<NEW_LINE>builder.setApplicationName(config.getApplicationName());<NEW_LINE>builder.setApplicationUri(config.getApplicationUri());<NEW_LINE>builder.setProductUri(config.getProductUri());<NEW_LINE>builder.setEncodingLimits(config.getEncodingLimits());<NEW_LINE>builder.setChannelLifetime(config.getChannelLifetime());<NEW_LINE>builder.setExecutor(config.getExecutor());<NEW_LINE>builder.setScheduledExecutor(config.getScheduledExecutor());<NEW_LINE>builder.setEventLoop(config.getEventLoop());<NEW_LINE>builder.setWheelTimer(config.getWheelTimer());<NEW_LINE>builder.setConnectTimeout(config.getConnectTimeout());<NEW_LINE>builder.setAcknowledgeTimeout(config.getAcknowledgeTimeout());<NEW_LINE>builder.setRequestTimeout(config.getRequestTimeout());<NEW_LINE>// OpcUaClientConfig values<NEW_LINE>builder.<MASK><NEW_LINE>builder.setSessionTimeout(config.getSessionTimeout());<NEW_LINE>builder.setRequestTimeout(config.getRequestTimeout());<NEW_LINE>builder.setMaxResponseMessageSize(config.getMaxResponseMessageSize());<NEW_LINE>builder.setMaxPendingPublishRequests(config.getMaxPendingPublishRequests());<NEW_LINE>builder.setIdentityProvider(config.getIdentityProvider());<NEW_LINE>builder.setKeepAliveFailuresAllowed(config.getKeepAliveFailuresAllowed());<NEW_LINE>builder.setKeepAliveInterval(config.getKeepAliveInterval());<NEW_LINE>builder.setKeepAliveTimeout(config.getKeepAliveTimeout());<NEW_LINE>builder.setSessionLocaleIds(config.getSessionLocaleIds());<NEW_LINE>return builder;<NEW_LINE>} | setSessionName(config.getSessionName()); |
1,605,594 | private void decompressBlock() throws IOException {<NEW_LINE>// The first term is kept uncompressed, so no need to decompress block if only<NEW_LINE>// look up the first term when doing seek block.<NEW_LINE>term.length = bytes.readVInt();<NEW_LINE>bytes.readBytes(term.bytes, 0, term.length);<NEW_LINE>long offset = bytes.getFilePointer();<NEW_LINE>if (offset < entry.termsDataLength - 1) {<NEW_LINE>// Avoid decompress again if we are reading a same block.<NEW_LINE>if (currentCompressedBlockStart != offset) {<NEW_LINE>int decompressLength = bytes.readVInt();<NEW_LINE>// Decompress the remaining of current block<NEW_LINE>LZ4.decompress(EndiannessReverserUtil.wrapDataInput(bytes), <MASK><NEW_LINE>currentCompressedBlockStart = offset;<NEW_LINE>currentCompressedBlockEnd = bytes.getFilePointer();<NEW_LINE>} else {<NEW_LINE>// Skip decompression but need to re-seek to block end.<NEW_LINE>bytes.seek(currentCompressedBlockEnd);<NEW_LINE>}<NEW_LINE>// Reset the buffer.<NEW_LINE>blockInput = new ByteArrayDataInput(blockBuffer.bytes, 0, blockBuffer.length);<NEW_LINE>}<NEW_LINE>} | decompressLength, blockBuffer.bytes, 0); |
921,415 | private static InsnNode convertStringBuilderChain(MethodNode mth, InvokeNode toStrInsn, List<InsnNode> chain) {<NEW_LINE>try {<NEW_LINE>int chainSize = chain.size();<NEW_LINE>if (chainSize < 2) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>List<InsnArg> args = new ArrayList<>(chainSize);<NEW_LINE>InsnNode firstInsn = chain.get(0);<NEW_LINE>if (firstInsn.getType() != InsnType.CONSTRUCTOR) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>ConstructorInsn constrInsn = (ConstructorInsn) firstInsn;<NEW_LINE>if (constrInsn.getArgsCount() == 1) {<NEW_LINE>ArgType argType = constrInsn.getCallMth().getArgumentsTypes().get(0);<NEW_LINE>if (!argType.isObject()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>args.add(constrInsn.getArg(0));<NEW_LINE>}<NEW_LINE>for (int i = 1; i < chainSize; i++) {<NEW_LINE>InsnNode chainInsn = chain.get(i);<NEW_LINE>InsnArg arg = getArgFromAppend(chainInsn);<NEW_LINE>if (arg == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>args.add(arg);<NEW_LINE>}<NEW_LINE>boolean stringArgFound = false;<NEW_LINE>for (InsnArg arg : args) {<NEW_LINE>if (arg.getType().equals(ArgType.STRING)) {<NEW_LINE>stringArgFound = true;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!stringArgFound) {<NEW_LINE>mth.addDebugComment("TODO: convert one arg to string using `String.valueOf()`, args: " + args);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>// all check passed<NEW_LINE>removeStringBuilderInsns(mth, toStrInsn, chain);<NEW_LINE>List<InsnArg> dupArgs = Utils.collectionMap(args, InsnArg::duplicate);<NEW_LINE>List<InsnArg> simplifiedArgs = concatConstArgs(dupArgs);<NEW_LINE>InsnNode concatInsn = new <MASK><NEW_LINE>concatInsn.setResult(toStrInsn.getResult());<NEW_LINE>concatInsn.add(AFlag.SYNTHETIC);<NEW_LINE>concatInsn.copyAttributesFrom(toStrInsn);<NEW_LINE>concatInsn.remove(AFlag.DONT_GENERATE);<NEW_LINE>concatInsn.remove(AFlag.REMOVE);<NEW_LINE>checkResult(mth, concatInsn);<NEW_LINE>return concatInsn;<NEW_LINE>} catch (Exception e) {<NEW_LINE>mth.addWarnComment("String concatenation convert failed", e);<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | InsnNode(InsnType.STR_CONCAT, simplifiedArgs); |
1,431,407 | public void validate(final String name, final String value) throws ParameterException {<NEW_LINE>// Make sure the value is a valid URI<NEW_LINE>final URI uri;<NEW_LINE>try {<NEW_LINE>uri = new URI(value);<NEW_LINE>} catch (URISyntaxException e) {<NEW_LINE>throw new ParameterException("Invalid URI " + value + " (for option: " + name + ")", e);<NEW_LINE>}<NEW_LINE>// If it's a file, make sure it exists, it's a file, it's readable, etc.<NEW_LINE>if (uri.getScheme().equals("file")) {<NEW_LINE>final Path path = Paths.<MASK><NEW_LINE>if (!Files.exists(path)) {<NEW_LINE>throw new ParameterException("File " + value + " does not exist (for option: " + name + ")");<NEW_LINE>} else if (!Files.isRegularFile(path)) {<NEW_LINE>throw new ParameterException("File " + value + " is not a file (for option: " + name + ")");<NEW_LINE>} else if (!Files.isReadable(path)) {<NEW_LINE>throw new ParameterException("File " + value + " is not readable (for option: " + name + ")");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | get(uri.getPath()); |
654,993 | private boolean updateNotebookStatus(String resourceId, Map<String, Object> updateObject) {<NEW_LINE>Notebook notebook = notebookService.select(resourceId);<NEW_LINE>if (notebook == null) {<NEW_LINE>throw new SubmarineRuntimeException(Status.NOT_FOUND.getStatusCode(), String.format("cannot find notebook with id:%s", resourceId));<NEW_LINE>}<NEW_LINE>if (updateObject.containsKey("status")) {<NEW_LINE>notebook.setStatus(updateObject.get("status").toString());<NEW_LINE>}<NEW_LINE>if (updateObject.get("createTime") != null) {<NEW_LINE>notebook.setCreatedTime(updateObject.get("createTime").toString());<NEW_LINE>}<NEW_LINE>if (updateObject.get("deletedTime") != null) {<NEW_LINE>notebook.setDeletedTime(updateObject.get<MASK><NEW_LINE>}<NEW_LINE>if (updateObject.get("name") != null) {<NEW_LINE>notebook.setName(updateObject.get("name").toString());<NEW_LINE>;<NEW_LINE>}<NEW_LINE>if (updateObject.get("reason") != null) {<NEW_LINE>notebook.setReason(updateObject.get("reason").toString());<NEW_LINE>}<NEW_LINE>if (updateObject.get("url") != null) {<NEW_LINE>notebook.setUrl(updateObject.get("url").toString());<NEW_LINE>}<NEW_LINE>return notebookService.update(notebook);<NEW_LINE>} | ("deletedTime").toString()); |
91,513 | public static <K extends Kernel2D> SteerableKernel<K> gaussian(Class<K> kernelType, int orderX, int orderY, double sigma, int radius) {<NEW_LINE>if (orderX < 0 || orderX > 4)<NEW_LINE>throw new IllegalArgumentException("derivX must be from 0 to 4 inclusive.");<NEW_LINE>if (orderY < 0 || orderY > 4)<NEW_LINE>throw new IllegalArgumentException("derivT must be from 0 to 4 inclusive.");<NEW_LINE>int order = orderX + orderY;<NEW_LINE>if (order > 4) {<NEW_LINE>throw new IllegalArgumentException("The total order of x and y can't be greater than 4");<NEW_LINE>}<NEW_LINE>int maxOrder = Math.max(orderX, orderY);<NEW_LINE>if (sigma <= 0)<NEW_LINE>sigma = (float) FactoryKernelGaussian.sigmaForRadius(radius, maxOrder);<NEW_LINE>else if (radius <= 0)<NEW_LINE>radius = FactoryKernelGaussian.radiusForSigma(sigma, maxOrder);<NEW_LINE>Class kernel1DType = FactoryKernel.get1DType(kernelType);<NEW_LINE>Kernel1D kerX = FactoryKernelGaussian.derivativeK(kernel1DType, orderX, sigma, radius);<NEW_LINE>Kernel1D kerY = FactoryKernelGaussian.derivativeK(kernel1DType, orderY, sigma, radius);<NEW_LINE>Kernel2D kernel = <MASK><NEW_LINE>Kernel2D[] basis = new Kernel2D[order + 1];<NEW_LINE>// convert it into an image which can be rotated<NEW_LINE>ImageGray image = GKernelMath.convertToImage(kernel);<NEW_LINE>ImageGray imageRotated = (ImageGray) image.createNew(image.width, image.height);<NEW_LINE>basis[0] = kernel;<NEW_LINE>// form the basis by created rotated versions of the kernel<NEW_LINE>double angleStep = Math.PI / basis.length;<NEW_LINE>for (int index = 1; index <= order; index++) {<NEW_LINE>float angle = (float) (angleStep * index);<NEW_LINE>GImageMiscOps.fill(imageRotated, 0);<NEW_LINE>new FDistort(image, imageRotated).rotate(angle).apply();<NEW_LINE>basis[index] = GKernelMath.convertToKernel(imageRotated);<NEW_LINE>}<NEW_LINE>SteerableKernel<K> ret;<NEW_LINE>if (kernelType == Kernel2D_F32.class)<NEW_LINE>ret = (SteerableKernel<K>) new SteerableKernel_F32();<NEW_LINE>else<NEW_LINE>ret = (SteerableKernel<K>) new SteerableKernel_I32();<NEW_LINE>ret.setBasis(FactorySteerCoefficients.polynomial(order), basis);<NEW_LINE>return ret;<NEW_LINE>} | GKernelMath.convolve(kerY, kerX); |
917,661 | private static void testSpringMvcDefaultValuesJavaPrimitiveAllTransport(RestTemplate template) {<NEW_LINE>String microserviceName = "jaxrs";<NEW_LINE>for (String transport : DemoConst.transports) {<NEW_LINE>CategorizedTestCaseRunner.changeTransport(microserviceName, transport);<NEW_LINE>String cseUrlPrefix = "cse://" + microserviceName + "/JaxRSDefaultValues/";<NEW_LINE>HttpHeaders headers = new HttpHeaders();<NEW_LINE>headers.setContentType(org.springframework.http.MediaType.APPLICATION_FORM_URLENCODED);<NEW_LINE>MultiValueMap<String, String> map = new LinkedMultiValueMap<>();<NEW_LINE>HttpEntity<MultiValueMap<String, String>> request = new HttpEntity<>(map, headers);<NEW_LINE>// default values with primitive<NEW_LINE>String result = template.postForObject(cseUrlPrefix + "/javaprimitiveint", request, String.class);<NEW_LINE>TestMgr.check("Hello 0bobo", result);<NEW_LINE>result = template.postForObject(cseUrlPrefix + "/javaprimitivenumber", request, String.class);<NEW_LINE>TestMgr.check("Hello 0.0false", result);<NEW_LINE>result = template.postForObject(cseUrlPrefix + "/javaprimitivestr", request, String.class);<NEW_LINE><MASK><NEW_LINE>result = template.postForObject(cseUrlPrefix + "/javaprimitivecomb", request, String.class);<NEW_LINE>TestMgr.check("Hello nullnull", result);<NEW_LINE>result = template.postForObject(cseUrlPrefix + "/allprimitivetypes", null, String.class);<NEW_LINE>TestMgr.check("Hello false,\0,0,0,0,0,0.0,0.0,null", result);<NEW_LINE>}<NEW_LINE>} | TestMgr.check("Hello", result); |
1,034,479 | public Response submitJob(List<Job> jobs) {<NEW_LINE>Response response;<NEW_LINE>try {<NEW_LINE>response = superSubmitJob(jobs);<NEW_LINE>} catch (JobSubmitProtectException e) {<NEW_LINE>response = new Response();<NEW_LINE>response.setSuccess(false);<NEW_LINE>response.setFailedJobs(jobs);<NEW_LINE>response.setCode(ResponseCode.SUBMIT_TOO_BUSY_AND_SAVE_FOR_LATER);<NEW_LINE>response.setMsg(<MASK><NEW_LINE>}<NEW_LINE>if (!response.isSuccess()) {<NEW_LINE>try {<NEW_LINE>for (Job job : response.getFailedJobs()) {<NEW_LINE>jobRetryScheduler.inSchedule(job.getTaskId(), job);<NEW_LINE>stat.incFailStoreNum();<NEW_LINE>}<NEW_LINE>response.setSuccess(true);<NEW_LINE>response.setCode(ResponseCode.SUBMIT_FAILED_AND_SAVE_FOR_LATER);<NEW_LINE>response.setMsg(response.getMsg() + ", save local fail store and send later !");<NEW_LINE>LOGGER.warn(JSON.toJSONString(response));<NEW_LINE>} catch (Exception e) {<NEW_LINE>response.setSuccess(false);<NEW_LINE>response.setMsg(e.getMessage());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return response;<NEW_LINE>} | response.getMsg() + ", submit too busy"); |
661,826 | public void mulligan(Game game, UUID playerId) {<NEW_LINE>Player player = game.getPlayer(playerId);<NEW_LINE>int numCards = player.getHand().size();<NEW_LINE>int numToMulliganTo = numCards;<NEW_LINE>player.getLibrary().addAll(player.getHand().getCards(game), game);<NEW_LINE>player.getHand().clear();<NEW_LINE>player.shuffleLibrary(null, game);<NEW_LINE>if (usedMulligans != null) {<NEW_LINE>String mulliganCode = "7";<NEW_LINE>if (usedMulligans.containsKey(player.getId())) {<NEW_LINE>mulliganCode = usedMulligans.<MASK><NEW_LINE>}<NEW_LINE>numToMulliganTo = getNextMulliganNum(mulliganCode);<NEW_LINE>usedMulligans.put(player.getId(), getNextMulligan(mulliganCode));<NEW_LINE>}<NEW_LINE>game.fireInformEvent(new StringBuilder(player.getLogName()).append(" mulligans to ").append(numToMulliganTo).append(numToMulliganTo == 1 ? " card" : " cards").toString());<NEW_LINE>player.drawCards(numToMulliganTo, null, game);<NEW_LINE>} | get(player.getId()); |
710,447 | private static String stringValue(final Object arg) {<NEW_LINE>if (arg instanceof NativeFunction) {<NEW_LINE>// Don't return the string value of the function, because it's usually<NEW_LINE>// multiple lines of content and messes up the log.<NEW_LINE>final String name = StringUtils.defaultIfEmpty(((NativeFunction) arg).getFunctionName(), "anonymous");<NEW_LINE>return "[function " + name + "]";<NEW_LINE>} else if (arg instanceof IdFunctionObject) {<NEW_LINE>return "[function " + ((IdFunctionObject) arg).getFunctionName() + "]";<NEW_LINE>} else if (arg instanceof Function) {<NEW_LINE>return "[function anonymous]";<NEW_LINE>}<NEW_LINE>String asString;<NEW_LINE>try {<NEW_LINE>// try to get the js representation<NEW_LINE>asString = Context.toString(arg);<NEW_LINE>if (arg instanceof Event) {<NEW_LINE>asString += "<" + ((Event) arg).getType() + ">";<NEW_LINE>}<NEW_LINE>} catch (final Throwable e) {<NEW_LINE>// seems to be a bug (many bugs) in rhino (TODO: investigate it)<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>return asString;<NEW_LINE>} | asString = String.valueOf(arg); |
1,094,645 | protected JFreeChart createPie3DChart() throws JRException {<NEW_LINE>JFreeChart jfreeChart = super.createPie3DChart();<NEW_LINE>PiePlot3D piePlot3D = (PiePlot3D) jfreeChart.getPlot();<NEW_LINE>JRPie3DPlot jrPiePlot = (JRPie3DPlot) getPlot();<NEW_LINE>boolean isShowLabels = jrPiePlot.getShowLabels() == null ? true : jrPiePlot.getShowLabels();<NEW_LINE>if (isShowLabels && piePlot3D.getLabelGenerator() != null) {<NEW_LINE><MASK><NEW_LINE>piePlot3D.setLabelShadowPaint(ChartThemesConstants.TRANSPARENT_PAINT);<NEW_LINE>piePlot3D.setLabelOutlinePaint(ChartThemesConstants.TRANSPARENT_PAINT);<NEW_LINE>}<NEW_LINE>piePlot3D.setDarkerSides(true);<NEW_LINE>piePlot3D.setDepthFactor(0.1);<NEW_LINE>// does not work for 3D<NEW_LINE>// piePlot3D.setShadowXOffset(5);<NEW_LINE>// piePlot3D.setShadowYOffset(10);<NEW_LINE>// piePlot3D.setShadowPaint(new GradientPaint(<NEW_LINE>// 0,<NEW_LINE>// getChart().getHeight() / 2,<NEW_LINE>// new Color(41, 120, 162),<NEW_LINE>// 0,<NEW_LINE>// getChart().getHeight(),<NEW_LINE>// Color.white)<NEW_LINE>// );<NEW_LINE>PieDataset pieDataset = piePlot3D.getDataset();<NEW_LINE>if (pieDataset != null) {<NEW_LINE>for (int i = 0; i < pieDataset.getItemCount(); i++) {<NEW_LINE>piePlot3D.setSectionOutlinePaint(pieDataset.getKey(i), ChartThemesConstants.TRANSPARENT_PAINT);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>piePlot3D.setCircular(true);<NEW_LINE>return jfreeChart;<NEW_LINE>} | piePlot3D.setLabelBackgroundPaint(ChartThemesConstants.TRANSPARENT_PAINT); |
553,367 | private void addCovariantMethods(ClassNode classNode, List declaredMethods, Map abstractMethods, Map methodsToAdd, Map oldGenericsSpec) {<NEW_LINE>ClassNode sn = classNode.getUnresolvedSuperClass(false);<NEW_LINE>if (sn != null) {<NEW_LINE>Map genericsSpec = createGenericsSpec(sn, oldGenericsSpec);<NEW_LINE>List<MethodNode<MASK><NEW_LINE>// original class causing bridge methods for methods in super class<NEW_LINE>storeMissingCovariantMethods(declaredMethods, methodsToAdd, genericsSpec, classMethods);<NEW_LINE>// super class causing bridge methods for abstract methods in original class<NEW_LINE>if (!abstractMethods.isEmpty()) {<NEW_LINE>for (Object classMethod : classMethods) {<NEW_LINE>MethodNode method = (MethodNode) classMethod;<NEW_LINE>if (method.isStatic())<NEW_LINE>continue;<NEW_LINE>storeMissingCovariantMethods(abstractMethods.values(), method, methodsToAdd, Collections.EMPTY_MAP, true);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>addCovariantMethods(sn.redirect(), declaredMethods, abstractMethods, methodsToAdd, genericsSpec);<NEW_LINE>}<NEW_LINE>ClassNode[] interfaces = classNode.getInterfaces();<NEW_LINE>for (ClassNode anInterface : interfaces) {<NEW_LINE>List interfacesMethods = anInterface.getMethods();<NEW_LINE>Map genericsSpec = createGenericsSpec(anInterface, oldGenericsSpec);<NEW_LINE>storeMissingCovariantMethods(declaredMethods, methodsToAdd, genericsSpec, interfacesMethods);<NEW_LINE>addCovariantMethods(anInterface, declaredMethods, abstractMethods, methodsToAdd, genericsSpec);<NEW_LINE>}<NEW_LINE>} | > classMethods = sn.getMethods(); |
395,487 | final DescribeConfigurationResult executeDescribeConfiguration(DescribeConfigurationRequest describeConfigurationRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeConfigurationRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeConfigurationRequest> request = null;<NEW_LINE>Response<DescribeConfigurationResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeConfigurationRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeConfigurationRequest));<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, "mq");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeConfiguration");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeConfigurationResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeConfigurationResultJsonUnmarshaller());<NEW_LINE>response = <MASK><NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | invoke(request, responseHandler, executionContext); |
678,556 | public ReportSettings prepareReportSettings(StockMove stockMove, String format) throws AxelorException {<NEW_LINE>if (stockMove.getPrintingSettings() == null) {<NEW_LINE>throw new AxelorException(TraceBackRepository.CATEGORY_MISSING_FIELD, String.format(I18n.get(IExceptionMessage.STOCK_MOVES_MISSING_PRINTING_SETTINGS), stockMove.getStockMoveSeq()), stockMove);<NEW_LINE>}<NEW_LINE>String locale = ReportSettings.getPrintingLocale(stockMove.getPartner());<NEW_LINE>String title = getFileName(stockMove);<NEW_LINE>AppBase appBase = appBaseService.getAppBase();<NEW_LINE>ReportSettings reportSetting = ReportFactory.createReport(<MASK><NEW_LINE>return reportSetting.addParam("StockMoveId", stockMove.getId()).addParam("Timezone", stockMove.getCompany() != null ? stockMove.getCompany().getTimezone() : null).addParam("Locale", locale).addParam("GroupProducts", appBase.getIsRegroupProductsOnPrintings() && stockMove.getGroupProductsOnPrintings()).addParam("GroupProductTypes", appBase.getRegroupProductsTypeSelect()).addParam("GroupProductLevel", appBase.getRegroupProductsLevelSelect()).addParam("GroupProductProductTitle", appBase.getRegroupProductsLabelProducts()).addParam("GroupProductServiceTitle", appBase.getRegroupProductsLabelServices()).addParam("HeaderHeight", stockMove.getPrintingSettings().getPdfHeaderHeight()).addParam("FooterHeight", stockMove.getPrintingSettings().getPdfFooterHeight()).addFormat(format);<NEW_LINE>} | IReport.STOCK_MOVE, title + " - ${date}"); |
206,848 | @Secured(action = ActionTypes.WRITE)<NEW_LINE>public ResponseEntity update(HttpServletRequest request) throws NacosException {<NEW_LINE>String healthyString = WebUtils.optional(request, HEALTHY_KEY, StringUtils.EMPTY);<NEW_LINE>if (StringUtils.isBlank(healthyString)) {<NEW_LINE>healthyString = WebUtils.optional(request, VALID_KEY, StringUtils.EMPTY);<NEW_LINE>}<NEW_LINE>if (StringUtils.isBlank(healthyString)) {<NEW_LINE>throw new IllegalArgumentException("Param 'healthy' is required.");<NEW_LINE>}<NEW_LINE>boolean <MASK><NEW_LINE>String serviceName = WebUtils.required(request, CommonParams.SERVICE_NAME);<NEW_LINE>String namespaceId = WebUtils.optional(request, CommonParams.NAMESPACE_ID, Constants.DEFAULT_NAMESPACE_ID);<NEW_LINE>String clusterName = WebUtils.optional(request, CommonParams.CLUSTER_NAME, UtilsAndCommons.DEFAULT_CLUSTER_NAME);<NEW_LINE>String ip = WebUtils.required(request, IP_KEY);<NEW_LINE>int port = Integer.parseInt(WebUtils.required(request, PORT_KEY));<NEW_LINE>getHealthOperator().updateHealthStatusForPersistentInstance(namespaceId, serviceName, clusterName, ip, port, health);<NEW_LINE>return ResponseEntity.ok("ok");<NEW_LINE>} | health = ConvertUtils.toBoolean(healthyString); |
1,652,804 | public static void arcPrint(final RasterPlotter matrix, final int cx, final int cy, final int radius, final double angle, final String message, final int intensity) {<NEW_LINE>final int x = cx + (int) ((radius + 1) * Math.cos<MASK><NEW_LINE>final int y = cy - (int) ((radius + 1) * Math.sin(RasterPlotter.PI180 * angle));<NEW_LINE>int yp = y + 3;<NEW_LINE>if ((angle > arcDist) && (angle < 180 - arcDist))<NEW_LINE>yp = y;<NEW_LINE>if ((angle > 180 + arcDist) && (angle < 360 - arcDist))<NEW_LINE>yp = y + 6;<NEW_LINE>if ((angle > (90 - arcDist)) && (angle < (90 + arcDist)))<NEW_LINE>yp -= 6;<NEW_LINE>if ((angle > (270 - arcDist)) && (angle < (270 + arcDist)))<NEW_LINE>yp += 6;<NEW_LINE>int xp = x - 3 * message.length();<NEW_LINE>if ((angle > (90 + arcDist)) && (angle < (270 - arcDist)))<NEW_LINE>xp = x - 6 * message.length();<NEW_LINE>if ((angle < (90 - arcDist)) || (angle > (270 + arcDist)))<NEW_LINE>xp = x;<NEW_LINE>print(matrix, xp, yp, 0, message, -1, intensity);<NEW_LINE>} | (RasterPlotter.PI180 * angle)); |
749,410 | private <T> Future<List<InetSocketAddress>> resolveAddresses(Request request, ProxyServer proxy, NettyResponseFuture<T> future, AsyncHandler<T> asyncHandler) {<NEW_LINE>Uri uri = request.getUri();<NEW_LINE>final Promise<List<InetSocketAddress>> promise = ImmediateEventExecutor.INSTANCE.newPromise();<NEW_LINE>if (proxy != null && !proxy.isIgnoredForHost(uri.getHost()) && proxy.getProxyType().isHttp()) {<NEW_LINE>int port = uri.isSecured() ? proxy.getSecuredPort() : proxy.getPort();<NEW_LINE>InetSocketAddress unresolvedRemoteAddress = InetSocketAddress.createUnresolved(proxy.getHost(), port);<NEW_LINE>scheduleRequestTimeout(future, unresolvedRemoteAddress);<NEW_LINE>return RequestHostnameResolver.INSTANCE.resolve(request.getNameResolver(), unresolvedRemoteAddress, asyncHandler);<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>InetSocketAddress unresolvedRemoteAddress = InetSocketAddress.createUnresolved(uri.getHost(), port);<NEW_LINE>scheduleRequestTimeout(future, unresolvedRemoteAddress);<NEW_LINE>if (request.getAddress() != null) {<NEW_LINE>// bypass resolution<NEW_LINE>InetSocketAddress inetSocketAddress = new InetSocketAddress(request.getAddress(), port);<NEW_LINE>return promise.setSuccess(singletonList(inetSocketAddress));<NEW_LINE>} else {<NEW_LINE>return RequestHostnameResolver.INSTANCE.resolve(request.getNameResolver(), unresolvedRemoteAddress, asyncHandler);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | int port = uri.getExplicitPort(); |
1,074,354 | public void draw(DrawHandler drawHandler, LifelineDrawingInfo drawingInfo, int lifelineLastTick) {<NEW_LINE>// draw Head with text<NEW_LINE>if (createdOnStart) {<NEW_LINE>drawHead(drawHandler, drawingInfo.getHorizontalStart(), drawingInfo.getVerticalHeadStart(), drawingInfo.getWidth(), drawingInfo.getHeadHeight());<NEW_LINE>} else // check if the creation tick was set, while writing a diagram it can be possible that the message that<NEW_LINE>// creates this head wasn't yet written<NEW_LINE>if (created != null) {<NEW_LINE>drawHead(drawHandler, drawingInfo.getSymmetricHorizontalStart(created), drawingInfo.getVerticalStart(created), drawingInfo.getSymmetricWidth(created), drawingInfo.getTickHeight(created));<NEW_LINE>}<NEW_LINE>// without an starting point we can not draw anything<NEW_LINE>if (createdOnStart || created != null) {<NEW_LINE>// draw lifeline occurrences<NEW_LINE>for (Map.Entry<Integer, LifelineOccurrence> e : lifeline.entrySet()) {<NEW_LINE>int tick = e.getKey();<NEW_LINE>PointDouble topLeftOccurence = new PointDouble(drawingInfo.getSymmetricHorizontalStart(tick)<MASK><NEW_LINE>PointDouble sizeOccurence = new PointDouble(drawingInfo.getSymmetricWidth(tick), drawingInfo.getTickHeight(tick));<NEW_LINE>Line1D llInterruption = e.getValue().draw(drawHandler, topLeftOccurence, sizeOccurence);<NEW_LINE>if (llInterruption != null) {<NEW_LINE>drawingInfo.addInterruptedArea(llInterruption);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// draw actual lifeline (horizontal line)<NEW_LINE>drawLifeline(drawHandler, drawingInfo, lifelineLastTick);<NEW_LINE>}<NEW_LINE>} | , drawingInfo.getVerticalStart(tick)); |
386,784 | public ProjectEntity patchProjectsId(ProjectsIdBody body, Integer id) throws ApiException {<NEW_LINE>Object localVarPostBody = body;<NEW_LINE>// verify the required parameter 'body' is set<NEW_LINE>if (body == null) {<NEW_LINE>throw new ApiException(400, "Missing the required parameter 'body' when calling patchProjectsId");<NEW_LINE>}<NEW_LINE>// verify the required parameter 'id' is set<NEW_LINE>if (id == null) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/projects/{id}".replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));<NEW_LINE>// query params<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>final String[] localVarAccepts = { "application/json" };<NEW_LINE>final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>final String[] localVarContentTypes = { "application/json" };<NEW_LINE>final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>String[] localVarAuthNames = new String[] {};<NEW_LINE>GenericType<ProjectEntity> localVarReturnType = new GenericType<ProjectEntity>() {<NEW_LINE>};<NEW_LINE>return apiClient.invokeAPI(localVarPath, "PATCH", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);<NEW_LINE>} | throw new ApiException(400, "Missing the required parameter 'id' when calling patchProjectsId"); |
351,117 | public void start(@NonNull final Properties ctx, @NonNull final IReplicationProcessor replicationProcessor, final String trxName) throws Exception {<NEW_LINE>getLogger(Level.INFO).addLog("Starting {} ({})", replicationProcessor, replicationProcessor.getMImportProcessor());<NEW_LINE>final I_IMP_Processor impProcessor = replicationProcessor.getMImportProcessor();<NEW_LINE>final List<I_IMP_ProcessorParameter> processorParameters = Services.get(IIMPProcessorDAO.class).retrieveParameters(impProcessor, trxName);<NEW_LINE>final String host = impProcessor.getHost();<NEW_LINE>final int port = impProcessor.getPort();<NEW_LINE>final String account = impProcessor.getAccount();<NEW_LINE>final String password = impProcessor.getPasswordInfo();<NEW_LINE>// mandatory parameters!<NEW_LINE>String queueName = StringUtils.EMPTY;<NEW_LINE>String consumerTag = StringUtils.EMPTY;<NEW_LINE>String exchangeName = StringUtils.EMPTY;<NEW_LINE>boolean isDurableQueue = true;<NEW_LINE>for (final I_IMP_ProcessorParameter processorParameter : processorParameters) {<NEW_LINE>final String parameterName = processorParameter.getValue();<NEW_LINE>getLogger(Level.DEBUG).addLog("Parameters: {} = {}", parameterName, processorParameter.getParameterValue());<NEW_LINE>if (parameterName.equals(PARAM_QUEUE_NAME)) {<NEW_LINE>queueName = processorParameter.getParameterValue();<NEW_LINE>} else if (parameterName.equals(PARAM_CONSUMER_TAG)) {<NEW_LINE>consumerTag = processorParameter.getParameterValue();<NEW_LINE>} else if (parameterName.equals(PARAM_EXCHANGE_NAME)) {<NEW_LINE>exchangeName = processorParameter.getParameterValue();<NEW_LINE>} else if (parameterName.equals(PARAM_IS_DURABLE_QUEUE)) {<NEW_LINE>isDurableQueue = Boolean.parseBoolean(processorParameter.getParameterValue());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (StringUtils.isEmpty(queueName)) {<NEW_LINE>throw new AdempiereException(MessageFormat.format("Missing {0} with key {1}!", I_IMP_ProcessorParameter.Table_Name, PARAM_QUEUE_NAME)).appendParametersToMessage().setParameter("IMP_Processor_ID", impProcessor.getIMP_Processor_ID());<NEW_LINE>}<NEW_LINE>if (StringUtils.isEmpty(exchangeName)) {<NEW_LINE>throw new AdempiereException(MessageFormat.format("Missing {0} with key {1}!", I_IMP_ProcessorParameter.Table_Name, PARAM_EXCHANGE_NAME)).appendParametersToMessage().setParameter(<MASK><NEW_LINE>}<NEW_LINE>if (StringUtils.isEmpty(consumerTag)) {<NEW_LINE>throw new AdempiereException(MessageFormat.format("Missing {0} with key {1}!", I_IMP_ProcessorParameter.Table_Name, PARAM_CONSUMER_TAG)).appendParametersToMessage().setParameter("IMP_Processor_ID", impProcessor.getIMP_Processor_ID());<NEW_LINE>}<NEW_LINE>rabbitMqListener = new RabbitMqListener(ctx, replicationProcessor, host, port, consumerTag, queueName, account, password, trxName, exchangeName, isDurableQueue);<NEW_LINE>rabbitMqListener.run();<NEW_LINE>getLogger(Level.INFO).addLog("Listener started: {}", rabbitMqListener);<NEW_LINE>} | "IMP_Processor_ID", impProcessor.getIMP_Processor_ID()); |
795,544 | public void handleCommand(ChannelUID channelUID, Command command) {<NEW_LINE>Objects.requireNonNull(channelUID, "channelUID cannot be null");<NEW_LINE>Objects.requireNonNull(command, "command cannot be null");<NEW_LINE>final NeeoDeviceProtocol protocol = deviceProtocol.get();<NEW_LINE>if (protocol == null) {<NEW_LINE>logger.debug("Protocol is null - ignoring update: {}", channelUID);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final String[] channelIds = UidUtils.parseChannelId(channelUID);<NEW_LINE>if (channelIds.length == 0) {<NEW_LINE>logger.debug("Bad group declaration: {}", channelUID);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final <MASK><NEW_LINE>final String groupId = localGroupId == null || localGroupId.isEmpty() ? "" : localGroupId;<NEW_LINE>final String channelId = channelIds[0];<NEW_LINE>final String channelKey = channelIds.length > 1 ? channelIds[1] : "";<NEW_LINE>if (groupId.isEmpty()) {<NEW_LINE>logger.debug("GroupID for channel is null - ignoring command: {}", channelUID);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (command instanceof RefreshType) {<NEW_LINE>refreshChannel(protocol, groupId, channelId, channelKey);<NEW_LINE>} else {<NEW_LINE>switch(groupId) {<NEW_LINE>case NeeoConstants.DEVICE_GROUP_MACROS_ID:<NEW_LINE>switch(channelId) {<NEW_LINE>case NeeoConstants.DEVICE_CHANNEL_STATUS:<NEW_LINE>if (command instanceof OnOffType) {<NEW_LINE>protocol.setMacroStatus(channelKey, command == OnOffType.ON);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>logger.debug("Unknown channel to set: {}", channelUID);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>logger.debug("Unknown group to set: {}", channelUID);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | String localGroupId = channelUID.getGroupId(); |
1,823,466 | private static List<Supplier<Path>> checkMaven(Map<String, Map.Entry<String, String>> map) {<NEW_LINE>List<Supplier<Path>> incomplete = new ArrayList<>();<NEW_LINE>for (Map.Entry<String, Map.Entry<String, String>> entry : map.entrySet()) {<NEW_LINE>String maven = entry.getKey();<NEW_LINE>String hash = entry<MASK><NEW_LINE>String url = entry.getValue().getValue();<NEW_LINE>String path = "libraries/" + Util.mavenToPath(maven);<NEW_LINE>if (new File(path).exists()) {<NEW_LINE>try {<NEW_LINE>String fileHash = Util.hash(path);<NEW_LINE>if (!fileHash.equals(hash)) {<NEW_LINE>incomplete.add(new MavenDownloader(MAVEN_REPO, maven, path, hash, url));<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>incomplete.add(new MavenDownloader(MAVEN_REPO, maven, path, hash, url));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>incomplete.add(new MavenDownloader(MAVEN_REPO, maven, path, hash, url));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return incomplete;<NEW_LINE>} | .getValue().getKey(); |
569,195 | public void drawFluid(FluidStack fluid, int x, int y, int width, int height, int maxCapacity) {<NEW_LINE>if (fluid == null || fluid.getFluid() == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>TextureAtlasSprite sprite = FluidRenderer.getFluidTexture(fluid.getFluid(), FluidType.STILL);<NEW_LINE>mc.renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);<NEW_LINE>RenderUtil.setGLColorFromInt(fluid.getFluid<MASK><NEW_LINE>int fullX = width / 16;<NEW_LINE>int fullY = height / 16;<NEW_LINE>int lastX = width - fullX * 16;<NEW_LINE>int lastY = height - fullY * 16;<NEW_LINE>int level = fluid.amount * height / maxCapacity;<NEW_LINE>int fullLvl = (height - level) / 16;<NEW_LINE>int lastLvl = (height - level) - fullLvl * 16;<NEW_LINE>for (int i = 0; i < fullX; i++) {<NEW_LINE>for (int j = 0; j < fullY; j++) {<NEW_LINE>if (j >= fullLvl) {<NEW_LINE>drawCutIcon(sprite, x + i * 16, y + j * 16, 16, 16, j == fullLvl ? lastLvl : 0);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (int i = 0; i < fullX; i++) {<NEW_LINE>drawCutIcon(sprite, x + i * 16, y + fullY * 16, 16, lastY, fullLvl == fullY ? lastLvl : 0);<NEW_LINE>}<NEW_LINE>for (int i = 0; i < fullY; i++) {<NEW_LINE>if (i >= fullLvl) {<NEW_LINE>drawCutIcon(sprite, x + fullX * 16, y + i * 16, lastX, 16, i == fullLvl ? lastLvl : 0);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>drawCutIcon(sprite, x + fullX * 16, y + fullY * 16, lastX, lastY, fullLvl == fullY ? lastLvl : 0);<NEW_LINE>GlStateManager.color(1, 1, 1, 1);<NEW_LINE>} | ().getColor(fluid)); |
1,463,002 | private ClickHandler buttonClickHandler(DownloadType downloadType) {<NEW_LINE>return clickEvent -> {<NEW_LINE>if (timer != null) {<NEW_LINE>timer.cancel();<NEW_LINE>}<NEW_LINE>timer = new Timer() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>int oldZoom = drawPanelDiagram.getGridSize();<NEW_LINE>switch(downloadType) {<NEW_LINE>case UXF:<NEW_LINE>DiagramXmlParser.diagramToXml(true, false, drawPanelDiagram.getDiagram(), WebDownloadPopupPanel.this, DownloadType.UXF);<NEW_LINE>break;<NEW_LINE>case PNG:<NEW_LINE>double scalingValue = filenameAndScaleHolder.getScaling();<NEW_LINE>drawPanelDiagram.setGridAndZoom(SharedConstants.DEFAULT_GRID_SIZE, false, null);<NEW_LINE>CanvasUtils.createPngCanvasDataUrl(drawPanelDiagram.getDiagram(), scalingValue, WebDownloadPopupPanel.this, DownloadType.PNG);<NEW_LINE>drawPanelDiagram.setGridAndZoom(oldZoom, false, null);<NEW_LINE>break;<NEW_LINE>case PDF:<NEW_LINE>drawPanelDiagram.setGridAndZoom(SharedConstants.DEFAULT_GRID_SIZE, false, null);<NEW_LINE>CanvasUtils.createPdfCanvasDataUrl(drawPanelDiagram.getDiagram(), WebDownloadPopupPanel.this, DownloadType.PDF);<NEW_LINE>drawPanelDiagram.<MASK><NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>};<NEW_LINE>timer.schedule(0);<NEW_LINE>};<NEW_LINE>} | setGridAndZoom(oldZoom, false, null); |
595,805 | private void initNotificationsList() {<NEW_LINE>String[] columnToolTips = { "plugin.notificationconfig.tableheader.ENABLE", "plugin.notificationconfig.tableheader.EXECUTE", "plugin.notificationconfig.tableheader.POPUP", <MASK><NEW_LINE>JLabel icon1 = new JLabel(new ImageIcon(Resources.getImageInBytes("plugin.notificationconfig.PROG_ICON")));<NEW_LINE>JLabel icon2 = new JLabel(new ImageIcon(Resources.getImageInBytes("plugin.notificationconfig.POPUP_ICON")));<NEW_LINE>JLabel icon3 = new JLabel(new ImageIcon(Resources.getImageInBytes("plugin.notificationconfig.SOUND_ICON_NOTIFY")));<NEW_LINE>JLabel icon4 = new JLabel(new ImageIcon(Resources.getImageInBytes("plugin.notificationconfig.SOUND_ICON_PLAYBACK")));<NEW_LINE>JLabel icon5 = new JLabel(new ImageIcon(Resources.getImageInBytes("plugin.notificationconfig.SOUND_ICON")));<NEW_LINE>Object[] column = { "", icon1, icon2, icon3, icon4, icon5, Resources.getString("plugin.notificationconfig.DESCRIPTION") };<NEW_LINE>notificationList = new NotificationsTable(column, columnToolTips, this);<NEW_LINE>notificationList.setPreferredSize(new Dimension(500, 300));<NEW_LINE>this.add(notificationList, BorderLayout.CENTER);<NEW_LINE>if (notificationList.getRowCount() > 0)<NEW_LINE>notificationList.setSelectedRow(0);<NEW_LINE>} | "plugin.notificationconfig.tableheader.SOUND", "plugin.notificationconfig.tableheader.PLAYBACK_SOUND", "plugin.notificationconfig.tableheader.PCSPEAKER_SOUND", "plugin.notificationconfig.tableheader.DESCRIPTION" }; |
1,134,069 | final GetIPSetResult executeGetIPSet(GetIPSetRequest getIPSetRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getIPSetRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetIPSetRequest> request = null;<NEW_LINE>Response<GetIPSetResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new GetIPSetRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getIPSetRequest));<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, "GuardDuty");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetIPSet");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetIPSetResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetIPSetResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | awsRequestMetrics.startEvent(Field.RequestMarshallTime); |
1,358,316 | public static void main(String[] args) {<NEW_LINE>if (!(args.length == 1 && !args[0].startsWith(CHECKER_ARG)) && !(args.length == 2 && args[0].startsWith(CHECKER_ARG))) {<NEW_LINE>printUsage();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// process arguments<NEW_LINE>String checkerName = null;<NEW_LINE>if (args[0].startsWith(CHECKER_ARG)) {<NEW_LINE>checkerName = args[0].<MASK><NEW_LINE>if (!Signatures.isBinaryName(checkerName)) {<NEW_LINE>throw new UserError("Bad checker name \"%s\"", checkerName);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Setup compiler environment<NEW_LINE>Context context = new Context();<NEW_LINE>JavacProcessingEnvironment env = JavacProcessingEnvironment.instance(context);<NEW_LINE>SignaturePrinter printer = new SignaturePrinter();<NEW_LINE>printer.init(env, checkerName);<NEW_LINE>String className = args[args.length - 1];<NEW_LINE>TypeElement elem = env.getElementUtils().getTypeElement(className);<NEW_LINE>if (elem == null) {<NEW_LINE>System.err.println("Couldn't find class: " + className);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>printer.typeProcess(elem, null);<NEW_LINE>} | substring(CHECKER_ARG.length()); |
1,190,659 | final StartRouteAnalysisResult executeStartRouteAnalysis(StartRouteAnalysisRequest startRouteAnalysisRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(startRouteAnalysisRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<StartRouteAnalysisRequest> request = null;<NEW_LINE>Response<StartRouteAnalysisResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new StartRouteAnalysisRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(startRouteAnalysisRequest));<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, "NetworkManager");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "StartRouteAnalysis");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<StartRouteAnalysisResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new StartRouteAnalysisResultJsonUnmarshaller());<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); |
1,207,345 | final AssociateLicenseResult executeAssociateLicense(AssociateLicenseRequest associateLicenseRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(associateLicenseRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<AssociateLicenseRequest> request = null;<NEW_LINE>Response<AssociateLicenseResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new AssociateLicenseRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(associateLicenseRequest));<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, "grafana");<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<AssociateLicenseResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new AssociateLicenseResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | addHandlerContext(HandlerContextKey.OPERATION_NAME, "AssociateLicense"); |
1,528,565 | final DescribePublishingDestinationResult executeDescribePublishingDestination(DescribePublishingDestinationRequest describePublishingDestinationRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describePublishingDestinationRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribePublishingDestinationRequest> request = null;<NEW_LINE>Response<DescribePublishingDestinationResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribePublishingDestinationRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describePublishingDestinationRequest));<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, "GuardDuty");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribePublishingDestination");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribePublishingDestinationResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribePublishingDestinationResultJsonUnmarshaller());<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,536,241 | public EncodedClusterStateBundle encode(ClusterStateBundle stateBundle) {<NEW_LINE>Slime slime = new Slime();<NEW_LINE>Cursor root = slime.setObject();<NEW_LINE>if (stateBundle.deferredActivation()) {<NEW_LINE>root.setBool("deferred-activation", stateBundle.deferredActivation());<NEW_LINE>}<NEW_LINE>Cursor states = root.setObject("states");<NEW_LINE>// TODO add another function that is not toString for this..!<NEW_LINE>states.setString("baseline", stateBundle.getBaselineClusterState().toString());<NEW_LINE>Cursor <MASK><NEW_LINE>stateBundle.getDerivedBucketSpaceStates().entrySet().forEach(entry -> spaces.setString(entry.getKey(), entry.getValue().toString()));<NEW_LINE>// Only bother to encode feed block state if cluster is actually blocked<NEW_LINE>if (stateBundle.getFeedBlock().map(fb -> fb.blockFeedInCluster()).orElse(false)) {<NEW_LINE>Cursor feedBlock = root.setObject("feed-block");<NEW_LINE>feedBlock.setBool("block-feed-in-cluster", true);<NEW_LINE>feedBlock.setString("description", stateBundle.getFeedBlock().get().getDescription());<NEW_LINE>}<NEW_LINE>Compressor.Compression compression = BinaryFormat.encode_and_compress(slime, compressor);<NEW_LINE>return EncodedClusterStateBundle.fromCompressionBuffer(compression);<NEW_LINE>} | spaces = states.setObject("spaces"); |
347,862 | // outputSolutions<NEW_LINE>@Override<NEW_LINE>public void outputJoinSet(final IBuffer<IBindingSet> out) {<NEW_LINE>try {<NEW_LINE>@SuppressWarnings({ "rawtypes", "unchecked" })<NEW_LINE>final Constant t = askVar == null ? null : new Constant(XSDBooleanIV.valueOf(true));<NEW_LINE>final HTree joinSet = getJoinSet();<NEW_LINE>if (log.isInfoEnabled()) {<NEW_LINE>log.info("joinSet: #nnodes=" + joinSet.getNodeCount() + ",#leaves=" + joinSet.getLeafCount() + ",#entries=" + joinSet.getEntryCount());<NEW_LINE>}<NEW_LINE>// source.<NEW_LINE>final ITupleIterator<?> solutionsIterator = joinSet.rangeIterator();<NEW_LINE>while (solutionsIterator.hasNext()) {<NEW_LINE>IBindingSet bset = decodeSolution(solutionsIterator.next());<NEW_LINE>if (selectVars != null) {<NEW_LINE>// Drop variables which are not projected.<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (t != null) {<NEW_LINE>if (selectVars == null)<NEW_LINE>bset = bset.clone();<NEW_LINE>bset.set(askVar, t);<NEW_LINE>}<NEW_LINE>encoder.resolveCachedValues(bset);<NEW_LINE>out.add(bset);<NEW_LINE>}<NEW_LINE>} catch (Throwable t) {<NEW_LINE>throw launderThrowable(t);<NEW_LINE>}<NEW_LINE>} | bset = bset.copy(selectVars); |
1,103,244 | public static String wrapQuery(final DBPDataSource dataSource, String sqlQuery, final DBDDataFilter dataFilter) {<NEW_LINE>// Append filter conditions to query<NEW_LINE>StringBuilder modifiedQuery = new StringBuilder(<MASK><NEW_LINE>modifiedQuery.append("SELECT * FROM (\n");<NEW_LINE>modifiedQuery.append(sqlQuery);<NEW_LINE>modifiedQuery.append("\n) ").append(NESTED_QUERY_AlIAS);<NEW_LINE>if (dataFilter.hasConditions()) {<NEW_LINE>modifiedQuery.append(" WHERE ");<NEW_LINE>SQLUtils.appendConditionString(dataFilter, dataSource, NESTED_QUERY_AlIAS, modifiedQuery, true, true);<NEW_LINE>}<NEW_LINE>if (dataFilter.hasOrdering()) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>modifiedQuery.append(" ORDER BY ");<NEW_LINE>SQLUtils.appendOrderString(dataFilter, dataSource, NESTED_QUERY_AlIAS, true, modifiedQuery);<NEW_LINE>}<NEW_LINE>return modifiedQuery.toString();<NEW_LINE>} | sqlQuery.length() + 100); |
673,587 | public void onActivityCreated(Bundle savedInstanceState) {<NEW_LINE>super.onActivityCreated(savedInstanceState);<NEW_LINE>getDialog().getWindow().setLayout(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);<NEW_LINE>Bundle args = getArguments();<NEW_LINE>mTransactionIds = args.getLongArray(UxArgument.SELECTED_TRANSACTION_IDS);<NEW_LINE>mOriginAccountUID = args.getString(UxArgument.ORIGIN_ACCOUNT_UID);<NEW_LINE>String title = getActivity().getString(R.string.title_move_transactions, mTransactionIds.length);<NEW_LINE>getDialog().setTitle(title);<NEW_LINE>AccountsDbAdapter accountsDbAdapter = AccountsDbAdapter.getInstance();<NEW_LINE>String conditions = "(" + DatabaseSchema.AccountEntry.COLUMN_UID + " != ? AND " + DatabaseSchema.AccountEntry.COLUMN_CURRENCY + " = ? AND " + DatabaseSchema.AccountEntry.COLUMN_HIDDEN + " = 0 AND " + DatabaseSchema.AccountEntry.COLUMN_PLACEHOLDER + " = 0" + ")";<NEW_LINE>Cursor cursor = accountsDbAdapter.fetchAccountsOrderedByFullName(conditions, new String[] { mOriginAccountUID, <MASK><NEW_LINE>SimpleCursorAdapter mCursorAdapter = new QualifiedAccountNameCursorAdapter(getActivity(), cursor);<NEW_LINE>mDestinationAccountSpinner.setAdapter(mCursorAdapter);<NEW_LINE>setListeners();<NEW_LINE>} | accountsDbAdapter.getCurrencyCode(mOriginAccountUID) }); |
967,601 | public static void main(String[] args) throws Exception {<NEW_LINE>if (args.length < 2) {<NEW_LINE>System.out.println("Syntax: <in.mov> <out.mov>");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>SeekableByteChannel input = readableChannel(new File(args[0]));<NEW_LINE>MP4Demuxer demuxer = MP4Demuxer.createMP4Demuxer(input);<NEW_LINE>SeekableByteChannel output = writableChannel(new File(args[1]));<NEW_LINE>MP4Muxer muxer = MP4Muxer.createMP4Muxer(output, Brand.MOV);<NEW_LINE>DemuxerTrack inVideo = demuxer.getVideoTrack();<NEW_LINE>DemuxerTrackMeta meta = inVideo.getMeta();<NEW_LINE>Size size = meta.getVideoCodecMeta().getSize();<NEW_LINE>ProresToProxy toProxy = new ProresToProxy(size.getWidth(), size.getHeight(), 65536);<NEW_LINE>MuxerTrack outVideo = muxer.addVideoTrack(meta.getCodec(), meta.getVideoCodecMeta());<NEW_LINE>System.out.println(toProxy.getFrameSize());<NEW_LINE>int frame = 0;<NEW_LINE>long from = System.currentTimeMillis();<NEW_LINE>long last = from;<NEW_LINE>MP4Packet pkt = null;<NEW_LINE>while ((pkt = (MP4Packet) inVideo.nextFrame()) != null) {<NEW_LINE>ByteBuffer out = ByteBuffer.allocate(pkt.getData().remaining());<NEW_LINE>toProxy.transcode(pkt.getData(), out);<NEW_LINE>out.flip();<NEW_LINE>outVideo.addFrame(MP4Packet.createMP4PacketWithData(pkt, out));<NEW_LINE>frame++;<NEW_LINE><MASK><NEW_LINE>if (cur - last > 5000) {<NEW_LINE>System.out.println(((1000 * frame) / (cur - from)) + " fps");<NEW_LINE>last = cur;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>muxer.finish();<NEW_LINE>output.close();<NEW_LINE>input.close();<NEW_LINE>} | long cur = System.currentTimeMillis(); |
1,235,903 | public void execute() throws Throwable {<NEW_LINE>pagedItems = streamOperation.retrievePage(holder.getVal(), pageSize);<NEW_LINE>streamOperation.pagedExecute(pagedItems);<NEW_LINE>int pagedItemCount = ((Collection) pagedItems<MASK><NEW_LINE>if (pagedItemCount == 0) {<NEW_LINE>holder.setVal(totalCount.intValue());<NEW_LINE>} else {<NEW_LINE>if (LOG.isDebugEnabled() && !isFinalPage(holder, pagedItemCount, totalCount) && (pagedItemCount != pageSize)) {<NEW_LINE>LOG.debug(String.format("In the previous iteration of this streaming transactional operation, " + "(%s) pagedItems were processed when we were expecting a full page of (%s) items. " + "Please ensure that your StreamCapableTransactionalOperation#retrieveTotalCount() " + "and StreamCapableTransactionalOperation#retrievePage(int startPos, int pageSize) " + "queries contain the same conditions as to ultimately provide the number of entities " + "equal to the declared total count. Stream operation: %s", pagedItemCount, pageSize, streamOperation.getClass()));<NEW_LINE>}<NEW_LINE>if (pagedItemCount < pageSize) {<NEW_LINE>holder.setVal(holder.getVal() + pageSize);<NEW_LINE>} else {<NEW_LINE>holder.setVal(holder.getVal() + pagedItemCount);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | [0]).size(); |
629,966 | private void addToQueueBasedOnUserDefinition(String applicationType, int applicationSupportId, int queueId, KeyNamePair recipient) {<NEW_LINE>MADQueue queue = new MADQueue(getContext(), queueId, getTransactionName());<NEW_LINE>MADNotificationQueue notification = new MADNotificationQueue(queue);<NEW_LINE>notification.setApplicationType(applicationType);<NEW_LINE>if (getUserId() > 0) {<NEW_LINE>notification.setAD_User_ID(getUserId());<NEW_LINE>}<NEW_LINE>if (getApplicationSupportId() > 0) {<NEW_LINE>notification.setAD_AppSupport_ID(applicationSupportId);<NEW_LINE>}<NEW_LINE>if (!Util.isEmpty(getText())) {<NEW_LINE>notification.setText(getText());<NEW_LINE>}<NEW_LINE>if (!Util.isEmpty(getDescription())) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>notification.saveEx();<NEW_LINE>// Add recipient<NEW_LINE>MADNotificationRecipient notificationRecipient = new MADNotificationRecipient(notification);<NEW_LINE>notificationRecipient.setAccountName(Optional.ofNullable(recipient.getName()).orElse("").trim());<NEW_LINE>if (recipient.getKey() > 0) {<NEW_LINE>notificationRecipient.setAD_User_ID(recipient.getKey());<NEW_LINE>}<NEW_LINE>notificationRecipient.saveEx();<NEW_LINE>// Add Attachments<NEW_LINE>if (getAttachments().size() > 0) {<NEW_LINE>getAttachments().forEach(attachment -> {<NEW_LINE>MAttachment attachmentReference = notification.createAttachment();<NEW_LINE>attachmentReference.addEntry(attachment.getAttachment());<NEW_LINE>Optional.ofNullable(attachment.getComment()).ifPresent(comment -> attachmentReference.addTextMsg(comment));<NEW_LINE>attachmentReference.saveEx(getTransactionName());<NEW_LINE>});<NEW_LINE>}<NEW_LINE>logger.fine("Queue Added: " + notification);<NEW_LINE>} | notification.setDescription(getDescription()); |
483,564 | private void write_pin_swap(app.freerouting.board.Pin p_pin_1, app.freerouting.board.Pin p_pin_2) throws java.io.IOException {<NEW_LINE>int layer_no = Math.max(p_pin_1.first_layer(), p_pin_2.first_layer());<NEW_LINE>String layer_name = board.layer_structure.arr[layer_no].name;<NEW_LINE>this.out_file.write("CHANGE LAYER ");<NEW_LINE>this.out_file.write(layer_name);<NEW_LINE><MASK><NEW_LINE>double[] location_1 = this.board.communication.coordinate_transform.board_to_dsn(p_pin_1.get_center().to_float());<NEW_LINE>double[] location_2 = this.board.communication.coordinate_transform.board_to_dsn(p_pin_2.get_center().to_float());<NEW_LINE>this.out_file.write("PINSWAP ");<NEW_LINE>this.out_file.write(" (");<NEW_LINE>Double curr_coor = location_1[0];<NEW_LINE>this.out_file.write(curr_coor.toString());<NEW_LINE>this.out_file.write(" ");<NEW_LINE>curr_coor = location_1[1];<NEW_LINE>this.out_file.write(curr_coor.toString());<NEW_LINE>this.out_file.write(") (");<NEW_LINE>curr_coor = location_2[0];<NEW_LINE>this.out_file.write(curr_coor.toString());<NEW_LINE>this.out_file.write(" ");<NEW_LINE>curr_coor = location_2[1];<NEW_LINE>this.out_file.write(curr_coor.toString());<NEW_LINE>this.out_file.write(");\n");<NEW_LINE>} | this.out_file.write(";\n"); |
1,609,998 | private void createDateField(Builder builder, Field field) {<NEW_LINE>AnnotationSpec column = AnnotationSpec.builder(Column.class).addMember("name", "ColumnNamePrefix + " + field.<MASK><NEW_LINE>AnnotationSpec temporal = AnnotationSpec.builder(Temporal.class).addMember("value", "javax.persistence.TemporalType.DATE").build();<NEW_LINE>FieldSpec fieldSpec = FieldSpec.builder(Date.class, field.getName(), Modifier.PRIVATE).addAnnotation(this.fieldDescribe(field)).addAnnotation(this.index(field)).addAnnotation(this.checkPersist(field)).addAnnotation(column).addAnnotation(temporal).build();<NEW_LINE>MethodSpec get = MethodSpec.methodBuilder(StringTools.getMethodName(field.getName())).addModifiers(Modifier.PUBLIC).returns(Date.class).addStatement("return this." + field.getName()).build();<NEW_LINE>MethodSpec set = MethodSpec.methodBuilder(StringTools.setMethodName(field.getName())).addModifiers(Modifier.PUBLIC).returns(void.class).addParameter(Date.class, field.getName()).addStatement("this." + field.getName() + " = " + field.getName()).build();<NEW_LINE>builder.addField(this.fieldName(field)).addField(fieldSpec).addMethod(get).addMethod(set);<NEW_LINE>} | fieldName()).build(); |
228,734 | public void onBindViewHolder(GifViewHolder holder, int position) {<NEW_LINE>final Api.GifResult result = results[position];<NEW_LINE>holder.gifView.setOnClickListener(new View.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(View view) {<NEW_LINE>ClipboardManager clipboard = (ClipboardManager) activity.getSystemService(Context.CLIPBOARD_SERVICE);<NEW_LINE>ClipData clip = ClipData.newPlainText("giphy_url", result.images.fixed_height.url);<NEW_LINE>Preconditions.checkNotNull(clipboard).setPrimaryClip(clip);<NEW_LINE>Intent fullscreenIntent = FullscreenActivity.getIntent(activity, result);<NEW_LINE>activity.startActivity(fullscreenIntent);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>// clearOnDetach let's us stop animating GifDrawables that RecyclerView hasn't yet recycled<NEW_LINE>// but that are currently off screen.<NEW_LINE>requestBuilder.load(result).into(holder.gifView).clearOnDetach();<NEW_LINE><MASK><NEW_LINE>} | preloadSizeProvider.setView(holder.gifView); |
891,391 | private PolynomialApproximation approximateKnnDistances(double[] knnDistances) {<NEW_LINE>StringBuilder msg = new StringBuilder();<NEW_LINE>// count the zero distances (necessary of log-log space is used)<NEW_LINE>int k_0 = 0;<NEW_LINE>if (settings.log) {<NEW_LINE>for (int i = 0; i < settings.kmax; i++) {<NEW_LINE>double dist = knnDistances[i];<NEW_LINE>if (dist == 0) {<NEW_LINE>k_0++;<NEW_LINE>} else {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>double[] x = new double[settings.kmax - k_0];<NEW_LINE>double[] y = new double[settings.kmax - k_0];<NEW_LINE>for (int k = 0; k < settings.kmax - k_0; k++) {<NEW_LINE>if (settings.log) {<NEW_LINE>x[k] = FastMath.log(k + k_0);<NEW_LINE>y[k] = FastMath.log(knnDistances[k + k_0]);<NEW_LINE>} else {<NEW_LINE>x[k] = k + k_0;<NEW_LINE>y[k] = knnDistances[k + k_0];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>PolynomialRegression regression = new PolynomialRegression(<MASK><NEW_LINE>PolynomialApproximation approximation = new PolynomialApproximation(regression.getEstimatedCoefficients());<NEW_LINE>if (LOG.isDebugging()) {<NEW_LINE>msg.append("approximation ").append(approximation);<NEW_LINE>LOG.debugFine(msg.toString());<NEW_LINE>}<NEW_LINE>return approximation;<NEW_LINE>} | y, x, settings.p); |
413,476 | final DeleteBGPPeerResult executeDeleteBGPPeer(DeleteBGPPeerRequest deleteBGPPeerRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteBGPPeerRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteBGPPeerRequest> request = null;<NEW_LINE>Response<DeleteBGPPeerResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteBGPPeerRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteBGPPeerRequest));<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, "Direct Connect");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteBGPPeer");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteBGPPeerResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteBGPPeerResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | awsRequestMetrics.endEvent(Field.RequestMarshallTime); |
52,360 | public static void mainHmmVoiceConversion() throws IOException {<NEW_LINE>String baseInputFolder = "D:/Oytun/DFKI/voices/hmmVoiceConversionTest2/output/final/";<NEW_LINE>String baseOutputFolder = "D:/Oytun/DFKI/voices/hmmVoiceConversionTest2/objective_test/";<NEW_LINE>boolean isBark = true;<NEW_LINE>String method1, method2, folder1, folder2, referenceFolder, outputFile;<NEW_LINE>referenceFolder = "D:/Oytun/DFKI/voices/hmmVoiceConversionTest2/output/final/origTarget";<NEW_LINE>// No-GV vs GV<NEW_LINE>method1 = "NOGV";<NEW_LINE>method2 = "GV";<NEW_LINE>folder1 = baseInputFolder + "hmmSource_nogv";<NEW_LINE>folder2 = baseInputFolder + "hmmSource_gv";<NEW_LINE>outputFile = baseOutputFolder + "lsf_" <MASK><NEW_LINE>mainHmmVoiceConversion(method1, method2, folder1, folder2, referenceFolder, outputFile, isBark);<NEW_LINE>// No-GV vs SC<NEW_LINE>method1 = "NOGV";<NEW_LINE>method2 = "NOGV+SC";<NEW_LINE>folder1 = baseInputFolder + "hmmSource_nogv";<NEW_LINE>folder2 = baseInputFolder + "tfm_nogv_1092files_128mixes";<NEW_LINE>outputFile = baseOutputFolder + "lsf_" + method1 + "_" + method2 + ".txt";<NEW_LINE>mainHmmVoiceConversion(method1, method2, folder1, folder2, referenceFolder, outputFile, isBark);<NEW_LINE>// GV vs SC<NEW_LINE>method1 = "GV";<NEW_LINE>method2 = "GV+SC";<NEW_LINE>folder1 = baseInputFolder + "hmmSource_gv";<NEW_LINE>folder2 = baseInputFolder + "tfm_gv_1092files_128mixes";<NEW_LINE>outputFile = baseOutputFolder + "lsf_" + method1 + "_" + method2 + ".txt";<NEW_LINE>mainHmmVoiceConversion(method1, method2, folder1, folder2, referenceFolder, outputFile, isBark);<NEW_LINE>System.out.println("Objective test completed...");<NEW_LINE>} | + method1 + "_" + method2 + ".txt"; |
28,220 | public void initLayer(@NonNull final OsmandMapTileView view) {<NEW_LINE>app = getApplication();<NEW_LINE>this.view = view;<NEW_LINE>cacheMetricSystem = app.getSettings().METRIC_SYSTEM.get();<NEW_LINE>cacheMapDensity = getMapDensity();<NEW_LINE>cacheDistances = new ArrayList<>();<NEW_LINE>cacheCenter = new QuadPoint();<NEW_LINE>maxRadiusInDp = app.getResources().getDimensionPixelSize(R.dimen.map_ruler_width);<NEW_LINE>centerIconDay = BitmapFactory.decodeResource(view.getResources(), R.drawable.map_ruler_center_day);<NEW_LINE>centerIconNight = BitmapFactory.decodeResource(view.getResources(), R.drawable.map_ruler_center_night);<NEW_LINE>bitmapPaint = new Paint();<NEW_LINE>bitmapPaint.setAntiAlias(true);<NEW_LINE>bitmapPaint.setDither(true);<NEW_LINE>bitmapPaint.setFilterBitmap(true);<NEW_LINE>int colorNorthArrow = ContextCompat.getColor(app, R.color.compass_control_active);<NEW_LINE>int colorHeadingArrow = ContextCompat.getColor(<MASK><NEW_LINE>triangleNorthPaint = initPaintWithStyle(Style.FILL, colorNorthArrow);<NEW_LINE>triangleHeadingPaint = initPaintWithStyle(Style.FILL, colorHeadingArrow);<NEW_LINE>redLinesPaint = initPaintWithStyle(Style.STROKE, colorNorthArrow);<NEW_LINE>blueLinesPaint = initPaintWithStyle(Style.STROKE, colorHeadingArrow);<NEW_LINE>float circleTextSize = TEXT_SIZE * app.getResources().getDisplayMetrics().density;<NEW_LINE>circleAttrs = new RenderingLineAttributes("rulerCircle");<NEW_LINE>circleAttrs.paint2.setTextSize(circleTextSize);<NEW_LINE>circleAttrs.paint3.setTextSize(circleTextSize);<NEW_LINE>circleAttrsAlt = new RenderingLineAttributes("rulerCircleAlt");<NEW_LINE>circleAttrsAlt.paint2.setTextSize(circleTextSize);<NEW_LINE>circleAttrsAlt.paint3.setTextSize(circleTextSize);<NEW_LINE>for (int i = 0; i < 72; i++) {<NEW_LINE>degrees[i] = Math.toRadians(i * 5);<NEW_LINE>}<NEW_LINE>} | app, R.color.active_color_primary_light); |
1,582,472 | public void channelRead0(ChannelHandlerContext ctx, FullHttpRequest request) throws Exception {<NEW_LINE>FullHttpResponse response = null;<NEW_LINE>if (request.uri().startsWith("/get_books")) {<NEW_LINE>response = new DefaultFullHttpResponse(HTTP_1_1, OK, Unpooled.wrappedBuffer(objectWriter.writeValueAsBytes(booksDB.values())));<NEW_LINE>response.headers().set(CONTENT_TYPE, "application/json");<NEW_LINE>response.headers().set(CONTENT_LENGTH, response.content().readableBytes());<NEW_LINE>} else if (request.uri().startsWith("/get_book")) {<NEW_LINE>List<String> id = new QueryStringDecoder(request.uri()).parameters().get("id");<NEW_LINE>if (id != null && !id.isEmpty()) {<NEW_LINE>Book book = booksDB.get(id.get(0));<NEW_LINE>if (book != null) {<NEW_LINE>response = new DefaultFullHttpResponse(HTTP_1_1, OK, Unpooled.wrappedBuffer(objectWriter.writeValueAsBytes(book)));<NEW_LINE>response.headers().set(CONTENT_TYPE, "application/json");<NEW_LINE>response.headers().set(CONTENT_LENGTH, response.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (response == null) {<NEW_LINE>response = new DefaultFullHttpResponse(HTTP_1_1, NOT_FOUND);<NEW_LINE>}<NEW_LINE>ctx.write(response).addListener(ChannelFutureListener.CLOSE);<NEW_LINE>} | content().readableBytes()); |
1,434,137 | public void add(StatefulBeanO beanO) {<NEW_LINE>BeanId id = beanO.beanId;<NEW_LINE>TimeoutElement elt = beanO.ivTimeoutElement;<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>Tr.entry(tc, "add " + beanO.beanId + ", " + elt.timeout);<NEW_LINE>// LIDB2775-23.4 Begins<NEW_LINE>Object obj = ivStatefulBeanList.put(id, elt);<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())<NEW_LINE>Tr.debug(tc, (obj != null) ? "Stateful bean information replaced" : "Stateful bean information added");<NEW_LINE>// LIDB2775-23.4 Ends<NEW_LINE>synchronized (this) {<NEW_LINE>if (// F743-33394<NEW_LINE>numObjects == 0 && !ivIsCanceled) {<NEW_LINE>startAlarm();<NEW_LINE>}<NEW_LINE>numObjects++;<NEW_LINE>numAdds++;<NEW_LINE>}<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE><MASK><NEW_LINE>} | Tr.exit(tc, "add"); |
1,282,549 | public Flux<V> receive(StreamOffset<K> streamOffset) {<NEW_LINE>if (logger.isDebugEnabled()) {<NEW_LINE>logger.debug(String.format("receive(%s)", streamOffset));<NEW_LINE>}<NEW_LINE>RedisSerializationContext.SerializationPair<K> keySerializer = template.getSerializationContext().getKeySerializationPair();<NEW_LINE>ByteBuffer rawKey = keySerializer.write(streamOffset.getKey());<NEW_LINE>Function<ReadOffset, Flux<ByteBufferRecord>> readFunction = readOffset -> template.execute(connection -> connection.streamCommands().xRead(readOptions, StreamOffset.create(rawKey.asReadOnlyBuffer(), readOffset)));<NEW_LINE>return Flux.defer(() -> {<NEW_LINE>PollState pollState = PollState.standalone(streamOffset.getOffset());<NEW_LINE>return Flux.create(sink -> new StreamSubscription(sink, streamOffset.getKey(), pollState, readFunction, receiverOptions.getResumeFunction<MASK><NEW_LINE>});<NEW_LINE>} | ()).arm()); |
194,532 | void logResponseHeader(long seqId, String serviceName, String methodName, Metadata metadata, int maxHeaderBytes, GrpcLogRecord.EventLogger eventLogger, String rpcId, @Nullable SocketAddress peerAddress) {<NEW_LINE>checkNotNull(serviceName, "serviceName");<NEW_LINE>checkNotNull(methodName, "methodName");<NEW_LINE>checkNotNull(rpcId, "rpcId");<NEW_LINE>// Logging peer address only on the first incoming event. On server side, peer address will<NEW_LINE>// of logging request header<NEW_LINE>checkArgument(peerAddress == null || eventLogger == GrpcLogRecord.EventLogger.LOGGER_CLIENT, "peerAddress can only be specified for client");<NEW_LINE>PayloadBuilder<GrpcLogRecord.Metadata.Builder> pair = createMetadataProto(metadata, maxHeaderBytes);<NEW_LINE>GrpcLogRecord.Builder logEntryBuilder = createTimestamp().setSequenceId(seqId).setServiceName(serviceName).setMethodName(methodName).setEventType(EventType.GRPC_CALL_RESPONSE_HEADER).setEventLogger(eventLogger).setLogLevel(LogLevel.LOG_LEVEL_DEBUG).setMetadata(pair.payload).setPayloadSize(pair.size).setPayloadTruncated(pair<MASK><NEW_LINE>if (peerAddress != null) {<NEW_LINE>logEntryBuilder.setPeerAddress(socketAddressToProto(peerAddress));<NEW_LINE>}<NEW_LINE>sink.write(logEntryBuilder.build());<NEW_LINE>} | .truncated).setRpcId(rpcId); |
1,717,628 | // clamp timerange to case<NEW_LINE>@SuppressWarnings("AssignmentToMethodParameter")<NEW_LINE>synchronized public void pushTimeAndType(Interval timeRange, TimelineEventType.HierarchyLevel typeZoom) throws TskCoreException {<NEW_LINE>Interval overlappingTimeRange = this.filteredEvents.getSpanningInterval().overlap(timeRange);<NEW_LINE>EventsModelParams currentZoom = filteredEvents.modelParamsProperty().get();<NEW_LINE>if (currentZoom == null) {<NEW_LINE>advance(InitialZoomState.withTimeAndType(overlappingTimeRange, typeZoom));<NEW_LINE>} else if (currentZoom.hasTimeRange(overlappingTimeRange) == false && currentZoom.hasTypeZoomLevel(typeZoom) == false) {<NEW_LINE>advance(currentZoom.withTimeAndType(overlappingTimeRange, typeZoom));<NEW_LINE>} else if (currentZoom.hasTimeRange(overlappingTimeRange) == false) {<NEW_LINE>advance<MASK><NEW_LINE>} else if (currentZoom.hasTypeZoomLevel(typeZoom) == false) {<NEW_LINE>advance(currentZoom.withTypeZoomLevel(typeZoom));<NEW_LINE>}<NEW_LINE>} | (currentZoom.withTimeRange(overlappingTimeRange)); |
1,268,851 | public void marshall(UpdateTableRequest updateTableRequest, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (updateTableRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(updateTableRequest.getTableName(), TABLENAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateTableRequest.getBillingMode(), BILLINGMODE_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateTableRequest.getProvisionedThroughput(), PROVISIONEDTHROUGHPUT_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateTableRequest.getGlobalSecondaryIndexUpdates(), GLOBALSECONDARYINDEXUPDATES_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateTableRequest.getStreamSpecification(), STREAMSPECIFICATION_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateTableRequest.getSSESpecification(), SSESPECIFICATION_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateTableRequest.getReplicaUpdates(), REPLICAUPDATES_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateTableRequest.getTableClass(), TABLECLASS_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | updateTableRequest.getAttributeDefinitions(), ATTRIBUTEDEFINITIONS_BINDING); |
677,658 | protected StateFactory init(MetaStreamEvent metaStreamEvent, AbstractDefinition inputDefinition, ExpressionExecutor[] attributeExpressionExecutors, ConfigReader configReader, StreamEventClonerHolder streamEventClonerHolder, boolean outputExpectsExpiredEvents, boolean findToBeExecuted, SiddhiQueryContext siddhiQueryContext) {<NEW_LINE>if (attributeExpressionExecutors[0] instanceof ConstantExpressionExecutor) {<NEW_LINE>expressionString = (String) ((ConstantExpressionExecutor) attributeExpressionExecutors<MASK><NEW_LINE>constructExpression(metaStreamEvent, siddhiQueryContext);<NEW_LINE>} else {<NEW_LINE>for (Attribute attribute : inputDefinition.getAttributeList()) {<NEW_LINE>metaStreamEvent.addData(attribute);<NEW_LINE>}<NEW_LINE>expressionStringExecutor = attributeExpressionExecutors[0];<NEW_LINE>}<NEW_LINE>if (attributeExpressionExecutors.length > 1) {<NEW_LINE>if (attributeExpressionExecutors[1] instanceof ConstantExpressionExecutor) {<NEW_LINE>includeTriggeringEvent = (Boolean) ((ConstantExpressionExecutor) attributeExpressionExecutors[1]).getValue();<NEW_LINE>} else {<NEW_LINE>includeTriggeringEventExecutor = attributeExpressionExecutors[1];<NEW_LINE>}<NEW_LINE>if (attributeExpressionExecutors.length > 2 && attributeExpressionExecutors[2] instanceof ConstantExpressionExecutor) {<NEW_LINE>streamInputEvents = (Boolean) ((ConstantExpressionExecutor) attributeExpressionExecutors[2]).getValue();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return () -> new WindowState();<NEW_LINE>} | [0]).getValue(); |
1,814,736 | protected void addGuiElements() {<NEW_LINE>super.addGuiElements();<NEW_LINE>addRenderableWidget(new GuiDownArrow(this, 159, 44));<NEW_LINE>addRenderableWidget(new GuiHorizontalPowerBar(this, tile.getEnergyContainer(), 115, 75)).warning(WarningType.NOT_ENOUGH_ENERGY, tile.getWarningCheck(RecipeError.NOT_ENOUGH_ENERGY)).warning(WarningType.NOT_ENOUGH_ENERGY_REDUCED_RATE, tile<MASK><NEW_LINE>addRenderableWidget(new GuiEnergyTab(this, tile.getEnergyContainer(), tile::getEnergyUsed));<NEW_LINE>addRenderableWidget(new GuiFluidGauge(() -> tile.fluidTank, () -> tile.getFluidTanks(null), GaugeType.STANDARD, this, 133, 13)).warning(WarningType.NO_MATCHING_RECIPE, tile.getWarningCheck(TileEntityRotaryCondensentrator.NOT_ENOUGH_FLUID_INPUT_ERROR)).warning(WarningType.NO_SPACE_IN_OUTPUT, tile.getWarningCheck(TileEntityRotaryCondensentrator.NOT_ENOUGH_SPACE_FLUID_OUTPUT_ERROR));<NEW_LINE>addRenderableWidget(new GuiGasGauge(() -> tile.gasTank, () -> tile.getGasTanks(null), GaugeType.STANDARD, this, 25, 13)).warning(WarningType.NO_MATCHING_RECIPE, tile.getWarningCheck(TileEntityRotaryCondensentrator.NOT_ENOUGH_GAS_INPUT_ERROR)).warning(WarningType.NO_SPACE_IN_OUTPUT, tile.getWarningCheck(TileEntityRotaryCondensentrator.NOT_ENOUGH_SPACE_GAS_OUTPUT_ERROR));<NEW_LINE>addRenderableWidget(new GuiProgress(new IBooleanProgressInfoHandler() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean fillProgressBar() {<NEW_LINE>return tile.getActive();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean isActive() {<NEW_LINE>return !tile.mode;<NEW_LINE>}<NEW_LINE>}, ProgressType.LARGE_RIGHT, this, 64, 39).jeiCategories(MekanismJEIRecipeType.CONDENSENTRATING)).warning(WarningType.INPUT_DOESNT_PRODUCE_OUTPUT, tile.getWarningCheck(RecipeError.INPUT_DOESNT_PRODUCE_OUTPUT));<NEW_LINE>addRenderableWidget(new GuiProgress(new IBooleanProgressInfoHandler() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean fillProgressBar() {<NEW_LINE>return tile.getActive();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean isActive() {<NEW_LINE>return tile.mode;<NEW_LINE>}<NEW_LINE>}, ProgressType.LARGE_LEFT, this, 64, 39).jeiCategories(MekanismJEIRecipeType.DECONDENSENTRATING)).warning(WarningType.INPUT_DOESNT_PRODUCE_OUTPUT, tile.getWarningCheck(RecipeError.INPUT_DOESNT_PRODUCE_OUTPUT));<NEW_LINE>addRenderableWidget(new ToggleButton(this, 4, 4, () -> tile.mode, () -> Mekanism.packetHandler().sendToServer(new PacketGuiInteract(GuiInteraction.NEXT_MODE, tile)), getOnHover(MekanismLang.CONDENSENTRATOR_TOGGLE)));<NEW_LINE>} | .getWarningCheck(RecipeError.NOT_ENOUGH_ENERGY_REDUCED_RATE)); |
423,111 | public static DescribeMPCoSPhaseInfoResponse unmarshall(DescribeMPCoSPhaseInfoResponse describeMPCoSPhaseInfoResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeMPCoSPhaseInfoResponse.setRequestId(_ctx.stringValue("DescribeMPCoSPhaseInfoResponse.RequestId"));<NEW_LINE>describeMPCoSPhaseInfoResponse.setCode(_ctx.integerValue("DescribeMPCoSPhaseInfoResponse.Code"));<NEW_LINE>describeMPCoSPhaseInfoResponse.setSuccess(_ctx.booleanValue("DescribeMPCoSPhaseInfoResponse.Success"));<NEW_LINE>describeMPCoSPhaseInfoResponse.setMessage(_ctx.stringValue("DescribeMPCoSPhaseInfoResponse.Message"));<NEW_LINE>Data data = new Data();<NEW_LINE>data.setProductKey(_ctx.stringValue("DescribeMPCoSPhaseInfoResponse.Data.ProductKey"));<NEW_LINE>data.setIotId(_ctx.stringValue("DescribeMPCoSPhaseInfoResponse.Data.IotId"));<NEW_LINE>data.setDataValue(_ctx.stringValue("DescribeMPCoSPhaseInfoResponse.Data.DataValue"));<NEW_LINE>data.setBlockNumber(_ctx.longValue("DescribeMPCoSPhaseInfoResponse.Data.BlockNumber"));<NEW_LINE>data.setPreviousHash(_ctx.stringValue("DescribeMPCoSPhaseInfoResponse.Data.PreviousHash"));<NEW_LINE>data.setBlockHash(_ctx.stringValue("DescribeMPCoSPhaseInfoResponse.Data.BlockHash"));<NEW_LINE>data.setTransactionHash(_ctx.stringValue("DescribeMPCoSPhaseInfoResponse.Data.TransactionHash"));<NEW_LINE>data.setDataHash<MASK><NEW_LINE>data.setTimestamp(_ctx.longValue("DescribeMPCoSPhaseInfoResponse.Data.Timestamp"));<NEW_LINE>List<RelatedData> relatedDataList = new ArrayList<RelatedData>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeMPCoSPhaseInfoResponse.Data.RelatedDataList.Length"); i++) {<NEW_LINE>RelatedData relatedData = new RelatedData();<NEW_LINE>relatedData.setRelatedPhaseId(_ctx.stringValue("DescribeMPCoSPhaseInfoResponse.Data.RelatedDataList[" + i + "].RelatedPhaseId"));<NEW_LINE>relatedData.setRelatedPhaseName(_ctx.stringValue("DescribeMPCoSPhaseInfoResponse.Data.RelatedDataList[" + i + "].RelatedPhaseName"));<NEW_LINE>relatedData.setRelatedDataKey(_ctx.stringValue("DescribeMPCoSPhaseInfoResponse.Data.RelatedDataList[" + i + "].RelatedDataKey"));<NEW_LINE>relatedData.setRelatedDataSeq(_ctx.stringValue("DescribeMPCoSPhaseInfoResponse.Data.RelatedDataList[" + i + "].RelatedDataSeq"));<NEW_LINE>relatedData.setRelatedPhaseDataHash(_ctx.stringValue("DescribeMPCoSPhaseInfoResponse.Data.RelatedDataList[" + i + "].RelatedPhaseDataHash"));<NEW_LINE>relatedDataList.add(relatedData);<NEW_LINE>}<NEW_LINE>data.setRelatedDataList(relatedDataList);<NEW_LINE>describeMPCoSPhaseInfoResponse.setData(data);<NEW_LINE>return describeMPCoSPhaseInfoResponse;<NEW_LINE>} | (_ctx.stringValue("DescribeMPCoSPhaseInfoResponse.Data.DataHash")); |
1,255,401 | private void analyzeMethod(ClassContext classContext, Method method) throws CFGBuilderException, ClassNotFoundException, DataflowAnalysisException {<NEW_LINE>CFG cfg = classContext.getCFG(method);<NEW_LINE>for (Iterator<Location> i = cfg.locationIterator(); i.hasNext(); ) {<NEW_LINE>Location location = i.next();<NEW_LINE>Instruction ins = location.getHandle().getInstruction();<NEW_LINE>if (ins instanceof InvokeInstruction) {<NEW_LINE>if (TARGET_METHOD != null && !((InvokeInstruction) ins).getMethodName(classContext.getConstantPoolGen()).equals(TARGET_METHOD)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>System.out.println("\n*******************************************************\n");<NEW_LINE>System.out.println("Method invocation: " + location.getHandle());<NEW_LINE>System.out.println("\tInvoking: " + SignatureConverter.convertMethodSignature((InvokeInstruction) ins, classContext.getConstantPoolGen()));<NEW_LINE>JavaClassAndMethod proto = Hierarchy.findInvocationLeastUpperBound((InvokeInstruction) <MASK><NEW_LINE>if (proto == null) {<NEW_LINE>System.out.println("\tUnknown prototype method");<NEW_LINE>} else {<NEW_LINE>System.out.println("\tPrototype method: class=" + proto.getJavaClass().getClassName() + ", method=" + proto.getMethod());<NEW_LINE>}<NEW_LINE>Set<JavaClassAndMethod> calledMethodSet = Hierarchy.resolveMethodCallTargets((InvokeInstruction) ins, classContext.getTypeDataflow(method).getFactAtLocation(location), classContext.getConstantPoolGen());<NEW_LINE>System.out.println("\tTarget method set: " + calledMethodSet);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ins, classContext.getConstantPoolGen()); |
286,118 | public String toModelName(final String name) {<NEW_LINE>final String sanitizedName = sanitizeName(modelNamePrefix + this.stripPackageName(name) + modelNameSuffix);<NEW_LINE>// camelize the model name<NEW_LINE>// phone_number => PhoneNumber<NEW_LINE><MASK><NEW_LINE>// model name cannot use reserved keyword, e.g. return<NEW_LINE>if (isReservedWord(camelizedName)) {<NEW_LINE>final String modelName = "Model" + camelizedName;<NEW_LINE>LOGGER.warn("{} (reserved word) cannot be used as model name. Renamed to {}", camelizedName, modelName);<NEW_LINE>return modelName;<NEW_LINE>}<NEW_LINE>// model name starts with number<NEW_LINE>if (name.matches("^\\d.*")) {<NEW_LINE>// e.g. 200Response => Model200Response (after camelize)<NEW_LINE>final String modelName = "Model" + camelizedName;<NEW_LINE>LOGGER.warn("{} (model name starts with number) cannot be used as model name. Renamed to {}", name, modelName);<NEW_LINE>return modelName;<NEW_LINE>}<NEW_LINE>return camelizedName;<NEW_LINE>} | final String camelizedName = camelize(sanitizedName); |
801,191 | private void constructFlow(final Flow flow, final Node node, final Set<String> visitedOnPath, final Set<String> visitedEver) {<NEW_LINE>visitedOnPath.add(node.getId());<NEW_LINE>visitedEver.add(node.getId());<NEW_LINE>flow.addNode(node);<NEW_LINE>flow.setCondition(node.getCondition());<NEW_LINE>if (SpecialJobTypes.EMBEDDED_FLOW_TYPE.equals(node.getType())) {<NEW_LINE>final Props props = this.jobPropsMap.get(node.getId());<NEW_LINE>final String embeddedFlow = props.get(SpecialJobTypes.FLOW_NAME);<NEW_LINE>Set<String> embeddedFlows = this.flowDependencies.get(flow.getId());<NEW_LINE>if (embeddedFlows == null) {<NEW_LINE>embeddedFlows = new HashSet<>();<NEW_LINE>this.flowDependencies.put(flow.getId(), embeddedFlows);<NEW_LINE>}<NEW_LINE>node.setEmbeddedFlowId(embeddedFlow);<NEW_LINE>embeddedFlows.add(embeddedFlow);<NEW_LINE>}<NEW_LINE>final Map<String, Edge> dependencies = this.nodeDependencies.get(node.getId());<NEW_LINE>if (dependencies != null) {<NEW_LINE>for (Edge edge : dependencies.values()) {<NEW_LINE>if (edge.hasError()) {<NEW_LINE>flow.addEdge(edge);<NEW_LINE>} else if (visitedOnPath.contains(edge.getSourceId())) {<NEW_LINE>// We have a cycle. We set it as an error edge<NEW_LINE>edge = new Edge(edge.getSourceId(), node.getId());<NEW_LINE>edge.setError("Cyclical dependencies found.");<NEW_LINE>this.errors.add("Cyclical dependency found at " + edge.getId());<NEW_LINE>flow.addEdge(edge);<NEW_LINE>} else if (visitedEver.contains(edge.getSourceId())) {<NEW_LINE>// this node was already checked, don't need to check further<NEW_LINE>flow.addEdge(edge);<NEW_LINE>} else {<NEW_LINE>// This should not be null<NEW_LINE>flow.addEdge(edge);<NEW_LINE>final Node sourceNode = this.nodeMap.<MASK><NEW_LINE>constructFlow(flow, sourceNode, visitedOnPath, visitedEver);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>visitedOnPath.remove(node.getId());<NEW_LINE>} | get(edge.getSourceId()); |
518,099 | private boolean tryConnection() {<NEW_LINE>m_user = userTextField.getText();<NEW_LINE>m_pwd = new String(passwordField.getPassword());<NEW_LINE>// Establish connection<NEW_LINE>if (!DB.isConnected(false))<NEW_LINE>validateConnection();<NEW_LINE>if (!DB.isConnected(false)) {<NEW_LINE>statusBar.setStatusLine(txt_NoDatabase, true);<NEW_LINE>hostField.setBackground(AdempierePLAF.getFieldBackground_Error());<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// Reference check<NEW_LINE>Ini.setProperty(Ini.P_ADEMPIERESYS, "Reference".equalsIgnoreCase(CConnection.get().getDbUid()));<NEW_LINE>// Reference check<NEW_LINE>Ini.setProperty(Ini.P_LOGMIGRATIONSCRIPT, "Reference".equalsIgnoreCase(CConnection.get().getDbUid()));<NEW_LINE>// Get Roles<NEW_LINE>m_login = new Login(m_ctx);<NEW_LINE>KeyNamePair[] roles = null;<NEW_LINE>try {<NEW_LINE>roles = m_login.getRoles(m_user, m_pwd);<NEW_LINE>if (roles == null || roles.length == 0) {<NEW_LINE>statusBar.setStatusLine(txt_UserPwdError, true);<NEW_LINE>userTextField.setBackground(AdempierePLAF.getFieldBackground_Error());<NEW_LINE>passwordField.setBackground(AdempierePLAF.getFieldBackground_Error());<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>} catch (Throwable e) {<NEW_LINE>if (e.getCause() instanceof AccessException) {<NEW_LINE>statusBar.setStatusLine(txt_UserPwdError, true);<NEW_LINE>userTextField.setBackground(AdempierePLAF.getFieldBackground_Error());<NEW_LINE>passwordField.setBackground(AdempierePLAF.getFieldBackground_Error());<NEW_LINE>return false;<NEW_LINE>} else {<NEW_LINE>log.severe(CLogger.getRootCause(e).getLocalizedMessage());<NEW_LINE>statusBar.setStatusLine(CLogger.getRootCause(e).getLocalizedMessage(), true);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Delete existing role items<NEW_LINE>m_comboActive = true;<NEW_LINE>if (roleCombo.getItemCount() > 0)<NEW_LINE>roleCombo.removeAllItems();<NEW_LINE>// Initial role<NEW_LINE>KeyNamePair iniValue = null;<NEW_LINE>String iniDefault = Ini.getProperty(Ini.P_ROLE);<NEW_LINE>// fill roles<NEW_LINE>for (int i = 0; i < roles.length; i++) {<NEW_LINE>roleCombo.addItem(roles[i]);<NEW_LINE>if (roles[i].getName().equals(iniDefault))<NEW_LINE>iniValue = roles[i];<NEW_LINE>}<NEW_LINE>if (iniValue != null)<NEW_LINE>roleCombo.setSelectedItem(iniValue);<NEW_LINE>// If we have only one role, we can hide the combobox - metas-2009_0021_AP1_G94<NEW_LINE>if (roleCombo.getItemCount() == 1 && !MSysConfig.getBooleanValue("ALogin_ShowOneRole", true)) {<NEW_LINE>roleCombo.setSelectedIndex(0);<NEW_LINE>roleLabel.setVisible(false);<NEW_LINE>roleCombo.setVisible(false);<NEW_LINE>} else {<NEW_LINE>roleLabel.setVisible(true);<NEW_LINE>roleCombo.setVisible(true);<NEW_LINE>}<NEW_LINE>userTextField.<MASK><NEW_LINE>passwordField.setBackground(AdempierePLAF.getFieldBackground_Normal());<NEW_LINE>//<NEW_LINE>this.setTitle(hostField.getDisplay());<NEW_LINE>statusBar.setStatusLine(txt_LoggedIn);<NEW_LINE>m_comboActive = false;<NEW_LINE>roleComboChanged();<NEW_LINE>return true;<NEW_LINE>} | setBackground(AdempierePLAF.getFieldBackground_Normal()); |
741,198 | private static void writeForDdlExternalProperty(Element properties) throws Exception {<NEW_LINE>Element property = properties.addElement("property");<NEW_LINE>property.addAttribute("name", "javax.persistence.jdbc.driver");<NEW_LINE>property.addAttribute("value", Config.externalDataSources().get(0).getDriverClassName());<NEW_LINE>property = properties.addElement("property");<NEW_LINE>property.addAttribute("name", "javax.persistence.jdbc.url");<NEW_LINE>property.addAttribute("value", Config.externalDataSources().get(0).getUrl());<NEW_LINE>property = properties.addElement("property");<NEW_LINE>property.addAttribute("name", "javax.persistence.jdbc.user");<NEW_LINE>property.addAttribute("value", Config.externalDataSources().get(0).getUsername());<NEW_LINE>property = properties.addElement("property");<NEW_LINE>property.addAttribute("name", "javax.persistence.jdbc.password");<NEW_LINE>property.addAttribute("value", Config.externalDataSources().get(0).getPassword());<NEW_LINE>property = properties.addElement("property");<NEW_LINE><MASK><NEW_LINE>property.addAttribute("value", "false");<NEW_LINE>} | property.addAttribute("name", "openjpa.DynamicEnhancementAgent"); |
938,669 | /*<NEW_LINE>* jint AttachCurrentThreadAsDaemon(JavaVM *vm, void <MASK><NEW_LINE>*/<NEW_LINE>@CEntryPoint(include = CEntryPoint.NotIncludedAutomatically.class, exceptionHandler = JNIFunctions.Support.JNIExceptionHandlerDetachAndReturnJniErr.class)<NEW_LINE>@CEntryPointOptions(prologue = JNIJavaVMEnterAttachThreadManualJavaThreadPrologue.class, epilogue = NoEpilogue.class, publishAs = Publish.NotPublished)<NEW_LINE>@Uninterruptible(reason = "Permits omitting an epilogue so we can detach in the exception handler.", calleeMustBe = false)<NEW_LINE>static int AttachCurrentThreadAsDaemon(JNIJavaVM vm, JNIEnvironmentPointer penv, JNIJavaVMAttachArgs args) {<NEW_LINE>Support.attachCurrentThread(vm, penv, args, true);<NEW_LINE>CEntryPointActions.leave();<NEW_LINE>return JNIErrors.JNI_OK();<NEW_LINE>} | **p_env, void *thr_args); |
529,498 | public static void printDevService(StringBuilder builder, DevServiceDescriptionBuildItem devService, boolean withStatus) {<NEW_LINE>if (devService.hasContainerInfo()) {<NEW_LINE>builder.append(BOLD).append(devService.getName()).append(NO_BOLD);<NEW_LINE>if (withStatus) {<NEW_LINE>builder.append(" - ").append(devService.getContainerInfo().getStatus());<NEW_LINE>}<NEW_LINE>builder.append("\n");<NEW_LINE>builder.append(String.format(" %-18s", "Container: ")).append(devService.getContainerInfo().getId(), 0, 12).append(devService.getContainerInfo().formatNames()).append(" ").append(devService.getContainerInfo().getImageName()).append("\n");<NEW_LINE>builder.append(String.format(" %-18s", "Network: ")).append(devService.getContainerInfo().formatNetworks()).append(" - ").append(devService.getContainerInfo().formatPorts()).append("\n");<NEW_LINE>builder.append(String.format(" %-18s", "Exec command: ")).append(String.format(EXEC_FORMAT, devService.getContainerInfo().getShortId())).append("\n");<NEW_LINE>}<NEW_LINE>builder.append(String.format(" %-18s", "Injected Config: ")).append(devService.formatConfigs<MASK><NEW_LINE>} | ()).append("\n"); |
1,449,015 | public boolean retainAll(Collection<?> collection) {<NEW_LINE>int retainedSize = collection.size();<NEW_LINE>UnifiedMap<K, V> retainedCopy = (UnifiedMap<K, V>) UnifiedMap.this.newEmpty(retainedSize);<NEW_LINE>for (Object obj : collection) {<NEW_LINE>if (obj instanceof Entry) {<NEW_LINE>Entry<?, ?> otherEntry = (Entry<?, ?>) obj;<NEW_LINE>Entry<K, V> thisEntry = this.getEntry(otherEntry);<NEW_LINE>if (thisEntry != null) {<NEW_LINE>retainedCopy.put(thisEntry.getKey(), thisEntry.getValue());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (retainedCopy.size() < this.size()) {<NEW_LINE>UnifiedMap<MASK><NEW_LINE>UnifiedMap.this.occupied = retainedCopy.occupied;<NEW_LINE>UnifiedMap.this.table = retainedCopy.table;<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | .this.maxSize = retainedCopy.maxSize; |
317,068 | final CreateEndpointResult executeCreateEndpoint(CreateEndpointRequest createEndpointRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createEndpointRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateEndpointRequest> request = null;<NEW_LINE>Response<CreateEndpointResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateEndpointRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createEndpointRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Comprehend");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateEndpoint");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateEndpointResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateEndpointResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | HandlerContextKey.SIGNING_REGION, getSigningRegion()); |
741,811 | public static void addVoidMethodReturnsProposals(IInvocationContext context, IProblemLocationCore problem, Collection<ChangeCorrectionProposal> proposals) {<NEW_LINE>ICompilationUnit cu = context.getCompilationUnit();<NEW_LINE>CompilationUnit astRoot = context.getASTRoot();<NEW_LINE>ASTNode selectedNode = problem.getCoveringNode(astRoot);<NEW_LINE>if (selectedNode == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>BodyDeclaration decl = ASTResolving.findParentBodyDeclaration(selectedNode);<NEW_LINE>if (decl instanceof MethodDeclaration && selectedNode.getNodeType() == ASTNode.RETURN_STATEMENT) {<NEW_LINE>ReturnStatement returnStatement = (ReturnStatement) selectedNode;<NEW_LINE>Expression expr = returnStatement.getExpression();<NEW_LINE>if (expr != null) {<NEW_LINE>AST ast = astRoot.getAST();<NEW_LINE>ITypeBinding binding = Bindings.normalizeTypeBinding(expr.resolveTypeBinding());<NEW_LINE>if (binding == null) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (binding.isWildcardType()) {<NEW_LINE>binding = ASTResolving.normalizeWildcardType(binding, true, ast);<NEW_LINE>}<NEW_LINE>MethodDeclaration methodDeclaration = (MethodDeclaration) decl;<NEW_LINE>ASTRewrite rewrite = ASTRewrite.create(ast);<NEW_LINE>String label = Messages.format(CorrectionMessages.ReturnTypeSubProcessor_voidmethodreturns_description, BindingLabelProviderCore.getBindingLabel(binding, BindingLabelProviderCore.DEFAULT_TEXTFLAGS));<NEW_LINE>LinkedCorrectionProposal proposal = new LinkedCorrectionProposal(label, CodeActionKind.QuickFix, cu, rewrite, IProposalRelevance.VOID_METHOD_RETURNS);<NEW_LINE>ImportRewrite imports = proposal.createImportRewrite(astRoot);<NEW_LINE>ImportRewriteContext importRewriteContext = new ContextSensitiveImportRewriteContext(methodDeclaration, imports);<NEW_LINE>Type newReturnType = imports.addImport(binding, ast, importRewriteContext, TypeLocation.RETURN_TYPE);<NEW_LINE>if (methodDeclaration.isConstructor()) {<NEW_LINE>rewrite.set(methodDeclaration, MethodDeclaration.CONSTRUCTOR_PROPERTY, Boolean.FALSE, null);<NEW_LINE>rewrite.set(methodDeclaration, MethodDeclaration.RETURN_TYPE2_PROPERTY, newReturnType, null);<NEW_LINE>} else {<NEW_LINE>rewrite.replace(methodDeclaration.getReturnType2(), newReturnType, null);<NEW_LINE>}<NEW_LINE>// $NON-NLS-1$<NEW_LINE>String key = "return_type";<NEW_LINE>proposal.addLinkedPosition(rewrite.track(newReturnType), true, key);<NEW_LINE>ITypeBinding[] bindings = ASTResolving.getRelaxingTypes(ast, binding);<NEW_LINE>for (int i = 0; i < bindings.length; i++) {<NEW_LINE>proposal.addLinkedPositionProposal(key, bindings[i]);<NEW_LINE>}<NEW_LINE>Javadoc javadoc = methodDeclaration.getJavadoc();<NEW_LINE>if (javadoc != null) {<NEW_LINE>TagElement newTag = ast.newTagElement();<NEW_LINE>newTag.setTagName(TagElement.TAG_RETURN);<NEW_LINE>TextElement commentStart = ast.newTextElement();<NEW_LINE>newTag.fragments().add(commentStart);<NEW_LINE>JavadocTagsSubProcessor.insertTag(rewrite.getListRewrite(javadoc, Javadoc.TAGS_PROPERTY), newTag, null);<NEW_LINE>// $NON-NLS-1$<NEW_LINE>proposal.addLinkedPosition(rewrite.track(commentStart), false, "comment_start");<NEW_LINE>}<NEW_LINE>proposals.add(proposal);<NEW_LINE>}<NEW_LINE>ASTRewrite rewrite = ASTRewrite.create(decl.getAST());<NEW_LINE>rewrite.remove(returnStatement.getExpression(), null);<NEW_LINE>String label = CorrectionMessages.ReturnTypeSubProcessor_removereturn_description;<NEW_LINE>ASTRewriteCorrectionProposal proposal = new ASTRewriteCorrectionProposal(label, CodeActionKind.QuickFix, cu, rewrite, IProposalRelevance.CHANGE_TO_RETURN);<NEW_LINE>proposals.add(proposal);<NEW_LINE>}<NEW_LINE>} | binding = ast.resolveWellKnownType("java.lang.Object"); |
1,677,201 | private void configureViewerPreferredSize() {<NEW_LINE>int vertexCount = graph.vertexSet().size();<NEW_LINE><MASK><NEW_LINE>// set the layoutModel's initials size to a minimal value. Not sure this should be necessary<NEW_LINE>// but it makes the initial scaling look better for small graphs. Otherwise it seems<NEW_LINE>// to use a very large area to layout the graph, resulting in tiny nodes that are spaced<NEW_LINE>// very far apart. This might just be a work around for a bug in some of the layout<NEW_LINE>// algorithms that don't seem to properly compute a good layout size.<NEW_LINE>viewer.getVisualizationModel().getLayoutModel().setSize(1, 1);<NEW_LINE>if (vertexCount < 100) {<NEW_LINE>viewer.getVisualizationModel().getLayoutModel().setPreferredSize(viewSize.width, viewSize.height);<NEW_LINE>} else {<NEW_LINE>int newSize = viewSize.width + 5 * (vertexCount - 100);<NEW_LINE>viewer.getVisualizationModel().getLayoutModel().setPreferredSize(newSize, newSize);<NEW_LINE>}<NEW_LINE>} | Dimension viewSize = viewer.getPreferredSize(); |
1,050,971 | private static void appendGroupStatus(StringBuilder buffer, Map<ActionExecutionMetadata, Pair<String, Long>> statusMap, String status, long currentTime) {<NEW_LINE>List<Pair<Long, ActionExecutionMetadata>> actions = new ArrayList<>();<NEW_LINE>for (Map.Entry<ActionExecutionMetadata, Pair<String, Long>> entry : statusMap.entrySet()) {<NEW_LINE>if (entry.getValue().first.equals(status)) {<NEW_LINE>actions.add(Pair.of(entry.getValue().second, entry.getKey()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (actions.isEmpty()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Collections.sort(actions, comparing(arg -> arg.first));<NEW_LINE>buffer.<MASK><NEW_LINE>boolean truncateList = actions.size() > MAX_LINES;<NEW_LINE>for (Pair<Long, ActionExecutionMetadata> entry : actions.subList(0, truncateList ? MAX_LINES - 1 : actions.size())) {<NEW_LINE>String message = entry.second.getProgressMessage();<NEW_LINE>if (message == null) {<NEW_LINE>// Actions will a null progress message should run so<NEW_LINE>// fast we never see them here. In any case...<NEW_LINE>message = entry.second.prettyPrint();<NEW_LINE>}<NEW_LINE>buffer.append("\n ").append(message);<NEW_LINE>// Convert to seconds.<NEW_LINE>long runTime = (currentTime - entry.first) / 1000000000L;<NEW_LINE>buffer.append(", ").append(runTime).append(" s");<NEW_LINE>}<NEW_LINE>if (truncateList) {<NEW_LINE>buffer.append("\n ... ").append(actions.size() - MAX_LINES + 1).append(" more jobs");<NEW_LINE>}<NEW_LINE>} | append("\n " + status + ":"); |
489,820 | public void deletePet(Long petId, String apiKey) throws ApiException {<NEW_LINE>Object localVarPostBody = null;<NEW_LINE>// verify the required parameter 'petId' is set<NEW_LINE>if (petId == null) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/pet/{petId}".replaceAll("\\{format\\}", "json").replaceAll("\\{" + "petId" + "\\}", apiInvoker.escapeString(petId.toString()));<NEW_LINE>// query params<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>// header params<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>// form params<NEW_LINE>Map<String, String> localVarFormParams = new HashMap<String, String>();<NEW_LINE>localVarHeaderParams.put("api_key", ApiInvoker.parameterToString(apiKey));<NEW_LINE>String[] localVarContentTypes = {};<NEW_LINE>String localVarContentType = localVarContentTypes.length > 0 ? localVarContentTypes[0] : "application/json";<NEW_LINE>if (localVarContentType.startsWith("multipart/form-data")) {<NEW_LINE>// file uploading<NEW_LINE>MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();<NEW_LINE>localVarPostBody = localVarBuilder.build();<NEW_LINE>} else {<NEW_LINE>// normal form params<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType);<NEW_LINE>if (localVarResponse != null) {<NEW_LINE>return;<NEW_LINE>} else {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>} catch (ApiException ex) {<NEW_LINE>throw ex;<NEW_LINE>}<NEW_LINE>} | throw new ApiException(400, "Missing the required parameter 'petId' when calling deletePet"); |
199,307 | public static void main(String[] args) throws IOException, ClassNotFoundException {<NEW_LINE>// Write V1<NEW_LINE>var fishV1 = new RainbowFish("Zed", 10, 11, 12);<NEW_LINE>LOGGER.info("fishV1 name={} age={} length={} weight={}", fishV1.getName(), fishV1.getAge(), fishV1.getLengthMeters(), fishV1.getWeightTons());<NEW_LINE><MASK><NEW_LINE>// Read V1<NEW_LINE>var deserializedRainbowFishV1 = RainbowFishSerializer.readV1("fish1.out");<NEW_LINE>LOGGER.info("deserializedFishV1 name={} age={} length={} weight={}", deserializedRainbowFishV1.getName(), deserializedRainbowFishV1.getAge(), deserializedRainbowFishV1.getLengthMeters(), deserializedRainbowFishV1.getWeightTons());<NEW_LINE>// Write V2<NEW_LINE>var fishV2 = new RainbowFishV2("Scar", 5, 12, 15, true, true, true);<NEW_LINE>LOGGER.info("fishV2 name={} age={} length={} weight={} sleeping={} hungry={} angry={}", fishV2.getName(), fishV2.getAge(), fishV2.getLengthMeters(), fishV2.getWeightTons(), fishV2.isHungry(), fishV2.isAngry(), fishV2.isSleeping());<NEW_LINE>RainbowFishSerializer.writeV2(fishV2, "fish2.out");<NEW_LINE>// Read V2 with V1 method<NEW_LINE>var deserializedFishV2 = RainbowFishSerializer.readV1("fish2.out");<NEW_LINE>LOGGER.info("deserializedFishV2 name={} age={} length={} weight={}", deserializedFishV2.getName(), deserializedFishV2.getAge(), deserializedFishV2.getLengthMeters(), deserializedFishV2.getWeightTons());<NEW_LINE>} | RainbowFishSerializer.writeV1(fishV1, "fish1.out"); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.