idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
790,205
public PipelineResult run(Pipeline pipeline) {<NEW_LINE>// create a worker and pass in the pipeline and then do the translation<NEW_LINE>Twister2PipelineExecutionEnvironment env = new Twister2PipelineExecutionEnvironment(options);<NEW_LINE>LOG.info("Translating pipeline to Twister2 program.");<NEW_LINE><MASK><NEW_LINE>// TODO(BEAM-10670): Use SDF read as default when we address performance issue.<NEW_LINE>if (!ExperimentalOptions.hasExperiment(pipeline.getOptions(), "beam_fn_api")) {<NEW_LINE>SplittableParDo.convertReadBasedSplittableDoFnsToPrimitiveReadsIfNecessary(pipeline);<NEW_LINE>}<NEW_LINE>env.translate(pipeline);<NEW_LINE>setupSystem(options);<NEW_LINE>Map configMap = new HashMap();<NEW_LINE>JobConfig jobConfig = new JobConfig();<NEW_LINE>if (isLocalMode(options)) {<NEW_LINE>options.setParallelism(1);<NEW_LINE>configMap.put(SIDEINPUTS, extractNames(env.getSideInputs()));<NEW_LINE>configMap.put(LEAVES, extractNames(env.getLeaves()));<NEW_LINE>configMap.put(GRAPH, env.getTSetGraph());<NEW_LINE>configMap.put("twister2.network.buffer.size", 32000);<NEW_LINE>configMap.put("twister2.network.sendBuffer.count", options.getParallelism());<NEW_LINE>LOG.warning("Twister2 Local Mode currently only supports single worker");<NEW_LINE>} else {<NEW_LINE>jobConfig.put(SIDEINPUTS, extractNames(env.getSideInputs()));<NEW_LINE>jobConfig.put(LEAVES, extractNames(env.getLeaves()));<NEW_LINE>jobConfig.put(GRAPH, env.getTSetGraph());<NEW_LINE>}<NEW_LINE>Config config = ResourceAllocator.loadConfig(configMap);<NEW_LINE>int workers = options.getParallelism();<NEW_LINE>Twister2Job twister2Job = Twister2Job.newBuilder().setJobName(options.getJobName()).setWorkerClass(BeamBatchWorker.class).addComputeResource(options.getWorkerCPUs(), options.getRamMegaBytes(), workers).setConfig(jobConfig).build();<NEW_LINE>Twister2JobState jobState;<NEW_LINE>if (isLocalMode(options)) {<NEW_LINE>jobState = LocalSubmitter.submitJob(twister2Job, config);<NEW_LINE>} else {<NEW_LINE>jobState = Twister2Submitter.submitJob(twister2Job, config);<NEW_LINE>}<NEW_LINE>Twister2PipelineResult result = new Twister2PipelineResult(jobState);<NEW_LINE>return result;<NEW_LINE>}
pipeline.replaceAll(getDefaultOverrides());
1,621,223
public List<JobId> forceTrigger(ApplicationId applicationId, JobType jobType, String reason, boolean requireTests, boolean upgradeRevision, boolean upgradePlatform) {<NEW_LINE>Application application = applications().requireApplication<MASK><NEW_LINE>Instance instance = application.require(applicationId.instance());<NEW_LINE>JobId job = new JobId(instance.id(), jobType);<NEW_LINE>if (job.type().environment().isManuallyDeployed())<NEW_LINE>return forceTriggerManualJob(job, reason);<NEW_LINE>DeploymentStatus status = jobs.deploymentStatus(application);<NEW_LINE>Change change = instance.change();<NEW_LINE>if (!upgradeRevision && change.application().isPresent())<NEW_LINE>change = change.withoutApplication();<NEW_LINE>if (!upgradePlatform && change.platform().isPresent())<NEW_LINE>change = change.withoutPlatform();<NEW_LINE>Versions versions = Versions.from(change, application, status.deploymentFor(job), controller.readSystemVersion());<NEW_LINE>DeploymentStatus.Job toTrigger = new DeploymentStatus.Job(job.type(), versions, Optional.of(controller.clock().instant()), instance.change());<NEW_LINE>Map<JobId, List<DeploymentStatus.Job>> testJobs = status.testJobs(Map.of(job, List.of(toTrigger)));<NEW_LINE>Map<JobId, List<DeploymentStatus.Job>> jobs = testJobs.isEmpty() || !requireTests ? Map.of(job, List.of(toTrigger)) : testJobs.entrySet().stream().filter(entry -> controller.jobController().last(entry.getKey()).map(Run::hasEnded).orElse(true)).collect(toMap(Map.Entry::getKey, Map.Entry::getValue));<NEW_LINE>jobs.forEach((jobId, versionsList) -> {<NEW_LINE>trigger(deploymentJob(instance, versionsList.get(0).versions(), jobId.type(), status.jobs().get(jobId).get(), clock.instant()), reason);<NEW_LINE>});<NEW_LINE>return List.copyOf(jobs.keySet());<NEW_LINE>}
(TenantAndApplicationId.from(applicationId));
1,362,344
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {<NEW_LINE>response.setContentType("text/html");<NEW_LINE>ServletOutputStream out = response.getOutputStream();<NEW_LINE>out.println("<html>");<NEW_LINE>out.println("<br/>Before getUserPrincipal=" + request.getUserPrincipal());<NEW_LINE>out.println("<br/>Before getRemoteUser=" + request.getRemoteUser());<NEW_LINE>String param = request.getParameter("action");<NEW_LINE>if ("login".equals(param)) {<NEW_LINE>request.login("jetty", "jetty");<NEW_LINE>} else if ("logout".equals(param)) {<NEW_LINE>request.logout();<NEW_LINE>} else if ("wrong".equals(param)) {<NEW_LINE>request.login("jetty", "123");<NEW_LINE>}<NEW_LINE>out.println(<MASK><NEW_LINE>out.println("<br/>After getRemoteUser=" + request.getRemoteUser());<NEW_LINE>out.println("</html>");<NEW_LINE>out.flush();<NEW_LINE>}
"<br/>After getUserPrincipal=" + request.getUserPrincipal());
463,104
public InstanceIdentity postInstanceRegisterInformation(InstanceRegisterInformation info, java.util.Map<String, java.util.List<String>> headers) {<NEW_LINE>WebTarget <MASK><NEW_LINE>Invocation.Builder invocationBuilder = target.request("application/json");<NEW_LINE>if (credsHeader != null) {<NEW_LINE>invocationBuilder = credsHeader.startsWith("Cookie.") ? invocationBuilder.cookie(credsHeader.substring(7), credsToken) : invocationBuilder.header(credsHeader, credsToken);<NEW_LINE>}<NEW_LINE>Response response = invocationBuilder.post(javax.ws.rs.client.Entity.entity(info, "application/json"));<NEW_LINE>int code = response.getStatus();<NEW_LINE>switch(code) {<NEW_LINE>case 201:<NEW_LINE>if (headers != null) {<NEW_LINE>headers.put("location", java.util.Arrays.asList((String) response.getHeaders().getFirst("Location")));<NEW_LINE>}<NEW_LINE>return response.readEntity(InstanceIdentity.class);<NEW_LINE>default:<NEW_LINE>throw new ResourceException(code, response.readEntity(ResourceError.class));<NEW_LINE>}<NEW_LINE>}
target = base.path("/instance");
531,563
public com.satoshilabs.trezor.lib.protobuf.TrezorType.TxRequestSerializedType buildPartial() {<NEW_LINE>com.satoshilabs.trezor.lib.protobuf.TrezorType.TxRequestSerializedType result = new com.satoshilabs.trezor.lib.<MASK><NEW_LINE>int from_bitField0_ = bitField0_;<NEW_LINE>int to_bitField0_ = 0;<NEW_LINE>if (((from_bitField0_ & 0x00000001) == 0x00000001)) {<NEW_LINE>to_bitField0_ |= 0x00000001;<NEW_LINE>}<NEW_LINE>result.signatureIndex_ = signatureIndex_;<NEW_LINE>if (((from_bitField0_ & 0x00000002) == 0x00000002)) {<NEW_LINE>to_bitField0_ |= 0x00000002;<NEW_LINE>}<NEW_LINE>result.signature_ = signature_;<NEW_LINE>if (((from_bitField0_ & 0x00000004) == 0x00000004)) {<NEW_LINE>to_bitField0_ |= 0x00000004;<NEW_LINE>}<NEW_LINE>result.serializedTx_ = serializedTx_;<NEW_LINE>result.bitField0_ = to_bitField0_;<NEW_LINE>onBuilt();<NEW_LINE>return result;<NEW_LINE>}
protobuf.TrezorType.TxRequestSerializedType(this);
679,400
public void checkPass(PortalRegistryService service, String token) {<NEW_LINE>String key = service.getTag() == null ? service.getServiceId() : service.getServiceId() + "|" + service.getTag();<NEW_LINE>String checkId = String.format("%s:%s:%s", key, service.getAddress(), service.getPort());<NEW_LINE>if (logger.isTraceEnabled())<NEW_LINE>logger.trace("checkPass id = {}", checkId);<NEW_LINE>Map<String, Object> <MASK><NEW_LINE>map.put("id", checkId);<NEW_LINE>map.put("pass", true);<NEW_LINE>map.put("checkInterval", config.getCheckInterval());<NEW_LINE>String path = "/services/check";<NEW_LINE>ClientConnection connection = null;<NEW_LINE>try {<NEW_LINE>connection = client.borrowConnection(uri, Http2Client.WORKER, Http2Client.SSL, Http2Client.BUFFER_POOL, optionMap).get();<NEW_LINE>AtomicReference<ClientResponse> reference = send(connection, Methods.PUT, path, token, JsonMapper.toJson(map));<NEW_LINE>int statusCode = reference.get().getResponseCode();<NEW_LINE>if (statusCode >= UNUSUAL_STATUS_CODE) {<NEW_LINE>logger.error("checkPass error: {} : {}", statusCode, reference.get().getAttachment(Http2Client.RESPONSE_BODY));<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.error("CheckPass request exception", e);<NEW_LINE>} finally {<NEW_LINE>client.returnConnection(connection);<NEW_LINE>}<NEW_LINE>}
map = new HashMap<>();
84,693
// snippet-start:[polly.java2.demo.main]<NEW_LINE>public static void talkPolly(PollyClient polly) {<NEW_LINE>try {<NEW_LINE>DescribeVoicesRequest describeVoiceRequest = DescribeVoicesRequest.builder().engine("standard").build();<NEW_LINE>DescribeVoicesResponse describeVoicesResult = polly.describeVoices(describeVoiceRequest);<NEW_LINE>Voice voice = describeVoicesResult.voices().get(26);<NEW_LINE>InputStream stream = synthesize(polly, SAMPLE, voice, OutputFormat.MP3);<NEW_LINE>AdvancedPlayer player = new AdvancedPlayer(stream, javazoom.jl.player.FactoryRegistry.<MASK><NEW_LINE>player.setPlayBackListener(new PlaybackListener() {<NEW_LINE><NEW_LINE>public void playbackStarted(PlaybackEvent evt) {<NEW_LINE>System.out.println("Playback started");<NEW_LINE>System.out.println(SAMPLE);<NEW_LINE>}<NEW_LINE><NEW_LINE>public void playbackFinished(PlaybackEvent evt) {<NEW_LINE>System.out.println("Playback finished");<NEW_LINE>}<NEW_LINE>});<NEW_LINE>// play it!<NEW_LINE>player.play();<NEW_LINE>} catch (PollyException | JavaLayerException | IOException e) {<NEW_LINE>System.err.println(e.getMessage());<NEW_LINE>System.exit(1);<NEW_LINE>}<NEW_LINE>}
systemRegistry().createAudioDevice());
724,847
public int compareTo(checkTableClass_args other) {<NEW_LINE>if (!getClass().equals(other.getClass())) {<NEW_LINE>return getClass().getName().compareTo(other.getClass().getName());<NEW_LINE>}<NEW_LINE>int lastComparison = 0;<NEW_LINE>lastComparison = java.lang.Boolean.compare(isSetTinfo(), other.isSetTinfo());<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>if (isSetTinfo()) {<NEW_LINE>lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.tinfo, other.tinfo);<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>lastComparison = java.lang.Boolean.compare(isSetCredentials(), other.isSetCredentials());<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>if (isSetCredentials()) {<NEW_LINE>lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.credentials, other.credentials);<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>lastComparison = java.lang.Boolean.compare(isSetTableId(), other.isSetTableId());<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>if (isSetTableId()) {<NEW_LINE>lastComparison = org.apache.thrift.TBaseHelper.compareTo(<MASK><NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>lastComparison = java.lang.Boolean.compare(isSetClassName(), other.isSetClassName());<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>if (isSetClassName()) {<NEW_LINE>lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.className, other.className);<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>lastComparison = java.lang.Boolean.compare(isSetInterfaceMatch(), other.isSetInterfaceMatch());<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>if (isSetInterfaceMatch()) {<NEW_LINE>lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.interfaceMatch, other.interfaceMatch);<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return 0;<NEW_LINE>}
this.tableId, other.tableId);
410,645
public OView createView(ODatabaseDocumentInternal database, String viewName, String statement, Map<String, Object> metadata) {<NEW_LINE>OViewConfig cfg = new OViewConfig(viewName, statement);<NEW_LINE>if (metadata != null) {<NEW_LINE>cfg.setUpdatable(Boolean.TRUE.equals(<MASK><NEW_LINE>Object updateInterval = metadata.get("updateIntervalSeconds");<NEW_LINE>if (updateInterval instanceof Integer) {<NEW_LINE>cfg.setUpdateIntervalSeconds((Integer) updateInterval);<NEW_LINE>}<NEW_LINE>Object updateStrategy = metadata.get("updateStrategy");<NEW_LINE>if (updateStrategy instanceof String) {<NEW_LINE>cfg.setUpdateStrategy((String) updateStrategy);<NEW_LINE>}<NEW_LINE>Object watchClasses = metadata.get("watchClasses");<NEW_LINE>if (watchClasses instanceof List) {<NEW_LINE>cfg.setWatchClasses((List) watchClasses);<NEW_LINE>}<NEW_LINE>Object nodes = metadata.get("nodes");<NEW_LINE>if (nodes instanceof List) {<NEW_LINE>cfg.setNodes((List) nodes);<NEW_LINE>}<NEW_LINE>Object originRidField = metadata.get("originRidField");<NEW_LINE>if (originRidField instanceof String) {<NEW_LINE>cfg.setOriginRidField((String) originRidField);<NEW_LINE>}<NEW_LINE>Object indexes = metadata.get("indexes");<NEW_LINE>if (indexes instanceof Collection) {<NEW_LINE>for (Object index : (Collection) indexes) {<NEW_LINE>if (index instanceof Map) {<NEW_LINE>OViewConfig.OViewIndexConfig idxConfig = cfg.addIndex((String) ((Map) index).get("type"), (String) ((Map) index).get("engine"));<NEW_LINE>for (Map.Entry<String, String> entry : ((Map<String, String>) ((Map) index).get("properties")).entrySet()) {<NEW_LINE>OType val = OType.valueOf(entry.getValue().toUpperCase(Locale.ENGLISH));<NEW_LINE>if (val == null) {<NEW_LINE>throw new IllegalArgumentException("Invalid value for index key type: " + entry.getValue());<NEW_LINE>}<NEW_LINE>idxConfig.addProperty(entry.getKey(), val);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return createView(database, cfg);<NEW_LINE>}
metadata.get("updatable")));
1,597,170
public HashMap pageContent(String query, String sortBy, String perPage, String currentPageNumber) {<NEW_LINE>HashMap retMap = new HashMap();<NEW_LINE>int pageNumber = 1;<NEW_LINE>try {<NEW_LINE>pageNumber = Integer.parseInt(currentPageNumber);<NEW_LINE>} catch (Exception e) {<NEW_LINE>}<NEW_LINE>int displayPerPage = Config.getIntProperty("PER_PAGE");<NEW_LINE>try {<NEW_LINE>displayPerPage = Integer.parseInt(perPage);<NEW_LINE>} catch (Exception e) {<NEW_LINE>}<NEW_LINE>int minIndex = (pageNumber - 1) * displayPerPage;<NEW_LINE>int maxIndex = displayPerPage * pageNumber;<NEW_LINE>int limit = 0;<NEW_LINE>List<Map> l = new ArrayList<Map>();<NEW_LINE>SearchHits hits = null;<NEW_LINE>List<Contentlet> c = new ArrayList<Contentlet>();<NEW_LINE>try {<NEW_LINE>c = APILocator.getContentletAPI().search(query, limit, -1, sortBy, user, true);<NEW_LINE>} catch (Exception ex) {<NEW_LINE>Logger.error(this.getClass(<MASK><NEW_LINE>}<NEW_LINE>for (int i = minIndex; i < c.size(); i++) {<NEW_LINE>if (i == maxIndex) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>Map<String, Object> hm = new HashMap<String, Object>();<NEW_LINE>hm.put("inode", c.get(i).getInode());<NEW_LINE>hm.put("identifier", c.get(i).getIdentifier());<NEW_LINE>l.add(hm);<NEW_LINE>} catch (Exception e) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>retMap.put("_inodeList", l);<NEW_LINE>retMap.put("_total", String.valueOf(c.size()));<NEW_LINE>return retMap;<NEW_LINE>}
), "indexSearch: Error Searching Contentlets - lucene query: " + query, ex);
1,453,543
public Result track() throws Exception {<NEW_LINE>if (!_isEnabled) {<NEW_LINE>// If tracking is disabled, simply return a 200.<NEW_LINE>return status(200);<NEW_LINE>}<NEW_LINE>JsonNode event;<NEW_LINE>try {<NEW_LINE>event = request().body().asJson();<NEW_LINE>} catch (Exception e) {<NEW_LINE>return badRequest();<NEW_LINE>}<NEW_LINE>final String actor = ctx().session().get(ACTOR);<NEW_LINE>try {<NEW_LINE>_logger.debug(String.format("Emitting product analytics event. actor: %s, event: %s", actor, event));<NEW_LINE>final ProducerRecord<String, String> record = new ProducerRecord<>(_topic, actor, event.toString());<NEW_LINE>_producer.send(record);<NEW_LINE>_producer.flush();<NEW_LINE>return ok();<NEW_LINE>} catch (Exception e) {<NEW_LINE>_logger.error(String.format<MASK><NEW_LINE>return internalServerError(e.getMessage());<NEW_LINE>}<NEW_LINE>}
("Failed to emit product analytics event. actor: %s, event: %s", actor, event));
403,670
public static ParallelTransferOptions populateAndApplyDefaults(ParallelTransferOptions other) {<NEW_LINE>other = other == <MASK><NEW_LINE>Long blockSize = other.getBlockSizeLong();<NEW_LINE>if (blockSize == null) {<NEW_LINE>blockSize = (long) BlobAsyncClient.BLOB_DEFAULT_UPLOAD_BLOCK_SIZE;<NEW_LINE>}<NEW_LINE>Integer maxConcurrency = other.getMaxConcurrency();<NEW_LINE>if (maxConcurrency == null) {<NEW_LINE>maxConcurrency = BlobAsyncClient.BLOB_DEFAULT_NUMBER_OF_BUFFERS;<NEW_LINE>}<NEW_LINE>Long maxSingleUploadSize = other.getMaxSingleUploadSizeLong();<NEW_LINE>if (maxSingleUploadSize == null) {<NEW_LINE>maxSingleUploadSize = BLOB_DEFAULT_MAX_SINGLE_UPLOAD_SIZE;<NEW_LINE>}<NEW_LINE>return new ParallelTransferOptions().setBlockSizeLong(blockSize).setMaxConcurrency(maxConcurrency).setProgressReceiver(other.getProgressReceiver()).setMaxSingleUploadSizeLong(maxSingleUploadSize);<NEW_LINE>}
null ? new ParallelTransferOptions() : other;
500,695
static String parseAttr(Pointer attr) {<NEW_LINE>int valueTag = Cups.INSTANCE.ippGetValueTag(attr);<NEW_LINE>int attrCount = Cups.INSTANCE.ippGetCount(attr);<NEW_LINE>String data = "";<NEW_LINE>String attrName = Cups.INSTANCE.ippGetName(attr);<NEW_LINE>for (int i = 0; i < attrCount; i++) {<NEW_LINE>if (valueTag == Cups.INSTANCE.ippTagValue("Integer")) {<NEW_LINE>data += Cups.<MASK><NEW_LINE>} else if (valueTag == Cups.INSTANCE.ippTagValue("Boolean")) {<NEW_LINE>data += (Cups.INSTANCE.ippGetInteger(attr, i) == 1);<NEW_LINE>} else if (valueTag == Cups.INSTANCE.ippTagValue("Enum")) {<NEW_LINE>data += Cups.INSTANCE.ippEnumString(attrName, Cups.INSTANCE.ippGetInteger(attr, i));<NEW_LINE>} else {<NEW_LINE>data += Cups.INSTANCE.ippGetString(attr, i, "");<NEW_LINE>}<NEW_LINE>if (i + 1 < attrCount) {<NEW_LINE>data += ", ";<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (attrName == null) {<NEW_LINE>return "------------------------";<NEW_LINE>}<NEW_LINE>return String.format("%s: %d %s {%s}", attrName, attrCount, Cups.INSTANCE.ippTagString(valueTag), data);<NEW_LINE>}
INSTANCE.ippGetInteger(attr, i);
387,715
public static void main(String[] args) throws IOException {<NEW_LINE>final TravelingSalesman tsm = new TravelingSalesman(districtCapitals().subSeq(0, 10));<NEW_LINE>final Engine<EnumGene<WayPoint>, Double> engine = Engine.builder(tsm).optimize(Optimize.MINIMUM).alterers(new SwapMutator<>(0.15), new PartiallyMatchedCrossover<>(0.15)).build();<NEW_LINE>// Create evolution statistics consumer.<NEW_LINE>final EvolutionStatistics<Double, ?> statistics = EvolutionStatistics.ofNumber();<NEW_LINE>final Phenotype<EnumGene<WayPoint>, Double> best = engine.stream().limit(1_000).peek(statistics).collect(toBestPhenotype());<NEW_LINE>final ISeq<WayPoint> path = best.genotype().chromosome().stream().map(Gene::allele).collect(ISeq.toISeq());<NEW_LINE>final GPX gpx = GPX.builder().addTrack(track -> track.name("Best Track").addSegment(s -> s.points(path.asList()))).build();<NEW_LINE>final double km = tsm.fitness(best.genotype()) / 1_000.0;<NEW_LINE>GPX.writer(" ").write(gpx, format("%s/out_%d.gpx", getProperty("user.home"<MASK><NEW_LINE>System.out.println(statistics);<NEW_LINE>System.out.println("Length: " + km);<NEW_LINE>}
), (int) km));
831,312
private Mono<Response<Flux<ByteBuffer>>> deleteWithResponseAsync(String resourceGroupName, String privateCloudName, String globalReachConnectionName, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (privateCloudName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (globalReachConnectionName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter globalReachConnectionName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, globalReachConnectionName, this.client.getApiVersion(), accept, context);<NEW_LINE>}
error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
478,490
public static DescribeDrdsParamsResponse unmarshall(DescribeDrdsParamsResponse describeDrdsParamsResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeDrdsParamsResponse.setRequestId(_ctx.stringValue("DescribeDrdsParamsResponse.RequestId"));<NEW_LINE>describeDrdsParamsResponse.setSuccess(_ctx.booleanValue("DescribeDrdsParamsResponse.Success"));<NEW_LINE>List<ListItem> list = new ArrayList<ListItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeDrdsParamsResponse.List.Length"); i++) {<NEW_LINE>ListItem listItem = new ListItem();<NEW_LINE>listItem.setParamName(_ctx.stringValue("DescribeDrdsParamsResponse.List[" + i + "].ParamName"));<NEW_LINE>listItem.setParamEnglishName(_ctx.stringValue("DescribeDrdsParamsResponse.List[" + i + "].ParamEnglishName"));<NEW_LINE>listItem.setParamVariableName(_ctx.stringValue("DescribeDrdsParamsResponse.List[" + i + "].ParamVariableName"));<NEW_LINE>listItem.setParamDesc(_ctx.stringValue("DescribeDrdsParamsResponse.List[" + i + "].ParamDesc"));<NEW_LINE>listItem.setParamValue(_ctx.stringValue("DescribeDrdsParamsResponse.List[" + i + "].ParamValue"));<NEW_LINE>listItem.setDbName(_ctx.stringValue("DescribeDrdsParamsResponse.List[" + i + "].DbName"));<NEW_LINE>listItem.setParamDefaultValue(_ctx.stringValue("DescribeDrdsParamsResponse.List[" + i + "].ParamDefaultValue"));<NEW_LINE>listItem.setParamRanges(_ctx.stringValue("DescribeDrdsParamsResponse.List[" + i + "].ParamRanges"));<NEW_LINE>listItem.setParamLevel(_ctx.stringValue("DescribeDrdsParamsResponse.List[" + i + "].ParamLevel"));<NEW_LINE>listItem.setParamType(_ctx.stringValue("DescribeDrdsParamsResponse.List[" + i + "].ParamType"));<NEW_LINE>listItem.setNeedRestart(_ctx.booleanValue("DescribeDrdsParamsResponse.List[" + i + "].NeedRestart"));<NEW_LINE>listItem.setUserVisible(_ctx.booleanValue<MASK><NEW_LINE>list.add(listItem);<NEW_LINE>}<NEW_LINE>describeDrdsParamsResponse.setList(list);<NEW_LINE>return describeDrdsParamsResponse;<NEW_LINE>}
("DescribeDrdsParamsResponse.List[" + i + "].UserVisible"));
650,890
public static DescribeActivationsResponse unmarshall(DescribeActivationsResponse describeActivationsResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeActivationsResponse.setRequestId(_ctx.stringValue("DescribeActivationsResponse.RequestId"));<NEW_LINE>describeActivationsResponse.setPageSize(_ctx.longValue("DescribeActivationsResponse.PageSize"));<NEW_LINE>describeActivationsResponse.setPageNumber(_ctx.longValue("DescribeActivationsResponse.PageNumber"));<NEW_LINE>describeActivationsResponse.setTotalCount<MASK><NEW_LINE>List<Activation> activationList = new ArrayList<Activation>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeActivationsResponse.ActivationList.Length"); i++) {<NEW_LINE>Activation activation = new Activation();<NEW_LINE>activation.setCreationTime(_ctx.stringValue("DescribeActivationsResponse.ActivationList[" + i + "].CreationTime"));<NEW_LINE>activation.setDeregisteredCount(_ctx.integerValue("DescribeActivationsResponse.ActivationList[" + i + "].DeregisteredCount"));<NEW_LINE>activation.setInstanceCount(_ctx.integerValue("DescribeActivationsResponse.ActivationList[" + i + "].InstanceCount"));<NEW_LINE>activation.setDescription(_ctx.stringValue("DescribeActivationsResponse.ActivationList[" + i + "].Description"));<NEW_LINE>activation.setRegisteredCount(_ctx.integerValue("DescribeActivationsResponse.ActivationList[" + i + "].RegisteredCount"));<NEW_LINE>activation.setInstanceName(_ctx.stringValue("DescribeActivationsResponse.ActivationList[" + i + "].InstanceName"));<NEW_LINE>activation.setDisabled(_ctx.booleanValue("DescribeActivationsResponse.ActivationList[" + i + "].Disabled"));<NEW_LINE>activation.setIpAddressRange(_ctx.stringValue("DescribeActivationsResponse.ActivationList[" + i + "].IpAddressRange"));<NEW_LINE>activation.setTimeToLiveInHours(_ctx.longValue("DescribeActivationsResponse.ActivationList[" + i + "].TimeToLiveInHours"));<NEW_LINE>activation.setActivationId(_ctx.stringValue("DescribeActivationsResponse.ActivationList[" + i + "].ActivationId"));<NEW_LINE>activationList.add(activation);<NEW_LINE>}<NEW_LINE>describeActivationsResponse.setActivationList(activationList);<NEW_LINE>return describeActivationsResponse;<NEW_LINE>}
(_ctx.longValue("DescribeActivationsResponse.TotalCount"));
1,780,120
public double pNorm(double p) {<NEW_LINE>if (p <= 0)<NEW_LINE>throw new IllegalArgumentException("norm must be a positive value, not " + p);<NEW_LINE>double result = 0;<NEW_LINE>if (p == 1) {<NEW_LINE>for (int i = startIndex; i < endIndex; i++) result += abs(array[i]);<NEW_LINE>} else if (p == 2) {<NEW_LINE>for (int i = startIndex; i < endIndex; i++) result += array<MASK><NEW_LINE>result = Math.sqrt(result);<NEW_LINE>} else if (Double.isInfinite(p)) {<NEW_LINE>for (int i = startIndex; i < endIndex; i++) result = Math.max(result, abs(array[i]));<NEW_LINE>} else {<NEW_LINE>for (int i = startIndex; i < endIndex; i++) result += Math.pow(Math.abs(array[i]), p);<NEW_LINE>result = pow(result, 1 / p);<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
[i] * array[i];
486,352
public static RemoveAlbumPhotosResponse unmarshall(RemoveAlbumPhotosResponse removeAlbumPhotosResponse, UnmarshallerContext context) {<NEW_LINE>removeAlbumPhotosResponse.setRequestId(context.stringValue("RemoveAlbumPhotosResponse.RequestId"));<NEW_LINE>removeAlbumPhotosResponse.setCode(context.stringValue("RemoveAlbumPhotosResponse.Code"));<NEW_LINE>removeAlbumPhotosResponse.setMessage(context.stringValue("RemoveAlbumPhotosResponse.Message"));<NEW_LINE>removeAlbumPhotosResponse.setAction(context.stringValue("RemoveAlbumPhotosResponse.Action"));<NEW_LINE>List<Result> results = new ArrayList<Result>();<NEW_LINE>for (int i = 0; i < context.lengthValue("RemoveAlbumPhotosResponse.Results.Length"); i++) {<NEW_LINE>Result result = new Result();<NEW_LINE>result.setId(context.longValue<MASK><NEW_LINE>result.setIdStr(context.stringValue("RemoveAlbumPhotosResponse.Results[" + i + "].IdStr"));<NEW_LINE>result.setCode(context.stringValue("RemoveAlbumPhotosResponse.Results[" + i + "].Code"));<NEW_LINE>result.setMessage(context.stringValue("RemoveAlbumPhotosResponse.Results[" + i + "].Message"));<NEW_LINE>results.add(result);<NEW_LINE>}<NEW_LINE>removeAlbumPhotosResponse.setResults(results);<NEW_LINE>return removeAlbumPhotosResponse;<NEW_LINE>}
("RemoveAlbumPhotosResponse.Results[" + i + "].Id"));
309,904
final DeleteDocumentationVersionResult executeDeleteDocumentationVersion(DeleteDocumentationVersionRequest deleteDocumentationVersionRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteDocumentationVersionRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<DeleteDocumentationVersionRequest> request = null;<NEW_LINE>Response<DeleteDocumentationVersionResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteDocumentationVersionRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteDocumentationVersionRequest));<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, "API Gateway");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteDocumentationVersion");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteDocumentationVersionResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteDocumentationVersionResultJsonUnmarshaller());<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.ClientExecuteTime);
102,996
public void execute(ObjectNode incomingMessage, HttpServletRequest httpRequest, Writer out) {<NEW_LINE>JsonFactory jsonFactory = new JsonFactory();<NEW_LINE>JsonGenerator writer = null;<NEW_LINE>try {<NEW_LINE>writer = jsonFactory.createGenerator(out);<NEW_LINE>writer.writeStartObject();<NEW_LINE>String token = incomingMessage.has("token") ? incomingMessage.get("token").asText() : null;<NEW_LINE>String oAuthCode = incomingMessage.has("oauthcode") ? incomingMessage.get("oauthcode").asText() : null;<NEW_LINE>long messageId = incomingMessage.has("id") ? incomingMessage.get("id").asLong() : -1;<NEW_LINE>if (messageId != -1) {<NEW_LINE>writer.writeFieldName("id");<NEW_LINE>writer.writeNumber(messageId);<NEW_LINE>}<NEW_LINE>if (incomingMessage.has("request")) {<NEW_LINE>writer.writeFieldName("response");<NEW_LINE>processSingleRequest((ObjectNode) incomingMessage.get("request"), token, oAuthCode, httpRequest, writer);<NEW_LINE>} else if (incomingMessage.has("requests")) {<NEW_LINE>processMultiRequest((ArrayNode) incomingMessage.get("requests"), token, oAuthCode, httpRequest, writer);<NEW_LINE>}<NEW_LINE>} catch (Throwable throwable) {<NEW_LINE>if (throwable instanceof UserException) {<NEW_LINE>} else {<NEW_LINE>LOGGER.info(incomingMessage.toString());<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>// throwable.printStackTrace();<NEW_LINE>handleThrowable(writer, throwable);<NEW_LINE>} finally {<NEW_LINE>try {<NEW_LINE>writer.writeEndObject();<NEW_LINE>writer.close();<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOGGER.error("", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
LOGGER.info("", throwable);
656,370
public void taskCompleted(UndoableDomainObject obj, BackgroundCommandTask task, TaskMonitor monitor) {<NEW_LINE>double taskTime = (System.currentTimeMillis() - startTaskTime) / 1000.00;<NEW_LINE>Msg.debug(this, time() + task.getTaskTitle() + " task finish (" + taskTime + " secs)");<NEW_LINE>obj.flushEvents();<NEW_LINE>try {<NEW_LINE>while (!monitor.isCancelled()) {<NEW_LINE>BackgroundCommand cmd;<NEW_LINE>synchronized (this) {<NEW_LINE>cmd = getNextCommand(obj);<NEW_LINE>if (cmd == null) {<NEW_LINE>// any late follow-on commands will require a new task<NEW_LINE>task.setDoneQueueProcessing();<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Msg.debug(this, time() + "Queue - " + cmd.getName());<NEW_LINE>toolTaskMonitor.updateTaskCmd(cmd);<NEW_LINE>long localStart = System.currentTimeMillis();<NEW_LINE>cmd.applyTo(obj, monitor);<NEW_LINE>cmd.taskCompleted();<NEW_LINE>double totalTime = (System.currentTimeMillis() - localStart) / 1000.00;<NEW_LINE>Msg.debug(this, time() + "(" + totalTime + " secs)");<NEW_LINE>obj.flushEvents();<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>try {<NEW_LINE>if (monitor.isCancelled()) {<NEW_LINE>clearQueuedCommands(obj);<NEW_LINE>if (tool != null) {<NEW_LINE>tool.setStatusInfo(task.getCommand().getName() + " cancelled");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>synchronized (this) {<NEW_LINE>Integer openForgroundTransactionID = openForgroundTransactionIDs.remove(obj);<NEW_LINE>if (openForgroundTransactionID != null) {<NEW_LINE>obj.endTransaction(openForgroundTransactionID, true);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>if (currentTask.isModal()) {<NEW_LINE>modalTaskDialog.taskProcessed();<NEW_LINE>modalTaskDialog = null;<NEW_LINE>} else {<NEW_LINE>toolTaskMonitor.taskCompleted(currentTask);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>task.getCommand().taskCompleted();<NEW_LINE>double totalTime = (System.<MASK><NEW_LINE>Msg.debug(this, time() + task.getTaskTitle() + " task complete (" + totalTime + " secs)");<NEW_LINE>}
currentTimeMillis() - startTaskTime) / 1000.00;
1,193,500
final GetRecordResult executeGetRecord(GetRecordRequest getRecordRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getRecordRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetRecordRequest> request = null;<NEW_LINE>Response<GetRecordResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetRecordRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getRecordRequest));<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, "SageMaker FeatureStore Runtime");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetRecord");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetRecordResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetRecordResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
1,559,743
public void onSaveInstanceState(@NonNull Bundle outState) {<NEW_LINE>super.onSaveInstanceState(outState);<NEW_LINE>outState.putInt(KEY_SELECTED_YEAR, mCalendar.get(Calendar.YEAR));<NEW_LINE>outState.putInt(KEY_SELECTED_MONTH, mCalendar.get(Calendar.MONTH));<NEW_LINE>outState.putInt(KEY_SELECTED_DAY, mCalendar.get(Calendar.DAY_OF_MONTH));<NEW_LINE>outState.putInt(KEY_WEEK_START, mWeekStart);<NEW_LINE><MASK><NEW_LINE>int listPosition = -1;<NEW_LINE>if (mCurrentView == MONTH_AND_DAY_VIEW) {<NEW_LINE>listPosition = mDayPickerView.getMostVisiblePosition();<NEW_LINE>} else if (mCurrentView == YEAR_VIEW) {<NEW_LINE>listPosition = mYearPickerView.getFirstVisiblePosition();<NEW_LINE>outState.putInt(KEY_LIST_POSITION_OFFSET, mYearPickerView.getFirstPositionOffset());<NEW_LINE>}<NEW_LINE>outState.putInt(KEY_LIST_POSITION, listPosition);<NEW_LINE>outState.putSerializable(KEY_HIGHLIGHTED_DAYS, highlightedDays);<NEW_LINE>outState.putBoolean(KEY_THEME_DARK, mThemeDark);<NEW_LINE>outState.putBoolean(KEY_THEME_DARK_CHANGED, mThemeDarkChanged);<NEW_LINE>if (mAccentColor != null)<NEW_LINE>outState.putInt(KEY_ACCENT, mAccentColor);<NEW_LINE>outState.putBoolean(KEY_VIBRATE, mVibrate);<NEW_LINE>outState.putBoolean(KEY_DISMISS, mDismissOnPause);<NEW_LINE>outState.putBoolean(KEY_AUTO_DISMISS, mAutoDismiss);<NEW_LINE>outState.putInt(KEY_DEFAULT_VIEW, mDefaultView);<NEW_LINE>outState.putString(KEY_TITLE, mTitle);<NEW_LINE>outState.putInt(KEY_OK_RESID, mOkResid);<NEW_LINE>outState.putString(KEY_OK_STRING, mOkString);<NEW_LINE>if (mOkColor != null)<NEW_LINE>outState.putInt(KEY_OK_COLOR, mOkColor);<NEW_LINE>outState.putInt(KEY_CANCEL_RESID, mCancelResid);<NEW_LINE>outState.putString(KEY_CANCEL_STRING, mCancelString);<NEW_LINE>if (mCancelColor != null)<NEW_LINE>outState.putInt(KEY_CANCEL_COLOR, mCancelColor);<NEW_LINE>outState.putSerializable(KEY_VERSION, mVersion);<NEW_LINE>outState.putSerializable(KEY_SCROLL_ORIENTATION, mScrollOrientation);<NEW_LINE>outState.putSerializable(KEY_TIMEZONE, mTimezone);<NEW_LINE>outState.putParcelable(KEY_DATERANGELIMITER, mDateRangeLimiter);<NEW_LINE>outState.putSerializable(KEY_LOCALE, mLocale);<NEW_LINE>}
outState.putInt(KEY_CURRENT_VIEW, mCurrentView);
94,272
public void performOperation(Random rnd, Genome[] parents, int parentIndex, Genome[] offspring, int offspringIndex) {<NEW_LINE>IntegerArrayGenome mother = (IntegerArrayGenome) parents[parentIndex];<NEW_LINE>IntegerArrayGenome father = (IntegerArrayGenome) parents[parentIndex + 1];<NEW_LINE>IntegerArrayGenome offspring1 = (IntegerArrayGenome) this.owner.getPopulation().getGenomeFactory().factor();<NEW_LINE>IntegerArrayGenome offspring2 = (IntegerArrayGenome) this.owner.getPopulation().getGenomeFactory().factor();<NEW_LINE>offspring[offspringIndex] = offspring1;<NEW_LINE>offspring[offspringIndex + 1] = offspring2;<NEW_LINE>final int geneLength = mother.size();<NEW_LINE>// the chromosome must be cut at two positions, determine them<NEW_LINE>final int cutpoint1 = (int) (rnd.nextInt(geneLength - this.cutLength));<NEW_LINE>final int cutpoint2 = cutpoint1 + this.cutLength;<NEW_LINE>// keep track of which genes have been taken in each of the two<NEW_LINE>// offspring, defaults to false.<NEW_LINE>final Set<Integer> taken1 = new HashSet<Integer>();<NEW_LINE>final Set<Integer> taken2 = new HashSet<Integer>();<NEW_LINE>// handle cut section<NEW_LINE>for (int i = 0; i < geneLength; i++) {<NEW_LINE>if (!((i < cutpoint1) || (i > cutpoint2))) {<NEW_LINE>offspring1.<MASK><NEW_LINE>offspring2.copy(mother, i, i);<NEW_LINE>taken1.add(father.getData()[i]);<NEW_LINE>taken2.add(mother.getData()[i]);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// handle outer sections<NEW_LINE>for (int i = 0; i < geneLength; i++) {<NEW_LINE>if ((i < cutpoint1) || (i > cutpoint2)) {<NEW_LINE>offspring1.getData()[i] = SpliceNoRepeat.getNotTaken(mother, taken1);<NEW_LINE>offspring2.getData()[i] = SpliceNoRepeat.getNotTaken(father, taken2);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
copy(father, i, i);
820,199
public IpAddress allocateIP(Account ipOwner, long zoneId, Long networkId, Boolean displayIp, String ipaddress) throws ResourceAllocationException, InsufficientAddressCapacityException, ConcurrentOperationException {<NEW_LINE>Account caller = CallContext.current().getCallingAccount();<NEW_LINE>long callerUserId = CallContext.current().getCallingUserId();<NEW_LINE>DataCenter zone = _entityMgr.findById(DataCenter.class, zoneId);<NEW_LINE>if (networkId != null) {<NEW_LINE>Network network = _networksDao.findById(networkId);<NEW_LINE>if (network == null) {<NEW_LINE>throw new InvalidParameterValueException("Invalid network id is given");<NEW_LINE>}<NEW_LINE>if (network.getGuestType() == Network.GuestType.Shared) {<NEW_LINE>if (zone == null) {<NEW_LINE>throw new InvalidParameterValueException("Invalid zone Id is given");<NEW_LINE>}<NEW_LINE>// if shared network in the advanced zone, then check the caller against the network for 'AccessType.UseNetwork'<NEW_LINE>if (zone.getNetworkType() == NetworkType.Advanced) {<NEW_LINE>if (isSharedNetworkOfferingWithServices(network.getNetworkOfferingId())) {<NEW_LINE>_accountMgr.checkAccess(caller, AccessType.UseEntry, false, network);<NEW_LINE>if (s_logger.isDebugEnabled()) {<NEW_LINE>s_logger.debug("Associate IP address called by the user " + callerUserId + " account " + ipOwner.getId());<NEW_LINE>}<NEW_LINE>return _ipAddrMgr.allocateIp(ipOwner, false, caller, <MASK><NEW_LINE>} else {<NEW_LINE>throw new InvalidParameterValueException("Associate IP address can only be called on the shared networks in the advanced zone" + " with Firewall/Source Nat/Static Nat/Port Forwarding/Load balancing services enabled");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>_accountMgr.checkAccess(caller, null, false, ipOwner);<NEW_LINE>}<NEW_LINE>return _ipAddrMgr.allocateIp(ipOwner, false, caller, callerUserId, zone, displayIp, ipaddress);<NEW_LINE>}
callerUserId, zone, displayIp, ipaddress);
76,046
public boolean renew(String appName, String id, boolean isReplication) {<NEW_LINE>RENEW.increment(isReplication);<NEW_LINE>Map<String, Lease<InstanceInfo>> gMap = registry.get(appName);<NEW_LINE>Lease<InstanceInfo> leaseToRenew = null;<NEW_LINE>if (gMap != null) {<NEW_LINE>leaseToRenew = gMap.get(id);<NEW_LINE>}<NEW_LINE>if (leaseToRenew == null) {<NEW_LINE>RENEW_NOT_FOUND.increment(isReplication);<NEW_LINE>logger.warn("DS: Registry: lease doesn't exist, registering resource: {} - {}", appName, id);<NEW_LINE>return false;<NEW_LINE>} else {<NEW_LINE>InstanceInfo instanceInfo = leaseToRenew.getHolder();<NEW_LINE>if (instanceInfo != null) {<NEW_LINE>// touchASGCache(instanceInfo.getASGName());<NEW_LINE>InstanceStatus overriddenInstanceStatus = this.getOverriddenInstanceStatus(instanceInfo, leaseToRenew, isReplication);<NEW_LINE>if (overriddenInstanceStatus == InstanceStatus.UNKNOWN) {<NEW_LINE>logger.info("Instance status UNKNOWN possibly due to deleted override for instance {}" + <MASK><NEW_LINE>RENEW_NOT_FOUND.increment(isReplication);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (!instanceInfo.getStatus().equals(overriddenInstanceStatus)) {<NEW_LINE>logger.info("The instance status {} is different from overridden instance status {} for instance {}. " + "Hence setting the status to overridden status", instanceInfo.getStatus().name(), overriddenInstanceStatus.name(), instanceInfo.getId());<NEW_LINE>instanceInfo.setStatusWithoutDirty(overriddenInstanceStatus);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>renewsLastMin.increment();<NEW_LINE>leaseToRenew.renew();<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}
"; re-register required", instanceInfo.getId());
465,578
private void shutdownDerbyEmbedded() {<NEW_LINE>final <MASK><NEW_LINE>if (trace && tc.isEntryEnabled())<NEW_LINE>Tr.entry(this, tc, "shutdownDerbyEmbedded", classloader, embDerbyRefCount);<NEW_LINE>// Shut down Derby embedded if the reference count drops to 0<NEW_LINE>if (embDerbyRefCount.remove(classloader) && !embDerbyRefCount.contains(classloader))<NEW_LINE>try {<NEW_LINE>Class<?> EmbDS = AdapterUtil.forNameWithPriv("org.apache.derby.jdbc.EmbeddedDataSource40", true, classloader);<NEW_LINE>DataSource ds = (DataSource) EmbDS.newInstance();<NEW_LINE>EmbDS.getMethod("setShutdownDatabase", String.class).invoke(ds, "shutdown");<NEW_LINE>ds.getConnection().close();<NEW_LINE>if (trace && tc.isEntryEnabled())<NEW_LINE>Tr.exit(this, tc, "shutdownDerbyEmbedded");<NEW_LINE>} catch (SQLException x) {<NEW_LINE>// expected for shutdown<NEW_LINE>if (trace && tc.isEntryEnabled())<NEW_LINE>Tr.exit(this, tc, "shutdownDerbyEmbedded", x.getSQLState() + ' ' + x.getErrorCode() + ':' + x.getMessage());<NEW_LINE>} catch (Throwable x) {<NEW_LINE>// Work around Derby issue when the JVM is shutting down while Derby shutdown is requested.<NEW_LINE>if (trace && tc.isEntryEnabled())<NEW_LINE>Tr.exit(this, tc, "shutdownDerbyEmbedded", x);<NEW_LINE>}<NEW_LINE>else if (trace && tc.isEntryEnabled())<NEW_LINE>Tr.exit(this, tc, "shutdownDerbyEmbedded", false);<NEW_LINE>}
boolean trace = TraceComponent.isAnyTracingEnabled();
425,294
public static JMethodCall transformToNullMethodCall(JMethodCall x, JProgram program) {<NEW_LINE>JExpression instance = x.getInstance();<NEW_LINE>List<JExpression> args = x.getArgs();<NEW_LINE>if (program.isStaticImpl(x.getTarget())) {<NEW_LINE><MASK><NEW_LINE>args = args.subList(1, args.size());<NEW_LINE>} else {<NEW_LINE>// assert !x.getTarget().isStatic();<NEW_LINE>if (x.getTarget().isStatic() && instance == null) {<NEW_LINE>instance = program.getLiteralNull();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>assert (instance != null);<NEW_LINE>if (!instance.hasSideEffects()) {<NEW_LINE>instance = program.getLiteralNull();<NEW_LINE>}<NEW_LINE>JMethodCall newCall = new JMethodCall(x.getSourceInfo(), instance, program.getNullMethod());<NEW_LINE>newCall.overrideReturnType(primitiveTypeOrNullTypeOrArray(program, x.getType()));<NEW_LINE>// Retain the original arguments, they will be evaluated for side effects.<NEW_LINE>for (JExpression arg : args) {<NEW_LINE>if (arg.hasSideEffects()) {<NEW_LINE>newCall.addArg(arg);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return newCall;<NEW_LINE>}
instance = args.get(0);
1,327,533
public static void preInit() {<NEW_LINE>laser = HELPER.addBlockAndItem(new BlockLaser(Material.IRON, "block.laser"));<NEW_LINE>assemblyTable = <MASK><NEW_LINE>advancedCraftingTable = createLaserTable(EnumLaserTableType.ADVANCED_CRAFTING_TABLE, "block.advanced_crafting_table");<NEW_LINE>integrationTable = createLaserTable(EnumLaserTableType.INTEGRATION_TABLE, "block.integration_table");<NEW_LINE>if (BCLib.DEV) {<NEW_LINE>chargingTable = createLaserTable(EnumLaserTableType.CHARGING_TABLE, "block.charging_table");<NEW_LINE>programmingTable = createLaserTable(EnumLaserTableType.PROGRAMMING_TABLE, "block.programming_table");<NEW_LINE>}<NEW_LINE>HELPER.registerTile(TileLaser.class, "tile.laser");<NEW_LINE>HELPER.registerTile(TileAssemblyTable.class, "tile.assembly_table");<NEW_LINE>HELPER.registerTile(TileAdvancedCraftingTable.class, "tile.advanced_crafting_table");<NEW_LINE>HELPER.registerTile(TileIntegrationTable.class, "tile.integration_table");<NEW_LINE>if (BCLib.DEV) {<NEW_LINE>HELPER.registerTile(TileChargingTable.class, "tile.charging_table");<NEW_LINE>HELPER.registerTile(TileProgrammingTable_Neptune.class, "tile.programming_table");<NEW_LINE>}<NEW_LINE>}
createLaserTable(EnumLaserTableType.ASSEMBLY_TABLE, "block.assembly_table");
3,378
protected void startFile(File file) {<NEW_LINE>currentFile = file;<NEW_LINE>AudioFormat format;<NEW_LINE>try {<NEW_LINE>format = AudioSystem.getAudioFileFormat(file).getFormat();<NEW_LINE>float samplerate = format.getSampleRate();<NEW_LINE>int size = 1024;<NEW_LINE>int overlap = 0;<NEW_LINE>PitchResyntheziser prs = new PitchResyntheziser(samplerate);<NEW_LINE>estimationGain = new GainProcessor(estimationGainSlider.getValue() / 100.0);<NEW_LINE>estimationDispatcher = AudioDispatcherFactory.fromFile(file, size, overlap);<NEW_LINE>estimationDispatcher.addAudioProcessor(new PitchProcessor(algo, samplerate, size, prs));<NEW_LINE>estimationDispatcher.addAudioProcessor(estimationGain);<NEW_LINE>estimationDispatcher.addAudioProcessor(new AudioPlayer(format));<NEW_LINE>sourceGain = new GainProcessor(sourceGainSlider.getValue() / 100.0);<NEW_LINE>sourceDispatcher = AudioDispatcherFactory.fromFile(file, size, overlap);<NEW_LINE>sourceDispatcher.addAudioProcessor(sourceGain);<NEW_LINE>sourceDispatcher.addAudioProcessor(new AudioPlayer(format));<NEW_LINE>new Thread(estimationDispatcher).start();<NEW_LINE>new <MASK><NEW_LINE>} catch (UnsupportedAudioFileException e) {<NEW_LINE>// TODO Auto-generated catch block<NEW_LINE>e.printStackTrace();<NEW_LINE>} catch (IOException e) {<NEW_LINE>// TODO Auto-generated catch block<NEW_LINE>e.printStackTrace();<NEW_LINE>} catch (LineUnavailableException e) {<NEW_LINE>// TODO Auto-generated catch block<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>}
Thread(sourceDispatcher).start();
1,580,804
public ApiResponse<Void> testJsonFormDataWithHttpInfo(String param, String param2) throws ApiException {<NEW_LINE>HttpRequest.Builder localVarRequestBuilder = testJsonFormDataRequestBuilder(param, param2);<NEW_LINE>try {<NEW_LINE>HttpResponse<InputStream> localVarResponse = memberVarHttpClient.send(localVarRequestBuilder.build(), <MASK><NEW_LINE>if (memberVarResponseInterceptor != null) {<NEW_LINE>memberVarResponseInterceptor.accept(localVarResponse);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>if (localVarResponse.statusCode() / 100 != 2) {<NEW_LINE>throw getApiException("testJsonFormData", localVarResponse);<NEW_LINE>}<NEW_LINE>return new ApiResponse<Void>(localVarResponse.statusCode(), localVarResponse.headers().map(), null);<NEW_LINE>} finally {<NEW_LINE>// Drain the InputStream<NEW_LINE>while (localVarResponse.body().read() != -1) {<NEW_LINE>// Ignore<NEW_LINE>}<NEW_LINE>localVarResponse.body().close();<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new ApiException(e);<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>Thread.currentThread().interrupt();<NEW_LINE>throw new ApiException(e);<NEW_LINE>}<NEW_LINE>}
HttpResponse.BodyHandlers.ofInputStream());
804,597
protected void drawText(Canvas canvas, ViewDetailsPreferences.Preferences preferences, int day) {<NEW_LINE>CharSequence baseText = getBaseText(preferences);<NEW_LINE>final int linesNo = mFormat.getEventLines();<NEW_LINE>final int span = mFormat.getDaySpan(day);<NEW_LINE>if (mFormat.isPartiallyHidden()) {<NEW_LINE>preFormatText(preferences, span);<NEW_LINE>}<NEW_LINE>for (int i = 0; i < linesNo; i++) {<NEW_LINE>CharSequence lineText;<NEW_LINE>if (i == linesNo - 1) {<NEW_LINE>lineText = getFormattedText(baseText.subSequence(mTextLayout.getLineStart(i), baseText<MASK><NEW_LINE>} else {<NEW_LINE>lineText = baseText.subSequence(mTextLayout.getLineStart(i), mTextLayout.getLineEnd(i));<NEW_LINE>}<NEW_LINE>canvas.drawText(lineText.toString(), mBoundaries.getTextX(), mBoundaries.getTextY(), getTextPaint());<NEW_LINE>mBoundaries.moveLinesDown(1);<NEW_LINE>}<NEW_LINE>}
.length()), span);
268,898
public static byte[] generate(byte[] P, byte[] S, int N, int r, int p, int dkLen) {<NEW_LINE>if (P == null) {<NEW_LINE>throw new IllegalArgumentException("Passphrase P must be provided.");<NEW_LINE>}<NEW_LINE>if (S == null) {<NEW_LINE>throw new IllegalArgumentException("Salt S must be provided.");<NEW_LINE>}<NEW_LINE>if (N <= 1 || !isPowerOf2(N)) {<NEW_LINE>throw new IllegalArgumentException("Cost parameter N must be > 1 and a power of 2");<NEW_LINE>}<NEW_LINE>// Only value of r that cost (as an int) could be exceeded for is 1<NEW_LINE>if (r == 1 && N >= 65536) {<NEW_LINE>throw new IllegalArgumentException("Cost parameter N must be > 1 and < 65536.");<NEW_LINE>}<NEW_LINE>if (r < 1) {<NEW_LINE>throw new IllegalArgumentException("Block size r must be >= 1.");<NEW_LINE>}<NEW_LINE>int maxParallel = Integer.MAX_VALUE / (128 * r * 8);<NEW_LINE>if (p < 1 || p > maxParallel) {<NEW_LINE>throw new IllegalArgumentException("Parallelisation parameter p must be >= 1 and <= " + <MASK><NEW_LINE>}<NEW_LINE>if (dkLen < 1) {<NEW_LINE>throw new IllegalArgumentException("Generated key length dkLen must be >= 1.");<NEW_LINE>}<NEW_LINE>return MFcrypt(P, S, N, r, p, dkLen);<NEW_LINE>}
maxParallel + " (based on block size r of " + r + ")");
388,808
public DescribeConfigurationSettingsResult unmarshall(StaxUnmarshallerContext context) throws Exception {<NEW_LINE>DescribeConfigurationSettingsResult describeConfigurationSettingsResult = new DescribeConfigurationSettingsResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>if (context.isStartOfDocument())<NEW_LINE>targetDepth += 2;<NEW_LINE>while (true) {<NEW_LINE>XMLEvent xmlEvent = context.nextEvent();<NEW_LINE>if (xmlEvent.isEndDocument())<NEW_LINE>return describeConfigurationSettingsResult;<NEW_LINE>if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) {<NEW_LINE>if (context.testExpression("ConfigurationSettings", targetDepth)) {<NEW_LINE>describeConfigurationSettingsResult.withConfigurationSettings(new ArrayList<ConfigurationSettingsDescription>());<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("ConfigurationSettings/member", targetDepth)) {<NEW_LINE>describeConfigurationSettingsResult.withConfigurationSettings(ConfigurationSettingsDescriptionStaxUnmarshaller.getInstance<MASK><NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>} else if (xmlEvent.isEndElement()) {<NEW_LINE>if (context.getCurrentDepth() < originalDepth) {<NEW_LINE>return describeConfigurationSettingsResult;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
().unmarshall(context));
10,632
public IRubyObject rpartition(ThreadContext context, IRubyObject arg) {<NEW_LINE>Ruby runtime = context.runtime;<NEW_LINE>final int pos;<NEW_LINE>final RubyString sep;<NEW_LINE>if (arg instanceof RubyRegexp) {<NEW_LINE>IRubyObject tmp = rindex(context, arg);<NEW_LINE>if (tmp.isNil())<NEW_LINE>return rpartitionMismatch(runtime);<NEW_LINE>pos = tmp.convertToInteger().getIntValue();<NEW_LINE>sep = (RubyString) RubyRegexp.nth_match(<MASK><NEW_LINE>} else {<NEW_LINE>IRubyObject tmp = arg.checkStringType();<NEW_LINE>if (tmp.isNil())<NEW_LINE>throw runtime.newTypeError("type mismatch: " + arg.getMetaClass().getName() + " given");<NEW_LINE>sep = (RubyString) tmp;<NEW_LINE>pos = StringSupport.rindex(value, StringSupport.strLengthFromRubyString(this, this.checkEncoding(sep)), StringSupport.strLengthFromRubyString(sep, this.checkEncoding(sep)), subLength(value.getRealSize()), sep, this.checkEncoding(sep));<NEW_LINE>if (pos < 0)<NEW_LINE>return rpartitionMismatch(runtime);<NEW_LINE>}<NEW_LINE>return RubyArray.newArrayNoCopy(runtime, new IRubyObject[] { substr19(runtime, 0, pos), sep, substr19(runtime, pos + sep.strLength(), value.getRealSize()) });<NEW_LINE>}
0, context.getLocalMatchOrNil());
423,981
public void event(TargetObject object, TargetThread eventThread, TargetEventType type, String description, List<Object> parameters) {<NEW_LINE>if (!valid) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>TimedMsg.debug(this, "Event: " + type + " thread=" + eventThread + " description=" + description + " params=" + parameters);<NEW_LINE>// Just use this to step the snaps. Creation/destruction still handled in add/remove<NEW_LINE>if (eventThread == null) {<NEW_LINE>if (!type.equals(TargetEventType.PROCESS_CREATED)) {<NEW_LINE>Msg.error(this, "Null eventThread for " + type);<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (!eventApplies(eventThread, type, parameters)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (type == TargetEventType.RUNNING) {<NEW_LINE>ignoreInvalidation = true;<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>ManagedThreadRecorder rec = recorder.getThreadRecorder(eventThread);<NEW_LINE>recorder.createSnapshot(description, rec == null ? null : rec.getTraceThread(), null);<NEW_LINE>ignoreInvalidation = false;<NEW_LINE>if (type == TargetEventType.MODULE_LOADED) {<NEW_LINE>long snap = recorder.getSnap();<NEW_LINE>Object p0 = parameters.get(0);<NEW_LINE>if (!(p0 instanceof TargetModule)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>TargetModule mod = (TargetModule) p0;<NEW_LINE>String modPath = mod.getJoinedPath(".");<NEW_LINE>recorder.parTx.execute("Adjust module load: " + modPath, () -> {<NEW_LINE>TraceModule traceModule = recorder.getTraceModule(mod);<NEW_LINE>if (traceModule == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>traceModule.setLoadedSnap(snap);<NEW_LINE>} catch (DuplicateNameException e) {<NEW_LINE>Msg.<MASK><NEW_LINE>}<NEW_LINE>}, modPath);<NEW_LINE>}<NEW_LINE>}
error(this, "Could not set module loaded snap", e);
854,581
final GetWirelessGatewayTaskResult executeGetWirelessGatewayTask(GetWirelessGatewayTaskRequest getWirelessGatewayTaskRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getWirelessGatewayTaskRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetWirelessGatewayTaskRequest> request = null;<NEW_LINE>Response<GetWirelessGatewayTaskResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetWirelessGatewayTaskRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getWirelessGatewayTaskRequest));<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, "IoT Wireless");<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<GetWirelessGatewayTaskResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetWirelessGatewayTaskResultJsonUnmarshaller());<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, "GetWirelessGatewayTask");
1,174,891
public static Ifc2x3tc1Package init() {<NEW_LINE>if (isInited)<NEW_LINE>return (Ifc2x3tc1Package) EPackage.Registry.INSTANCE.getEPackage(Ifc2x3tc1Package.eNS_URI);<NEW_LINE>// Obtain or create and register package<NEW_LINE>Object registeredIfc2x3tc1Package = EPackage.Registry.INSTANCE.get(eNS_URI);<NEW_LINE>Ifc2x3tc1PackageImpl theIfc2x3tc1Package = registeredIfc2x3tc1Package instanceof Ifc2x3tc1PackageImpl ? (Ifc2x3tc1PackageImpl) registeredIfc2x3tc1Package : new Ifc2x3tc1PackageImpl();<NEW_LINE>isInited = true;<NEW_LINE>// Obtain or create and register interdependencies<NEW_LINE>Object registeredPackage = EPackage.Registry.INSTANCE.getEPackage(GeometryPackage.eNS_URI);<NEW_LINE>GeometryPackageImpl theGeometryPackage = (GeometryPackageImpl) (registeredPackage instanceof GeometryPackageImpl ? registeredPackage : GeometryPackage.eINSTANCE);<NEW_LINE>registeredPackage = EPackage.Registry.INSTANCE.getEPackage(Ifc4Package.eNS_URI);<NEW_LINE>Ifc4PackageImpl theIfc4Package = (Ifc4PackageImpl) (registeredPackage instanceof Ifc4PackageImpl ? registeredPackage : Ifc4Package.eINSTANCE);<NEW_LINE>registeredPackage = EPackage.Registry.INSTANCE.getEPackage(LogPackage.eNS_URI);<NEW_LINE>LogPackageImpl theLogPackage = (LogPackageImpl) (registeredPackage instanceof LogPackageImpl ? registeredPackage : LogPackage.eINSTANCE);<NEW_LINE>registeredPackage = EPackage.Registry.<MASK><NEW_LINE>StorePackageImpl theStorePackage = (StorePackageImpl) (registeredPackage instanceof StorePackageImpl ? registeredPackage : StorePackage.eINSTANCE);<NEW_LINE>// Load packages<NEW_LINE>theIfc2x3tc1Package.loadPackage();<NEW_LINE>theGeometryPackage.loadPackage();<NEW_LINE>theIfc4Package.loadPackage();<NEW_LINE>theLogPackage.loadPackage();<NEW_LINE>theStorePackage.loadPackage();<NEW_LINE>// Fix loaded packages<NEW_LINE>theIfc2x3tc1Package.fixPackageContents();<NEW_LINE>theGeometryPackage.fixPackageContents();<NEW_LINE>theIfc4Package.fixPackageContents();<NEW_LINE>theLogPackage.fixPackageContents();<NEW_LINE>theStorePackage.fixPackageContents();<NEW_LINE>// Mark meta-data to indicate it can't be changed<NEW_LINE>theIfc2x3tc1Package.freeze();<NEW_LINE>// Update the registry and return the package<NEW_LINE>EPackage.Registry.INSTANCE.put(Ifc2x3tc1Package.eNS_URI, theIfc2x3tc1Package);<NEW_LINE>return theIfc2x3tc1Package;<NEW_LINE>}
INSTANCE.getEPackage(StorePackage.eNS_URI);
36,248
public void initUI(double latitude, double longitude) {<NEW_LINE>showCurrentFormat(new LatLon(latitude, longitude));<NEW_LINE>final Spinner format = ((Spinner) view.findViewById(R.id.Format));<NEW_LINE>ArrayAdapter<String> adapter = new ArrayAdapter<String>(getActivity(), android.R.layout.simple_spinner_item, new String[] { PointDescription.formatToHumanString(this.getContext(), PointDescription.FORMAT_DEGREES), PointDescription.formatToHumanString(this.getContext(), PointDescription.FORMAT_MINUTES), PointDescription.formatToHumanString(this.getContext(), PointDescription.FORMAT_SECONDS), PointDescription.formatToHumanString(this.getContext(), PointDescription.UTM_FORMAT), PointDescription.formatToHumanString(this.getContext(), PointDescription.MGRS_FORMAT) });<NEW_LINE>adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);<NEW_LINE>format.setAdapter(adapter);<NEW_LINE>format.setSelection(currentFormat);<NEW_LINE>format.setOnItemSelectedListener(new OnItemSelectedListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onItemSelected(AdapterView<?> parent, View v, int position, long id) {<NEW_LINE>int newFormat = currentFormat;<NEW_LINE>String itm = (String) format.getItemAtPosition(position);<NEW_LINE>if (PointDescription.formatToHumanString(NavigatePointFragment.this.getContext(), PointDescription.FORMAT_DEGREES).equals(itm)) {<NEW_LINE>newFormat = PointDescription.FORMAT_DEGREES;<NEW_LINE>} else if (PointDescription.formatToHumanString(NavigatePointFragment.this.getContext(), PointDescription.FORMAT_MINUTES).equals(itm)) {<NEW_LINE>newFormat = PointDescription.FORMAT_MINUTES;<NEW_LINE>} else if (PointDescription.formatToHumanString(NavigatePointFragment.this.getContext(), PointDescription.FORMAT_SECONDS).equals(itm)) {<NEW_LINE>newFormat = PointDescription.FORMAT_SECONDS;<NEW_LINE>} else if (PointDescription.formatToHumanString(NavigatePointFragment.this.getContext(), PointDescription.UTM_FORMAT).equals(itm)) {<NEW_LINE>newFormat = PointDescription.UTM_FORMAT;<NEW_LINE>} else if (PointDescription.formatToHumanString(NavigatePointFragment.this.getContext(), PointDescription.MGRS_FORMAT).equals(itm)) {<NEW_LINE>newFormat = PointDescription.MGRS_FORMAT;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>LatLon loc = parseLocation();<NEW_LINE>currentFormat = newFormat;<NEW_LINE>app.getSettings().COORDINATES_FORMAT.set(currentFormat);<NEW_LINE>view.findViewById(R.id.ValidateTextView<MASK><NEW_LINE>showCurrentFormat(loc);<NEW_LINE>} catch (RuntimeException e) {<NEW_LINE>view.findViewById(R.id.ValidateTextView).setVisibility(View.VISIBLE);<NEW_LINE>((TextView) view.findViewById(R.id.ValidateTextView)).setText(R.string.invalid_locations);<NEW_LINE>// $NON-NLS-1$<NEW_LINE>Log.w(PlatformUtil.TAG, "Convertion failed", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onNothingSelected(AdapterView<?> parent) {<NEW_LINE>}<NEW_LINE>});<NEW_LINE>addPasteListeners();<NEW_LINE>}
).setVisibility(View.INVISIBLE);
913,782
public static byte[] scanBankToBytes(NTAG215 tag, int bank) throws IllegalStateException, NullPointerException {<NEW_LINE>final Context context = TagMo.getContext();<NEW_LINE>byte[] tagData = new byte[NfcByte.TAG_FILE_SIZE];<NEW_LINE>try {<NEW_LINE>byte[] data = tag.amiiboFastRead(0x00, 0x86, bank);<NEW_LINE>if (null == data) {<NEW_LINE>throw new NullPointerException(context.getString(R.string.fail_read_amiibo));<NEW_LINE>}<NEW_LINE>System.arraycopy(data, 0, tagData, 0, NfcByte.TAG_FILE_SIZE);<NEW_LINE>Debug.Log(TagReader.class, TagUtils.bytesToHex(tagData));<NEW_LINE>return tagData;<NEW_LINE>} catch (IllegalStateException e) {<NEW_LINE>throw new IllegalStateException(context.getString(R.string.fail_early_remove));<NEW_LINE>} catch (NullPointerException npe) {<NEW_LINE>throw new NullPointerException(context.getString<MASK><NEW_LINE>}<NEW_LINE>}
(R.string.fail_amiibo_null));
970,031
public OAuth2Token authenticationCodeGrant(String authorizationEndpoint, String scopes, boolean useReqBodyAuthScheme) {<NEW_LINE>return getToken(() -> {<NEW_LINE>AuthorizationCodeCaptureServer server = new AuthorizationCodeCaptureServer();<NEW_LINE>OAuth20Service service = getOauthService(server.getReturnUrl(), authorizationEndpoint, useReqBodyAuthScheme);<NEW_LINE>var authorizationUrl = service.createAuthorizationUrlBuilder().scope(scopes).build();<NEW_LINE>log.info("Redirecting to " + authorizationUrl);<NEW_LINE>if (!PlatformUtil.tryOpenBrowser(authorizationUrl)) {<NEW_LINE>throw new RuntimeException("Failed to open browser");<NEW_LINE>}<NEW_LINE>var dialog = new WaitForMonoDialog<String>();<NEW_LINE>dialog.showAndWait("Waiting for Authorization Code ...", server.listenForCode());<NEW_LINE>if (dialog.isCancelled()) {<NEW_LINE>throw new IllegalStateException("Authorization Flow got cancelled");<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>return service.getAccessToken(code);<NEW_LINE>});<NEW_LINE>}
var code = dialog.getValue();
938,283
public Map<ReturnableData, Object> handle(final RequestWrapper request, final HttpSession session) {<NEW_LINE>final User user = (User) session.getAttribute(SessionAttribute.USER);<NEW_LINE>assert (user != null);<NEW_LINE>if (!user.isAdmin()) {<NEW_LINE>return error(ErrorCode.NOT_ADMIN);<NEW_LINE>}<NEW_LINE>if (null == request.getParameter(AjaxRequest.NICKNAME) || request.getParameter(AjaxRequest.NICKNAME).isEmpty()) {<NEW_LINE>return error(ErrorCode.NO_NICK_SPECIFIED);<NEW_LINE>}<NEW_LINE>final User kickUser = connectedUsers.getUser(request.getParameter(AjaxRequest.NICKNAME));<NEW_LINE>if (null == kickUser) {<NEW_LINE>return error(ErrorCode.NO_SUCH_USER);<NEW_LINE>}<NEW_LINE>final Map<ReturnableData, Object> kickData = new HashMap<ReturnableData, Object>();<NEW_LINE>kickData.put(LongPollResponse.EVENT, <MASK><NEW_LINE>final QueuedMessage qm = new QueuedMessage(MessageType.KICKED, kickData);<NEW_LINE>kickUser.enqueueMessage(qm);<NEW_LINE>connectedUsers.removeUser(kickUser, DisconnectReason.KICKED);<NEW_LINE>logger.warn(String.format("Kicking %s by request of %s", kickUser.getNickname(), user.getNickname()));<NEW_LINE>return new HashMap<ReturnableData, Object>();<NEW_LINE>}
LongPollEvent.KICKED.toString());
1,378,831
private static <K, V> CacheConfigurationBuilder<K, V> addDefaultCopiers(CacheConfigurationBuilder<K, V> builder, Class<K> keyType, Class<V> valueType) {<NEW_LINE>Set<Class<?>> immutableTypes = new HashSet<>();<NEW_LINE>immutableTypes.add(String.class);<NEW_LINE><MASK><NEW_LINE>immutableTypes.add(Float.class);<NEW_LINE>immutableTypes.add(Double.class);<NEW_LINE>immutableTypes.add(Character.class);<NEW_LINE>immutableTypes.add(Integer.class);<NEW_LINE>if (immutableTypes.contains(keyType)) {<NEW_LINE>builder = builder.withService(new DefaultCopierConfiguration<K>((Class) Eh107IdentityCopier.class, DefaultCopierConfiguration.Type.KEY));<NEW_LINE>} else {<NEW_LINE>builder = builder.withService(new DefaultCopierConfiguration<>(SerializingCopier.<K>asCopierClass(), DefaultCopierConfiguration.Type.KEY));<NEW_LINE>}<NEW_LINE>if (immutableTypes.contains(valueType)) {<NEW_LINE>builder = builder.withService(new DefaultCopierConfiguration<K>((Class) Eh107IdentityCopier.class, DefaultCopierConfiguration.Type.VALUE));<NEW_LINE>} else {<NEW_LINE>builder = builder.withService(new DefaultCopierConfiguration<>(SerializingCopier.<K>asCopierClass(), DefaultCopierConfiguration.Type.VALUE));<NEW_LINE>}<NEW_LINE>return builder;<NEW_LINE>}
immutableTypes.add(Long.class);
1,525,209
private Class<? extends Annotation> readScope() {<NEW_LINE>// first check to see if the value is set<NEW_LINE>String property = String.format(REST_SCOPE_FORMAT, clientInterface.getName());<NEW_LINE>String configuredScope = ConfigFacade.getOptionalValue(property, String.class).orElse(null);<NEW_LINE>if (configuredScope != null) {<NEW_LINE>try {<NEW_LINE>return ClassLoaderUtils.loadClass(configuredScope, getClass(), Annotation.class);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new IllegalArgumentException(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>List<Annotation> possibleScopes = new ArrayList<>();<NEW_LINE>Annotation[] annotations = clientInterface.getDeclaredAnnotations();<NEW_LINE>for (Annotation annotation : annotations) {<NEW_LINE>if (beanManager.isScope(annotation.annotationType())) {<NEW_LINE>possibleScopes.add(annotation);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (possibleScopes.isEmpty()) {<NEW_LINE>return Dependent.class;<NEW_LINE>} else if (possibleScopes.size() == 1) {<NEW_LINE>return possibleScopes.get(0).annotationType();<NEW_LINE>} else {<NEW_LINE>throw new IllegalArgumentException("The client interface " + clientInterface + " has multiple scopes defined " + possibleScopes);<NEW_LINE>}<NEW_LINE>}
"The scope " + configuredScope + " is invalid", e);
104,265
private static void logWarnBoxedToPrimitiveType(Class declaringClass, String methodName, Method bestMatch, EPType[] paramTypes) {<NEW_LINE>Class[] parametersMethod = bestMatch.getParameterTypes();<NEW_LINE>for (int i = 0; i < parametersMethod.length; i++) {<NEW_LINE>Class paramMethod = parametersMethod[i];<NEW_LINE>if (!paramMethod.isPrimitive()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>EPType paramType = paramTypes[i];<NEW_LINE>boolean paramNull = paramType == null || paramType == EPTypeNull.INSTANCE;<NEW_LINE>// if null-type parameter, or non-JDK class and boxed type matches<NEW_LINE>if (paramNull || (!declaringClass.getClass().getName().startsWith("java") && JavaClassHelper.getBoxedType(paramMethod) == ((EPTypeClass) paramType).getType())) {<NEW_LINE>String paramTypeStr = paramNull ? "null" : ((<MASK><NEW_LINE>log.info("Method '" + methodName + "' in class '" + declaringClass.getName() + "' expects primitive type '" + parametersMethod[i] + "' as parameter " + i + ", but receives a nullable (boxed) type " + paramTypeStr + ". This may cause null pointer exception at runtime if the actual value is null, please consider using boxed types for method parameters.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
EPTypeClass) paramType).toSimpleName();
1,532,124
final GetSqlInjectionMatchSetResult executeGetSqlInjectionMatchSet(GetSqlInjectionMatchSetRequest getSqlInjectionMatchSetRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getSqlInjectionMatchSetRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetSqlInjectionMatchSetRequest> request = null;<NEW_LINE>Response<GetSqlInjectionMatchSetResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetSqlInjectionMatchSetRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getSqlInjectionMatchSetRequest));<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, "WAF Regional");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetSqlInjectionMatchSet");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetSqlInjectionMatchSetResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetSqlInjectionMatchSetResultJsonUnmarshaller());<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());
309,908
public boolean login(String mediaWikiApiEndpoint, String username, List<Cookie> cookies) {<NEW_LINE>cookies.forEach(cookie <MASK><NEW_LINE>Map<String, Object> map = new HashMap<>();<NEW_LINE>map.put("baseUrl", mediaWikiApiEndpoint);<NEW_LINE>map.put("cookies", cookies);<NEW_LINE>map.put("username", username);<NEW_LINE>map.put("loggedIn", true);<NEW_LINE>map.put("tokens", Collections.emptyMap());<NEW_LINE>map.put("connectTimeout", CONNECT_TIMEOUT);<NEW_LINE>map.put("readTimeout", READ_TIMEOUT);<NEW_LINE>try {<NEW_LINE>BasicApiConnection connection = convertToBasicApiConnection(map);<NEW_LINE>connection.checkCredentials();<NEW_LINE>endpointToConnection.put(mediaWikiApiEndpoint, connection);<NEW_LINE>return true;<NEW_LINE>} catch (IOException | MediaWikiApiErrorException e) {<NEW_LINE>logger.error(e.getMessage(), e);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}
-> cookie.setPath("/"));
1,776,036
public List<Item> findItemsByColorAndGrade() {<NEW_LINE>CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder();<NEW_LINE>CriteriaQuery<Item> criteriaQuery = <MASK><NEW_LINE>Root<Item> itemRoot = criteriaQuery.from(Item.class);<NEW_LINE>Predicate predicateForBlueColor = criteriaBuilder.equal(itemRoot.get("color"), "blue");<NEW_LINE>Predicate predicateForRedColor = criteriaBuilder.equal(itemRoot.get("color"), "red");<NEW_LINE>Predicate predicateForColor = criteriaBuilder.or(predicateForBlueColor, predicateForRedColor);<NEW_LINE>Predicate predicateForGradeA = criteriaBuilder.equal(itemRoot.get("grade"), "A");<NEW_LINE>Predicate predicateForGradeB = criteriaBuilder.equal(itemRoot.get("grade"), "B");<NEW_LINE>Predicate predicateForGrade = criteriaBuilder.or(predicateForGradeA, predicateForGradeB);<NEW_LINE>// final search filter<NEW_LINE>Predicate finalPredicate = criteriaBuilder.and(predicateForColor, predicateForGrade);<NEW_LINE>criteriaQuery.where(finalPredicate);<NEW_LINE>List<Item> items = entityManager.createQuery(criteriaQuery).getResultList();<NEW_LINE>return items;<NEW_LINE>}
criteriaBuilder.createQuery(Item.class);
408,322
public static void validateDockerSpec(JReleaserContext context, Distribution distribution, DockerSpec spec, Docker docker, Errors errors) {<NEW_LINE>if (!spec.isEnabled())<NEW_LINE>return;<NEW_LINE>String element = "distribution." + distribution.getName() + ".docker.spec." + spec.getName();<NEW_LINE>context.getLogger().debug(element);<NEW_LINE>validateTemplate(context, distribution, spec, docker, errors);<NEW_LINE>mergeExtraProperties(spec, docker);<NEW_LINE>validateBaseImage(distribution, spec);<NEW_LINE>if (spec.getImageNames().isEmpty()) {<NEW_LINE>spec.addImageName("{{repoOwner}}/{{distributionName}}-{{dockerSpecName}}:{{tagName}}");<NEW_LINE>}<NEW_LINE>if (context.getModel().getProject().isSnapshot()) {<NEW_LINE>// find the 1st image that ends with :{{tagName}}<NEW_LINE>Optional<String> imageName = spec.getImageNames().stream().filter(n -> n.endsWith(":{{tagName}}") || n.endsWith(":{{ tagName }}")).findFirst();<NEW_LINE>spec.setImageNames(singleton(<MASK><NEW_LINE>}<NEW_LINE>validateCommands(spec, docker);<NEW_LINE>Map<String, String> labels = new LinkedHashMap<>();<NEW_LINE>labels.putAll(docker.getLabels());<NEW_LINE>labels.putAll(spec.getLabels());<NEW_LINE>if (!spec.getLabels().containsKey(LABEL_OCI_IMAGE_TITLE)) {<NEW_LINE>labels.put(LABEL_OCI_IMAGE_TITLE, docker.getLabels().get(LABEL_OCI_IMAGE_TITLE) + "-{{dockerSpecName}}");<NEW_LINE>}<NEW_LINE>spec.setLabels(labels);<NEW_LINE>validateLabels(spec);<NEW_LINE>validateRegistries(context, spec, docker, errors, element);<NEW_LINE>long artifactCount = distribution.getArtifacts().stream().filter(Artifact::isActive).count();<NEW_LINE>if (artifactCount > 1 && spec.getMatchers().isEmpty()) {<NEW_LINE>errors.configuration(RB.$("validation_must_not_be_empty", element + ".matchers"));<NEW_LINE>}<NEW_LINE>if (!spec.isUseLocalArtifactSet() && docker.isUseLocalArtifactSet()) {<NEW_LINE>spec.setUseLocalArtifact(docker.isUseLocalArtifact());<NEW_LINE>}<NEW_LINE>if (distribution.getType() == Distribution.DistributionType.SINGLE_JAR) {<NEW_LINE>spec.setUseLocalArtifact(true);<NEW_LINE>}<NEW_LINE>}
imageName.orElse("{{repoOwner}}/{{distributionName}}-{{dockerSpecName}}:{{tagName}}")));
1,280,908
private static void jar(File src, String prefix, JarInfo info) throws IOException {<NEW_LINE>JarOutputStream jout = info.out;<NEW_LINE>if (src.isDirectory()) {<NEW_LINE>// create / init the zip entry<NEW_LINE>prefix = prefix + src.getName() + "/";<NEW_LINE><MASK><NEW_LINE>entry.setTime(src.lastModified());<NEW_LINE>entry.setMethod(ZipOutputStream.STORED);<NEW_LINE>entry.setSize(0L);<NEW_LINE>entry.setCrc(0L);<NEW_LINE>jout.putNextEntry(entry);<NEW_LINE>jout.closeEntry();<NEW_LINE>// process the sub-directories<NEW_LINE>File[] files = src.listFiles(info.filter);<NEW_LINE>for (File file : files) {<NEW_LINE>jar(file, prefix, info);<NEW_LINE>}<NEW_LINE>} else if (src.isFile()) {<NEW_LINE>// get the required info objects<NEW_LINE>byte[] buffer = info.buffer;<NEW_LINE>// create / init the zip entry<NEW_LINE>ZipEntry entry = new ZipEntry(prefix + src.getName());<NEW_LINE>entry.setTime(src.lastModified());<NEW_LINE>jout.putNextEntry(entry);<NEW_LINE>// dump the file<NEW_LINE>try (FileInputStream in = new FileInputStream(src)) {<NEW_LINE>int len;<NEW_LINE>while ((len = in.read(buffer, 0, buffer.length)) != -1) {<NEW_LINE>jout.write(buffer, 0, len);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>jout.closeEntry();<NEW_LINE>}<NEW_LINE>}
ZipEntry entry = new ZipEntry(prefix);
1,416,140
public void read(org.apache.thrift.protocol.TProtocol iprot, TExternalCompactionList struct) throws org.apache.thrift.TException {<NEW_LINE>org.apache.thrift.protocol.TField schemeField;<NEW_LINE>iprot.readStructBegin();<NEW_LINE>while (true) {<NEW_LINE>schemeField = iprot.readFieldBegin();<NEW_LINE>if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>switch(schemeField.id) {<NEW_LINE>case // COMPACTIONS<NEW_LINE>1:<NEW_LINE>if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {<NEW_LINE>{<NEW_LINE>org.apache.thrift.protocol.TMap _map10 = iprot.readMapBegin();<NEW_LINE>struct.compactions = new java.util.HashMap<java.lang.String, TExternalCompaction>(2 * _map10.size);<NEW_LINE>@org.apache.thrift.annotation.Nullable<NEW_LINE>java.lang.String _key11;<NEW_LINE>@org.apache.thrift.annotation.Nullable<NEW_LINE>TExternalCompaction _val12;<NEW_LINE>for (int _i13 = 0; _i13 < _map10.size; ++_i13) {<NEW_LINE>_key11 = iprot.readString();<NEW_LINE>_val12 = new TExternalCompaction();<NEW_LINE>_val12.read(iprot);<NEW_LINE>struct.compactions.put(_key11, _val12);<NEW_LINE>}<NEW_LINE>iprot.readMapEnd();<NEW_LINE>}<NEW_LINE>struct.setCompactionsIsSet(true);<NEW_LINE>} else {<NEW_LINE>org.apache.thrift.protocol.TProtocolUtil.<MASK><NEW_LINE>}<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);<NEW_LINE>}<NEW_LINE>iprot.readFieldEnd();<NEW_LINE>}<NEW_LINE>iprot.readStructEnd();<NEW_LINE>// check for required fields of primitive type, which can't be checked in the validate method<NEW_LINE>struct.validate();<NEW_LINE>}
skip(iprot, schemeField.type);
1,555,586
public DimensionFilter unmarshall(StaxUnmarshallerContext context) throws Exception {<NEW_LINE>DimensionFilter dimensionFilter = new DimensionFilter();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>if (context.isStartOfDocument())<NEW_LINE>targetDepth += 2;<NEW_LINE>while (true) {<NEW_LINE>int xmlEvent = context.nextEvent();<NEW_LINE>if (xmlEvent == XmlPullParser.END_DOCUMENT)<NEW_LINE>break;<NEW_LINE>if (xmlEvent == XmlPullParser.START_TAG) {<NEW_LINE>if (context.testExpression("Name", targetDepth)) {<NEW_LINE>dimensionFilter.setName(StringStaxUnmarshaller.getInstance<MASK><NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("Value", targetDepth)) {<NEW_LINE>dimensionFilter.setValue(StringStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>} else if (xmlEvent == XmlPullParser.END_TAG) {<NEW_LINE>if (context.getCurrentDepth() < originalDepth) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return dimensionFilter;<NEW_LINE>}
().unmarshall(context));
1,294,783
protected static void removeOldModifiersFromNavUrl(final StringBuilder sb, final String newModifier) {<NEW_LINE>int nmpi = newModifier.indexOf(":");<NEW_LINE>if (nmpi > 0) {<NEW_LINE>final String newModifierKey = newModifier.substring(0, nmpi) + ":";<NEW_LINE>int sameModifierIndex = sb.indexOf(newModifierKey);<NEW_LINE>while (sameModifierIndex > 0) {<NEW_LINE>final int spaceModifierIndex = sb.indexOf(" ", sameModifierIndex);<NEW_LINE>if (spaceModifierIndex > sameModifierIndex) {<NEW_LINE>sb.setLength(sameModifierIndex);<NEW_LINE>}<NEW_LINE>sameModifierIndex = sb.indexOf(newModifierKey);<NEW_LINE>}<NEW_LINE>if (sb.charAt(sb.length() - 1) == '+') {<NEW_LINE>sb.setLength(<MASK><NEW_LINE>}<NEW_LINE>if (sb.charAt(sb.length() - 1) == ' ') {<NEW_LINE>sb.setLength(sb.length() - 1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
sb.length() - 1);
1,266,062
public boolean find(final Path file, final ListProgressListener listener) throws BackgroundException {<NEW_LINE>try {<NEW_LINE>if (containerService.isContainer(file)) {<NEW_LINE>final List<B2BucketResponse> buckets = session<MASK><NEW_LINE>for (B2BucketResponse bucket : buckets) {<NEW_LINE>if (StringUtils.equals(containerService.getContainer(file).getName(), bucket.getBucketName())) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>try {<NEW_LINE>new B2AttributesFinderFeature(session, fileid).find(file, listener);<NEW_LINE>return true;<NEW_LINE>} catch (NotfoundException e) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} catch (B2ApiException e) {<NEW_LINE>throw new B2ExceptionMappingService(fileid).map("Failure to read attributes of {0}", e, file);<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new DefaultIOExceptionMappingService().map(e);<NEW_LINE>}<NEW_LINE>}
.getClient().listBuckets();
1,583,876
public static DescribeAsyncTasksResponse unmarshall(DescribeAsyncTasksResponse describeAsyncTasksResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeAsyncTasksResponse.setRequestId(_ctx.stringValue("DescribeAsyncTasksResponse.RequestId"));<NEW_LINE>describeAsyncTasksResponse.setTotalCount(_ctx.integerValue("DescribeAsyncTasksResponse.TotalCount"));<NEW_LINE>List<AsyncTask> asyncTasks <MASK><NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeAsyncTasksResponse.AsyncTasks.Length"); i++) {<NEW_LINE>AsyncTask asyncTask = new AsyncTask();<NEW_LINE>asyncTask.setTaskId(_ctx.longValue("DescribeAsyncTasksResponse.AsyncTasks[" + i + "].TaskId"));<NEW_LINE>asyncTask.setEndTime(_ctx.longValue("DescribeAsyncTasksResponse.AsyncTasks[" + i + "].EndTime"));<NEW_LINE>asyncTask.setStartTime(_ctx.longValue("DescribeAsyncTasksResponse.AsyncTasks[" + i + "].StartTime"));<NEW_LINE>asyncTask.setTaskStatus(_ctx.integerValue("DescribeAsyncTasksResponse.AsyncTasks[" + i + "].TaskStatus"));<NEW_LINE>asyncTask.setTaskResult(_ctx.stringValue("DescribeAsyncTasksResponse.AsyncTasks[" + i + "].TaskResult"));<NEW_LINE>asyncTask.setTaskParams(_ctx.stringValue("DescribeAsyncTasksResponse.AsyncTasks[" + i + "].TaskParams"));<NEW_LINE>asyncTask.setTaskType(_ctx.integerValue("DescribeAsyncTasksResponse.AsyncTasks[" + i + "].TaskType"));<NEW_LINE>asyncTasks.add(asyncTask);<NEW_LINE>}<NEW_LINE>describeAsyncTasksResponse.setAsyncTasks(asyncTasks);<NEW_LINE>return describeAsyncTasksResponse;<NEW_LINE>}
= new ArrayList<AsyncTask>();
183,020
public static void exec(File workingDir, String command) {<NEW_LINE>logger.info("start excute commond:" + command);<NEW_LINE>String[] commands = command.split(" ");<NEW_LINE>try {<NEW_LINE>ProcessBuilder processBuilder = new ProcessBuilder(commands);<NEW_LINE>processBuilder.directory(workingDir);<NEW_LINE>Process process = processBuilder.start();<NEW_LINE>BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(process.getInputStream()));<NEW_LINE>String line = null;<NEW_LINE>while ((line = bufferedReader.readLine()) != null) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>process.waitFor();<NEW_LINE>process.destroy();<NEW_LINE>} catch (Throwable e) {<NEW_LINE>if (commands[0].equals("zip")) {<NEW_LINE>try {<NEW_LINE>ZipUtils.addFileAndDirectoryToZip(new File(commands[2]), workingDir);<NEW_LINE>} catch (Exception e1) {<NEW_LINE>e1.printStackTrace();<NEW_LINE>}<NEW_LINE>} else if (commands[0].equals("unzip")) {<NEW_LINE>ZipUtils.unzip(new File(commands[1]), commands[3]);<NEW_LINE>}<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>}
System.out.println(line);
510,030
public boolean apply(Game game, Ability source) {<NEW_LINE>Player player = game.getPlayer(source.getControllerId());<NEW_LINE>Card card = game.getCard(source.getFirstTarget());<NEW_LINE>if (player == null || card == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>CreateTokenCopyTargetEffect effect = new CreateTokenCopyTargetEffect(source.getControllerId(), null, false, 1, false, false, null, 1, 1, false);<NEW_LINE>effect.setTargetPointer(new FixedTarget(card.getId(), card.getZoneChangeCounter(game) + 1));<NEW_LINE>player.moveCards(card, Zone.EXILED, source, game);<NEW_LINE>effect.apply(game, source);<NEW_LINE>effect.getAddedPermanents().stream().forEach(permanent -> {<NEW_LINE>ContinuousEffect continuousEffect = new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.UntilYourNextTurn);<NEW_LINE>continuousEffect.setTargetPointer(new FixedTarget(permanent, game));<NEW_LINE><MASK><NEW_LINE>});<NEW_LINE>return true;<NEW_LINE>}
game.addEffect(continuousEffect, source);
1,303,845
public boolean send(SmsMessage sms) {<NEW_LINE>String app_key = JPressOptions.get(JPressConsts.OPTION_CONNECTION_SMS_APPID);<NEW_LINE>String app_secret = JPressOptions.get(JPressConsts.OPTION_CONNECTION_SMS_APPSECRET);<NEW_LINE>String random = new Random().nextInt(1000000) + "";<NEW_LINE>String time = System.currentTimeMillis() / 1000 + "";<NEW_LINE>String srcStr = "appkey=" + app_secret + "&random=" + random + "&time=" + time + "&mobile=" + sms.getMobile();<NEW_LINE>String <MASK><NEW_LINE>boolean hasCode = StrUtil.isNotBlank(sms.getCode());<NEW_LINE>String postContent = (hasCode ? SMS_JSON.replace("{code}", sms.getCode()) : SMS_NO_CODE_JSON).replace("{sig}", sig).replace("{sign}", sms.getSign()).replace("{mobile}", sms.getMobile()).replace("{time}", time).replace("{tpl_id}", sms.getTemplate());<NEW_LINE>String url = "https://yun.tim.qq.com/v5/tlssmssvr/sendsms?sdkappid=" + app_key + "&random=" + random;<NEW_LINE>String content = HttpUtil.httpPost(url, postContent);<NEW_LINE>if (StrUtil.isBlank(content)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>JSONObject resultJson = JSON.parseObject(content);<NEW_LINE>Integer result = resultJson.getInteger("result");<NEW_LINE>if (result != null && result == 0) {<NEW_LINE>return true;<NEW_LINE>} else {<NEW_LINE>LogKit.error("qcloud sms send error : " + content);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}
sig = HashKit.sha256(srcStr);
704,680
private void initBuffer() {<NEW_LINE>logger.info("Initializing display (if last line in log then likely the game crashed from an issue with your " + "video card)");<NEW_LINE>if (!config.isVSync()) {<NEW_LINE>GLFW.glfwSwapInterval(0);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>String root = "org/terasology/icons/";<NEW_LINE>ClassLoader classLoader = getClass().getClassLoader();<NEW_LINE>BufferedImage icon16 = ImageIO.read(classLoader<MASK><NEW_LINE>BufferedImage icon32 = ImageIO.read(classLoader.getResourceAsStream(root + "gooey_sweet_32.png"));<NEW_LINE>BufferedImage icon64 = ImageIO.read(classLoader.getResourceAsStream(root + "gooey_sweet_64.png"));<NEW_LINE>BufferedImage icon128 = ImageIO.read(classLoader.getResourceAsStream(root + "gooey_sweet_128.png"));<NEW_LINE>GLFWImage.Buffer buffer = GLFWImage.create(4);<NEW_LINE>buffer.put(0, LwjglGraphicsUtil.convertToGLFWFormat(icon16));<NEW_LINE>buffer.put(1, LwjglGraphicsUtil.convertToGLFWFormat(icon32));<NEW_LINE>buffer.put(2, LwjglGraphicsUtil.convertToGLFWFormat(icon64));<NEW_LINE>buffer.put(3, LwjglGraphicsUtil.convertToGLFWFormat(icon128));<NEW_LINE>} catch (IOException | IllegalArgumentException e) {<NEW_LINE>logger.warn("Could not set icon", e);<NEW_LINE>}<NEW_LINE>display.setDisplayModeSetting(config.getDisplayModeSetting());<NEW_LINE>}
.getResourceAsStream(root + "gooey_sweet_16.png"));
1,760,341
public static <T1, T2, T3> double conditionalMI(List<T1> first, List<T2> second, List<T3> condition, List<Double> weights) {<NEW_LINE>if ((first.size() == second.size()) && (first.size() == condition.size()) && (first.size() == weights.size())) {<NEW_LINE>WeightedTripleDistribution<T1, T2, T3> tripleRV = WeightedTripleDistribution.constructFromLists(<MASK><NEW_LINE>return conditionalMI(tripleRV);<NEW_LINE>} else {<NEW_LINE>throw new IllegalArgumentException("Weighted Conditional Mutual Information requires four vectors the same length. first.size() = " + first.size() + ", second.size() = " + second.size() + ", condition.size() = " + condition.size() + ", weights.size() = " + weights.size());<NEW_LINE>}<NEW_LINE>}
first, second, condition, weights);
26,011
public void testGetDeliveryDelayClassicApi(HttpServletRequest request, HttpServletResponse response) throws Exception {<NEW_LINE>String failureReason = null;<NEW_LINE>QueueConnection con = jmsQCFBindings.createQueueConnection();<NEW_LINE>con.start();<NEW_LINE>QueueSession sessionSender = con.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);<NEW_LINE>emptyQueue(jmsQCFBindings, jmsQueue1);<NEW_LINE>QueueSender send = sessionSender.createSender(jmsQueue1);<NEW_LINE>long val = send.getDeliveryDelay();<NEW_LINE>if (val != 0) {<NEW_LINE>failureReason = "Incorrect default delivery dalay [ " + val + " ] expecting [ 0 ]";<NEW_LINE>}<NEW_LINE>send.setDeliveryDelay(1000);<NEW_LINE>val = send.getDeliveryDelay();<NEW_LINE>if (val != 1000) {<NEW_LINE>failureReason = "Incorrect delivery dalay [ " + val + " ] expecting [ 1000 ]";<NEW_LINE>}<NEW_LINE>sessionSender.close();<NEW_LINE>con.close();<NEW_LINE>if (failureReason != null) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}
throw new Exception("testGetDeliveryDelayClassicApi failed: " + failureReason);
1,050,762
private static boolean tryKubeConfig(Config config, String context) {<NEW_LINE>LOGGER.debug("Trying to configure client from Kubernetes config...");<NEW_LINE>if (!Utils.getSystemPropertyOrEnvVar(KUBERNETES_AUTH_TRYKUBECONFIG_SYSTEM_PROPERTY, true)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>File kubeConfigFile = new File(getKubeconfigFilename());<NEW_LINE>if (!kubeConfigFile.isFile()) {<NEW_LINE>LOGGER.debug("Did not find Kubernetes config at: [{}]. Ignoring.", kubeConfigFile.getPath());<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>LOGGER.debug(<MASK><NEW_LINE>String kubeconfigContents = getKubeconfigContents(kubeConfigFile);<NEW_LINE>if (kubeconfigContents == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>config.file = new File(kubeConfigFile.getPath());<NEW_LINE>loadFromKubeconfig(config, context, kubeconfigContents);<NEW_LINE>return true;<NEW_LINE>}
"Found for Kubernetes config at: [{}].", kubeConfigFile.getPath());
812,957
public static void applySettings(ProfileModel params) {<NEW_LINE>antiAlias = params.fontAA;<NEW_LINE>float small = params.fontSizeSmall;<NEW_LINE>float medium = params.fontSizeMedium;<NEW_LINE>float large = params.fontSizeLarge;<NEW_LINE>int screen = Math.max(params.screenWidth, params.screenHeight);<NEW_LINE>if (medium <= 0)<NEW_LINE>medium = Font.getFontSizeForResolution(1, screen);<NEW_LINE>if (small <= 0)<NEW_LINE>small = <MASK><NEW_LINE>if (large <= 0)<NEW_LINE>large = Font.getFontSizeForResolution(2, screen);<NEW_LINE>if (params.fontApplyDimensions) {<NEW_LINE>DisplayMetrics metrics = ContextHolder.getAppContext().getResources().getDisplayMetrics();<NEW_LINE>medium = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP, medium, metrics);<NEW_LINE>small = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP, small, metrics);<NEW_LINE>large = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP, large, metrics);<NEW_LINE>}<NEW_LINE>sizes[0] = medium;<NEW_LINE>sizes[1] = small;<NEW_LINE>sizes[2] = large;<NEW_LINE>Arrays.fill(fonts, null);<NEW_LINE>}
Font.getFontSizeForResolution(0, screen);
60,689
public boolean apply(Game game, Ability source) {<NEW_LINE>Player controller = game.getPlayer(source.getControllerId());<NEW_LINE>Player attachTo = game.getPlayer(targetPointer<MASK><NEW_LINE>if (controller == null || !(game.getState().getZone(source.getSourceId()) == Zone.GRAVEYARD) || attachTo == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>Card card = game.getCard(source.getSourceId());<NEW_LINE>if (card == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>game.getState().setValue(TransformAbility.VALUE_KEY_ENTER_TRANSFORMED + source.getSourceId(), Boolean.TRUE);<NEW_LINE>UUID secondFaceId = card.getSecondCardFace().getId();<NEW_LINE>game.getState().setValue("attachTo:" + secondFaceId, attachTo.getId());<NEW_LINE>if (controller.moveCards(card, Zone.BATTLEFIELD, source, game)) {<NEW_LINE>attachTo.addAttachment(card.getId(), source, game);<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
.getFirst(game, source));
1,604,551
public String toCircularString() {<NEW_LINE>Iterator<Segment<?>> i = descendingIterator();<NEW_LINE>StringBuilder path = new StringBuilder();<NEW_LINE>String <MASK><NEW_LINE>while (i.hasNext()) {<NEW_LINE>String segmentString = i.next().toString();<NEW_LINE>path.append(segmentString);<NEW_LINE>if (i.hasNext()) {<NEW_LINE>path.append(RIGHT_ARROW);<NEW_LINE>} else {<NEW_LINE>int totalLength = path.length() - 3;<NEW_LINE>String spaces = String.join("", Collections.nCopies(totalLength, " "));<NEW_LINE>path.append(ls).append("^").append(spaces).append("|").append(ls).append("|").append(spaces).append("|").append(ls).append("|").append(spaces).append("|").append(ls).append('+');<NEW_LINE>path.append(String.join("", Collections.nCopies(totalLength, "-"))).append('+');<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return path.toString();<NEW_LINE>}
ls = CachedEnvironment.getProperty("line.separator");
402,977
public static void show(final Context context, @NonNull final MuteSelectionListener listener, @Nullable Runnable cancelListener) {<NEW_LINE>AlertDialog.<MASK><NEW_LINE>builder.setTitle(R.string.MuteDialog_mute_notifications);<NEW_LINE>builder.setItems(R.array.mute_durations, (dialog, which) -> {<NEW_LINE>final long muteUntil;<NEW_LINE>switch(which) {<NEW_LINE>case 0:<NEW_LINE>muteUntil = System.currentTimeMillis() + TimeUnit.HOURS.toMillis(1);<NEW_LINE>break;<NEW_LINE>case 1:<NEW_LINE>muteUntil = System.currentTimeMillis() + TimeUnit.HOURS.toMillis(8);<NEW_LINE>break;<NEW_LINE>case 2:<NEW_LINE>muteUntil = System.currentTimeMillis() + TimeUnit.DAYS.toMillis(1);<NEW_LINE>break;<NEW_LINE>case 3:<NEW_LINE>muteUntil = System.currentTimeMillis() + TimeUnit.DAYS.toMillis(7);<NEW_LINE>break;<NEW_LINE>case 4:<NEW_LINE>muteUntil = Long.MAX_VALUE;<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>muteUntil = System.currentTimeMillis() + TimeUnit.HOURS.toMillis(1);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>listener.onMuted(muteUntil);<NEW_LINE>});<NEW_LINE>if (cancelListener != null) {<NEW_LINE>builder.setOnCancelListener(dialog -> {<NEW_LINE>cancelListener.run();<NEW_LINE>dialog.dismiss();<NEW_LINE>});<NEW_LINE>}<NEW_LINE>builder.show();<NEW_LINE>}
Builder builder = new MaterialAlertDialogBuilder(context);
472,384
final AcceptVpcEndpointConnectionsResult executeAcceptVpcEndpointConnections(AcceptVpcEndpointConnectionsRequest acceptVpcEndpointConnectionsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(acceptVpcEndpointConnectionsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<AcceptVpcEndpointConnectionsRequest> request = null;<NEW_LINE>Response<AcceptVpcEndpointConnectionsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new AcceptVpcEndpointConnectionsRequestMarshaller().marshall(super.beforeMarshalling(acceptVpcEndpointConnectionsRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "EC2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "AcceptVpcEndpointConnections");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<AcceptVpcEndpointConnectionsResult> responseHandler = new StaxResponseHandler<AcceptVpcEndpointConnectionsResult>(new AcceptVpcEndpointConnectionsResultStaxUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}
endClientExecution(awsRequestMetrics, request, response);
510,945
protected void startTracked() throws Exception {<NEW_LINE>final var endpoint = dynamodbDestinationConfig.getEndpoint();<NEW_LINE>final AWSCredentials awsCreds = new BasicAWSCredentials(dynamodbDestinationConfig.getAccessKeyId(), dynamodbDestinationConfig.getSecretAccessKey());<NEW_LINE>AmazonDynamoDB amazonDynamodb = null;<NEW_LINE>if (endpoint.isEmpty()) {<NEW_LINE>amazonDynamodb = AmazonDynamoDBClientBuilder.standard().withCredentials(new AWSStaticCredentialsProvider(awsCreds)).withRegion(dynamodbDestinationConfig.<MASK><NEW_LINE>} else {<NEW_LINE>final ClientConfiguration clientConfiguration = new ClientConfiguration();<NEW_LINE>clientConfiguration.setSignerOverride("AWSDynamodbSignerType");<NEW_LINE>amazonDynamodb = AmazonDynamoDBClientBuilder.standard().withEndpointConfiguration(new AwsClientBuilder.EndpointConfiguration(endpoint, dynamodbDestinationConfig.getRegion())).withClientConfiguration(clientConfiguration).withCredentials(new AWSStaticCredentialsProvider(awsCreds)).build();<NEW_LINE>}<NEW_LINE>final var uploadTimestamp = System.currentTimeMillis();<NEW_LINE>for (final ConfiguredAirbyteStream configuredStream : configuredCatalog.getStreams()) {<NEW_LINE>final var writer = new DynamodbWriter(dynamodbDestinationConfig, amazonDynamodb, configuredStream, uploadTimestamp);<NEW_LINE>final AirbyteStream stream = configuredStream.getStream();<NEW_LINE>final AirbyteStreamNameNamespacePair streamNamePair = AirbyteStreamNameNamespacePair.fromAirbyteSteam(stream);<NEW_LINE>streamNameAndNamespaceToWriters.put(streamNamePair, writer);<NEW_LINE>}<NEW_LINE>}
getRegion()).build();
395,341
public static boolean isOracleMacRetinaDevice(GraphicsDevice device) {<NEW_LINE>Boolean isRetina = devicesToRetinaSupportCacheMap.get(device);<NEW_LINE>if (isRetina != null) {<NEW_LINE>return isRetina;<NEW_LINE>}<NEW_LINE>Method getScaleFactorMethod = null;<NEW_LINE>try {<NEW_LINE>getScaleFactorMethod = Class.forName("sun.awt.CGraphicsDevice").getMethod("getScaleFactor");<NEW_LINE>} catch (ClassNotFoundException | NoSuchMethodException e) {<NEW_LINE>// not an Oracle Mac JDK or API has been changed<NEW_LINE>getLogger().debug("CGraphicsDevice.getScaleFactor(): not an Oracle Mac JDK or API has been changed");<NEW_LINE>} catch (Exception e) {<NEW_LINE>getLogger().debug(e);<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>try {<NEW_LINE>isRetina = getScaleFactorMethod == null || (Integer) getScaleFactorMethod.invoke(device) != 1;<NEW_LINE>} catch (IllegalAccessException e) {<NEW_LINE>getLogger().debug("CGraphicsDevice.getScaleFactor(): Access issue");<NEW_LINE>isRetina = false;<NEW_LINE>} catch (InvocationTargetException e) {<NEW_LINE>getLogger().debug("CGraphicsDevice.getScaleFactor(): Invocation issue");<NEW_LINE>isRetina = false;<NEW_LINE>} catch (IllegalArgumentException e) {<NEW_LINE>getLogger().debug("object is not an instance of declaring class: " + device.getClass().getName());<NEW_LINE>isRetina = false;<NEW_LINE>}<NEW_LINE>devicesToRetinaSupportCacheMap.put(device, isRetina);<NEW_LINE>return isRetina;<NEW_LINE>}
getLogger().debug("CGraphicsDevice.getScaleFactor(): probably it is Java 9");
899,703
public boolean checkTargetVersion(TargetVersion targetVersion) {<NEW_LINE>Config tlsConfig = getTlsConfig();<NEW_LINE>tlsConfig.setFiltersKeepUserSettings(false);<NEW_LINE>WorkflowConfigurationFactory factory = new WorkflowConfigurationFactory(tlsConfig);<NEW_LINE>WorkflowTrace workflowTrace = factory.createTlsEntryWorkflowTrace(tlsConfig.getDefaultClientConnection());<NEW_LINE>workflowTrace.addTlsAction(new SendAction(new ClientHelloMessage(tlsConfig)));<NEW_LINE>List<ProtocolMessage> messageList = new LinkedList<>();<NEW_LINE>messageList.add(new ServerHelloMessage(tlsConfig));<NEW_LINE>messageList.add(new CertificateMessage(tlsConfig));<NEW_LINE>messageList.<MASK><NEW_LINE>workflowTrace.addTlsAction(new ReceiveAction(messageList));<NEW_LINE>ChangeCipherSpecMessage changeCipherSpecMessage = new ChangeCipherSpecMessage(tlsConfig);<NEW_LINE>workflowTrace.addTlsAction(new SendAction(changeCipherSpecMessage));<NEW_LINE>byte[] emptyMasterSecret = new byte[0];<NEW_LINE>workflowTrace.addTlsAction(new ChangeMasterSecretAction(emptyMasterSecret));<NEW_LINE>workflowTrace.addTlsAction(new ActivateEncryptionAction());<NEW_LINE>workflowTrace.addTlsAction(new EarlyCcsAction(targetVersion == TargetVersion.OPENSSL_1_0_0));<NEW_LINE>if (targetVersion != TargetVersion.OPENSSL_1_0_0) {<NEW_LINE>workflowTrace.addTlsAction(new ChangeMasterSecretAction(emptyMasterSecret));<NEW_LINE>}<NEW_LINE>workflowTrace.addTlsAction(new SendAction(new FinishedMessage(tlsConfig)));<NEW_LINE>messageList = new LinkedList<>();<NEW_LINE>messageList.add(new ChangeCipherSpecMessage(tlsConfig));<NEW_LINE>messageList.add(new FinishedMessage(tlsConfig));<NEW_LINE>workflowTrace.addTlsAction(new ReceiveAction(messageList));<NEW_LINE>State state = new State(tlsConfig, workflowTrace);<NEW_LINE>WorkflowExecutor workflowExecutor = WorkflowExecutorFactory.createWorkflowExecutor(tlsConfig.getWorkflowExecutorType(), state);<NEW_LINE>workflowExecutor.executeWorkflow();<NEW_LINE>if (WorkflowTraceUtil.didReceiveMessage(ProtocolMessageType.ALERT, workflowTrace)) {<NEW_LINE>CONSOLE.info("Not vulnerable (definitely), Alert message found");<NEW_LINE>return false;<NEW_LINE>} else if (WorkflowTraceUtil.didReceiveMessage(HandshakeMessageType.FINISHED, workflowTrace)) {<NEW_LINE>CONSOLE.warn("Vulnerable (definitely), Finished message found");<NEW_LINE>return true;<NEW_LINE>} else {<NEW_LINE>CONSOLE.info("Not vulnerable (probably), No Finished message found, yet also no alert");<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}
add(new ServerHelloDoneMessage(tlsConfig));
1,038,150
void appendWrapFn(final Appendable out) throws IOException {<NEW_LINE>if (this.codecType == Decoder) {<NEW_LINE>indent(out, 2, "pub fn wrap(\n");<NEW_LINE>indent(out, 3, "mut self,\n");<NEW_LINE>indent(out, 3, "buf: %s,\n", withLifetime(this.codecType.bufType()));<NEW_LINE>indent(out, 3, "offset: usize,\n");<NEW_LINE>indent(out, 3, "acting_block_length: %s,\n", blockLengthType());<NEW_LINE>indent(out, 3, "acting_version: %s,\n", schemaVersionType());<NEW_LINE>indent(out, 2, ") -> Self {\n");<NEW_LINE>indent(out, 3, "let limit = offset + acting_block_length as usize;\n");<NEW_LINE>} else {<NEW_LINE>indent(out, 2, "pub fn wrap(mut self, buf: %s, offset: usize) -> Self {\n", withLifetime(this.codecType.bufType()));<NEW_LINE>indent(out, 3, "let limit = offset + SBE_BLOCK_LENGTH as usize;\n");<NEW_LINE>}<NEW_LINE>indent(out, 3, "self.buf = buf;\n");<NEW_LINE>indent(out, 3, "self.initial_offset = offset;\n");<NEW_LINE>indent(out, 3, "self.offset = offset;\n");<NEW_LINE>indent(out, 3, "self.limit = limit;\n");<NEW_LINE>if (this.codecType == Decoder) {<NEW_LINE>indent(out, 3, "self.acting_block_length = acting_block_length;\n");<NEW_LINE>indent(out, 3, "self.acting_version = acting_version;\n");<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>indent(out, 2, "}\n\n");<NEW_LINE>}
indent(out, 3, "self\n");
1,702,386
public static InstructorAttributes valueOf(Instructor instructor) {<NEW_LINE>InstructorAttributes instructorAttributes = new InstructorAttributes(instructor.getCourseId(), instructor.getEmail());<NEW_LINE>instructorAttributes.name = instructor.getName();<NEW_LINE>instructorAttributes<MASK><NEW_LINE>instructorAttributes.key = instructor.getRegistrationKey();<NEW_LINE>if (instructor.getRole() != null) {<NEW_LINE>instructorAttributes.role = instructor.getRole();<NEW_LINE>}<NEW_LINE>if (instructor.getDisplayedName() != null) {<NEW_LINE>instructorAttributes.displayedName = instructor.getDisplayedName();<NEW_LINE>}<NEW_LINE>instructorAttributes.isArchived = instructor.getIsArchived();<NEW_LINE>instructorAttributes.isDisplayedToStudents = instructor.isDisplayedToStudents();<NEW_LINE>if (instructor.getInstructorPrivilegesAsText() == null) {<NEW_LINE>instructorAttributes.privileges = new InstructorPrivileges(instructorAttributes.role);<NEW_LINE>} else {<NEW_LINE>InstructorPrivilegesLegacy privilegesLegacy = JsonUtils.fromJson(instructor.getInstructorPrivilegesAsText(), InstructorPrivilegesLegacy.class);<NEW_LINE>instructorAttributes.privileges = new InstructorPrivileges(privilegesLegacy);<NEW_LINE>}<NEW_LINE>if (instructor.getCreatedAt() != null) {<NEW_LINE>instructorAttributes.createdAt = instructor.getCreatedAt();<NEW_LINE>}<NEW_LINE>if (instructor.getUpdatedAt() != null) {<NEW_LINE>instructorAttributes.updatedAt = instructor.getUpdatedAt();<NEW_LINE>}<NEW_LINE>return instructorAttributes;<NEW_LINE>}
.googleId = instructor.getGoogleId();
886,569
final DeleteIPSetResult executeDeleteIPSet(DeleteIPSetRequest deleteIPSetRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteIPSetRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteIPSetRequest> request = null;<NEW_LINE>Response<DeleteIPSetResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteIPSetRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteIPSetRequest));<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, "DeleteIPSet");<NEW_LINE>request.<MASK><NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteIPSetResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteIPSetResultJsonUnmarshaller());<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.ADVANCED_CONFIG, advancedConfig);
214,588
private void genForAllFields() {<NEW_LINE>ThanosManager thanos = ThanosManager.from(getContext());<NEW_LINE>if (!thanos.isServiceInstalled()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>new AndroidId(null, false).updateValue(RandomStringUtils.randomAlphanumeric(16).toLowerCase(Locale.ENGLISH));<NEW_LINE>new DeviceId(null, false).updateValue(RandomStringUtils.randomNumeric(14));<NEW_LINE>new Line1Num(null, false).updateValue(RandomStringUtils.randomNumeric(11));<NEW_LINE>new SimSerial(null, false).updateValue(RandomStringUtils.randomNumeric(20));<NEW_LINE>new SimCountryIso(null, false).updateValue("us");<NEW_LINE>new SimOp(null, false, -1).updateValue(RandomStringUtils.randomNumeric(5));<NEW_LINE>new SimOpName(null, false, -1).updateValue(RandomStringUtils.randomAlphabetic(6).toLowerCase(Locale.ENGLISH));<NEW_LINE>new NetCountryIso(null, false).updateValue("jp");<NEW_LINE>new NetOp(null, false, -1).updateValue(RandomStringUtils.randomNumeric(5));<NEW_LINE>new NetOpName(null, false, -1).updateValue(RandomStringUtils.randomAlphabetic(6).toLowerCase(Locale.ENGLISH));<NEW_LINE>int phoneCount = thanos.getPrivacyManager().getPhoneCount();<NEW_LINE>XLog.w("genForAllFields phoneCount: %s", phoneCount);<NEW_LINE>SubscriptionInfo[] subscriptionInfos = thanos.getPrivacyManager().getAccessibleSubscriptionInfoList();<NEW_LINE>XLog.w("genForAllFields subscriptionInfos: %s", Arrays.toString(subscriptionInfos));<NEW_LINE>if (ArrayUtils.isEmpty(subscriptionInfos)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Bind cheat imei.<NEW_LINE>if (thanos.hasFeature(BuildProp.THANOX_FEATURE_PRIVACY_FIELD_IMEI)) {<NEW_LINE>int nameIndex = 1;<NEW_LINE>for (SubscriptionInfo sub : subscriptionInfos) {<NEW_LINE>int slotId = sub.getSimSlotIndex();<NEW_LINE>XLog.w("genForAllFields nameIndex: %s, slotId: %s", nameIndex, slotId);<NEW_LINE>new Imei(null, false, slotId).updateValue(RandomStringUtils.randomNumeric(15));<NEW_LINE>nameIndex++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Bind cheat meid.<NEW_LINE>if (thanos.hasFeature(BuildProp.THANOX_FEATURE_PRIVACY_FIELD_MEID)) {<NEW_LINE>int nameIndex = 1;<NEW_LINE>for (SubscriptionInfo sub : subscriptionInfos) {<NEW_LINE>int slotId = sub.getSimSlotIndex();<NEW_LINE>XLog.<MASK><NEW_LINE>new Meid(null, false, slotId).updateValue(RandomStringUtils.randomNumeric(15));<NEW_LINE>nameIndex++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
w("genForAllFields nameIndex: %s, slotId: %s", nameIndex, slotId);
1,249,213
public boolean order(Buffer b) {<NEW_LINE>if (b instanceof java.nio.ByteBuffer)<NEW_LINE>return ((java.nio.ByteBuffer) b).order() == ByteOrder.LITTLE_ENDIAN;<NEW_LINE>if (b instanceof java.nio.ShortBuffer)<NEW_LINE>return ((java.nio.ShortBuffer) b).order() == ByteOrder.LITTLE_ENDIAN;<NEW_LINE>if (b instanceof java.nio.CharBuffer)<NEW_LINE>return ((java.nio.CharBuffer) b).order() == ByteOrder.LITTLE_ENDIAN;<NEW_LINE>if (b instanceof java.nio.IntBuffer)<NEW_LINE>return ((java.nio.IntBuffer) b).order() == ByteOrder.LITTLE_ENDIAN;<NEW_LINE>if (b instanceof java.nio.LongBuffer)<NEW_LINE>return ((java.nio.LongBuffer) b)<MASK><NEW_LINE>if (b instanceof java.nio.FloatBuffer)<NEW_LINE>return ((java.nio.FloatBuffer) b).order() == ByteOrder.LITTLE_ENDIAN;<NEW_LINE>if (b instanceof java.nio.DoubleBuffer)<NEW_LINE>return ((java.nio.DoubleBuffer) b).order() == ByteOrder.LITTLE_ENDIAN;<NEW_LINE>return true;<NEW_LINE>}
.order() == ByteOrder.LITTLE_ENDIAN;
733,459
public double[] transformToDoubleValuesSV(ProjectionBlock projectionBlock) {<NEW_LINE>int numDocs = projectionBlock.getNumDocs();<NEW_LINE>if (_doubleValuesSV == null || _doubleValuesSV.length < numDocs) {<NEW_LINE>_doubleValuesSV = new double[numDocs];<NEW_LINE>}<NEW_LINE>double[] values = _arguments.get(0).transformToDoubleValuesSV(projectionBlock);<NEW_LINE>System.arraycopy(values, 0, _doubleValuesSV, 0, numDocs);<NEW_LINE>for (int i = 1; i < _arguments.size(); i++) {<NEW_LINE>values = _arguments.get(i).transformToDoubleValuesSV(projectionBlock);<NEW_LINE>for (int j = 0; j < numDocs & j < values.length; j++) {<NEW_LINE>_doubleValuesSV[j] = Math.min(_doubleValuesSV[<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>return _doubleValuesSV;<NEW_LINE>}
j], values[j]);
215,859
public static void main(String[] args) {<NEW_LINE>Scanner sc = new Scanner(System.in);<NEW_LINE>Linklist list = new Linklist();<NEW_LINE>boolean flag = true;<NEW_LINE>int valu;<NEW_LINE>int posi = 0;<NEW_LINE>while (flag) {<NEW_LINE>System.out.println();<NEW_LINE>System.out.println("1. Add item to the list at start");<NEW_LINE>System.out.println("2. Add item to the list at last");<NEW_LINE>System.out.println("3. Add item to the list at position");<NEW_LINE>System.out.println("4. Delete First node");<NEW_LINE>System.out.println("5. Delete last node");<NEW_LINE>System.out.println("6. Delete node at position");<NEW_LINE>System.out.println("7. Update node at position");<NEW_LINE>System.out.println("8. Reverse link list");<NEW_LINE>System.out.println("9. View List");<NEW_LINE>System.out.println("10. Get List Size");<NEW_LINE>System.out.println("11. Exit");<NEW_LINE>System.out.println("Enter Choice");<NEW_LINE>int choice = sc.nextInt();<NEW_LINE>switch(choice) {<NEW_LINE>case 1:<NEW_LINE>System.out.println("Enter value");<NEW_LINE>valu = sc.nextInt();<NEW_LINE>list.insertAtFirst(valu);<NEW_LINE>break;<NEW_LINE>case 2:<NEW_LINE>System.out.println("Enter value");<NEW_LINE>valu = sc.nextInt();<NEW_LINE>list.insertAtLast(valu);<NEW_LINE>break;<NEW_LINE>case 3:<NEW_LINE>System.out.println("Enter value");<NEW_LINE>valu = sc.nextInt();<NEW_LINE>System.out.println("Enter position");<NEW_LINE>posi = sc.nextInt();<NEW_LINE>list.insertAtPos(valu, posi);<NEW_LINE>break;<NEW_LINE>case 4:<NEW_LINE>list.deleteFirst();<NEW_LINE>break;<NEW_LINE>case 5:<NEW_LINE>list.deleteLast();<NEW_LINE>break;<NEW_LINE>case 6:<NEW_LINE><MASK><NEW_LINE>posi = sc.nextInt();<NEW_LINE>list.deleteAtPos(posi);<NEW_LINE>break;<NEW_LINE>case 7:<NEW_LINE>System.out.println("Enter value");<NEW_LINE>valu = sc.nextInt();<NEW_LINE>System.out.println("Enter position");<NEW_LINE>posi = sc.nextInt();<NEW_LINE>list.updateData(valu, posi);<NEW_LINE>break;<NEW_LINE>case 8:<NEW_LINE>list.reverseList();<NEW_LINE>break;<NEW_LINE>case 9:<NEW_LINE>list.viewList();<NEW_LINE>break;<NEW_LINE>case 10:<NEW_LINE>System.out.println(list.getListSize());<NEW_LINE>break;<NEW_LINE>case 11:<NEW_LINE>flag = false;<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>System.out.println("invalid choice");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
System.out.println("Enter position");
1,783,186
// For the transactional case, could read straight in, not via buffering graphs that catch syntax errors.<NEW_LINE>private static void addInGraphsWorker(DatasetGraph dsg, List<String> uriList, List<String> namedSourceList, String baseURI) {<NEW_LINE>String absBaseURI = null;<NEW_LINE>// Sort out base URI, if any.<NEW_LINE>if (baseURI != null)<NEW_LINE>absBaseURI = IRIs.resolve(baseURI);<NEW_LINE>// Merge into background graph<NEW_LINE>if (uriList != null && !uriList.isEmpty()) {<NEW_LINE>// Isolate from syntax errors<NEW_LINE>Graph gTmp = GraphFactory.createJenaDefaultGraph();<NEW_LINE>for (Iterator<String> iter = uriList.iterator(); iter.hasNext(); ) {<NEW_LINE>String sourceURI = iter.next();<NEW_LINE>String <MASK><NEW_LINE>// We can use a single temp graph.<NEW_LINE>RDFDataMgr.read(gTmp, sourceURI, absURI, null);<NEW_LINE>}<NEW_LINE>GraphUtil.addInto(dsg.getDefaultGraph(), gTmp);<NEW_LINE>}<NEW_LINE>if (namedSourceList != null && !namedSourceList.isEmpty()) {<NEW_LINE>for (Iterator<String> iter = namedSourceList.iterator(); iter.hasNext(); ) {<NEW_LINE>String sourceURI = iter.next();<NEW_LINE>String absURI = baseURI(sourceURI, absBaseURI);<NEW_LINE>// Read to a tmp graph in case of syntax errors.<NEW_LINE>Graph gTmp = GraphFactory.createJenaDefaultGraph();<NEW_LINE>RDFDataMgr.read(gTmp, sourceURI, absBaseURI, null);<NEW_LINE>Node gn = NodeFactory.createURI(sourceURI);<NEW_LINE>dsg.addGraph(gn, gTmp);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
absURI = baseURI(sourceURI, absBaseURI);
988,444
private static Map<Integer, Integer> createBranchOpcodeInversion() {<NEW_LINE>Map<Integer, Integer> <MASK><NEW_LINE>m.put(Opcode.IF_ACMPEQ, Opcode.IF_ACMPNE);<NEW_LINE>m.put(Opcode.IF_ACMPNE, Opcode.IF_ACMPEQ);<NEW_LINE>m.put(Opcode.IF_ICMPEQ, Opcode.IF_ICMPNE);<NEW_LINE>m.put(Opcode.IF_ICMPNE, Opcode.IF_ICMPEQ);<NEW_LINE>m.put(Opcode.IF_ICMPGE, Opcode.IF_ICMPLT);<NEW_LINE>m.put(Opcode.IF_ICMPLT, Opcode.IF_ICMPGE);<NEW_LINE>m.put(Opcode.IF_ICMPGT, Opcode.IF_ICMPLE);<NEW_LINE>m.put(Opcode.IF_ICMPLE, Opcode.IF_ICMPGT);<NEW_LINE>m.put(Opcode.IFEQ, Opcode.IFNE);<NEW_LINE>m.put(Opcode.IFNE, Opcode.IFEQ);<NEW_LINE>m.put(Opcode.IFGE, Opcode.IFLT);<NEW_LINE>m.put(Opcode.IFLT, Opcode.IFGE);<NEW_LINE>m.put(Opcode.IFGT, Opcode.IFLE);<NEW_LINE>m.put(Opcode.IFLE, Opcode.IFGT);<NEW_LINE>m.put(Opcode.IFNULL, Opcode.IFNONNULL);<NEW_LINE>m.put(Opcode.IFNONNULL, Opcode.IFNULL);<NEW_LINE>return Collections.unmodifiableMap(m);<NEW_LINE>}
m = new HashMap<>();
1,092,788
private static HttpUpload createHttpUploader(IParam param, Context ctx) {<NEW_LINE>if (param.isLeaf()) {<NEW_LINE>Object url = param.getLeafExpression().calculate(ctx);<NEW_LINE>if (!(url instanceof String)) {<NEW_LINE>MessageManager mm = EngineMessage.get();<NEW_LINE>throw new RQException("httpupload" + mm.getMessage("function.paramTypeError"));<NEW_LINE>}<NEW_LINE>return new HttpUpload((String) url);<NEW_LINE>} else if (param.getSubSize() == 2) {<NEW_LINE>IParam urlParam = param.getSub(0);<NEW_LINE>IParam csParam = param.getSub(1);<NEW_LINE>if (urlParam == null || csParam == null) {<NEW_LINE>MessageManager mm = EngineMessage.get();<NEW_LINE>throw new RQException("httpupload" + mm.getMessage("function.invalidParam"));<NEW_LINE>}<NEW_LINE>Object url = urlParam.getLeafExpression().calculate(ctx);<NEW_LINE>if (!(url instanceof String)) {<NEW_LINE>MessageManager mm = EngineMessage.get();<NEW_LINE>throw new RQException("httpupload" <MASK><NEW_LINE>}<NEW_LINE>Object cs = csParam.getLeafExpression().calculate(ctx);<NEW_LINE>if (!(cs instanceof String)) {<NEW_LINE>MessageManager mm = EngineMessage.get();<NEW_LINE>throw new RQException("httpupload" + mm.getMessage("function.paramTypeError"));<NEW_LINE>}<NEW_LINE>HttpUpload upload = new HttpUpload((String) url);<NEW_LINE>upload.setResultEncoding((String) cs);<NEW_LINE>return upload;<NEW_LINE>} else {<NEW_LINE>MessageManager mm = EngineMessage.get();<NEW_LINE>throw new RQException("httpupload" + mm.getMessage("function.invalidParam"));<NEW_LINE>}<NEW_LINE>}
+ mm.getMessage("function.paramTypeError"));
17,560
private static void validateRetentionConfig(TableConfig tableConfig) {<NEW_LINE>SegmentsValidationAndRetentionConfig segmentsConfig = tableConfig.getValidationConfig();<NEW_LINE>String tableName = tableConfig.getTableName();<NEW_LINE>if (segmentsConfig == null) {<NEW_LINE>throw new IllegalStateException(String<MASK><NEW_LINE>}<NEW_LINE>String segmentPushType = IngestionConfigUtils.getBatchSegmentIngestionType(tableConfig);<NEW_LINE>// segmentPushType is not needed for Realtime table<NEW_LINE>if (tableConfig.getTableType() == TableType.OFFLINE && segmentPushType != null && !segmentPushType.isEmpty()) {<NEW_LINE>if (!segmentPushType.equalsIgnoreCase("REFRESH") && !segmentPushType.equalsIgnoreCase("APPEND")) {<NEW_LINE>throw new IllegalStateException(String.format("Table: %s, invalid push type: %s", tableName, segmentPushType));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Retention may not be specified. Ignore validation in that case.<NEW_LINE>String timeUnitString = segmentsConfig.getRetentionTimeUnit();<NEW_LINE>if (timeUnitString == null || timeUnitString.isEmpty()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>TimeUnit.valueOf(timeUnitString.toUpperCase());<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new IllegalStateException(String.format("Table: %s, invalid time unit: %s", tableName, timeUnitString));<NEW_LINE>}<NEW_LINE>}
.format("Table: %s, \"segmentsConfig\" field is missing in table config", tableName));
1,826,245
private void computeLexicalScopes(AncestorChain<?> ac, LexicalScope parent, List<LexicalScope> scopes) {<NEW_LINE>// Compute the scope for the current node.<NEW_LINE>// Since we create a global scope in the original caller, avoid creating<NEW_LINE>// two scopes for the same object here.<NEW_LINE>LexicalScope scope = parent;<NEW_LINE>if (introducesScope(ac) && scope.root != ac) {<NEW_LINE>scope = new LexicalScope(ac, parent);<NEW_LINE>scopes.add(scope);<NEW_LINE>// Sets up the symbol table.<NEW_LINE>initScope(scope);<NEW_LINE>}<NEW_LINE>assert (ac.node instanceof Identifier || !ac.node.getAttributes().containsKey(CONTAINING_SCOPE)) : "Scope already attached to node";<NEW_LINE>ac.node.getAttributes().set(CONTAINING_SCOPE, scope);<NEW_LINE>// initScope may have set up some symbols, but if this is a declaration,<NEW_LINE>// do the appropriate hoisting and declarations.<NEW_LINE>if (ac.node instanceof Declaration) {<NEW_LINE>AncestorChain<Declaration> d = ac.cast(Declaration.class);<NEW_LINE>LexicalScope definingScope = scope;<NEW_LINE>while (definingScope.parent != null && hoist(d, definingScope)) {<NEW_LINE>definingScope = definingScope.parent;<NEW_LINE>}<NEW_LINE>ac.node.getAttributes().set(DEFINING_SCOPE, definingScope);<NEW_LINE>definingScope.symbols.declare(ac<MASK><NEW_LINE>}<NEW_LINE>// recurse to children<NEW_LINE>for (ParseTreeNode child : ac.node.children()) {<NEW_LINE>computeLexicalScopes(AncestorChain.instance(ac, child), scope, scopes);<NEW_LINE>}<NEW_LINE>}
.cast(Declaration.class));
421,440
public void processEvent(ComponentSystemEvent event) {<NEW_LINE>super.processEvent(event);<NEW_LINE>FacesContext facesContext = FacesContext.getCurrentInstance();<NEW_LINE>ResourceHandler resourceHanlder = facesContext.getApplication().getResourceHandler();<NEW_LINE>UIViewRoot view = facesContext.getViewRoot();<NEW_LINE>// verify if library css with resource test-style.css has been rendered<NEW_LINE>facesContext.addMessage(null, new FacesMessage("Message from " + CustomComponent.class.getSimpleName() + ": isResourceRendered library=css name=test-style.css --> " + resourceHanlder.isResourceRendered(facesContext, "test-style.css", "css")));<NEW_LINE>// mark library css with resource test-style.css as rendered<NEW_LINE>resourceHanlder.markResourceRendered(facesContext, "test-style.css", "css");<NEW_LINE>// verify again if library css with resource test-style.css has been rendered. It should be true now.<NEW_LINE>facesContext.addMessage(null, new FacesMessage("Message from " + CustomComponent.class.getSimpleName() + ": isResourceRendered library=css name=test-style.css --> " + resourceHanlder.isResourceRendered(facesContext, "test-style.css", "css")));<NEW_LINE>// get the component resources<NEW_LINE>facesContext.addMessage(null, new FacesMessage("Message from " + CustomComponent.class.getSimpleName() + ": getComponentResources List size --> " + view.getComponentResources(<MASK><NEW_LINE>}
facesContext).size()));
1,652,793
public void processMessage(final WebSocketMessage webSocketData) {<NEW_LINE>setDoTransactionNotifications(true);<NEW_LINE>String id = webSocketData.getId();<NEW_LINE>String newTemplateId = webSocketData.getNodeDataStringValue("newTemplateId");<NEW_LINE>// check node to append<NEW_LINE>if (id == null) {<NEW_LINE>getWebSocket().send(MessageBuilder.status().code(422).message("Cannot replace template, no id is given").build(), true);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// check for parent ID<NEW_LINE>if (newTemplateId == null) {<NEW_LINE>getWebSocket().send(MessageBuilder.status().code(422).message("Cannot replace template node without newTemplateId").build(), true);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// check if parent node with given ID exists<NEW_LINE>final Template newTemplate <MASK><NEW_LINE>if (newTemplate == null) {<NEW_LINE>getWebSocket().send(MessageBuilder.status().code(404).message("Replacement template node not found").build(), true);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final DOMNode templateToBeReplaced = getDOMNode(id);<NEW_LINE>if (templateToBeReplaced == null) {<NEW_LINE>getWebSocket().send(MessageBuilder.status().code(422).message("Unable to find template node to be replaced").build(), true);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>// 1: Clone new template into tree<NEW_LINE>final DOMNode newClonedTemplate = CloneComponentCommand.cloneComponent(newTemplate, templateToBeReplaced.getParent());<NEW_LINE>// 2: Move new template before existing template<NEW_LINE>DOMNode.insertBefore(templateToBeReplaced.getParent(), newClonedTemplate, templateToBeReplaced);<NEW_LINE>// 3: Move child nodes from existing template to new template<NEW_LINE>for (final DOMNode child : templateToBeReplaced.getAllChildNodes()) {<NEW_LINE>newClonedTemplate.appendChild(child);<NEW_LINE>}<NEW_LINE>// 4: Remove old template node<NEW_LINE>DOMNode.removeChild(templateToBeReplaced.getParent(), templateToBeReplaced);<NEW_LINE>TransactionCommand.registerNodeCallback(newClonedTemplate, callback);<NEW_LINE>} catch (DOMException | FrameworkException ex) {<NEW_LINE>// send DOM exception<NEW_LINE>getWebSocket().send(MessageBuilder.status().code(422).message(ex.getMessage()).build(), true);<NEW_LINE>}<NEW_LINE>}
= (Template) getNode(newTemplateId);
1,020,488
public static List<String> listChildrenAndWatchForNewChildren(ZooKeeperWatcher zkw, String zNode) throws KeeperException {<NEW_LINE>try {<NEW_LINE>List<String> children = zkw.getRecoverableZooKeeper().getChildren(zNode, zkw);<NEW_LINE>return children;<NEW_LINE>} catch (KeeperException.NoNodeException ke) {<NEW_LINE>if (logger.isDebugEnabled()) {<NEW_LINE>logger.debug(zkw.prefix("Unable to list children of zNode " + zNode + " " + "because node does not exist (not an error)"));<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} catch (KeeperException e) {<NEW_LINE>logger.warn(zkw.prefix("Unable to list children of zNode " + zNode + " "), e);<NEW_LINE>zkw.keeperException(e);<NEW_LINE>return null;<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>logger.warn(zkw.prefix("Unable to list children of zNode " <MASK><NEW_LINE>zkw.interruptedException(e);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}
+ zNode + " "), e);
1,774,568
public InteractionResultHolder<ItemStack> use(Level world, Player player, @Nonnull InteractionHand hand) {<NEW_LINE>ItemStack stack = player.getItemInHand(hand);<NEW_LINE>if (!world.isClientSide && ManaItemHandler.instance().requestManaExactForTool(stack, player, MANA_COST, false)) {<NEW_LINE>BlockState bifrost = ModBlocks.bifrost.defaultBlockState();<NEW_LINE>Vec3 vector = player.getLookAngle().normalize();<NEW_LINE>double x = player.getX();<NEW_LINE>double y = player.getY() - 1;<NEW_LINE>double z = player.getZ();<NEW_LINE>BlockPos.MutableBlockPos pos = new BlockPos.MutableBlockPos((int) x, (int) y, (int) z);<NEW_LINE>double lastX = 0;<NEW_LINE>double lastY = -1;<NEW_LINE>double lastZ = 0;<NEW_LINE>BlockPos.MutableBlockPos previousPos = new BlockPos.MutableBlockPos();<NEW_LINE>int count = 0;<NEW_LINE>boolean placedAny = false;<NEW_LINE>boolean prof = ManaItemHandler.instance(<MASK><NEW_LINE>int maxlen = prof ? 160 : 100;<NEW_LINE>int time = prof ? (int) (TIME * 1.6) : TIME;<NEW_LINE>BlockPos.MutableBlockPos placePos = new BlockPos.MutableBlockPos();<NEW_LINE>while (count < maxlen) {<NEW_LINE>previousPos.set(lastX, lastY, lastZ);<NEW_LINE>if (!previousPos.equals(pos)) {<NEW_LINE>// Occasionally moving to the next segment stays on the same location, skip it<NEW_LINE>if (!world.isEmptyBlock(pos) && world.getBlockState(pos) != bifrost && count >= 4) {<NEW_LINE>// Stop placing if you hit a wall (bifrost blocks are fine), but only after 4 segments.<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>if (world.isOutsideBuildHeight(pos.getY())) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>if (placeBridgeSegment(world, pos, placePos, time)) {<NEW_LINE>placedAny = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>count++;<NEW_LINE>lastX = x;<NEW_LINE>lastY = y;<NEW_LINE>lastZ = z;<NEW_LINE>x += vector.x;<NEW_LINE>y += vector.y;<NEW_LINE>z += vector.z;<NEW_LINE>pos.set(x, y, z);<NEW_LINE>}<NEW_LINE>if (placedAny) {<NEW_LINE>world.playSound(null, player.getX(), player.getY(), player.getZ(), ModSounds.bifrostRod, SoundSource.PLAYERS, 1F, 1F);<NEW_LINE>ManaItemHandler.instance().requestManaExactForTool(stack, player, MANA_COST, false);<NEW_LINE>player.getCooldowns().addCooldown(this, player.isCreative() ? 10 : TIME);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return InteractionResultHolder.success(stack);<NEW_LINE>}
).hasProficiency(player, stack);
1,060,529
public URL toServer(Project project, FileObject projectFile) {<NEW_LINE>String prefix = JsTestDriver.getServerURL();<NEW_LINE>if (!prefix.endsWith("/")) {<NEW_LINE>// NOI18N<NEW_LINE>// NOI18N<NEW_LINE>prefix += "/";<NEW_LINE>}<NEW_LINE>// NOI18N<NEW_LINE>prefix += "test/";<NEW_LINE>String relativePath = FileUtil.getRelativePath(project.getProjectDirectory(), projectFile);<NEW_LINE>if (relativePath != null) {<NEW_LINE>try {<NEW_LINE>return new URL(prefix + relativePath);<NEW_LINE>} catch (MalformedURLException ex) {<NEW_LINE>LOGGER.log(Level.WARNING, null, ex);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// maybe a test file from outside tests folder<NEW_LINE>FileObject testsFolder = getTestsFolder(project);<NEW_LINE>if (testsFolder == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (isUnderneath(testsFolder, projectFile)) {<NEW_LINE>// it is project file<NEW_LINE>String absolutePath = FileUtil.toFile(projectFile).getAbsolutePath();<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>} catch (MalformedURLException ex) {<NEW_LINE>LOGGER.log(Level.WARNING, null, ex);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
return new URL(prefix + absolutePath);
147,232
private Mono<Response<Flux<ByteBuffer>>> claimAnyVmWithResponseAsync(String resourceGroupName, String name, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>if (name == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null."));<NEW_LINE>}<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.claimAnyVm(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, name, this.client.getApiVersion(), accept, context);<NEW_LINE>}
error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
114,977
private synchronized void addMutations(Map<String, TabletServerMutations<Mutation>> binnedMutations) {<NEW_LINE>int count = 0;<NEW_LINE>// merge mutations into existing mutations for a tablet server<NEW_LINE>for (Entry<String, TabletServerMutations<Mutation>> entry : binnedMutations.entrySet()) {<NEW_LINE>String server = entry.getKey();<NEW_LINE>TabletServerMutations<Mutation> currentMutations = serversMutations.get(server);<NEW_LINE>if (currentMutations == null) {<NEW_LINE>serversMutations.put(<MASK><NEW_LINE>} else {<NEW_LINE>for (Entry<KeyExtent, List<Mutation>> entry2 : entry.getValue().getMutations().entrySet()) {<NEW_LINE>for (Mutation m : entry2.getValue()) {<NEW_LINE>currentMutations.addMutation(entry2.getKey(), m);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (log.isTraceEnabled())<NEW_LINE>for (Entry<KeyExtent, List<Mutation>> entry2 : entry.getValue().getMutations().entrySet()) count += entry2.getValue().size();<NEW_LINE>}<NEW_LINE>if (count > 0 && log.isTraceEnabled())<NEW_LINE>log.trace(String.format("Started sending %,d mutations to %,d tablet servers", count, binnedMutations.keySet().size()));<NEW_LINE>// randomize order of servers<NEW_LINE>ArrayList<String> servers = new ArrayList<>(binnedMutations.keySet());<NEW_LINE>Collections.shuffle(servers);<NEW_LINE>for (String server : servers) if (!queued.contains(server)) {<NEW_LINE>sendThreadPool.execute(new SendTask(server));<NEW_LINE>queued.add(server);<NEW_LINE>}<NEW_LINE>}
server, entry.getValue());
265,529
final ListRevisionAssetsResult executeListRevisionAssets(ListRevisionAssetsRequest listRevisionAssetsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listRevisionAssetsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListRevisionAssetsRequest> request = null;<NEW_LINE>Response<ListRevisionAssetsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListRevisionAssetsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listRevisionAssetsRequest));<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, "DataExchange");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListRevisionAssets");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListRevisionAssetsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListRevisionAssetsResultJsonUnmarshaller());<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());
1,839,161
private final PricingConditionsBreakQuery createPricingConditionsBreakQuery(final I_C_OrderLine salesOrderLine) {<NEW_LINE>final IProductDAO productsRepo = <MASK><NEW_LINE>final IAttributeDAO attributesRepo = Services.get(IAttributeDAO.class);<NEW_LINE>final ProductId productId = ProductId.ofRepoId(salesOrderLine.getM_Product_ID());<NEW_LINE>final ProductAndCategoryAndManufacturerId product = productsRepo.retrieveProductAndCategoryAndManufacturerByProductId(productId);<NEW_LINE>final AttributeSetInstanceId asiId = AttributeSetInstanceId.ofRepoIdOrNone(salesOrderLine.getM_AttributeSetInstance_ID());<NEW_LINE>final ImmutableAttributeSet attributes = attributesRepo.getImmutableAttributeSetById(asiId);<NEW_LINE>final BigDecimal qty = salesOrderLine.getQtyOrdered();<NEW_LINE>final BigDecimal price = salesOrderLine.getPriceActual();<NEW_LINE>return PricingConditionsBreakQuery.builder().product(product).attributes(attributes).qty(qty).price(price).build();<NEW_LINE>}
Services.get(IProductDAO.class);
313,749
private String addFieldsBinding(String target, List<ActionBuilderLine> lines, int level) {<NEW_LINE>StringBuilder stb = new StringBuilder();<NEW_LINE>lines.sort((l1, l2) -> {<NEW_LINE>if (l1.getDummy() && !l2.getDummy()) {<NEW_LINE>return -1;<NEW_LINE>}<NEW_LINE>if (!l1.getDummy() && l2.getDummy()) {<NEW_LINE>return 1;<NEW_LINE>}<NEW_LINE>return 0;<NEW_LINE>});<NEW_LINE>for (ActionBuilderLine line : lines) {<NEW_LINE>String name = line.getName();<NEW_LINE>String value = line.getValue();<NEW_LINE>if (value != null && value.contains(".sum(")) {<NEW_LINE>value = getSum(value, line.getFilter());<NEW_LINE>}<NEW_LINE>if (line.getDummy()) {<NEW_LINE>stb.append(format("_$." + name + " = " + value + ";", level));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>MetaJsonField jsonField = line.getMetaJsonField();<NEW_LINE>MetaField metaField = line.getMetaField();<NEW_LINE>if (jsonField != null && (jsonField.getTargetJsonModel() != null || jsonField.getTargetModel() != null)) {<NEW_LINE>value = addRelationalBinding(line, target, true);<NEW_LINE>} else if (metaField != null && metaField.getRelationship() != null) {<NEW_LINE>value = addRelationalBinding(line, target, false);<NEW_LINE>}<NEW_LINE>// else {<NEW_LINE>// MetaJsonField valueJson = line.getValueJson();<NEW_LINE>// if (valueJson != null && valueJson.getType().contentEquals("many-to-one")) {<NEW_LINE>// value = value.replace("$." + valueJson.getName(),"$json.create($json.find($."<NEW_LINE>// +<NEW_LINE>// valueJson.getName() + ".id))");<NEW_LINE>// }<NEW_LINE>// }<NEW_LINE>if (value != null && metaField != null && metaField.getTypeName().equals(BigDecimal.class.getSimpleName())) {<NEW_LINE>value = "new BigDecimal(" + value + ")";<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>if (condition != null) {<NEW_LINE>stb.append(format("if(" + condition + "){" + target + "." + name + " = " + value + ";}", level));<NEW_LINE>} else {<NEW_LINE>stb.append(format(target + "." + name + " = " + value + ";", level));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return stb.toString();<NEW_LINE>}
String condition = line.getConditionText();
447,744
public final I_AD_Printer_Config retrievePrinterConfig(@Nullable final String hostKey, @Nullable final UserId userToPrintId) {<NEW_LINE>try (MDC.MDCCloseable ignore = MDC.putCloseable("hostKey", hostKey);<NEW_LINE>MDC.MDCCloseable ignore2 = MDC.putCloseable("userToPrintId", Integer.toString(UserId.toRepoId(userToPrintId)))) {<NEW_LINE>final IQueryBuilder<I_AD_Printer_Config> queryBuilder = queryBL.createQueryBuilderOutOfTrx(I_AD_Printer_Config.class).addOnlyActiveRecordsFilter();<NEW_LINE>if (Check.isNotBlank(hostKey)) {<NEW_LINE>logger.debug("retrievePrinterConfig - will filter by ConfigHostKey IN ({}, NULL)", hostKey);<NEW_LINE>// allow "less specific" configs without hostkey<NEW_LINE>queryBuilder.addInArrayFilter(I_AD_Printer_Config.COLUMN_ConfigHostKey, hostKey, null);<NEW_LINE>} else {<NEW_LINE>Check.errorIf(userToPrintId == null, "If the 'hostKey' param is empty, then the 'userToPrintId has to be > 0");<NEW_LINE>}<NEW_LINE>// prefer records with hostkey set<NEW_LINE>queryBuilder.orderBy(I_AD_Printer_Config.COLUMNNAME_ConfigHostKey);<NEW_LINE>if (userToPrintId != null) {<NEW_LINE>logger.debug("retrievePrinterConfig - will filter by AD_User_PrinterMatchingConfig_ID={}", UserId.toRepoId(userToPrintId));<NEW_LINE>queryBuilder.addEqualsFilter(I_AD_Printer_Config.COLUMNNAME_AD_User_PrinterMatchingConfig_ID, userToPrintId);<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>Check.errorIf(Check.isBlank(hostKey), "If the 'userToPrintId' param is empty, then the 'hostKey has to be not-blank");<NEW_LINE>// prefer records with userId set<NEW_LINE>queryBuilder.orderBy(I_AD_Printer_Config.COLUMNNAME_AD_User_PrinterMatchingConfig_ID);<NEW_LINE>}<NEW_LINE>return queryBuilder.orderBy(I_AD_Printer_Config.COLUMNNAME_ConfigHostKey).create().first();<NEW_LINE>}<NEW_LINE>}
logger.debug("retrievePrinterConfig - userToPrintId is null -> order by AD_User_PrinterMatchingConfig_ID to prefer records with user set", hostKey);
426,041
public void hideSearchView() {<NEW_LINE>final int END_RADIUS = 16;<NEW_LINE>int startRadius = Math.max(searchViewLayout.getWidth(), searchViewLayout.getHeight());<NEW_LINE>Animator animator;<NEW_LINE>if (SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) {<NEW_LINE>int[] searchCoords = new int[2];<NEW_LINE>View searchItem = // It could change position, get it every time<NEW_LINE>appbar.getToolbar().// It could change position, get it every time<NEW_LINE>findViewById(R.id.search);<NEW_LINE>searchViewEditText.setText("");<NEW_LINE>searchItem.getLocationOnScreen(searchCoords);<NEW_LINE>animator = ViewAnimationUtils.createCircularReveal(searchViewLayout, searchCoords[0] + 32, searchCoords[1] - 16, startRadius, END_RADIUS);<NEW_LINE>} else {<NEW_LINE>// TODO: ViewAnimationUtils.createCircularReveal<NEW_LINE>animator = ObjectAnimator.ofFloat(searchViewLayout, "alpha", 1f, 0f);<NEW_LINE>}<NEW_LINE>// removing background fade view<NEW_LINE>mainActivity.hideSmokeScreen();<NEW_LINE>animator<MASK><NEW_LINE>animator.setDuration(600);<NEW_LINE>animator.start();<NEW_LINE>animator.addListener(new Animator.AnimatorListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onAnimationStart(Animator animation) {<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onAnimationEnd(Animator animation) {<NEW_LINE>searchViewLayout.setVisibility(View.GONE);<NEW_LINE>enabled = false;<NEW_LINE>InputMethodManager inputMethodManager = (InputMethodManager) mainActivity.getSystemService(INPUT_METHOD_SERVICE);<NEW_LINE>inputMethodManager.hideSoftInputFromWindow(searchViewEditText.getWindowToken(), InputMethodManager.HIDE_IMPLICIT_ONLY);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onAnimationCancel(Animator animation) {<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onAnimationRepeat(Animator animation) {<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
.setInterpolator(new AccelerateDecelerateInterpolator());
1,825,956
static protected int isSimpleAsFeature(/* const */<NEW_LINE>Geometry geometry, /* const */<NEW_LINE>SpatialReference spatialReference, boolean bForce, NonSimpleResult result, ProgressTracker progressTracker) {<NEW_LINE>if (result != null) {<NEW_LINE>result.m_reason = NonSimpleResult.Reason.NotDetermined;<NEW_LINE>result.m_vertexIndex1 = -1;<NEW_LINE>result.m_vertexIndex2 = -1;<NEW_LINE>}<NEW_LINE>if (geometry.isEmpty())<NEW_LINE>return 1;<NEW_LINE>Geometry.Type gt = geometry.getType();<NEW_LINE>if (gt == Geometry.Type.Point)<NEW_LINE>return 1;<NEW_LINE>double tolerance = InternalUtils.calculateToleranceFromGeometry(spatialReference, geometry, false);<NEW_LINE>if (gt == Geometry.Type.Envelope) {<NEW_LINE>Segment seg = (Segment) geometry;<NEW_LINE>Polyline polyline = new <MASK><NEW_LINE>polyline.addSegment(seg, true);<NEW_LINE>return isSimpleAsFeature(polyline, spatialReference, bForce, result, progressTracker);<NEW_LINE>}<NEW_LINE>// double geomTolerance = 0;<NEW_LINE>int isSimple = ((MultiVertexGeometryImpl) geometry._getImpl()).getIsSimple(tolerance);<NEW_LINE>int knownSimpleResult = bForce ? -1 : isSimple;<NEW_LINE>// TODO: need to distinguish KnownSimple between SimpleAsFeature and<NEW_LINE>// SimplePlanar.<NEW_LINE>// From the first sight it seems the SimplePlanar implies<NEW_LINE>// SimpleAsFeature.<NEW_LINE>if (knownSimpleResult != -1)<NEW_LINE>return knownSimpleResult;<NEW_LINE>OperatorSimplifyLocalHelper helper = new OperatorSimplifyLocalHelper(geometry, spatialReference, knownSimpleResult, progressTracker, false);<NEW_LINE>if (gt == Geometry.Type.MultiPoint) {<NEW_LINE>knownSimpleResult = helper.multiPointIsSimpleAsFeature_();<NEW_LINE>} else if (gt == Geometry.Type.Polyline) {<NEW_LINE>knownSimpleResult = helper.polylineIsSimpleAsFeature_();<NEW_LINE>} else if (gt == Geometry.Type.Polygon) {<NEW_LINE>knownSimpleResult = helper.polygonIsSimpleAsFeature_();<NEW_LINE>} else {<NEW_LINE>// what else?<NEW_LINE>throw GeometryException.GeometryInternalError();<NEW_LINE>}<NEW_LINE>((MultiVertexGeometryImpl) (geometry._getImpl())).setIsSimple(knownSimpleResult, tolerance, false);<NEW_LINE>if (result != null && knownSimpleResult == 0)<NEW_LINE>result.Assign(helper.m_nonSimpleResult);<NEW_LINE>return knownSimpleResult;<NEW_LINE>}
Polyline(seg.getDescription());
1,832,201
public void run() {<NEW_LINE>if (followersAdapter == null) {<NEW_LINE>if (followingIds == null) {<NEW_LINE>// we will do a normal array adapter<NEW_LINE>followersAdapter = new PeopleArrayAdapter(context, followers);<NEW_LINE>} else {<NEW_LINE>followersAdapter = new FollowersArrayAdapter(context, followers, followingIds);<NEW_LINE>}<NEW_LINE>listView.setAdapter(followersAdapter);<NEW_LINE>} else {<NEW_LINE>followersAdapter.notifyDataSetChanged();<NEW_LINE>}<NEW_LINE>if (settings.roundContactImages) {<NEW_LINE>ImageUtils.loadSizedCircleImage(context, profilePicture, thisUser.getOriginalProfileImageURL(), mCache, 96);<NEW_LINE>} else {<NEW_LINE>ImageUtils.loadImage(context, profilePicture, thisUser.getOriginalProfileImageURL(), mCache);<NEW_LINE>}<NEW_LINE>String url = user.getProfileBannerURL();<NEW_LINE>ImageUtils.loadImage(context, background, url, mCache);<NEW_LINE>canRefresh = true;<NEW_LINE><MASK><NEW_LINE>}
spinner.setVisibility(View.GONE);
1,369,425
boolean canClose() {<NEW_LINE>Collection<MultiViewElement> col = model.getCreatedElements();<NEW_LINE>Iterator<MultiViewElement> it = col.iterator();<NEW_LINE>Collection<CloseOperationState> <MASK><NEW_LINE>while (it.hasNext()) {<NEW_LINE>MultiViewElement el = it.next();<NEW_LINE>CloseOperationState state = el.canCloseElement();<NEW_LINE>if (!state.canClose()) {<NEW_LINE>badOnes.add(state);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (badOnes.size() > 0) {<NEW_LINE>CloseOperationState[] states = new CloseOperationState[badOnes.size()];<NEW_LINE>states = badOnes.toArray(states);<NEW_LINE>boolean res = closeHandler.resolveCloseOperation(states);<NEW_LINE>if (res && SpiAccessor.DEFAULT.shouldCheckCanCloseAgain(closeHandler)) {<NEW_LINE>// #236369 - check if everything saved ok<NEW_LINE>col = model.getCreatedElements();<NEW_LINE>it = col.iterator();<NEW_LINE>while (it.hasNext()) {<NEW_LINE>MultiViewElement el = it.next();<NEW_LINE>CloseOperationState state = el.canCloseElement();<NEW_LINE>if (!state.canClose()) {<NEW_LINE>res = false;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return res;<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
badOnes = new ArrayList<>();
461,091
private List<Set<String>> partitionTopicSet(Set<String> topicSet) {<NEW_LINE>List<Set<String>> topicGroups = new ArrayList<>();<NEW_LINE>List<String> sortedList = new ArrayList<>(topicSet);<NEW_LINE>Collections.sort(sortedList);<NEW_LINE>int maxTopicsEachProducerHolder = tubeConfig.getMaxTopicsEachProducerHold();<NEW_LINE>int cycle = sortedList.size() / maxTopicsEachProducerHolder;<NEW_LINE>int remainder = sortedList.size() % maxTopicsEachProducerHolder;<NEW_LINE>for (int i = 0; i <= cycle; i++) {<NEW_LINE>// allocate topic<NEW_LINE>Set<String> subset = new HashSet<>();<NEW_LINE>int startIndex = i * maxTopicsEachProducerHolder;<NEW_LINE>int endIndex = startIndex + maxTopicsEachProducerHolder - 1;<NEW_LINE>if (i == cycle) {<NEW_LINE>if (remainder == 0) {<NEW_LINE>continue;<NEW_LINE>} else {<NEW_LINE>endIndex = startIndex + remainder - 1;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (int index = startIndex; index <= endIndex; index++) {<NEW_LINE>subset.add<MASK><NEW_LINE>}<NEW_LINE>topicGroups.add(subset);<NEW_LINE>}<NEW_LINE>return topicGroups;<NEW_LINE>}
(sortedList.get(index));
447,800
public Row doNext() {<NEW_LINE>if (currentChunk == null || currentChunk.getPositionCount() == nextPos) {<NEW_LINE>if (currentChunks == null || !currentChunks.hasNext()) {<NEW_LINE>// has next<NEW_LINE>while (client.isValid()) {<NEW_LINE><MASK><NEW_LINE>QueryError queryError = clientResults.getError();<NEW_LINE>if (queryError != null) {<NEW_LINE>log.error("MppError:" + ec.getTraceId() + ",SchemaName=" + ec.getSchemaName() + ",stackInfo=" + queryError.getFailureInfo());<NEW_LINE>throw GeneralUtil.nestedException(queryError.toException());<NEW_LINE>}<NEW_LINE>Iterable<Object> data = clientResults.getData();<NEW_LINE>if (data != null) {<NEW_LINE>currentChunks = data.iterator();<NEW_LINE>client.advance();<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>client.advance();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (currentChunks != null && currentChunks.hasNext()) {<NEW_LINE>currentChunk = (Chunk) currentChunks.next();<NEW_LINE>nextPos = 0;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (currentChunk != null && currentChunk.getPositionCount() > nextPos) {<NEW_LINE>currentValue = currentChunk.rowAt(nextPos++);<NEW_LINE>currentValue.setCursorMeta(cursorMeta);<NEW_LINE>} else {<NEW_LINE>currentValue = null;<NEW_LINE>}<NEW_LINE>return currentValue;<NEW_LINE>}
QueryResults clientResults = client.current();