idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
936,003
private static void quickSort(Comparable[] array, int low, int high) {<NEW_LINE>Stack<QuickSortRange> stack = new Stack<>();<NEW_LINE>QuickSortRange quickSortRange = new QuickSortRange(low, high);<NEW_LINE>stack.push(quickSortRange);<NEW_LINE>while (stack.size() > 0) {<NEW_LINE>QuickSortRange currentQuickSortRange = stack.pop();<NEW_LINE>int partition = partition(array, currentQuickSortRange.low, currentQuickSortRange.high);<NEW_LINE>QuickSortRange leftQuickSortRange = new QuickSortRange(currentQuickSortRange.low, partition - 1);<NEW_LINE>QuickSortRange rightQuickSortRange = new QuickSortRange(<MASK><NEW_LINE>// Size = right - left + 1<NEW_LINE>int leftSubArraySize = partition - currentQuickSortRange.low;<NEW_LINE>int rightSubArraySize = currentQuickSortRange.high - partition;<NEW_LINE>// Push the larger sub array first to guarantee that the stack will have at most lg N entries<NEW_LINE>if (leftSubArraySize > rightSubArraySize) {<NEW_LINE>if (leftSubArraySize > 1) {<NEW_LINE>stack.push(leftQuickSortRange);<NEW_LINE>}<NEW_LINE>if (rightSubArraySize > 1) {<NEW_LINE>stack.push(rightQuickSortRange);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (rightSubArraySize > 1) {<NEW_LINE>stack.push(rightQuickSortRange);<NEW_LINE>}<NEW_LINE>if (leftSubArraySize > 1) {<NEW_LINE>stack.push(leftQuickSortRange);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
partition + 1, currentQuickSortRange.high);
659,841
public boolean removeByURLHash(final byte[] urlhashBytes) {<NEW_LINE>try {<NEW_LINE>final HandleSet urlHashes = new RowHandleSet(Word.<MASK><NEW_LINE>urlHashes.put(urlhashBytes);<NEW_LINE>boolean ret = false;<NEW_LINE>try {<NEW_LINE>ret |= this.noloadStack.remove(urlHashes) > 0;<NEW_LINE>} catch (final IOException e) {<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>ret |= this.coreStack.remove(urlHashes) > 0;<NEW_LINE>} catch (final IOException e) {<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>ret |= this.limitStack.remove(urlHashes) > 0;<NEW_LINE>} catch (final IOException e) {<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>ret |= this.remoteStack != null && this.remoteStack.remove(urlHashes) > 0;<NEW_LINE>} catch (final IOException e) {<NEW_LINE>}<NEW_LINE>return ret;<NEW_LINE>} catch (final SpaceExceededException e) {<NEW_LINE>ConcurrentLog.logException(e);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}
commonHashLength, Base64Order.enhancedCoder, 1);
1,325,818
public void onTrainingEnd(Trainer trainer) {<NEW_LINE>Metrics metrics = trainer.getMetrics();<NEW_LINE>if (metrics == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>float p50;<NEW_LINE>float p90;<NEW_LINE>if (metrics.hasMetric("train")) {<NEW_LINE>// possible no train metrics if only one iteration is executed<NEW_LINE>p50 = metrics.percentile("train", 50).getValue().longValue() / 1_000_000f;<NEW_LINE>p90 = metrics.percentile("train", 90).getValue().longValue() / 1_000_000f;<NEW_LINE>logger.info(String.format("train P50: %.3f ms, P90: %.3f ms", p50, p90));<NEW_LINE>}<NEW_LINE>if (metrics.hasMetric("forward")) {<NEW_LINE>p50 = metrics.percentile("forward", 50).getValue().longValue() / 1_000_000f;<NEW_LINE>p90 = metrics.percentile("forward", 90).getValue().longValue() / 1_000_000f;<NEW_LINE>logger.info(String.format("forward P50: %.3f ms, P90: %.3f ms", p50, p90));<NEW_LINE>}<NEW_LINE>if (metrics.hasMetric("training-metrics")) {<NEW_LINE>p50 = metrics.percentile("training-metrics", 50).getValue().longValue() / 1_000_000f;<NEW_LINE>p90 = metrics.percentile("training-metrics", 90).getValue().longValue() / 1_000_000f;<NEW_LINE>logger.info(String.format("training-metrics P50: %.3f ms, P90: %.3f ms", p50, p90));<NEW_LINE>}<NEW_LINE>if (metrics.hasMetric("backward")) {<NEW_LINE>p50 = metrics.percentile("backward", 50).getValue().longValue() / 1_000_000f;<NEW_LINE>p90 = metrics.percentile("backward", 90).getValue().longValue() / 1_000_000f;<NEW_LINE>logger.info(String.format("backward P50: %.3f ms, P90: %.3f ms", p50, p90));<NEW_LINE>}<NEW_LINE>if (metrics.hasMetric("step")) {<NEW_LINE>p50 = metrics.percentile("step", 50).getValue().longValue() / 1_000_000f;<NEW_LINE>p90 = metrics.percentile("step", 90).getValue().longValue() / 1_000_000f;<NEW_LINE>logger.info(String.format("step P50: %.3f ms, P90: %.3f ms", p50, p90));<NEW_LINE>}<NEW_LINE>if (metrics.hasMetric("epoch")) {<NEW_LINE>p50 = metrics.percentile("epoch", 50).getValue().longValue() / 1_000_000_000f;<NEW_LINE>p90 = metrics.percentile("epoch", 90).getValue().longValue() / 1_000_000_000f;<NEW_LINE>logger.info(String.format<MASK><NEW_LINE>}<NEW_LINE>}
("epoch P50: %.3f s, P90: %.3f s", p50, p90));
490,575
public void linkActivated(String target) {<NEW_LINE>if (target.startsWith(OPEN)) {<NEW_LINE>String file = target.substring(OPEN.length());<NEW_LINE>// check if file is already opened somewhere<NEW_LINE>java.util.Optional<MPart> part = //<NEW_LINE>partService.getParts().stream().//<NEW_LINE>filter(p -> UIConstants.Part.PORTFOLIO.equals(p.getElementId())).filter(p -> file.equals(p.getPersistedState().get(UIConstants.PersistedState.FILENAME))).findAny();<NEW_LINE>if (part.isPresent())<NEW_LINE>partService.activate(part.get());<NEW_LINE>else<NEW_LINE>executeCommand(UIConstants.Command.OPEN_RECENT_FILE, <MASK><NEW_LINE>} else if (// $NON-NLS-1$<NEW_LINE>"action:open".equals(target)) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>executeCommand("name.abuchen.portfolio.ui.command.open");<NEW_LINE>} else if (// $NON-NLS-1$<NEW_LINE>"action:new".equals(target)) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>executeCommand("name.abuchen.portfolio.ui.command.newclient");<NEW_LINE>} else if (// $NON-NLS-1$<NEW_LINE>"action:sample".equals(target)) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>// $NON-NLS-1$<NEW_LINE>executeCommand(//<NEW_LINE>"name.abuchen.portfolio.ui.command.openSample", // $NON-NLS-1$ //$NON-NLS-2$<NEW_LINE>UIConstants.Parameter.SAMPLE_FILE, "/" + getClass().getPackage().getName().replace('.', '/') + "/kommer.xml");<NEW_LINE>} else if (// $NON-NLS-1$<NEW_LINE>"action:daxsample".equals(target)) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>// $NON-NLS-1$<NEW_LINE>executeCommand(//<NEW_LINE>"name.abuchen.portfolio.ui.command.openSample", // $NON-NLS-1$ //$NON-NLS-2$<NEW_LINE>UIConstants.Parameter.SAMPLE_FILE, "/" + getClass().getPackage().getName().replace('.', '/') + "/dax.xml");<NEW_LINE>} else if (// $NON-NLS-1$<NEW_LINE>"action:opensettings".equals(target)) {<NEW_LINE>executeCommand(UIConstants.Command.PREFERENCES);<NEW_LINE>} else if (// $NON-NLS-1$<NEW_LINE>target.startsWith("http")) {<NEW_LINE>DesktopAPI.browse(target);<NEW_LINE>}<NEW_LINE>}
UIConstants.Parameter.FILE, file);
306,458
private String readFileFromUri(ReactContext reactContext, Uri uri) {<NEW_LINE>if (uri == null)<NEW_LINE>return null;<NEW_LINE>String filePath = null;<NEW_LINE>if (uri.getScheme().equals("content")) {<NEW_LINE>ContentResolver resolver = reactContext.getContentResolver();<NEW_LINE>String mimeType = resolver.getType(uri);<NEW_LINE>String extension = MimeTypeMap.getSingleton().getExtensionFromMimeType(mimeType);<NEW_LINE>// Load the filename from the resolver.<NEW_LINE>// Of course, Android makes this super clean and easy.<NEW_LINE>// Use a GUID default.<NEW_LINE>String filename = String.format("%s.%s", UUID.randomUUID().toString(), extension);<NEW_LINE>String[] nameProjection = { MediaStore.MediaColumns.DISPLAY_NAME };<NEW_LINE>Cursor cursor = resolver.query(uri, nameProjection, null, null, null);<NEW_LINE>if (cursor != null) {<NEW_LINE>try {<NEW_LINE>if (cursor.moveToFirst()) {<NEW_LINE>filename = cursor.getString(0);<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>cursor.close();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int cut = filename.lastIndexOf('/');<NEW_LINE>if (cut != -1) {<NEW_LINE>filename = filename.substring(cut + 1);<NEW_LINE>}<NEW_LINE>// Now load the file itself.<NEW_LINE>File file = new File(reactContext.getCacheDir(), filename);<NEW_LINE>try {<NEW_LINE>InputStream istream = resolver.openInputStream(uri);<NEW_LINE><MASK><NEW_LINE>byte[] buf = new byte[64 * 1024];<NEW_LINE>int len;<NEW_LINE>while ((len = istream.read(buf)) != -1) {<NEW_LINE>ostream.write(buf, 0, len);<NEW_LINE>}<NEW_LINE>filePath = file.getPath();<NEW_LINE>} catch (IOException ex) {<NEW_LINE>Log.w(TAG, "error writing shared file " + uri.toString());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>filePath = uri.getPath();<NEW_LINE>}<NEW_LINE>return filePath;<NEW_LINE>}
OutputStream ostream = new FileOutputStream(file);
1,752,499
public DockerClient providesDockerClient(SingularityExecutorConfiguration configuration) {<NEW_LINE>Builder dockerClientBuilder = DefaultDockerClient.builder().uri(URI.create("unix://localhost/var/run/docker.sock")).connectionPoolSize(configuration.getDockerClientConnectionPoolSize());<NEW_LINE>if (configuration.getDockerAuthConfig().isPresent()) {<NEW_LINE>SingularityExecutorDockerAuthConfig authConfig = configuration<MASK><NEW_LINE>if (authConfig.isFromDockerConfig()) {<NEW_LINE>try {<NEW_LINE>dockerClientBuilder.registryAuth(RegistryAuth.fromDockerConfig().build());<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>dockerClientBuilder.registryAuth(RegistryAuth.builder().email(authConfig.getEmail()).username(authConfig.getUsername()).password(authConfig.getPassword()).serverAddress(authConfig.getServerAddress()).build());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return dockerClientBuilder.build();<NEW_LINE>}
.getDockerAuthConfig().get();
781,383
public void startPhantomJS() {<NEW_LINE>String mainScriptTempName = director.getScriptManager().getScriptFilename(PhantomJS.MAIN_SCRIPT_RESOURCE);<NEW_LINE>String listenAddress = listenURI.getHost() + ":" + listenURI.getPort();<NEW_LINE>int idleTimeout = director.getProcessIdleTimeout();<NEW_LINE>List<String> command = new ArrayList<>();<NEW_LINE>command.<MASK><NEW_LINE>String options = "";<NEW_LINE>if (director.getOptions() != null) {<NEW_LINE>for (PropertySuffix suffix : director.getOptions()) {<NEW_LINE>String option = suffix.getValue();<NEW_LINE>if (option != null && !option.trim().isEmpty()) {<NEW_LINE>command.add(option.trim());<NEW_LINE>options += option.trim() + " ";<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>command.add(mainScriptTempName);<NEW_LINE>command.add("-listenAddress");<NEW_LINE>command.add(listenAddress);<NEW_LINE>command.add("-confirmMessage");<NEW_LINE>command.add(PHANTOMJS_CONFIRMATION_MESSAGE);<NEW_LINE>command.add("-idleTimeout");<NEW_LINE>command.add(Integer.toString(idleTimeout));<NEW_LINE>log.info("PhantomJS process " + id + " starting on port " + listenURI.getPort());<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug(id + " starting phantomjs process with command: " + director.getPhantomjsExecutablePath() + options + " \"" + mainScriptTempName + "\"" + " -listenAddress \"" + listenAddress + "\"" + " -confirmMessage \"" + PHANTOMJS_CONFIRMATION_MESSAGE + "\"" + " -idleTimeout " + idleTimeout + "");<NEW_LINE>}<NEW_LINE>ProcessBuilder pb = new ProcessBuilder(command);<NEW_LINE>pb.redirectErrorStream(false);<NEW_LINE>pb.directory(director.getScriptManager().getTempFolder());<NEW_LINE>try {<NEW_LINE>process = pb.start();<NEW_LINE>ProcessOutputReader outputReader = new ProcessOutputReader(this);<NEW_LINE>outputReader.start();<NEW_LINE>boolean started = outputReader.waitConfirmation(director.getProcessStartTimeout());<NEW_LINE>if (!started) {<NEW_LINE>// TODO lucianc write error output<NEW_LINE>log.error("PhantomJS process " + id + " failed to start");<NEW_LINE>process.destroy();<NEW_LINE>throw new JRRuntimeException(EXCEPTION_MESSAGE_KEY_FAILED_START, (Object[]) null);<NEW_LINE>}<NEW_LINE>processConnection = new ProcessConnection(director, this);<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new JRRuntimeException(e);<NEW_LINE>}<NEW_LINE>}
add(director.getPhantomjsExecutablePath());
1,515,800
private // Instance Methods:<NEW_LINE>Path localizeCosmicDbFileIfRemote(final Path cosmicDbPathMaybeRemote) {<NEW_LINE>// Is the path local or in the cloud:<NEW_LINE>if (cosmicDbPathMaybeRemote.getFileSystem().equals(FileSystems.getDefault())) {<NEW_LINE>// local path, just return it:<NEW_LINE>return cosmicDbPathMaybeRemote;<NEW_LINE>}<NEW_LINE>// Not a local path! We must localize it!<NEW_LINE>// Create a place for the files:<NEW_LINE>final File <MASK><NEW_LINE>tmpDir.deleteOnExit();<NEW_LINE>final Path tmpDirPath = tmpDir.toPath();<NEW_LINE>// Create paths to the fasta, fasta index, and the sequence dictionary:<NEW_LINE>final Path localCosmicDbFilePath = tmpDirPath.resolve(LOCAL_COSMIC_DB_FILE_NAME);<NEW_LINE>// Copy the files to our local machine:<NEW_LINE>logger.info("Localizing Cosmic db file for compatibility and faster lookup times...");<NEW_LINE>// Copy DB:<NEW_LINE>NioFileCopierWithProgressMeter.create(cosmicDbPathMaybeRemote, localCosmicDbFilePath, true).initiateCopy();<NEW_LINE>// Bye Bye!<NEW_LINE>return localCosmicDbFilePath;<NEW_LINE>}
tmpDir = IOUtils.createTempDir(LOCAL_COSMIC_DB_TMP_DIR_PREFIX);
838,630
static double powerSeries(double a, double b, double x) throws ArithmeticException {<NEW_LINE>double s, t, u, v<MASK><NEW_LINE>ai = 1.0 / a;<NEW_LINE>u = (1.0 - b) * x;<NEW_LINE>v = u / (a + 1.0);<NEW_LINE>t1 = v;<NEW_LINE>t = u;<NEW_LINE>n = 2.0;<NEW_LINE>s = 0.0;<NEW_LINE>z = MACHEP * ai;<NEW_LINE>while (Math.abs(v) > z) {<NEW_LINE>u = (n - b) * x / n;<NEW_LINE>t *= u;<NEW_LINE>v = t / (a + n);<NEW_LINE>s += v;<NEW_LINE>n += 1.0;<NEW_LINE>}<NEW_LINE>s += t1;<NEW_LINE>s += ai;<NEW_LINE>u = a * Math.log(x);<NEW_LINE>if ((a + b) < MAXGAM && Math.abs(u) < MAXLOG) {<NEW_LINE>t = GammaFunctions.gamma(a + b) / (GammaFunctions.gamma(a) * GammaFunctions.gamma(b));<NEW_LINE>s = s * t * Math.pow(x, a);<NEW_LINE>} else {<NEW_LINE>t = GammaFunctions.logGamma(a + b) - GammaFunctions.logGamma(a) - GammaFunctions.logGamma(b) + u + Math.log(s);<NEW_LINE>if (t < MINLOG)<NEW_LINE>s = 0.0;<NEW_LINE>else<NEW_LINE>s = Math.exp(t);<NEW_LINE>}<NEW_LINE>return s;<NEW_LINE>}
, n, t1, z, ai;
95,711
private void saveState() {<NEW_LINE>if (chunks.size() < 1)<NEW_LINE>return;<NEW_LINE>StringBuffer sb = new StringBuffer();<NEW_LINE>sb.append(this.length + "\n");<NEW_LINE>sb.append(downloaded + "\n");<NEW_LINE>sb.append(((long) this.totalDuration) + "\n");<NEW_LINE>sb.append(urlList.size() + "\n");<NEW_LINE>for (int i = 0; i < urlList.size(); i++) {<NEW_LINE>String <MASK><NEW_LINE>sb.append(url + "\n");<NEW_LINE>}<NEW_LINE>sb.append(chunks.size() + "\n");<NEW_LINE>for (int i = 0; i < chunks.size(); i++) {<NEW_LINE>Segment seg = chunks.get(i);<NEW_LINE>sb.append(seg.getId() + "\n");<NEW_LINE>if (seg.isFinished()) {<NEW_LINE>sb.append(seg.getLength() + "\n");<NEW_LINE>sb.append(seg.getStartOffset() + "\n");<NEW_LINE>sb.append(seg.getDownloaded() + "\n");<NEW_LINE>} else {<NEW_LINE>sb.append("-1\n");<NEW_LINE>sb.append(seg.getStartOffset() + "\n");<NEW_LINE>sb.append(seg.getDownloaded() + "\n");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!StringUtils.isNullOrEmptyOrBlank(lastModified)) {<NEW_LINE>sb.append(this.lastModified + "\n");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>File tmp = new File(folder, System.currentTimeMillis() + ".tmp");<NEW_LINE>File out = new File(folder, "state.txt");<NEW_LINE>FileOutputStream fs = new FileOutputStream(tmp);<NEW_LINE>fs.write(sb.toString().getBytes());<NEW_LINE>fs.close();<NEW_LINE>out.delete();<NEW_LINE>tmp.renameTo(out);<NEW_LINE>} catch (Exception e) {<NEW_LINE>Logger.log(e);<NEW_LINE>}<NEW_LINE>}
url = urlList.get(i);
505,449
private final void accept0(CreateTableImpl query) {<NEW_LINE>Table<?> table = query.$table();<NEW_LINE>MutableSchema schema = getSchema(table.getSchema(), true);<NEW_LINE>// TODO We're doing this all the time. Can this be factored out without adding too much abstraction?<NEW_LINE>MutableTable <MASK><NEW_LINE>if (existing != null) {<NEW_LINE>if (!query.$ifNotExists())<NEW_LINE>throw alreadyExists(table, existing);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>MutableTable mt = newTable(table, schema, query.$columns(), query.$select(), query.$comment(), query.$temporary() ? TableOptions.temporaryTable(query.$onCommit()) : TableOptions.table());<NEW_LINE>for (Constraint constraint : query.$constraints()) addConstraint(query, (ConstraintImpl) constraint, mt);<NEW_LINE>for (Index index : query.$indexes()) {<NEW_LINE>IndexImpl impl = (IndexImpl) index;<NEW_LINE>mt.indexes.add(new MutableIndex((UnqualifiedName) impl.getUnqualifiedName(), mt, mt.sortFields(asList(impl.$fields())), impl.$unique(), impl.$where()));<NEW_LINE>}<NEW_LINE>}
existing = schema.table(table);
1,669,841
private void loadLocalizations() throws Exception {<NEW_LINE>PathMatchingResourcePatternResolver resourcePatternResolver = new PathMatchingResourcePatternResolver(this.<MASK><NEW_LINE>String filePattern = "ors_(.*?)(\\.default)?.resources";<NEW_LINE>String resourcePattern = "/resources/**/ors_*.resources";<NEW_LINE>Resource[] resources = resourcePatternResolver.getResources(resourcePattern);<NEW_LINE>Pattern pattern = Pattern.compile(filePattern);<NEW_LINE>if (resources.length == 0)<NEW_LINE>throw new Exception("Resources can not be found.");<NEW_LINE>for (Resource res : resources) {<NEW_LINE>File file = res.getFile();<NEW_LINE>if (file.isFile()) {<NEW_LINE>Matcher matcher = pattern.matcher(file.getName());<NEW_LINE>if (matcher.find()) {<NEW_LINE>loadLocalization(matcher.group(1).toLowerCase(), file, matcher.group(2) != null);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
getClass().getClassLoader());
595,500
private void postProcessLog(final CaptureLog originalLog, final ICodeGenerator<?> generator, final Set<Class<?>> blackList, CaptureLog log, int[] oidExchange, final Class<?>... observedClasses) throws RuntimeException {<NEW_LINE>if (oidExchange == null) {<NEW_LINE>generator.after(log);<NEW_LINE>} else {<NEW_LINE>try {<NEW_LINE>final Class<?> origClass = this.getClassFromOID(log, oidExchange[0]);<NEW_LINE>final Class<?> destClass = this.getClassFromOID<MASK><NEW_LINE>for (int i = 0; i < observedClasses.length; i++) {<NEW_LINE>if (origClass.equals(observedClasses[i])) {<NEW_LINE>observedClasses[i] = destClass;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>generator.clear();<NEW_LINE>this.analyze(originalLog, generator, blackList, observedClasses);<NEW_LINE>} catch (final Exception e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
(log, oidExchange[1]);
1,737,015
public Object read(final InputStream is) {<NEW_LINE>final ART1 result = new ART1();<NEW_LINE>final EncogReadHelper in = new EncogReadHelper(is);<NEW_LINE>EncogFileSection section;<NEW_LINE>while ((section = in.readNextSection()) != null) {<NEW_LINE>if (section.getSectionName().equals("ART1") && section.getSubSectionName().equals("PARAMS")) {<NEW_LINE>final Map<String, String> params = section.parseParams();<NEW_LINE>result.getProperties().putAll(params);<NEW_LINE>}<NEW_LINE>if (section.getSectionName().equals("ART1") && section.getSubSectionName().equals("NETWORK")) {<NEW_LINE>final Map<String, String> params = section.parseParams();<NEW_LINE>result.setA1(EncogFileSection.parseDouble(params, ART.PROPERTY_A1));<NEW_LINE>result.setB1(EncogFileSection.parseDouble(params, ART.PROPERTY_B1));<NEW_LINE>result.setC1(EncogFileSection.parseDouble(params, ART.PROPERTY_C1));<NEW_LINE>result.setD1(EncogFileSection.parseDouble(params, ART.PROPERTY_D1));<NEW_LINE>result.setF1Count(EncogFileSection.parseInt(params, PersistConst.PROPERTY_F1_COUNT));<NEW_LINE>result.setF2Count(EncogFileSection.parseInt(params, PersistConst.PROPERTY_F2_COUNT));<NEW_LINE>result.setNoWinner(EncogFileSection.parseInt(params, ART.PROPERTY_NO_WINNER));<NEW_LINE>result.setL(EncogFileSection.parseDouble<MASK><NEW_LINE>result.setVigilance(EncogFileSection.parseDouble(params, ART.PROPERTY_VIGILANCE));<NEW_LINE>result.setWeightsF1toF2(EncogFileSection.parseMatrix(params, PersistConst.PROPERTY_WEIGHTS_F1_F2));<NEW_LINE>result.setWeightsF2toF1(EncogFileSection.parseMatrix(params, PersistConst.PROPERTY_WEIGHTS_F2_F1));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
(params, ART.PROPERTY_L));
1,805,881
private void initializeDatabaseMetadata(List<Integer> partitions) throws SQLException, SchemaGenerationException {<NEW_LINE>// Verify the partitions are valid.<NEW_LINE>_numPartitions = _databaseSource.getPartitionCount();<NEW_LINE>partitions.forEach(p -> Validate.isTrue(p <MASK><NEW_LINE>_databaseSource.getPrimaryKeyFields(_table).forEach(k -> _chunkingKeys.put(k, null));<NEW_LINE>if (_chunkingKeys.isEmpty()) {<NEW_LINE>_metrics.updateErrorRate();<NEW_LINE>// There can be tables without primary keys. Let user to handle it.<NEW_LINE>String msg = "Failed to get primary keys for table " + _table + ". Cannot chunk without it";<NEW_LINE>throw new DatastreamRuntimeException(msg, new InvalidKeyException());<NEW_LINE>}<NEW_LINE>_tableSchema = _databaseSource.getTableSchema(_table);<NEW_LINE>if (_tableSchema == null) {<NEW_LINE>ErrorLogger.logAndThrowDatastreamRuntimeException(LOG, "Failed to get schema for table " + _table);<NEW_LINE>}<NEW_LINE>}
>= 0 && p < _numPartitions));
1,243,921
private boolean isEmptyDirectory(URI uri) throws IOException {<NEW_LINE>if (!isDirectory(uri)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>String prefix = normalizeToDirectoryPrefix(uri);<NEW_LINE>boolean isEmpty = true;<NEW_LINE>ListObjectsV2Response listObjectsV2Response;<NEW_LINE>ListObjectsV2Request.Builder listObjectsV2RequestBuilder = ListObjectsV2Request.builder().bucket(uri.getHost());<NEW_LINE>if (!prefix.equals(DELIMITER)) {<NEW_LINE>listObjectsV2RequestBuilder = listObjectsV2RequestBuilder.prefix(prefix);<NEW_LINE>}<NEW_LINE>ListObjectsV2Request listObjectsV2Request = listObjectsV2RequestBuilder.build();<NEW_LINE><MASK><NEW_LINE>for (S3Object s3Object : listObjectsV2Response.contents()) {<NEW_LINE>if (s3Object.key().equals(prefix)) {<NEW_LINE>continue;<NEW_LINE>} else {<NEW_LINE>isEmpty = false;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return isEmpty;<NEW_LINE>}
listObjectsV2Response = _s3Client.listObjectsV2(listObjectsV2Request);
1,313,661
public boolean createTenantVDCIngressAclRule(String tenantName, long ruleId, String policyIdentifier, String protocol, String sourceStartIp, String sourceEndIp, String destStartPort, String destEndPort) throws ExecutionException {<NEW_LINE>String xml = VnmcXml.CREATE_INGRESS_ACL_RULE.getXml();<NEW_LINE>String service = VnmcXml.CREATE_INGRESS_ACL_RULE.getService();<NEW_LINE>String <MASK><NEW_LINE>xml = replaceXmlValue(xml, "cookie", _cookie);<NEW_LINE>xml = replaceXmlValue(xml, "aclruledn", getDnForAclRule(tenantName, identifier, policyIdentifier));<NEW_LINE>xml = replaceXmlValue(xml, "aclrulename", getNameForAclRule(tenantName, identifier));<NEW_LINE>xml = replaceXmlValue(xml, "descr", "Ingress ACL rule for Tenant VDC " + tenantName);<NEW_LINE>xml = replaceXmlValue(xml, "actiontype", "permit");<NEW_LINE>xml = replaceXmlValue(xml, "protocolvalue", protocol);<NEW_LINE>xml = replaceXmlValue(xml, "sourcestartip", sourceStartIp);<NEW_LINE>xml = replaceXmlValue(xml, "sourceendip", sourceEndIp);<NEW_LINE>xml = replaceXmlValue(xml, "deststartport", destStartPort);<NEW_LINE>xml = replaceXmlValue(xml, "destendport", destEndPort);<NEW_LINE>long order = 100 + ruleId;<NEW_LINE>xml = replaceXmlValue(xml, "order", Long.toString(order));<NEW_LINE>String response = sendRequest(service, xml);<NEW_LINE>return verifySuccess(response);<NEW_LINE>}
identifier = Long.toString(ruleId);
414,244
public <T> void validateAndSetDefaults(ClassCacheMgr cacheMgr, CFMappingDef<T> cfMapDef) {<NEW_LINE>KeyDefinition keyDef = cfMapDef.getKeyDef();<NEW_LINE>if (null == keyDef.getPkClazz()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Map<String, PropertyDescriptor> pdMap;<NEW_LINE>try {<NEW_LINE>pdMap = cacheMgr.getFieldPropertyDescriptorMap(keyDef.getPkClazz());<NEW_LINE>} catch (IntrospectionException e) {<NEW_LINE>throw new HectorObjectMapperException("exception while introspecting class, " + keyDef.getPkClazz().getName(), e);<NEW_LINE>}<NEW_LINE>if (keyDef.getIdPropertyMap().size() != pdMap.size()) {<NEW_LINE>throw new HectorObjectMapperException("Each field in the primary key class, " + keyDef.getPkClazz().getName() + ", must have a corresponding property in the entity, " + cfMapDef.getRealClass().getName() + ", annotated with @" + <MASK><NEW_LINE>}<NEW_LINE>for (String idFieldName : pdMap.keySet()) {<NEW_LINE>if (!keyDef.getIdPropertyMap().containsKey(idFieldName)) {<NEW_LINE>throw new HectorObjectMapperException("Each field in the primary key class, " + keyDef.getPkClazz().getName() + ", must have a corresponding property in the entity, " + cfMapDef.getRealClass().getName() + ", annotated with @" + Id.class.getSimpleName() + " : missing ID field, " + idFieldName);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
Id.class.getSimpleName());
1,510,860
private Chunk createTextChunk(String text, boolean pageNumber, Font currentRunFont, UnderlinePatterns currentRunUnderlinePatterns, Color currentRunBackgroundColor) {<NEW_LINE>// Chunk textChunk =<NEW_LINE>// pageNumber ? new ExtendedChunk( pdfDocument, true, currentRunFont ) :<NEW_LINE>// new Chunk( text, currentRunFont );<NEW_LINE>Chunk textChunk = null;<NEW_LINE>if (processingTotalPageCountField && expectedPageCount != null) {<NEW_LINE>textChunk = new Chunk(String.valueOf(expectedPageCount), currentRunFont);<NEW_LINE>} else {<NEW_LINE>textChunk = pageNumber ? new ExtendedChunk(pdfDocument, true, currentRunFont) : new Chunk(text, currentRunFont);<NEW_LINE>}<NEW_LINE>if (currentRunUnderlinePatterns != null) {<NEW_LINE>// underlined<NEW_LINE>boolean singleUnderlined = false;<NEW_LINE>switch(currentRunUnderlinePatterns) {<NEW_LINE>case SINGLE:<NEW_LINE>singleUnderlined = true;<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>if (singleUnderlined) {<NEW_LINE>textChunk.setUnderline(1, -2);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// background color<NEW_LINE>if (currentRunBackgroundColor != null) {<NEW_LINE>textChunk.setBackground<MASK><NEW_LINE>}<NEW_LINE>if (currentRunX != null) {<NEW_LINE>this.currentRunX += textChunk.getWidthPoint();<NEW_LINE>}<NEW_LINE>return textChunk;<NEW_LINE>}
(Converter.toBaseColor(currentRunBackgroundColor));
1,209,329
public InitiatedLinkedAccount initiateLinkedAccount(LinkedAccountType accountType, String redirectUri, String nonce) {<NEW_LINE>String authServerRootUrl = config.getKeycloakAuthUrl();<NEW_LINE>String realm = config.getKeycloakRealm();<NEW_LINE><MASK><NEW_LINE>KeycloakSecurityContext session = (KeycloakSecurityContext) request.getAttribute(KeycloakSecurityContext.class.getName());<NEW_LINE>AccessToken token = session.getToken();<NEW_LINE>String clientId = token.getIssuedFor();<NEW_LINE>MessageDigest md = null;<NEW_LINE>try {<NEW_LINE>md = MessageDigest.getInstance("SHA-256");<NEW_LINE>} catch (NoSuchAlgorithmException e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>String input = nonce + token.getSessionState() + clientId + provider;<NEW_LINE>byte[] check = md.digest(input.getBytes(StandardCharsets.UTF_8));<NEW_LINE>String hash = Base64Url.encode(check);<NEW_LINE>String accountLinkUrl = KeycloakUriBuilder.fromUri(authServerRootUrl).path("/realms/{realm}/broker/{provider}/link").queryParam("nonce", nonce).queryParam("hash", hash).queryParam("client_id", clientId).queryParam("redirect_uri", redirectUri).build(realm, provider).toString();<NEW_LINE>logger.debug("Account Link URL: {}", accountLinkUrl);<NEW_LINE>// Return the URL that the browser should use to initiate the account linking<NEW_LINE>InitiatedLinkedAccount rval = new InitiatedLinkedAccount();<NEW_LINE>rval.setAuthUrl(accountLinkUrl);<NEW_LINE>rval.setNonce(nonce);<NEW_LINE>return rval;<NEW_LINE>}
String provider = accountType.alias();
157,485
protected void onSaveInstanceState(Bundle outState) {<NEW_LINE>if (mWorkspace.getChildCount() > 0) {<NEW_LINE>outState.putInt(RUNTIME_STATE_CURRENT_SCREEN, mWorkspace.getNextPage());<NEW_LINE>}<NEW_LINE>outState.putInt(RUNTIME_STATE, mStateManager.getState().ordinal);<NEW_LINE>AbstractFloatingView widgets = AbstractFloatingView.getOpenView(this, AbstractFloatingView.TYPE_WIDGETS_FULL_SHEET);<NEW_LINE>if (widgets != null) {<NEW_LINE>SparseArray<Parcelable> <MASK><NEW_LINE>widgets.saveHierarchyState(widgetsState);<NEW_LINE>outState.putSparseParcelableArray(RUNTIME_STATE_WIDGET_PANEL, widgetsState);<NEW_LINE>} else {<NEW_LINE>outState.remove(RUNTIME_STATE_WIDGET_PANEL);<NEW_LINE>}<NEW_LINE>// We close any open folders and shortcut containers that are not safe for rebind,<NEW_LINE>// and we need to make sure this state is reflected.<NEW_LINE>AbstractFloatingView.closeOpenViews(this, false, TYPE_ALL & ~TYPE_REBIND_SAFE);<NEW_LINE>finishAutoCancelActionMode();<NEW_LINE>if (mPendingRequestArgs != null) {<NEW_LINE>outState.putParcelable(RUNTIME_STATE_PENDING_REQUEST_ARGS, mPendingRequestArgs);<NEW_LINE>}<NEW_LINE>outState.putInt(RUNTIME_STATE_PENDING_REQUEST_CODE, mPendingActivityRequestCode);<NEW_LINE>if (mPendingActivityResult != null) {<NEW_LINE>outState.putParcelable(RUNTIME_STATE_PENDING_ACTIVITY_RESULT, mPendingActivityResult);<NEW_LINE>}<NEW_LINE>super.onSaveInstanceState(outState);<NEW_LINE>mOverlayManager.onActivitySaveInstanceState(this, outState);<NEW_LINE>}
widgetsState = new SparseArray<>();
1,247,428
public final IonSystem build() {<NEW_LINE>IonCatalog catalog = (myCatalog != null ? myCatalog : new SimpleCatalog());<NEW_LINE>IonTextWriterBuilder twb = IonTextWriterBuilder.standard().withCharsetAscii();<NEW_LINE>twb.setCatalog(catalog);<NEW_LINE>_Private_IonBinaryWriterBuilder bwb = _Private_IonBinaryWriterBuilder.standard();<NEW_LINE>bwb.setCatalog(catalog);<NEW_LINE>bwb.setStreamCopyOptimized(myStreamCopyOptimized);<NEW_LINE>// TODO Would be nice to remove this since it's implied by the BWB.<NEW_LINE>// However that currently causes problems in the IonSystem<NEW_LINE>// constructors (which get a null initialSymtab).<NEW_LINE>SymbolTable <MASK><NEW_LINE>bwb.setInitialSymbolTable(systemSymtab);<NEW_LINE>// This is what we need, more or less.<NEW_LINE>// bwb = bwb.fillDefaults();<NEW_LINE>IonReaderBuilder rb = readerBuilder == null ? IonReaderBuilder.standard() : readerBuilder;<NEW_LINE>rb = rb.withCatalog(catalog);<NEW_LINE>return newLiteSystem(twb, bwb, rb);<NEW_LINE>}
systemSymtab = _Private_Utils.systemSymtab(1);
196,948
/*<NEW_LINE>* @see<NEW_LINE>* com.ibm.wsspi.channelfw.ChannelFramework#removeChainFromGroup(java.lang<NEW_LINE>* .String, java.lang.String)<NEW_LINE>*/<NEW_LINE>@Override<NEW_LINE>public synchronized ChainGroupData removeChainFromGroup(String groupName, String chainName) throws ChainGroupException, ChainException {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {<NEW_LINE>Tr.debug(tc, "removeChainFromGroup chainName=" + chainName + ", groupName=" + groupName);<NEW_LINE>}<NEW_LINE>if (null == groupName) {<NEW_LINE>throw new ChainGroupException("Null chain group");<NEW_LINE>}<NEW_LINE>if (null == chainName) {<NEW_LINE>throw new ChainException("Null chain name");<NEW_LINE>}<NEW_LINE>// Ensure the chain exists.<NEW_LINE>ChainData chain = <MASK><NEW_LINE>if (null == chain) {<NEW_LINE>throw new ChainException("Unable to find chain: " + chainName);<NEW_LINE>}<NEW_LINE>// Ensure the group exists.<NEW_LINE>ChainGroupDataImpl group = (ChainGroupDataImpl) this.chainGroups.get(groupName);<NEW_LINE>if (null == group) {<NEW_LINE>throw new ChainGroupException("Unable to find group: " + groupName);<NEW_LINE>}<NEW_LINE>// Remove the chain from the group.<NEW_LINE>group.removeChain(chain);<NEW_LINE>return group;<NEW_LINE>}
this.chainDataMap.get(chainName);
1,610,578
final ListContainersResult executeListContainers(ListContainersRequest listContainersRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listContainersRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListContainersRequest> request = null;<NEW_LINE>Response<ListContainersResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new ListContainersRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listContainersRequest));<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, "MediaStore");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListContainers");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListContainersResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListContainersResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
1,538,459
final BatchDisassociateApprovalRuleTemplateFromRepositoriesResult executeBatchDisassociateApprovalRuleTemplateFromRepositories(BatchDisassociateApprovalRuleTemplateFromRepositoriesRequest batchDisassociateApprovalRuleTemplateFromRepositoriesRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(batchDisassociateApprovalRuleTemplateFromRepositoriesRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<BatchDisassociateApprovalRuleTemplateFromRepositoriesRequest> request = null;<NEW_LINE>Response<BatchDisassociateApprovalRuleTemplateFromRepositoriesResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new BatchDisassociateApprovalRuleTemplateFromRepositoriesRequestProtocolMarshaller(protocolFactory).marshall<MASK><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, "CodeCommit");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "BatchDisassociateApprovalRuleTemplateFromRepositories");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<BatchDisassociateApprovalRuleTemplateFromRepositoriesResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new BatchDisassociateApprovalRuleTemplateFromRepositoriesResultJsonUnmarshaller());<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>}
(super.beforeMarshalling(batchDisassociateApprovalRuleTemplateFromRepositoriesRequest));
1,806,315
void jbInit() throws Exception {<NEW_LINE>// [ 1707303 ] Account Combination Form(VAccountDialog) translation issue<NEW_LINE>titledBorder = new TitledBorder(BorderFactory.createEtchedBorder(Color.white, new Color(134, 134, 134)), msgBL.getMsg(Env.getCtx(), "Parameter"));<NEW_LINE>//<NEW_LINE>panelLayout.setHgap(5);<NEW_LINE>panelLayout.setVgap(5);<NEW_LINE>northLayout.setHgap(5);<NEW_LINE>northLayout.setVgap(5);<NEW_LINE>//<NEW_LINE>parameterPanel.setLayout(parameterLayout);<NEW_LINE>parameterPanel.setBorder(titledBorder);<NEW_LINE>northPanel.setLayout(northLayout);<NEW_LINE>toolBar.setOrientation(JToolBar.VERTICAL);<NEW_LINE>toolBar.setBorder(null);<NEW_LINE>toolBar.setRequestFocusEnabled(false);<NEW_LINE>toolBar.setBorderPainted(false);<NEW_LINE>toolBar.setMargin(new Insets(5, 5, 5, 5));<NEW_LINE>bSave.setIcon(Images.getImageIcon2("Save24"));<NEW_LINE>bSave.setMargin(new Insets(2, 2, 2, 2));<NEW_LINE>bSave.setToolTipText(msgBL.getMsg(Env<MASK><NEW_LINE>bSave.addActionListener(this);<NEW_LINE>bRefresh.setIcon(Images.getImageIcon2("Refresh24"));<NEW_LINE>bRefresh.setMargin(new Insets(2, 2, 2, 2));<NEW_LINE>bRefresh.setToolTipText(msgBL.getMsg(Env.getCtx(), "Refresh"));<NEW_LINE>bRefresh.addActionListener(this);<NEW_LINE>bIgnore.setIcon(Images.getImageIcon2("Ignore24"));<NEW_LINE>bIgnore.setMargin(new Insets(2, 2, 2, 2));<NEW_LINE>bIgnore.setToolTipText(msgBL.getMsg(Env.getCtx(), "Ignore"));<NEW_LINE>bIgnore.addActionListener(this);<NEW_LINE>//<NEW_LINE>toolBar.addSeparator();<NEW_LINE>toolBar.add(bRefresh, null);<NEW_LINE>toolBar.add(bIgnore, null);<NEW_LINE>toolBar.add(bSave, null);<NEW_LINE>//<NEW_LINE>getContentPane().add(panel);<NEW_LINE>panel.setLayout(panelLayout);<NEW_LINE>panel.add(confirmPanel, BorderLayout.SOUTH);<NEW_LINE>panel.add(northPanel, BorderLayout.NORTH);<NEW_LINE>northPanel.add(parameterPanel, BorderLayout.CENTER);<NEW_LINE>northPanel.add(toolBar, BorderLayout.EAST);<NEW_LINE>//<NEW_LINE>this.getContentPane().add(statusBar, BorderLayout.SOUTH);<NEW_LINE>confirmPanel.setActionListener(this);<NEW_LINE>}
.getCtx(), "AccountNewUpdate"));
1,010,071
private void jbInit() throws Exception {<NEW_LINE>this.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);<NEW_LINE>fResource.addActionListener(this);<NEW_LINE>delete.addActionListener(this);<NEW_LINE>confirmPanel.addButton(delete);<NEW_LINE>confirmPanel.setActionListener(this);<NEW_LINE>//<NEW_LINE>mainPanel.setLayout(mainLayout);<NEW_LINE>mainPanel.add(lResource, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(8, 8, 4, 4), 0, 0));<NEW_LINE>mainPanel.add(fResource, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(8, 0, 4, <MASK><NEW_LINE>mainPanel.add(lDate, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(2, 8, 4, 4), 0, 0));<NEW_LINE>mainPanel.add(fDateFrom, new GridBagConstraints(1, 1, 2, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(2, 0, 4, 8), 100, 0));<NEW_LINE>mainPanel.add(lQty, new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(2, 8, 4, 4), 0, 0));<NEW_LINE>mainPanel.add(fQty, new GridBagConstraints(1, 2, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(2, 0, 4, 4), 0, 0));<NEW_LINE>mainPanel.add(lUOM, new GridBagConstraints(2, 2, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(2, 4, 4, 8), 0, 0));<NEW_LINE>mainPanel.add(lName, new GridBagConstraints(0, 3, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(2, 8, 4, 4), 0, 0));<NEW_LINE>mainPanel.add(lDescription, new GridBagConstraints(0, 4, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(2, 8, 8, 4), 0, 0));<NEW_LINE>mainPanel.add(fName, new GridBagConstraints(1, 3, 2, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(2, 0, 4, 8), 0, 0));<NEW_LINE>mainPanel.add(fDescription, new GridBagConstraints(1, 4, 2, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(2, 0, 8, 8), 0, 0));<NEW_LINE>//<NEW_LINE>this.getContentPane().add(mainPanel, BorderLayout.CENTER);<NEW_LINE>this.getContentPane().add(confirmPanel, BorderLayout.SOUTH);<NEW_LINE>}
4), 0, 0));
1,790,030
public static void main(final String[] args) throws IOException {<NEW_LINE>final Struct_v1 v1 = new Struct_v1();<NEW_LINE>boolean sawException = false;<NEW_LINE>// Struct_v1 has a required field foo which by default is set to 'nothing'.<NEW_LINE>// If we try to serialize object v1 w/o initializing the field to some value<NEW_LINE>// Bond will throw an exception.<NEW_LINE>try {<NEW_LINE>System.out.println("Serializing v1...");<NEW_LINE>serialize(v1);<NEW_LINE>} catch (IOException ex) {<NEW_LINE>System.out.println(ex.getMessage());<NEW_LINE>sawException = true;<NEW_LINE>}<NEW_LINE>assert sawException : "Expected serialization to throw, as required nothing field is missing";<NEW_LINE>// Initialize field by assigning a Something value to it...<NEW_LINE>v1.foo = Something.wrap(10);<NEW_LINE>// ... or for complex fields, use Something.getValue() to get a<NEW_LINE>// reference to the thing.<NEW_LINE>v1.baz = Something.wrap(new LinkedList<String>());<NEW_LINE>v1.baz.getValue().add("test1");<NEW_LINE>v1.baz.<MASK><NEW_LINE>// We can also set a field to 'nothing' by assigning null to the<NEW_LINE>// field itself. Optional fields that are set to 'nothing' are<NEW_LINE>// omitted when object is serialized.<NEW_LINE>v1.baz = null;<NEW_LINE>final byte[] buffer = serialize(v1);<NEW_LINE>// Deserialize the payload into object of type Struct_v2<NEW_LINE>final Struct_v2 v2 = deserialize(buffer, Struct_v2.BOND_TYPE);<NEW_LINE>// Struct_v2 has an optional field bar, which didn't exist in<NEW_LINE>// Struct_v1. It is initialized to 'nothing' by default. By checking<NEW_LINE>// if the field is 'nothing' (== null) after de-serialization we can<NEW_LINE>// detect if it was present in the payload or not.<NEW_LINE>assert v2.baz == null : "baz was expected to have been omitted because it was set to nothing";<NEW_LINE>assert v2.bar == null : "v1 didn't have a bar field, so it should be nothing in v2";<NEW_LINE>}
getValue().add("test2");
717,341
public List<BoardCard> retrieveCardCandidates(final int boardId, final List<Integer> cardIds) {<NEW_LINE>if (cardIds.isEmpty()) {<NEW_LINE>return ImmutableList.of();<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>final String keyColumnName = boardDescriptor.getKeyColumnName();<NEW_LINE>final String userIdColumnName = boardDescriptor.getUserIdColumnName();<NEW_LINE>//<NEW_LINE>final List<Object> sqlParams = new ArrayList<>();<NEW_LINE>final CompositeStringExpression.Builder sqlExpr;<NEW_LINE>{<NEW_LINE>final IStringExpression sqlSelectDocument = buildSqlSelectDocument(boardDescriptor);<NEW_LINE>final String tableAlias = "r";<NEW_LINE>final String keyColumnNameFQ = tableAlias + "." + keyColumnName;<NEW_LINE>final String userIdColumnNameFQ = tableAlias + "." + userIdColumnName;<NEW_LINE>final SqlLookupDescriptor documentLookup = SqlLookupDescriptor.cast(boardDescriptor.getLookupDescriptor());<NEW_LINE>sqlExpr = //<NEW_LINE>IStringExpression.composer().append("SELECT ").append("\n NULL AS " + I_WEBUI_Board_RecordAssignment.COLUMNNAME_WEBUI_Board_Lane_ID).append("\n, " + keyColumnNameFQ + " AS " + I_WEBUI_Board_RecordAssignment.COLUMNNAME_Record_ID).append("\n, (").append(documentLookup.getSqlForFetchingLookupByIdExpression().toStringExpression(keyColumnNameFQ)).append(") AS card$caption").append("\n, u." + I_AD_User.COLUMNNAME_AD_User_ID + " AS card$user_id").append("\n, u." + I_AD_User.COLUMNNAME_Avatar_ID + " AS card$user_avatar_id").append(//<NEW_LINE>"\n, u." + I_AD_User.COLUMNNAME_Name + " AS card$user_fullname").// all exported document fields<NEW_LINE>append(//<NEW_LINE>"\n, " + tableAlias + ".*").append("\n FROM (").append(sqlSelectDocument).append(") " + tableAlias).append("\n LEFT OUTER JOIN " + I_AD_User.Table_Name + " u ON (u." + I_AD_User.COLUMNNAME_AD_User_ID + " = " + userIdColumnNameFQ + ")");<NEW_LINE>sqlExpr.append("\n WHERE ").append("\n " + DB.buildSqlList(keyColumnNameFQ, cardIds, sqlParams));<NEW_LINE>}<NEW_LINE>final String sql = sqlExpr.build().evaluate(Evaluatees.empty(), OnVariableNotFound.Fail);<NEW_LINE>return retrieveCardsFromSql(sql, sqlParams, boardDescriptor);<NEW_LINE>}
final BoardDescriptor boardDescriptor = getBoardDescriptor(boardId);
238,455
private void buildServlets(Config config) {<NEW_LINE>final ServletContextHandler servletContextHandler = new ServletContextHandler(null, "/");<NEW_LINE>servletContextHandler.setErrorHandler(createErrorHandler());<NEW_LINE>jettyServer.setHandler(servletContextHandler);<NEW_LINE>// Servlet holder for the pages of the Drill AM web app. The web app is a<NEW_LINE>// javax.ws application driven from annotations. The servlet holder "does<NEW_LINE>// the right thing" to drive the application, which is rooted at "/".<NEW_LINE>// The servlet container comes from Jersey, and manages the servlet<NEW_LINE>// lifecycle.<NEW_LINE>final ServletHolder servletHolder = new ServletHolder(new ServletContainer(new WebUiPageTree(dispatcher)));<NEW_LINE>servletHolder.setInitOrder(1);<NEW_LINE>servletContextHandler.addServlet(servletHolder, "/*");<NEW_LINE>final ServletHolder restHolder = new ServletHolder(new ServletContainer(new AmRestApi(dispatcher)));<NEW_LINE>restHolder.setInitOrder(2);<NEW_LINE><MASK><NEW_LINE>// Applying filters for CSRF protection.<NEW_LINE>servletContextHandler.addFilter(CsrfTokenInjectFilter.class, "/*", EnumSet.of(DispatcherType.REQUEST));<NEW_LINE>for (String path : new String[] { "/resize", "/stop", "/cancel" }) {<NEW_LINE>servletContextHandler.addFilter(CsrfTokenValidateFilter.class, path, EnumSet.of(DispatcherType.REQUEST));<NEW_LINE>}<NEW_LINE>// Static resources (CSS, images, etc.)<NEW_LINE>setupStaticResources(servletContextHandler);<NEW_LINE>// Security, if requested.<NEW_LINE>if (AMSecurityManagerImpl.isEnabled()) {<NEW_LINE>servletContextHandler.setSecurityHandler(createSecurityHandler());<NEW_LINE>servletContextHandler.setSessionHandler(createSessionHandler(config, servletContextHandler.getSecurityHandler()));<NEW_LINE>}<NEW_LINE>}
servletContextHandler.addServlet(restHolder, "/rest/*");
398,497
public static void main(String[] args) throws IOException {<NEW_LINE>String filePath = UtilIO.pathExample("mvs/stone_sign.ply");<NEW_LINE>// Load the PLY file<NEW_LINE>var cloud = new DogArray<>(Point3dRgbI_F32::new);<NEW_LINE>PointCloudIO.load(PointCloudIO.Format.PLY, new FileInputStream(filePath), PointCloudWriter.wrapF32RGB(cloud));<NEW_LINE>System.out.println("Total Points " + cloud.size);<NEW_LINE>// Create the 3D viewer as a Swing panel that will have some minimal controls for adjusting the clouds<NEW_LINE>// appearance. Since a software render is used it will get a bit sluggish (on my computer)<NEW_LINE>// around 1,000,000 points<NEW_LINE>PointCloudViewerPanel viewerPanel = new PointCloudViewerPanel();<NEW_LINE>viewerPanel.setPreferredSize(new Dimension(800, 600));<NEW_LINE>PointCloudViewer viewer = viewerPanel.getViewer();<NEW_LINE>// Change the camera's Field-of-View<NEW_LINE>viewer.setCameraHFov(UtilAngle.radian(60));<NEW_LINE>// So many formats to store a 3D point and color that a functional API is used here<NEW_LINE>viewer.addCloud((idx, p) -> ConvertFloatType.convert(cloud.get(idx), p), (idx) -> cloud.get(idx<MASK><NEW_LINE>// There are a ton of options for the viewer, but we will let the GUI handle most of them<NEW_LINE>// Alternatively, you could use VisualizeData.createPointCloudViewer(). No controls are<NEW_LINE>// provided if you use that.<NEW_LINE>SwingUtilities.invokeLater(() -> {<NEW_LINE>viewerPanel.handleControlChange();<NEW_LINE>viewerPanel.repaint();<NEW_LINE>ShowImages.showWindow(viewerPanel, "Point Cloud", true);<NEW_LINE>});<NEW_LINE>}
).rgb, cloud.size);
36,262
protected void executeImpl() throws MojoExecutionException, MojoFailureException {<NEW_LINE>File commonDir = getCN1ProjectDir();<NEW_LINE>if (commonDir == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>File rootMavenProjectDir = commonDir.getParentFile();<NEW_LINE>File javaSEDir = new File(rootMavenProjectDir, "javase");<NEW_LINE>if (!javaSEDir.exists()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>InvocationRequest request = new DefaultInvocationRequest();<NEW_LINE>// request.setPomFile( new File( "/path/to/pom.xml" ) );<NEW_LINE>request.setGoals(Arrays.asList("verify"));<NEW_LINE>request.setProfiles(Arrays.asList("simulator"));<NEW_LINE>Properties props = new Properties();<NEW_LINE><MASK><NEW_LINE>request.setProperties(props);<NEW_LINE>request.setBaseDirectory(rootMavenProjectDir);<NEW_LINE>Invoker invoker = new DefaultInvoker();<NEW_LINE>try {<NEW_LINE>invoker.execute(request);<NEW_LINE>} catch (MavenInvocationException ex) {<NEW_LINE>throw new MojoExecutionException(ex.getMessage(), ex);<NEW_LINE>}<NEW_LINE>}
props.setProperty("codename1.platform", "javase");
823,255
default FutureStream<Collection<U>> chunkSinceLastRead() {<NEW_LINE>final Queue queue = this.withQueueFactory(QueueFactories.unboundedQueue()).toQueue();<NEW_LINE>final Queue.QueueReader reader = new <MASK><NEW_LINE>class Chunker implements Iterator<Collection<U>> {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean hasNext() {<NEW_LINE>return reader.isOpen();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Collection<U> next() {<NEW_LINE>return reader.drainToOrBlock();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final Chunker chunker = new Chunker();<NEW_LINE>final Function<Supplier<U>, Supplier<Collection<U>>> fn = s -> {<NEW_LINE>return () -> {<NEW_LINE>try {<NEW_LINE>return chunker.next();<NEW_LINE>} catch (final ClosedQueueException e) {<NEW_LINE>throw new ClosedQueueException();<NEW_LINE>}<NEW_LINE>};<NEW_LINE>};<NEW_LINE>return fromStream(queue.streamBatchNoTimeout(getSubscription(), fn));<NEW_LINE>}
Queue.QueueReader(queue, null);
225,328
private void initialiseClassFrameSections() {<NEW_LINE>// @formatter:off<NEW_LINE>initialiseSection(new AnnAxiom<OWLClass, OWLAnnotation>(x -> parseAnnotation(), ANNOTATIONS, (s, o, anns) -> df.getOWLAnnotationAssertionAxiom(s.getIRI(), o, anns)), simpleClassFrameSections);<NEW_LINE>initialiseSection(new AnnAxiom<OWLClassExpression, OWLClassExpression>(x -> parseUnion(), SUBCLASS_OF, (s, o, anns) -> df.getOWLSubClassOfAxiom(s, <MASK><NEW_LINE>initialiseSection(new AnnAxiom<OWLClassExpression, OWLClassExpression>(x -> parseUnion(), EQUIVALENT_TO, (s, o, anns) -> df.getOWLEquivalentClassesAxiom(s, o, anns)), complexClassFrameSections);<NEW_LINE>initialiseSection(new AnnAxiom<OWLClassExpression, OWLClassExpression>(x -> parseUnion(), DISJOINT_WITH, (s, o, anns) -> df.getOWLDisjointClassesAxiom(s, o, anns)), complexClassFrameSections);<NEW_LINE>initialiseSection(new AnnAxiom<OWLClassExpression, Set<OWLPropertyExpression>>(x -> parsePropertyList(), HAS_KEY, (s, o, anns) -> df.getOWLHasKeyAxiom(s, o, anns)), complexClassFrameSections);<NEW_LINE>initialiseSection(new AnnAxiom<OWLClass, Set<OWLClassExpression>>(x -> parseClassExpressionList(), DISJOINT_UNION_OF, (s, o, anns) -> df.getOWLDisjointUnionAxiom(s, o, anns)), simpleClassFrameSections);<NEW_LINE>// Extensions<NEW_LINE>initialiseSection(new AnnAxiom<OWLClassExpression, OWLClassExpression>(x -> parseUnion(), SUPERCLASS_OF, (s, o, anns) -> df.getOWLSubClassOfAxiom(o, s, anns)), complexClassFrameSections);<NEW_LINE>initialiseSection(new AnnAxiom<OWLClassExpression, Set<OWLClassExpression>>(x -> parseClassExpressionList(), DISJOINT_CLASSES, (s, o, anns) -> df.getOWLDisjointClassesAxiom(o, anns)), complexClassFrameSections);<NEW_LINE>initialiseSection(new AnnAxiom<OWLClassExpression, OWLIndividual>(x -> parseIndividual(), INDIVIDUALS, (s, o, anns) -> df.getOWLClassAssertionAxiom(s, o, anns)), complexClassFrameSections);<NEW_LINE>// @formatter:on<NEW_LINE>}
o, anns)), complexClassFrameSections);
334,735
public String generateToolTip(XYDataset dataset, int series, int item) {<NEW_LINE>if (!(dataset instanceof OHLCDataset)) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>OHLCDataset d = (OHLCDataset) dataset;<NEW_LINE>Number high = d.getHigh(series, item);<NEW_LINE>Number low = d.getLow(series, item);<NEW_LINE>Number open = <MASK><NEW_LINE>Number close = d.getClose(series, item);<NEW_LINE>Number x = d.getX(series, item);<NEW_LINE>sb.append(d.getSeriesKey(series).toString());<NEW_LINE>if (x != null) {<NEW_LINE>Date date = new Date(x.longValue());<NEW_LINE>sb.append("--> Date=").append(this.dateFormatter.format(date));<NEW_LINE>if (high != null) {<NEW_LINE>sb.append(" High=");<NEW_LINE>sb.append(this.numberFormatter.format(high.doubleValue()));<NEW_LINE>}<NEW_LINE>if (low != null) {<NEW_LINE>sb.append(" Low=");<NEW_LINE>sb.append(this.numberFormatter.format(low.doubleValue()));<NEW_LINE>}<NEW_LINE>if (open != null) {<NEW_LINE>sb.append(" Open=");<NEW_LINE>sb.append(this.numberFormatter.format(open.doubleValue()));<NEW_LINE>}<NEW_LINE>if (close != null) {<NEW_LINE>sb.append(" Close=");<NEW_LINE>sb.append(this.numberFormatter.format(close.doubleValue()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return sb.toString();<NEW_LINE>}
d.getOpen(series, item);
938,222
private static IdFilter buildProjectIdFilter(Project project, boolean includeNonProjectItems) {<NEW_LINE>long started = System.currentTimeMillis();<NEW_LINE>final BitSet idSet = new BitSet();<NEW_LINE>ContentIterator iterator = fileOrDir -> {<NEW_LINE>idSet.set(((VirtualFileWithId) fileOrDir).getId());<NEW_LINE>ProgressManager.checkCanceled();<NEW_LINE>return true;<NEW_LINE>};<NEW_LINE>if (!includeNonProjectItems) {<NEW_LINE>ProjectRootManager.getInstance(project).getFileIndex().iterateContent(iterator);<NEW_LINE>} else {<NEW_LINE>FileBasedIndex.getInstance().iterateIndexableFiles(iterator, project, ProgressIndicatorProvider.getGlobalProgressIndicator());<NEW_LINE>}<NEW_LINE>if (LOG.isDebugEnabled()) {<NEW_LINE>long elapsed = System.currentTimeMillis() - started;<NEW_LINE>LOG.debug("Done filter (includeNonProjectItems=" + includeNonProjectItems + ") " + "in " + elapsed + "ms. Total files in set: " + idSet.cardinality());<NEW_LINE>}<NEW_LINE>return new IdFilter() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean containsFileId(int id) {<NEW_LINE>return id >= 0 && idSet.get(id);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Nonnull<NEW_LINE>@Override<NEW_LINE>public GlobalSearchScope getEffectiveFilteringScope() {<NEW_LINE>return includeNonProjectItems ? GlobalSearchScope.allScope(project<MASK><NEW_LINE>}<NEW_LINE>};<NEW_LINE>}
) : GlobalSearchScope.projectScope(project);
861,963
public io.kubernetes.client.proto.V1Rbac.PolicyRule buildPartial() {<NEW_LINE>io.kubernetes.client.proto.V1Rbac.PolicyRule result = new io.kubernetes.client.proto.V1Rbac.PolicyRule(this);<NEW_LINE>int from_bitField0_ = bitField0_;<NEW_LINE>if (((bitField0_ & 0x00000001) == 0x00000001)) {<NEW_LINE>verbs_ = verbs_.getUnmodifiableView();<NEW_LINE>bitField0_ = (bitField0_ & ~0x00000001);<NEW_LINE>}<NEW_LINE>result.verbs_ = verbs_;<NEW_LINE>if (((bitField0_ & 0x00000002) == 0x00000002)) {<NEW_LINE>apiGroups_ = apiGroups_.getUnmodifiableView();<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>result.apiGroups_ = apiGroups_;<NEW_LINE>if (((bitField0_ & 0x00000004) == 0x00000004)) {<NEW_LINE>resources_ = resources_.getUnmodifiableView();<NEW_LINE>bitField0_ = (bitField0_ & ~0x00000004);<NEW_LINE>}<NEW_LINE>result.resources_ = resources_;<NEW_LINE>if (((bitField0_ & 0x00000008) == 0x00000008)) {<NEW_LINE>resourceNames_ = resourceNames_.getUnmodifiableView();<NEW_LINE>bitField0_ = (bitField0_ & ~0x00000008);<NEW_LINE>}<NEW_LINE>result.resourceNames_ = resourceNames_;<NEW_LINE>if (((bitField0_ & 0x00000010) == 0x00000010)) {<NEW_LINE>nonResourceURLs_ = nonResourceURLs_.getUnmodifiableView();<NEW_LINE>bitField0_ = (bitField0_ & ~0x00000010);<NEW_LINE>}<NEW_LINE>result.nonResourceURLs_ = nonResourceURLs_;<NEW_LINE>onBuilt();<NEW_LINE>return result;<NEW_LINE>}
bitField0_ = (bitField0_ & ~0x00000002);
481,063
public void initBuffersWithMetaInfo(DbusEventBufferMetaInfo mi) throws DbusEventBufferMetaInfo.DbusEventBufferMetaInfoException {<NEW_LINE>if (mi.isValid()) {<NEW_LINE>_head.setPosition(mi.getLong(DbusEventBufferMetaInfo.BUFFER_HEAD));<NEW_LINE>_tail.setPosition(mi.getLong(DbusEventBufferMetaInfo.BUFFER_TAIL));<NEW_LINE>_currentWritePosition.setPosition(mi.getLong(DbusEventBufferMetaInfo.CURRENT_WRITE_POSITION));<NEW_LINE>_empty = mi.getBool(DbusEventBufferMetaInfo.BUFFER_EMPTY);<NEW_LINE>// _eventStartIndex<NEW_LINE>_eventStartIndex.setPosition(mi.getLong(DbusEventBufferMetaInfo.EVENT_START_INDEX));<NEW_LINE>_numEventsInWindow = mi.getInt(DbusEventBufferMetaInfo.NUM_EVENTS_IN_WINDOW);<NEW_LINE>_eventState = DbusEventBuffer.WindowState.valueOf(mi.getVal(DbusEventBufferMetaInfo.EVENT_STATE));<NEW_LINE>_lastWrittenSequence = <MASK><NEW_LINE>_seenEndOfPeriodScn = mi.getLong(DbusEventBufferMetaInfo.SEEN_END_OF_PERIOD_SCN);<NEW_LINE>_prevScn = mi.getLong(DbusEventBufferMetaInfo.PREV_SCN);<NEW_LINE>_timestampOfFirstEvent = mi.getLong(DbusEventBufferMetaInfo.TIMESTAMP_OF_FIRST_EVENT);<NEW_LINE>_timestampOfLatestDataEvent = mi.getLong(DbusEventBufferMetaInfo.TIMESTAMP_OF_LATEST_DATA_EVENT);<NEW_LINE>}<NEW_LINE>}
mi.getLong(DbusEventBufferMetaInfo.LAST_WRITTEN_SEQUENCE);
1,277,628
final DeleteLicenseConfigurationResult executeDeleteLicenseConfiguration(DeleteLicenseConfigurationRequest deleteLicenseConfigurationRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteLicenseConfigurationRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteLicenseConfigurationRequest> request = null;<NEW_LINE>Response<DeleteLicenseConfigurationResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteLicenseConfigurationRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteLicenseConfigurationRequest));<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, "License Manager");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteLicenseConfiguration");<NEW_LINE>request.<MASK><NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteLicenseConfigurationResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteLicenseConfigurationResultJsonUnmarshaller());<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,606,613
private void handleShowExport() throws AnalysisException {<NEW_LINE>ShowExportStmt showExportStmt = (ShowExportStmt) stmt;<NEW_LINE>Env env = Env.getCurrentEnv();<NEW_LINE>Database db = env.getInternalCatalog().getDbOrAnalysisException(showExportStmt.getDbName());<NEW_LINE>long dbId = db.getId();<NEW_LINE><MASK><NEW_LINE>Set<ExportJob.JobState> states = null;<NEW_LINE>ExportJob.JobState state = showExportStmt.getJobState();<NEW_LINE>if (state != null) {<NEW_LINE>states = Sets.newHashSet(state);<NEW_LINE>}<NEW_LINE>List<List<String>> infos = exportMgr.getExportJobInfosByIdOrState(dbId, showExportStmt.getJobId(), showExportStmt.getLabel(), showExportStmt.isLabelUseLike(), states, showExportStmt.getOrderByPairs(), showExportStmt.getLimit());<NEW_LINE>resultSet = new ShowResultSet(showExportStmt.getMetaData(), infos);<NEW_LINE>}
ExportMgr exportMgr = env.getExportMgr();
1,459,008
private static void createNotificationChannel(Context context, Constants.NotificationChannel channel) {<NEW_LINE>if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {<NEW_LINE>NotificationChannel notificationChannel = new NotificationChannel(channelId(channel), context.getString(R.string<MASK><NEW_LINE>switch(channel) {<NEW_LINE>case BACKUP_FAILED:<NEW_LINE>notificationChannel.setName(context.getString(R.string.notification_channel_name_backup_failed));<NEW_LINE>notificationChannel.setDescription(context.getString(R.string.notification_channel_desc_backup_failed));<NEW_LINE>notificationChannel.setImportance(NotificationManager.IMPORTANCE_HIGH);<NEW_LINE>break;<NEW_LINE>case BACKUP_SUCCESS:<NEW_LINE>notificationChannel.setName(context.getString(R.string.notification_channel_name_backup_success));<NEW_LINE>notificationChannel.setDescription(context.getString(R.string.notification_channel_desc_backup_success));<NEW_LINE>notificationChannel.setImportance(NotificationManager.IMPORTANCE_LOW);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>NotificationManager notificationManager = (NotificationManager) context.getSystemService(NOTIFICATION_SERVICE);<NEW_LINE>notificationManager.createNotificationChannel(notificationChannel);<NEW_LINE>}<NEW_LINE>}
.app_name), NotificationManager.IMPORTANCE_DEFAULT);
999,666
public void put(long ledgerId, long entryId, ByteBuf entry) {<NEW_LINE><MASK><NEW_LINE>int alignedSize = align64(entrySize);<NEW_LINE>lock.readLock().lock();<NEW_LINE>try {<NEW_LINE>if (entrySize > segmentSize) {<NEW_LINE>log.warn("entrySize {} > segmentSize {}, skip update read cache!", entrySize, segmentSize);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int offset = currentSegmentOffset.getAndAdd(alignedSize);<NEW_LINE>if (offset + entrySize > segmentSize) {<NEW_LINE>// Roll-over the segment (outside the read-lock)<NEW_LINE>} else {<NEW_LINE>// Copy entry into read cache segment<NEW_LINE>cacheSegments.get(currentSegmentIdx).setBytes(offset, entry, entry.readerIndex(), entry.readableBytes());<NEW_LINE>cacheIndexes.get(currentSegmentIdx).put(ledgerId, entryId, offset, entrySize);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>lock.readLock().unlock();<NEW_LINE>}<NEW_LINE>// We could not insert in segment, we to get the write lock and roll-over to<NEW_LINE>// next segment<NEW_LINE>lock.writeLock().lock();<NEW_LINE>try {<NEW_LINE>int offset = currentSegmentOffset.getAndAdd(entrySize);<NEW_LINE>if (offset + entrySize > segmentSize) {<NEW_LINE>// Rollover to next segment<NEW_LINE>currentSegmentIdx = (currentSegmentIdx + 1) % cacheSegments.size();<NEW_LINE>currentSegmentOffset.set(alignedSize);<NEW_LINE>cacheIndexes.get(currentSegmentIdx).clear();<NEW_LINE>offset = 0;<NEW_LINE>}<NEW_LINE>// Copy entry into read cache segment<NEW_LINE>cacheSegments.get(currentSegmentIdx).setBytes(offset, entry, entry.readerIndex(), entry.readableBytes());<NEW_LINE>cacheIndexes.get(currentSegmentIdx).put(ledgerId, entryId, offset, entrySize);<NEW_LINE>} finally {<NEW_LINE>lock.writeLock().unlock();<NEW_LINE>}<NEW_LINE>}
int entrySize = entry.readableBytes();
187,765
private void nextConnection(AsyncHttpRequest request) {<NEW_LINE>Uri uri = request.getUri();<NEW_LINE>final int port = getSchemePort(uri);<NEW_LINE>String key = computeLookup(uri, port, request.getProxyHost(), request.getProxyPort());<NEW_LINE>synchronized (AsyncSocketMiddleware.this) {<NEW_LINE>ConnectionInfo <MASK><NEW_LINE>if (info == null)<NEW_LINE>return;<NEW_LINE>--info.openCount;<NEW_LINE>while (info.openCount < maxConnectionCount && info.queue.size() > 0) {<NEW_LINE>GetSocketData gsd = info.queue.remove();<NEW_LINE>SimpleCancellable socketCancellable = (SimpleCancellable) gsd.socketCancellable;<NEW_LINE>if (socketCancellable.isCancelled())<NEW_LINE>continue;<NEW_LINE>Cancellable connect = getSocket(gsd);<NEW_LINE>socketCancellable.setParent(connect);<NEW_LINE>}<NEW_LINE>maybeCleanupConnectionInfo(key);<NEW_LINE>}<NEW_LINE>}
info = connectionInfo.get(key);
652,319
final DeleteNamedQueryResult executeDeleteNamedQuery(DeleteNamedQueryRequest deleteNamedQueryRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteNamedQueryRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteNamedQueryRequest> request = null;<NEW_LINE>Response<DeleteNamedQueryResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteNamedQueryRequestProtocolMarshaller(protocolFactory).marshall<MASK><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, "Athena");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteNamedQuery");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteNamedQueryResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteNamedQueryResultJsonUnmarshaller());<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>}
(super.beforeMarshalling(deleteNamedQueryRequest));
1,742,903
public void updateStatus(@NonNull final JsonRequestCandidateResults results) {<NEW_LINE>final AdIssueId generalAdIssueId = createADIssue(results.getError());<NEW_LINE>if (generalAdIssueId != null) {<NEW_LINE>logger.debug("Created AD_Issue_ID={} that applies to all exported shipment schedules", generalAdIssueId.getRepoId());<NEW_LINE>}<NEW_LINE>if (results.getItems().isEmpty()) {<NEW_LINE>logger.debug("given results is empty; -> return");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final APIExportAudit<ShipmentScheduleExportAuditItem> exportAudit = shipmentScheduleAuditRepository.getByTransactionId(results.getTransactionKey());<NEW_LINE>if (exportAudit == null) {<NEW_LINE>logger.debug(<MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>exportAudit.setForwardedData(results.getForwardedData());<NEW_LINE>exportAudit.setIssueId(generalAdIssueId);<NEW_LINE>final ImmutableSet<ShipmentScheduleId> shipmentScheduleIds = CollectionUtils.extractDistinctElementsIntoSet(results.getItems(), item -> ShipmentScheduleId.ofRepoId(item.getScheduleId().getValue()));<NEW_LINE>final ImmutableMap<ShipmentScheduleId, ShipmentSchedule> shipmentSchedules = shipmentScheduleRepository.getByIds(shipmentScheduleIds);<NEW_LINE>APIExportStatus overallStatus = ExportedAndForwarded;<NEW_LINE>for (final JsonRequestCandidateResult jsonResultItem : results.getItems()) {<NEW_LINE>final ShipmentScheduleId shipmentScheduleId = ShipmentScheduleId.ofRepoId(jsonResultItem.getScheduleId().getValue());<NEW_LINE>final ShipmentSchedule shipmentSchedule = shipmentSchedules.get(shipmentScheduleId);<NEW_LINE>if (shipmentSchedule == null) {<NEW_LINE>// also shouldn't happen, unless we do some API-testing with static JSON stuff<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>final ShipmentScheduleExportAuditItemBuilder builder = createOrGetAuditItemBuilder(exportAudit, shipmentScheduleId).orgId(shipmentSchedule.getOrgId());<NEW_LINE>final APIExportStatus itemStatus;<NEW_LINE>switch(jsonResultItem.getOutcome()) {<NEW_LINE>case OK:<NEW_LINE>itemStatus = ExportedAndForwarded;<NEW_LINE>break;<NEW_LINE>case ERROR:<NEW_LINE>itemStatus = ExportedAndError;<NEW_LINE>overallStatus = ExportedAndError;<NEW_LINE>final AdIssueId specificAdIssueId = createADIssue(jsonResultItem.getError());<NEW_LINE>builder.issueId(specificAdIssueId);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new AdempiereException("jsonResultItem has unexpected outcome=" + jsonResultItem.getOutcome()).setParameter("TransactionIdAPI", results.getTransactionKey()).setParameter("jsonResultItem", jsonResultItem);<NEW_LINE>}<NEW_LINE>builder.exportStatus(itemStatus);<NEW_LINE>exportAudit.addItem(builder.build());<NEW_LINE>shipmentSchedule.setExportStatus(itemStatus);<NEW_LINE>}<NEW_LINE>exportAudit.setExportStatus(overallStatus);<NEW_LINE>shipmentScheduleRepository.saveAll(shipmentSchedules.values());<NEW_LINE>shipmentScheduleAuditRepository.save(exportAudit);<NEW_LINE>}
"Given results.transactionKey={} does not match any audit records; -> return", results.getTransactionKey());
133,264
private void reportSocketStats(long channelId, InternalWithLogId socketLogId) {<NEW_LINE>final long socketId = socketLogId.getLogId().getId();<NEW_LINE>InternalInstrumented<InternalChannelz.SocketStats> iSocket = channelz.getSocket(socketId);<NEW_LINE>if (iSocket == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final String socketName = channelId + "-Socket-" + socketId;<NEW_LINE>final InternalChannelz.SocketStats socketStats = ChannelzUtils.getResult(socketName, iSocket);<NEW_LINE>if (socketStats == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>MoreObjects.ToStringHelper title = MoreObjects.toStringHelper("");<NEW_LINE>title.add("local", socketStats.local);<NEW_LINE>title.add("remote", socketStats.remote);<NEW_LINE>title.<MASK><NEW_LINE>logger.info("{} {}", socketName, title);<NEW_LINE>final InternalChannelz.TransportStats transportStats = socketStats.data;<NEW_LINE>if (transportStats != null) {<NEW_LINE>MoreObjects.ToStringHelper socketStrHelper = MoreObjects.toStringHelper("");<NEW_LINE>socketStrHelper.add("streamsStarted", transportStats.streamsStarted);<NEW_LINE>socketStrHelper.add("lastLocalStreamCreatedTime", toMillis(transportStats.lastLocalStreamCreatedTimeNanos));<NEW_LINE>socketStrHelper.add("lastRemoteStreamCreatedTime", toMillis(transportStats.lastRemoteStreamCreatedTimeNanos));<NEW_LINE>logger.info("{} {}", socketName, socketStrHelper);<NEW_LINE>MoreObjects.ToStringHelper socketStatStrHelper = MoreObjects.toStringHelper("");<NEW_LINE>socketStatStrHelper.add("streamsSucceeded", transportStats.streamsSucceeded);<NEW_LINE>socketStatStrHelper.add("streamsFailed", transportStats.streamsFailed);<NEW_LINE>socketStatStrHelper.add("messagesSent", transportStats.messagesSent);<NEW_LINE>socketStatStrHelper.add("messagesReceived", transportStats.messagesReceived);<NEW_LINE>logger.info("{} {}", socketName, socketStatStrHelper);<NEW_LINE>MoreObjects.ToStringHelper socketStat2StrHelper = MoreObjects.toStringHelper("");<NEW_LINE>socketStat2StrHelper.add("keepAlivesSent", transportStats.keepAlivesSent);<NEW_LINE>socketStat2StrHelper.add("lastMessageSentTime", toMillis(transportStats.lastMessageSentTimeNanos));<NEW_LINE>socketStat2StrHelper.add("lastMessageReceivedTime", toMillis(transportStats.lastMessageReceivedTimeNanos));<NEW_LINE>socketStat2StrHelper.add("localFlowControlWindow", transportStats.localFlowControlWindow);<NEW_LINE>socketStat2StrHelper.add("remoteFlowControlWindow", transportStats.remoteFlowControlWindow);<NEW_LINE>logger.info("{} {}", socketName, socketStat2StrHelper);<NEW_LINE>}<NEW_LINE>// InternalChannelz.SocketOptions socketOptions = socketStats.socketOptions;<NEW_LINE>// logger.info("{} socketOptions soTimeoutMillis:{} lingerSeconds:{}", socketName, socketOptions.soTimeoutMillis, socketOptions.lingerSeconds);<NEW_LINE>// logger.info("{} socketOptions others:{}", socketName, socketOptions.others);<NEW_LINE>// InternalChannelz.TcpInfo tcpInfo = socketOptions.tcpInfo;<NEW_LINE>// if (tcpInfo != null) {<NEW_LINE>// logger.info("{} tcpInfo retransmits:{}", socketName, tcpInfo.retransmits);<NEW_LINE>// logger.info("{} tcpInfo backoff:{}", socketName, tcpInfo.backoff);<NEW_LINE>// }<NEW_LINE>}
add("security", socketStats.security);
1,142,887
/* Build call for applicationsApplicationIdKeysKeyTypeGet */<NEW_LINE>private com.squareup.okhttp.Call applicationsApplicationIdKeysKeyTypeGetCall(String applicationId, String keyType, String groupId, String accept, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {<NEW_LINE>Object localVarPostBody = null;<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/applications/{applicationId}/keys/{keyType}".replaceAll("\\{format\\}", "json").replaceAll("\\{" + "applicationId" + "\\}", apiClient.escapeString(applicationId.toString())).replaceAll("\\{" + "keyType" + "\\}", apiClient.escapeString(keyType.toString()));<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>if (groupId != null)<NEW_LINE>localVarQueryParams.addAll(apiClient.parameterToPairs("", "groupId", groupId));<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>if (accept != null)<NEW_LINE>localVarHeaderParams.put("Accept", apiClient.parameterToString(accept));<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>final String[] localVarContentTypes = { "application/json" };<NEW_LINE>final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>localVarHeaderParams.put("Content-Type", localVarContentType);<NEW_LINE>if (progressListener != null) {<NEW_LINE>apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {<NEW_LINE>com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());<NEW_LINE>return originalResponse.newBuilder().body(new ProgressResponseBody(originalResponse.body(), progressListener)).build();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>String[] localVarAuthNames = new String[] {};<NEW_LINE>return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);<NEW_LINE>}
localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
1,013,336
public void consume(BoltResult t) throws Throwable {<NEW_LINE>outputEventStream.writeStatementStart(statement, Arrays.asList(statementMetadata.fieldNames().clone()));<NEW_LINE>var outputEventStreamRecordConsumer = new OutputEventStreamRecordConsumer(t, outputEventStream, valueMapper);<NEW_LINE>t.handleRecords(outputEventStreamRecordConsumer, -1);<NEW_LINE>// todo this can be a lot tidier. We're converting back from what AbstractCypherAdapterCypherStream<NEW_LINE>QueryExecutionType queryExecutionType = extractQueryExecutionType(outputEventStreamRecordConsumer.metadataMap());<NEW_LINE>QueryStatistics queryStatistics = fromAnyValue(outputEventStreamRecordConsumer.metadataMap().getOrDefault(STATS, null));<NEW_LINE>ExecutionPlanDescription executionPlanDescription = <MASK><NEW_LINE>Iterable<Notification> notifications = iterableFromAnyValue(outputEventStreamRecordConsumer.metadataMap().getOrDefault(NOTIFICATIONS, null));<NEW_LINE>outputEventStream.writeStatementEnd(queryExecutionType, queryStatistics, executionPlanDescription, notifications);<NEW_LINE>}
extractExecutionPlanDescription(outputEventStreamRecordConsumer.metadataMap());
1,682,072
public JsonObject toJSON() {<NEW_LINE>JsonObject sinfo = new JsonObject();<NEW_LINE>sinfo.addProperty("tooltips for default roll format", getUseToolTipsForDefaultRollFormat() ? BigDecimal.ONE : BigDecimal.ZERO);<NEW_LINE>sinfo.addProperty("GM reveals vision for unowned tokens", getGmRevealsVisionForUnownedTokens() ? BigDecimal.ONE : BigDecimal.ZERO);<NEW_LINE>sinfo.addProperty("players can reveal", getPlayersCanRevealVision() ? BigDecimal.ONE : BigDecimal.ZERO);<NEW_LINE>sinfo.addProperty("auto reveal on movement", isAutoRevealOnMovement() ? BigDecimal.ONE : BigDecimal.ZERO);<NEW_LINE>sinfo.addProperty("movement locked", isMovementLocked() ? BigDecimal.ONE : BigDecimal.ZERO);<NEW_LINE>sinfo.addProperty("token editor locked", isTokenEditorLocked() ? BigDecimal.ONE : BigDecimal.ZERO);<NEW_LINE>sinfo.addProperty("restricted impersonation", isRestrictedImpersonation() ? <MASK><NEW_LINE>sinfo.addProperty("individual views", isUseIndividualViews() ? BigDecimal.ONE : BigDecimal.ZERO);<NEW_LINE>sinfo.addProperty("individual fow", isUseIndividualFOW() ? BigDecimal.ONE : BigDecimal.ZERO);<NEW_LINE>sinfo.addProperty("strict token management", useStrictTokenManagement() ? BigDecimal.ONE : BigDecimal.ZERO);<NEW_LINE>sinfo.addProperty("players receive campaign macros", playersReceiveCampaignMacros() ? BigDecimal.ONE : BigDecimal.ZERO);<NEW_LINE>sinfo.addProperty("hide map select ui", getMapSelectUIHidden() ? BigDecimal.ONE : BigDecimal.ZERO);<NEW_LINE>sinfo.addProperty("disable player asset panel", getDisablePlayerAssetPanel() ? BigDecimal.ONE : BigDecimal.ZERO);<NEW_LINE>WalkerMetric metric = MapTool.isPersonalServer() ? AppPreferences.getMovementMetric() : getMovementMetric();<NEW_LINE>sinfo.addProperty("movement metric", metric.name());<NEW_LINE>sinfo.addProperty("using ai", isUsingAstarPathfinding() ? BigDecimal.ONE : BigDecimal.ZERO);<NEW_LINE>sinfo.addProperty("vbl blocks movement", getVblBlocksMove() ? BigDecimal.ONE : BigDecimal.ZERO);<NEW_LINE>sinfo.addProperty("timeInMs", getSystemTime());<NEW_LINE>sinfo.addProperty("timeDate", getTimeDate());<NEW_LINE>JsonArray gms = new JsonArray();<NEW_LINE>for (String gm : MapTool.getGMs()) {<NEW_LINE>gms.add(gm);<NEW_LINE>}<NEW_LINE>sinfo.add("gm", gms);<NEW_LINE>sinfo.addProperty("hosting server", MapTool.isHostingServer() ? BigDecimal.ONE : BigDecimal.ZERO);<NEW_LINE>sinfo.addProperty("personal server", MapTool.isPersonalServer() ? BigDecimal.ONE : BigDecimal.ZERO);<NEW_LINE>sinfo.addProperty("useWebRTC", AppState.useWebRTC() ? BigDecimal.ONE : BigDecimal.ZERO);<NEW_LINE>StartServerDialogPreferences prefs = new StartServerDialogPreferences();<NEW_LINE>sinfo.addProperty("usePasswordFile", prefs.getUsePasswordFile() ? BigDecimal.ONE : BigDecimal.ZERO);<NEW_LINE>sinfo.addProperty("server name", prefs.getRPToolsName());<NEW_LINE>sinfo.addProperty("port number", prefs.getPort());<NEW_LINE>return sinfo;<NEW_LINE>}
BigDecimal.ONE : BigDecimal.ZERO);
1,665,520
protected void update(PresentationData presentation) {<NEW_LINE>RunnerAndConfigurationSettings configurationSettings = getConfigurationSettings();<NEW_LINE>boolean isStored = RunManager.getInstance(getProject()).hasSettings(configurationSettings);<NEW_LINE>presentation.addText(configurationSettings.getName(), isStored ? SimpleTextAttributes.REGULAR_ATTRIBUTES : SimpleTextAttributes.GRAY_ATTRIBUTES);<NEW_LINE>RunDashboardContributor contributor = RunDashboardContributor.getContributor(configurationSettings.getType());<NEW_LINE>Image icon = null;<NEW_LINE>if (contributor != null) {<NEW_LINE>DashboardRunConfigurationStatus <MASK><NEW_LINE>if (DashboardRunConfigurationStatus.STARTED.equals(status)) {<NEW_LINE>icon = getExecutorIcon();<NEW_LINE>} else if (DashboardRunConfigurationStatus.FAILED.equals(status)) {<NEW_LINE>icon = status.getIcon();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (icon == null) {<NEW_LINE>icon = RunManagerEx.getInstanceEx(getProject()).getConfigurationIcon(configurationSettings);<NEW_LINE>}<NEW_LINE>presentation.setIcon(isStored ? icon : ImageEffects.grayed(icon));<NEW_LINE>if (contributor != null) {<NEW_LINE>contributor.updatePresentation(presentation, this);<NEW_LINE>}<NEW_LINE>}
status = contributor.getStatus(this);
1,429,411
private ExtraKeyButton[][] initExtraKeysInfo(@NonNull String propertiesInfo, @NonNull ExtraKeysConstants.ExtraKeyDisplayMap extraKeyDisplayMap, @NonNull ExtraKeysConstants.ExtraKeyDisplayMap extraKeyAliasMap) throws JSONException {<NEW_LINE>// Convert String propertiesInfo to Array of Arrays<NEW_LINE>JSONArray arr = new JSONArray(propertiesInfo);<NEW_LINE>Object[][] matrix = new Object[arr.length()][];<NEW_LINE>for (int i = 0; i < arr.length(); i++) {<NEW_LINE>JSONArray line = arr.getJSONArray(i);<NEW_LINE>matrix[i] = new Object[line.length()];<NEW_LINE>for (int j = 0; j < line.length(); j++) {<NEW_LINE>matrix[i][j] = line.get(j);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// convert matrix to buttons<NEW_LINE>ExtraKeyButton[][] buttons = new ExtraKeyButton[matrix.length][];<NEW_LINE>for (int i = 0; i < matrix.length; i++) {<NEW_LINE>buttons[i] = new ExtraKeyButton<MASK><NEW_LINE>for (int j = 0; j < matrix[i].length; j++) {<NEW_LINE>Object key = matrix[i][j];<NEW_LINE>JSONObject jobject = normalizeKeyConfig(key);<NEW_LINE>ExtraKeyButton button;<NEW_LINE>if (!jobject.has(ExtraKeyButton.KEY_POPUP)) {<NEW_LINE>// no popup<NEW_LINE>button = new ExtraKeyButton(jobject, extraKeyDisplayMap, extraKeyAliasMap);<NEW_LINE>} else {<NEW_LINE>// a popup<NEW_LINE>JSONObject popupJobject = normalizeKeyConfig(jobject.get(ExtraKeyButton.KEY_POPUP));<NEW_LINE>ExtraKeyButton popup = new ExtraKeyButton(popupJobject, extraKeyDisplayMap, extraKeyAliasMap);<NEW_LINE>button = new ExtraKeyButton(jobject, popup, extraKeyDisplayMap, extraKeyAliasMap);<NEW_LINE>}<NEW_LINE>buttons[i][j] = button;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return buttons;<NEW_LINE>}
[matrix[i].length];
1,789,810
public void actionPerformed(@Nonnull AnActionEvent e) {<NEW_LINE>VirtualFile[] files = getContextFiles(e, file -> OverrideFileTypeManager.getInstance().getFileValue(file) == null);<NEW_LINE>if (files.length == 0)<NEW_LINE>return;<NEW_LINE>DefaultActionGroup group = new DefaultActionGroup();<NEW_LINE>// although well-behaved types have unique names, file types coming from plugins can be wild<NEW_LINE>Map<String, List<String>> duplicates = Arrays.stream(FileTypeManager.getInstance().getRegisteredFileTypes()).map(t -> t.getDisplayName()).collect(Collectors.groupingBy(Function.identity()));<NEW_LINE>for (FileType type : ContainerUtil.sorted(Arrays.asList(FileTypeManager.getInstance().getRegisteredFileTypes()), (f1, f2) -> f1.getDisplayName().compareToIgnoreCase(f2.getDisplayName()))) {<NEW_LINE>if (!OverrideFileTypeManager.isOverridable(type))<NEW_LINE>continue;<NEW_LINE>boolean hasDuplicate = duplicates.get(type.getDisplayName()).size() > 1;<NEW_LINE>String dupHint = null;<NEW_LINE>if (hasDuplicate) {<NEW_LINE>PluginDescriptor descriptor = PluginManager.getPlugin(type.getClass());<NEW_LINE>dupHint = descriptor == null ? null : " (" + (descriptor.isBundled() ? ActionsBundle.message("group.OverrideFileTypeAction.bundledPlugin") : ActionsBundle.message("group.OverrideFileTypeAction.fromNamedPlugin", descriptor.getName())) + ")";<NEW_LINE>}<NEW_LINE>String displayText = type.getDisplayName() + StringUtil.notNullize(dupHint);<NEW_LINE>group.add(new ChangeToThisFileTypeAction(displayText, files, type));<NEW_LINE>}<NEW_LINE>JBPopupFactory.getInstance().createActionGroupPopup(ActionsBundle.message("group.OverrideFileTypeAction.title"), group, e.getDataContext(), false, null, -1).<MASK><NEW_LINE>}
showInBestPositionFor(e.getDataContext());
1,244,181
public Object readFPrimitiveArray(Object array, Class componentType, int len) {<NEW_LINE>if (componentType == double.class) {<NEW_LINE>double[] da = (double[]) array;<NEW_LINE>for (int i = 0; i < da.length; i++) {<NEW_LINE>da[i] = (double) input.readTag(input.readIn());<NEW_LINE>}<NEW_LINE>return da;<NEW_LINE>}<NEW_LINE>if (componentType == float.class) {<NEW_LINE>float[] <MASK><NEW_LINE>for (int i = 0; i < da.length; i++) {<NEW_LINE>da[i] = (float) input.readTag(input.readIn());<NEW_LINE>}<NEW_LINE>return da;<NEW_LINE>}<NEW_LINE>// input.readObject();<NEW_LINE>Object arr = array;<NEW_LINE>int length = Array.getLength(arr);<NEW_LINE>if (len != -1 && len != length)<NEW_LINE>throw new RuntimeException("unexpected arrays size");<NEW_LINE>byte type = 0;<NEW_LINE>if (componentType == boolean.class)<NEW_LINE>type |= MinBin.INT_8;<NEW_LINE>else if (componentType == byte.class)<NEW_LINE>type |= MinBin.INT_8;<NEW_LINE>else if (componentType == short.class)<NEW_LINE>type |= MinBin.INT_16;<NEW_LINE>else if (componentType == char.class)<NEW_LINE>type |= MinBin.INT_16 | MinBin.UNSIGN_MASK;<NEW_LINE>else if (componentType == int.class)<NEW_LINE>type |= MinBin.INT_32;<NEW_LINE>else if (componentType == long.class)<NEW_LINE>type |= MinBin.INT_64;<NEW_LINE>else<NEW_LINE>throw new RuntimeException("unsupported type " + componentType.getName());<NEW_LINE>input.readArrayRaw(type, len, array);<NEW_LINE>return arr;<NEW_LINE>}
da = (float[]) array;
830,303
// some where conditions eg. field1=field2 or field1>field2<NEW_LINE>private boolean explanSpecialCondWithBothSidesAreProperty(SQLBinaryOpExpr bExpr, Where where) throws SqlParseException {<NEW_LINE>// join is not support<NEW_LINE>if ((bExpr.getLeft() instanceof SQLPropertyExpr || bExpr.getLeft() instanceof SQLIdentifierExpr) && (bExpr.getRight() instanceof SQLPropertyExpr || bExpr.getRight() instanceof SQLIdentifierExpr) && Sets.newHashSet("=", "<", ">", ">=", "<=", "<>", "!=").contains(bExpr.getOperator().getName()) && !Util.isFromJoinOrUnionTable(bExpr)) {<NEW_LINE>SQLMethodInvokeExpr sqlMethodInvokeExpr = new SQLMethodInvokeExpr("script", null);<NEW_LINE>String operator = bExpr.getOperator().getName();<NEW_LINE>if (operator.equals("=")) {<NEW_LINE>operator = "==";<NEW_LINE>} else if (operator.equals("<>")) {<NEW_LINE>operator = "!=";<NEW_LINE>}<NEW_LINE>String leftProperty = Util.expr2Object(bExpr.getLeft()).toString();<NEW_LINE>String rightProperty = Util.expr2Object(bExpr.getRight()).toString();<NEW_LINE>if (leftProperty.split("\\.").length > 1) {<NEW_LINE>leftProperty = leftProperty.substring(leftProperty.split("\\.")[0].length() + 1);<NEW_LINE>}<NEW_LINE>if (rightProperty.split("\\.").length > 1) {<NEW_LINE>rightProperty = rightProperty.substring(rightProperty.split("\\.")[0<MASK><NEW_LINE>}<NEW_LINE>sqlMethodInvokeExpr.addParameter(new SQLCharExpr("doc['" + leftProperty + "'].value " + operator + " doc['" + rightProperty + "'].value"));<NEW_LINE>explanCond("AND", sqlMethodInvokeExpr, where);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
].length() + 1);
1,397,223
public ListAssociatedFleetsResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ListAssociatedFleetsResult listAssociatedFleetsResult = new ListAssociatedFleetsResult();<NEW_LINE><MASK><NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return listAssociatedFleetsResult;<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("Names", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listAssociatedFleetsResult.setNames(new ListUnmarshaller<String>(context.getUnmarshaller(String.class)).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("NextToken", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listAssociatedFleetsResult.setNextToken(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 listAssociatedFleetsResult;<NEW_LINE>}
int originalDepth = context.getCurrentDepth();
1,083,849
private DeleteResult cleanupStaleIndices(Map<String, BlobContainer> foundIndices, Set<String> survivingIndexIds) {<NEW_LINE>DeleteResult deleteResult = DeleteResult.ZERO;<NEW_LINE>for (Map.Entry<String, BlobContainer> indexEntry : foundIndices.entrySet()) {<NEW_LINE>final String indexSnId = indexEntry.getKey();<NEW_LINE>try {<NEW_LINE>if (survivingIndexIds.contains(indexSnId) == false) {<NEW_LINE>logger.debug("[{}] Found stale index [{}]. Cleaning it up", metadata.name(), indexSnId);<NEW_LINE>deleteResult = deleteResult.add(indexEntry.getValue().delete());<NEW_LINE>logger.debug("[{}] Cleaned up stale index [{}]", <MASK><NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.warn(() -> new ParameterizedMessage("[{}] index {} is no longer part of any snapshot in the repository, " + "but failed to clean up its index folder", metadata.name(), indexSnId), e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return deleteResult;<NEW_LINE>}
metadata.name(), indexSnId);
1,232,398
public void run() {<NEW_LINE>try {<NEW_LINE>DataObject dob = null;<NEW_LINE>if (byPassFolder != null) {<NEW_LINE>dob = DataFolder.findFolder(byPassFolder);<NEW_LINE>} else {<NEW_LINE>FileObject fob = refactoring.getRefactoringSource().lookup(FileObject.class);<NEW_LINE>if (fob != null) {<NEW_LINE>dob = DataObject.find(refactoring.getRefactoringSource().lookup(FileObject.class));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final DataObject dobFin = dob;<NEW_LINE>FileUtil.runAtomicAction(new FileSystem.AtomicAction() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() throws IOException {<NEW_LINE>if (dobFin != null) {<NEW_LINE>dobFin.rename(panel.getNameValue());<NEW_LINE>} else {<NEW_LINE>NonRecursiveFolder pack = refactoring.getRefactoringSource(<MASK><NEW_LINE>if (pack != null) {<NEW_LINE>renamePackage(pack.getFolder(), panel.getNameValue());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} catch (IOException iOException) {<NEW_LINE>Exceptions.printStackTrace(iOException);<NEW_LINE>}<NEW_LINE>}
).lookup(NonRecursiveFolder.class);
1,268,242
private void init() throws IOException {<NEW_LINE>if (!initialized) {<NEW_LINE>try {<NEW_LINE>List<Indexable> _resources = new ArrayList<Indexable>();<NEW_LINE>List<Indexable> _allResources = checkTimeStamps.contains(TimeStampAction.CHECK) && supportsAllFiles ? new ArrayList<Indexable>() : new NullList<Indexable>();<NEW_LINE>this.finished = collectResources(_resources, _allResources);<NEW_LINE>this.resources = Collections.unmodifiableList(_resources);<NEW_LINE>this.allResources = checkTimeStamps.contains(TimeStampAction.CHECK) && supportsAllFiles ? Collections.unmodifiableList(_allResources) : null;<NEW_LINE>changed = !_resources.isEmpty();<NEW_LINE>final Set<String> unseen = timeStamps.getUnseenFiles();<NEW_LINE>if (unseen != null) {<NEW_LINE>List<Indexable> _deleted = new ArrayList<Indexable>(unseen.size());<NEW_LINE>for (String u : unseen) {<NEW_LINE>_deleted.add(createIndexable(new DeletedIndexable(root, u)));<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>} else {<NEW_LINE>deleted = Collections.<Indexable>emptyList();<NEW_LINE>}<NEW_LINE>changed |= !deleted.isEmpty();<NEW_LINE>} finally {<NEW_LINE>initialized = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
deleted = Collections.unmodifiableList(_deleted);
72,866
public void document(int docID, StoredFieldVisitor visitor) throws IOException {<NEW_LINE>if (docID != 0) {<NEW_LINE>throw new IllegalArgumentException("no such doc ID " + docID);<NEW_LINE>}<NEW_LINE>if (visitor.needsField(FAKE_SOURCE_FIELD) == StoredFieldVisitor.Status.YES) {<NEW_LINE>assert operation.source().toBytesRef().offset == 0;<NEW_LINE>assert operation.source().toBytesRef().length == operation.source().toBytesRef().bytes.length;<NEW_LINE>visitor.binaryField(FAKE_SOURCE_FIELD, operation.source().toBytesRef().bytes);<NEW_LINE>}<NEW_LINE>if (operation.routing() != null && visitor.needsField(FAKE_ROUTING_FIELD) == StoredFieldVisitor.Status.YES) {<NEW_LINE>visitor.stringField(FAKE_ROUTING_FIELD, operation.routing());<NEW_LINE>}<NEW_LINE>if (visitor.needsField(FAKE_ID_FIELD) == StoredFieldVisitor.Status.YES) {<NEW_LINE>BytesRef bytesRef = Uid.encodeId(operation.id());<NEW_LINE>final byte[] id = new byte[bytesRef.length];<NEW_LINE>System.arraycopy(bytesRef.bytes, bytesRef.offset, <MASK><NEW_LINE>visitor.binaryField(FAKE_ID_FIELD, id);<NEW_LINE>}<NEW_LINE>}
id, 0, bytesRef.length);
940,110
public PointSensitivityBuilder presentValueSensitivityModelParamsSabr(ResolvedSwaption swaption, RatesProvider ratesProvider, SabrSwaptionVolatilities swaptionVolatilities) {<NEW_LINE>validate(swaption, ratesProvider, swaptionVolatilities);<NEW_LINE>double expiry = swaptionVolatilities.relativeTime(swaption.getExpiry());<NEW_LINE>ResolvedSwap underlying = swaption.getUnderlying();<NEW_LINE>ResolvedSwapLeg fixedLeg = fixedLeg(underlying);<NEW_LINE>double tenor = swaptionVolatilities.tenor(fixedLeg.getStartDate(), fixedLeg.getEndDate());<NEW_LINE>double shift = swaptionVolatilities.shift(expiry, tenor);<NEW_LINE>double pvbp = getSwapPricer().getLegPricer().pvbp(fixedLeg, ratesProvider);<NEW_LINE>double strike = getSwapPricer().getLegPricer().couponEquivalent(fixedLeg, ratesProvider, pvbp);<NEW_LINE>if (expiry < 0d) {<NEW_LINE>// Option has expired already<NEW_LINE>return PointSensitivityBuilder.none();<NEW_LINE>}<NEW_LINE>double forward = forwardRate(swaption, ratesProvider);<NEW_LINE>double volatility = swaptionVolatilities.volatility(expiry, tenor, strike, forward);<NEW_LINE>DoubleArray derivative = swaptionVolatilities.volatilityAdjoint(expiry, tenor, strike, forward).getDerivatives();<NEW_LINE>// Backward sweep<NEW_LINE>double vega = Math.abs(pvbp) * BlackFormulaRepository.vega(forward + shift, strike + shift, expiry, volatility) * swaption.getLongShort().sign();<NEW_LINE>// sensitivities<NEW_LINE>Currency ccy = fixedLeg.getCurrency();<NEW_LINE>SwaptionVolatilitiesName name = swaptionVolatilities.getName();<NEW_LINE>return PointSensitivityBuilder.of(SwaptionSabrSensitivity.of(name, expiry, tenor, ALPHA, ccy, vega * derivative.get(2)), SwaptionSabrSensitivity.of(name, expiry, tenor, BETA, ccy, vega * derivative.get(3)), SwaptionSabrSensitivity.of(name, expiry, tenor, RHO, ccy, vega * derivative.get(4)), SwaptionSabrSensitivity.of(name, expiry, tenor, NU, ccy, vega * <MASK><NEW_LINE>}
derivative.get(5)));
1,853,315
public Sql[] generateSql(AddPrimaryKeyStatement statement, Database database, SqlGeneratorChain sqlGeneratorChain) {<NEW_LINE>StringBuilder sql = new StringBuilder();<NEW_LINE>sql.append("ALTER TABLE ");<NEW_LINE>sql.append(database.escapeTableName(statement.getCatalogName(), statement.getSchemaName(), statement.getTableName()));<NEW_LINE>sql.append(" ADD CONSTRAINT PRIMARY KEY (");<NEW_LINE>sql.append(database.escapeColumnNameList(statement.getColumnNames()));<NEW_LINE>sql.append(")");<NEW_LINE>// Using auto-generated names of the form <constraint_type><tabid>_<constraintid> can cause collisions<NEW_LINE>// See here: http://www-01.ibm.com/support/docview.wss?uid=swg21156047<NEW_LINE>String constraintName = statement.getConstraintName();<NEW_LINE>if ((constraintName != null) && !constraintName.matches("[urcn][0-9]+_[0-9]+")) {<NEW_LINE>sql.append(" CONSTRAINT ");<NEW_LINE>sql.append<MASK><NEW_LINE>}<NEW_LINE>return new Sql[] { new UnparsedSql(sql.toString(), getAffectedPrimaryKey(statement)) };<NEW_LINE>}
(database.escapeConstraintName(constraintName));
1,834,649
void publishEvent(CacheEventContext cacheEventContext) {<NEW_LINE>final EventService eventService = nodeEngine.getEventService();<NEW_LINE>final String cacheName = cacheEventContext.getCacheName();<NEW_LINE>final Collection<EventRegistration> candidates = eventService.getRegistrations(SERVICE_NAME, cacheName);<NEW_LINE>if (candidates.isEmpty()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final Object eventData;<NEW_LINE>final CacheEventType eventType = cacheEventContext.getEventType();<NEW_LINE>switch(eventType) {<NEW_LINE>case CREATED:<NEW_LINE>case UPDATED:<NEW_LINE>case REMOVED:<NEW_LINE>case EXPIRED:<NEW_LINE>final CacheEventData cacheEventData = new CacheEventDataImpl(cacheName, eventType, cacheEventContext.getDataKey(), cacheEventContext.getDataValue(), cacheEventContext.getDataOldValue(), cacheEventContext.isOldValueAvailable());<NEW_LINE>CacheEventSet eventSet = new CacheEventSet(<MASK><NEW_LINE>eventSet.addEventData(cacheEventData);<NEW_LINE>eventData = eventSet;<NEW_LINE>break;<NEW_LINE>case EVICTED:<NEW_LINE>case INVALIDATED:<NEW_LINE>eventData = new CacheEventDataImpl(cacheName, eventType, cacheEventContext.getDataKey(), null, null, false);<NEW_LINE>break;<NEW_LINE>case COMPLETED:<NEW_LINE>CacheEventData completedEventData = new CacheEventDataImpl(cacheName, eventType, cacheEventContext.getDataKey(), cacheEventContext.getDataValue(), null, false);<NEW_LINE>eventSet = new CacheEventSet(eventType, cacheEventContext.getCompletionId());<NEW_LINE>eventSet.addEventData(completedEventData);<NEW_LINE>eventData = eventSet;<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new IllegalArgumentException("Event Type not defined to create an eventData during publish: " + eventType.name());<NEW_LINE>}<NEW_LINE>eventService.publishEvent(SERVICE_NAME, candidates, eventData, cacheEventContext.getOrderKey());<NEW_LINE>}
eventType, cacheEventContext.getCompletionId());
1,541,090
public void connectToAllAddress() {<NEW_LINE>for (int dstWorkerId = 0; dstWorkerId < networkMap.getWorkerNum(); ++dstWorkerId) {<NEW_LINE>if (dstWorkerId == networkMap.getSelfWorkerId()) {<NEW_LINE>connections[dstWorkerId] = null;<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>String <MASK><NEW_LINE>int port = networkMap.getPortForWorker(dstWorkerId);<NEW_LINE>InetSocketAddress dstAddress = resolveAddress(hostName, port);<NEW_LINE>// There are no duplicated connections in our settings.<NEW_LINE>workerId2Address.put(dstWorkerId, dstAddress);<NEW_LINE>logger.debug("NettyClient [{}]: Resolved address for worker: {}, dstAddr: {}", workerId, dstWorkerId, dstAddress);<NEW_LINE>ChannelFuture channelFuture = bootstrap.connect(dstAddress);<NEW_LINE>connections[dstWorkerId] = new Connection(channelFuture, dstAddress, dstWorkerId);<NEW_LINE>}<NEW_LINE>waitAllConnections();<NEW_LINE>logger.info("NettyClient [{}]: All connection established!", workerId);<NEW_LINE>}
hostName = networkMap.getHostNameForWorker(dstWorkerId);
364,204
public State visitMethod(MethodTree node, Void p) {<NEW_LINE>Map<TypeMirror, Map<VariableElement, State>> oldResumeOnExceptionHandler = resumeOnExceptionHandler;<NEW_LINE>resumeOnExceptionHandler = new IdentityHashMap<>();<NEW_LINE>try {<NEW_LINE>variable2State = new HashMap<>();<NEW_LINE>not = false;<NEW_LINE>Element current = info.getTrees().getElement(getCurrentPath());<NEW_LINE>if (current != null && (current.getKind() == ElementKind.METHOD || current.getKind() == ElementKind.CONSTRUCTOR)) {<NEW_LINE>for (VariableElement var : ((ExecutableElement) current).getParameters()) {<NEW_LINE>variable2State.put(var, getStateFromAnnotations(info, var));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>while (current != null) {<NEW_LINE>for (VariableElement var : ElementFilter.fieldsIn(current.getEnclosedElements())) {<NEW_LINE>variable2State.put(var, getStateFromAnnotations(info, var));<NEW_LINE>}<NEW_LINE>current = current.getEnclosingElement();<NEW_LINE>}<NEW_LINE>return <MASK><NEW_LINE>} finally {<NEW_LINE>resumeOnExceptionHandler = oldResumeOnExceptionHandler;<NEW_LINE>}<NEW_LINE>}
super.visitMethod(node, p);
732,576
public void emitCode(CompilationResultBuilder crb, AMD64MacroAssembler masm) {<NEW_LINE>boolean compressed = input.isCompressed();<NEW_LINE>if (isRegister(result)) {<NEW_LINE>if (compressed) {<NEW_LINE>crb.recordInlineDataInCode(input);<NEW_LINE>masm.movl(asRegister(result), 0xDEADDEAD);<NEW_LINE>} else {<NEW_LINE>crb.recordInlineDataInCode(input);<NEW_LINE>masm.movq(asRegister(result), 0xDEADDEADDEADDEADL);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>assert isStackSlot(result);<NEW_LINE>if (compressed) {<NEW_LINE>crb.recordInlineDataInCode(input);<NEW_LINE>masm.movl((AMD64Address) crb<MASK><NEW_LINE>} else {<NEW_LINE>throw GraalError.shouldNotReachHere("Cannot store 64-bit constants to memory");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
.asAddress(result), 0xDEADDEAD);
1,591,034
private void jbInit() {<NEW_LINE>dateFrom = new VDate("DateFrom", true, false, true, DisplayType.Date, "DateFrom");<NEW_LINE>dateTo = new VDate("DateTo", true, false, true, DisplayType.Date, "DateTo");<NEW_LINE>CPanel northPanel = new CPanel();<NEW_LINE>northPanel.setLayout(new java.awt.GridBagLayout());<NEW_LINE>northPanel.add(new CLabel(Msg.translate(Env.getCtx(), "S_Resource_ID")), new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));<NEW_LINE>northPanel.add(resource, new GridBagConstraints(1, 1, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0));<NEW_LINE>northPanel.add(new CLabel(Msg.translate(Env.getCtx(), "DateFrom")), new GridBagConstraints(2, 1, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));<NEW_LINE>northPanel.add(dateFrom, new GridBagConstraints(3, 1, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0));<NEW_LINE>northPanel.add(new CLabel(Msg.translate(Env.getCtx(), "DateTo")), new GridBagConstraints(4, 1, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));<NEW_LINE>northPanel.add(dateTo, new GridBagConstraints(5, 1, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0));<NEW_LINE>ConfirmPanel confirmPanel = new ConfirmPanel(true);<NEW_LINE>confirmPanel.addActionListener(new ActionHandler());<NEW_LINE>contentPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);<NEW_LINE>contentPanel.setPreferredSize(<MASK><NEW_LINE>m_form.getWindow().getContentPane().add(northPanel, BorderLayout.NORTH);<NEW_LINE>m_form.getWindow().getContentPane().add(contentPanel, BorderLayout.CENTER);<NEW_LINE>m_form.getWindow().getContentPane().add(confirmPanel, BorderLayout.SOUTH);<NEW_LINE>}
new Dimension(800, 600));
1,145,455
public boolean apply(Game game, Ability source) {<NEW_LINE>Player player = game.getPlayer(source.getControllerId());<NEW_LINE>if (player == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>Cards cardToReveal = new CardsImpl();<NEW_LINE>for (int cmc = 3; cmc > 0; cmc--) {<NEW_LINE>TargetCardInLibrary target = new TargetCardInLibrary(filterMap.get(cmc));<NEW_LINE>player.searchLibrary(target, source, game);<NEW_LINE>Card card = player.getLibrary().getCard(target.getFirstTarget(), game);<NEW_LINE>if (card == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>cardToReveal.clear();<NEW_LINE>cardToReveal.add(card);<NEW_LINE>player.revealCards(source, cardToReveal, game);<NEW_LINE>player.moveCards(cardToReveal, Zone.HAND, source, game);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>return true;<NEW_LINE>}
player.shuffleLibrary(source, game);
588,875
public static String replace(@Nonnull final String text, @Nonnull final String oldS, @Nonnull final String newS, final boolean ignoreCase) {<NEW_LINE>if (text.length() < oldS.length())<NEW_LINE>return text;<NEW_LINE>StringBuilder newText = null;<NEW_LINE>int i = 0;<NEW_LINE>while (i < text.length()) {<NEW_LINE>final int index = ignoreCase ? indexOfIgnoreCase(text, oldS, i) : text.indexOf(oldS, i);<NEW_LINE>if (index < 0) {<NEW_LINE>if (i == 0) {<NEW_LINE>return text;<NEW_LINE>}<NEW_LINE>newText.append(text, i, text.length());<NEW_LINE>break;<NEW_LINE>} else {<NEW_LINE>if (newText == null) {<NEW_LINE>if (text.length() == oldS.length()) {<NEW_LINE>return newS;<NEW_LINE>}<NEW_LINE>newText = new StringBuilder(text.length() - i);<NEW_LINE>}<NEW_LINE>newText.<MASK><NEW_LINE>newText.append(newS);<NEW_LINE>i = index + oldS.length();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return newText != null ? newText.toString() : "";<NEW_LINE>}
append(text, i, index);
1,421,804
public DescribeAccountLimitsResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>DescribeAccountLimitsResult describeAccountLimitsResult = new DescribeAccountLimitsResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return describeAccountLimitsResult;<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("AccountLimits", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>describeAccountLimitsResult.setAccountLimits(new ListUnmarshaller<AccountLimit>(AccountLimitJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("NextToken", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>describeAccountLimitsResult.setNextToken(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return describeAccountLimitsResult;<NEW_LINE>}
class).unmarshall(context));
631,481
private // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents<NEW_LINE>void initComponents() {<NEW_LINE>java.awt.GridBagConstraints gridBagConstraints;<NEW_LINE>labelVer = <MASK><NEW_LINE>textFieldVer = new javax.swing.JTextField();<NEW_LINE>setLayout(new java.awt.GridBagLayout());<NEW_LINE>labelVer.setLabelFor(textFieldVer);<NEW_LINE>// NOI18N<NEW_LINE>org.openide.awt.Mnemonics.setLocalizedText(labelVer, org.openide.util.NbBundle.getMessage(JFXApplicationPanel.class, "JFXApplicationPanel.labelVer.text"));<NEW_LINE>gridBagConstraints = new java.awt.GridBagConstraints();<NEW_LINE>gridBagConstraints.gridx = 0;<NEW_LINE>gridBagConstraints.gridy = 0;<NEW_LINE>gridBagConstraints.anchor = java.awt.GridBagConstraints.BASELINE_LEADING;<NEW_LINE>gridBagConstraints.insets = new java.awt.Insets(14, 1, 10, 0);<NEW_LINE>add(labelVer, gridBagConstraints);<NEW_LINE>// NOI18N<NEW_LINE>labelVer.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(JFXApplicationPanel.class, "AN_JFXApplicationPanel.labelVer.text"));<NEW_LINE>// NOI18N<NEW_LINE>labelVer.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(JFXApplicationPanel.class, "AD_JFXApplicationPanel.labelVer.text"));<NEW_LINE>// NOI18N<NEW_LINE>textFieldVer.setText(org.openide.util.NbBundle.getMessage(JFXApplicationPanel.class, "JFXApplicationPanel.textFieldVer.text"));<NEW_LINE>textFieldVer.addActionListener(new java.awt.event.ActionListener() {<NEW_LINE><NEW_LINE>public void actionPerformed(java.awt.event.ActionEvent evt) {<NEW_LINE>textFieldVerActionPerformed(evt);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>gridBagConstraints = new java.awt.GridBagConstraints();<NEW_LINE>gridBagConstraints.gridx = 1;<NEW_LINE>gridBagConstraints.gridy = 0;<NEW_LINE>gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;<NEW_LINE>gridBagConstraints.ipadx = 160;<NEW_LINE>gridBagConstraints.anchor = java.awt.GridBagConstraints.BASELINE_LEADING;<NEW_LINE>gridBagConstraints.insets = new java.awt.Insets(0, 7, 0, 5);<NEW_LINE>add(textFieldVer, gridBagConstraints);<NEW_LINE>// NOI18N<NEW_LINE>textFieldVer.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(JFXApplicationPanel.class, "AN_JFXApplicationPanel.textFieldVer.text"));<NEW_LINE>// NOI18N<NEW_LINE>textFieldVer.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(JFXApplicationPanel.class, "AD_JFXApplicationPanel.textFieldVer.text"));<NEW_LINE>}
new javax.swing.JLabel();
358,212
private void applyPatch(ArrayList<DiffChunk> chunks, ArrayList<Line> lines, boolean reverse, PatchMode patchMode) {<NEW_LINE>chunks <MASK><NEW_LINE>if (reverse) {<NEW_LINE>for (int i = 0; i < chunks.size(); i++) chunks.set(i, chunks.get(i).reverse());<NEW_LINE>lines = Line.reverseLines(lines);<NEW_LINE>}<NEW_LINE>String path = view_.getChangelistTable().getSelectedPaths().get(0);<NEW_LINE>if (path.indexOf(" -> ") >= 0)<NEW_LINE>path = path.substring(path.indexOf(" -> ") + " -> ".length());<NEW_LINE>UnifiedEmitter emitter = new UnifiedEmitter(path);<NEW_LINE>for (DiffChunk chunk : chunks) emitter.addContext(chunk);<NEW_LINE>emitter.addDiffs(lines);<NEW_LINE>String patch = emitter.createPatch(true);<NEW_LINE>softModeSwitch_ = true;<NEW_LINE>server_.gitApplyPatch(patch, patchMode, StringUtil.notNull(currentSourceEncoding_), new SimpleRequestCallback<>());<NEW_LINE>}
= new ArrayList<>(chunks);
915,742
private void writeGloballyTrustedKeys(DependencyVerificationConfiguration configuration) throws IOException {<NEW_LINE>final List<DependencyVerificationConfiguration.TrustedKey> keys = configuration.getTrustedKeys();<NEW_LINE>if (keys.isEmpty()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>writer.startElement(TRUSTED_KEYS);<NEW_LINE>Map<String, List<DependencyVerificationConfiguration.TrustedKey>> groupedByKeyId = keys.stream().collect(Collectors.groupingBy(DependencyVerificationConfiguration.TrustedKey::getKeyId, TreeMap::new, Collectors.toList()));<NEW_LINE>for (Map.Entry<String, List<DependencyVerificationConfiguration.TrustedKey>> e : groupedByKeyId.entrySet()) {<NEW_LINE><MASK><NEW_LINE>List<DependencyVerificationConfiguration.TrustedKey> trustedKeys = e.getValue();<NEW_LINE>if (trustedKeys.size() == 1) {<NEW_LINE>writeTrustedKey(trustedKeys.get(0));<NEW_LINE>} else {<NEW_LINE>writeGroupedTrustedKey(key, trustedKeys);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>writer.endElement();<NEW_LINE>}
String key = e.getKey();
974,350
private ViewServiceConfig createViewServiceConfig(ViewServiceRegistration registration, ViewServiceConfig requestedViewServiceConfig) {<NEW_LINE>ViewServiceConfig viewServiceConfig;<NEW_LINE>if (requestedViewServiceConfig instanceof IntegrationViewServiceConfig) {<NEW_LINE>IntegrationViewServiceConfig requestedIntegrationViewServiceConfig = (IntegrationViewServiceConfig) requestedViewServiceConfig;<NEW_LINE>IntegrationViewServiceConfig createdViewServiceConfig = new IntegrationViewServiceConfig(registration);<NEW_LINE>createdViewServiceConfig.setResourceEndpoints(requestedIntegrationViewServiceConfig.getResourceEndpoints());<NEW_LINE>viewServiceConfig = createdViewServiceConfig;<NEW_LINE>// some integration services require the OMAGServerPlatformRootURL<NEW_LINE>createdViewServiceConfig.setOMAGServerPlatformRootURL(requestedViewServiceConfig.getOMAGServerPlatformRootURL());<NEW_LINE>} else if (requestedViewServiceConfig instanceof SolutionViewServiceConfig) {<NEW_LINE>SolutionViewServiceConfig requestedSolutionViewServiceConfig = (SolutionViewServiceConfig) requestedViewServiceConfig;<NEW_LINE>SolutionViewServiceConfig createdViewServiceConfig = new SolutionViewServiceConfig(registration);<NEW_LINE>createdViewServiceConfig.setOMAGServerPlatformRootURL(requestedSolutionViewServiceConfig.getOMAGServerPlatformRootURL());<NEW_LINE>createdViewServiceConfig.<MASK><NEW_LINE>viewServiceConfig = createdViewServiceConfig;<NEW_LINE>} else {<NEW_LINE>ViewServiceConfig createdViewServiceConfig = new ViewServiceConfig(registration);<NEW_LINE>createdViewServiceConfig.setOMAGServerPlatformRootURL(requestedViewServiceConfig.getOMAGServerPlatformRootURL());<NEW_LINE>createdViewServiceConfig.setOMAGServerName(requestedViewServiceConfig.getOMAGServerName());<NEW_LINE>viewServiceConfig = createdViewServiceConfig;<NEW_LINE>}<NEW_LINE>Map<String, Object> viewOptions = requestedViewServiceConfig.getViewServiceOptions();<NEW_LINE>viewServiceConfig.setViewServiceOptions(viewOptions);<NEW_LINE>return viewServiceConfig;<NEW_LINE>}
setOMAGServerName(requestedSolutionViewServiceConfig.getOMAGServerName());
1,402,679
public void initialize(URL url, ResourceBundle resourceBundle) {<NEW_LINE>this.resourceBundle = resourceBundle;<NEW_LINE>final <MASK><NEW_LINE>networkExpertSettingsVBox.disableProperty().bind(networkExpertModeCB.selectedProperty().not());<NEW_LINE>pcIpTF.disableProperty().bind(autoDetectIpCB.selectedProperty());<NEW_LINE>pcPortTF.disableProperty().bind(randomlySelectPortCB.selectedProperty());<NEW_LINE>pcExtraTF.disableProperty().bind(noRequestsServeCB.selectedProperty().not());<NEW_LINE>xciNszXczSupportCB.setSelected(preferences.getTfXCI());<NEW_LINE>validateNSHostNameCB.setSelected(preferences.getNsIpValidationNeeded());<NEW_LINE>networkExpertModeCB.setSelected(preferences.getExpertMode());<NEW_LINE>pcIpTF.setText(preferences.getHostIp());<NEW_LINE>pcPortTF.setText(preferences.getHostPort());<NEW_LINE>pcExtraTF.setText(preferences.getHostExtra());<NEW_LINE>autoDetectIpCB.setSelected(preferences.getAutoDetectIp());<NEW_LINE>randomlySelectPortCB.setSelected(preferences.getRandPort());<NEW_LINE>boolean noServeRequestsFlag = preferences.getNotServeRequests();<NEW_LINE>if (noServeRequestsFlag) {<NEW_LINE>noServeRequestAction(true);<NEW_LINE>}<NEW_LINE>noRequestsServeCB.setSelected(noServeRequestsFlag);<NEW_LINE>pcIpTF.setTextFormatter(buildSpacelessTextFormatter());<NEW_LINE>pcPortTF.setTextFormatter(buildPortTextFormatter());<NEW_LINE>pcExtraTF.setTextFormatter(buildSpacelessTextFormatter());<NEW_LINE>autoDetectIpCB.setOnAction(e -> pcIpTF.requestFocus());<NEW_LINE>randomlySelectPortCB.setOnAction(e -> pcPortTF.requestFocus());<NEW_LINE>noRequestsServeCB.selectedProperty().addListener(((observableValue, oldValue, newValue) -> noServeRequestAction(newValue)));<NEW_LINE>}
AppPreferences preferences = AppPreferences.getInstance();
855,490
protected Map<String, Object> transform(final HTMLPageAsset page, final Map<String, Object> map, final Set<TransformOptions> options, final User user) throws DotSecurityException, DotDataException {<NEW_LINE>final String title = (String) map.get(TITLE_FIELD);<NEW_LINE>if (isNotSet(title)) {<NEW_LINE>map.put(TITLE_FIELD, page.getPageUrl());<NEW_LINE>}<NEW_LINE>map.put(MIMETYPE_FIELD, "application/dotpage");<NEW_LINE>map.put("name", page.getPageUrl());<NEW_LINE>map.put("description", page.getFriendlyName());<NEW_LINE>map.put("extension", "page");<NEW_LINE>map.put("isContentlet", true);<NEW_LINE>map.put("statusIcons", UtilHTML.getStatusIcons(page));<NEW_LINE>map.put("__icon__", IconType.HTMLPAGE.iconName());<NEW_LINE>final Optional<ContentletVersionInfo> info = APILocator.getVersionableAPI().getContentletVersionInfo(page.getIdentifier(), page.getLanguageId());<NEW_LINE>info.ifPresent(contentletVersionInfo -> map.put("workingInode", contentletVersionInfo.getWorkingInode()));<NEW_LINE>info.ifPresent(contentletVersionInfo -> map.put("liveInode", contentletVersionInfo.getLiveInode()));<NEW_LINE>info.ifPresent(contentletVersionInfo -> map.put("shortyWorking", APILocator.getShortyAPI().shortify(contentletVersionInfo.getWorkingInode())));<NEW_LINE>info.ifPresent(contentletVersionInfo -> map.put("shortyLive", APILocator.getShortyAPI().shortify(<MASK><NEW_LINE>map.put("canEdit", toolBox.permissionAPI.doesUserHavePermission(page, PermissionLevel.EDIT.getType(), user, false));<NEW_LINE>map.put("canRead", toolBox.permissionAPI.doesUserHavePermission(page, PermissionLevel.READ.getType(), user, false));<NEW_LINE>map.put("canLock", canLock(page, user));<NEW_LINE>if (info.isPresent() && info.get().getLockedBy() != null) {<NEW_LINE>map.put("lockedOn", info.get().getLockedOn());<NEW_LINE>map.put("lockedBy", info.get().getLockedBy());<NEW_LINE>map.put("lockedByName", getLockedByUserName(info.get()));<NEW_LINE>}<NEW_LINE>return map;<NEW_LINE>}
contentletVersionInfo.getLiveInode())));
142,802
private Map<Integer, byte[]> removeLowerTransportControlMessageHeader(final ControlMessage message) {<NEW_LINE>final Map<Integer, byte[]> messages = message.getLowerTransportControlPdu();<NEW_LINE>if (messages.size() > 1) {<NEW_LINE>for (Integer index : messages.keySet()) {<NEW_LINE>final byte[] data = messages.get(index);<NEW_LINE>// header size of unsegmented messages is 4;<NEW_LINE>final int length = data.length - SEGMENTED_MESSAGE_HEADER_LENGTH;<NEW_LINE>messages.put(index, removeHeader(data, 4, length));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>final int opCode = message.getOpCode();<NEW_LINE>final byte[] data;<NEW_LINE>final int length;<NEW_LINE>if (opCode == TransportLayerOpCodes.SAR_ACK_OPCODE) {<NEW_LINE>// data = messages.get(0);<NEW_LINE>Integer index = (Integer) messages.keySet().toArray()[0];<NEW_LINE><MASK><NEW_LINE>// header size of unsegmented acknowledgement messages is 3;<NEW_LINE>length = data.length - UNSEGMENTED_ACK_MESSAGE_HEADER_LENGTH;<NEW_LINE>// messages.put(0, removeHeader(data, UNSEGMENTED_ACK_MESSAGE_HEADER_LENGTH, length));<NEW_LINE>messages.put(index, removeHeader(data, UNSEGMENTED_ACK_MESSAGE_HEADER_LENGTH, length));<NEW_LINE>} else {<NEW_LINE>// data = messages.get(0);<NEW_LINE>Integer index = (Integer) messages.keySet().toArray()[0];<NEW_LINE>data = messages.get(index);<NEW_LINE>// header size of unsegmented messages is 1;<NEW_LINE>length = data.length - UNSEGMENTED_MESSAGE_HEADER_LENGTH;<NEW_LINE>// messages.put(0, removeHeader(data, UNSEGMENTED_MESSAGE_HEADER_LENGTH, length));<NEW_LINE>messages.put(index, removeHeader(data, UNSEGMENTED_MESSAGE_HEADER_LENGTH, length));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return messages;<NEW_LINE>}
data = messages.get(index);
442,814
private List<LayerDeclaration> createDeclarations(AmidstSettings settings, List<Integer> enabledLayers) {<NEW_LINE>LayerDeclaration[] declarations = new LayerDeclaration[LayerIds.NUMBER_OF_LAYERS];<NEW_LINE>// @formatter:off<NEW_LINE>declare(settings, declarations, enabledLayers, LayerIds.ALPHA, null, false, Setting.createImmutable(true));<NEW_LINE>declare(settings, declarations, enabledLayers, LayerIds.BIOME_DATA, Dimension.OVERWORLD, false, Setting.createImmutable(true));<NEW_LINE>declare(settings, declarations, enabledLayers, LayerIds.END_ISLANDS, Dimension.END, false, Setting.createImmutable(true));<NEW_LINE>declare(settings, declarations, enabledLayers, LayerIds.BACKGROUND, null, false, Setting.createImmutable(true));<NEW_LINE>declare(settings, declarations, enabledLayers, LayerIds.SLIME, Dimension.OVERWORLD, false, settings.showSlimeChunks);<NEW_LINE>declare(settings, declarations, enabledLayers, LayerIds.GRID, null, true, settings.showGrid);<NEW_LINE>declare(settings, declarations, enabledLayers, LayerIds.SPAWN, Dimension.OVERWORLD, false, settings.showSpawn);<NEW_LINE>declare(settings, declarations, enabledLayers, LayerIds.STRONGHOLD, Dimension.OVERWORLD, false, settings.showStrongholds);<NEW_LINE>declare(settings, declarations, enabledLayers, LayerIds.PLAYER, null, false, settings.showPlayers);<NEW_LINE>declare(settings, declarations, enabledLayers, LayerIds.VILLAGE, Dimension.OVERWORLD, false, settings.showVillages);<NEW_LINE>declare(settings, declarations, enabledLayers, LayerIds.TEMPLE, Dimension.OVERWORLD, false, settings.showTemples);<NEW_LINE>declare(settings, declarations, enabledLayers, LayerIds.MINESHAFT, Dimension.OVERWORLD, false, settings.showMineshafts);<NEW_LINE>declare(settings, declarations, enabledLayers, LayerIds.OCEAN_MONUMENT, Dimension.<MASK><NEW_LINE>declare(settings, declarations, enabledLayers, LayerIds.WOODLAND_MANSION, Dimension.OVERWORLD, false, settings.showWoodlandMansions);<NEW_LINE>declare(settings, declarations, enabledLayers, LayerIds.OCEAN_FEATURES, Dimension.OVERWORLD, false, settings.showOceanFeatures);<NEW_LINE>declare(settings, declarations, enabledLayers, LayerIds.NETHER_FEATURES, Dimension.OVERWORLD, false, settings.showNetherFortresses);<NEW_LINE>declare(settings, declarations, enabledLayers, LayerIds.END_CITY, Dimension.END, false, settings.showEndCities);<NEW_LINE>// @formatter:on<NEW_LINE>return Collections.unmodifiableList(Arrays.asList(declarations));<NEW_LINE>}
OVERWORLD, false, settings.showOceanMonuments);
1,345,171
private void computePopupBounds(Rectangle result, JLayeredPane lPane, int modelSize) {<NEW_LINE>Dimension cSize = comboBar.getSize();<NEW_LINE>int width = getPopupWidth();<NEW_LINE>Point location = new Point(cSize.width - width - 1, <MASK><NEW_LINE>if (SwingUtilities.getWindowAncestor(comboBar) != null) {<NEW_LINE>location = SwingUtilities.convertPoint(comboBar, location, lPane);<NEW_LINE>}<NEW_LINE>result.setLocation(location);<NEW_LINE>// hack to make jList.getpreferredSize work correctly<NEW_LINE>// JList is listening on ResultsModel same as us and order of listeners<NEW_LINE>// is undefined, so we have to force update of JList's layout data<NEW_LINE>jList1.setFixedCellHeight(15);<NEW_LINE>jList1.setFixedCellHeight(-1);<NEW_LINE>// end of hack<NEW_LINE>jList1.setVisibleRowCount(modelSize);<NEW_LINE>Dimension preferredSize = jList1.getPreferredSize();<NEW_LINE>preferredSize.width = width;<NEW_LINE>preferredSize.height += statusPanel.getPreferredSize().height + 3;<NEW_LINE>result.setSize(preferredSize);<NEW_LINE>}
comboBar.getBottomLineY() - 1);
461,000
public void executeMojo() throws MojoExecutionException {<NEW_LINE>List<Migration> pendingMigrations;<NEW_LINE>try {<NEW_LINE>String path = toAbsolutePath(getMigrationsPath());<NEW_LINE>getLog().info("Checking " + <MASK><NEW_LINE>openConnection();<NEW_LINE>MigrationManager manager = new MigrationManager(getProject(), path, getUrl());<NEW_LINE>pendingMigrations = manager.getPendingMigrations();<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new MojoExecutionException("Failed to check " + getUrl(), e);<NEW_LINE>} finally {<NEW_LINE>Base.close();<NEW_LINE>}<NEW_LINE>if (pendingMigrations.isEmpty())<NEW_LINE>return;<NEW_LINE>getLog().warn("Pending migration(s): ");<NEW_LINE>for (Migration migration : pendingMigrations) getLog().warn("Migration: " + migration.getName());<NEW_LINE>getLog().warn("Run db-migrator:migrate to apply pending migrations.");<NEW_LINE>throw new MojoExecutionException("Pending migration(s) exist, migrate your db and try again.");<NEW_LINE>}
getUrl() + " using migrations from " + path);
939,300
ActionResult<Wo> execute(HttpServletRequest request, EffectivePerson effectivePerson, JsonElement jsonElement) throws Exception {<NEW_LINE>ActionResult<Wo> result = new ActionResult<>();<NEW_LINE>Wi wrapIn = null;<NEW_LINE>Boolean check = true;<NEW_LINE>try {<NEW_LINE>wrapIn = this.convertToWrapIn(jsonElement, Wi.class);<NEW_LINE>} catch (Exception e) {<NEW_LINE>check = false;<NEW_LINE>Exception exception = new ExceptionWrapInConvert(e, jsonElement);<NEW_LINE>result.error(exception);<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>if (check && wrapIn != null) {<NEW_LINE>try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {<NEW_LINE>AppInfo appInfo = null;<NEW_LINE>if (wrapIn.getAppId() != null && !wrapIn.getAppId().isEmpty()) {<NEW_LINE>appInfo = emc.find(wrapIn.getAppId(), AppInfo.class);<NEW_LINE>if (appInfo != null) {<NEW_LINE>QueryView queryView = new QueryView();<NEW_LINE>wrapIn.copyTo(queryView);<NEW_LINE>if (wrapIn != null && wrapIn.getId() != null && wrapIn.getId().isEmpty()) {<NEW_LINE>queryView.setId(wrapIn.getId());<NEW_LINE>}<NEW_LINE>queryView.<MASK><NEW_LINE>queryView.setAppName(appInfo.getAppName());<NEW_LINE>queryView.setCreatorPerson(effectivePerson.getDistinguishedName());<NEW_LINE>queryView.setLastUpdatePerson(effectivePerson.getDistinguishedName());<NEW_LINE>queryView.setLastUpdateTime(new Date());<NEW_LINE>this.transQuery(queryView);<NEW_LINE>emc.beginTransaction(QueryView.class);<NEW_LINE>emc.persist(queryView, CheckPersistType.all);<NEW_LINE>emc.commit();<NEW_LINE>CacheManager.notify(QueryView.class);<NEW_LINE>Wo wo = new Wo();<NEW_LINE>wo.setId(queryView.getId());<NEW_LINE>result.setData(wo);<NEW_LINE>} else {<NEW_LINE>Exception exception = new ExceptionAppInfoNotExists(wrapIn.getAppId());<NEW_LINE>result.error(exception);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>Exception exception = new ExceptionQueryViewAppIdEmpty();<NEW_LINE>result.error(exception);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
setAppId(appInfo.getId());
1,633,630
public SDeserializerPluginConfiguration convertToSObject(DeserializerPluginConfiguration input) {<NEW_LINE>if (input == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>SDeserializerPluginConfiguration result = new SDeserializerPluginConfiguration();<NEW_LINE>result.setOid(input.getOid());<NEW_LINE>result.setUuid(input.getUuid());<NEW_LINE>result.setRid(input.getRid());<NEW_LINE>result.setName(input.getName());<NEW_LINE>result.setEnabled(input.getEnabled());<NEW_LINE>result.<MASK><NEW_LINE>PluginDescriptor pluginDescriptorVal = input.getPluginDescriptor();<NEW_LINE>result.setPluginDescriptorId(pluginDescriptorVal == null ? -1 : pluginDescriptorVal.getOid());<NEW_LINE>ObjectType settingsVal = input.getSettings();<NEW_LINE>result.setSettingsId(settingsVal == null ? -1 : settingsVal.getOid());<NEW_LINE>UserSettings userSettingsVal = input.getUserSettings();<NEW_LINE>result.setUserSettingsId(userSettingsVal == null ? -1 : userSettingsVal.getOid());<NEW_LINE>return result;<NEW_LINE>}
setDescription(input.getDescription());
190,127
private void cleanupJobResults(NodeEngine nodeEngine) {<NEW_LINE>int maxNoResults = Math.max(1, nodeEngine.getProperties().getInteger(ClusterProperty.JOB_RESULTS_MAX_SIZE));<NEW_LINE>// delete oldest job results<NEW_LINE>Map<Long<MASK><NEW_LINE>if (jobResultsMap.size() > Util.addClamped(maxNoResults, maxNoResults / MAX_NO_RESULTS_OVERHEAD)) {<NEW_LINE>Set<Long> jobIds = jobResultsMap.values().stream().sorted(comparing(JobResult::getCompletionTime).reversed()).skip(maxNoResults).map(JobResult::getJobId).collect(toSet());<NEW_LINE>jobMetrics.get().submitToKeys(jobIds, (EntryProcessor) ENTRY_REMOVING_PROCESSOR);<NEW_LINE>jobResults.get().submitToKeys(jobIds, (EntryProcessor) ENTRY_REMOVING_PROCESSOR);<NEW_LINE>jobIds.forEach(jobId -> {<NEW_LINE>String resourcesMapName = jobResourcesMapName(jobId);<NEW_LINE>if (nodeEngine.getProxyService().existsDistributedObject(SERVICE_NAME, resourcesMapName)) {<NEW_LINE>instance.getMap(resourcesMapName).destroy();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>}
, JobResult> jobResultsMap = jobResultsMap();
1,696,222
final CreateMountTargetResult executeCreateMountTarget(CreateMountTargetRequest createMountTargetRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createMountTargetRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateMountTargetRequest> request = null;<NEW_LINE>Response<CreateMountTargetResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateMountTargetRequestProtocolMarshaller(protocolFactory).marshall<MASK><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, "EFS");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateMountTarget");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateMountTargetResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateMountTargetResultJsonUnmarshaller());<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>}
(super.beforeMarshalling(createMountTargetRequest));
1,593,723
public void removeFilterEventListener(Session session, Participant subscriber, String streamId, String eventType) throws OpenViduException {<NEW_LINE>String participantPrivateId = ((KurentoSession<MASK><NEW_LINE>if (participantPrivateId != null) {<NEW_LINE>log.debug("Request [REMOVE_FILTER_LISTENER] over stream [{}]", streamId);<NEW_LINE>Participant participantPublishing = this.getParticipant(participantPrivateId);<NEW_LINE>KurentoParticipant kParticipantPublishing = (KurentoParticipant) participantPublishing;<NEW_LINE>if (!participantPublishing.isStreaming()) {<NEW_LINE>log.warn("PARTICIPANT {}: Requesting to removeFilterEventListener to stream {} " + "in session {} but user is not streaming media", subscriber.getParticipantPublicId(), streamId, session.getSessionId());<NEW_LINE>throw new OpenViduException(Code.USER_NOT_STREAMING_ERROR_CODE, "User '" + participantPublishing.getParticipantPublicId() + " not streaming media in session '" + session.getSessionId() + "'");<NEW_LINE>} else if (kParticipantPublishing.getPublisher().getFilter() == null) {<NEW_LINE>log.warn("PARTICIPANT {}: Requesting to removeFilterEventListener to user {} " + "in session {} but user does NOT have a filter", subscriber.getParticipantPublicId(), participantPublishing.getParticipantPublicId(), session.getSessionId());<NEW_LINE>throw new OpenViduException(Code.FILTER_NOT_APPLIED_ERROR_CODE, "User '" + participantPublishing.getParticipantPublicId() + " has no filter applied in session '" + session.getSessionId() + "'");<NEW_LINE>} else {<NEW_LINE>try {<NEW_LINE>PublisherEndpoint pub = kParticipantPublishing.getPublisher();<NEW_LINE>if (pub.removeParticipantAsListenerOfFilterEvent(eventType, subscriber.getParticipantPublicId())) {<NEW_LINE>// If there are no more participants listening to the event remove the event<NEW_LINE>// from the GenericMediaElement<NEW_LINE>this.removeFilterEventListenerInPublisher(kParticipantPublishing, eventType);<NEW_LINE>}<NEW_LINE>} catch (OpenViduException e) {<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>log.info("State of filter for participant {}: {}", kParticipantPublishing.getParticipantPublicId(), kParticipantPublishing.getPublisher().filterCollectionsToString());<NEW_LINE>}<NEW_LINE>}
) session).getParticipantPrivateIdFromStreamId(streamId);
1,132,028
public AnnotationMirror greatestLowerBound(AnnotationMirror a1, AnnotationMirror a2) {<NEW_LINE>if (AnnotationUtils.areSame(a1, UNKNOWN)) {<NEW_LINE>return a2;<NEW_LINE>}<NEW_LINE>if (AnnotationUtils.areSame(a2, UNKNOWN)) {<NEW_LINE>return a1;<NEW_LINE>}<NEW_LINE>if (AnnotationUtils.areSame(a1, BOTTOM)) {<NEW_LINE>return a1;<NEW_LINE>}<NEW_LINE>if (AnnotationUtils.areSame(a2, BOTTOM)) {<NEW_LINE>return a2;<NEW_LINE>}<NEW_LINE>UBQualifier ubq1 = UBQualifier.createUBQualifier(a1, (<MASK><NEW_LINE>UBQualifier ubq2 = UBQualifier.createUBQualifier(a2, (IndexChecker) checker.getUltimateParentChecker());<NEW_LINE>UBQualifier glb = ubq1.glb(ubq2);<NEW_LINE>return convertUBQualifierToAnnotation(glb);<NEW_LINE>}
IndexChecker) checker.getUltimateParentChecker());
1,677,708
public void run() {<NEW_LINE>try {<NEW_LINE>final boolean succeed = "success".equalsIgnoreCase(status);<NEW_LINE>if ("cancelled".equalsIgnoreCase(status)) {<NEW_LINE>System.out.println("Job status is `cancelled` - exiting");<NEW_LINE>System.exit(0);<NEW_LINE>}<NEW_LINE>System.out.println(String.format("The CI build had status %s.", status));<NEW_LINE>final GitHub github = new GitHubBuilder().withOAuthToken(token).build();<NEW_LINE>final GHRepository repository = github.getRepository(issueRepo);<NEW_LINE>final GHIssue issue = repository.getIssue(issueNumber);<NEW_LINE>if (issue == null) {<NEW_LINE>System.out.println(String.format<MASK><NEW_LINE>System.exit(-1);<NEW_LINE>} else {<NEW_LINE>System.out.println(String.format("Report issue found: %s - %s", issue.getTitle(), issue.getHtmlUrl().toString()));<NEW_LINE>System.out.println(String.format("The issue is currently %s", issue.getState().toString()));<NEW_LINE>}<NEW_LINE>if (succeed) {<NEW_LINE>if (issue != null && isOpen(issue)) {<NEW_LINE>// close issue with a comment<NEW_LINE>final GHIssueComment comment = issue.comment(String.format("Build fixed:\n* Link to latest CI run: https://github.com/%s/actions/runs/%s", thisRepo, runId));<NEW_LINE>issue.close();<NEW_LINE>System.out.println(String.format("Comment added on issue %s - %s, the issue has also been closed", issue.getHtmlUrl().toString(), comment.getHtmlUrl().toString()));<NEW_LINE>} else {<NEW_LINE>System.out.println("Nothing to do - the build passed and the issue is already closed");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (isOpen(issue)) {<NEW_LINE>final GHIssueComment comment = issue.comment(String.format("The build is still failing:\n* Link to latest CI run: https://github.com/%s/actions/runs/%s", thisRepo, runId));<NEW_LINE>System.out.println(String.format("Comment added on issue %s - %s", issue.getHtmlUrl().toString(), comment.getHtmlUrl().toString()));<NEW_LINE>} else {<NEW_LINE>issue.reopen();<NEW_LINE>final GHIssueComment comment = issue.comment(String.format("Unfortunately, the build failed:\n* Link to latest CI run: https://github.com/%s/actions/runs/%s", thisRepo, runId));<NEW_LINE>System.out.println(String.format("Comment added on issue %s - %s, the issue has been re-opened", issue.getHtmlUrl().toString(), comment.getHtmlUrl().toString()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new UncheckedIOException(e);<NEW_LINE>}<NEW_LINE>}
("Unable to find the issue %s in project %s", issueNumber, issueRepo));
715,508
// todo just calculate log likelihood in the last inter.<NEW_LINE>@Override<NEW_LINE>public void calc(ComContext context) {<NEW_LINE>int stepNo = context.getStepNo();<NEW_LINE>if (!addedIndex && seed != null) {<NEW_LINE>random.reSeed(seed);<NEW_LINE>addedIndex = true;<NEW_LINE>}<NEW_LINE>if (stepNo == 1) {<NEW_LINE>double[] logLikelihoodHook = new double[1];<NEW_LINE>context.putObj(LdaVariable.logLikelihood, logLikelihoodHook);<NEW_LINE>}<NEW_LINE>// only calculate log likelihood in the last iter.<NEW_LINE>if (stepNo == this.numIter) {<NEW_LINE>double[] logLikelihoodHook = context.getObj(LdaVariable.logLikelihood);<NEW_LINE>Tuple2<Long, Integer> tuple2 = ((List<Tuple2<Long, Integer>>) context.getObj(LdaVariable.shape)).get(0);<NEW_LINE>int vocabularySize = tuple2.f1;<NEW_LINE>DenseMatrix lambda = <MASK><NEW_LINE>DenseMatrix alpha = context.getObj(LdaVariable.alpha);<NEW_LINE>// get data<NEW_LINE>List<Vector> data = context.getObj(LdaVariable.data);<NEW_LINE>int taskNum = context.getNumTask();<NEW_LINE>DenseMatrix gammad = null;<NEW_LINE>double logLikelihood = logLikelihood(data, lambda, alpha, gammad, numTopic, vocabularySize, beta, taskNum, gammaShape, random);<NEW_LINE>logLikelihoodHook[0] = logLikelihood;<NEW_LINE>context.putObj(LdaVariable.logLikelihood, logLikelihoodHook);<NEW_LINE>}<NEW_LINE>}
context.getObj(LdaVariable.lambda);
663,176
protected Object decode(Channel channel, SocketAddress remoteAddress, Object msg) throws Exception {<NEW_LINE>Parser parser = new Parser(PATTERN, (String) msg);<NEW_LINE>if (!parser.matches()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>DeviceSession deviceSession = getDeviceSession(channel, remoteAddress, parser.next());<NEW_LINE>if (deviceSession == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>Position position = new Position(getProtocolName());<NEW_LINE>position.setDeviceId(deviceSession.getDeviceId());<NEW_LINE>position.setTime(parser.nextDateTime());<NEW_LINE>position.setValid(true);<NEW_LINE>position.setLongitude(parser.nextDouble());<NEW_LINE>position.setLatitude(parser.nextDouble());<NEW_LINE>position.setSpeed(UnitsConverter.knotsFromKph(parser.nextDouble()));<NEW_LINE>position.setCourse(parser.nextDouble());<NEW_LINE>position.setAltitude(parser.nextDouble());<NEW_LINE>position.set(Position.KEY_SATELLITES, parser.nextInt());<NEW_LINE><MASK><NEW_LINE>position.set(Position.KEY_ALARM, decodeAlarm(event));<NEW_LINE>position.set(Position.KEY_EVENT, event);<NEW_LINE>position.set(Position.KEY_INPUT, parser.nextInt());<NEW_LINE>position.set(Position.KEY_OUTPUT, parser.nextInt());<NEW_LINE>position.set(Position.PREFIX_ADC + 1, parser.nextDouble());<NEW_LINE>position.set(Position.PREFIX_ADC + 2, parser.nextDouble());<NEW_LINE>// J1939 data<NEW_LINE>if (parser.hasNext(10)) {<NEW_LINE>position.set(Position.KEY_OBD_SPEED, parser.nextInt());<NEW_LINE>position.set(Position.KEY_RPM, parser.nextInt());<NEW_LINE>position.set("coolant", parser.nextInt());<NEW_LINE>position.set(Position.KEY_FUEL_LEVEL, parser.nextInt());<NEW_LINE>position.set(Position.KEY_FUEL_CONSUMPTION, parser.nextInt());<NEW_LINE>position.set(Position.PREFIX_TEMP + 1, parser.nextInt());<NEW_LINE>position.set("chargerPressure", parser.nextInt());<NEW_LINE>position.set("tpl", parser.nextInt());<NEW_LINE>position.set(Position.KEY_AXLE_WEIGHT, parser.nextInt());<NEW_LINE>position.set(Position.KEY_OBD_ODOMETER, parser.nextInt());<NEW_LINE>}<NEW_LINE>return position;<NEW_LINE>}
int event = parser.nextInt();
1,133,431
private CRArtifact artifactConfigToCRArtifact(ArtifactTypeConfig artifactTypeConfig) {<NEW_LINE>if (artifactTypeConfig instanceof BuildArtifactConfig) {<NEW_LINE>BuildArtifactConfig buildArtifact = (BuildArtifactConfig) artifactTypeConfig;<NEW_LINE>return new CRBuiltInArtifact(buildArtifact.getSource(), buildArtifact.getDestination(), CRArtifactType.build);<NEW_LINE>} else if (artifactTypeConfig instanceof TestArtifactConfig) {<NEW_LINE>TestArtifactConfig testArtifact = (TestArtifactConfig) artifactTypeConfig;<NEW_LINE>return new CRBuiltInArtifact(testArtifact.getSource(), testArtifact.getDestination(), CRArtifactType.test);<NEW_LINE>} else if (artifactTypeConfig instanceof PluggableArtifactConfig) {<NEW_LINE>PluggableArtifactConfig pluggableArtifact = (PluggableArtifactConfig) artifactTypeConfig;<NEW_LINE>List<CRConfigurationProperty> crConfigurationProperties = <MASK><NEW_LINE>return new CRPluggableArtifact(pluggableArtifact.getId(), pluggableArtifact.getStoreId(), crConfigurationProperties);<NEW_LINE>} else {<NEW_LINE>throw new RuntimeException(String.format("Unsupported Artifact Type: %s.", artifactTypeConfig.getArtifactType()));<NEW_LINE>}<NEW_LINE>}
configurationToCRConfiguration(pluggableArtifact.getConfiguration());
1,508,951
private void residualLumaI16x16(MBlock mBlock, boolean leftAvailable, boolean topAvailable, int mbX, int mbY) {<NEW_LINE>CoeffTransformer.invDC4x4(mBlock.dc);<NEW_LINE>int[] scalingList = getScalingList(0);<NEW_LINE>CoeffTransformer.dequantizeDC4x4(mBlock.dc, s.qp, scalingList);<NEW_LINE>reorderDC4x4(mBlock.dc);<NEW_LINE>for (int bInd = 0; bInd < 16; bInd++) {<NEW_LINE>int ind8x8 = bInd >> 2;<NEW_LINE>int mask = 1 << ind8x8;<NEW_LINE>if ((mBlock.cbpLuma() & mask) != 0) {<NEW_LINE>CoeffTransformer.dequantizeAC(mBlock.ac[0][bInd], s.qp, scalingList);<NEW_LINE>}<NEW_LINE>mBlock.ac[0][bInd][0] = mBlock.dc[bInd];<NEW_LINE>CoeffTransformer.idct4x4(mBlock.<MASK><NEW_LINE>}<NEW_LINE>}
ac[0][bInd]);
1,083,711
public static Timestamp toTimestamp(Object value) {<NEW_LINE>if (value == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (value instanceof Timestamp) {<NEW_LINE>return (Timestamp) value;<NEW_LINE>} else if (value instanceof java.util.Date) {<NEW_LINE>// no nanos here... so hopefully ok<NEW_LINE>return new Timestamp(((java.util.Date) value).getTime());<NEW_LINE>} else if (value instanceof Calendar) {<NEW_LINE>return new Timestamp(((Calendar) value).getTime().getTime());<NEW_LINE>} else if (value instanceof String) {<NEW_LINE>return Timestamp.valueOf((String) value);<NEW_LINE>} else if (value instanceof LocalDateTime) {<NEW_LINE>return Timestamp.valueOf((LocalDateTime) value);<NEW_LINE>} else if (value instanceof Number) {<NEW_LINE>return new Timestamp(((Number<MASK><NEW_LINE>} else {<NEW_LINE>String msg = "Unable to convert [" + value.getClass().getName() + "] into a Timestamp.";<NEW_LINE>throw new RuntimeException(msg);<NEW_LINE>}<NEW_LINE>}
) value).longValue());
754,464
public void configure() {<NEW_LINE>CamelRouteUtil.setupProperties(getContext());<NEW_LINE>final String maximumRedeliveries = CamelRouteUtil.resolveProperty(getContext(), CamelConstants.EXPORT_BPARTNER_RETRY_COUNT, "0");<NEW_LINE>final String redeliveryDelay = CamelRouteUtil.resolveProperty(getContext(), CamelConstants.EXPORT_BPARTNER_RETRY_DELAY, "0");<NEW_LINE>errorHandler(deadLetterChannel(RABBITMQ_DEADLETTER_ROUTE_ID).logHandled(true).maximumRedeliveries(Integer.parseInt(maximumRedeliveries)).redeliveryDelay(<MASK><NEW_LINE>from(direct(RABBITMQ_DISPATCHER_ROUTE_ID)).routeId(RABBITMQ_DISPATCHER_ROUTE_ID).streamCaching().process(this::extractAndAttachRabbitHttpRequest).to(direct(RABBITMQ_MESSAGE_SENDER));<NEW_LINE>// dev-note: we need the whole route to be replayed in case of redelivery<NEW_LINE>from(direct(RABBITMQ_MESSAGE_SENDER)).routeId(RABBITMQ_MESSAGE_SENDER).errorHandler(noErrorHandler()).log("invoked").marshal(// dev-note: the actual path is computed in this.extractAndAttachRabbitHttpRequest()<NEW_LINE>CamelRouteUtil.setupJacksonDataFormatFor(getContext(), JsonRabbitMQHttpMessage.class)).to("https://placeholder").id(RABBITMQ_ENDPOINT_ID).unmarshal(CamelRouteUtil.setupJacksonDataFormatFor(getContext(), JsonRabbitMQHttpResponse.class)).process(this::validateMessageRouted).id(RABBIT_MQ_RESPONSE_PROCESSOR_ID);<NEW_LINE>from(RABBITMQ_DEADLETTER_ROUTE_ID).routeId(RABBITMQ_DEADLETTER_ROUTE_ID).to(direct(MF_ERROR_ROUTE_ID));<NEW_LINE>}
Integer.parseInt(redeliveryDelay)));
903,082
private void reconcileStatusBarStyle(Activity activity, ReadableMap prev, ReadableMap next, boolean firstCall) {<NEW_LINE>if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {<NEW_LINE>reconcileStatusBarStyleOnM(activity, prev, next, firstCall);<NEW_LINE>}<NEW_LINE>if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {<NEW_LINE>reconcileStatusBarStyleOnLollipop(activity, prev, next, firstCall);<NEW_LINE>}<NEW_LINE>if (firstCall || boolHasChanged("statusBarHidden", prev, next)) {<NEW_LINE>boolean hidden = false;<NEW_LINE>if (next.hasKey("statusBarHidden")) {<NEW_LINE>hidden = next.getBoolean("statusBarHidden");<NEW_LINE>}<NEW_LINE>if (hidden) {<NEW_LINE>activity.getWindow().<MASK><NEW_LINE>activity.getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);<NEW_LINE>} else {<NEW_LINE>activity.getWindow().addFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);<NEW_LINE>activity.getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
210,492
protected void processOneForForward(Id sourceV, Id targetV) {<NEW_LINE>for (Node source : this.sources.get(sourceV)) {<NEW_LINE>// If have loop, skip target<NEW_LINE>if (source.contains(targetV)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>// If cross point exists, path found, concat them<NEW_LINE>if (this.targetsAll.containsKey(targetV)) {<NEW_LINE>for (Node target : this.targetsAll.get(targetV)) {<NEW_LINE>List<Id> <MASK><NEW_LINE>if (!path.isEmpty()) {<NEW_LINE>this.paths.add(new Path(targetV, path));<NEW_LINE>if (this.reachLimit()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Add node to next start-nodes<NEW_LINE>this.addNodeToNewVertices(targetV, new Node(targetV, source));<NEW_LINE>}<NEW_LINE>}
path = source.joinPath(target);
1,444,852
private void uninstallCustomApp(String fileName) throws Exception {<NEW_LINE>Nodes nodes = Config.nodes();<NEW_LINE>for (String node : nodes.keySet()) {<NEW_LINE>if (nodes.get(node).getApplication().getEnable()) {<NEW_LINE>logger.print("socket uninstall custom app{} to {}:{}", fileName, node, nodes.get(node).nodeAgentPort());<NEW_LINE>try (Socket socket = new Socket(node, nodes.get(node).nodeAgentPort())) {<NEW_LINE>socket.setKeepAlive(true);<NEW_LINE>socket.setSoTimeout(5000);<NEW_LINE>try (DataOutputStream dos = new DataOutputStream(socket.getOutputStream());<NEW_LINE>DataInputStream dis = new DataInputStream(socket.getInputStream())) {<NEW_LINE>Map<String, Object> commandObject = new HashMap<>();<NEW_LINE>commandObject.put("command", "uninstall:customWar");<NEW_LINE>commandObject.put("credential", Crypto.rsaEncrypt("o2@", Config.publicKey()));<NEW_LINE>dos.writeUTF<MASK><NEW_LINE>dos.flush();<NEW_LINE>dos.writeUTF(fileName);<NEW_LINE>dos.flush();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
(XGsonBuilder.toJson(commandObject));
677,140
public void logMetrics(String experimentRunId, List<KeyValue> newMetrics) {<NEW_LINE>try (var session = modelDBHibernateUtil.getSessionFactory().openSession()) {<NEW_LINE>var experimentRunEntityObj = session.get(ExperimentRunEntity.class, experimentRunId, LockMode.PESSIMISTIC_WRITE);<NEW_LINE>if (experimentRunEntityObj == null) {<NEW_LINE>throw new NotFoundException(ModelDBMessages.EXP_RUN_NOT_FOUND_ERROR_MSG);<NEW_LINE>}<NEW_LINE>List<KeyValue> existingMetrics = experimentRunEntityObj.getProtoObject().getMetricsList();<NEW_LINE>for (KeyValue existingMetric : existingMetrics) {<NEW_LINE>for (KeyValue newMetric : newMetrics) {<NEW_LINE>if (existingMetric.getKey().equals(newMetric.getKey())) {<NEW_LINE>throw new AlreadyExistsException("Metric being logged already exists. existing metric Key : " + newMetric.getKey());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>List<KeyValueEntity> newMetricList = RdbmsUtils.convertKeyValuesFromKeyValueEntityList(experimentRunEntityObj, ModelDBConstants.METRICS, newMetrics);<NEW_LINE>experimentRunEntityObj.setKeyValueMapping(newMetricList);<NEW_LINE>long currentTimestamp = Calendar<MASK><NEW_LINE>experimentRunEntityObj.setDate_updated(currentTimestamp);<NEW_LINE>experimentRunEntityObj.increaseVersionNumber();<NEW_LINE>var transaction = session.beginTransaction();<NEW_LINE>session.saveOrUpdate(experimentRunEntityObj);<NEW_LINE>transaction.commit();<NEW_LINE>} catch (Exception ex) {<NEW_LINE>if (ModelDBUtils.needToRetry(ex)) {<NEW_LINE>logMetrics(experimentRunId, newMetrics);<NEW_LINE>} else {<NEW_LINE>throw ex;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
.getInstance().getTimeInMillis();
1,322,001
public int fill(Supplier<E> s, int limit) {<NEW_LINE>if (null == s)<NEW_LINE>throw new IllegalArgumentException("supplier is null");<NEW_LINE>if (limit < 0)<NEW_LINE>throw new IllegalArgumentException("limit is negative:" + limit);<NEW_LINE>if (limit == 0)<NEW_LINE>return 0;<NEW_LINE>final int parallelQueuesMask = this.parallelQueuesMask;<NEW_LINE>int start = (int) (Thread.currentThread(<MASK><NEW_LINE>final MpscArrayQueue<E>[] queues = this.queues;<NEW_LINE>int filled = queues[start].fill(s, limit);<NEW_LINE>if (filled == limit) {<NEW_LINE>return limit;<NEW_LINE>} else {<NEW_LINE>// we already offered to first queue, try the rest<NEW_LINE>for (int i = start + 1; i < start + parallelQueuesMask + 1; i++) {<NEW_LINE>filled += queues[i & parallelQueuesMask].fill(s, limit - filled);<NEW_LINE>if (filled == limit) {<NEW_LINE>return limit;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// this is a relaxed offer, we can fail for any reason we like<NEW_LINE>return filled;<NEW_LINE>}<NEW_LINE>}
).getId() & parallelQueuesMask);
56,196
private CompiledCondition generateExpiryCompiledCondition() {<NEW_LINE>MetaStreamEvent tableMetaStreamEvent = new MetaStreamEvent();<NEW_LINE>tableMetaStreamEvent.setEventType(MetaStreamEvent.EventType.TABLE);<NEW_LINE>TableDefinition matchingTableDefinition = TableDefinition.id(cacheTable.getTableDefinition().getId());<NEW_LINE>for (Attribute attribute : cacheTable.getTableDefinition().getAttributeList()) {<NEW_LINE>tableMetaStreamEvent.addOutputData(attribute);<NEW_LINE>matchingTableDefinition.attribute(attribute.getName(), attribute.getType());<NEW_LINE>}<NEW_LINE>tableMetaStreamEvent.addInputDefinition(matchingTableDefinition);<NEW_LINE>streamEventFactory = new StreamEventFactory(tableMetaStreamEvent);<NEW_LINE>Variable rightExpressionForSubtract = new Variable(CACHE_TABLE_TIMESTAMP_ADDED);<NEW_LINE>rightExpressionForSubtract.setStreamId(cacheTable.getTableDefinition().getId());<NEW_LINE>Expression rightExpressionForCompare = new LongConstant(retentionPeriod);<NEW_LINE>Compare.Operator greaterThanOperator = Compare.Operator.GREATER_THAN;<NEW_LINE>MetaStreamEvent currentTimeMetaStreamEvent = new MetaStreamEvent();<NEW_LINE>currentTimeMetaStreamEvent.setEventType(MetaStreamEvent.EventType.TABLE);<NEW_LINE>Attribute currentTimeAttribute = new Attribute(CACHE_EXPIRE_CURRENT_TIME, Attribute.Type.LONG);<NEW_LINE>currentTimeMetaStreamEvent.addOutputData(currentTimeAttribute);<NEW_LINE>TableDefinition currentTimeTableDefinition = TableDefinition.id("");<NEW_LINE>currentTimeTableDefinition.attribute(CACHE_EXPIRE_CURRENT_TIME, Attribute.Type.LONG);<NEW_LINE>currentTimeMetaStreamEvent.addInputDefinition(currentTimeTableDefinition);<NEW_LINE>MetaStateEvent metaStateEvent = new MetaStateEvent(2);<NEW_LINE>metaStateEvent.addEvent(currentTimeMetaStreamEvent);<NEW_LINE>metaStateEvent.addEvent(tableMetaStreamEvent);<NEW_LINE>MatchingMetaInfoHolder matchingMetaInfoHolder = MatcherParser.constructMatchingMetaStateHolder(metaStateEvent, 0, cacheTable.getTableDefinition(), 0);<NEW_LINE>List<VariableExpressionExecutor> <MASK><NEW_LINE>Expression leftExpressionForSubtract = new Variable(CACHE_EXPIRE_CURRENT_TIME);<NEW_LINE>Expression leftExpressionForCompare = new Subtract(leftExpressionForSubtract, rightExpressionForSubtract);<NEW_LINE>Expression deleteCondition = new Compare(leftExpressionForCompare, greaterThanOperator, rightExpressionForCompare);<NEW_LINE>SiddhiQueryContext siddhiQueryContext = new SiddhiQueryContext(siddhiAppContext, "expiryDeleteQuery");<NEW_LINE>return cacheTable.compileCondition(deleteCondition, matchingMetaInfoHolder, variableExpressionExecutors, tableMap, siddhiQueryContext);<NEW_LINE>}
variableExpressionExecutors = new ArrayList<>();
1,852,202
private void replaceLocation(Map<String, String> urlToFileMap, String baseUrl, SimpleValue wsdlImport) throws Exception {<NEW_LINE>String location = wsdlImport.getStringValue();<NEW_LINE>if (location != null) {<NEW_LINE>if (location.startsWith("file:") || location.indexOf("://") > 0) {<NEW_LINE>String newLocation = urlToFileMap.get(location);<NEW_LINE>if (newLocation != null) {<NEW_LINE>wsdlImport.setStringValue(newLocation);<NEW_LINE>} else {<NEW_LINE>throw new <MASK><NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>String loc = Tools.joinRelativeUrl(baseUrl, location);<NEW_LINE>String newLocation = urlToFileMap.get(loc);<NEW_LINE>if (newLocation == null) {<NEW_LINE>newLocation = urlToFileMap.get(loc.replaceAll("/", "\\\\"));<NEW_LINE>}<NEW_LINE>if (newLocation == null) {<NEW_LINE>newLocation = urlToFileMap.get(loc.replaceAll("\\\\", "/"));<NEW_LINE>}<NEW_LINE>if (newLocation != null) {<NEW_LINE>wsdlImport.setStringValue(newLocation);<NEW_LINE>} else {<NEW_LINE>throw new Exception("Missing local file for [" + loc + "]");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
Exception("Missing local file for [" + newLocation + "]");
188,906
private int[] computeVisibleSpan() {<NEW_LINE>Component parent = pane.getParent();<NEW_LINE>if (parent instanceof JLayeredPane) {<NEW_LINE>parent = parent.getParent();<NEW_LINE>}<NEW_LINE>if (parent instanceof JViewport) {<NEW_LINE>JViewport vp = (JViewport) parent;<NEW_LINE>Point start = vp.getViewPosition();<NEW_LINE>Dimension size = vp.getExtentSize();<NEW_LINE>Point end = new Point((int) (start.getX() + size.getWidth()), (int) (start.getY() <MASK><NEW_LINE>int startPosition = pane.viewToModel(start);<NEW_LINE>int endPosition = pane.viewToModel(end);<NEW_LINE>if (parentWithListener != vp) {<NEW_LINE>vp.addChangeListener(WeakListeners.change(this, vp));<NEW_LINE>parentWithListener = vp;<NEW_LINE>}<NEW_LINE>return new int[] { startPosition, endPosition };<NEW_LINE>}<NEW_LINE>return new int[] { 0, pane.getDocument().getLength() };<NEW_LINE>}
+ size.getHeight()));