idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
672,573 | public void run(RegressionEnvironment env) {<NEW_LINE>RegressionPath path = new RegressionPath();<NEW_LINE>String stmtOrigText = "@name('split') @public on SupportBean as mystream " + "insert into AStream34 select mystream.theString||'_1' as theString where intPrimitive=1 " + "insert into BStream34 select mystream.theString||'_2' as theString where intPrimitive=2 " + "insert into CStream34 select theString||'_3' as theString";<NEW_LINE>env.compileDeploy(stmtOrigText, path).addListener("split");<NEW_LINE>env.compileDeploy("@name('s0') select * from AStream34", path).addListener("s0");<NEW_LINE>env.compileDeploy("@name('s1') select * from BStream34", path).addListener("s1");<NEW_LINE>env.compileDeploy("@name('s2') select * from CStream34", path).addListener("s2");<NEW_LINE>env.assertThat(() -> {<NEW_LINE>assertNotSame(env.statement("s0").getEventType(), env.statement("s1").getEventType());<NEW_LINE>assertSame(env.statement("s0").getEventType().getUnderlyingType(), env.statement("s1").getEventType().getUnderlyingType());<NEW_LINE>});<NEW_LINE>sendSupportBean(env, "E1", 1);<NEW_LINE>env.assertEqualsNew("s0", "theString", "E1_1");<NEW_LINE>env.assertListenerNotInvoked("s1");<NEW_LINE>env.assertListenerNotInvoked("s2");<NEW_LINE>env.assertListenerNotInvoked("split");<NEW_LINE>sendSupportBean(env, "E2", 2);<NEW_LINE>env.assertListenerNotInvoked("s0");<NEW_LINE>env.<MASK><NEW_LINE>env.assertListenerNotInvoked("s2");<NEW_LINE>env.assertListenerNotInvoked("split");<NEW_LINE>sendSupportBean(env, "E3", 1);<NEW_LINE>env.assertEqualsNew("s0", "theString", "E3_1");<NEW_LINE>env.assertListenerNotInvoked("s1");<NEW_LINE>env.assertListenerNotInvoked("s2");<NEW_LINE>env.assertListenerNotInvoked("split");<NEW_LINE>sendSupportBean(env, "E4", -999);<NEW_LINE>env.assertListenerNotInvoked("s0");<NEW_LINE>env.assertListenerNotInvoked("s1");<NEW_LINE>env.assertEqualsNew("s2", "theString", "E4_3");<NEW_LINE>env.assertListenerNotInvoked("split");<NEW_LINE>env.undeployAll();<NEW_LINE>} | assertEqualsNew("s1", "theString", "E2_2"); |
1,231,316 | public long writeSeeds(Path sampleSeedPath) throws Exception {<NEW_LINE>int fileNo = 0;<NEW_LINE>// total number of samples<NEW_LINE>long numTotal = this.numSamples;<NEW_LINE>// number of initial centroids<NEW_LINE>int centriodNum = genParams.length;<NEW_LINE>long numPerCluster = (long) Math.ceil(numTotal / (double) centriodNum);<NEW_LINE>// num of files per cluster<NEW_LINE>long numFiles = (long) Math.ceil(numPerCluster / (double) SAMPLES_PER_FILE);<NEW_LINE>for (int k = 0; k < genParams.length; k++) {<NEW_LINE>if (genParams[k].length != dimension)<NEW_LINE>throw new Exception("The dimension of mean vector or std vector does not match desired dimension!");<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>for (int d = 0; d < dimension; d++) {<NEW_LINE>if (genParams[k][d].length != 2)<NEW_LINE>throw new Exception("The dimension of mean vector or std vector does not match desired dimension");<NEW_LINE>sb.append("\t" + Double.toString(genParams[k][d][0]) + "\t" + Double.toString(genParams[k][d][1]));<NEW_LINE>}<NEW_LINE>for (long i = 0; i < numFiles; i++) {<NEW_LINE>SequenceFile.Writer out = createNewFile(new Path(sampleSeedPath, "seed" + (fileNo++)), IntWritable.class, Text.class);<NEW_LINE>out.append(new IntWritable(k), new Text(Long.toString(SAMPLES_PER_FILE) + sb.toString()));<NEW_LINE>out.close();<NEW_LINE>}<NEW_LINE>if (numFiles * SAMPLES_PER_FILE < numPerCluster) {<NEW_LINE><MASK><NEW_LINE>SequenceFile.Writer out = createNewFile(new Path(sampleSeedPath, "seed" + (fileNo++)), IntWritable.class, Text.class);<NEW_LINE>out.append(new IntWritable(k), new Text(Long.toString(left) + sb.toString()));<NEW_LINE>out.close();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return numPerCluster * centriodNum;<NEW_LINE>} | long left = numPerCluster - numFiles * SAMPLES_PER_FILE; |
978,556 | public static boolean extract(IPath destination) {<NEW_LINE>IPath zipExecutable = getBundlePath(ZIP_EXECUTABLE);<NEW_LINE>IPath archivePath = getBundlePath(ARCHIVE_PATH);<NEW_LINE>if (zipExecutable == null || archivePath == null) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>PortableGitPlugin.log("Something is missing here.");<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>File destinationFile = destination.toFile();<NEW_LINE>if (!destinationFile.exists() && !destinationFile.mkdirs()) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>PortableGitPlugin.log("Failed to create destination directory " + destinationFile.getAbsolutePath());<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>ProcessBuilder processBuilder = new // $NON-NLS-1$<NEW_LINE>ProcessBuilder(// $NON-NLS-1$<NEW_LINE>zipExecutable.toOSString(), // $NON-NLS-1$<NEW_LINE>"x", // $NON-NLS-1$<NEW_LINE>"-o" + destination.lastSegment(), "-y", archivePath.toOSString());<NEW_LINE>processBuilder.<MASK><NEW_LINE>processBuilder.redirectErrorStream(true);<NEW_LINE>StringBuffer output = new StringBuffer();<NEW_LINE>try {<NEW_LINE>Process process = processBuilder.start();<NEW_LINE>LineNumberReader reader = new LineNumberReader(new InputStreamReader(process.getInputStream()));<NEW_LINE>String line;<NEW_LINE>while ((line = reader.readLine()) != null) {<NEW_LINE>output.append(line);<NEW_LINE>}<NEW_LINE>process.waitFor();<NEW_LINE>return process.exitValue() == 0;<NEW_LINE>} catch (IOException e) {<NEW_LINE>PortableGitPlugin.log(e);<NEW_LINE>return false;<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>return false;<NEW_LINE>} finally {<NEW_LINE>PortableGitPlugin.log(output.toString());<NEW_LINE>}<NEW_LINE>} | directory(destinationFile.getParentFile()); |
958,935 | public SimpleHttpResponse sendMultipartPostRequest(String url, String body, @Nullable Map<String, String> headers) throws IOException {<NEW_LINE>HttpPost post = new HttpPost(url);<NEW_LINE>// our handlers ignore key...so we can put anything here<NEW_LINE>MultipartEntityBuilder builder = MultipartEntityBuilder.create();<NEW_LINE>builder.addTextBody("body", body);<NEW_LINE>post.setEntity(builder.build());<NEW_LINE>if (MapUtils.isNotEmpty(headers)) {<NEW_LINE>for (String key : headers.keySet()) {<NEW_LINE>post.addHeader(key<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>try (CloseableHttpResponse response = _httpClient.execute(post)) {<NEW_LINE>StatusLine statusLine = response.getStatusLine();<NEW_LINE>int statusCode = statusLine.getStatusCode();<NEW_LINE>if (statusCode >= 300) {<NEW_LINE>return new SimpleHttpResponse(statusCode, getErrorMessage(post, response));<NEW_LINE>}<NEW_LINE>return new SimpleHttpResponse(statusCode, EntityUtils.toString(response.getEntity()));<NEW_LINE>}<NEW_LINE>} | , headers.get(key)); |
409,484 | public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Receiver receiver, ValueNode sa, ValueNode sp, ValueNode da, ValueNode dp, ValueNode len) {<NEW_LINE>MetaAccessProvider metaAccess = b.getMetaAccess();<NEW_LINE>int byteArrayBaseOffset = metaAccess.getArrayBaseOffset(JavaKind.Byte);<NEW_LINE>ValueNode srcOffset = AddNode.create(ConstantNode.forInt(byteArrayBaseOffset), new LeftShiftNode(sp, ConstantNode.forInt(2)), NodeView.DEFAULT);<NEW_LINE>ValueNode dstOffset = AddNode.create(ConstantNode.forInt(byteArrayBaseOffset), dp, NodeView.DEFAULT);<NEW_LINE>ComputeObjectAddressNode src = b.add(new ComputeObjectAddressNode(sa, srcOffset));<NEW_LINE>ComputeObjectAddressNode dst = b.add(new ComputeObjectAddressNode(da, dstOffset));<NEW_LINE>b.addPush(JavaKind.Int, new EncodeArrayNode(src<MASK><NEW_LINE>return true;<NEW_LINE>} | , dst, len, ISO_8859_1)); |
1,359,485 | static TSpace avgTSpace(final TSpace tS0, final TSpace tS1) {<NEW_LINE>TSpace tsRes = new TSpace();<NEW_LINE>// this if is important. Due to floating point precision<NEW_LINE>// averaging when s0 == s1 will cause a slight difference<NEW_LINE>// which results in tangent space splits later on<NEW_LINE>if (tS0.magS == tS1.magS && tS0.magT == tS1.magT && tS0.os.equals(tS1.os) && tS0.ot.equals(tS1.ot)) {<NEW_LINE>tsRes.magS = tS0.magS;<NEW_LINE>tsRes.magT = tS0.magT;<NEW_LINE>tsRes.os.set(tS0.os);<NEW_LINE>tsRes.ot.set(tS0.ot);<NEW_LINE>} else {<NEW_LINE>tsRes.magS = 0.5f * (<MASK><NEW_LINE>tsRes.magT = 0.5f * (tS0.magT + tS1.magT);<NEW_LINE>tsRes.os.set(tS0.os).addLocal(tS1.os).normalizeLocal();<NEW_LINE>tsRes.ot.set(tS0.ot).addLocal(tS1.ot).normalizeLocal();<NEW_LINE>}<NEW_LINE>return tsRes;<NEW_LINE>} | tS0.magS + tS1.magS); |
1,488,590 | final ImportCertificateAuthorityCertificateResult executeImportCertificateAuthorityCertificate(ImportCertificateAuthorityCertificateRequest importCertificateAuthorityCertificateRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(importCertificateAuthorityCertificateRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ImportCertificateAuthorityCertificateRequest> request = null;<NEW_LINE>Response<ImportCertificateAuthorityCertificateResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ImportCertificateAuthorityCertificateRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(importCertificateAuthorityCertificateRequest));<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, "ACM PCA");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ImportCertificateAuthorityCertificate");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ImportCertificateAuthorityCertificateResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ImportCertificateAuthorityCertificateResultJsonUnmarshaller());<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,587,647 | private void deleteAllScopeJobs(ExecutionEntity scopeExecution, TimerJobEntityManager timerJobEntityManager) {<NEW_LINE>Collection<TimerJobEntity> timerJobsForExecution = timerJobEntityManager.findJobsByExecutionId(scopeExecution.getId());<NEW_LINE>for (TimerJobEntity job : timerJobsForExecution) {<NEW_LINE>timerJobEntityManager.delete(job);<NEW_LINE>}<NEW_LINE>JobEntityManager jobEntityManager = commandContext.getJobEntityManager();<NEW_LINE>Collection<JobEntity> jobsForExecution = jobEntityManager.findJobsByExecutionId(scopeExecution.getId());<NEW_LINE>for (JobEntity job : jobsForExecution) {<NEW_LINE>jobEntityManager.delete(job);<NEW_LINE>}<NEW_LINE>SuspendedJobEntityManager suspendedJobEntityManager = commandContext.getSuspendedJobEntityManager();<NEW_LINE>Collection<SuspendedJobEntity> suspendedJobsForExecution = suspendedJobEntityManager.<MASK><NEW_LINE>for (SuspendedJobEntity job : suspendedJobsForExecution) {<NEW_LINE>suspendedJobEntityManager.delete(job);<NEW_LINE>}<NEW_LINE>DeadLetterJobEntityManager deadLetterJobEntityManager = commandContext.getDeadLetterJobEntityManager();<NEW_LINE>Collection<DeadLetterJobEntity> deadLetterJobsForExecution = deadLetterJobEntityManager.findJobsByExecutionId(scopeExecution.getId());<NEW_LINE>for (DeadLetterJobEntity job : deadLetterJobsForExecution) {<NEW_LINE>deadLetterJobEntityManager.delete(job);<NEW_LINE>}<NEW_LINE>} | findJobsByExecutionId(scopeExecution.getId()); |
1,828,534 | public V putIfAbsent(K key, V value) {<NEW_LINE>requireNonNull(value);<NEW_LINE>// Keep in sync with BoundedVarExpiration.putIfAbsentAsync(key, value, duration, unit)<NEW_LINE>CompletableFuture<V> priorFuture = null;<NEW_LINE>for (; ; ) {<NEW_LINE>priorFuture = (priorFuture == null) ? delegate.get(key) : delegate.getIfPresentQuietly(key);<NEW_LINE>if (priorFuture != null) {<NEW_LINE>if (!priorFuture.isDone()) {<NEW_LINE>Async.getWhenSuccessful(priorFuture);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>V prior = Async.getWhenSuccessful(priorFuture);<NEW_LINE>if (prior != null) {<NEW_LINE>return prior;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>boolean[] added = { false };<NEW_LINE>CompletableFuture<V> computed = delegate.compute(key, (k, valueFuture) -> {<NEW_LINE>added[0] = (valueFuture == null) || (valueFuture.isDone() && (Async.<MASK><NEW_LINE>return added[0] ? CompletableFuture.completedFuture(value) : valueFuture;<NEW_LINE>}, delegate.expiry(), /* recordMiss */<NEW_LINE>false, /* recordLoad */<NEW_LINE>false, /* recordLoadFailure */<NEW_LINE>false);<NEW_LINE>if (added[0]) {<NEW_LINE>return null;<NEW_LINE>} else {<NEW_LINE>V prior = Async.getWhenSuccessful(computed);<NEW_LINE>if (prior != null) {<NEW_LINE>return prior;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | getIfReady(valueFuture) == null)); |
564,078 | protected Set<Response> read(OperationContext context) {<NEW_LINE>Set<Response> ret;<NEW_LINE>try {<NEW_LINE>PathMatchingResourcePatternResolver resourceResolver = new PathMatchingResourcePatternResolver();<NEW_LINE>Resource[] resources = resourceResolver.getResources("classpath*:" + <MASK><NEW_LINE>// TODO: restdocs in safe package name, not directly under restdocs<NEW_LINE>ret = Arrays.stream(resources).map(toRawHttpResponse()).filter(Objects::nonNull).collect(Collectors.collectingAndThen(toMap(RawHttpResponse::getStatusCode, mappingResponseToResponseMessageBuilder(), mergingExamples()), responseMessagesMap -> responseMessagesMap.values().stream().map(ResponseBuilder::build).collect(Collectors.toSet())));<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOG.warn("Failed to read restdocs example for {} " + context.getName() + " caused by: " + e.toString());<NEW_LINE>ret = Collections.emptySet();<NEW_LINE>}<NEW_LINE>return ret;<NEW_LINE>} | context.getName() + "*/http-response.springfox"); |
1,031,409 | public static void untargz(Path targz, Path outputDir, boolean stripRootFolder, Path selectFolder) throws IOException {<NEW_LINE>try (TarArchiveInputStream tarArchiveInputStream = new TarArchiveInputStream(new GzipCompressorInputStream(new FileInputStream(targz.toFile())))) {<NEW_LINE>TarArchiveEntry targzEntry;<NEW_LINE>while ((targzEntry = tarArchiveInputStream.getNextTarEntry()) != null) {<NEW_LINE>Path entry = Paths.get(targzEntry.getName());<NEW_LINE>if (stripRootFolder) {<NEW_LINE>if (entry.getNameCount() == 1) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>entry = entry.subpath(1, entry.getNameCount());<NEW_LINE>}<NEW_LINE>if (selectFolder != null) {<NEW_LINE>if (!entry.startsWith(selectFolder) || entry.equals(selectFolder)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>entry = entry.subpath(selectFolder.getNameCount(), entry.getNameCount());<NEW_LINE>}<NEW_LINE>entry = outputDir.resolve(entry).normalize();<NEW_LINE>if (!entry.startsWith(outputDir)) {<NEW_LINE>throw new IOException("Entry is outside of the target dir: " + targzEntry.getName());<NEW_LINE>}<NEW_LINE>if (targzEntry.isDirectory()) {<NEW_LINE>Files.createDirectories(entry);<NEW_LINE>} else {<NEW_LINE>if (!Files.isDirectory(entry.getParent())) {<NEW_LINE>Files.createDirectories(entry.getParent());<NEW_LINE>}<NEW_LINE>Files.copy(tarArchiveInputStream, entry);<NEW_LINE><MASK><NEW_LINE>if (mode != 0 && !Util.isWindows()) {<NEW_LINE>Set<PosixFilePermission> permissions = PosixFilePermissionSupport.toPosixFilePermissions(mode);<NEW_LINE>Files.setPosixFilePermissions(entry, permissions);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | int mode = targzEntry.getMode(); |
1,418,826 | public I_C_Contract_Change retrieveChangeConditions(final I_C_Flatrate_Term term, final int newSubscriptionId, final Timestamp changeDate) {<NEW_LINE>final String where = X_C_Contract_Change.COLUMNNAME_Action + "='" + X_C_Contract_Change.ACTION_Abowechsel + "' AND " + X_C_Contract_Change.COLUMNNAME_C_Flatrate_Transition_ID + "=? AND " + "COALESCE(" + X_C_Contract_Change.COLUMNNAME_C_Flatrate_Conditions_ID + ",0) IN (0,?) AND " + X_C_Contract_Change.COLUMNNAME_C_Flatrate_Conditions_Next_ID + "=?";<NEW_LINE>final Properties ctx = InterfaceWrapperHelper.getCtx(term);<NEW_LINE>final String trxName = InterfaceWrapperHelper.getTrxName(term);<NEW_LINE>final List<I_C_Contract_Change> entries = new Query(ctx, I_C_Contract_Change.Table_Name, where, trxName).setParameters(term.getC_Flatrate_Transition_ID(), term.getC_Flatrate_Conditions_ID(), newSubscriptionId).setOnlyActiveRecords(true).setClient_ID().setOrderBy(I_C_Contract_Change.COLUMNNAME_C_Contract_Change_ID).list(I_C_Contract_Change.class);<NEW_LINE>final I_C_Contract_Change earliestEntryForRefDate = getEarliestEntryForRefDate(entries, changeDate, term.getEndDate());<NEW_LINE>if (earliestEntryForRefDate == null) {<NEW_LINE>throw new SubscriptionChangeException(term.<MASK><NEW_LINE>}<NEW_LINE>return earliestEntryForRefDate;<NEW_LINE>} | getC_Flatrate_Conditions_ID(), newSubscriptionId, changeDate); |
547,548 | public int LAPACKE_dggesx_work(int arg0, byte arg1, byte arg2, byte arg3, Pointer arg4, byte arg5, int arg6, DoubleBuffer arg7, int arg8, DoubleBuffer arg9, int arg10, IntBuffer arg11, DoubleBuffer arg12, DoubleBuffer arg13, DoubleBuffer arg14, DoubleBuffer arg15, int arg16, DoubleBuffer arg17, int arg18, DoubleBuffer arg19, DoubleBuffer arg20, DoubleBuffer arg21, int arg22, IntBuffer arg23, int arg24, IntBuffer arg25) {<NEW_LINE>return LAPACKE_dggesx_work(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16, arg17, arg18, arg19, arg20, arg21, <MASK><NEW_LINE>} | arg22, arg23, arg24, arg25); |
340,898 | final ModifyLoadBalancerAttributesResult executeModifyLoadBalancerAttributes(ModifyLoadBalancerAttributesRequest modifyLoadBalancerAttributesRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(modifyLoadBalancerAttributesRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ModifyLoadBalancerAttributesRequest> request = null;<NEW_LINE>Response<ModifyLoadBalancerAttributesResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ModifyLoadBalancerAttributesRequestMarshaller().marshall(super.beforeMarshalling(modifyLoadBalancerAttributesRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Elastic Load Balancing v2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ModifyLoadBalancerAttributes");<NEW_LINE>request.<MASK><NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<ModifyLoadBalancerAttributesResult> responseHandler = new StaxResponseHandler<ModifyLoadBalancerAttributesResult>(new ModifyLoadBalancerAttributesResultStaxUnmarshaller());<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); |
1,383,498 | public void run() {<NEW_LINE>boolean active = TimeHelper.sleepToNextMinute();<NEW_LINE>while (active) {<NEW_LINE>Transaction t = Cat.newTransaction(<MASK><NEW_LINE>long current = System.currentTimeMillis();<NEW_LINE>try {<NEW_LINE>Set<String> domains = m_projectService.findAllDomains();<NEW_LINE>for (String domain : domains) {<NEW_LINE>if (m_serverFilterConfigManager.validateDomain(domain) && StringUtils.isNotEmpty(domain)) {<NEW_LINE>try {<NEW_LINE>processDomain(domain);<NEW_LINE>} catch (Exception e) {<NEW_LINE>Cat.logError(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>t.setStatus(Transaction.SUCCESS);<NEW_LINE>} catch (Exception e) {<NEW_LINE>t.setStatus(e);<NEW_LINE>} finally {<NEW_LINE>t.complete();<NEW_LINE>}<NEW_LINE>long duration = System.currentTimeMillis() - current;<NEW_LINE>try {<NEW_LINE>if (duration < DURATION) {<NEW_LINE>Thread.sleep(DURATION - duration);<NEW_LINE>}<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>active = false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | "AlertHeartbeat", TimeHelper.getMinuteStr()); |
795,366 | public void process(DMatrixRMaj K1, Se3_F64 worldToCamera1, DMatrixRMaj K2, Se3_F64 worldToCamera2) {<NEW_LINE>SimpleMatrix sK1 = SimpleMatrix.wrap(K1);<NEW_LINE>SimpleMatrix sK2 = SimpleMatrix.wrap(K2);<NEW_LINE>SimpleMatrix R1 = SimpleMatrix.wrap(worldToCamera1.getR());<NEW_LINE>SimpleMatrix R2 = SimpleMatrix.wrap(worldToCamera2.getR());<NEW_LINE>SimpleMatrix T1 = new SimpleMatrix(3, 1, true, new double[] { worldToCamera1.getT().x, worldToCamera1.getT().y, worldToCamera1.getT().z });<NEW_LINE>SimpleMatrix T2 = new SimpleMatrix(3, 1, true, new double[] { worldToCamera2.getT().x, worldToCamera2.getT().y, worldToCamera2.getT().z });<NEW_LINE>// P = K*[R|T]<NEW_LINE>SimpleMatrix <MASK><NEW_LINE>SimpleMatrix KR2 = sK2.mult(R2);<NEW_LINE>// compute optical centers in world reference frame<NEW_LINE>// c = -R'*T<NEW_LINE>SimpleMatrix c1 = R1.transpose().mult(T1.scale(-1));<NEW_LINE>SimpleMatrix c2 = R2.transpose().mult(T2.scale(-1));<NEW_LINE>// new coordinate system axises<NEW_LINE>selectAxises(R1, R2, c1, c2);<NEW_LINE>// new extrinsic parameters, rotation matrix with rows of camera 1's coordinate system in<NEW_LINE>// the world frame<NEW_LINE>SimpleMatrix RR = new SimpleMatrix(3, 3, true, new double[] { v1.x, v1.y, v1.z, v2.x, v2.y, v2.z, v3.x, v3.y, v3.z });<NEW_LINE>// new calibration matrix that is an average of the original<NEW_LINE>K.setTo(sK1.plus(sK2).scale(0.5));<NEW_LINE>// set skew to zero<NEW_LINE>K.set(0, 1, 0);<NEW_LINE>// new projection rotation matrices<NEW_LINE>SimpleMatrix KRR = K.mult(RR);<NEW_LINE>// rectification transforms<NEW_LINE>undistToRectPixels1.setTo(KRR.mult(KR1.invert()).getDDRM());<NEW_LINE>undistToRectPixels2.setTo(KRR.mult(KR2.invert()).getDDRM());<NEW_LINE>rectifiedRotation = RR.getDDRM();<NEW_LINE>} | KR1 = sK1.mult(R1); |
1,102,859 | public static CSmartCombo<DBPConnectionType> createConnectionTypeCombo(Composite composite) {<NEW_LINE>UIUtils.createControlLabel(composite, CoreMessages.dialog_connection_wizard_final_label_connection_type);<NEW_LINE>Composite ctGroup = <MASK><NEW_LINE>CSmartCombo<DBPConnectionType> connectionTypeCombo = new CSmartCombo<>(ctGroup, SWT.BORDER | SWT.DROP_DOWN | SWT.READ_ONLY, new ConnectionTypeLabelProvider());<NEW_LINE>loadConnectionTypes(connectionTypeCombo);<NEW_LINE>setConnectionType(connectionTypeCombo, DBPConnectionType.getDefaultConnectionType());<NEW_LINE>connectionTypeCombo.select(DBPConnectionType.getDefaultConnectionType());<NEW_LINE>final GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);<NEW_LINE>gd.widthHint = UIUtils.getFontHeight(connectionTypeCombo) * 20;<NEW_LINE>connectionTypeCombo.setLayoutData(gd);<NEW_LINE>return connectionTypeCombo;<NEW_LINE>} | UIUtils.createComposite(composite, 1); |
946,714 | private static void tryPattern3Stream(RegressionEnvironment env, String text, AtomicInteger milestone, Integer[] intBoxedA, Double[] doubleBoxedA, Integer[] intBoxedB, Double[] doubleBoxedB, Integer[] intBoxedC, Double[] doubleBoxedC, boolean[] expected) {<NEW_LINE>assertEquals(intBoxedA.length, doubleBoxedA.length);<NEW_LINE>assertEquals(intBoxedB.length, doubleBoxedB.length);<NEW_LINE>assertEquals(expected.length, doubleBoxedA.length);<NEW_LINE>assertEquals(intBoxedA.length, doubleBoxedB.length);<NEW_LINE>assertEquals(intBoxedC.length, doubleBoxedC.length);<NEW_LINE>assertEquals(intBoxedB.length, doubleBoxedC.length);<NEW_LINE>for (int i = 0; i < intBoxedA.length; i++) {<NEW_LINE>env.compileDeployAddListenerMile("@name('s0')" + text, "s0", milestone.getAndIncrement());<NEW_LINE>sendBeanIntDouble(env, intBoxedA[<MASK><NEW_LINE>sendBeanIntDouble(env, intBoxedB[i], doubleBoxedB[i]);<NEW_LINE>sendBeanIntDouble(env, intBoxedC[i], doubleBoxedC[i]);<NEW_LINE>int index = i;<NEW_LINE>env.assertListener("s0", listener -> assertEquals("failed at index " + index, expected[index], listener.getAndClearIsInvoked()));<NEW_LINE>env.undeployAll();<NEW_LINE>}<NEW_LINE>} | i], doubleBoxedA[i]); |
720,345 | public void buildMacro(MacroSymbol sym, ConstructTpl rtl) {<NEW_LINE>entry("buildMacro", sym, rtl);<NEW_LINE>String errstring = checkSymbols(symtab.getCurrentScope());<NEW_LINE>if (errstring.length() != 0) {<NEW_LINE>reportError(sym.getLocation(), "Error in definition of macro '" + sym.<MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (!expandMacros(rtl)) {<NEW_LINE>reportError(sym.getLocation(), "Could not expand submacro in definition of macro '" + sym.getName() + "'");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Propagate size information (as much as possible)<NEW_LINE>pcode.propagateSize(rtl);<NEW_LINE>sym.setConstruct(rtl);<NEW_LINE>// Pop local variables used to define macro<NEW_LINE>symtab.popScope();<NEW_LINE>macrotable.push_back(rtl);<NEW_LINE>} | getName() + "': " + errstring); |
989,870 | public static void main(String[] args) {<NEW_LINE>final ConfigBuilder configBuilder = new ConfigBuilder();<NEW_LINE>if (args.length > 0) {<NEW_LINE>configBuilder.withMasterUrl(args[0]);<NEW_LINE>}<NEW_LINE>try (KubernetesClient client = new KubernetesClientBuilder().withConfig(configBuilder.build()).build()) {<NEW_LINE>VersionInfo versionInfo = client.getVersion();<NEW_LINE>logger.info("Version details of this Kubernetes cluster :-");<NEW_LINE>logger.info("Major : {}", versionInfo.getMajor());<NEW_LINE>logger.info("Minor : {}", versionInfo.getMinor());<NEW_LINE>logger.info("GitVersion : {}", versionInfo.getGitVersion());<NEW_LINE>logger.info("BuildDate : {}", versionInfo.getBuildDate());<NEW_LINE>logger.info("GitTreeState : {}", versionInfo.getGitTreeState());<NEW_LINE>logger.info("Platform : {}", versionInfo.getPlatform());<NEW_LINE>logger.info(<MASK><NEW_LINE>logger.info("GoVersion : {}", versionInfo.getGoVersion());<NEW_LINE>logger.info("GitCommit : {}", versionInfo.getGitCommit());<NEW_LINE>}<NEW_LINE>} | "GitVersion : {}", versionInfo.getGitVersion()); |
265,574 | final CreateSafetyRuleResult executeCreateSafetyRule(CreateSafetyRuleRequest createSafetyRuleRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createSafetyRuleRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateSafetyRuleRequest> request = null;<NEW_LINE>Response<CreateSafetyRuleResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateSafetyRuleRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createSafetyRuleRequest));<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, "Route53 Recovery Control Config");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateSafetyRule");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateSafetyRuleResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateSafetyRuleResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} | endClientExecution(awsRequestMetrics, request, response); |
1,211,558 | protected void engineSetPadding(String padding) throws NoSuchPaddingException {<NEW_LINE>String pad = Strings.toUpperCase(padding);<NEW_LINE>if (pad.equals("NOPADDING")) {<NEW_LINE>cipher = new RSABlindedEngine();<NEW_LINE>} else if (pad.equals("PKCS1PADDING")) {<NEW_LINE>cipher = new PKCS1Encoding(new RSABlindedEngine());<NEW_LINE>} else if (pad.equals("ISO9796-1PADDING")) {<NEW_LINE>cipher = new ISO9796d1Encoding(new RSABlindedEngine());<NEW_LINE>} else if (pad.equals("OAEPPADDING")) {<NEW_LINE>cipher = new OAEPEncoding(new RSABlindedEngine());<NEW_LINE>} else if (pad.equals("OAEPWITHSHA1ANDMGF1PADDING")) {<NEW_LINE>cipher = new OAEPEncoding(new RSABlindedEngine());<NEW_LINE>} else if (pad.equals("OAEPWITHSHA224ANDMGF1PADDING")) {<NEW_LINE>cipher = new OAEPEncoding(new RSABlindedEngine(), new SHA224Digest());<NEW_LINE>} else if (pad.equals("OAEPWITHSHA256ANDMGF1PADDING")) {<NEW_LINE>cipher = new OAEPEncoding(new RSABlindedEngine(), new SHA256Digest());<NEW_LINE>} else if (pad.equals("OAEPWITHSHA384ANDMGF1PADDING")) {<NEW_LINE>cipher = new OAEPEncoding(new RSABlindedEngine<MASK><NEW_LINE>} else if (pad.equals("OAEPWITHSHA512ANDMGF1PADDING")) {<NEW_LINE>cipher = new OAEPEncoding(new RSABlindedEngine(), new SHA512Digest());<NEW_LINE>} else if (pad.equals("OAEPWITHMD5ANDMGF1PADDING")) {<NEW_LINE>cipher = new OAEPEncoding(new RSABlindedEngine(), new MD5Digest());<NEW_LINE>} else {<NEW_LINE>throw new NoSuchPaddingException(padding + " unavailable with RSA.");<NEW_LINE>}<NEW_LINE>} | (), new SHA384Digest()); |
1,407,253 | public void recordFetch(ClusterNode clusterNode, ByteArray key) {<NEW_LINE>if (lastFetchedKey.containsKey(clusterNode)) {<NEW_LINE>ByteArray <MASK><NEW_LINE>if (!key.equals(lastKey)) {<NEW_LINE>if (!fullyFetchedKeyMap.containsKey(lastKey)) {<NEW_LINE>fullyFetchedKeyMap.put(lastKey, new HashSet<ClusterNode>());<NEW_LINE>}<NEW_LINE>Set<ClusterNode> lastKeyIterSet = fullyFetchedKeyMap.get(lastKey);<NEW_LINE>lastKeyIterSet.add(clusterNode);<NEW_LINE>// sweep if fully fetched by all iterators<NEW_LINE>if (lastKeyIterSet.size() == fetcherCount) {<NEW_LINE>fullyFetchedKeys.add(lastKey);<NEW_LINE>fullyFetchedKeyMap.remove(lastKey);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// remember key fetch states<NEW_LINE>lastFetchedKey.put(clusterNode, key);<NEW_LINE>} | lastKey = lastFetchedKey.get(clusterNode); |
1,649,697 | public DoubleMatrix[] solveWithSensitivity(double[] values, double[] intervals, double[] slopes, double[][] slopeSensitivity, DoubleArray[] firstWithSensitivity) {<NEW_LINE>int nData = values.length;<NEW_LINE>double[] first = firstWithSensitivity[0].toArray();<NEW_LINE>DoubleMatrix[] res = new DoubleMatrix[nData];<NEW_LINE>double[][] coef = solve(<MASK><NEW_LINE>res[0] = DoubleMatrix.copyOf(coef);<NEW_LINE>for (int i = 0; i < nData - 1; ++i) {<NEW_LINE>double[][] coefSense = new double[4][nData];<NEW_LINE>Arrays.fill(coefSense[3], 0.);<NEW_LINE>coefSense[3][i] = 1.;<NEW_LINE>for (int k = 0; k < nData; ++k) {<NEW_LINE>coefSense[0][k] = -(2. * slopeSensitivity[i][k] - firstWithSensitivity[i + 2].get(k) - firstWithSensitivity[i + 1].get(k)) / intervals[i] / intervals[i];<NEW_LINE>coefSense[1][k] = (3. * slopeSensitivity[i][k] - firstWithSensitivity[i + 2].get(k) - 2. * firstWithSensitivity[i + 1].get(k)) / intervals[i];<NEW_LINE>coefSense[2][k] = firstWithSensitivity[i + 1].get(k);<NEW_LINE>}<NEW_LINE>res[i + 1] = DoubleMatrix.copyOf(coefSense);<NEW_LINE>}<NEW_LINE>return res;<NEW_LINE>} | values, intervals, slopes, first); |
1,232,947 | private void pushDownPredicatesPastWindows(Analyzer analyzer, SelectStmt stmt) throws AnalysisException {<NEW_LINE>final <MASK><NEW_LINE>if (analyticInfo == null || analyticInfo.getCommonPartitionExprs().size() == 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final List<Expr> predicates = getBoundPredicates(analyzer, analyticInfo.getOutputTupleDesc());<NEW_LINE>if (predicates.size() <= 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Push down predicates to Windows' child until they are assigned successfully.<NEW_LINE>final List<Expr> pushDownPredicates = getPredicatesBoundedByGroupbysSourceExpr(predicates, analyzer, stmt);<NEW_LINE>if (pushDownPredicates.size() <= 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (putPredicatesOnAggregation(stmt, analyzer, pushDownPredicates)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>putPredicatesOnTargetTupleIds(stmt.getTableRefIds(), analyzer, predicates);<NEW_LINE>} | AnalyticInfo analyticInfo = stmt.getAnalyticInfo(); |
1,484,753 | public Double pay(@QueryParam("acct") String acctNumber, Payment payment) throws UnknownAccountException, InsufficientFundsException {<NEW_LINE>int myTimeout = AsyncTestServlet.TIMEOUT;<NEW_LINE>if (isAIX()) {<NEW_LINE>myTimeout = AsyncTestServlet.TIMEOUT * 2;<NEW_LINE>}<NEW_LINE>if (isZOS()) {<NEW_LINE>myTimeout = AsyncTestServlet.TIMEOUT * 3;<NEW_LINE>}<NEW_LINE>Double balance = accountBalances.get(acctNumber);<NEW_LINE>if (balance == null) {<NEW_LINE>throw new UnknownAccountException();<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>Double remainingBalanceInAccount = bankAccountClient.withdraw(paymentAmt).toCompletableFuture().get(myTimeout, TimeUnit.SECONDS);<NEW_LINE>_log.info("balance remaining in bank after withdrawal: " + remainingBalanceInAccount);<NEW_LINE>} catch (ExecutionException | InterruptedException | TimeoutException ex) {<NEW_LINE>Throwable t = ex.getCause();<NEW_LINE>if (t != null && t instanceof InsufficientFundsException) {<NEW_LINE>throw (InsufficientFundsException) t;<NEW_LINE>}<NEW_LINE>_log.log(Level.WARNING, "Caught unexpected exception: " + ex + " with cause " + t);<NEW_LINE>_log.info(crunchifyGenerateThreadDump());<NEW_LINE>}<NEW_LINE>Double remainingBalance = balance - paymentAmt;<NEW_LINE>accountBalances.put(acctNumber, remainingBalance);<NEW_LINE>_log.info("pay " + acctNumber + " " + remainingBalance);<NEW_LINE>return remainingBalance;<NEW_LINE>} | Double paymentAmt = payment.getAmount(); |
1,130,543 | public Object clone() {<NEW_LINE>CrosstabBaseCloneFactory factory = new CrosstabBaseCloneFactory();<NEW_LINE>JRBaseCrosstab clone = (JRBaseCrosstab) super.clone();<NEW_LINE>clone.parameters = JRCloneUtils.cloneArray(parameters);<NEW_LINE>if (variables != null) {<NEW_LINE>clone.variables = new JRVariable[variables.length];<NEW_LINE>for (int i = 0; i < variables.length; i++) {<NEW_LINE>clone.variables[i] = factory.clone(variables[i]);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>clone.parametersMapExpression = JRCloneUtils.nullSafeClone(parametersMapExpression);<NEW_LINE>clone.dataset = JRCloneUtils.nullSafeClone(dataset);<NEW_LINE>clone.rowGroups = factory.cloneCrosstabObjects(rowGroups);<NEW_LINE>clone.columnGroups = factory.cloneCrosstabObjects(columnGroups);<NEW_LINE>clone.measures = factory.cloneCrosstabObjects(measures);<NEW_LINE>clone.cells = new <MASK><NEW_LINE>for (int i = 0; i < cells.length; i++) {<NEW_LINE>clone.cells[i] = JRCloneUtils.cloneArray(cells[i]);<NEW_LINE>}<NEW_LINE>clone.whenNoDataCell = JRCloneUtils.nullSafeClone(whenNoDataCell);<NEW_LINE>clone.titleCell = JRCloneUtils.nullSafeClone(titleCell);<NEW_LINE>clone.headerCell = JRCloneUtils.nullSafeClone(headerCell);<NEW_LINE>clone.lineBox = lineBox.clone(clone);<NEW_LINE>return clone;<NEW_LINE>} | JRCrosstabCell[cells.length][]; |
607,599 | public void deleteAttachmentsByTaskId(String taskId) {<NEW_LINE>checkHistoryEnabled();<NEW_LINE>List<AttachmentEntity> attachments = findAttachmentsByTaskId(taskId);<NEW_LINE>FlowableEventDispatcher eventDispatcher = getEventDispatcher();<NEW_LINE>boolean dispatchEvents = eventDispatcher != null && eventDispatcher.isEnabled();<NEW_LINE>String processInstanceId = null;<NEW_LINE>String processDefinitionId = null;<NEW_LINE>String executionId = null;<NEW_LINE>if (dispatchEvents && attachments != null && !attachments.isEmpty()) {<NEW_LINE>// Forced to fetch the task to get hold of the process definition<NEW_LINE>// for event-dispatching, if available<NEW_LINE>Task task = engineConfiguration.getTaskServiceConfiguration().getTaskService().getTask(taskId);<NEW_LINE>if (task != null) {<NEW_LINE>processDefinitionId = task.getProcessDefinitionId();<NEW_LINE>processInstanceId = task.getProcessInstanceId();<NEW_LINE>executionId = task.getExecutionId();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (Attachment attachment : attachments) {<NEW_LINE><MASK><NEW_LINE>if (contentId != null) {<NEW_LINE>getByteArrayEntityManager().deleteByteArrayById(contentId);<NEW_LINE>}<NEW_LINE>dataManager.delete((AttachmentEntity) attachment);<NEW_LINE>if (dispatchEvents) {<NEW_LINE>eventDispatcher.dispatchEvent(FlowableEventBuilder.createEntityEvent(FlowableEngineEventType.ENTITY_DELETED, attachment, executionId, processInstanceId, processDefinitionId), engineConfiguration.getEngineCfgKey());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | String contentId = attachment.getContentId(); |
1,278,931 | public List<RouteSegmentResult> findRouteWithIntermediateSegments(RouteCalculationParams routeParams, RouteCalculationResult result, List<Location> gpxRouteLocations, List<Location> segmentEndpoints, int nearestGpxPointInd) {<NEW_LINE>List<RouteSegmentResult> newGpxRoute = new ArrayList<>();<NEW_LINE>int lastIndex = nearestGpxPointInd;<NEW_LINE>for (int i = 0; i < segmentEndpoints.size() - 1; i += 2) {<NEW_LINE>Location prevSegmentPoint = segmentEndpoints.get(i);<NEW_LINE>Location newSegmentPoint = segmentEndpoints.get(i + 1);<NEW_LINE>if (prevSegmentPoint.distanceTo(newSegmentPoint) <= MIN_DISTANCE_FOR_INSERTING_ROUTE_SEGMENT) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>int indexNew = findNearestGpxPointIndexFromRoute(gpxRouteLocations, newSegmentPoint, routeParams.gpxRoute.calculateOsmAndRouteParts);<NEW_LINE>int indexPrev = findNearestGpxPointIndexFromRoute(gpxRouteLocations, <MASK><NEW_LINE>if (indexPrev != -1 && indexPrev > nearestGpxPointInd && indexNew != -1) {<NEW_LINE>List<RouteSegmentResult> route = result.getOriginalRoute(lastIndex, indexPrev, true);<NEW_LINE>if (!Algorithms.isEmpty(route)) {<NEW_LINE>newGpxRoute.addAll(route);<NEW_LINE>}<NEW_LINE>lastIndex = indexNew;<NEW_LINE>LatLon end = new LatLon(newSegmentPoint.getLatitude(), newSegmentPoint.getLongitude());<NEW_LINE>RouteCalculationResult newRes = findOfflineRouteSegment(routeParams, prevSegmentPoint, end);<NEW_LINE>List<RouteSegmentResult> segmentResults = newRes.getOriginalRoute();<NEW_LINE>if (!Algorithms.isEmpty(segmentResults)) {<NEW_LINE>newGpxRoute.addAll(segmentResults);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>List<RouteSegmentResult> route = result.getOriginalRoute(lastIndex);<NEW_LINE>if (!Algorithms.isEmpty(route)) {<NEW_LINE>newGpxRoute.addAll(route);<NEW_LINE>}<NEW_LINE>return newGpxRoute;<NEW_LINE>} | prevSegmentPoint, routeParams.gpxRoute.calculateOsmAndRouteParts); |
1,386,544 | private BuildRule createExtensionBuildRule(BuildTarget buildTarget, ProjectFilesystem projectFilesystem, ActionGraphBuilder graphBuilder, CellPathResolver cellRoots, PythonPlatform pythonPlatform, CxxPlatform cxxPlatform, CxxPythonExtensionDescriptionArg args) {<NEW_LINE>String moduleName = args.getModuleName().<MASK><NEW_LINE>String extensionName = getExtensionName(moduleName);<NEW_LINE>Path extensionPath = getExtensionPath(projectFilesystem, buildTarget, moduleName, pythonPlatform.getFlavor(), cxxPlatform.getFlavor());<NEW_LINE>ImmutableSet<BuildRule> deps = getPlatformDeps(graphBuilder, pythonPlatform, cxxPlatform, args);<NEW_LINE>return CxxLinkableEnhancer.createCxxLinkableBuildRule(cxxBuckConfig, cxxPlatform, projectFilesystem, graphBuilder, getExtensionTarget(buildTarget, pythonPlatform.getFlavor(), cxxPlatform.getFlavor()), Linker.LinkType.SHARED, Optional.of(extensionName), extensionPath, args.getLinkerExtraOutputs(), Linker.LinkableDepType.SHARED, Optional.empty(), CxxLinkOptions.of(), RichStream.from(deps).filter(NativeLinkableGroup.class).map(g -> g.getNativeLinkable(cxxPlatform, graphBuilder)).toImmutableList(), args.getCxxRuntimeType(), Optional.empty(), ImmutableSet.of(), ImmutableSet.of(), NativeLinkableInput.builder().setArgs(getExtensionArgs(buildTarget.withoutFlavors(LinkerMapMode.FLAVOR_DOMAIN.getFlavors()), projectFilesystem, graphBuilder, cellRoots, cxxPlatform, args, deps, true)).setFrameworks(args.getFrameworks()).setLibraries(args.getLibraries()).build(), Optional.empty(), cellRoots);<NEW_LINE>} | orElse(buildTarget.getShortName()); |
1,361,528 | private Mono<Response<Flux<ByteBuffer>>> startWithResponseAsync(String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, 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 (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (vmScaleSetName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName 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 (vmInstanceIDs != null) {<NEW_LINE>vmInstanceIDs.validate();<NEW_LINE>}<NEW_LINE>final String apiVersion = "2021-11-01";<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.start(this.client.getEndpoint(), resourceGroupName, vmScaleSetName, apiVersion, this.client.getSubscriptionId(<MASK><NEW_LINE>} | ), vmInstanceIDs, accept, context); |
377,119 | public com.amazonaws.services.memorydb.model.SubnetGroupInUseException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.memorydb.model.SubnetGroupInUseException subnetGroupInUseException = new com.amazonaws.services.memorydb.model.SubnetGroupInUseException(null);<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return subnetGroupInUseException;<NEW_LINE>} | String currentParentElement = context.getCurrentParentElement(); |
1,235,765 | private Handler<Promise<Object>> createBlockingHandler(RoutingContext context) {<NEW_LINE>return promise -> {<NEW_LINE>KeycloakSessionFactory sessionFactory = getSessionFactory();<NEW_LINE>KeycloakSession session = sessionFactory.create();<NEW_LINE>configureContextualData(context, createClientConnection(context<MASK><NEW_LINE>configureEndHandler(context, session);<NEW_LINE>KeycloakTransactionManager tx = session.getTransactionManager();<NEW_LINE>try {<NEW_LINE>tx.begin();<NEW_LINE>context.next();<NEW_LINE>promise.tryComplete();<NEW_LINE>} catch (Throwable cause) {<NEW_LINE>promise.fail(cause);<NEW_LINE>// re-throw so that the any exception is handled from parent<NEW_LINE>throw new RuntimeException(cause);<NEW_LINE>} finally {<NEW_LINE>if (!context.response().headWritten()) {<NEW_LINE>// make sure the session is closed in case the handler is not called<NEW_LINE>// it might happen that, for whatever reason, downstream handlers do not end the response or<NEW_LINE>// no data was written to the response<NEW_LINE>close(session);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>};<NEW_LINE>} | .request()), session); |
56,903 | public static void main(String[] args) {<NEW_LINE>if (args.length < 2) {<NEW_LINE>System.out.println("JRApiWriter usage:");<NEW_LINE><MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String reportCreatorClassName = args[0];<NEW_LINE>String destFileName = args[1];<NEW_LINE>try {<NEW_LINE>Class<?> reportCreatorClass = Class.forName(reportCreatorClassName);<NEW_LINE>ReportCreator reportCreator = (ReportCreator) reportCreatorClass.getDeclaredConstructor().newInstance();<NEW_LINE>JasperDesign jasperDesign = reportCreator.create();<NEW_LINE>new JRXmlWriter(DefaultJasperReportsContext.getInstance()).write(jasperDesign, destFileName, "UTF-8");<NEW_LINE>} catch (ClassNotFoundException | NoSuchMethodException | InvocationTargetException | IllegalAccessException | InstantiationException | JRException e) {<NEW_LINE>if (log.isErrorEnabled()) {<NEW_LINE>log.error("Error running report creator class : " + reportCreatorClassName, e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | System.out.println("\tjava JRApiWriter reportCreatorClassName file"); |
1,352,003 | private void handleNextExternal(long callId, JSONObject iterable) throws Exceptions.OsoException {<NEW_LINE>if (!calls.containsKey(callId)) {<NEW_LINE>Object result = host.toJava(iterable);<NEW_LINE>Enumeration<Object> enumResult;<NEW_LINE>if (result instanceof Enumeration<?>) {<NEW_LINE>enumResult = (Enumeration<Object>) result;<NEW_LINE>} else if (result instanceof Collection<?>) {<NEW_LINE>enumResult = java.util.Collections.enumeration(<MASK><NEW_LINE>} else if (result instanceof Iterable<?>) {<NEW_LINE>enumResult = IteratorUtils.asEnumeration(((Iterable<?>) result).iterator());<NEW_LINE>} else {<NEW_LINE>throw new Exceptions.InvalidIteratorError(String.format("value %s of type %s is not iterable", result, result.getClass()));<NEW_LINE>}<NEW_LINE>calls.put(callId, enumResult);<NEW_LINE>}<NEW_LINE>String result;<NEW_LINE>try {<NEW_LINE>result = nextCallResult(callId).toString();<NEW_LINE>} catch (NoSuchElementException e) {<NEW_LINE>result = "null";<NEW_LINE>}<NEW_LINE>ffiQuery.callResult(callId, result);<NEW_LINE>} | (Collection<Object>) result); |
366,221 | public Request<AddTagsRequest> marshall(AddTagsRequest addTagsRequest) {<NEW_LINE>if (addTagsRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>Request<AddTagsRequest> request = new DefaultRequest<AddTagsRequest>(addTagsRequest, "AmazonElasticLoadBalancing");<NEW_LINE>request.addParameter("Action", "AddTags");<NEW_LINE>request.addParameter("Version", "2012-06-01");<NEW_LINE>request.setHttpMethod(HttpMethodName.POST);<NEW_LINE>if (!addTagsRequest.getLoadBalancerNames().isEmpty() || !((com.amazonaws.internal.SdkInternalList<String>) addTagsRequest.getLoadBalancerNames()).isAutoConstruct()) {<NEW_LINE>com.amazonaws.internal.SdkInternalList<String> loadBalancerNamesList = (com.amazonaws.internal.SdkInternalList<String>) addTagsRequest.getLoadBalancerNames();<NEW_LINE>int loadBalancerNamesListIndex = 1;<NEW_LINE>for (String loadBalancerNamesListValue : loadBalancerNamesList) {<NEW_LINE>if (loadBalancerNamesListValue != null) {<NEW_LINE>request.addParameter("LoadBalancerNames.member." + loadBalancerNamesListIndex, StringUtils.fromString(loadBalancerNamesListValue));<NEW_LINE>}<NEW_LINE>loadBalancerNamesListIndex++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!addTagsRequest.getTags().isEmpty() || !((com.amazonaws.internal.SdkInternalList<Tag>) addTagsRequest.getTags()).isAutoConstruct()) {<NEW_LINE>com.amazonaws.internal.SdkInternalList<Tag> tagsList = (com.amazonaws.internal.SdkInternalList<Tag>) addTagsRequest.getTags();<NEW_LINE>int tagsListIndex = 1;<NEW_LINE>for (Tag tagsListValue : tagsList) {<NEW_LINE>if (tagsListValue != null) {<NEW_LINE>if (tagsListValue.getKey() != null) {<NEW_LINE>request.addParameter("Tags.member." + tagsListIndex + ".Key", StringUtils.fromString(tagsListValue.getKey()));<NEW_LINE>}<NEW_LINE>if (tagsListValue.getValue() != null) {<NEW_LINE>request.addParameter("Tags.member." + tagsListIndex + ".Value", StringUtils.fromString<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>tagsListIndex++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>} | (tagsListValue.getValue())); |
1,613,191 | private void populateV09AgentRollupTable() throws Exception {<NEW_LINE>Map<String, V09AgentRollup> v09AgentRollups = getV09AgentRollupsFromAgentRollupTable();<NEW_LINE>PreparedStatement insertPS = null;<NEW_LINE>for (V09AgentRollup v09AgentRollup : v09AgentRollups.values()) {<NEW_LINE>if (v09AgentRollup.agent() && v09AgentRollup.hasRollup()) {<NEW_LINE>// only create v09_agent_check and v09_last_capture_time tables if needed<NEW_LINE>if (insertPS == null) {<NEW_LINE>dropTableIfExists("v09_agent_rollup");<NEW_LINE>session.createTableWithLCS("create table if not exists v09_agent_rollup (one" + " int, v09_agent_id varchar, v09_agent_rollup_id varchar, primary key" + " (one, v09_agent_id, v09_agent_rollup_id))");<NEW_LINE>insertPS = session.prepare("insert into v09_agent_rollup" + " (one, v09_agent_id, v09_agent_rollup_id) values (1, ?, ?)");<NEW_LINE>}<NEW_LINE>BoundStatement boundStatement = insertPS.bind();<NEW_LINE>boundStatement.setString(<MASK><NEW_LINE>int i = 0;<NEW_LINE>boundStatement.setString(i++, v09AgentRollup.v09AgentRollupId());<NEW_LINE>boundStatement.setString(i++, checkNotNull(v09AgentRollup.v09ParentAgentRollupId()));<NEW_LINE>session.write(boundStatement);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | 0, v09AgentRollup.agentRollupId()); |
1,018,497 | public int read() throws IOException {<NEW_LINE>while (true) {<NEW_LINE>final int ch = input.read();<NEW_LINE>if (ch == -1) {<NEW_LINE>// reached end of the input<NEW_LINE>int ret = prevChar;<NEW_LINE>prevChar = ch;<NEW_LINE>return ret;<NEW_LINE>}<NEW_LINE>inputOff++;<NEW_LINE>int ret = -1;<NEW_LINE>// if the current char is a voice mark, then try to combine it with the previous char.<NEW_LINE>if (ch == HW_KATAKANA_SEMI_VOICED_MARK || ch == HW_KATAKANA_VOICED_MARK) {<NEW_LINE>final int combinedChar = combineVoiceMark(prevChar, ch);<NEW_LINE>if (prevChar != combinedChar) {<NEW_LINE>// successfully combined. returns the combined char immediately<NEW_LINE>prevChar = -1;<NEW_LINE>// offset needs to be corrected<NEW_LINE>final int prevCumulativeDiff = getLastCumulativeDiff();<NEW_LINE>addOffCorrectMap(inputOff - 1 - prevCumulativeDiff, prevCumulativeDiff + 1);<NEW_LINE>return combinedChar;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (prevChar != -1) {<NEW_LINE>ret = prevChar;<NEW_LINE>}<NEW_LINE>if (ch >= 0xFF01 && ch <= 0xFF5E) {<NEW_LINE>// Fullwidth ASCII variants<NEW_LINE>prevChar = ch - 0xFEE0;<NEW_LINE>} else if (ch >= 0xFF65 && ch <= 0xFF9F) {<NEW_LINE>// Halfwidth Katakana variants<NEW_LINE><MASK><NEW_LINE>} else {<NEW_LINE>// no need to normalize<NEW_LINE>prevChar = ch;<NEW_LINE>}<NEW_LINE>if (ret != -1) {<NEW_LINE>return ret;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | prevChar = KANA_NORM[ch - 0xFF65]; |
1,722,948 | public Object apply(final ActionContext ctx, final Object caller, final Object[] sources) throws FrameworkException {<NEW_LINE>try {<NEW_LINE>assertArrayHasLengthAndAllElementsNotNull(sources, 1);<NEW_LINE>if (sources[0] instanceof Iterable) {<NEW_LINE>final List<String> cleanList = new LinkedList<>();<NEW_LINE>for (final Object obj : (Iterable) sources[0]) {<NEW_LINE>if (StringUtils.isBlank(obj.toString())) {<NEW_LINE>cleanList.add("");<NEW_LINE>} else {<NEW_LINE>cleanList.add(obj.toString().trim());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return cleanList;<NEW_LINE>}<NEW_LINE>if (StringUtils.isBlank(sources[0].toString())) {<NEW_LINE>return "";<NEW_LINE>}<NEW_LINE>return sources[0]<MASK><NEW_LINE>} catch (ArgumentNullException pe) {<NEW_LINE>// silently ignore null arguments<NEW_LINE>return null;<NEW_LINE>} catch (ArgumentCountException pe) {<NEW_LINE>logParameterError(caller, sources, pe.getMessage(), ctx.isJavaScriptContext());<NEW_LINE>return usage(ctx.isJavaScriptContext());<NEW_LINE>}<NEW_LINE>} | .toString().trim(); |
1,168,119 | public int seek(int ts) {<NEW_LINE><MASK><NEW_LINE>if (keyFrameMeta == null) {<NEW_LINE>if (!(reader instanceof IKeyFrameDataAnalyzer)) {<NEW_LINE>// Seeking not supported<NEW_LINE>return ts;<NEW_LINE>}<NEW_LINE>keyFrameMeta = ((IKeyFrameDataAnalyzer) reader).analyzeKeyFrames();<NEW_LINE>}<NEW_LINE>if (keyFrameMeta.positions.length == 0) {<NEW_LINE>// no video keyframe metainfo, it's an audio-only FLV we skip the seek for now.<NEW_LINE>// TODO add audio-seek capability<NEW_LINE>return ts;<NEW_LINE>}<NEW_LINE>int frame = 0;<NEW_LINE>for (int i = 0; i < keyFrameMeta.positions.length; i++) {<NEW_LINE>if (keyFrameMeta.timestamps[i] > ts) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>frame = i;<NEW_LINE>}<NEW_LINE>reader.position(keyFrameMeta.positions[frame]);<NEW_LINE>return keyFrameMeta.timestamps[frame];<NEW_LINE>} | log.trace("Seek ts: {}", ts); |
249,785 | private void detectCycle() {<NEW_LINE>List<AbsolutePackPath> cycle = new ArrayList<>();<NEW_LINE>Set<AbsolutePackPath> <MASK><NEW_LINE>for (AbsolutePackPath start : nodes.keySet()) {<NEW_LINE>if (exploreForCycles(start, cycle, visited)) {<NEW_LINE>AbsolutePackPath lastFilePath = null;<NEW_LINE>StringBuilder error = new StringBuilder();<NEW_LINE>for (AbsolutePackPath node : cycle) {<NEW_LINE>if (lastFilePath == null) {<NEW_LINE>lastFilePath = node;<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>FileNode lastFile = nodes.get(lastFilePath);<NEW_LINE>int lineNumber = -1;<NEW_LINE>for (Map.Entry<Integer, AbsolutePackPath> include : lastFile.getIncludes().entrySet()) {<NEW_LINE>if (include.getValue() == node) {<NEW_LINE>lineNumber = include.getKey() + 1;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>String badLine = lastFile.getLines().get(lineNumber - 1);<NEW_LINE>String detailMessage = node.equals(start) ? "final #include in cycle" : "#include involved in cycle";<NEW_LINE>if (lastFilePath.equals(start)) {<NEW_LINE>// first node in cycle<NEW_LINE>error.append(new RusticError("error", "#include cycle detected", detailMessage, lastFilePath.getPathString(), lineNumber, badLine));<NEW_LINE>} else {<NEW_LINE>error.append("\n = " + new RusticError("note", "cycle involves another file", detailMessage, lastFilePath.getPathString(), lineNumber, badLine));<NEW_LINE>}<NEW_LINE>lastFilePath = node;<NEW_LINE>}<NEW_LINE>error.append("\n = note: #include directives are resolved before any other preprocessor directives, any form of #include guard will not work" + "\n = note: other cycles may still exist, only the first detected non-trivial cycle will be reported");<NEW_LINE>// TODO: Expose this to the caller (more semantic error handling)<NEW_LINE>Iris.logger.error(error.toString());<NEW_LINE>throw new IllegalStateException("Cycle detected in #include graph, see previous messages for details");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | visited = new HashSet<>(); |
712,179 | public NameEnvironmentAnswer findClass(String binaryFileName, String qualifiedPackageName, String moduleName, String qualifiedBinaryFileName, boolean asBinaryOnly, Predicate<String> moduleNameFilter) {<NEW_LINE>// most common case<NEW_LINE>if (!isPackage(qualifiedPackageName, moduleName))<NEW_LINE>return null;<NEW_LINE>try {<NEW_LINE>IBinaryType reader = null;<NEW_LINE>byte[] content = null;<NEW_LINE>String fileNameWithoutExtension = qualifiedBinaryFileName.substring(0, qualifiedBinaryFileName.length() - SuffixConstants.SUFFIX_CLASS.length);<NEW_LINE>if (this.subReleases != null && this.subReleases.length > 0) {<NEW_LINE>// $NON-NLS-1$ //$NON-NLS-2$<NEW_LINE>qualifiedBinaryFileName = qualifiedBinaryFileName.replace(".class", ".sig");<NEW_LINE>for (String rel : this.subReleases) {<NEW_LINE>Path p = this.fs.getPath(rel, qualifiedBinaryFileName);<NEW_LINE>if (Files.exists(p)) {<NEW_LINE>content = JRTUtil.safeReadBytes(p);<NEW_LINE>if (content != null) {<NEW_LINE>reader = new ClassFileReader(<MASK><NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>reader = ClassFileReader.readFromModule(new File(this.zipFilename), moduleName, qualifiedBinaryFileName, moduleNameFilter);<NEW_LINE>}<NEW_LINE>if (reader != null) {<NEW_LINE>if (this.externalAnnotationPath != null) {<NEW_LINE>try {<NEW_LINE>if (this.annotationZipFile == null) {<NEW_LINE>this.annotationZipFile = ExternalAnnotationDecorator.getAnnotationZipFile(this.externalAnnotationPath, null);<NEW_LINE>}<NEW_LINE>reader = ExternalAnnotationDecorator.create(reader, this.externalAnnotationPath, fileNameWithoutExtension, this.annotationZipFile);<NEW_LINE>} catch (IOException e) {<NEW_LINE>// don't let error on annotations fail class reading<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (this.accessRuleSet == null)<NEW_LINE>return new NameEnvironmentAnswer(reader, null, reader.getModule());<NEW_LINE>return new NameEnvironmentAnswer(reader, this.accessRuleSet.getViolatedRestriction(fileNameWithoutExtension.toCharArray()), reader.getModule());<NEW_LINE>}<NEW_LINE>} catch (ClassFormatException e) {<NEW_LINE>// treat as if class file is missing<NEW_LINE>} catch (IOException e) {<NEW_LINE>// treat as if class file is missing<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | content, qualifiedBinaryFileName.toCharArray()); |
1,297,215 | public static void renderBehaviorizedEventHandlers(FacesContext facesContext, ResponseWriter writer, UIComponent uiComponent, String targetClientId, Map<String, List<ClientBehavior>> clientBehaviors) throws IOException {<NEW_LINE>renderBehaviorizedAttribute(facesContext, writer, HTML.ONCLICK_ATTR, uiComponent, targetClientId, ClientBehaviorEvents.CLICK, clientBehaviors, HTML.ONCLICK_ATTR);<NEW_LINE>renderBehaviorizedAttribute(facesContext, writer, HTML.ONDBLCLICK_ATTR, uiComponent, targetClientId, ClientBehaviorEvents.DBLCLICK, clientBehaviors, HTML.ONDBLCLICK_ATTR);<NEW_LINE>renderBehaviorizedAttribute(facesContext, writer, HTML.ONMOUSEDOWN_ATTR, uiComponent, targetClientId, ClientBehaviorEvents.MOUSEDOWN, clientBehaviors, HTML.ONMOUSEDOWN_ATTR);<NEW_LINE>renderBehaviorizedAttribute(facesContext, writer, HTML.ONMOUSEUP_ATTR, uiComponent, targetClientId, ClientBehaviorEvents.MOUSEUP, clientBehaviors, HTML.ONMOUSEUP_ATTR);<NEW_LINE>renderBehaviorizedAttribute(facesContext, writer, HTML.ONMOUSEOVER_ATTR, uiComponent, targetClientId, ClientBehaviorEvents.MOUSEOVER, clientBehaviors, HTML.ONMOUSEOVER_ATTR);<NEW_LINE>renderBehaviorizedAttribute(facesContext, writer, HTML.ONMOUSEMOVE_ATTR, uiComponent, targetClientId, ClientBehaviorEvents.<MASK><NEW_LINE>renderBehaviorizedAttribute(facesContext, writer, HTML.ONMOUSEOUT_ATTR, uiComponent, targetClientId, ClientBehaviorEvents.MOUSEOUT, clientBehaviors, HTML.ONMOUSEOUT_ATTR);<NEW_LINE>renderBehaviorizedAttribute(facesContext, writer, HTML.ONKEYPRESS_ATTR, uiComponent, targetClientId, ClientBehaviorEvents.KEYPRESS, clientBehaviors, HTML.ONKEYPRESS_ATTR);<NEW_LINE>renderBehaviorizedAttribute(facesContext, writer, HTML.ONKEYDOWN_ATTR, uiComponent, targetClientId, ClientBehaviorEvents.KEYDOWN, clientBehaviors, HTML.ONKEYDOWN_ATTR);<NEW_LINE>renderBehaviorizedAttribute(facesContext, writer, HTML.ONKEYUP_ATTR, uiComponent, targetClientId, ClientBehaviorEvents.KEYUP, clientBehaviors, HTML.ONKEYUP_ATTR);<NEW_LINE>} | MOUSEMOVE, clientBehaviors, HTML.ONMOUSEMOVE_ATTR); |
1,239,948 | public void onConfidenceChanged(TransactionConfidence conf, ChangeReason reason) {<NEW_LINE>// The number of peers that announced this tx has gone up.<NEW_LINE>int numSeenPeers = conf.numBroadcastPeers() + rejects.size();<NEW_LINE>boolean mined <MASK><NEW_LINE>log.info("broadcastTransaction: {}: TX {} seen by {} peers{}", reason, tx.getTxId(), numSeenPeers, mined ? " and mined" : "");<NEW_LINE>// Progress callback on the requested thread.<NEW_LINE>invokeAndRecord(numSeenPeers, mined);<NEW_LINE>if (numSeenPeers >= numWaitingFor || mined) {<NEW_LINE>// We've seen the min required number of peers announce the transaction, or it was included<NEW_LINE>// in a block. Normally we'd expect to see it fully propagate before it gets mined, but<NEW_LINE>// it can be that a block is solved very soon after broadcast, and it's also possible that<NEW_LINE>// due to version skew and changes in the relay rules our transaction is not going to<NEW_LINE>// fully propagate yet can get mined anyway.<NEW_LINE>//<NEW_LINE>// Note that we can't wait for the current number of connected peers right now because we<NEW_LINE>// could have added more peers after the broadcast took place, which means they won't<NEW_LINE>// have seen the transaction. In future when peers sync up their memory pools after they<NEW_LINE>// connect we could come back and change this.<NEW_LINE>//<NEW_LINE>// We're done! It's important that the PeerGroup lock is not held (by this thread) at this<NEW_LINE>// point to avoid triggering inversions when the Future completes.<NEW_LINE>log.info("broadcastTransaction: {} complete", tx.getTxId());<NEW_LINE>peerGroup.removePreMessageReceivedEventListener(rejectionListener);<NEW_LINE>conf.removeEventListener(this);<NEW_LINE>// RE-ENTRANCY POINT<NEW_LINE>future.complete(tx);<NEW_LINE>}<NEW_LINE>} | = tx.getAppearsInHashes() != null; |
436,086 | private NumberFormat createCurrencyNumberFormat(final I_C_Invoice_Candidate ic) {<NEW_LINE>final IBPartnerDAO bpartnerDAO = Services.get(IBPartnerDAO.class);<NEW_LINE>final ICurrencyDAO currencyDAO = Services.get(ICurrencyDAO.class);<NEW_LINE>final I_C_BPartner_Location billBPLocation = bpartnerDAO.getBPartnerLocationByIdEvenInactive(BPartnerLocationId.ofRepoId(ic.getBill_BPartner_ID(), ic.getBill_Location_ID()));<NEW_LINE>Check.<MASK><NEW_LINE>// We use the language of the bill location to determine the number format.<NEW_LINE>// using the ic's context's language make no sense, because it basically amounts to the login language and can change a lot.<NEW_LINE>final String langInfo = billBPLocation.getC_Location().getC_Country().getAD_Language();<NEW_LINE>final Locale locale = Language.getLanguage(langInfo).getLocale();<NEW_LINE>final NumberFormat numberFormat = NumberFormat.getCurrencyInstance(locale);<NEW_LINE>final CurrencyId currencyId = CurrencyId.ofRepoIdOrNull(ic.getC_Currency_ID());<NEW_LINE>if (currencyId != null) {<NEW_LINE>final CurrencyCode currencyCode = currencyDAO.getCurrencyCodeById(currencyId);<NEW_LINE>numberFormat.setCurrency(Currency.getInstance(currencyCode.toThreeLetterCode()));<NEW_LINE>}<NEW_LINE>return numberFormat;<NEW_LINE>} | assumeNotNull(billBPLocation, "billBPLocation not null for {}", ic); |
785,304 | public okhttp3.Call applicationsApplicationIdKeysKeyTypePutCall(String applicationId, String keyType, ApplicationKeyDTO applicationKeyDTO, final ApiCallback _callback) throws ApiException {<NEW_LINE>Object localVarPostBody = applicationKeyDTO;<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/applications/{applicationId}/keys/{keyType}".replaceAll("\\{" + "applicationId" + "\\}", localVarApiClient.escapeString(applicationId.toString())).replaceAll("\\{" + "keyType" + "\\}", localVarApiClient.escapeString(keyType.toString()));<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>Map<String, String> localVarCookieParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>final String[] localVarAccepts = { "application/json" };<NEW_LINE>final String <MASK><NEW_LINE>if (localVarAccept != null) {<NEW_LINE>localVarHeaderParams.put("Accept", localVarAccept);<NEW_LINE>}<NEW_LINE>final String[] localVarContentTypes = { "application/json" };<NEW_LINE>final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>localVarHeaderParams.put("Content-Type", localVarContentType);<NEW_LINE>String[] localVarAuthNames = new String[] { "OAuth2Security" };<NEW_LINE>return localVarApiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);<NEW_LINE>} | localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); |
1,696,571 | public boolean apply(Game game, Ability source) {<NEW_LINE>boolean result = false;<NEW_LINE>Player controller = game.getPlayer(source.getControllerId());<NEW_LINE>if (controller != null) {<NEW_LINE>Card card = game.getCard(source.getSourceId());<NEW_LINE>if (card != null) {<NEW_LINE>ContinuousEffect effect = new EntersBattlefieldEffect(new AddCountersSourceEffect(CounterType.LUCK.createInstance()), "");<NEW_LINE><MASK><NEW_LINE>game.addEffect(effect, source);<NEW_LINE>if (controller.moveCards(card, Zone.BATTLEFIELD, source, game)) {<NEW_LINE>Permanent permanent = game.getPermanent(card.getId());<NEW_LINE>if (permanent != null) {<NEW_LINE>Cost cost = new ExileFromHandCost(new TargetCardInHand());<NEW_LINE>if (cost.canPay(source, source, source.getControllerId(), game)) {<NEW_LINE>result = cost.pay(source, game, source, source.getControllerId(), true, null);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | effect.setDuration(Duration.OneUse); |
715,571 | public void initScene() {<NEW_LINE>mLight = new DirectionalLight();<NEW_LINE>mLight.setLookAt(1, -1, 1);<NEW_LINE>mLight.enableLookAt();<NEW_LINE>mLight.setPower(1.5f);<NEW_LINE>getCurrentScene().addLight(mLight);<NEW_LINE>getCurrentCamera().setFarPlane(50);<NEW_LINE>getCurrentCamera().setPosition(5, 15, 30);<NEW_LINE>getCurrentCamera().setLookAt(0, 0, 0);<NEW_LINE>getCurrentCamera().enableLookAt();<NEW_LINE>Material planeMaterial = new Material();<NEW_LINE>planeMaterial.enableLighting(true);<NEW_LINE>planeMaterial.setDiffuseMethod(new DiffuseMethod.Lambert());<NEW_LINE>Plane plane = new Plane(Vector3.Axis.Y);<NEW_LINE>plane.setScale(10);<NEW_LINE>plane.setMaterial(planeMaterial);<NEW_LINE>plane.setColor(Color.GREEN);<NEW_LINE>getCurrentScene().addChild(plane);<NEW_LINE>Material sphereMaterial = new Material();<NEW_LINE>sphereMaterial.enableLighting(true);<NEW_LINE>sphereMaterial.setDiffuseMethod(new DiffuseMethod.Lambert());<NEW_LINE>for (int z = 0; z < 10; z++) {<NEW_LINE>for (int x = 0; x < 10; x++) {<NEW_LINE>Cube cube = new Cube(.7f);<NEW_LINE>cube.setMaterial(sphereMaterial);<NEW_LINE>cube.setColor(Color.rgb(100 + 10 * x, 0, 0));<NEW_LINE>cube.setPosition(-4.5f + x, 5, -4.5f + z);<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>Material cubeMaterial = new Material();<NEW_LINE>cubeMaterial.enableLighting(true);<NEW_LINE>cubeMaterial.setDiffuseMethod(new DiffuseMethod.Lambert());<NEW_LINE>Cube cube = new Cube(2);<NEW_LINE>cube.setMaterial(cubeMaterial);<NEW_LINE>cube.setColor(Color.GRAY);<NEW_LINE>cube.setY(1.5f);<NEW_LINE>getCurrentScene().addChild(cube);<NEW_LINE>mPostProcessingManager = new PostProcessingManager(this);<NEW_LINE>ShadowEffect shadowEffect = new ShadowEffect(getCurrentScene(), getCurrentCamera(), mLight, 2048);<NEW_LINE>shadowEffect.setShadowInfluence(.5f);<NEW_LINE>mPostProcessingManager.addEffect(shadowEffect);<NEW_LINE>shadowEffect.setRenderToScreen(true);<NEW_LINE>} | getCurrentScene().addChild(cube); |
320,613 | public void registerFix(@Nullable IntentionAction action, @Nullable List<IntentionAction> options, @Nullable String displayName, @Nullable TextRange fixRange, @Nullable HighlightDisplayKey key) {<NEW_LINE>if (action == null)<NEW_LINE>return;<NEW_LINE>if (fixRange == null)<NEW_LINE>fixRange = new TextRange(startOffset, endOffset);<NEW_LINE>if (quickFixActionRanges == null) {<NEW_LINE>quickFixActionRanges = ContainerUtil.createLockFreeCopyOnWriteList();<NEW_LINE>}<NEW_LINE>IntentionActionDescriptor desc = new IntentionActionDescriptor(action, options, displayName, null, key, getProblemGroup(), getSeverity());<NEW_LINE>quickFixActionRanges.add(Pair<MASK><NEW_LINE>fixStartOffset = Math.min(fixStartOffset, fixRange.getStartOffset());<NEW_LINE>fixEndOffset = Math.max(fixEndOffset, fixRange.getEndOffset());<NEW_LINE>if (action instanceof HintAction) {<NEW_LINE>setHint(true);<NEW_LINE>}<NEW_LINE>} | .create(desc, fixRange)); |
881,741 | protected // /////////////////////////////////////////////////////////////////////////////////////////<NEW_LINE>void buildForm() {<NEW_LINE>addTitledGroupBg(root, gridRow, 2, Res.get("shared.manageAccounts"));<NEW_LINE>Tuple3<Label, ListView<PaymentAccount>, VBox> tuple = addTopLabelListView(root, gridRow, Res.get<MASK><NEW_LINE>paymentAccountsListView = tuple.second;<NEW_LINE>int prefNumRows = Math.min(4, Math.max(2, model.dataModel.getNumPaymentAccounts()));<NEW_LINE>paymentAccountsListView.setMinHeight(prefNumRows * Layout.LIST_ROW_HEIGHT + 28);<NEW_LINE>setPaymentAccountsCellFactory();<NEW_LINE>Tuple3<Button, Button, Button> tuple3 = add3ButtonsAfterGroup(root, ++gridRow, Res.get("shared.addNewAccount"), Res.get("shared.ExportAccounts"), Res.get("shared.importAccounts"));<NEW_LINE>addAccountButton = tuple3.first;<NEW_LINE>exportButton = tuple3.second;<NEW_LINE>importButton = tuple3.third;<NEW_LINE>} | ("account.altcoin.yourAltcoinAccounts"), Layout.FIRST_ROW_DISTANCE); |
1,303,887 | public int compareTo(bulkImport_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(isSetTid(), other.isSetTid());<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>if (isSetTid()) {<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(isSetFiles(), other.isSetFiles());<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>if (isSetFiles()) {<NEW_LINE>lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.files, other.files);<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>lastComparison = java.lang.Boolean.compare(isSetSetTime(), other.isSetSetTime());<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>if (isSetSetTime()) {<NEW_LINE>lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.setTime, other.setTime);<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return 0;<NEW_LINE>} | this.tid, other.tid); |
462,669 | public IotEventsAction unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>IotEventsAction iotEventsAction = new IotEventsAction();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE><MASK><NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("inputName", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>iotEventsAction.setInputName(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("messageId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>iotEventsAction.setMessageId(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("batchMode", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>iotEventsAction.setBatchMode(context.getUnmarshaller(Boolean.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("roleArn", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>iotEventsAction.setRoleArn(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return iotEventsAction;<NEW_LINE>} | JsonToken token = context.getCurrentToken(); |
741,409 | private JsonResponseReceiveFromManufacturingOrder processReceipt(final JsonRequestReceiveFromManufacturingOrder receipt) {<NEW_LINE><MASK><NEW_LINE>final LocatorId locatorId = getReceiveToLocatorByOrderId(orderId);<NEW_LINE>final ProductId productId = getFinishedGoodProductId(orderId);<NEW_LINE>final I_C_UOM stockingUOM = productBL.getStockUOM(productId);<NEW_LINE>final Quantity qtyToReceive = Quantity.of(receipt.getQtyToReceiveInStockUOM(), stockingUOM);<NEW_LINE>final IPPOrderReceiptHUProducer receiptProducer = huPPOrderBL.receivingMainProduct(orderId).movementDate(receipt.getDate()).locatorId(locatorId).lotNumber(receipt.getLotNumber()).bestBeforeDate(receipt.getBestBeforeDate());<NEW_LINE>final I_M_HU vhu = receiptProducer.receiveVHU(qtyToReceive);<NEW_LINE>final Set<PPCostCollectorId> costCollectorIds = receiptProducer.getCreatedCostCollectorIds();<NEW_LINE>final OrderLineId salesOrderLineId = getSalesOrderLineIdByOrderId(orderId).orElse(null);<NEW_LINE>if (salesOrderLineId != null) {<NEW_LINE>huReservationService.makeReservation(ReserveHUsRequest.builder().qtyToReserve(qtyToReceive).documentRef(HUReservationDocRef.ofSalesOrderLineId(salesOrderLineId)).productId(productId).huId(HuId.ofRepoId(vhu.getM_HU_ID())).build());<NEW_LINE>}<NEW_LINE>return JsonResponseReceiveFromManufacturingOrder.builder().requestId(receipt.getRequestId()).costCollectorIds(costCollectorIds.stream().map(costCollectorId -> toJsonMetasfreshId(costCollectorId)).collect(ImmutableSet.toImmutableSet())).build();<NEW_LINE>} | final PPOrderId orderId = extractPPOrderId(receipt); |
1,589,564 | final UpdateDetectorResult executeUpdateDetector(UpdateDetectorRequest updateDetectorRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateDetectorRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateDetectorRequest> request = null;<NEW_LINE>Response<UpdateDetectorResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateDetectorRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateDetectorRequest));<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, "UpdateDetector");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateDetectorResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateDetectorResultJsonUnmarshaller());<NEW_LINE>response = <MASK><NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | invoke(request, responseHandler, executionContext); |
592,125 | public static void nfsV3AccountCreate(com.azure.resourcemanager.AzureResourceManager azure) {<NEW_LINE>azure.storageAccounts().manager().serviceClient().getStorageAccounts().create("res9101", "sto4445", new StorageAccountCreateParameters().withSku(new Sku().withName(SkuName.PREMIUM_LRS)).withKind(Kind.BLOCK_BLOB_STORAGE).withLocation("eastus").withNetworkRuleSet(new NetworkRuleSet().withBypass(Bypass.AZURE_SERVICES).withVirtualNetworkRules(Arrays.asList(new VirtualNetworkRule().withVirtualNetworkResourceId("/subscriptions/{subscription-id}/resourceGroups/res9101/providers/Microsoft.Network/virtualNetworks/net123/subnets/subnet12"))).withIpRules(Arrays.asList()).withDefaultAction(DefaultAction.ALLOW)).withEnableHttpsTrafficOnly(false).withIsHnsEnabled(true).withEnableNfsV3<MASK><NEW_LINE>} | (true), Context.NONE); |
516,928 | static Request toOkHttpRequest(feign.Request input) {<NEW_LINE>Request.Builder requestBuilder = new Request.Builder();<NEW_LINE>requestBuilder.url(input.url());<NEW_LINE>MediaType mediaType = null;<NEW_LINE>boolean hasAcceptHeader = false;<NEW_LINE>for (String field : input.headers().keySet()) {<NEW_LINE>if (field.equalsIgnoreCase("Accept")) {<NEW_LINE>hasAcceptHeader = true;<NEW_LINE>}<NEW_LINE>for (String value : input.headers().get(field)) {<NEW_LINE>requestBuilder.addHeader(field, value);<NEW_LINE>if (field.equalsIgnoreCase("Content-Type")) {<NEW_LINE>mediaType = MediaType.parse(value);<NEW_LINE>if (input.charset() != null) {<NEW_LINE>mediaType.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Some servers choke on the default accept string.<NEW_LINE>if (!hasAcceptHeader) {<NEW_LINE>requestBuilder.addHeader("Accept", "*/*");<NEW_LINE>}<NEW_LINE>byte[] inputBody = input.body();<NEW_LINE>boolean isMethodWithBody = HttpMethod.POST == input.httpMethod() || HttpMethod.PUT == input.httpMethod() || HttpMethod.PATCH == input.httpMethod();<NEW_LINE>if (isMethodWithBody) {<NEW_LINE>requestBuilder.removeHeader("Content-Type");<NEW_LINE>if (inputBody == null) {<NEW_LINE>// write an empty BODY to conform with okhttp 2.4.0+<NEW_LINE>// http://johnfeng.github.io/blog/2015/06/30/okhttp-updates-post-wouldnt-be-allowed-to-have-null-body/<NEW_LINE>inputBody = new byte[0];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>RequestBody body = inputBody != null ? RequestBody.create(mediaType, inputBody) : null;<NEW_LINE>requestBuilder.method(input.httpMethod().name(), body);<NEW_LINE>return requestBuilder.build();<NEW_LINE>} | charset(input.charset()); |
1,427,748 | private void loadMap() throws ConfigurationException {<NEW_LINE>File mapFile = new File(_segmentDirectory, V1Constants.INDEX_MAP_FILE_NAME);<NEW_LINE>PropertiesConfiguration mapConfig = CommonsConfigurationUtils.fromFile(mapFile);<NEW_LINE>for (String key : CommonsConfigurationUtils.getKeys(mapConfig)) {<NEW_LINE>// column names can have '.' in it hence scan from backwards<NEW_LINE>// parsing names like "column.name.dictionary.startOffset"<NEW_LINE>// or, "column.name.dictionary.endOffset" where column.name is the key<NEW_LINE>int lastSeparatorPos = key.lastIndexOf(MAP_KEY_SEPARATOR);<NEW_LINE>Preconditions.checkState(lastSeparatorPos != -1, "Key separator not found: " + key + ", segment: " + _segmentDirectory);<NEW_LINE>String propertyName = key.substring(lastSeparatorPos + 1);<NEW_LINE>int indexSeparatorPos = key.lastIndexOf(MAP_KEY_SEPARATOR, lastSeparatorPos - 1);<NEW_LINE>Preconditions.checkState(indexSeparatorPos != -1, <MASK><NEW_LINE>String indexName = key.substring(indexSeparatorPos + 1, lastSeparatorPos);<NEW_LINE>String columnName = key.substring(0, indexSeparatorPos);<NEW_LINE>IndexKey indexKey = new IndexKey(columnName, ColumnIndexType.getValue(indexName));<NEW_LINE>IndexEntry entry = _columnEntries.get(indexKey);<NEW_LINE>if (entry == null) {<NEW_LINE>entry = new IndexEntry(indexKey);<NEW_LINE>_columnEntries.put(indexKey, entry);<NEW_LINE>}<NEW_LINE>if (propertyName.equals(MAP_KEY_NAME_START_OFFSET)) {<NEW_LINE>entry._startOffset = mapConfig.getLong(key);<NEW_LINE>} else if (propertyName.equals(MAP_KEY_NAME_SIZE)) {<NEW_LINE>entry._size = mapConfig.getLong(key);<NEW_LINE>} else {<NEW_LINE>throw new ConfigurationException("Invalid map file key: " + key + ", segmentDirectory: " + _segmentDirectory.toString());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// validation<NEW_LINE>for (Map.Entry<IndexKey, IndexEntry> colIndexEntry : _columnEntries.entrySet()) {<NEW_LINE>IndexEntry entry = colIndexEntry.getValue();<NEW_LINE>if (entry._size < 0 || entry._startOffset < 0) {<NEW_LINE>throw new ConfigurationException("Invalid map entry for key: " + colIndexEntry.getKey().toString() + ", segment: " + _segmentDirectory.toString());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | "Index separator not found: " + key + " , segment: " + _segmentDirectory); |
1,848,669 | private Response makeExecutionLogResponse(Request request, Date resultDate, TestResultRecord testResultRecord) throws Exception {<NEW_LINE>String content = FileUtil.getFileContent(testResultRecord.getFile());<NEW_LINE>ExecutionReport <MASK><NEW_LINE>HtmlPage page = context.pageFactory.newPage();<NEW_LINE>String tags = "";<NEW_LINE>if (report instanceof TestExecutionReport && !((TestExecutionReport) report).getResults().isEmpty()) {<NEW_LINE>tags = ((TestExecutionReport) report).getResults().get(0).getTags();<NEW_LINE>}<NEW_LINE>PageTitle pageTitle = new PageTitle("Execution Log", PathParser.parse(request.getResource()), tags);<NEW_LINE>page.setPageTitle(pageTitle);<NEW_LINE>page.setTitle("Execution Log");<NEW_LINE>page.setNavTemplate("viewNav");<NEW_LINE>page.put("currentDate", resultDate);<NEW_LINE>page.put("resultDate", dateFormat.format(resultDate));<NEW_LINE>page.put("version", report.getVersion());<NEW_LINE>page.put("viewLocation", request.getResource());<NEW_LINE>page.put("runTime", report.getTotalRunTimeInMillis() / 1000);<NEW_LINE>page.put("logs", report.getExecutionLogs());<NEW_LINE>page.setMainTemplate("executionLog");<NEW_LINE>SimpleResponse response = new SimpleResponse();<NEW_LINE>response.setContent(page.html(request));<NEW_LINE>return response;<NEW_LINE>} | report = ExecutionReport.makeReport(content); |
877,083 | private ExternalDataObject constructExternalDataObjectFromSherpaJournal(SHERPAJournal sherpaJournal) {<NEW_LINE>// Set up external object<NEW_LINE>ExternalDataObject externalDataObject = new ExternalDataObject();<NEW_LINE>externalDataObject.setSource(sourceIdentifier);<NEW_LINE>// Set journal title in external object<NEW_LINE>if (CollectionUtils.isNotEmpty(sherpaJournal.getTitles())) {<NEW_LINE>String journalTitle = sherpaJournal.<MASK><NEW_LINE>externalDataObject.setId(sherpaJournal.getTitles().get(0));<NEW_LINE>externalDataObject.addMetadata(new MetadataValueDTO("dc", "title", null, null, journalTitle));<NEW_LINE>externalDataObject.setValue(journalTitle);<NEW_LINE>externalDataObject.setDisplayValue(journalTitle);<NEW_LINE>}<NEW_LINE>// Set ISSNs in external object<NEW_LINE>if (CollectionUtils.isNotEmpty(sherpaJournal.getIssns())) {<NEW_LINE>String issn = sherpaJournal.getIssns().get(0);<NEW_LINE>externalDataObject.addMetadata(new MetadataValueDTO("dc", "identifier", "issn", null, issn));<NEW_LINE>}<NEW_LINE>return externalDataObject;<NEW_LINE>} | getTitles().get(0); |
1,402,658 | public void updateDescription(@NonNull LocalIndexInfo info) {<NEW_LINE>File f = new File(info.getPathToData());<NEW_LINE>if (info.getType() == LocalIndexType.MAP_DATA) {<NEW_LINE>Map<String, String> ifns = app.getResourceManager().getIndexFileNames();<NEW_LINE>if (ifns.containsKey(info.getFileName())) {<NEW_LINE>try {<NEW_LINE>Date dt = app.getResourceManager().getDateFormat().parse(ifns.get(info.getFileName()));<NEW_LINE>info.setDescription(getInstalledDate(dt.getTime(), null));<NEW_LINE>} catch (ParseException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>info.setDescription(getInstalledDate(f));<NEW_LINE>}<NEW_LINE>} else if (info.getType() == LocalIndexType.TILES_DATA) {<NEW_LINE>ITileSource template;<NEW_LINE>if (f.isDirectory() && TileSourceManager.isTileSourceMetaInfoExist(f)) {<NEW_LINE>template = TileSourceManager.createTileSourceTemplate(new File(info.getPathToData()));<NEW_LINE>} else if (f.isFile() && f.getName().endsWith(SQLiteTileSource.EXT)) {<NEW_LINE>template = new SQLiteTileSource(app, f, TileSourceManager.getKnownSourceTemplates());<NEW_LINE>} else {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String descr = "";<NEW_LINE>if (template.getExpirationTimeMinutes() >= 0) {<NEW_LINE>descr += app.getString(R.string.local_index_tile_data_expire, String.valueOf(template.getExpirationTimeMinutes()));<NEW_LINE>}<NEW_LINE>info.setAttachedObject(template);<NEW_LINE>info.setDescription(descr);<NEW_LINE>} else if (info.getType() == LocalIndexType.SRTM_DATA) {<NEW_LINE>info.setDescription(app.getString<MASK><NEW_LINE>} else if (info.getType() == LocalIndexType.WIKI_DATA) {<NEW_LINE>info.setDescription(getInstalledDate(f));<NEW_LINE>} else if (info.getType() == LocalIndexType.TRAVEL_DATA) {<NEW_LINE>info.setDescription(getInstalledDate(f));<NEW_LINE>} else if (info.getType() == LocalIndexType.TTS_VOICE_DATA) {<NEW_LINE>info.setDescription(getInstalledDate(f));<NEW_LINE>} else if (info.getType() == LocalIndexType.DEACTIVATED) {<NEW_LINE>info.setDescription(getInstalledDate(f));<NEW_LINE>} else if (info.getType() == LocalIndexType.VOICE_DATA) {<NEW_LINE>info.setDescription(getInstalledDate(f));<NEW_LINE>} else if (info.getType() == LocalIndexType.FONT_DATA) {<NEW_LINE>info.setDescription(getInstalledDate(f));<NEW_LINE>}<NEW_LINE>} | (R.string.download_srtm_maps)); |
717,504 | TimelineXYItem[] createItems(ProbeItemDescriptor[] itemDescriptors) {<NEW_LINE>int itemsCount = values == null ? 0 : values.length;<NEW_LINE>int addedItemsCount = itemDescriptors.length;<NEW_LINE>TimelineXYItem[<MASK><NEW_LINE>for (int i = 0; i < addedItemsCount; i++) {<NEW_LINE>if (itemDescriptors[i] instanceof ValueItemDescriptor) {<NEW_LINE>ValueItemDescriptor d = (ValueItemDescriptor) itemDescriptors[i];<NEW_LINE>itemsArr[i] = new TimelineXYItem(d.getName(), d.getMinValue(), d.getMaxValue(), itemsCount + i) {<NEW_LINE><NEW_LINE>public long getYValue(int valueIndex) {<NEW_LINE>return values[getIndex()][valueIndex];<NEW_LINE>}<NEW_LINE>};<NEW_LINE>} else {<NEW_LINE>// Reserved for non-value items<NEW_LINE>}<NEW_LINE>items.add(itemsArr[i]);<NEW_LINE>}<NEW_LINE>addItemsImpl(addedItemsCount);<NEW_LINE>return itemsArr;<NEW_LINE>} | ] itemsArr = new TimelineXYItem[addedItemsCount]; |
1,259,930 | final DeleteBotLocaleResult executeDeleteBotLocale(DeleteBotLocaleRequest deleteBotLocaleRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteBotLocaleRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteBotLocaleRequest> request = null;<NEW_LINE>Response<DeleteBotLocaleResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteBotLocaleRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteBotLocaleRequest));<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, "Lex Models V2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteBotLocale");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteBotLocaleResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteBotLocaleResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} | endClientExecution(awsRequestMetrics, request, response); |
1,001,208 | public void marshall(CreateQualificationTypeRequest createQualificationTypeRequest, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (createQualificationTypeRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(createQualificationTypeRequest.getName(), NAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(createQualificationTypeRequest.getKeywords(), KEYWORDS_BINDING);<NEW_LINE>protocolMarshaller.marshall(createQualificationTypeRequest.getDescription(), DESCRIPTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(createQualificationTypeRequest.getQualificationTypeStatus(), QUALIFICATIONTYPESTATUS_BINDING);<NEW_LINE>protocolMarshaller.marshall(createQualificationTypeRequest.getRetryDelayInSeconds(), RETRYDELAYINSECONDS_BINDING);<NEW_LINE>protocolMarshaller.marshall(createQualificationTypeRequest.getTest(), TEST_BINDING);<NEW_LINE>protocolMarshaller.marshall(createQualificationTypeRequest.getAnswerKey(), ANSWERKEY_BINDING);<NEW_LINE>protocolMarshaller.marshall(createQualificationTypeRequest.getTestDurationInSeconds(), TESTDURATIONINSECONDS_BINDING);<NEW_LINE>protocolMarshaller.marshall(createQualificationTypeRequest.getAutoGranted(), AUTOGRANTED_BINDING);<NEW_LINE>protocolMarshaller.marshall(createQualificationTypeRequest.getAutoGrantedValue(), AUTOGRANTEDVALUE_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + <MASK><NEW_LINE>}<NEW_LINE>} | e.getMessage(), e); |
669,229 | public Optional<GroupConfigTable> readGroupConfig(final Set<String> keys) {<NEW_LINE>GroupConfigTable groupConfigTable = new GroupConfigTable();<NEW_LINE>keys.forEach(key -> {<NEW_LINE>GroupConfigTable.GroupConfigItems groupConfigItems <MASK><NEW_LINE>groupConfigTable.addGroupConfigItems(groupConfigItems);<NEW_LINE>String config = null;<NEW_LINE>try {<NEW_LINE>config = configService.getConfig(key, settings.getGroup(), 1000);<NEW_LINE>if (StringUtil.isNotEmpty(config)) {<NEW_LINE>String[] itemNames = config.split("\\n|\\r\\n");<NEW_LINE>Arrays.stream(itemNames).map(String::trim).forEach(itemName -> {<NEW_LINE>String itemValue = null;<NEW_LINE>try {<NEW_LINE>itemValue = configService.getConfig(itemName, settings.getGroup(), 1000);<NEW_LINE>} catch (NacosException e) {<NEW_LINE>log.error("Failed to register Nacos listener for dataId: {}", itemName, e);<NEW_LINE>}<NEW_LINE>groupConfigItems.add(new ConfigTable.ConfigItem(itemName, itemValue));<NEW_LINE>});<NEW_LINE>}<NEW_LINE>} catch (NacosException e) {<NEW_LINE>log.error("Failed to register Nacos listener for dataId: {}", key, e);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return Optional.of(groupConfigTable);<NEW_LINE>} | = new GroupConfigTable.GroupConfigItems(key); |
1,550,490 | private boolean isServiceChangedCCCDEnabled() throws DeviceDisconnectedException, DfuException, UploadAbortedException {<NEW_LINE>if (!mConnected)<NEW_LINE>throw new DeviceDisconnectedException("Unable to read Service Changed CCCD: device disconnected");<NEW_LINE>if (mAborted)<NEW_LINE>throw new UploadAbortedException();<NEW_LINE>// If the Service Changed characteristic or the CCCD is not available we return false.<NEW_LINE>final BluetoothGatt gatt = mGatt;<NEW_LINE>final BluetoothGattService genericAttributeService = gatt.getService(GENERIC_ATTRIBUTE_SERVICE_UUID);<NEW_LINE>if (genericAttributeService == null)<NEW_LINE>return false;<NEW_LINE>final BluetoothGattCharacteristic serviceChangedCharacteristic = genericAttributeService.getCharacteristic(SERVICE_CHANGED_UUID);<NEW_LINE>if (serviceChangedCharacteristic == null)<NEW_LINE>return false;<NEW_LINE>final BluetoothGattDescriptor <MASK><NEW_LINE>if (descriptor == null)<NEW_LINE>return false;<NEW_LINE>mRequestCompleted = false;<NEW_LINE>mError = 0;<NEW_LINE>logi("Reading Service Changed CCCD value...");<NEW_LINE>mService.sendLogBroadcast(DfuBaseService.LOG_LEVEL_VERBOSE, "Reading Service Changed CCCD value...");<NEW_LINE>mService.sendLogBroadcast(DfuBaseService.LOG_LEVEL_DEBUG, "gatt.readDescriptor(" + descriptor.getUuid() + ")");<NEW_LINE>gatt.readDescriptor(descriptor);<NEW_LINE>// We have to wait until device receives a response or an error occur<NEW_LINE>try {<NEW_LINE>synchronized (mLock) {<NEW_LINE>while ((!mRequestCompleted && mConnected && mError == 0) || mPaused) mLock.wait();<NEW_LINE>}<NEW_LINE>} catch (final InterruptedException e) {<NEW_LINE>loge("Sleeping interrupted", e);<NEW_LINE>}<NEW_LINE>if (!mConnected)<NEW_LINE>throw new DeviceDisconnectedException("Unable to read Service Changed CCCD: device disconnected");<NEW_LINE>if (mError != 0)<NEW_LINE>throw new DfuException("Unable to read Service Changed CCCD", mError);<NEW_LINE>// Return true if the CCCD value is<NEW_LINE>return descriptor.getValue() != null && descriptor.getValue().length == 2 && descriptor.getValue()[0] == BluetoothGattDescriptor.ENABLE_INDICATION_VALUE[0] && descriptor.getValue()[1] == BluetoothGattDescriptor.ENABLE_INDICATION_VALUE[1];<NEW_LINE>} | descriptor = serviceChangedCharacteristic.getDescriptor(CLIENT_CHARACTERISTIC_CONFIG); |
1,574,238 | private static void migrateConversation(Context context, SmsMigrationProgressListener listener, ProgressDescription progress, long theirThreadId, long ourThreadId) {<NEW_LINE>MessageDatabase ourSmsDatabase = SignalDatabase.sms();<NEW_LINE>Cursor cursor = null;<NEW_LINE>SQLiteStatement statement = null;<NEW_LINE>try {<NEW_LINE>Uri uri = <MASK><NEW_LINE>try {<NEW_LINE>cursor = context.getContentResolver().query(uri, null, null, null, null);<NEW_LINE>} catch (SQLiteException e) {<NEW_LINE>// / Work around for weird sony-specific (?) bug: #4309<NEW_LINE>Log.w(TAG, e);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>SQLiteDatabase transaction = ourSmsDatabase.beginTransaction();<NEW_LINE>statement = ourSmsDatabase.createInsertStatement(transaction);<NEW_LINE>while (cursor != null && cursor.moveToNext()) {<NEW_LINE>int addressColumn = cursor.getColumnIndexOrThrow(SystemColumns.ADDRESS);<NEW_LINE>int typeColumn = cursor.getColumnIndex(SmsDatabase.TYPE);<NEW_LINE>if (!cursor.isNull(addressColumn) && (cursor.isNull(typeColumn) || isAppropriateTypeForMigration(cursor, typeColumn))) {<NEW_LINE>getContentValuesForRow(context, cursor, ourThreadId, statement);<NEW_LINE>statement.execute();<NEW_LINE>}<NEW_LINE>listener.progressUpdate(new ProgressDescription(progress, cursor.getCount(), cursor.getPosition()));<NEW_LINE>}<NEW_LINE>ourSmsDatabase.endTransaction(transaction);<NEW_LINE>SignalDatabase.threads().update(ourThreadId, true);<NEW_LINE>SignalDatabase.threads().setLastScrolled(ourThreadId, 0);<NEW_LINE>SignalDatabase.threads().notifyConversationListeners(ourThreadId);<NEW_LINE>} finally {<NEW_LINE>if (statement != null)<NEW_LINE>statement.close();<NEW_LINE>if (cursor != null)<NEW_LINE>cursor.close();<NEW_LINE>}<NEW_LINE>} | Uri.parse("content://sms/conversations/" + theirThreadId); |
405,220 | public <T> Evaluator<T> create(QueryMetadata metadata, List<? extends Expression<?>> sources, Expression<T> projection) {<NEW_LINE>final CollQuerySerializer serializer = new CollQuerySerializer(templates);<NEW_LINE>serializer.append("return ");<NEW_LINE>if (projection instanceof FactoryExpression<?>) {<NEW_LINE>serializer.append("(");<NEW_LINE>serializer.append(ClassUtils.getName<MASK><NEW_LINE>serializer.append(")(");<NEW_LINE>serializer.handle(projection);<NEW_LINE>serializer.append(")");<NEW_LINE>} else {<NEW_LINE>serializer.handle(projection);<NEW_LINE>}<NEW_LINE>serializer.append(";");<NEW_LINE>Map<Object, String> constantToLabel = serializer.getConstantToLabel();<NEW_LINE>Map<String, Object> constants = getConstants(metadata, constantToLabel);<NEW_LINE>Class<?>[] types = new Class<?>[sources.size()];<NEW_LINE>String[] names = new String[sources.size()];<NEW_LINE>for (int i = 0; i < sources.size(); i++) {<NEW_LINE>types[i] = sources.get(i).getType();<NEW_LINE>names[i] = sources.get(i).toString();<NEW_LINE>}<NEW_LINE>// normalize types<NEW_LINE>for (int i = 0; i < types.length; i++) {<NEW_LINE>if (PrimitiveUtils.isWrapperType(types[i])) {<NEW_LINE>types[i] = PrimitiveUtils.unwrap(types[i]);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return factory.createEvaluator(serializer.toString(), projection.getType(), names, types, constants);<NEW_LINE>} | (projection.getType())); |
1,292,577 | protected void onCreate(Bundle savedInstanceState) {<NEW_LINE>super.onCreate(savedInstanceState);<NEW_LINE>localeDelegate.onCreate(this);<NEW_LINE>PreferenceManager.setDefaultValues(this, R.xml.preferences, false);<NEW_LINE>setContentView(R.layout.activity_main);<NEW_LINE>Toolbar toolbar = findViewById(R.id.toolbar);<NEW_LINE>setSupportActionBar(toolbar);<NEW_LINE>DrawerLayout drawer = findViewById(R.id.drawer_layout);<NEW_LINE>ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(this, drawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close);<NEW_LINE>drawer.addDrawerListener(toggle);<NEW_LINE>toggle.syncState();<NEW_LINE>NavigationView navigationView = findViewById(R.id.nav_view);<NEW_LINE>navigationView.setNavigationItemSelectedListener(this);<NEW_LINE>if (savedInstanceState == null) {<NEW_LINE>navigationView.setCheckedItem(R.id.nav_outline);<NEW_LINE>Fragment fragment = new OutlineFragment();<NEW_LINE>getSupportFragmentManager().beginTransaction().replace(R.id.content_main, fragment, FRAGMENT_OUTLINE).commit();<NEW_LINE>}<NEW_LINE>Info.INSTANCE.welcome(this);<NEW_LINE><MASK><NEW_LINE>Version.INSTANCE.nearFutureChange(this);<NEW_LINE>} | Version.INSTANCE.dataVersionChange(this); |
1,132,906 | protected static void propagatePreviousGlbs(final Subtypes targetSubtypes, InferenceResult solution, final Map<AnnotatedTypeMirror, AnnotationMirrorSet> subtypesOfTarget) {<NEW_LINE>for (final Map.Entry<TypeVariable, AnnotationMirrorSet> subtypeTarget : targetSubtypes.targets.entrySet()) {<NEW_LINE>final InferredValue subtargetInferredGlb = solution.get(subtypeTarget.getKey());<NEW_LINE>if (subtargetInferredGlb != null) {<NEW_LINE>final AnnotatedTypeMirror subtargetGlbType = ((InferredType) subtargetInferredGlb).type;<NEW_LINE>AnnotationMirrorSet subtargetAnnos = subtypesOfTarget.get(subtargetGlbType);<NEW_LINE>if (subtargetAnnos != null) {<NEW_LINE>// there is already an equivalent type in the list of subtypes, just add<NEW_LINE>// any hierarchies that are not in its list but are in the supertarget's list<NEW_LINE>subtargetAnnos.<MASK><NEW_LINE>} else {<NEW_LINE>subtypesOfTarget.put(subtargetGlbType, subtypeTarget.getValue());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | addAll(subtypeTarget.getValue()); |
507,733 | public List<T> mapRow(Result result, int rowNum) throws Exception {<NEW_LINE>if (result.isEmpty()) {<NEW_LINE>return Collections.emptyList();<NEW_LINE>}<NEW_LINE>final byte[] distributedRowKey = result.getRow();<NEW_LINE>final String agentId = this.hbaseOperationFactory.getAgentId(distributedRowKey);<NEW_LINE>final long baseTimestamp = this.hbaseOperationFactory.getBaseTimestamp(distributedRowKey);<NEW_LINE>List<T> dataPoints = new ArrayList<>();<NEW_LINE>for (Cell cell : result.rawCells()) {<NEW_LINE>if (CellUtil.matchingFamily(cell, targetHbaseColumnFamily.getName())) {<NEW_LINE>Buffer qualifierBuffer = new OffsetFixedBuffer(cell.getQualifierArray(), cell.getQualifierOffset(<MASK><NEW_LINE>Buffer valueBuffer = new OffsetFixedBuffer(cell.getValueArray(), cell.getValueOffset(), cell.getValueLength());<NEW_LINE>long timestampDelta = this.decoder.decodeQualifier(qualifierBuffer);<NEW_LINE>AgentStatDecodingContext decodingContext = new AgentStatDecodingContext();<NEW_LINE>decodingContext.setAgentId(agentId);<NEW_LINE>decodingContext.setBaseTimestamp(baseTimestamp);<NEW_LINE>decodingContext.setTimestampDelta(timestampDelta);<NEW_LINE>List<T> candidates = this.decoder.decodeValue(valueBuffer, decodingContext);<NEW_LINE>for (T candidate : candidates) {<NEW_LINE>if (filter(candidate)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>dataPoints.add(candidate);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Reverse sort as timestamp is stored in a reversed order.<NEW_LINE>dataPoints.sort(REVERSE_TIMESTAMP_COMPARATOR);<NEW_LINE>return dataPoints;<NEW_LINE>} | ), cell.getQualifierLength()); |
1,121,819 | // --------//<NEW_LINE>// preAdd //<NEW_LINE>// --------//<NEW_LINE>@Override<NEW_LINE>public List<? extends UITask> preAdd(WrappedBoolean cancel) {<NEW_LINE>final List<UITask> tasks = new ArrayList<>();<NEW_LINE>if (model == null) {<NEW_LINE>model = buildModel();<NEW_LINE>}<NEW_LINE>if (model == null) {<NEW_LINE>cancel.value = true;<NEW_LINE>return tasks;<NEW_LINE>}<NEW_LINE>// We "convert" compound note addition into:<NEW_LINE>// head, stem, head-stem relation, beam-stem relations?, headChord?<NEW_LINE>final SystemInfo system = staff.getSystem();<NEW_LINE>final SIGraph theSig = system.getSig();<NEW_LINE>final int profile = Math.max(getProfile(), system.getProfile());<NEW_LINE>// Look for beams around, this also updates head and stem data<NEW_LINE>final Collection<Link> stemLinks = stem.lookupBeamLinks(system, profile);<NEW_LINE>final Rectangle headBounds = model.headBox.getBounds();<NEW_LINE>tasks.add(new AdditionTask(theSig, head, headBounds, Collections.emptySet()));<NEW_LINE>final Rectangle stemBounds = model.stemBox.getBounds();<NEW_LINE>tasks.add(new AdditionTask(theSig, stem, stemBounds, Collections.emptySet()));<NEW_LINE>tasks.add(new LinkTask(theSig, head, stem, new HeadStemRelation()));<NEW_LINE>// Stem to beams<NEW_LINE>for (Link link : stemLinks) {<NEW_LINE>tasks.add(new LinkTask(theSig, link.partner, stem, new BeamStemRelation()));<NEW_LINE>}<NEW_LINE>if (system.getSheet().getStub().getLatestStep().compareTo(OmrStep.CHORDS) >= 0) {<NEW_LINE>// Create the related head chord<NEW_LINE>final HeadChordInter chord = new HeadChordInter(null);<NEW_LINE>tasks.add(new AdditionTask(theSig, chord, stemBounds, Collections.emptySet()));<NEW_LINE>tasks.add(new LinkTask(theSig, chord, head, new Containment()));<NEW_LINE>tasks.add(new LinkTask(theSig, chord, stem, new ChordStemRelation()));<NEW_LINE>}<NEW_LINE>// Addition of needed ledgers<NEW_LINE>final Point2D headCenter = GeoUtil.center2D(headBounds);<NEW_LINE>tasks.addAll(HeadInter<MASK><NEW_LINE>return tasks;<NEW_LINE>} | .getNeededLedgerAdditions(headCenter, staff)); |
1,012,415 | public Request<DescribeEndpointRequest> marshall(DescribeEndpointRequest describeEndpointRequest) {<NEW_LINE>if (describeEndpointRequest == null) {<NEW_LINE>throw new AmazonClientException("Invalid argument passed to marshall(DescribeEndpointRequest)");<NEW_LINE>}<NEW_LINE>Request<DescribeEndpointRequest> request = new DefaultRequest<DescribeEndpointRequest>(describeEndpointRequest, "AmazonComprehend");<NEW_LINE>String target = "Comprehend_20171127.DescribeEndpoint";<NEW_LINE>request.addHeader("X-Amz-Target", target);<NEW_LINE>request.setHttpMethod(HttpMethodName.POST);<NEW_LINE>String uriResourcePath = "/";<NEW_LINE>request.setResourcePath(uriResourcePath);<NEW_LINE>try {<NEW_LINE>StringWriter stringWriter = new StringWriter();<NEW_LINE>AwsJsonWriter jsonWriter = JsonUtils.getJsonWriter(stringWriter);<NEW_LINE>jsonWriter.beginObject();<NEW_LINE>if (describeEndpointRequest.getEndpointArn() != null) {<NEW_LINE><MASK><NEW_LINE>jsonWriter.name("EndpointArn");<NEW_LINE>jsonWriter.value(endpointArn);<NEW_LINE>}<NEW_LINE>jsonWriter.endObject();<NEW_LINE>jsonWriter.close();<NEW_LINE>String snippet = stringWriter.toString();<NEW_LINE>byte[] content = snippet.getBytes(UTF8);<NEW_LINE>request.setContent(new StringInputStream(snippet));<NEW_LINE>request.addHeader("Content-Length", Integer.toString(content.length));<NEW_LINE>} catch (Throwable t) {<NEW_LINE>throw new AmazonClientException("Unable to marshall request to JSON: " + t.getMessage(), t);<NEW_LINE>}<NEW_LINE>if (!request.getHeaders().containsKey("Content-Type")) {<NEW_LINE>request.addHeader("Content-Type", "application/x-amz-json-1.1");<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>} | String endpointArn = describeEndpointRequest.getEndpointArn(); |
699,181 | private void updateCategory() {<NEW_LINE>try {<NEW_LINE>ImageGalleryController controllerForCase = ImageGalleryController.getController(Case.getCurrentCaseThrows());<NEW_LINE>if (controllerForCase == null) {<NEW_LINE>// This can only happen during case closing, so return without generating an error.<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>List<MASK><NEW_LINE>TagName tag = null;<NEW_LINE>for (ContentTag ct : contentTags) {<NEW_LINE>TagName tagName = ct.getName();<NEW_LINE>if (controllerForCase.getCategoryManager().isCategoryTagName(tagName)) {<NEW_LINE>tag = tagName;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>categoryTagName.set(tag);<NEW_LINE>} catch (TskCoreException ex) {<NEW_LINE>// NON-NLS<NEW_LINE>LOGGER.log(Level.WARNING, "problem looking up category for " + this.getContentPathSafe(), ex);<NEW_LINE>} catch (IllegalStateException | NoCurrentCaseException ex) {<NEW_LINE>// We get here many times if the case is closed during ingest, so don't print out a ton of warnings.<NEW_LINE>}<NEW_LINE>} | <ContentTag> contentTags = getContentTags(); |
745,141 | // ========================================<NEW_LINE>// MouseListener methods<NEW_LINE>// ========================================<NEW_LINE>@Override<NEW_LINE>public void mouseClicked(MouseEvent e) {<NEW_LINE>TreePath clickedPath = null;<NEW_LINE>// when nothing is viewable, do nothing and return immediately<NEW_LINE>if (tree.getClosestPathForLocation(e.getX(), e.getY()) == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>clickedPath = tree.getClosestPathForLocation(e.getX(), e.getY());<NEW_LINE>if (clickedPath.getLastPathComponent() instanceof CommonTreeNode) {<NEW_LINE>clickedNode = (CommonTreeNode) clickedPath.getLastPathComponent();<NEW_LINE>}<NEW_LINE>if (clickedNode == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Highlight this selected path<NEW_LINE>tree.setSelectionPath(clickedPath);<NEW_LINE>int nodeType = clickedNode.getNodeType();<NEW_LINE>int popIndex = getPopupIndexForNode(nodeType);<NEW_LINE>TrickQPApplication.QPTabType tabType = TrickQPApplication.getTabTypeForNode(nodeType);<NEW_LINE>// Determining which popup menu needs displaying<NEW_LINE>if (UIUtils.isRightMouseClick(e)) {<NEW_LINE>if (popIndex > -1 && getPopup(popIndex) != null && !getPopup(popIndex).isVisible()) {<NEW_LINE>getPopup(popIndex).show(e.getComponent(), e.getX(), e.getY());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>try {<NEW_LINE>if (tabType != null) {<NEW_LINE>(TrickQPApplication.getInstance(TrickQPApplication.class)).setSelectedTab(tabType.ordinal(), clickedNode);<NEW_LINE>} else {<NEW_LINE>(TrickQPApplication.getInstance(TrickQPApplication.class<MASK><NEW_LINE>}<NEW_LINE>} catch (ArrayIndexOutOfBoundsException ae) {<NEW_LINE>// do nothing, if this happens, no tab is selected.<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | )).setSelectedTab(-1); |
420,456 | private boolean isSyntheticConstructor(ClassNode classNode, PropertyNode constructorNode) {<NEW_LINE>// constructor may be synthetic from parser<NEW_LINE>Expression value = constructorNode.getValue();<NEW_LINE>if (!(value instanceof FunctionNode)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>String keyName = constructorNode.getKeyName();<NEW_LINE>IdentNode nameNode = classNode.getIdent();<NEW_LINE>// $NON-NLS-1$<NEW_LINE>String constructorName = "constructor";<NEW_LINE>if (nameNode != null) {<NEW_LINE>constructorName = nameNode.getName();<NEW_LINE>}<NEW_LINE>if (!constructorName.equals(keyName)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>FunctionNode constructorFunction = (FunctionNode) value;<NEW_LINE><MASK><NEW_LINE>int numParams = constructorFunction.getNumOfParams();<NEW_LINE>boolean isSubclass = (classNode.getClassHeritage() != null);<NEW_LINE>// not a subclass<NEW_LINE>if (!isSubclass) {<NEW_LINE>return numParams == 0 && body.getStatementCount() == 0;<NEW_LINE>}<NEW_LINE>// TODO do we need to check the statement is an ExpressionStatement holding a CallNode with function "super" and<NEW_LINE>// single "args" argument?<NEW_LINE>return numParams == 1 && constructorFunction.hasDirectSuper() && constructorFunction.getParameter(0).isRestParameter() && body.getStatementCount() == 1;<NEW_LINE>} | Block body = constructorFunction.getBody(); |
1,296,419 | private void processNoMasterNoDataNode(Terminal terminal, Path[] dataPaths, Environment env) throws IOException {<NEW_LINE>NodeEnvironment.NodePath[] nodePaths = toNodePaths(dataPaths);<NEW_LINE>terminal.println(Terminal.Verbosity.VERBOSE, "Collecting shard data paths");<NEW_LINE>List<Path> shardDataPaths = NodeEnvironment.collectShardDataPaths(nodePaths);<NEW_LINE>terminal.println(Terminal.Verbosity.VERBOSE, "Collecting index metadata paths");<NEW_LINE>List<Path> <MASK><NEW_LINE>Set<Path> indexPaths = uniqueParentPaths(shardDataPaths, indexMetadataPaths);<NEW_LINE>final PersistedClusterStateService persistedClusterStateService = createPersistedClusterStateService(env.settings(), dataPaths);<NEW_LINE>final Metadata metadata = loadClusterState(terminal, env, persistedClusterStateService).metadata();<NEW_LINE>if (indexPaths.isEmpty() && metadata.indices().isEmpty()) {<NEW_LINE>terminal.println(Terminal.Verbosity.NORMAL, NO_DATA_TO_CLEAN_UP_FOUND);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final Set<String> indexUUIDs = Sets.union(indexUUIDsFor(indexPaths), StreamSupport.stream(metadata.indices().values().spliterator(), false).map(imd -> imd.value.getIndexUUID()).collect(Collectors.toSet()));<NEW_LINE>outputVerboseInformation(terminal, indexPaths, indexUUIDs, metadata);<NEW_LINE>terminal.println(noMasterMessage(indexUUIDs.size(), shardDataPaths.size(), indexMetadataPaths.size()));<NEW_LINE>outputHowToSeeVerboseInformation(terminal);<NEW_LINE>terminal.println("Node is being re-purposed as no-cluster-manager and no-data. Clean-up of index data will be performed.");<NEW_LINE>confirm(terminal, "Do you want to proceed?");<NEW_LINE>// clean-up shard dirs<NEW_LINE>removePaths(terminal, indexPaths);<NEW_LINE>// clean-up all metadata dirs<NEW_LINE>MetadataStateFormat.deleteMetaState(dataPaths);<NEW_LINE>IOUtils.rm(Stream.of(dataPaths).map(path -> path.resolve(INDICES_FOLDER)).toArray(Path[]::new));<NEW_LINE>terminal.println("Node successfully repurposed to no-cluster-manager and no-data.");<NEW_LINE>} | indexMetadataPaths = NodeEnvironment.collectIndexMetadataPaths(nodePaths); |
1,682,101 | public ImmutableImage scaleTo(int targetWidth, int targetHeight, ScaleMethod scaleMethod) {<NEW_LINE>if (targetWidth == width && targetHeight == height)<NEW_LINE>return this;<NEW_LINE>switch(scaleMethod) {<NEW_LINE>case FastScale:<NEW_LINE>if (targetWidth < width && targetHeight < height && awt().getType() == BufferedImage.TYPE_INT_ARGB)<NEW_LINE>return wrapAwt(fastScaleScrimage<MASK><NEW_LINE>else<NEW_LINE>return wrapAwt(fastScaleAwt(targetWidth, targetHeight), metadata);<NEW_LINE>case Lanczos3:<NEW_LINE>Lanczos3Filter lan = ResampleFilters.lanczos3Filter;<NEW_LINE>ImmutableImage s1 = op(new ResampleOp(lan, targetWidth, targetHeight));<NEW_LINE>return wrapAwt(s1.awt(), s1.awt().getType());<NEW_LINE>case BSpline:<NEW_LINE>BSplineFilter bs = ResampleFilters.bSplineFilter;<NEW_LINE>ImmutableImage s2 = op(new ResampleOp(bs, targetWidth, targetHeight));<NEW_LINE>return wrapAwt(s2.awt(), s2.awt().getType());<NEW_LINE>case Bilinear:<NEW_LINE>TriangleFilter t = ResampleFilters.triangleFilter;<NEW_LINE>ImmutableImage s3 = op(new ResampleOp(t, targetWidth, targetHeight));<NEW_LINE>return wrapAwt(s3.awt(), s3.awt().getType());<NEW_LINE>case Progressive:<NEW_LINE>if (targetWidth >= width || targetHeight >= height)<NEW_LINE>return scaleTo(targetWidth, targetHeight, ScaleMethod.Bicubic);<NEW_LINE>BufferedImage result = ProgressiveScale.scale(awt(), targetWidth, targetHeight, RenderingHints.VALUE_INTERPOLATION_BILINEAR);<NEW_LINE>return wrapAwt(result);<NEW_LINE>case Bicubic:<NEW_LINE>BiCubicFilter b = ResampleFilters.biCubicFilter;<NEW_LINE>ImmutableImage s4 = op(new ResampleOp(b, targetWidth, targetHeight));<NEW_LINE>return wrapAwt(s4.awt());<NEW_LINE>default:<NEW_LINE>throw new UnsupportedOperationException();<NEW_LINE>}<NEW_LINE>} | (targetWidth, targetHeight), metadata); |
1,724,560 | public static void drawMageLightBg(Canvas canvas, RectF targetFrame, ResizingBehavior resizing) {<NEW_LINE>// Resize to Target Frame<NEW_LINE>canvas.save();<NEW_LINE>RectF resizedFrame = CacheForMageLightBg.resizedFrame;<NEW_LINE>HabiticaIcons.resizingBehaviorApply(resizing, CacheForMageLightBg.originalFrame, targetFrame, resizedFrame);<NEW_LINE>canvas.translate(resizedFrame.left, resizedFrame.top);<NEW_LINE>canvas.scale(resizedFrame.width() / 32f, <MASK><NEW_LINE>// Symbol<NEW_LINE>RectF symbolRect = CacheForMageLightBg.symbolRect;<NEW_LINE>symbolRect.set(0f, 0f, 32f, 32f);<NEW_LINE>canvas.save();<NEW_LINE>canvas.clipRect(symbolRect);<NEW_LINE>canvas.translate(symbolRect.left, symbolRect.top);<NEW_LINE>RectF symbolTargetRect = CacheForMageLightBg.symbolTargetRect;<NEW_LINE>symbolTargetRect.set(0f, 0f, symbolRect.width(), symbolRect.height());<NEW_LINE>HabiticaIcons.drawMage(canvas, symbolTargetRect, ResizingBehavior.Stretch, false);<NEW_LINE>canvas.restore();<NEW_LINE>canvas.restore();<NEW_LINE>} | resizedFrame.height() / 32f); |
295,231 | public void runSupport() {<NEW_LINE>enabled_networks.clear();<NEW_LINE>enabled_sources.clear();<NEW_LINE>if (network_buttons == null || network_buttons[0].isDisposed()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>DownloadManagerState state = null;<NEW_LINE>String[] networks = null;<NEW_LINE>String[] sources = null;<NEW_LINE>if (dm != null) {<NEW_LINE>state = dm.getDownloadState();<NEW_LINE>networks = state.getNetworks();<NEW_LINE>sources = state.getPeerSources();<NEW_LINE>}<NEW_LINE>privacy_scale.setEnabled(networks != null);<NEW_LINE>if (networks != null) {<NEW_LINE>enabled_networks.addAll(Arrays.asList(networks));<NEW_LINE>int pl;<NEW_LINE>if (enabled_networks.contains(AENetworkClassifier.AT_PUBLIC)) {<NEW_LINE>if (enabled_networks.size() == 1) {<NEW_LINE>pl = PL_PUBLIC;<NEW_LINE>} else {<NEW_LINE>pl = PL_MIX;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (enabled_networks.size() == 0) {<NEW_LINE>pl = PL_INVALID;<NEW_LINE>} else {<NEW_LINE>pl = PL_ANONYMOUS;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>privacy_level = pl;<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>for (int i = 0; i < AENetworkClassifier.AT_NETWORKS.length; i++) {<NEW_LINE>final String net = AENetworkClassifier.AT_NETWORKS[i];<NEW_LINE>network_buttons[i].setEnabled(networks != null);<NEW_LINE>network_buttons[i].setSelection(enabled_networks.contains(net));<NEW_LINE>}<NEW_LINE>if (sources != null) {<NEW_LINE>enabled_sources.addAll(Arrays.asList(sources));<NEW_LINE>}<NEW_LINE>for (int i = 0; i < PEPeerSource.PS_SOURCES.length; i++) {<NEW_LINE>final String source = PEPeerSource.PS_SOURCES[i];<NEW_LINE>source_buttons[i].setEnabled(sources != null && state.isPeerSourcePermitted(source));<NEW_LINE>source_buttons[i].setSelection(enabled_sources.contains(source));<NEW_LINE>}<NEW_LINE>if (state != null) {<NEW_LINE>ipfilter_enabled.setEnabled(true);<NEW_LINE>ipfilter_enabled.setSelection(!state.getFlag(DownloadManagerState.FLAG_DISABLE_IP_FILTER));<NEW_LINE>} else {<NEW_LINE>ipfilter_enabled.setEnabled(false);<NEW_LINE>}<NEW_LINE>// update info about which trackers etc are enabled<NEW_LINE>setupTorrentTracker(dm);<NEW_LINE>} | privacy_scale.setSelection(pl * 10); |
1,776,673 | private void decodeSpkac(byte[] der) throws SpkacException {<NEW_LINE>try {<NEW_LINE>ASN1Sequence signedPublicKeyAndChallenge = ASN1Sequence.getInstance(der);<NEW_LINE>ASN1Sequence publicKeyAndChallenge = (ASN1Sequence) signedPublicKeyAndChallenge.getObjectAt(0);<NEW_LINE>ASN1Sequence signatureAlgorithm = (<MASK><NEW_LINE>DERBitString signature = (DERBitString) signedPublicKeyAndChallenge.getObjectAt(2);<NEW_LINE>ASN1ObjectIdentifier signatureAlgorithmOid = (ASN1ObjectIdentifier) signatureAlgorithm.getObjectAt(0);<NEW_LINE>if (signatureAlgorithm.size() > 1) {<NEW_LINE>this.signatureAlgorithmParameters = signatureAlgorithm.getObjectAt(1).toASN1Primitive().getEncoded();<NEW_LINE>}<NEW_LINE>ASN1Sequence spki = (ASN1Sequence) publicKeyAndChallenge.getObjectAt(0);<NEW_LINE>DERIA5String challenge = (DERIA5String) publicKeyAndChallenge.getObjectAt(1);<NEW_LINE>ASN1Sequence publicKeyAlgorithm = (ASN1Sequence) spki.getObjectAt(0);<NEW_LINE>DERBitString publicKey = (DERBitString) spki.getObjectAt(1);<NEW_LINE>ASN1ObjectIdentifier publicKeyAlgorithmOid = (ASN1ObjectIdentifier) publicKeyAlgorithm.getObjectAt(0);<NEW_LINE>ASN1Primitive algorithmParameters = publicKeyAlgorithm.getObjectAt(1).toASN1Primitive();<NEW_LINE>this.challenge = challenge.getString();<NEW_LINE>this.publicKey = decodePublicKeyFromBitString(publicKeyAlgorithmOid, algorithmParameters, publicKey);<NEW_LINE>this.signatureAlgorithm = getSignatureAlgorithm(signatureAlgorithmOid);<NEW_LINE>this.signature = signature.getBytes();<NEW_LINE>} catch (Exception ex) {<NEW_LINE>throw new SpkacException(res.getString("NoDecodeSpkac.exception.message"), ex);<NEW_LINE>}<NEW_LINE>} | ASN1Sequence) signedPublicKeyAndChallenge.getObjectAt(1); |
1,553,692 | public static void checkVersion() {<NEW_LINE>if (versionChecked) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>synchronized (versionChecked) {<NEW_LINE>if (versionChecked) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>boolean versionCheck = true;<NEW_LINE>if (System.getProperty("tddl.version.check") != null) {<NEW_LINE>versionCheck = Boolean.valueOf(System.getProperty("tddl.version.check"));<NEW_LINE>}<NEW_LINE>Version.checkDuplicate("com/taobao/tddl/client/sequence/impl/GroupSequenceDao.class", true && versionCheck);<NEW_LINE>validVersion("polardbx-executor", "com/alibaba/polardbx/sequence/impl/GroupSequenceDao.class", VERSION, false);<NEW_LINE>Version.checkDuplicate("com/alibaba/polardbx/sequence/impl/SimpleSequenceDao.class", true && versionCheck);<NEW_LINE>validVersion("polardbx-executor", "com/alibaba/polardbx/sequence/impl/SimpleSequenceDao.class", VERSION, false);<NEW_LINE>Version.checkDuplicate("com/alibaba/druid/pool/DruidDataSource.class", true && versionCheck);<NEW_LINE>validVersion("druid", "com/alibaba/druid/pool/DruidDataSource.class", "1.0.15", true && versionCheck);<NEW_LINE>Version.checkDuplicate("com/google/common/collect/MapMaker.class", false);<NEW_LINE>validVersion(<MASK><NEW_LINE>Version.checkDuplicate("com/mysql/jdbc/Driver.class", true && versionCheck);<NEW_LINE>validVersion("mysql-connector-java", "com/mysql/jdbc/Driver.class", "5.1.26", true && versionCheck);<NEW_LINE>Version.checkDuplicate("org/slf4j/impl/StaticLoggerBinder.class", false);<NEW_LINE>} finally {<NEW_LINE>versionChecked = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | "guava", "com/google/common/collect/MapMaker.class", "15.0", false); |
232,982 | public void refreshFields() {<NEW_LINE>ResourceConfigData data = this.helper.getData();<NEW_LINE>for (int i = 0; i < jFields.length; i++) {<NEW_LINE>String item;<NEW_LINE>if (FieldHelper.isList(fields[i])) {<NEW_LINE>item = (String) ((JComboBox) jFields[i]).getSelectedItem();<NEW_LINE>} else {<NEW_LINE>item = (String) ((JTextField) jFields[i]).getText();<NEW_LINE>}<NEW_LINE>String fieldName = fields[i].getName();<NEW_LINE>Object value = data.get(fieldName);<NEW_LINE>if (value == null) {<NEW_LINE>value = FieldHelper<MASK><NEW_LINE>if (fieldName.equals("jndi-name")) {<NEW_LINE>// NOI18N<NEW_LINE>String helperJndiName = data.getTargetFile();<NEW_LINE>if (helperJndiName != null) {<NEW_LINE>if (getPanelType().equals(TYPE_JDBC_RESOURCE) || getPanelType().equals(TYPE_PERSISTENCE_MANAGER)) {<NEW_LINE>value = value + helperJndiName;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>data.set(fieldName, value);<NEW_LINE>}<NEW_LINE>String val = (String) value;<NEW_LINE>if (!item.equals(val)) {<NEW_LINE>if (FieldHelper.isList(fields[i])) {<NEW_LINE>((JComboBox) jFields[i]).setSelectedItem(val);<NEW_LINE>} else {<NEW_LINE>((JTextField) jFields[i]).setText(val);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (getPanelType().equals(TYPE_JDBC_RESOURCE)) {<NEW_LINE>Object selPool = (Object) data.getString(__PoolName);<NEW_LINE>existingResourceComboBox.setSelectedItem(selPool);<NEW_LINE>} else if (getPanelType().equals(TYPE_PERSISTENCE_MANAGER)) {<NEW_LINE>Object selJDBC = (Object) data.getString(__JdbcResourceJndiName);<NEW_LINE>existingResourceComboBox.setSelectedItem(selJDBC);<NEW_LINE>}<NEW_LINE>} | .getDefaultValue(fields[i]); |
331,728 | void flush(SegmentWriteState state, Sorter.DocMap sortMap) throws IOException {<NEW_LINE>super.flush(state, sortMap);<NEW_LINE>StoredFieldsReader reader = TEMP_STORED_FIELDS_FORMAT.fieldsReader(tmpDirectory, state.segmentInfo, state.fieldInfos, IOContext.DEFAULT);<NEW_LINE>// Don't pull a merge instance, since merge instances optimize for<NEW_LINE>// sequential access while we consume stored fields in random order here.<NEW_LINE>StoredFieldsWriter sortWriter = codec.storedFieldsFormat().fieldsWriter(state.directory, state.segmentInfo, IOContext.DEFAULT);<NEW_LINE>try {<NEW_LINE>reader.checkIntegrity();<NEW_LINE>CopyVisitor visitor = new CopyVisitor(sortWriter);<NEW_LINE>for (int docID = 0; docID < state.segmentInfo.maxDoc(); docID++) {<NEW_LINE>sortWriter.startDocument();<NEW_LINE>reader.visitDocument(sortMap == null ? docID : sortMap.newToOld(docID), visitor);<NEW_LINE>sortWriter.finishDocument();<NEW_LINE>}<NEW_LINE>sortWriter.finish(state.segmentInfo.maxDoc());<NEW_LINE>} finally {<NEW_LINE>IOUtils.close(reader, sortWriter);<NEW_LINE>IOUtils.deleteFiles(tmpDirectory, tmpDirectory.<MASK><NEW_LINE>}<NEW_LINE>} | getTemporaryFiles().values()); |
1,072,846 | public RouteValidationResult validate(List<UriMatchTemplate> templates, ParameterElement[] parameters, MethodElement method) {<NEW_LINE>Set<String> variables = templates.stream().flatMap(t -> t.getVariableNames().stream()).collect(Collectors.toSet());<NEW_LINE>Set<String> routeVariables = Arrays.stream(parameters).map(ParameterElement::getName).collect(Collectors.toCollection(LinkedHashSet::new));<NEW_LINE>routeVariables.addAll(Arrays.stream(parameters).filter(p -> p.hasAnnotation("io.micronaut.http.annotation.Body")).map(ParameterElement::getType).filter(Objects::nonNull).flatMap(t -> t.getBeanProperties().stream()).map(PropertyElement::getName).collect(Collectors.toList()));<NEW_LINE>// RequestBean has properties inside<NEW_LINE>routeVariables.addAll(Arrays.stream(parameters).filter(p -> p.hasAnnotation("io.micronaut.http.annotation.RequestBean")).map(ParameterElement::getType).flatMap(t -> t.getBeanProperties().stream()).filter(p -> p.hasStereotype(Bindable.class)).map(p -> p.getAnnotationMetadata().stringValue(Bindable.class).orElse(p.getName())).collect<MASK><NEW_LINE>List<String> errorMessages = new ArrayList<>();<NEW_LINE>for (String v : variables) {<NEW_LINE>if (!routeVariables.contains(v)) {<NEW_LINE>errorMessages.add(String.format("The route declares a uri variable named [%s], but no corresponding method argument is present", v));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new RouteValidationResult(errorMessages.toArray(new String[0]));<NEW_LINE>} | (Collectors.toSet())); |
827,392 | public void takeLeadership(CuratorFramework client) throws Exception {<NEW_LINE>setState(State.PRIMARY);<NEW_LINE>if (client.checkExists().forPath(mLeaderFolder + mName) != null) {<NEW_LINE>LOG.info("Deleting zk path: {}{}", mLeaderFolder, mName);<NEW_LINE>client.delete().forPath(mLeaderFolder + mName);<NEW_LINE>}<NEW_LINE>LOG.info("Creating zk path: {}{}", mLeaderFolder, mName);<NEW_LINE>client.create().creatingParentsIfNeeded().withMode(CreateMode.EPHEMERAL).forPath(mLeaderFolder + mName);<NEW_LINE>LOG.info("{} is now the leader.", mName);<NEW_LINE>try {<NEW_LINE>mLeaderZkSessionId = client.getZookeeperClient().getZooKeeper().getSessionId();<NEW_LINE>LOG.info(String.format("Taken leadership under session Id: %x", mLeaderZkSessionId));<NEW_LINE>waitForState(State.STANDBY);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>LOG.info("The current leader is {}", mLeaderSelector.getLeader().getId());<NEW_LINE>LOG.info("All participants: {}", mLeaderSelector.getParticipants());<NEW_LINE>client.delete().forPath(mLeaderFolder + mName);<NEW_LINE>mLeaderZkSessionId = NOT_A_LEADER;<NEW_LINE>}<NEW_LINE>} | LOG.warn("{} relinquishing leadership.", mName); |
1,405,883 | private void doFetchGroupConfig(final String server, final ConfigGroupEnum... groups) {<NEW_LINE>StringBuilder params = new StringBuilder();<NEW_LINE>for (ConfigGroupEnum groupKey : groups) {<NEW_LINE>params.append("groupKeys").append("=").append(groupKey.name()).append("&");<NEW_LINE>}<NEW_LINE>String url = server + Constants.SHENYU_ADMIN_PATH_CONFIGS_FETCH + "?" + StringUtils.removeEnd(params.toString(), "&");<NEW_LINE>LOG.info("request configs: [{}]", url);<NEW_LINE>String json;<NEW_LINE>try {<NEW_LINE>Optional<Object> <MASK><NEW_LINE>if (!token.isPresent()) {<NEW_LINE>throw new ShenyuException("get token from server : [" + server + " ] error");<NEW_LINE>}<NEW_LINE>HttpHeaders headers = new HttpHeaders();<NEW_LINE>headers.set(Constants.X_ACCESS_TOKEN, String.valueOf(token.get()));<NEW_LINE>HttpEntity<String> httpEntity = new HttpEntity<>(headers);<NEW_LINE>json = this.httpClient.exchange(url, HttpMethod.GET, httpEntity, String.class).getBody();<NEW_LINE>} catch (RestClientException e) {<NEW_LINE>String message = String.format("fetch config fail from server[%s], %s", url, e.getMessage());<NEW_LINE>LOG.warn(message);<NEW_LINE>throw new ShenyuException(message, e);<NEW_LINE>}<NEW_LINE>// update local cache<NEW_LINE>boolean updated = this.updateCacheWithJson(json);<NEW_LINE>if (updated) {<NEW_LINE>LOG.info("get latest configs: [{}]", json);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// not updated. it is likely that the current config server has not been updated yet. wait a moment.<NEW_LINE>LOG.info("The config of the server[{}] has not been updated or is out of date. Wait for 30s to listen for changes again.", server);<NEW_LINE>ThreadUtils.sleep(TimeUnit.SECONDS, 30);<NEW_LINE>} | token = accessToken.apply(server); |
975,173 | public void marshall(IosClientBrandingAttributes iosClientBrandingAttributes, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (iosClientBrandingAttributes == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(iosClientBrandingAttributes.getLogoUrl(), LOGOURL_BINDING);<NEW_LINE>protocolMarshaller.marshall(iosClientBrandingAttributes.getLogo2xUrl(), LOGO2XURL_BINDING);<NEW_LINE>protocolMarshaller.marshall(iosClientBrandingAttributes.getLogo3xUrl(), LOGO3XURL_BINDING);<NEW_LINE>protocolMarshaller.marshall(iosClientBrandingAttributes.getSupportEmail(), SUPPORTEMAIL_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(iosClientBrandingAttributes.getForgotPasswordLink(), FORGOTPASSWORDLINK_BINDING);<NEW_LINE>protocolMarshaller.marshall(iosClientBrandingAttributes.getLoginMessage(), LOGINMESSAGE_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | iosClientBrandingAttributes.getSupportLink(), SUPPORTLINK_BINDING); |
968,082 | public PagedList<CloudJobSchedule> list(final JobScheduleListOptions jobScheduleListOptions) {<NEW_LINE>ServiceResponseWithHeaders<Page<CloudJobSchedule>, JobScheduleListHeaders> response = listSinglePageAsync(jobScheduleListOptions).toBlocking().single();<NEW_LINE>return new PagedList<CloudJobSchedule>(response.body()) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Page<CloudJobSchedule> nextPage(String nextPageLink) {<NEW_LINE>JobScheduleListNextOptions jobScheduleListNextOptions = null;<NEW_LINE>if (jobScheduleListOptions != null) {<NEW_LINE>jobScheduleListNextOptions = new JobScheduleListNextOptions();<NEW_LINE>jobScheduleListNextOptions.<MASK><NEW_LINE>jobScheduleListNextOptions.withReturnClientRequestId(jobScheduleListOptions.returnClientRequestId());<NEW_LINE>jobScheduleListNextOptions.withOcpDate(jobScheduleListOptions.ocpDate());<NEW_LINE>}<NEW_LINE>return listNextSinglePageAsync(nextPageLink, jobScheduleListNextOptions).toBlocking().single().body();<NEW_LINE>}<NEW_LINE>};<NEW_LINE>} | withClientRequestId(jobScheduleListOptions.clientRequestId()); |
112,000 | public static void paintCellEditorBorder(Graphics2D g2, Component c, Rectangle r, boolean hasFocus) {<NEW_LINE>g2 = (Graphics2D) g2.create();<NEW_LINE>try {<NEW_LINE>g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);<NEW_LINE>g2.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, MacUIUtil.USE_QUARTZ ? RenderingHints.VALUE_STROKE_PURE : RenderingHints.VALUE_STROKE_NORMALIZE);<NEW_LINE>float bw = CELL_EDITOR_BW.getFloat();<NEW_LINE>Path2D border = new Path2D.Float(Path2D.WIND_EVEN_ODD);<NEW_LINE>border.append(new Rectangle2D.Float(0, 0, r.width, r.height), false);<NEW_LINE>border.append(new Rectangle2D.Float(bw, bw, r.width - bw * 2, r.height - bw * 2), false);<NEW_LINE>Object op = ((JComponent<MASK><NEW_LINE>if (op != null || hasFocus) {<NEW_LINE>Outline outline = op == null ? Outline.focus : Outline.valueOf(op.toString());<NEW_LINE>outline.setGraphicsColor(g2, true);<NEW_LINE>g2.fill(border);<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>g2.dispose();<NEW_LINE>}<NEW_LINE>} | ) c).getClientProperty("JComponent.outline"); |
48,480 | public boolean hasChanges() {<NEW_LINE>GradleSettings settings = GradleSettings.getDefault();<NEW_LINE>GradleExperimentalSettings experimental = GradleExperimentalSettings.getDefault();<NEW_LINE>boolean isChanged = !settings.getDistributionHome().equals(tfUseCustomGradle.getText());<NEW_LINE>isChanged |= settings.isWrapperPreferred() != cbPreferWrapper.isSelected();<NEW_LINE>isChanged |= !settings.getGradleVersion().equals(String.valueOf<MASK><NEW_LINE>boolean useCustomGradle = bgUsedDistribution.getSelection() == rbUseCustomGradle.getModel();<NEW_LINE>isChanged |= settings.useCustomGradle() != useCustomGradle;<NEW_LINE>isChanged |= settings.isStartDaemonOnStart() != cbStartDaemonOnStart.isSelected();<NEW_LINE>isChanged |= settings.isSilentInstall() != cbSilentInstall.isSelected();<NEW_LINE>isChanged |= settings.isOffline() != cbOffline.isSelected();<NEW_LINE>isChanged |= settings.isConfigureOnDemand() != cbConfigureOnDemand.isSelected();<NEW_LINE>isChanged |= settings.getUseConfigCache() != cbUseConfigCache.isSelected();<NEW_LINE>isChanged |= settings.skipCheck() != cbSkipCheck.isSelected();<NEW_LINE>isChanged |= settings.skipTest() != cbSkipTest.isSelected();<NEW_LINE>isChanged |= settings.isDisplayDesctiption() != cbDisplayDescription.isSelected();<NEW_LINE>isChanged |= settings.isHideEmptyConfigurations() != cbHideEmptyConfig.isSelected();<NEW_LINE>isChanged |= settings.isAlwaysShowOutput() != cbAlwaysShowOutput.isSelected();<NEW_LINE>isChanged |= settings.isReuseOutputTabs() != cbReuseOutputTabs.isSelected();<NEW_LINE>isChanged |= settings.isReuseEditorOnStackTace() != cbReuseEditorOnStackTrace.isSelected();<NEW_LINE>isChanged |= experimental.isCacheDisabled() == cbEnableCache.isSelected();<NEW_LINE>isChanged |= experimental.isOpenLazy() != cbOpenLazy.isSelected();<NEW_LINE>isChanged |= experimental.isBundledLoading() != cbBundledLoading.isSelected();<NEW_LINE>isChanged |= settings.isPreferMaven() != cbPreferMaven.isSelected();<NEW_LINE>isChanged |= settings.getDownloadLibs() != cbDownloadLibs.getSelectedItem();<NEW_LINE>isChanged |= settings.getDownloadSources() != cbDownloadSources.getSelectedItem();<NEW_LINE>isChanged |= settings.getDownloadJavadoc() != cbDownloadJavadoc.getSelectedItem();<NEW_LINE>isChanged |= settings.getGradleExecutionRule() != cbAllowExecution.getSelectedItem();<NEW_LINE>return isChanged;<NEW_LINE>} | (cbGradleVersion.getSelectedItem())); |
1,306,665 | private List<File> filterChildren(File file) {<NEW_LINE>File[<MASK><NEW_LINE>List<File> files = new ArrayList<>();<NEW_LINE>if (fileArray != null) {<NEW_LINE>for (int i = 0; i < fileArray.length; i++) {<NEW_LINE>File f = fileArray[i];<NEW_LINE>boolean filtered;<NEW_LINE>if (f.isDirectory()) {<NEW_LINE>filtered = false;<NEW_LINE>} else {<NEW_LINE>// If there is at least one filter, only accept the file if at least one filter accepts it<NEW_LINE>filtered = filters.size() > 0;<NEW_LINE>for (int j = 0; j < filters.size(); j++) {<NEW_LINE>if (filters.get(j).accept(f)) {<NEW_LINE>filtered = false;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!filtered)<NEW_LINE>files.add(f);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return files;<NEW_LINE>} | ] fileArray = file.listFiles(); |
328,426 | public PartOfSpeechTag unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>PartOfSpeechTag partOfSpeechTag = new PartOfSpeechTag();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE><MASK><NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("Tag", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>partOfSpeechTag.setTag(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("Score", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>partOfSpeechTag.setScore(context.getUnmarshaller(Float.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return partOfSpeechTag;<NEW_LINE>} | JsonToken token = context.getCurrentToken(); |
1,595,542 | private static void printSections(PrintStream out) {<NEW_LINE>List<BaseConfigSection> configSections = ConsoleConfigSections.getInstance().getAllConfigSections(true);<NEW_LINE>out.print(String.format("%1$-" + COL_LEN_SECTION_KEY + "s", "ID"));<NEW_LINE>out.print(" \u2502 ");<NEW_LINE>out.print(String.format("%1$-" + COL_LEN_SECTION_NAME + "s", "Name"));<NEW_LINE>out.println(" \u2502Min\u2502Max\u2502 Parent");<NEW_LINE>PrintUtils.outDupChar(out, '\u2500', COL_LEN_SECTION_KEY + 1);<NEW_LINE>out.print('\u253C');<NEW_LINE>PrintUtils.outDupChar(out, '\u2500', COL_LEN_SECTION_NAME + 2);<NEW_LINE>out.print('\u253C');<NEW_LINE>PrintUtils.outDupChar(out, '\u2500', 3);<NEW_LINE>out.print('\u253C');<NEW_LINE>PrintUtils.outDupChar(out, '\u2500', 3);<NEW_LINE>out.print('\u253C');<NEW_LINE>PrintUtils.outDupChar(out, '\u2500', 12);<NEW_LINE>out.println();<NEW_LINE>for (BaseConfigSection configSection : configSections) {<NEW_LINE>if (configSection == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>out.print(String.format("%1$-" + COL_LEN_SECTION_KEY + "s", PrintUtils.getFriendlyConfigSectionID(configSection)));<NEW_LINE>out.print(" \u2502 ");<NEW_LINE>out.print(String.format("%1$-" + COL_LEN_SECTION_NAME + "s", MessageText.getString(configSection.getSectionNameKey())));<NEW_LINE>out.print(" \u2502 ");<NEW_LINE>out.print(configSection.getMinUserMode());<NEW_LINE>out.print(" \u2502 ");<NEW_LINE>out.print(configSection.getMaxUserMode());<NEW_LINE>out.print(" \u2502 ");<NEW_LINE>String parentSectionID = configSection.getParentSectionID();<NEW_LINE>if (!ConfigSection.SECTION_ROOT.equals(parentSectionID)) {<NEW_LINE>out.print(MessageText.getString(<MASK><NEW_LINE>}<NEW_LINE>out.println();<NEW_LINE>}<NEW_LINE>PrintUtils.outDupChar(out, '\u2500', COL_LEN_SECTION_KEY + 1);<NEW_LINE>out.print('\u2534');<NEW_LINE>PrintUtils.outDupChar(out, '\u2500', COL_LEN_SECTION_NAME + 2);<NEW_LINE>out.print('\u2534');<NEW_LINE>PrintUtils.outDupChar(out, '\u2500', 3);<NEW_LINE>out.print('\u2534');<NEW_LINE>PrintUtils.outDupChar(out, '\u2500', 3);<NEW_LINE>out.print('\u2534');<NEW_LINE>PrintUtils.outDupChar(out, '\u2500', 12);<NEW_LINE>out.println();<NEW_LINE>} | ConfigSectionImpl.getSectionNameKey(parentSectionID))); |
1,469,591 | private ComponentReport parse(final JSONObject object) {<NEW_LINE>final ComponentReport componentReport = new ComponentReport();<NEW_LINE>componentReport.setCoordinates(object.optString("coordinates", null));<NEW_LINE>componentReport.setDescription(object<MASK><NEW_LINE>componentReport.setReference(object.optString("references", null));<NEW_LINE>final JSONArray vulnerabilities = object.optJSONArray("vulnerabilities");<NEW_LINE>for (int i = 0; i < vulnerabilities.length(); i++) {<NEW_LINE>final JSONObject vulnObject = vulnerabilities.getJSONObject(i);<NEW_LINE>final ComponentReportVulnerability vulnerability = new ComponentReportVulnerability();<NEW_LINE>vulnerability.setId(vulnObject.optString("id", null));<NEW_LINE>vulnerability.setTitle(vulnObject.optString("title", null));<NEW_LINE>vulnerability.setDescription(vulnObject.optString("description", null));<NEW_LINE>vulnerability.setCvssScore(vulnObject.optNumber("cvssScore", null));<NEW_LINE>vulnerability.setCvssVector(vulnObject.optString("cvssVector", null));<NEW_LINE>vulnerability.setCwe(vulnObject.optString("cwe", null));<NEW_LINE>vulnerability.setCve(vulnObject.optString("cve", null));<NEW_LINE>vulnerability.setReference(vulnObject.optString("reference", null));<NEW_LINE>final JSONArray externalRefsJSONArray = vulnObject.optJSONArray("externalReferences");<NEW_LINE>final List<String> externalReferences = new ArrayList<String>();<NEW_LINE>for (int j = 0; j < externalRefsJSONArray.length(); j++) {<NEW_LINE>externalReferences.add(externalRefsJSONArray.getString(j));<NEW_LINE>}<NEW_LINE>vulnerability.setExternalReferences(externalReferences);<NEW_LINE>componentReport.addVulnerability(vulnerability);<NEW_LINE>}<NEW_LINE>return componentReport;<NEW_LINE>} | .optString("description", null)); |
837,805 | private static void scheduleReinstallHelper(Set<JSONObject> hosts, JSONObject controlInfo, final String messagePrefix, final JobCreateListener listener) {<NEW_LINE>JSONArray hostnames, profiles;<NEW_LINE>String name = "reinstall_" + hosts.iterator().next().get("hostname").isString().stringValue();<NEW_LINE>if (hosts.size() > 1) {<NEW_LINE>name += "_etc";<NEW_LINE>}<NEW_LINE>// Get the option for "Never"<NEW_LINE>JSONValue rebootBefore = staticData.getData("reboot_before_options").isArray().get(0);<NEW_LINE>JSONValue rebootAfter = staticData.getData("reboot_after_options").isArray().get(0);<NEW_LINE>JSONObject args = new JSONObject();<NEW_LINE>args.put("name", new JSONString(name));<NEW_LINE>args.put("priority", staticData.getData("default_priority"));<NEW_LINE>args.put("control_file", controlInfo.get("control_file"));<NEW_LINE>args.put("control_type", new JSONString(TestSelector.SERVER_TYPE));<NEW_LINE>args.put("synch_count", controlInfo.get("synch_count"));<NEW_LINE>args.put("timeout", staticData.getData("job_timeout_default"));<NEW_LINE>args.put("max_runtime_hrs", staticData.getData("job_max_runtime_hrs_default"));<NEW_LINE>args.put("run_verify", JSONBoolean.getInstance(false));<NEW_LINE>args.put("parse_failed_repair", JSONBoolean.getInstance(true));<NEW_LINE>args.put("reboot_before", rebootBefore);<NEW_LINE>args.put("reboot_after", rebootAfter);<NEW_LINE>hostnames = new JSONArray();<NEW_LINE>profiles = new JSONArray();<NEW_LINE>for (JSONObject h : hosts) {<NEW_LINE>hostnames.set(hostnames.size(), h.get("hostname"));<NEW_LINE>profiles.set(profiles.size(), h.get("current_profile"));<NEW_LINE>}<NEW_LINE>args.put("hosts", hostnames);<NEW_LINE>args.put("profiles", profiles);<NEW_LINE>JsonRpcProxy rpcProxy = JsonRpcProxy.getProxy();<NEW_LINE>rpcProxy.rpcCall("create_job", args, new JsonRpcCallback() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onSuccess(JSONValue result) {<NEW_LINE>NotifyManager.getInstance(<MASK><NEW_LINE>if (listener != null) {<NEW_LINE>listener.onJobCreated((int) result.isNumber().doubleValue());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | ).showMessage(messagePrefix + " scheduled for reinstall"); |
1,122,714 | void asyncExplicitLacFlush(final long explicitLac) {<NEW_LINE>final LastAddConfirmedCallback cb = LastAddConfirmedCallback.INSTANCE;<NEW_LINE>final PendingWriteLacOp op = new PendingWriteLacOp(lh, clientCtx, lh.getCurrentEnsemble(), cb, null);<NEW_LINE>op.setLac(explicitLac);<NEW_LINE>try {<NEW_LINE>if (LOG.isDebugEnabled()) {<NEW_LINE>LOG.debug("Sending Explicit LAC: {}", explicitLac);<NEW_LINE>}<NEW_LINE>clientCtx.getMainWorkerPool().submit(new SafeRunnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void safeRun() {<NEW_LINE>ByteBufList toSend = lh.macManager.<MASK><NEW_LINE>op.initiate(toSend);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} catch (RejectedExecutionException e) {<NEW_LINE>cb.addLacComplete(BookKeeper.getReturnRc(clientCtx.getBookieClient(), BKException.Code.InterruptedException), lh, null);<NEW_LINE>}<NEW_LINE>} | computeDigestAndPackageForSendingLac(lh.getLastAddConfirmed()); |
1,623,518 | final ListPackagesForDomainResult executeListPackagesForDomain(ListPackagesForDomainRequest listPackagesForDomainRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listPackagesForDomainRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListPackagesForDomainRequest> request = null;<NEW_LINE>Response<ListPackagesForDomainResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListPackagesForDomainRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listPackagesForDomainRequest));<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, "Elasticsearch Service");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListPackagesForDomain");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListPackagesForDomainResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListPackagesForDomainResultJsonUnmarshaller());<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()); |
301,510 | public void marshall(ModelPackagingJobMetadata modelPackagingJobMetadata, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (modelPackagingJobMetadata == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(modelPackagingJobMetadata.getProjectName(), PROJECTNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(modelPackagingJobMetadata.getModelVersion(), MODELVERSION_BINDING);<NEW_LINE>protocolMarshaller.marshall(modelPackagingJobMetadata.getModelPackagingJobDescription(), MODELPACKAGINGJOBDESCRIPTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(modelPackagingJobMetadata.getModelPackagingMethod(), MODELPACKAGINGMETHOD_BINDING);<NEW_LINE>protocolMarshaller.marshall(modelPackagingJobMetadata.getStatus(), STATUS_BINDING);<NEW_LINE>protocolMarshaller.marshall(modelPackagingJobMetadata.getStatusMessage(), STATUSMESSAGE_BINDING);<NEW_LINE>protocolMarshaller.marshall(modelPackagingJobMetadata.getCreationTimestamp(), CREATIONTIMESTAMP_BINDING);<NEW_LINE>protocolMarshaller.marshall(modelPackagingJobMetadata.getLastUpdatedTimestamp(), LASTUPDATEDTIMESTAMP_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | modelPackagingJobMetadata.getJobName(), JOBNAME_BINDING); |
1,853 | private OptimizerStats execImpl(OptimizerContext optimizerCtx) {<NEW_LINE>OptimizerStats stats = new OptimizerStats(NAME);<NEW_LINE>FindStaticDispatchSitesVisitor finder = new FindStaticDispatchSitesVisitor();<NEW_LINE>Set<JMethod> modifiedMethods = optimizerCtx.getModifiedMethodsSince(optimizerCtx.getLastStepFor(NAME));<NEW_LINE>Set<JMethod> affectedMethods = affectedMethods(modifiedMethods, optimizerCtx);<NEW_LINE>optimizerCtx.traverse(finder, affectedMethods);<NEW_LINE>CreateStaticImplsVisitor creator <MASK><NEW_LINE>for (JMethod method : toBeMadeStatic) {<NEW_LINE>creator.accept(method);<NEW_LINE>}<NEW_LINE>for (JMethod method : toBeMadeStatic) {<NEW_LINE>// if method has specialization, add it to the static method<NEW_LINE>Specialization specialization = method.getSpecialization();<NEW_LINE>if (specialization != null) {<NEW_LINE>JMethod staticMethod = program.getStaticImpl(method);<NEW_LINE>List<JType> params = Lists.newArrayList(specialization.getParams());<NEW_LINE>params.add(0, staticMethod.getParams().get(0).getType());<NEW_LINE>staticMethod.setSpecialization(params, specialization.getReturns(), staticMethod.getName());<NEW_LINE>staticMethod.getSpecialization().resolve(params, specialization.getReturns(), program.getStaticImpl(specialization.getTargetMethod()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>RewriteCallSites rewriter = new RewriteCallSites(optimizerCtx);<NEW_LINE>rewriter.accept(program);<NEW_LINE>stats.recordModified(rewriter.getNumMods());<NEW_LINE>assert (rewriter.didChange() || toBeMadeStatic.isEmpty());<NEW_LINE>JavaAstVerifier.assertProgramIsConsistent(program);<NEW_LINE>return stats;<NEW_LINE>} | = new CreateStaticImplsVisitor(program, optimizerCtx); |
777,873 | protected boolean doTokensMatchPattern(List<Token> previousTokens, Token current, Pattern regex) {<NEW_LINE>ArrayList<String> tokenStrings = new ArrayList<>();<NEW_LINE>tokenStrings.add(current.getText());<NEW_LINE>for (int i = previousTokens.size() - 1; i >= 0; i--) {<NEW_LINE>Token prevToken = previousTokens.get(i);<NEW_LINE>if (prevToken.getParensDepth() != current.getParensDepth()) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>if (prevToken.getType() == TokenType.KEYWORD) {<NEW_LINE>tokenStrings.add(prevToken.getText());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>StringBuilder builder = new StringBuilder();<NEW_LINE>for (int i = tokenStrings.size() - 1; i >= 0; i--) {<NEW_LINE>builder.append<MASK><NEW_LINE>if (i != 0) {<NEW_LINE>builder.append(" ");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return regex.matcher(builder.toString()).matches();<NEW_LINE>} | (tokenStrings.get(i)); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.