idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
1,300,174
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {<NEW_LINE>super.onViewCreated(view, savedInstanceState);<NEW_LINE>quickActionRegistry = getApplication().getQuickActionRegistry();<NEW_LINE>long actionId = savedInstanceState == null ? getArguments().getLong(KEY_ACTION_ID) : savedInstanceState.getLong(KEY_ACTION_ID);<NEW_LINE>int type = savedInstanceState == null ? getArguments().getInt(KEY_ACTION_TYPE) : savedInstanceState.getInt(KEY_ACTION_TYPE);<NEW_LINE>isNew = savedInstanceState == null ? isNew = actionId == 0 : savedInstanceState.getBoolean(KEY_ACTION_IS_NEW);<NEW_LINE>action = QuickActionRegistry.produceAction(isNew ? quickActionRegistry.newActionByType(type) <MASK><NEW_LINE>setupToolbar(view);<NEW_LINE>setupHeader(view, savedInstanceState);<NEW_LINE>setupFooter(view);<NEW_LINE>action.drawUI((ViewGroup) getView().findViewById(R.id.container), getMapActivity());<NEW_LINE>}
: quickActionRegistry.getQuickAction(actionId));
768,660
<R> void sendRpc(YRpc<R> rpc) {<NEW_LINE>if (!rpc.deadlineTracker.hasDeadline()) {<NEW_LINE>LOG.warn(getPeerUuidLoggingString() + " sending an rpc without a timeout " + rpc);<NEW_LINE>}<NEW_LINE>if (chan != null) {<NEW_LINE>final ChannelBuffer serialized = encode(rpc);<NEW_LINE>if (serialized == null) {<NEW_LINE>// Error during encoding.<NEW_LINE>// Stop here. RPC has been failed already.<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Volatile read.<NEW_LINE>final Channel chan = this.chan;<NEW_LINE>if (chan != null) {<NEW_LINE>// Double check if we disconnected during encode().<NEW_LINE>Channels.write(chan, serialized);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>boolean tryagain = false;<NEW_LINE>boolean copyOfDead;<NEW_LINE>synchronized (this) {<NEW_LINE>copyOfDead = this.dead;<NEW_LINE>// Check if we got connected while entering this synchronized block.<NEW_LINE>if (chan != null) {<NEW_LINE>tryagain = true;<NEW_LINE>} else if (!copyOfDead) {<NEW_LINE>if (pending_rpcs == null) {<NEW_LINE>pending_rpcs = new ArrayList<YRpc<?>>();<NEW_LINE>}<NEW_LINE>pending_rpcs.add(rpc);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (copyOfDead) {<NEW_LINE>failOrRetryRpc(<MASK><NEW_LINE>return;<NEW_LINE>} else if (tryagain) {<NEW_LINE>// This recursion will not lead to a loop because we only get here if we<NEW_LINE>// connected while entering the synchronized block above. So when trying<NEW_LINE>// a second time, we will either succeed to send the RPC if we're still<NEW_LINE>// connected, or fail through to the code below if we got disconnected<NEW_LINE>// in the mean time.<NEW_LINE>sendRpc(rpc);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}
rpc, new ConnectionResetException(null));
613,637
protected Key copyPartialKey(Key key, PartialKey part) {<NEW_LINE>Key keyCopy;<NEW_LINE>switch(part) {<NEW_LINE>case ROW:<NEW_LINE>keyCopy = new Key(key.getRow());<NEW_LINE>break;<NEW_LINE>case ROW_COLFAM:<NEW_LINE>keyCopy = new Key(key.getRow(), key.getColumnFamily());<NEW_LINE>break;<NEW_LINE>case ROW_COLFAM_COLQUAL:<NEW_LINE>keyCopy = new Key(key.getRow(), key.getColumnFamily(), key.getColumnQualifier());<NEW_LINE>break;<NEW_LINE>case ROW_COLFAM_COLQUAL_COLVIS:<NEW_LINE>keyCopy = new Key(key.getRow(), key.getColumnFamily(), key.getColumnQualifier(<MASK><NEW_LINE>break;<NEW_LINE>case ROW_COLFAM_COLQUAL_COLVIS_TIME:<NEW_LINE>keyCopy = new Key(key.getRow(), key.getColumnFamily(), key.getColumnQualifier(), key.getColumnVisibility(), key.getTimestamp());<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new IllegalArgumentException("Unsupported key part: " + part);<NEW_LINE>}<NEW_LINE>return keyCopy;<NEW_LINE>}
), key.getColumnVisibility());
181,043
protected Void copyCallback(AsyncCallbackDispatcher<DataObjectManagerImpl, CopyCommandResult> callback, CopyContext<CreateCmdResult> context) {<NEW_LINE>CopyCommandResult result = callback.getResult();<NEW_LINE>DataObject destObj = context.destObj;<NEW_LINE>if (result.isFailed()) {<NEW_LINE>try {<NEW_LINE>objectInDataStoreMgr.update(destObj, Event.OperationFailed);<NEW_LINE>} catch (NoTransitionException e) {<NEW_LINE>s_logger.debug("Failed to update copying state", e);<NEW_LINE>} catch (ConcurrentOperationException e) {<NEW_LINE>s_logger.debug("Failed to update copying state", e);<NEW_LINE>}<NEW_LINE>CreateCmdResult res = new CreateCmdResult(null, null);<NEW_LINE>res.setResult(result.getResult());<NEW_LINE>context.getParentCallback().complete(res);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>objectInDataStoreMgr.update(<MASK><NEW_LINE>} catch (NoTransitionException e) {<NEW_LINE>s_logger.debug("Failed to update copying state: ", e);<NEW_LINE>try {<NEW_LINE>objectInDataStoreMgr.update(destObj, ObjectInDataStoreStateMachine.Event.OperationFailed);<NEW_LINE>} catch (Exception e1) {<NEW_LINE>s_logger.debug("failed to further change state to OperationFailed", e1);<NEW_LINE>}<NEW_LINE>CreateCmdResult res = new CreateCmdResult(null, null);<NEW_LINE>res.setResult("Failed to update copying state: " + e.toString());<NEW_LINE>context.getParentCallback().complete(res);<NEW_LINE>} catch (ConcurrentOperationException e) {<NEW_LINE>s_logger.debug("Failed to update copying state: ", e);<NEW_LINE>try {<NEW_LINE>objectInDataStoreMgr.update(destObj, ObjectInDataStoreStateMachine.Event.OperationFailed);<NEW_LINE>} catch (Exception e1) {<NEW_LINE>s_logger.debug("failed to further change state to OperationFailed", e1);<NEW_LINE>}<NEW_LINE>CreateCmdResult res = new CreateCmdResult(null, null);<NEW_LINE>res.setResult("Failed to update copying state: " + e.toString());<NEW_LINE>context.getParentCallback().complete(res);<NEW_LINE>}<NEW_LINE>CreateCmdResult res = new CreateCmdResult(result.getPath(), null);<NEW_LINE>context.getParentCallback().complete(res);<NEW_LINE>return null;<NEW_LINE>}
destObj, ObjectInDataStoreStateMachine.Event.OperationSuccessed);
1,439,954
public static void main(String[] args) {<NEW_LINE>Properties props = new Properties();<NEW_LINE><MASK><NEW_LINE>props.put("acks", "all");<NEW_LINE>props.put("retries", 0);<NEW_LINE>props.put("batch.size", 16384);<NEW_LINE>props.put("linger.ms", 1);<NEW_LINE>props.put("buffer.memory", 33554432);<NEW_LINE>props.put("key.serializer", "org.apache.kafka.common.serialization.StringSerializer");<NEW_LINE>props.put("value.serializer", "org.apache.kafka.common.serialization.StringSerializer");<NEW_LINE>Producer<String, String> producer = new KafkaProducer<>(props);<NEW_LINE>producer.send(new ProducerRecord("my-topic", "data_increment_data.mysql.mysql0.db.table.1.0.0(it should be same as namespace in value)", "message generated by edp.wormhole.ums.GenerateJavaUms"));<NEW_LINE>producer.close();<NEW_LINE>}
props.put("bootstrap.servers", "localhost:9092");
1,239,837
protected void copyTemplateToTargetFilesystemStorageIfNeeded(VolumeInfo srcVolumeInfo, StoragePool srcStoragePool, DataStore destDataStore, StoragePool destStoragePool, Host destHost) {<NEW_LINE>if (srcVolumeInfo.getVolumeType() != Volume.Type.ROOT || srcVolumeInfo.getTemplateId() == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>VMTemplateStoragePoolVO sourceVolumeTemplateStoragePoolVO = vmTemplatePoolDao.findByPoolTemplate(destStoragePool.getId(), srcVolumeInfo.getTemplateId(), null);<NEW_LINE>if (sourceVolumeTemplateStoragePoolVO == null && (isStoragePoolTypeInList(destStoragePool.getPoolType(), StoragePoolType.Filesystem, StoragePoolType.SharedMountPoint))) {<NEW_LINE>DataStore sourceTemplateDataStore = dataStoreManagerImpl.getRandomImageStore(srcVolumeInfo.getDataCenterId());<NEW_LINE>if (sourceTemplateDataStore != null) {<NEW_LINE>TemplateInfo sourceTemplateInfo = templateDataFactory.getTemplate(srcVolumeInfo.getTemplateId(), sourceTemplateDataStore);<NEW_LINE>TemplateObjectTO sourceTemplate = new TemplateObjectTO(sourceTemplateInfo);<NEW_LINE>LOGGER.debug(String.format("Could not find template [id=%s, name=%s] on the storage pool [id=%s]; copying the template to the target storage pool.", srcVolumeInfo.getTemplateId(), sourceTemplateInfo.getName(), destDataStore.getId()));<NEW_LINE>TemplateInfo destTemplateInfo = templateDataFactory.getTemplate(srcVolumeInfo.getTemplateId(), destDataStore);<NEW_LINE>final TemplateObjectTO destTemplate = new TemplateObjectTO(destTemplateInfo);<NEW_LINE>Answer copyCommandAnswer = sendCopyCommand(destHost, sourceTemplate, destTemplate, destDataStore);<NEW_LINE>if (copyCommandAnswer != null && copyCommandAnswer.getResult()) {<NEW_LINE>updateTemplateReferenceIfSuccessfulCopy(srcVolumeInfo.getTemplateId(), destTemplateInfo.getUuid(), destDataStore.getId(), destTemplate.getSize());<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>LOGGER.debug(String.format("Skipping 'copy template to target filesystem storage before migration' due to the template [%s] already exist on the storage pool [%s].", srcVolumeInfo.getTemplateId()<MASK><NEW_LINE>}
, destStoragePool.getId()));
1,828,142
ActionResult<Wo> execute(EffectivePerson effectivePerson, JsonElement jsonElement) throws Exception {<NEW_LINE>try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {<NEW_LINE>Wi wi = this.convertToWrapIn(jsonElement, Wi.class);<NEW_LINE>ActionResult<Wo> result = new ActionResult<>();<NEW_LINE>Wo wo = new Wo();<NEW_LINE>Business business = new Business(emc);<NEW_LINE>Person person = business.person().pick(wi.getPerson());<NEW_LINE>if (null == person) {<NEW_LINE>wo.setValue(false);<NEW_LINE>logger.warn("user {} append personAttribute {} fail, person {} not exist.", effectivePerson.getDistinguishedName(), StringUtils.join(wi.getAttributeList(), ","), wi.getPerson());<NEW_LINE>} else if ((!effectivePerson.isManager()) && effectivePerson.isNotPerson(person.getDistinguishedName())) {<NEW_LINE>wo.setValue(false);<NEW_LINE>logger.warn("user {} append personAttribute person: {}, value: {} fail, permission denied.", effectivePerson.getDistinguishedName(), wi.getPerson(), StringUtils.join(wi.getAttributeList(), ","));<NEW_LINE>} else {<NEW_LINE>emc.beginTransaction(PersonAttribute.class);<NEW_LINE>PersonAttribute personAttribute = this.get(business, person, wi.getName());<NEW_LINE>if (null == personAttribute) {<NEW_LINE>personAttribute = new PersonAttribute();<NEW_LINE>personAttribute.setAttributeList(ListTools.trim(wi.getAttributeList(), true, false));<NEW_LINE>personAttribute.setName(wi.getName());<NEW_LINE>personAttribute.setPerson(person.getId());<NEW_LINE>emc.persist(personAttribute, CheckPersistType.all);<NEW_LINE>} else {<NEW_LINE>List<String> <MASK><NEW_LINE>list.addAll(personAttribute.getAttributeList());<NEW_LINE>list.addAll(wi.getAttributeList());<NEW_LINE>personAttribute.setAttributeList(ListTools.trim(list, true, false));<NEW_LINE>personAttribute.setName(wi.getName());<NEW_LINE>personAttribute.setPerson(person.getId());<NEW_LINE>emc.check(personAttribute, CheckPersistType.all);<NEW_LINE>}<NEW_LINE>wo.setValue(true);<NEW_LINE>emc.commit();<NEW_LINE>CacheManager.notify(PersonAttribute.class);<NEW_LINE>CacheManager.notify(Person.class);<NEW_LINE>}<NEW_LINE>result.setData(wo);<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>}
list = new ArrayList<>();
1,620,746
public Route redirectIfNotLeader(final Route leaderRoute) {<NEW_LINE>MasterDescription latestMaster = masterMonitor.getLatestMaster();<NEW_LINE>if (leadershipManager.isLeader() || isLocalHost(latestMaster)) {<NEW_LINE>if (leadershipManager.isReady()) {<NEW_LINE>return leaderRoute;<NEW_LINE>} else {<NEW_LINE>return extractUri(uri -> {<NEW_LINE>logger.info("leader is not ready, returning 503 for {}", uri);<NEW_LINE>api503MasterNotReady.increment();<NEW_LINE>return complete(StatusCodes.SERVICE_UNAVAILABLE, "Mantis master awaiting to be ready");<NEW_LINE>});<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>String hostname = latestMaster.getHostname();<NEW_LINE>int apiPort = latestMaster.getApiPort();<NEW_LINE>return extractUri(uri -> {<NEW_LINE>Uri redirectUri = uri.host<MASK><NEW_LINE>apiRedirectsToLeader.increment();<NEW_LINE>logger.info("redirecting request {} to leader", redirectUri.toString());<NEW_LINE>return redirect(redirectUri, StatusCodes.FOUND);<NEW_LINE>});<NEW_LINE>}<NEW_LINE>}
(hostname).port(apiPort);
1,042,903
private void initializeSoot() {<NEW_LINE>logger.info("Initializing Soot...");<NEW_LINE>final String androidJar = config.getAnalysisFileConfig().getAndroidPlatformDir();<NEW_LINE>final String apkFileLocation = config.getAnalysisFileConfig().getTargetAPKFile();<NEW_LINE>// Clean up any old Soot instance we may have<NEW_LINE>G.reset();<NEW_LINE>Options.v().set_no_bodies_for_excluded(true);<NEW_LINE>Options.v().set_allow_phantom_refs(true);<NEW_LINE>if (config.getWriteOutputFiles())<NEW_LINE>Options.v().set_output_format(Options.output_format_jimple);<NEW_LINE>else<NEW_LINE>Options.v().set_output_format(Options.output_format_none);<NEW_LINE>Options.v().set_whole_program(true);<NEW_LINE>Options.v().set_process_dir(Collections.singletonList(apkFileLocation));<NEW_LINE>if (forceAndroidJar)<NEW_LINE>Options.v().set_force_android_jar(androidJar);<NEW_LINE>else<NEW_LINE>Options.v().set_android_jars(androidJar);<NEW_LINE>Options.v().set_src_prec(Options.src_prec_apk_class_jimple);<NEW_LINE>Options.v().set_keep_offset(false);<NEW_LINE>Options.v().set_keep_line_number(config.getEnableLineNumbers());<NEW_LINE>Options.v().set_throw_analysis(Options.throw_analysis_dalvik);<NEW_LINE>Options.v().set_process_multiple_dex(config.getMergeDexFiles());<NEW_LINE>Options.v().set_ignore_resolution_errors(true);<NEW_LINE>// Set soot phase option if original names should be used<NEW_LINE>if (config.getEnableOriginalNames())<NEW_LINE>Options.v().setPhaseOption("jb", "use-original-names:true");<NEW_LINE>// Set the Soot configuration options. Note that this will needs to be<NEW_LINE>// done before we compute the classpath.<NEW_LINE>if (sootConfig != null)<NEW_LINE>sootConfig.setSootOptions(<MASK><NEW_LINE>Options.v().set_soot_classpath(getClasspath());<NEW_LINE>Main.v().autoSetOptions();<NEW_LINE>configureCallgraph();<NEW_LINE>// Load whatever we need<NEW_LINE>logger.info("Loading dex files...");<NEW_LINE>Scene.v().loadNecessaryClasses();<NEW_LINE>// Make sure that we have valid Jimple bodies<NEW_LINE>PackManager.v().getPack("wjpp").apply();<NEW_LINE>// Patch the callgraph to support additional edges. We do this now,<NEW_LINE>// because during callback discovery, the context-insensitive callgraph<NEW_LINE>// algorithm would flood us with invalid edges.<NEW_LINE>LibraryClassPatcher patcher = getLibraryClassPatcher();<NEW_LINE>patcher.patchLibraries();<NEW_LINE>}
Options.v(), config);
952,174
private void checkOverlaps(Replacement replacement) {<NEW_LINE>Range<Integer> replacementRange = replacement.range();<NEW_LINE>Collection<Replacement> overlap = overlaps.subRangeMap(replacementRange)<MASK><NEW_LINE>checkArgument(overlap.isEmpty(), "%s overlaps with existing replacements: %s", replacement, Joiner.on(", ").join(overlap));<NEW_LINE>Set<Integer> containedZeroLengthRangeStarts = zeroLengthRanges.subSet(replacementRange.lowerEndpoint(), /* fromInclusive= */<NEW_LINE>false, replacementRange.upperEndpoint(), /* toInclusive= */<NEW_LINE>false);<NEW_LINE>checkArgument(containedZeroLengthRangeStarts.isEmpty(), "%s overlaps with existing zero-length replacements: %s", replacement, Joiner.on(", ").join(containedZeroLengthRangeStarts));<NEW_LINE>overlaps.put(replacementRange, replacement);<NEW_LINE>if (replacementRange.isEmpty()) {<NEW_LINE>zeroLengthRanges.add(replacementRange.lowerEndpoint());<NEW_LINE>}<NEW_LINE>}
.asMapOfRanges().values();
95,496
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {<NEW_LINE>builder.startObject();<NEW_LINE>builder.stringListField(INDEX_PATTERNS.getPreferredName(), this.indexPatterns);<NEW_LINE>if (this.template != null) {<NEW_LINE>builder.field(TEMPLATE.getPreferredName(), this.template, params);<NEW_LINE>}<NEW_LINE>if (this.componentTemplates != null) {<NEW_LINE>builder.stringListField(COMPOSED_OF.<MASK><NEW_LINE>}<NEW_LINE>if (this.priority != null) {<NEW_LINE>builder.field(PRIORITY.getPreferredName(), priority);<NEW_LINE>}<NEW_LINE>if (this.version != null) {<NEW_LINE>builder.field(VERSION.getPreferredName(), version);<NEW_LINE>}<NEW_LINE>if (this.metadata != null) {<NEW_LINE>builder.field(METADATA.getPreferredName(), metadata);<NEW_LINE>}<NEW_LINE>if (this.dataStreamTemplate != null) {<NEW_LINE>builder.field(DATA_STREAM.getPreferredName(), dataStreamTemplate, params);<NEW_LINE>}<NEW_LINE>if (this.allowAutoCreate != null) {<NEW_LINE>builder.field(ALLOW_AUTO_CREATE.getPreferredName(), allowAutoCreate);<NEW_LINE>}<NEW_LINE>builder.endObject();<NEW_LINE>return builder;<NEW_LINE>}
getPreferredName(), this.componentTemplates);
1,733,928
public boolean await(long time, TimeUnit unit) throws InterruptedException {<NEW_LINE>long remainTime = unit.toMillis(time);<NEW_LINE><MASK><NEW_LINE>if (getCount() == 0) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>CompletableFuture<RedissonCountDownLatchEntry> promise = subscribe();<NEW_LINE>try {<NEW_LINE>promise.toCompletableFuture().get(time, unit);<NEW_LINE>} catch (ExecutionException | CancellationException e) {<NEW_LINE>// skip<NEW_LINE>} catch (TimeoutException e) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>remainTime -= System.currentTimeMillis() - current;<NEW_LINE>if (remainTime <= 0) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>while (getCount() > 0) {<NEW_LINE>if (remainTime <= 0) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>current = System.currentTimeMillis();<NEW_LINE>// waiting for open state<NEW_LINE>commandExecutor.getNow(promise).getLatch().await(remainTime, TimeUnit.MILLISECONDS);<NEW_LINE>remainTime -= System.currentTimeMillis() - current;<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} finally {<NEW_LINE>unsubscribe(commandExecutor.getNow(promise));<NEW_LINE>}<NEW_LINE>}
long current = System.currentTimeMillis();
1,588,492
private static Map<TypeAlias, jnr.ffi.NativeType> buildTypeMap() {<NEW_LINE>Map<TypeAlias, jnr.ffi.NativeType> m = new EnumMap<TypeAlias, jnr.ffi.NativeType>(TypeAlias.class);<NEW_LINE>m.put(TypeAlias.int8_t, NativeType.SCHAR);<NEW_LINE>m.put(TypeAlias.u_int8_t, NativeType.UCHAR);<NEW_LINE>m.put(TypeAlias.int16_t, NativeType.SSHORT);<NEW_LINE>m.put(TypeAlias.u_int16_t, NativeType.USHORT);<NEW_LINE>m.put(TypeAlias.int32_t, NativeType.SINT);<NEW_LINE>m.put(TypeAlias.u_int32_t, NativeType.UINT);<NEW_LINE>m.put(TypeAlias.int64_t, NativeType.ADDRESS);<NEW_LINE>m.put(TypeAlias.u_int64_t, NativeType.ADDRESS);<NEW_LINE>m.put(TypeAlias.intptr_t, NativeType.SLONG);<NEW_LINE>m.put(TypeAlias.uintptr_t, NativeType.ULONG);<NEW_LINE>m.put(TypeAlias.caddr_t, NativeType.ADDRESS);<NEW_LINE>m.put(TypeAlias.dev_t, NativeType.ULONG);<NEW_LINE>m.put(TypeAlias.blkcnt_t, NativeType.SLONG);<NEW_LINE>m.put(TypeAlias.blksize_t, NativeType.SLONG);<NEW_LINE>m.put(TypeAlias.gid_t, NativeType.UINT);<NEW_LINE>m.put(TypeAlias.in_addr_t, NativeType.UINT);<NEW_LINE>m.put(TypeAlias.in_port_t, NativeType.USHORT);<NEW_LINE>m.put(TypeAlias.ino_t, NativeType.ULONG);<NEW_LINE>m.put(TypeAlias.ino64_t, NativeType.ULONG);<NEW_LINE>m.put(TypeAlias.key_t, NativeType.SINT);<NEW_LINE>m.put(TypeAlias.mode_t, NativeType.UINT);<NEW_LINE>m.put(TypeAlias.nlink_t, NativeType.ULONG);<NEW_LINE>m.put(TypeAlias.id_t, NativeType.UINT);<NEW_LINE>m.put(TypeAlias.pid_t, NativeType.SINT);<NEW_LINE>m.put(TypeAlias.off_t, NativeType.SLONG);<NEW_LINE>m.put(TypeAlias.swblk_t, NativeType.SLONG);<NEW_LINE>m.put(TypeAlias.uid_t, NativeType.UINT);<NEW_LINE>m.put(TypeAlias.clock_t, NativeType.SLONG);<NEW_LINE>m.put(TypeAlias.size_t, NativeType.ULONG);<NEW_LINE>m.put(TypeAlias.ssize_t, NativeType.SLONG);<NEW_LINE>m.put(TypeAlias.time_t, NativeType.SLONG);<NEW_LINE>m.put(TypeAlias.fsblkcnt_t, NativeType.ULONG);<NEW_LINE>m.put(TypeAlias.fsfilcnt_t, NativeType.ULONG);<NEW_LINE>m.put(TypeAlias.sa_family_t, NativeType.USHORT);<NEW_LINE>m.put(TypeAlias.socklen_t, NativeType.UINT);<NEW_LINE>m.put(<MASK><NEW_LINE>m.put(TypeAlias.cc_t, NativeType.UCHAR);<NEW_LINE>m.put(TypeAlias.speed_t, NativeType.UINT);<NEW_LINE>m.put(TypeAlias.tcflag_t, NativeType.UINT);<NEW_LINE>return m;<NEW_LINE>}
TypeAlias.rlim_t, NativeType.ULONG);
77,911
protected void update() {<NEW_LINE>int connectionType = ((IDiagramModelConnection) getFirstSelectedObject()).getType();<NEW_LINE>if ((connectionType & IDiagramModelConnection.ARROW_FILL_SOURCE) != 0) {<NEW_LINE>fValue = IDiagramModelConnection.ARROW_FILL_SOURCE;<NEW_LINE>fButton.setImage(IArchiImages.ImageFactory.getImage(IArchiImages.ARROW_SOURCE_FILL));<NEW_LINE>} else if ((connectionType & IDiagramModelConnection.ARROW_HOLLOW_SOURCE) != 0) {<NEW_LINE>fValue = IDiagramModelConnection.ARROW_HOLLOW_SOURCE;<NEW_LINE>fButton.setImage(IArchiImages.ImageFactory.getImage(IArchiImages.ARROW_SOURCE_HOLLOW));<NEW_LINE>} else if ((connectionType & IDiagramModelConnection.ARROW_LINE_SOURCE) != 0) {<NEW_LINE>fValue = IDiagramModelConnection.ARROW_LINE_SOURCE;<NEW_LINE>fButton.setImage(IArchiImages.ImageFactory<MASK><NEW_LINE>} else {<NEW_LINE>fValue = IDiagramModelConnection.ARROW_NONE;<NEW_LINE>fButton.setImage(IArchiImages.ImageFactory.getImage(IArchiImages.LINE_SOLID));<NEW_LINE>}<NEW_LINE>}
.getImage(IArchiImages.ARROW_SOURCE_LINE));
315,234
public String copyGroup(String src, String groupId) {<NEW_LINE>isTrue(!root.readonly(), IS_READ_ONLY);<NEW_LINE>Group group = groupCache.get(groupId);<NEW_LINE>isTrue("0".equals(groupId<MASK><NEW_LINE>isTrue(!Objects.equals(src, groupId), SRC_GROUP_CONFLICT);<NEW_LINE>Group srcGroup = groupCache.get(src);<NEW_LINE>notNull(srcGroup, GROUP_NOT_FOUND);<NEW_LINE>Group newGroup = new Group();<NEW_LINE>newGroup.setType(srcGroup.getType());<NEW_LINE>newGroup.setParentId(groupId);<NEW_LINE>newGroup.setName(srcGroup.getName() + "(Copy)");<NEW_LINE>newGroup.setPath(Objects.toString(srcGroup.getPath(), "") + "_copy");<NEW_LINE>newGroup.setOptions(srcGroup.getOptions());<NEW_LINE>newGroup.setPaths(srcGroup.getPaths());<NEW_LINE>newGroup.setProperties(srcGroup.getProperties());<NEW_LINE>saveGroup(newGroup);<NEW_LINE>listFiles(src).stream().map(MagicEntity::copy).peek(it -> it.setGroupId(newGroup.getId())).peek(it -> it.setId(null)).forEach(this::saveFile);<NEW_LINE>return newGroup.getId();<NEW_LINE>}
) || group != null, GROUP_NOT_FOUND);
749,778
private void extendPlugin(PluginBean pluginBean) {<NEW_LINE>myAppComponents = mergeElements(myAppComponents, pluginBean.applicationComponents);<NEW_LINE>myProjectComponents = mergeElements(myProjectComponents, pluginBean.projectComponents);<NEW_LINE>myActionsElements = mergeElements(myActionsElements, pluginBean.actions);<NEW_LINE>myApplicationListeners = mergeElements(myApplicationListeners, pluginBean.applicationListeners);<NEW_LINE>myProjectListeners = <MASK><NEW_LINE>myModuleListeners = mergeElements(myModuleListeners, pluginBean.moduleListeners);<NEW_LINE>List<ExtensionInfo> extensions = pluginBean.extensions;<NEW_LINE>if (extensions != null && !extensions.isEmpty()) {<NEW_LINE>initializeExtensions();<NEW_LINE>for (ExtensionInfo extension : extensions) {<NEW_LINE>String extId = extension.getPluginId() + "." + extension.getElement().getName();<NEW_LINE>myExtensions.putValue(extId, extension);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>List<SimpleXmlElement> extensionPoints = pluginBean.extensionPoints;<NEW_LINE>if (extensionPoints != null && !extensionPoints.isEmpty()) {<NEW_LINE>initializeExtensionPoints();<NEW_LINE>for (SimpleXmlElement extensionPoint : extensionPoints) {<NEW_LINE>String areaId = extensionPoint.getAttributeValue("area", "");<NEW_LINE>if (areaId.isEmpty()) {<NEW_LINE>areaId = "APPLICATION";<NEW_LINE>}<NEW_LINE>myExtensionsPoints.putValue(areaId, extensionPoint);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
mergeElements(myProjectListeners, pluginBean.projectListeners);
117,589
// Converts an object to a byte array, using enhancements when possible to reduce size<NEW_LINE>// reveals customer data<NEW_LINE>@Trivial<NEW_LINE>public byte[] serialize(Object value) throws IOException {<NEW_LINE>final boolean trace = TraceComponent.isAnyTracingEnabled();<NEW_LINE>BuiltinSerializationInfo<?> info = SerializationInfoCache.lookupByClass(value.getClass());<NEW_LINE>byte[] objbuf = null;<NEW_LINE>if (info != null) {<NEW_LINE>if (trace && tc.isDebugEnabled())<NEW_LINE>Tr.debug(this, tc, "serializing with custom objectToBytes");<NEW_LINE>// This is a value that can be written directly to bytes<NEW_LINE><MASK><NEW_LINE>} else {<NEW_LINE>if (trace && tc.isDebugEnabled())<NEW_LINE>Tr.debug(this, tc, "serializing with standard writeObject");<NEW_LINE>// Go through normal serialization process<NEW_LINE>ByteArrayOutputStream baos = new ByteArrayOutputStream();<NEW_LINE>ObjectOutputStream oos = cacheStoreService.serializationService.createObjectOutputStream(baos);<NEW_LINE>try {<NEW_LINE>oos.writeObject(value);<NEW_LINE>oos.flush();<NEW_LINE>objbuf = baos.toByteArray();<NEW_LINE>} finally {<NEW_LINE>oos.close();<NEW_LINE>baos.close();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return objbuf;<NEW_LINE>}
objbuf = info.objectToBytes(value);
159,623
public void onResponse(Call<DirectionsResponse> call, Response<DirectionsResponse> response) {<NEW_LINE>// You can get the generic HTTP info about the response<NEW_LINE>Timber.d("Response code: " + response.code());<NEW_LINE>if (response.body() == null) {<NEW_LINE>Timber.e("No routes found, make sure you set the right user and access token.");<NEW_LINE>return;<NEW_LINE>} else if (response.body().routes().size() < 1) {<NEW_LINE>Timber.e("No routes found");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>switch(profile) {<NEW_LINE>case DirectionsCriteria.PROFILE_DRIVING:<NEW_LINE>drivingRoute = response.body().<MASK><NEW_LINE>drivingButton.setText(String.format(getString(R.string.driving_profile), String.valueOf(TimeUnit.SECONDS.toMinutes(drivingRoute.duration().longValue()))));<NEW_LINE>if (!firstRouteDrawn) {<NEW_LINE>showRouteLine();<NEW_LINE>firstRouteDrawn = true;<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case DirectionsCriteria.PROFILE_WALKING:<NEW_LINE>walkingRoute = response.body().routes().get(0);<NEW_LINE>walkingButton.setText(String.format(getString(R.string.walking_profile), String.valueOf(TimeUnit.SECONDS.toMinutes(walkingRoute.duration().longValue()))));<NEW_LINE>break;<NEW_LINE>case DirectionsCriteria.PROFILE_CYCLING:<NEW_LINE>cyclingRoute = response.body().routes().get(0);<NEW_LINE>cyclingButton.setText(String.format(getString(R.string.cycling_profile), String.valueOf(TimeUnit.SECONDS.toMinutes(cyclingRoute.duration().longValue()))));<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>if (fromMapClick) {<NEW_LINE>showRouteLine();<NEW_LINE>}<NEW_LINE>}
routes().get(0);
780,576
public ReturnedValueOnReadFile call() throws StreamNotFoundException, IOException, OutOfMemoryError, ShellNotRunningException {<NEW_LINE>InputStream inputStream;<NEW_LINE>switch(fileAbstraction.scheme) {<NEW_LINE>case CONTENT:<NEW_LINE>Objects.requireNonNull(fileAbstraction.uri);<NEW_LINE>final AppConfig appConfig = AppConfig.getInstance();<NEW_LINE>if (fileAbstraction.uri.getAuthority().equals(appConfig.getPackageName())) {<NEW_LINE>DocumentFile documentFile = DocumentFile.fromSingleUri(appConfig, fileAbstraction.uri);<NEW_LINE>if (documentFile != null && documentFile.exists() && documentFile.canWrite()) {<NEW_LINE>inputStream = contentResolver.openInputStream(documentFile.getUri());<NEW_LINE>} else {<NEW_LINE>inputStream = loadFile(FileUtils<MASK><NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>inputStream = contentResolver.openInputStream(fileAbstraction.uri);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case FILE:<NEW_LINE>final HybridFileParcelable hybridFileParcelable = fileAbstraction.hybridFileParcelable;<NEW_LINE>Objects.requireNonNull(hybridFileParcelable);<NEW_LINE>File file = hybridFileParcelable.getFile();<NEW_LINE>inputStream = loadFile(file);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new IllegalArgumentException("The scheme for '" + fileAbstraction.scheme + "' cannot be processed!");<NEW_LINE>}<NEW_LINE>Objects.requireNonNull(inputStream);<NEW_LINE>InputStreamReader inputStreamReader = new InputStreamReader(inputStream);<NEW_LINE>char[] buffer = new char[MAX_FILE_SIZE_CHARS];<NEW_LINE>final int readChars = inputStreamReader.read(buffer);<NEW_LINE>boolean tooLong = -1 != inputStream.read();<NEW_LINE>inputStreamReader.close();<NEW_LINE>final String fileContents;<NEW_LINE>if (readChars == -1) {<NEW_LINE>fileContents = "";<NEW_LINE>} else {<NEW_LINE>fileContents = String.valueOf(buffer, 0, readChars);<NEW_LINE>}<NEW_LINE>return new ReturnedValueOnReadFile(fileContents, cachedFile, tooLong);<NEW_LINE>}
.fromContentUri(fileAbstraction.uri));
652,774
public boolean updateAttributes() {<NEW_LINE>String index = null;<NEW_LINE>List<HWPartition> partitions = getPartitions();<NEW_LINE>if (!partitions.isEmpty()) {<NEW_LINE>// If a partition exists on this drive, the major property<NEW_LINE>// corresponds to the disk index, so use it.<NEW_LINE>index = Integer.toString(partitions.get(0).getMajor());<NEW_LINE>} else if (getName().startsWith(PHYSICALDRIVE_PREFIX)) {<NEW_LINE>// If no partition exists, Windows reliably uses a name to match the<NEW_LINE>// disk index. That said, the skeptical person might wonder why a<NEW_LINE>// disk has read/write statistics without a partition, and wonder<NEW_LINE>// why this branch is even relevant as an option. The author of this<NEW_LINE>// comment does not have an answer for this valid question.<NEW_LINE>index = getName().substring(PHYSICALDRIVE_PREFIX.length(), getName().length());<NEW_LINE>} else {<NEW_LINE>// The author of this comment cannot fathom a circumstance in which<NEW_LINE>// the code reaches this point, but just in case it does, here's the<NEW_LINE>// correct response. If you get this log warning, the circumstances<NEW_LINE>// would be of great interest to the project's maintainers.<NEW_LINE>LOG.warn("Couldn't match index for {}", getName());<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>DiskStats stats = queryReadWriteStats(index);<NEW_LINE>if (stats.readMap.containsKey(index)) {<NEW_LINE>this.reads = stats.readMap.getOrDefault(index, 0L);<NEW_LINE>this.readBytes = stats.readByteMap.getOrDefault(index, 0L);<NEW_LINE>this.writes = stats.writeMap.getOrDefault(index, 0L);<NEW_LINE>this.writeBytes = stats.writeByteMap.getOrDefault(index, 0L);<NEW_LINE>this.currentQueueLength = stats.queueLengthMap.getOrDefault(index, 0L);<NEW_LINE>this.transferTime = stats.<MASK><NEW_LINE>this.timeStamp = stats.timeStamp;<NEW_LINE>return true;<NEW_LINE>} else {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}
diskTimeMap.getOrDefault(index, 0L);
560,817
public boolean archiveEvents(final ArchiveEventsCmd cmd) {<NEW_LINE>final Account caller = getCaller();<NEW_LINE>final List<Long> ids = cmd.getIds();<NEW_LINE>boolean result = true;<NEW_LINE>List<Long> permittedAccountIds = new ArrayList<Long>();<NEW_LINE>if (_accountService.isNormalUser(caller.getId()) || caller.getType() == Account.Type.PROJECT) {<NEW_LINE>permittedAccountIds.add(caller.getId());<NEW_LINE>} else {<NEW_LINE>final DomainVO domain = _domainDao.findById(caller.getDomainId());<NEW_LINE>final List<Long> permittedDomainIds = _domainDao.<MASK><NEW_LINE>permittedAccountIds = _accountDao.getAccountIdsForDomains(permittedDomainIds);<NEW_LINE>}<NEW_LINE>final List<EventVO> events = _eventDao.listToArchiveOrDeleteEvents(ids, cmd.getType(), cmd.getStartDate(), cmd.getEndDate(), permittedAccountIds);<NEW_LINE>final ControlledEntity[] sameOwnerEvents = events.toArray(new ControlledEntity[events.size()]);<NEW_LINE>_accountMgr.checkAccess(CallContext.current().getCallingAccount(), null, false, sameOwnerEvents);<NEW_LINE>if (ids != null && events.size() < ids.size()) {<NEW_LINE>result = false;<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>_eventDao.archiveEvents(events);<NEW_LINE>return result;<NEW_LINE>}
getDomainChildrenIds(domain.getPath());
1,112,521
private byte[] handlePosition(SimpleInterval interval, byte base, FeatureContext features) {<NEW_LINE>if (deletionBasesRemaining > 0) {<NEW_LINE>deletionBasesRemaining--;<NEW_LINE>return NO_BASES;<NEW_LINE>}<NEW_LINE>// If we have a mask at this site, use it<NEW_LINE>if (snpmaskPriority) {<NEW_LINE>if (isMasked(features))<NEW_LINE>return N_BYTES;<NEW_LINE>}<NEW_LINE>// Check to see if we have a called snp<NEW_LINE>for (final VariantContext vc : features.getValues(variants)) {<NEW_LINE>if (vc.isFiltered() || vc.getStart() != interval.getStart())<NEW_LINE>continue;<NEW_LINE>if (vc.isSimpleDeletion()) {<NEW_LINE>deletionBasesRemaining = vc.getReference<MASK><NEW_LINE>// delete the next n bases, not this one<NEW_LINE>return baseToByteArray(base);<NEW_LINE>} else if (vc.isSimpleInsertion() || vc.isSNP()) {<NEW_LINE>// Get the first alt allele that is not a spanning deletion. If none present, use the empty allele<NEW_LINE>final Optional<Allele> optionalAllele = getFirstConcreteAltAllele(vc.getAlternateAlleles());<NEW_LINE>final Allele allele = optionalAllele.orElseGet(() -> Allele.create(EMPTY_BASE, false));<NEW_LINE>if (vc.isSimpleInsertion()) {<NEW_LINE>return allele.getBases();<NEW_LINE>} else {<NEW_LINE>final String iupacBase = (iupacSample != null) ? getIUPACBase(vc.getGenotype(iupacSample)) : allele.toString();<NEW_LINE>return iupacBase.getBytes();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!snpmaskPriority) {<NEW_LINE>if (isMasked(features)) {<NEW_LINE>return N_BYTES;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// if we got here then we're just ref<NEW_LINE>return baseToByteArray(base);<NEW_LINE>}
().length() - 1;
88,468
Map<String, ?> toSerializable() {<NEW_LINE>Map<String, Object> map = new LinkedHashMap<>();<NEW_LINE>map.put("displayName", displayName);<NEW_LINE>map.put("id", id);<NEW_LINE>if (parentId != null) {<NEW_LINE>map.put("parentId", parentId);<NEW_LINE>}<NEW_LINE>map.put("startTime", startTime);<NEW_LINE>map.put("endTime", endTime);<NEW_LINE>map.put("duration", endTime - startTime);<NEW_LINE>if (details != null) {<NEW_LINE><MASK><NEW_LINE>map.put("detailsClassName", detailsClassName);<NEW_LINE>}<NEW_LINE>if (result != null) {<NEW_LINE>map.put("result", result);<NEW_LINE>map.put("resultClassName", resultClassName);<NEW_LINE>}<NEW_LINE>if (failure != null) {<NEW_LINE>map.put("failure", failure);<NEW_LINE>}<NEW_LINE>if (!progress.isEmpty()) {<NEW_LINE>map.put("progress", transform(progress, Progress::toSerializable));<NEW_LINE>}<NEW_LINE>if (!children.isEmpty()) {<NEW_LINE>map.put("children", transform(children, BuildOperationRecord::toSerializable));<NEW_LINE>}<NEW_LINE>return map;<NEW_LINE>}
map.put("details", details);
791,827
private ArchiveResult archive0(@NonNull final ArchiveRequest request) {<NEW_LINE>// t.schoemeberg@metas.de, 03787: using the client/org of the archived PO, if possible<NEW_LINE>final Properties ctxToUse = createContext(request);<NEW_LINE>final IArchiveStorage storage = Services.get(IArchiveStorageFactory.class).getArchiveStorage(ctxToUse);<NEW_LINE>final I_AD_Archive archive = storage.newArchive(ctxToUse, request.getTrxName());<NEW_LINE>archive.setDocumentFlavor(DocumentReportFlavor.toCode<MASK><NEW_LINE>// FRESH-218: extract and set the language to the archive<NEW_LINE>final String language = getLanguageFromReport(ctxToUse, request);<NEW_LINE>archive.setAD_Language(language);<NEW_LINE>archive.setDocumentNo(request.getDocumentNo());<NEW_LINE>archive.setName(request.getArchiveName());<NEW_LINE>archive.setC_Async_Batch_ID(NumberUtils.asInt(request.getAsyncBatchId(), -1));<NEW_LINE>archive.setIsReport(request.isReport());<NEW_LINE>//<NEW_LINE>archive.setAD_Process_ID(AdProcessId.toRepoId(request.getProcessId()));<NEW_LINE>final TableRecordReference recordRef = request.getRecordRef();<NEW_LINE>archive.setAD_Table_ID(recordRef != null ? recordRef.getAD_Table_ID() : -1);<NEW_LINE>archive.setRecord_ID(recordRef != null ? recordRef.getRecord_ID() : -1);<NEW_LINE>archive.setC_BPartner_ID(BPartnerId.toRepoId(request.getBpartnerId()));<NEW_LINE>final byte[] byteArray = extractByteArray(request);<NEW_LINE>storage.setBinaryData(archive, byteArray);<NEW_LINE>// FRESH-349: Set ad_pinstance<NEW_LINE>archive.setAD_PInstance_ID(PInstanceId.toRepoId(request.getPinstanceId()));<NEW_LINE>if (request.isSave()) {<NEW_LINE>InterfaceWrapperHelper.save(archive);<NEW_LINE>}<NEW_LINE>return ArchiveResult.builder().archiveRecord(archive).data(byteArray).build();<NEW_LINE>}
(request.getFlavor()));
1,690,622
public void run(RegressionEnvironment env) {<NEW_LINE>RegressionPath path = new RegressionPath();<NEW_LINE>String epl = "@public create table PointTable(id string primary key, px double, py double);\n" + "create index MyIndex on PointTable((px,py) pointregionquadtree(0,0,100,100,4,40));\n" + "insert into PointTable select id, px, py from SupportSpatialPoint;\n" + "@name('s0') on SupportSpatialAABB as aabb select pt.id as c0 from PointTable as pt where point(px,py).inside(rectangle(x,y,width,height));\n";<NEW_LINE>env.compileDeploy(epl, path).addListener("s0");<NEW_LINE>sendPoint(env, "P1", 80, 80);<NEW_LINE>sendPoint(env, "P2", 81, 80);<NEW_LINE>sendPoint(env, "P3", 80, 81);<NEW_LINE>sendPoint(env, "P4", 80, 80);<NEW_LINE>sendPoint(env, "P5", 45, 55);<NEW_LINE>assertRectanglesManyRow(env, BOXES, null, null, "P5", "P1,P2,P3,P4", "P5");<NEW_LINE>env.milestone(0);<NEW_LINE>assertRectanglesManyRow(env, BOXES, null, <MASK><NEW_LINE>env.compileExecuteFAFNoResult("delete from PointTable where id = 'P4'", path);<NEW_LINE>assertRectanglesManyRow(env, BOXES, null, null, "P5", "P1,P2,P3", "P5");<NEW_LINE>env.milestone(1);<NEW_LINE>assertRectanglesManyRow(env, BOXES, null, null, "P5", "P1,P2,P3", "P5");<NEW_LINE>env.undeployAll();<NEW_LINE>}
null, "P5", "P1,P2,P3,P4", "P5");
1,126,542
public void update() {<NEW_LINE>clear();<NEW_LINE>addSeparator(true).padRight(6);<NEW_LINE>visSelectBox = new VisSelectBox<>("white");<NEW_LINE>Array<ResolutionEntryVO> resolutionEntryVOs = new Array<>();<NEW_LINE>ResolutionEntryVO newResolutionEntryVO = new ResolutionEntryVO();<NEW_LINE>newResolutionEntryVO.name = "Create New ...";<NEW_LINE>resolutionEntryVOs.add(newResolutionEntryVO);<NEW_LINE>resolutionEntryVOs.add(resolutionManager.getOriginalResolution());<NEW_LINE>resolutionEntryVOs.addAll(resolutionManager.getResolutions());<NEW_LINE>visSelectBox.setItems(resolutionEntryVOs);<NEW_LINE>add("Resolution:").padRight(4);<NEW_LINE>add(visSelectBox).padRight(11).width(156);<NEW_LINE>VisImageButton.VisImageButtonStyle visImageButtonStyle = new VisImageButton.VisImageButtonStyle(skin.get("dark", VisImageButton.VisImageButtonStyle.class));<NEW_LINE>visImageButtonStyle.imageUp = skin.getDrawable("icon-trash");<NEW_LINE>visImageButtonStyle.imageOver = skin.getDrawable("icon-trash-over");<NEW_LINE>visImageButtonStyle.imageDisabled = skin.getDrawable("icon-trash-disabled");<NEW_LINE>deleteBtn = new VisImageButton("dark");<NEW_LINE>deleteBtn.setStyle(visImageButtonStyle);<NEW_LINE>deleteBtn.<MASK><NEW_LINE>add(deleteBtn).padRight(11).height(25);<NEW_LINE>VisTextButton repackBtn = new VisTextButton("Repack", "orange");<NEW_LINE>repackBtn.addListener(new UIResolutionBoxButtonClickListener(REPACK_BTN_CLICKED));<NEW_LINE>add(repackBtn).padRight(5).width(93).height(25);<NEW_LINE>setCurrentResolution(resolutionManager.currentResolutionName);<NEW_LINE>visSelectBox.addListener(new ResolutionChangeListener());<NEW_LINE>}
addListener(new UIResolutionBoxButtonClickListener(DELETE_RESOLUTION_BTN_CLICKED));
837,508
public static Memory createFromDateString(Environment env, TraceInfo traceInfo, Memory arg) {<NEW_LINE>try {<NEW_LINE>DateTimeParseResult result = new DateTimeParser(arg.toString()).parseResult();<NEW_LINE><MASK><NEW_LINE>DateInterval dateInterval = new DateInterval(env);<NEW_LINE>Memory relative = referenceMemories.refOfIndex("relative");<NEW_LINE>dateInterval.y = relative.refOfIndex("year").toValue(LongMemory.class);<NEW_LINE>dateInterval.m = relative.refOfIndex("month").toValue(LongMemory.class);<NEW_LINE>dateInterval.d = relative.refOfIndex("day").toValue(LongMemory.class);<NEW_LINE>dateInterval.h = relative.refOfIndex("hour").toValue(LongMemory.class);<NEW_LINE>dateInterval.i = relative.refOfIndex("minute").toValue(LongMemory.class);<NEW_LINE>dateInterval.s = relative.refOfIndex("second").toValue(LongMemory.class);<NEW_LINE>dateInterval.f = Memory.CONST_DOUBLE_0;<NEW_LINE>dateInterval.invert = Memory.CONST_INT_0;<NEW_LINE>dateInterval.days = Memory.FALSE;<NEW_LINE>return new ObjectMemory(dateInterval);<NEW_LINE>} catch (DateTimeParserException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
ArrayMemory referenceMemories = result.toArrayMemory();
1,458,640
private SSLContext createSslContext(SecurityStore keystore, SecurityStore truststore) {<NEW_LINE>try {<NEW_LINE>SSLContext sslContext;<NEW_LINE>if (isNotEmpty(provider)) {<NEW_LINE>sslContext = SSLContext.getInstance(protocol, provider);<NEW_LINE>} else {<NEW_LINE>sslContext = SSLContext.getInstance(protocol);<NEW_LINE>}<NEW_LINE>KeyManager[] keyManagers = null;<NEW_LINE>if (keystore != null || isNotEmpty(kmfAlgorithm)) {<NEW_LINE>String kmfAlgorithm;<NEW_LINE>if (isNotEmpty(this.kmfAlgorithm)) {<NEW_LINE>kmfAlgorithm = this.kmfAlgorithm;<NEW_LINE>} else {<NEW_LINE>kmfAlgorithm = KeyManagerFactory.getDefaultAlgorithm();<NEW_LINE>}<NEW_LINE>KeyManagerFactory kmf = KeyManagerFactory.getInstance(kmfAlgorithm);<NEW_LINE>if (keystore != null) {<NEW_LINE>kmf.init(keystore.get(), keystore.keyPassword());<NEW_LINE>} else {<NEW_LINE>kmf.init(null, null);<NEW_LINE>}<NEW_LINE>keyManagers = kmf.getKeyManagers();<NEW_LINE>}<NEW_LINE>String tmfAlgorithm = isNotEmpty(this.tmfAlgorithm) ? this.tmfAlgorithm : TrustManagerFactory.getDefaultAlgorithm();<NEW_LINE>TrustManagerFactory tmf = TrustManagerFactory.getInstance(tmfAlgorithm);<NEW_LINE>KeyStore ts = truststore == null ? null : truststore.get();<NEW_LINE>tmf.init(ts);<NEW_LINE>sslContext.init(keyManagers, tmf.<MASK><NEW_LINE>log.debug("Created SSL context with keystore {}, truststore {}, provider {}.", keystore, truststore, sslContext.getProvider().getName());<NEW_LINE>return sslContext;<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new KafkaException(e);<NEW_LINE>}<NEW_LINE>}
getTrustManagers(), this.secureRandomImplementation);
1,264,601
public AdditionalResultAttributeValue unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>AdditionalResultAttributeValue additionalResultAttributeValue = new AdditionalResultAttributeValue();<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 null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("TextWithHighlightsValue", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>additionalResultAttributeValue.setTextWithHighlightsValue(TextWithHighlightsJsonUnmarshaller.getInstance<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 additionalResultAttributeValue;<NEW_LINE>}
().unmarshall(context));
255,281
public okhttp3.Call prepareGarbageCollectionCommitsCall(String repository, GarbageCollectionPrepareRequest garbageCollectionPrepareRequest, final ApiCallback _callback) throws ApiException {<NEW_LINE>Object localVarPostBody = garbageCollectionPrepareRequest;<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/repositories/{repository}/gc/prepare_commits".replaceAll("\\{" + "repository" + "\\}", localVarApiClient.escapeString(repository.toString()));<NEW_LINE>List<Pair> localVarQueryParams <MASK><NEW_LINE>List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>Map<String, String> localVarCookieParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>final String[] localVarAccepts = { "application/json" };<NEW_LINE>final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>if (localVarAccept != null) {<NEW_LINE>localVarHeaderParams.put("Accept", localVarAccept);<NEW_LINE>}<NEW_LINE>final String[] localVarContentTypes = { "application/json" };<NEW_LINE>final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>localVarHeaderParams.put("Content-Type", localVarContentType);<NEW_LINE>String[] localVarAuthNames = new String[] { "basic_auth", "cookie_auth", "jwt_token" };<NEW_LINE>return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);<NEW_LINE>}
= new ArrayList<Pair>();
1,563,359
private void addPagination(Map<Field, String> fields, Pagination pagination) {<NEW_LINE>String startPage = "";<NEW_LINE>String endPage = "";<NEW_LINE>for (JAXBElement<String> element : pagination.getContent()) {<NEW_LINE>if ("MedlinePgn".equals(element.getName().getLocalPart())) {<NEW_LINE>putIfValueNotNull(fields, StandardField.PAGES, fixPageRange(element.getValue()));<NEW_LINE>} else if ("StartPage".equals(element.getName().getLocalPart())) {<NEW_LINE>// it could happen, that the article has only a start page<NEW_LINE>startPage = element.getValue() + endPage;<NEW_LINE>putIfValueNotNull(<MASK><NEW_LINE>} else if ("EndPage".equals(element.getName().getLocalPart())) {<NEW_LINE>endPage = element.getValue();<NEW_LINE>// but it should not happen, that a endpage appears without startpage<NEW_LINE>fields.put(StandardField.PAGES, fixPageRange(startPage + "-" + endPage));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
fields, StandardField.PAGES, startPage);
1,153,479
private void executeStreamOutBlocking(StringBuilder tornadoVMBytecodeList, final int objectIndex, final int contextIndex, final long offset, final int eventList, final long sizeBatch, final int[] waitList) {<NEW_LINE>final TornadoAcceleratorDevice device = contexts.get(contextIndex);<NEW_LINE>final Object object = objects.get(objectIndex);<NEW_LINE>if (isObjectKernelContext(object)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (TornadoOptions.PRINT_BYTECODES) {<NEW_LINE>String verbose = String.format("vm: STREAM_OUT_BLOCKING [0x%x] %s on %s, size=%d, offset=%d [event list=%d]", object.hashCode(), object, device, sizeBatch, offset, eventList);<NEW_LINE>tornadoVMBytecodeList.append(verbose).append("\n");<NEW_LINE>}<NEW_LINE>final DeviceObjectState objectState = resolveObjectState(objectIndex, contextIndex);<NEW_LINE>final int tornadoEventID = device.streamOutBlocking(object, offset, objectState, waitList);<NEW_LINE>if (TornadoOptions.isProfilerEnabled() && tornadoEventID != -1) {<NEW_LINE>Event event = device.resolveEvent(tornadoEventID);<NEW_LINE>event.waitForEvents();<NEW_LINE>long value = <MASK><NEW_LINE>value += event.getElapsedTime();<NEW_LINE>timeProfiler.setTimer(ProfilerType.COPY_OUT_TIME, value);<NEW_LINE>timeProfiler.addValueToMetric(ProfilerType.TOTAL_COPY_OUT_SIZE_BYTES, TimeProfiler.NO_TASK_NAME, objectState.getBuffer().size());<NEW_LINE>long dispatchValue = timeProfiler.getTimer(ProfilerType.TOTAL_DISPATCH_DATA_TRANSFERS_TIME);<NEW_LINE>dispatchValue += event.getDriverDispatchTime();<NEW_LINE>timeProfiler.setTimer(ProfilerType.TOTAL_DISPATCH_DATA_TRANSFERS_TIME, dispatchValue);<NEW_LINE>}<NEW_LINE>resetEventIndexes(eventList);<NEW_LINE>}
timeProfiler.getTimer(ProfilerType.COPY_OUT_TIME);
416,444
public void trim(MemoryTrimType trimType) {<NEW_LINE>ArrayList<<MASK><NEW_LINE>ArrayList<Entry<K, V>> oldMFUEntries;<NEW_LINE>final double trimRatio = mCacheTrimStrategy.getTrimRatio(trimType);<NEW_LINE>synchronized (this) {<NEW_LINE>final int targetCacheSize = (int) (mCachedEntries.getSizeInBytes() * (1 - trimRatio));<NEW_LINE>final int targetEvictionQueueSize = Math.max(0, targetCacheSize - getInUseSizeInBytes());<NEW_LINE>int MFUTargetEvictionQueueSize = mMostFrequentlyUsedExclusiveEntries.getSizeInBytes();<NEW_LINE>int LFUTargetEvictionQueueSize = Math.max(0, targetEvictionQueueSize - MFUTargetEvictionQueueSize);<NEW_LINE>if (targetEvictionQueueSize <= MFUTargetEvictionQueueSize) {<NEW_LINE>MFUTargetEvictionQueueSize = targetEvictionQueueSize;<NEW_LINE>LFUTargetEvictionQueueSize = 0;<NEW_LINE>}<NEW_LINE>oldLFUEntries = trimExclusivelyOwnedEntries(Integer.MAX_VALUE, LFUTargetEvictionQueueSize, mLeastFrequentlyUsedExclusiveEntries, ArrayListType.LFU);<NEW_LINE>oldMFUEntries = trimExclusivelyOwnedEntries(Integer.MAX_VALUE, MFUTargetEvictionQueueSize, mMostFrequentlyUsedExclusiveEntries, ArrayListType.MFU);<NEW_LINE>makeOrphans(oldLFUEntries, oldMFUEntries);<NEW_LINE>}<NEW_LINE>maybeClose(oldLFUEntries, oldMFUEntries);<NEW_LINE>maybeNotifyExclusiveEntriesRemoval(oldLFUEntries, oldMFUEntries);<NEW_LINE>maybeUpdateCacheParams();<NEW_LINE>maybeEvictEntries();<NEW_LINE>}
Entry<K, V>> oldLFUEntries;
938,145
public static void main(String... args) {<NEW_LINE>Query query = QueryFactory.create("SELECT * { {?s ?p ?o } UNION { GRAPH ?g { ?s ?p ?o } } }");<NEW_LINE>Dataset dataset = DatasetFactory.createTxnMem();<NEW_LINE>try (RDFConnection conn = RDFConnection.connect(dataset)) {<NEW_LINE>System.out.println("** Load a file");<NEW_LINE>// ---- Transaction 1: load data.<NEW_LINE>Txn.executeWrite(conn, () -> conn.load("data.ttl"));<NEW_LINE>// ---- Transaction 2: explicit styles<NEW_LINE>conn.begin(ReadWrite.WRITE);<NEW_LINE>conn.load("http://example/g0", "data.ttl");<NEW_LINE>System.out.println("** Inside multistep transaction - query dataset");<NEW_LINE>conn.<MASK><NEW_LINE>conn.abort();<NEW_LINE>conn.end();<NEW_LINE>System.out.println("** After abort 1");<NEW_LINE>// ---- Transaction 3: explicit styles<NEW_LINE>Txn.executeWrite(conn, () -> {<NEW_LINE>conn.load("http://example/g0", "data.ttl");<NEW_LINE>System.out.println("** Inside multistep transaction - fetch dataset");<NEW_LINE>Dataset ds2 = conn.fetchDataset();<NEW_LINE>RDFDataMgr.write(System.out, ds2, Lang.TRIG);<NEW_LINE>conn.abort();<NEW_LINE>});<NEW_LINE>System.out.println("** After abort 2");<NEW_LINE>// Only default graph showing.<NEW_LINE>conn.queryResultSet(query, ResultSetFormatter::out);<NEW_LINE>}<NEW_LINE>}
queryResultSet(query, ResultSetFormatter::out);
359,157
public void onConfigChanged(ConfigChanged event) {<NEW_LINE>if (event.getGroup().equals("attackIndicator")) {<NEW_LINE>boolean enabled = Boolean.TRUE.toString().equals(event.getNewValue());<NEW_LINE>switch(event.getKey()) {<NEW_LINE>case "warnForDefensive":<NEW_LINE>updateWarnedSkills(enabled, Skill.DEFENCE);<NEW_LINE>break;<NEW_LINE>case "warnForAttack":<NEW_LINE><MASK><NEW_LINE>break;<NEW_LINE>case "warnForStrength":<NEW_LINE>updateWarnedSkills(enabled, Skill.STRENGTH);<NEW_LINE>break;<NEW_LINE>case "warnForRanged":<NEW_LINE>updateWarnedSkills(enabled, Skill.RANGED);<NEW_LINE>break;<NEW_LINE>case "warnForMagic":<NEW_LINE>updateWarnedSkills(enabled, Skill.MAGIC);<NEW_LINE>break;<NEW_LINE>case "removeWarnedStyles":<NEW_LINE>hideWarnedStyles(enabled);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>processWidgets();<NEW_LINE>}<NEW_LINE>}
updateWarnedSkills(enabled, Skill.ATTACK);
1,595,258
public List<NamespaceVH> fetchNamespaceDetails(SubscriptionVH subscription) throws Exception {<NEW_LINE>List<NamespaceVH> namespaceList = new ArrayList<NamespaceVH>();<NEW_LINE>String accessToken = azureCredentialProvider.getToken(subscription.getTenant());<NEW_LINE>String url = String.format(apiUrlTemplate, URLEncoder.encode(subscription.getSubscriptionId()));<NEW_LINE>try {<NEW_LINE>String response = CommonUtils.doHttpGet(url, "Bearer", accessToken);<NEW_LINE>JsonObject responseObj = new JsonParser().parse(response).getAsJsonObject();<NEW_LINE>JsonArray namespaceObjects = responseObj.getAsJsonArray("value");<NEW_LINE>if (namespaceObjects != null) {<NEW_LINE>for (JsonElement namespaceElement : namespaceObjects) {<NEW_LINE>NamespaceVH namespaceVH = new NamespaceVH();<NEW_LINE><MASK><NEW_LINE>namespaceVH.setSubscription(subscription.getSubscriptionId());<NEW_LINE>namespaceVH.setSubscriptionName(subscription.getSubscriptionName());<NEW_LINE>namespaceVH.setId(namespaceObject.get("id").getAsString());<NEW_LINE>namespaceVH.setLocation(namespaceObject.get("location").getAsString());<NEW_LINE>namespaceVH.setName(namespaceObject.get("name").getAsString());<NEW_LINE>namespaceVH.setType(namespaceObject.get("type").getAsString());<NEW_LINE>JsonObject properties = namespaceObject.getAsJsonObject("properties");<NEW_LINE>JsonObject tags = namespaceObject.getAsJsonObject("tags");<NEW_LINE>JsonObject sku = namespaceObject.getAsJsonObject("sku");<NEW_LINE>if (properties != null) {<NEW_LINE>HashMap<String, Object> propertiesMap = new Gson().fromJson(properties.toString(), HashMap.class);<NEW_LINE>namespaceVH.setProperties(propertiesMap);<NEW_LINE>}<NEW_LINE>if (tags != null) {<NEW_LINE>HashMap<String, Object> tagsMap = new Gson().fromJson(tags.toString(), HashMap.class);<NEW_LINE>namespaceVH.setTags(tagsMap);<NEW_LINE>}<NEW_LINE>if (sku != null) {<NEW_LINE>HashMap<String, Object> skuMap = new Gson().fromJson(sku.toString(), HashMap.class);<NEW_LINE>namespaceVH.setSku(skuMap);<NEW_LINE>}<NEW_LINE>namespaceList.add(namespaceVH);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>log.error("Error collecting namespace", e);<NEW_LINE>}<NEW_LINE>log.info("Target Type : {} Total: {} ", "Namespace", namespaceList.size());<NEW_LINE>return namespaceList;<NEW_LINE>}
JsonObject namespaceObject = namespaceElement.getAsJsonObject();
1,210,280
@Consumes("application/x-www-form-urlencoded")<NEW_LINE>@Produces(MediaType.APPLICATION_JSON)<NEW_LINE>@Operation(description = "Fetch OAuth2 Access Token")<NEW_LINE>public AccessTokenResponse postAccessTokenRequest(@Parameter(description = "token request details include scope", required = true) String request) {<NEW_LINE>int code = ResourceException.OK;<NEW_LINE>ResourceContext context = null;<NEW_LINE>try {<NEW_LINE>context = this.delegate.newResourceContext(this.request, this.response, "postAccessTokenRequest");<NEW_LINE>context.authenticate();<NEW_LINE>return this.delegate.postAccessTokenRequest(context, request);<NEW_LINE>} catch (ResourceException e) {<NEW_LINE>code = e.getCode();<NEW_LINE>switch(code) {<NEW_LINE>case ResourceException.BAD_REQUEST:<NEW_LINE>throw typedException(code, e, ResourceError.class);<NEW_LINE>case ResourceException.FORBIDDEN:<NEW_LINE>throw typedException(<MASK><NEW_LINE>case ResourceException.NOT_FOUND:<NEW_LINE>throw typedException(code, e, ResourceError.class);<NEW_LINE>case ResourceException.UNAUTHORIZED:<NEW_LINE>throw typedException(code, e, ResourceError.class);<NEW_LINE>default:<NEW_LINE>System.err.println("*** Warning: undeclared exception (" + code + ") for resource postAccessTokenRequest");<NEW_LINE>throw typedException(code, e, ResourceError.class);<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>this.delegate.publishChangeMessage(context, code);<NEW_LINE>this.delegate.recordMetrics(context, code);<NEW_LINE>}<NEW_LINE>}
code, e, ResourceError.class);
1,360,518
public TransportFilter createTransportFilter(Connection connection, TransportCipher read_cipher, TransportCipher write_cipher) throws TransportException {<NEW_LINE>Transport transport = connection.getTransport();<NEW_LINE>if (transport == null) {<NEW_LINE>throw (new TransportException("no transport available"));<NEW_LINE>}<NEW_LINE>com.biglybt.core.networkmanager.Transport core_transport;<NEW_LINE>try {<NEW_LINE>core_transport = ((TransportImpl) transport).coreTransport();<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new TransportException(e);<NEW_LINE>}<NEW_LINE>TransportHelper helper;<NEW_LINE>if (core_transport instanceof TCPTransportImpl) {<NEW_LINE>TransportHelperFilter hfilter = ((TCPTransportImpl) core_transport).getFilter();<NEW_LINE>if (hfilter != null) {<NEW_LINE>helper = hfilter.getHelper();<NEW_LINE>} else {<NEW_LINE>helper = new TCPTransportHelper(((TCPTransportImpl) (core_transport)).getSocketChannel());<NEW_LINE>}<NEW_LINE>} else if (core_transport instanceof UDPTransport) {<NEW_LINE>TransportHelperFilter hfilter = ((UDPTransport) core_transport).getFilter();<NEW_LINE>if (hfilter != null) {<NEW_LINE>helper = hfilter.getHelper();<NEW_LINE>} else {<NEW_LINE>helper = ((UDPTransport) core_transport)<MASK><NEW_LINE>InetSocketAddress addr = core_transport.getTransportEndpoint().getProtocolEndpoint().getConnectionEndpoint().getNotionalAddress();<NEW_LINE>if (!connection.isIncoming()) {<NEW_LINE>try {<NEW_LINE>helper = new UDPTransportHelper(UDPNetworkManager.getSingleton().getConnectionManager(), addr, (UDPTransport) core_transport);<NEW_LINE>} catch (IOException ioe) {<NEW_LINE>throw new TransportException(ioe);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// helper = new UDPTransportHelper(UDPNetworkManager.getSingleton().getConnectionManager(), addr, (UDPTransport)core_transport);<NEW_LINE>throw new TransportException("udp incoming transport type not supported - " + core_transport);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw new TransportException("transport type not supported - " + core_transport);<NEW_LINE>}<NEW_LINE>TransportHelperFilterStreamCipher core_filter = new TransportHelperFilterStreamCipher(helper, ((TransportCipherImpl) read_cipher).cipher, ((TransportCipherImpl) write_cipher).cipher);<NEW_LINE>return new TransportFilterImpl(core_filter);<NEW_LINE>}
.getFilter().getHelper();
228,887
public RebootBrokerResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>RebootBrokerResult rebootBrokerResult = new RebootBrokerResult();<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 rebootBrokerResult;<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("clusterArn", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>rebootBrokerResult.setClusterArn(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("clusterOperationArn", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>rebootBrokerResult.setClusterOperationArn(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 rebootBrokerResult;<NEW_LINE>}
class).unmarshall(context));
1,709,183
public static void main(String[] args) {<NEW_LINE>final MetricsAdvisorAdministrationAsyncClient advisorAdministrationAsyncClient = new MetricsAdvisorAdministrationClientBuilder().endpoint("https://{endpoint}.cognitiveservices.azure.com/").credential(new MetricsAdvisorKeyCredential("subscription_key", "api_key")).buildAsyncClient();<NEW_LINE>// List the ingestion status of a data feed.<NEW_LINE>final String dataFeedId = "4957a2f7-a0f4-4fc0-b8d7-d866c1df0f4c";<NEW_LINE>final OffsetDateTime startTime = OffsetDateTime.parse("2020-01-01T00:00:00Z");<NEW_LINE>final OffsetDateTime endTime = OffsetDateTime.parse("2020-09-09T00:00:00Z");<NEW_LINE>final ListDataFeedIngestionOptions options = new ListDataFeedIngestionOptions(startTime, endTime);<NEW_LINE>advisorAdministrationAsyncClient.listDataFeedIngestionStatus(dataFeedId, options).doOnSubscribe(__ -> System.out.printf("Listing ingestion status%n")).doOnNext(ingestionStatus -> {<NEW_LINE>System.out.printf("Timestamp: %s%n", ingestionStatus.getTimestamp());<NEW_LINE>System.out.printf("Status: %s%n", ingestionStatus.getStatus());<NEW_LINE>System.out.printf(<MASK><NEW_LINE>}).blockLast();<NEW_LINE>// Get the ingestion progress.<NEW_LINE>advisorAdministrationAsyncClient.getDataFeedIngestionProgress(dataFeedId).doOnSubscribe(__ -> System.out.printf("Retrieving ingestion progress%n")).doOnNext(ingestionProgress -> {<NEW_LINE>System.out.printf("Latest active timestamp: %s%n", ingestionProgress.getLatestActiveTimestamp());<NEW_LINE>System.out.printf("Latest successful timestamp: %s%n", ingestionProgress.getLatestSuccessTimestamp());<NEW_LINE>}).block();<NEW_LINE>// Reingest the data in the data source for a given period and overwrite ingested data<NEW_LINE>// for the same period.<NEW_LINE>final OffsetDateTime dataPointStartTimeSamp = OffsetDateTime.parse("2020-01-01T00:00:00Z");<NEW_LINE>final OffsetDateTime dataPointEndTimeSamp = OffsetDateTime.parse("2020-03-03T00:00:00Z");<NEW_LINE>advisorAdministrationAsyncClient.refreshDataFeedIngestionWithResponse(dataFeedId, dataPointStartTimeSamp, dataPointEndTimeSamp).doOnSubscribe(__ -> System.out.printf("Refreshing ingestion for a period%n")).doOnNext(response -> {<NEW_LINE>System.out.printf("Response statusCode: %d%n", response.getStatusCode());<NEW_LINE>}).block();<NEW_LINE>}
"Message: %s%n", ingestionStatus.getMessage());
644,869
public void load(Reader theReader, boolean allowArray) throws DataFormatException {<NEW_LINE>PushbackReader pbr = new PushbackReader(theReader);<NEW_LINE>int nextInt;<NEW_LINE>try {<NEW_LINE>while (true) {<NEW_LINE>nextInt = pbr.read();<NEW_LINE>if (nextInt == -1) {<NEW_LINE>throw new DataFormatException(Msg.code(1857) + "Did not find any content to parse");<NEW_LINE>}<NEW_LINE>if (nextInt == '{') {<NEW_LINE>pbr.unread(nextInt);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>if (Character.isWhitespace(nextInt)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (allowArray) {<NEW_LINE>if (nextInt == '[') {<NEW_LINE>pbr.unread(nextInt);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>throw new DataFormatException(Msg.code(1858) + "Content does not appear to be FHIR JSON, first non-whitespace character was: '" + (char) nextInt + "' (must be '{' or '[')");<NEW_LINE>}<NEW_LINE>throw new DataFormatException(Msg.code(1859) + "Content does not appear to be FHIR JSON, first non-whitespace character was: '" <MASK><NEW_LINE>}<NEW_LINE>if (nextInt == '{') {<NEW_LINE>setNativeObject((ObjectNode) OBJECT_MAPPER.readTree(pbr));<NEW_LINE>} else {<NEW_LINE>setNativeArray((ArrayNode) OBJECT_MAPPER.readTree(pbr));<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>if (e.getMessage().startsWith("Unexpected char 39")) {<NEW_LINE>throw new DataFormatException(Msg.code(1860) + "Failed to parse JSON encoded FHIR content: " + e.getMessage() + " - " + "This may indicate that single quotes are being used as JSON escapes where double quotes are required", e);<NEW_LINE>}<NEW_LINE>throw new DataFormatException(Msg.code(1861) + "Failed to parse JSON encoded FHIR content: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
+ (char) nextInt + "' (must be '{')");
1,130,071
/* (non-Javadoc)<NEW_LINE>* @see com.ibm.jvm.j9.dump.indexsupport.IParserNode#nodeToPushAfterStarting(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes)<NEW_LINE>*/<NEW_LINE>public IParserNode nodeToPushAfterStarting(String uri, String localName, String qName, Attributes attributes) {<NEW_LINE>IParserNode child = null;<NEW_LINE>if (qName.equals("stack")) {<NEW_LINE>child <MASK><NEW_LINE>} else {<NEW_LINE>// the vmthread knows that an error tag here means a corrupt (or otherwise unreadable) stack but we still need to return the error token<NEW_LINE>if (qName.equals("error")) {<NEW_LINE>_javaThread.setStackCorrupt();<NEW_LINE>}<NEW_LINE>child = super.nodeToPushAfterStarting(uri, localName, qName, attributes);<NEW_LINE>}<NEW_LINE>return child;<NEW_LINE>}
= new NodeStack(_javaThread, attributes);
526,479
void showTopSlowBuildRules(ImmutableList.Builder<String> lines) {<NEW_LINE>if (numberOfSlowRulesToShow == 0 || buildFinished == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Comparator<UnflavoredBuildTarget> comparator = (target1, target2) -> {<NEW_LINE>Long elapsedTime1 = Objects.requireNonNull(timeSpentMillisecondsInRules.get(target1));<NEW_LINE>Long elapsedTime2 = Objects.requireNonNull<MASK><NEW_LINE>long delta = elapsedTime2 - elapsedTime1;<NEW_LINE>return Long.compare(delta, 0L);<NEW_LINE>};<NEW_LINE>ImmutableList.Builder<String> slowRulesLogsBuilder = ImmutableList.builder();<NEW_LINE>slowRulesLogsBuilder.add("");<NEW_LINE>synchronized (timeSpentMillisecondsInRules) {<NEW_LINE>if (timeSpentMillisecondsInRules.isEmpty()) {<NEW_LINE>slowRulesLogsBuilder.add("Top slow rules: Buck didn't spend time in rules.");<NEW_LINE>} else {<NEW_LINE>slowRulesLogsBuilder.add("Top slow rules");<NEW_LINE>Stream<UnflavoredBuildTarget> keys = timeSpentMillisecondsInRules.keySet().stream().sorted(comparator);<NEW_LINE>keys.limit(numberOfSlowRulesToShow).forEachOrdered(target -> {<NEW_LINE>if (timeSpentMillisecondsInRules.containsKey(target)) {<NEW_LINE>slowRulesLogsBuilder.add(String.format(" %s: %s", target, formatElapsedTime(timeSpentMillisecondsInRules.get(target))));<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ImmutableList<String> slowRulesLogs = slowRulesLogsBuilder.build();<NEW_LINE>logTopSlowBuildRulesIfNotLogged(slowRulesLogs);<NEW_LINE>if (showSlowRulesInConsole) {<NEW_LINE>lines.addAll(slowRulesLogs);<NEW_LINE>}<NEW_LINE>}
(timeSpentMillisecondsInRules.get(target2));
1,563,761
public void validate(OpenJobAction.JobParams params, ClusterState clusterState) {<NEW_LINE>final <MASK><NEW_LINE>final String jobId = params.getJobId();<NEW_LINE>validateJobAndId(jobId, job);<NEW_LINE>// If we already know that we can't find an ml node because all ml nodes are running at capacity or<NEW_LINE>// simply because there are no ml nodes in the cluster then we fail quickly here:<NEW_LINE>PersistentTasksCustomMetadata.Assignment assignment = getAssignment(params, clusterState.nodes(), clusterState);<NEW_LINE>if (assignment.equals(AWAITING_UPGRADE)) {<NEW_LINE>throw makeCurrentlyBeingUpgradedException(logger, params.getJobId());<NEW_LINE>}<NEW_LINE>if (assignment.getExecutorNode() == null && assignment.equals(AWAITING_LAZY_ASSIGNMENT) == false) {<NEW_LINE>throw makeNoSuitableNodesException(logger, params.getJobId(), assignment.getExplanation());<NEW_LINE>}<NEW_LINE>}
Job job = params.getJob();
1,132,724
private static void publishDiagnostics(JavaClientConnection connection, ICompilationUnit unit, IProgressMonitor monitor) throws JavaModelException {<NEW_LINE>final DiagnosticsHandler handler <MASK><NEW_LINE>WorkingCopyOwner wcOwner = new WorkingCopyOwner() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public IBuffer createBuffer(ICompilationUnit workingCopy) {<NEW_LINE>ICompilationUnit original = workingCopy.getPrimary();<NEW_LINE>IResource resource = original.getResource();<NEW_LINE>if (resource instanceof IFile) {<NEW_LINE>return new DocumentAdapter(workingCopy, (IFile) resource);<NEW_LINE>}<NEW_LINE>return DocumentAdapter.Null;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public IProblemRequestor getProblemRequestor(ICompilationUnit workingCopy) {<NEW_LINE>return handler;<NEW_LINE>}<NEW_LINE>};<NEW_LINE>int flags = ICompilationUnit.FORCE_PROBLEM_DETECTION | ICompilationUnit.ENABLE_BINDINGS_RECOVERY | ICompilationUnit.ENABLE_STATEMENTS_RECOVERY;<NEW_LINE>unit.reconcile(ICompilationUnit.NO_AST, flags, wcOwner, monitor);<NEW_LINE>}
= new DiagnosticsHandler(connection, unit);
1,637,419
public void marshall(WriteTreatmentResource writeTreatmentResource, AwsJsonWriter jsonWriter) throws Exception {<NEW_LINE>jsonWriter.beginObject();<NEW_LINE>if (writeTreatmentResource.getMessageConfiguration() != null) {<NEW_LINE>MessageConfiguration messageConfiguration = writeTreatmentResource.getMessageConfiguration();<NEW_LINE>jsonWriter.name("MessageConfiguration");<NEW_LINE>MessageConfigurationJsonMarshaller.getInstance(<MASK><NEW_LINE>}<NEW_LINE>if (writeTreatmentResource.getSchedule() != null) {<NEW_LINE>Schedule schedule = writeTreatmentResource.getSchedule();<NEW_LINE>jsonWriter.name("Schedule");<NEW_LINE>ScheduleJsonMarshaller.getInstance().marshall(schedule, jsonWriter);<NEW_LINE>}<NEW_LINE>if (writeTreatmentResource.getSizePercent() != null) {<NEW_LINE>Integer sizePercent = writeTreatmentResource.getSizePercent();<NEW_LINE>jsonWriter.name("SizePercent");<NEW_LINE>jsonWriter.value(sizePercent);<NEW_LINE>}<NEW_LINE>if (writeTreatmentResource.getTreatmentDescription() != null) {<NEW_LINE>String treatmentDescription = writeTreatmentResource.getTreatmentDescription();<NEW_LINE>jsonWriter.name("TreatmentDescription");<NEW_LINE>jsonWriter.value(treatmentDescription);<NEW_LINE>}<NEW_LINE>if (writeTreatmentResource.getTreatmentName() != null) {<NEW_LINE>String treatmentName = writeTreatmentResource.getTreatmentName();<NEW_LINE>jsonWriter.name("TreatmentName");<NEW_LINE>jsonWriter.value(treatmentName);<NEW_LINE>}<NEW_LINE>jsonWriter.endObject();<NEW_LINE>}
).marshall(messageConfiguration, jsonWriter);
1,436,078
public static DescribeNetworkRegionBlockResponse unmarshall(DescribeNetworkRegionBlockResponse describeNetworkRegionBlockResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeNetworkRegionBlockResponse.setRequestId(_ctx.stringValue("DescribeNetworkRegionBlockResponse.RequestId"));<NEW_LINE>Config config = new Config();<NEW_LINE>config.setRegionBlockSwitch<MASK><NEW_LINE>List<String> countries = new ArrayList<String>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeNetworkRegionBlockResponse.Config.Countries.Length"); i++) {<NEW_LINE>countries.add(_ctx.stringValue("DescribeNetworkRegionBlockResponse.Config.Countries[" + i + "]"));<NEW_LINE>}<NEW_LINE>config.setCountries(countries);<NEW_LINE>List<String> provinces = new ArrayList<String>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeNetworkRegionBlockResponse.Config.Provinces.Length"); i++) {<NEW_LINE>provinces.add(_ctx.stringValue("DescribeNetworkRegionBlockResponse.Config.Provinces[" + i + "]"));<NEW_LINE>}<NEW_LINE>config.setProvinces(provinces);<NEW_LINE>describeNetworkRegionBlockResponse.setConfig(config);<NEW_LINE>return describeNetworkRegionBlockResponse;<NEW_LINE>}
(_ctx.stringValue("DescribeNetworkRegionBlockResponse.Config.RegionBlockSwitch"));
461,992
public static List<RecordReader> init(ExecutorFragmentContext ctx, HiveSubScan config) {<NEW_LINE>final HiveReaderFactory readerFactory = getReaderFactory(config);<NEW_LINE>final UserGroupInformation proxyUgi = ImpersonationUtil.createProxyUgi(config.getUserName(), ctx.getQueryUserName());<NEW_LINE>final List<List<InputSplit><MASK><NEW_LINE>final HiveConf hiveConf = config.getHiveConf();<NEW_LINE>if (inputSplits.isEmpty()) {<NEW_LINE>return Collections.singletonList(readerFactory.createReader(config.getTable(), null, /*partition*/<NEW_LINE>null, /*split*/<NEW_LINE>config.getColumns(), ctx, hiveConf, proxyUgi));<NEW_LINE>} else {<NEW_LINE>IndexedPartitions partitions = getPartitions(config);<NEW_LINE>return IntStream.range(0, inputSplits.size()).mapToObj(idx -> readerFactory.createReader(config.getTable(), partitions.get(idx), inputSplits.get(idx), config.getColumns(), ctx, hiveConf, proxyUgi)).collect(Collectors.toList());<NEW_LINE>}<NEW_LINE>}
> inputSplits = config.getInputSplits();
1,148,293
public static void arrayToGray(byte[] array, Bitmap.Config config, GrayU8 output) {<NEW_LINE>final int h = output.height;<NEW_LINE>final int w = output.width;<NEW_LINE>int indexSrc = 0;<NEW_LINE>switch(config) {<NEW_LINE>case ARGB_8888:<NEW_LINE>{<NEW_LINE>for (int y = 0; y < h; y++) {<NEW_LINE>int indexDst = output<MASK><NEW_LINE>int end = indexDst + w;<NEW_LINE>// for (int x = 0; x < w; x++, indexSrc++) {<NEW_LINE>while (indexDst < end) {<NEW_LINE>int value = ((array[indexSrc++] & 0xFF) + (array[indexSrc++] & 0xFF) + (array[indexSrc++] & 0xFF)) / 3;<NEW_LINE>output.data[indexDst++] = (byte) value;<NEW_LINE>// skip over alpha channel<NEW_LINE>indexSrc++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case RGB_565:<NEW_LINE>{<NEW_LINE>for (int y = 0; y < h; y++) {<NEW_LINE>int indexDst = output.startIndex + y * output.stride;<NEW_LINE>for (int x = 0; x < w; x++) {<NEW_LINE>int value = (array[indexSrc++] & 0xFF) | ((array[indexSrc++] & 0xFF) << 8);<NEW_LINE>int r = (value >> 11) * 256 / 32;<NEW_LINE>int g = ((value & 0x07E0) >> 5) * 256 / 64;<NEW_LINE>int b = (value & 0x001F) * 256 / 32;<NEW_LINE>output.data[indexDst++] = (byte) ((r + g + b) / 3);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case ALPHA_8:<NEW_LINE>throw new RuntimeException("ALPHA_8 seems to have some weired internal format and is not currently supported");<NEW_LINE>case ARGB_4444:<NEW_LINE>throw new RuntimeException("Isn't 4444 deprecated?");<NEW_LINE>default:<NEW_LINE>throw new RuntimeException("Unsupported format: " + config);<NEW_LINE>}<NEW_LINE>}
.startIndex + y * output.stride;
428,315
public Scorer scorer(LeafReaderContext context) throws IOException {<NEW_LINE>LeafReader reader = context.reader();<NEW_LINE>CustomPhraseQuery.PostingsAndFreq[] postingsFreqs = new CustomPhraseQuery.<MASK><NEW_LINE>String field = query.terms[0].field();<NEW_LINE>Terms fieldTerms = reader.terms(field);<NEW_LINE>if (fieldTerms == null) {<NEW_LINE>return null;<NEW_LINE>} else if (!fieldTerms.hasPositions()) {<NEW_LINE>throw new IllegalStateException("field \"" + field + "\" was indexed without position data; cannot run CustomPhraseQuery (phrase=" + this.getQuery() + ")");<NEW_LINE>} else {<NEW_LINE>TermsEnum te = fieldTerms.iterator();<NEW_LINE>for (int i = 0; i < query.terms.length; ++i) {<NEW_LINE>Term t = query.terms[i];<NEW_LINE>TermState state = this.states[i].get(context);<NEW_LINE>if (state == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>te.seekExact(t.bytes(), state);<NEW_LINE>PostingsEnum postingsEnum = te.postings(null, 24);<NEW_LINE>postingsFreqs[i] = new CustomPhraseQuery.PostingsAndFreq(postingsEnum, query.positions[i], t);<NEW_LINE>}<NEW_LINE>if (query.slop == 0) {<NEW_LINE>ArrayUtil.timSort(postingsFreqs);<NEW_LINE>return new CustomExactPhraseScorer(this, postingsFreqs, query.offset);<NEW_LINE>} else {<NEW_LINE>return new CustomSloppyPhraseScorer(this, postingsFreqs, query.slop, query.offset);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
PostingsAndFreq[query.terms.length];
190,875
private // TODO: Obey ignoreMetadata<NEW_LINE>void readImageResources(final boolean pParseData) throws IOException {<NEW_LINE>readHeader();<NEW_LINE>if (pParseData && metadata.imageResources == null || metadata.layerAndMaskInfoStart == 0) {<NEW_LINE>imageInput.seek(metadata.imageResourcesStart);<NEW_LINE>long imageResourcesLength = imageInput.readUnsignedInt();<NEW_LINE>if (pParseData && metadata.imageResources == null && imageResourcesLength > 0) {<NEW_LINE>long expectedEnd = imageInput.getStreamPosition() + imageResourcesLength;<NEW_LINE>metadata.imageResources = new ArrayList<>();<NEW_LINE>while (imageInput.getStreamPosition() < expectedEnd) {<NEW_LINE>PSDImageResource resource = PSDImageResource.read(imageInput);<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (DEBUG) {<NEW_LINE>System.out.println("imageResources: " + metadata.imageResources);<NEW_LINE>}<NEW_LINE>if (imageInput.getStreamPosition() != expectedEnd) {<NEW_LINE>// ..or maybe just a bug in the reader.. ;-)<NEW_LINE>throw new IIOException("Corrupt PSD document");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// TODO: We should now be able to flush input<NEW_LINE>// imageInput.flushBefore(metadata.imageResourcesStart + imageResourcesLength + 4);<NEW_LINE>// + 4 for the length field itself<NEW_LINE>metadata.layerAndMaskInfoStart = metadata.imageResourcesStart + imageResourcesLength + 4;<NEW_LINE>}<NEW_LINE>}
metadata.imageResources.add(resource);
183,483
public MetricGroup deserialize(JsonParser p, DeserializationContext c) throws IOException {<NEW_LINE>if (p.getCurrentToken() != JsonToken.START_ARRAY) {<NEW_LINE>throw c.mappingException("Expected start of array");<NEW_LINE>}<NEW_LINE>final Long timestamp;<NEW_LINE>{<NEW_LINE>if (p.nextToken() != JsonToken.VALUE_NUMBER_INT) {<NEW_LINE>throw c.mappingException("Expected number (timestamp)");<NEW_LINE>}<NEW_LINE>timestamp = p.readValueAs(Long.class);<NEW_LINE>}<NEW_LINE>if (p.nextToken() != JsonToken.START_ARRAY) {<NEW_LINE>throw c.mappingException("Expected start of array");<NEW_LINE>}<NEW_LINE>final ImmutableList.Builder<MetricCollection> groups = ImmutableList.builder();<NEW_LINE>while (p.nextToken() == JsonToken.START_OBJECT) {<NEW_LINE>groups.add(p.readValueAs(MetricCollection.class));<NEW_LINE>}<NEW_LINE>if (p.getCurrentToken() != JsonToken.END_ARRAY) {<NEW_LINE>throw c.mappingException("Expected end of array");<NEW_LINE>}<NEW_LINE>return new MetricGroup(<MASK><NEW_LINE>}
timestamp, groups.build());
1,517,055
/*<NEW_LINE>* Walks the LiveSet in preorder, returns a HashSet of all walked objects. The HashSet is generated as a byproduct of the walk.<NEW_LINE>*<NEW_LINE>* @return a HashSet containing all visited objects<NEW_LINE>*/<NEW_LINE>public static void walkLiveSet(ObjectVisitor visitor, RootSetType rootSetType) throws CorruptDataException {<NEW_LINE>RootSet rootSet = RootSet.from(rootSetType, false);<NEW_LINE>GCIterator rootIterator = rootSet.gcIterator(rootSetType);<NEW_LINE>GCIterator rootAddressIterator = rootSet.gcIterator(rootSetType);<NEW_LINE>while (rootIterator.hasNext()) {<NEW_LINE>J9ObjectPointer nextObject = (J9ObjectPointer) rootIterator.next();<NEW_LINE>VoidPointer nextAddress = rootAddressIterator.nextAddress();<NEW_LINE>if (nextObject.notNull()) {<NEW_LINE>scanObject(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
visitedObjects, visitor, nextObject, nextAddress);
687,778
public UpdateNodegroupVersionResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>UpdateNodegroupVersionResult updateNodegroupVersionResult = new UpdateNodegroupVersionResult();<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 updateNodegroupVersionResult;<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("update", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>updateNodegroupVersionResult.setUpdate(UpdateJsonUnmarshaller.getInstance<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 updateNodegroupVersionResult;<NEW_LINE>}
().unmarshall(context));
1,770,783
protected void paintIcon(Graphics2D g2) {<NEW_LINE>g2.setColor(Color.WHITE);<NEW_LINE>g2.fillRect(0, scale(4), scale(16), scale(12));<NEW_LINE>g2.setColor(Color.BLACK);<NEW_LINE>g2.drawRect(0, scale(4), scale(16), scale(12));<NEW_LINE>g2.setColor(Color.LIGHT_GRAY);<NEW_LINE>final var font = g2.getFont().deriveFont((float) getIconWidth() / (float) 4.5);<NEW_LINE>var t = new TextLayout("LIBRARY", font, g2.getFontRenderContext());<NEW_LINE>t.draw(g2, (float) (getIconWidth() / 2 - t.getBounds().getCenterX()), (float) ((3 * getIconHeight()) / 8 - t.getBounds().getCenterY()));<NEW_LINE>t = new TextLayout("USE iee", font, g2.getFontRenderContext());<NEW_LINE>t.draw(g2, (float) (getIconWidth() / 2 - t.getBounds().getCenterX()), (float) ((5 * getIconHeight()) / 8 - t.getBounds().getCenterY()));<NEW_LINE>t = new TextLayout("ENTITY ", font, g2.getFontRenderContext());<NEW_LINE>t.draw(g2, (float) (getIconWidth() / 2 - t.getBounds().getCenterX()), (float) ((7 * getIconHeight()) / 8 - t.getBounds().getCenterY()));<NEW_LINE>if (type.equals(HdlToolbarModel.HDL_VALIDATE)) {<NEW_LINE>g2.setColor(Color.RED);<NEW_LINE>g2.setStroke(new BasicStroke(scale(2)));<NEW_LINE>final int[] xpos = { scale(3), scale(6), scale(15) };<NEW_LINE>final int[] ypos = { scale(3), scale(11), 0 };<NEW_LINE>g2.drawPolyline(xpos, ypos, 3);<NEW_LINE>} else {<NEW_LINE>if (type.equals(HdlToolbarModel.HDL_EXPORT)) {<NEW_LINE>g2.translate(scale(8), scale(4));<NEW_LINE>g2.rotate(Math.PI);<NEW_LINE>g2.translate(-scale(8<MASK><NEW_LINE>}<NEW_LINE>g2.setColor(Color.MAGENTA.darker());<NEW_LINE>final int[] x = { scale(7), scale(7), scale(5), scale(8), scale(11), scale(9), scale(9) };<NEW_LINE>final int[] y = { 0, scale(5), scale(5), scale(8), scale(5), scale(5), 0 };<NEW_LINE>g2.fillPolygon(x, y, 7);<NEW_LINE>g2.drawPolygon(x, y, 7);<NEW_LINE>}<NEW_LINE>}
), -scale(4));
1,053,853
ActionResult<Wo> execute(EffectivePerson effectivePerson, String flag) throws Exception {<NEW_LINE>try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {<NEW_LINE>ActionResult<Wo> result = new ActionResult<>();<NEW_LINE>Business business = new Business(emc);<NEW_LINE>File file = emc.flag(flag, File.class);<NEW_LINE>if (null == file) {<NEW_LINE>throw new <MASK><NEW_LINE>}<NEW_LINE>Application application = emc.find(file.getApplication(), Application.class);<NEW_LINE>if (null == application) {<NEW_LINE>throw new ExceptionEntityNotExist(file.getApplication(), Application.class);<NEW_LINE>}<NEW_LINE>if (!business.editable(effectivePerson, application)) {<NEW_LINE>throw new ExceptionAccessDenied(effectivePerson.getDistinguishedName());<NEW_LINE>}<NEW_LINE>emc.beginTransaction(File.class);<NEW_LINE>emc.remove(file, CheckRemoveType.all);<NEW_LINE>emc.commit();<NEW_LINE>CacheManager.notify(File.class);<NEW_LINE>Wo wo = new Wo();<NEW_LINE>wo.setId(file.getId());<NEW_LINE>result.setData(wo);<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>}
ExceptionEntityNotExist(flag, File.class);
1,326,333
private boolean threadPoolHasNext() throws CorruptDataException {<NEW_LINE>while ((current == null) && pool.notNull()) {<NEW_LINE>while (index < poolSize) {<NEW_LINE>J9ThreadMonitorPointer monitor = J9ThreadMonitorPointer.cast(poolEntries.add(index));<NEW_LINE>index++;<NEW_LINE>if (!FREE_TAG.eq(monitor.count())) {<NEW_LINE>J9ThreadAbstractMonitorPointer lock = J9ThreadAbstractMonitorPointer.cast(monitor);<NEW_LINE>if (lock.flags().allBitsIn(J9ThreadAbstractMonitor.J9THREAD_MONITOR_OBJECT)) {<NEW_LINE>if (!lock.userData().eq(0)) {<NEW_LINE>// this is an object monitor in the system monitor table<NEW_LINE>J9ObjectPointer obj = J9ObjectPointer.cast(lock.userData());<NEW_LINE>ObjectMonitor <MASK><NEW_LINE>// This check is to exclude flat object monitors. Flat object monitors are accounted for during the heap walk<NEW_LINE>if ((objmon == null) || !objmon.isInflated()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>// return an object monitor<NEW_LINE>current = objmon;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// return a system monitor<NEW_LINE>current = monitor;<NEW_LINE>}<NEW_LINE>if (log.isLoggable(Level.FINE)) {<NEW_LINE>log.fine(String.format("Found monitor @ 0x%016x : %s", monitor.getAddress(), monitor.name().getCStringAtOffset(0)));<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>pool = pool.next();<NEW_LINE>if (pool.notNull()) {<NEW_LINE>index = 0;<NEW_LINE>poolEntries = pool.entriesEA();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return pool.notNull();<NEW_LINE>}
objmon = ObjectAccessBarrier.getMonitor(obj);
1,108,860
final ListQueriesResult executeListQueries(ListQueriesRequest listQueriesRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listQueriesRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListQueriesRequest> request = null;<NEW_LINE>Response<ListQueriesResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListQueriesRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listQueriesRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "CloudTrail");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListQueries");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListQueriesResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListQueriesResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
HandlerContextKey.SIGNING_REGION, getSigningRegion());
1,250,749
private Node createMainPane() {<NEW_LINE>Pane main = new Pane();<NEW_LINE>HBox lr = new HBox(10);<NEW_LINE>VBox src = new VBox(10);<NEW_LINE>src.getChildren().add(new Text("SOURCE CONTROL:"));<NEW_LINE>src.getChildren().add(new Separator());<NEW_LINE>src.getChildren().add(sourceControlPane);<NEW_LINE>src.getChildren().add(new Separator());<NEW_LINE>src.getChildren().add(createLeftPane());<NEW_LINE>VBox trgt = new VBox(10);<NEW_LINE>trgt.getChildren().add(new Text("TARGET CONTROL:"));<NEW_LINE>trgt.getChildren().add(new Separator());<NEW_LINE>trgt.getChildren().add(targetControlPane);<NEW_LINE>trgt.getChildren()<MASK><NEW_LINE>trgt.getChildren().add(createRightPane());<NEW_LINE>lr.getChildren().add(src);<NEW_LINE>lr.getChildren().add(new Separator(Orientation.VERTICAL));<NEW_LINE>lr.getChildren().add(trgt);<NEW_LINE>VBox tb = new VBox(10);<NEW_LINE>tb.getChildren().add(lr);<NEW_LINE>tb.getChildren().add(new Separator());<NEW_LINE>tb.getChildren().add(log);<NEW_LINE>main.getChildren().add(tb);<NEW_LINE>return main;<NEW_LINE>}
.add(new Separator());
1,053,037
private AddEntryResult addEntry(final int recordVersion, final byte[] entryContent, final OAtomicOperation atomicOperation) throws IOException {<NEW_LINE>int recordSizesDiff;<NEW_LINE>int position;<NEW_LINE>int finalVersion = 0;<NEW_LINE>long pageIndex;<NEW_LINE>do {<NEW_LINE>final FindFreePageResult findFreePageResult = findFreePage(entryContent.length, atomicOperation);<NEW_LINE>final int freePageIndex = findFreePageResult.freePageIndex;<NEW_LINE>pageIndex = findFreePageResult.pageIndex;<NEW_LINE>final boolean newRecord = freePageIndex >= FREE_LIST_SIZE;<NEW_LINE>OCacheEntry cacheEntry = loadPageForWrite(atomicOperation, fileId, pageIndex, false, true);<NEW_LINE>if (cacheEntry == null) {<NEW_LINE>cacheEntry = addPage(atomicOperation, fileId);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>final OClusterPage localPage = new OClusterPage(cacheEntry);<NEW_LINE>if (newRecord) {<NEW_LINE>localPage.init();<NEW_LINE>}<NEW_LINE>assert newRecord || freePageIndex == calculateFreePageIndex(localPage);<NEW_LINE>final int initialFreeSpace = localPage.getFreeSpace();<NEW_LINE>position = localPage.appendRecord(recordVersion, entryContent, -1, atomicOperation.getBookedRecordPositions(id, cacheEntry.getPageIndex()));<NEW_LINE>final int freeSpace = localPage.getFreeSpace();<NEW_LINE>recordSizesDiff = initialFreeSpace - freeSpace;<NEW_LINE>if (position >= 0) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>releasePageFromWrite(atomicOperation, cacheEntry);<NEW_LINE>}<NEW_LINE>updateFreePagesIndex(freePageIndex, pageIndex, atomicOperation);<NEW_LINE>} while (position < 0);<NEW_LINE>return new AddEntryResult(pageIndex, position, finalVersion, recordSizesDiff);<NEW_LINE>}
finalVersion = localPage.getRecordVersion(position);
1,686,421
public static DescribePerDateDataResponse unmarshall(DescribePerDateDataResponse describePerDateDataResponse, UnmarshallerContext context) {<NEW_LINE>describePerDateDataResponse.setRequestId(context.stringValue("DescribePerDateDataResponse.RequestId"));<NEW_LINE>List<DataViewItem> dataView = new ArrayList<DataViewItem>();<NEW_LINE>for (int i = 0; i < context.lengthValue("DescribePerDateDataResponse.DataView.Length"); i++) {<NEW_LINE>DataViewItem dataViewItem = new DataViewItem();<NEW_LINE>dataViewItem.setDataTime(context.stringValue("DescribePerDateDataResponse.DataView[" + i + "].DataTime"));<NEW_LINE>dataViewItem.setCallTimes(context.longValue("DescribePerDateDataResponse.DataView[" + i + "].CallTimes"));<NEW_LINE>dataViewItem.setTotalHit(context.longValue("DescribePerDateDataResponse.DataView[" + i + "].TotalHit"));<NEW_LINE>dataViewItem.setHitRate(context.longValue("DescribePerDateDataResponse.DataView[" + i + "].HitRate"));<NEW_LINE>dataViewItem.setIsGreyPhone(context.longValue("DescribePerDateDataResponse.DataView[" + i + "].IsGreyPhone"));<NEW_LINE>dataViewItem.setIsBlackPhone(context.longValue("DescribePerDateDataResponse.DataView[" + i + "].IsBlackPhone"));<NEW_LINE>dataViewItem.setIsVirtualOperator(context.longValue("DescribePerDateDataResponse.DataView[" + i + "].IsVirtualOperator"));<NEW_LINE>dataViewItem.setIsOpenCommonPort1d(context.longValue<MASK><NEW_LINE>dataViewItem.setIsOpenCommonPort7d(context.longValue("DescribePerDateDataResponse.DataView[" + i + "].IsOpenCommonPort7d"));<NEW_LINE>dataViewItem.setIsOpenCommonPort30d(context.longValue("DescribePerDateDataResponse.DataView[" + i + "].IsOpenCommonPort30d"));<NEW_LINE>dataViewItem.setIsCheatFlow1d(context.longValue("DescribePerDateDataResponse.DataView[" + i + "].IsCheatFlow1d"));<NEW_LINE>dataViewItem.setIsCheatFlow7d(context.longValue("DescribePerDateDataResponse.DataView[" + i + "].IsCheatFlow7d"));<NEW_LINE>dataViewItem.setIsCheatFlow30d(context.longValue("DescribePerDateDataResponse.DataView[" + i + "].IsCheatFlow30d"));<NEW_LINE>dataViewItem.setIsProxy1d(context.longValue("DescribePerDateDataResponse.DataView[" + i + "].IsProxy1d"));<NEW_LINE>dataViewItem.setIsProxy7d(context.longValue("DescribePerDateDataResponse.DataView[" + i + "].IsProxy7d"));<NEW_LINE>dataViewItem.setIsProxy30d(context.longValue("DescribePerDateDataResponse.DataView[" + i + "].IsProxy30d"));<NEW_LINE>dataViewItem.setIsHiJack1d(context.longValue("DescribePerDateDataResponse.DataView[" + i + "].IsHiJack1d"));<NEW_LINE>dataViewItem.setIsHiJack7d(context.longValue("DescribePerDateDataResponse.DataView[" + i + "].IsHiJack7d"));<NEW_LINE>dataViewItem.setIsHiJack30d(context.longValue("DescribePerDateDataResponse.DataView[" + i + "].IsHiJack30d"));<NEW_LINE>dataViewItem.setIsC21d(context.longValue("DescribePerDateDataResponse.DataView[" + i + "].IsC21d"));<NEW_LINE>dataViewItem.setIsC27d(context.longValue("DescribePerDateDataResponse.DataView[" + i + "].IsC27d"));<NEW_LINE>dataViewItem.setIsC230d(context.longValue("DescribePerDateDataResponse.DataView[" + i + "].IsC230d"));<NEW_LINE>dataViewItem.setIsBotnet1d(context.longValue("DescribePerDateDataResponse.DataView[" + i + "].IsBotnet1d"));<NEW_LINE>dataViewItem.setIsBotnet7d(context.longValue("DescribePerDateDataResponse.DataView[" + i + "].IsBotnet7d"));<NEW_LINE>dataViewItem.setIsBotnet30d(context.longValue("DescribePerDateDataResponse.DataView[" + i + "].IsBotnet30d"));<NEW_LINE>dataViewItem.setIsNetAttack1d(context.longValue("DescribePerDateDataResponse.DataView[" + i + "].IsNetAttack1d"));<NEW_LINE>dataViewItem.setIsNetAttack7d(context.longValue("DescribePerDateDataResponse.DataView[" + i + "].IsNetAttack7d"));<NEW_LINE>dataViewItem.setIsNetAttack30d(context.longValue("DescribePerDateDataResponse.DataView[" + i + "].IsNetAttack30d"));<NEW_LINE>dataViewItem.setIsBlackCampaign1d(context.longValue("DescribePerDateDataResponse.DataView[" + i + "].IsBlackCampaign1d"));<NEW_LINE>dataViewItem.setIsBlackCampaign7d(context.longValue("DescribePerDateDataResponse.DataView[" + i + "].IsBlackCampaign7d"));<NEW_LINE>dataViewItem.setIsBlackCampaign30d(context.longValue("DescribePerDateDataResponse.DataView[" + i + "].IsBlackCampaign30d"));<NEW_LINE>dataView.add(dataViewItem);<NEW_LINE>}<NEW_LINE>describePerDateDataResponse.setDataView(dataView);<NEW_LINE>return describePerDateDataResponse;<NEW_LINE>}
("DescribePerDateDataResponse.DataView[" + i + "].IsOpenCommonPort1d"));
1,675,710
private Video createPinnedChannel(Video video) {<NEW_LINE>if (video == null || (!video.hasReloadPageKey() && !video.hasChannel() && !video.isChannel())) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>Video section = new Video();<NEW_LINE>section.itemType = video.itemType;<NEW_LINE>section.channelId = video.channelId;<NEW_LINE>section.reloadPageKey = video.getReloadPageKey();<NEW_LINE>// Trying to properly format channel playlists, mixes etc<NEW_LINE>boolean hasChannel = video.hasChannel(<MASK><NEW_LINE>boolean isUserPlaylistItem = video.getGroupTitle() != null && video.belongsToSamePlaylistGroup();<NEW_LINE>String title = hasChannel ? video.extractAuthor() : isUserPlaylistItem ? null : video.title;<NEW_LINE>String subtitle = isUserPlaylistItem ? video.getGroupTitle() : hasChannel || video.isChannel() ? null : video.extractAuthor();<NEW_LINE>section.title = title != null && subtitle != null ? String.format("%s - %s", title, subtitle) : String.format("%s", title != null ? title : subtitle);<NEW_LINE>section.cardImageUrl = video.cardImageUrl;<NEW_LINE>return section;<NEW_LINE>}
) && !video.isChannel();
247,151
public GetJobTemplateResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>GetJobTemplateResult getJobTemplateResult = new GetJobTemplateResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return getJobTemplateResult;<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("jobTemplate", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>getJobTemplateResult.setJobTemplate(JobTemplateJsonUnmarshaller.getInstance().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 getJobTemplateResult;<NEW_LINE>}
String currentParentElement = context.getCurrentParentElement();
602,122
protected WebResponse uncompressJavaScript(final WebResponse response) {<NEW_LINE>final WebRequest request = response.getWebRequest();<NEW_LINE>final String scriptName = request.getUrl().toString();<NEW_LINE>final <MASK><NEW_LINE>// skip if it is already formatted? => TODO<NEW_LINE>final ContextFactory factory = new ContextFactory();<NEW_LINE>final ContextAction<Object> action = cx -> {<NEW_LINE>cx.setOptimizationLevel(-1);<NEW_LINE>final Script script = cx.compileString(scriptSource, scriptName, 0, null);<NEW_LINE>return cx.decompileScript(script, 4);<NEW_LINE>};<NEW_LINE>try {<NEW_LINE>final String decompileScript = (String) factory.call(action);<NEW_LINE>final List<NameValuePair> responseHeaders = new ArrayList<>(response.getResponseHeaders());<NEW_LINE>for (int i = responseHeaders.size() - 1; i >= 0; i--) {<NEW_LINE>if ("content-encoding".equalsIgnoreCase(responseHeaders.get(i).getName())) {<NEW_LINE>responseHeaders.remove(i);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final WebResponseData wrd = new WebResponseData(decompileScript.getBytes(), response.getStatusCode(), response.getStatusMessage(), responseHeaders);<NEW_LINE>return new WebResponse(wrd, response.getWebRequest().getUrl(), response.getWebRequest().getHttpMethod(), response.getLoadTime());<NEW_LINE>} catch (final Exception e) {<NEW_LINE>LOG.warn("Failed to decompress JavaScript response. Delivering as it.", e);<NEW_LINE>}<NEW_LINE>return response;<NEW_LINE>}
String scriptSource = response.getContentAsString();
563,896
private void updateValue(String resourceUuid, String resourceType, String newValue, boolean localUpdate) {<NEW_LINE>String originValue = loadConfigValue(resourceUuid);<NEW_LINE>String oldValue = originValue == null ? globalConfig.value() : originValue;<NEW_LINE>if (localUpdate) {<NEW_LINE>globalConfig.getValidators().forEach(it -> it.validateGlobalConfig(globalConfig.getCategory(), globalConfig.getName(), oldValue, newValue));<NEW_LINE>validatorExtensions.forEach(it -> it.validateResourceConfig(resourceUuid, oldValue, newValue));<NEW_LINE>updateValueInDb(resourceUuid, resourceType, newValue);<NEW_LINE>localUpdateExtensions.forEach(it -> it.updateResourceConfig(this, resourceUuid, resourceType, oldValue, newValue));<NEW_LINE>}<NEW_LINE>updateExtensions.forEach(it -> it.updateResourceConfig(this, resourceUuid<MASK><NEW_LINE>if (localUpdate) {<NEW_LINE>UpdateEvent evt = new UpdateEvent();<NEW_LINE>evt.setResourceUuid(resourceUuid);<NEW_LINE>evt.setOldValue(oldValue);<NEW_LINE>evtf.fire(makeUpdateEventPath(), evt);<NEW_LINE>}<NEW_LINE>logger.debug(String.format("updated resource config[resourceUuid:%s, resourceType:%s, category:%s, name:%s]: %s to %s", resourceUuid, resourceType, globalConfig.getCategory(), globalConfig.getName(), oldValue, newValue));<NEW_LINE>}
, resourceType, oldValue, newValue));
15,785
private static void blockedMaze(char[][] maze, int i, int j, int m, int n, boolean[][] visited) {<NEW_LINE>if (i == m - 1 && j == n - 1) {<NEW_LINE>display(maze, m, n);<NEW_LINE>System.out.println();<NEW_LINE>return;<NEW_LINE>} else {<NEW_LINE>// Move in up direction<NEW_LINE>if (isSafe(maze, i - 1, j, m, n, visited)) {<NEW_LINE>visited[i - 1][j] = true;<NEW_LINE>maze[i - 1][j] = '*';<NEW_LINE>blockedMaze(maze, i - 1, j, m, n, visited);<NEW_LINE>visited[i - 1][j] = false;<NEW_LINE>maze[i - 1][j] = '-';<NEW_LINE>}<NEW_LINE>// Move in left direction<NEW_LINE>if (isSafe(maze, i, j - 1, m, n, visited)) {<NEW_LINE>visited[i][j - 1] = true;<NEW_LINE>maze[i][j - 1] = '*';<NEW_LINE>blockedMaze(maze, i, j - 1, m, n, visited);<NEW_LINE>visited[i][j - 1] = false;<NEW_LINE>maze[i][j - 1] = '-';<NEW_LINE>}<NEW_LINE>// Move in down direction<NEW_LINE>if (isSafe(maze, i + 1, j, m, n, visited)) {<NEW_LINE>visited[i + 1][j] = true;<NEW_LINE>maze[i + 1][j] = '*';<NEW_LINE>blockedMaze(maze, i + 1, j, m, n, visited);<NEW_LINE>visited[i <MASK><NEW_LINE>maze[i + 1][j] = '-';<NEW_LINE>}<NEW_LINE>// Move in right direction<NEW_LINE>if (isSafe(maze, i, j + 1, m, n, visited)) {<NEW_LINE>visited[i][j + 1] = true;<NEW_LINE>maze[i][j + 1] = '*';<NEW_LINE>blockedMaze(maze, i, j + 1, m, n, visited);<NEW_LINE>visited[i][j + 1] = false;<NEW_LINE>maze[i][j + 1] = '-';<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
+ 1][j] = false;
1,491,509
public void onCreate() {<NEW_LINE>super.onCreate();<NEW_LINE>inject(this);<NEW_LINE>navigation.setTitle(R.string.settings_developer);<NEW_LINE>LinearLayout wrapper = new LinearLayout(context);<NEW_LINE>wrapper.setOrientation(LinearLayout.VERTICAL);<NEW_LINE>Button logsButton = new Button(context);<NEW_LINE>logsButton.setOnClickListener(new View.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(View v) {<NEW_LINE>navigationController.pushController(new LogsController(context));<NEW_LINE>}<NEW_LINE>});<NEW_LINE>logsButton.<MASK><NEW_LINE>wrapper.addView(logsButton);<NEW_LINE>Button crashButton = new Button(context);<NEW_LINE>crashButton.setOnClickListener(new View.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(View v) {<NEW_LINE>throw new RuntimeException("Debug crash");<NEW_LINE>}<NEW_LINE>});<NEW_LINE>crashButton.setText("Crash the app");<NEW_LINE>wrapper.addView(crashButton);<NEW_LINE>summaryText = new TextView(context);<NEW_LINE>summaryText.setPadding(0, dp(25), 0, 0);<NEW_LINE>wrapper.addView(summaryText);<NEW_LINE>setDbSummary();<NEW_LINE>Button resetDbButton = new Button(context);<NEW_LINE>resetDbButton.setOnClickListener(new View.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(View v) {<NEW_LINE>databaseManager.reset();<NEW_LINE>System.exit(0);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>resetDbButton.setText("Delete database");<NEW_LINE>wrapper.addView(resetDbButton);<NEW_LINE>ScrollView scrollView = new ScrollView(context);<NEW_LINE>scrollView.addView(wrapper);<NEW_LINE>view = scrollView;<NEW_LINE>view.setBackgroundColor(getAttrColor(context, R.attr.backcolor));<NEW_LINE>}
setText(R.string.settings_open_logs);
74,848
public static String beanToStr(Object bean, boolean allowCustom) {<NEW_LINE>Class<?> clazz = Cls.unproxy(bean.getClass());<NEW_LINE>if (allowCustom) {<NEW_LINE>Method m = <MASK><NEW_LINE>if (!m.getDeclaringClass().equals(Object.class)) {<NEW_LINE>return bean.toString();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>BeanProperties props = propertiesOf(bean).annotated(ToString.class);<NEW_LINE>if (props.isEmpty()) {<NEW_LINE>Prop nameProp = property(bean, "name", false);<NEW_LINE>if (nameProp != null && nameProp.getType() == String.class) {<NEW_LINE>return U.safe((String) nameProp.get(bean));<NEW_LINE>}<NEW_LINE>props = propertiesOf(bean);<NEW_LINE>}<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>for (Prop prop : props) {<NEW_LINE>String name = prop.getName();<NEW_LINE>Object value = prop.get(bean);<NEW_LINE>if (sb.length() > 0) {<NEW_LINE>sb.append(", ");<NEW_LINE>}<NEW_LINE>if (prop.getTypeKind() == TypeKind.UNKNOWN) {<NEW_LINE>value = value == bean ? "[this]" : "[obj]";<NEW_LINE>}<NEW_LINE>if (value instanceof Date) {<NEW_LINE>Date date = (Date) value;<NEW_LINE>value = Dates.str(date);<NEW_LINE>}<NEW_LINE>sb.append(name);<NEW_LINE>sb.append(": ");<NEW_LINE>sb.append(value);<NEW_LINE>}<NEW_LINE>return sb.toString();<NEW_LINE>}
Cls.getMethod(clazz, "toString");
149,850
public BackupResponse newBackupResponse(Backup backup) {<NEW_LINE>VMInstanceVO vm = vmInstanceDao.findByIdIncludingRemoved(backup.getVmId());<NEW_LINE>AccountVO account = accountDao.findByIdIncludingRemoved(vm.getAccountId());<NEW_LINE>DomainVO domain = domainDao.findByIdIncludingRemoved(vm.getDomainId());<NEW_LINE>DataCenterVO zone = dataCenterDao.findByIdIncludingRemoved(vm.getDataCenterId());<NEW_LINE>BackupOffering offering = backupOfferingDao.findByIdIncludingRemoved(vm.getBackupOfferingId());<NEW_LINE>BackupResponse response = new BackupResponse();<NEW_LINE>response.setId(backup.getUuid());<NEW_LINE>response.setVmId(vm.getUuid());<NEW_LINE>response.setVmName(vm.getHostName());<NEW_LINE>response.setExternalId(backup.getExternalId());<NEW_LINE>response.setType(backup.getType());<NEW_LINE>response.setDate(backup.getDate());<NEW_LINE>response.setSize(backup.getSize());<NEW_LINE>response.setProtectedSize(backup.getProtectedSize());<NEW_LINE>response.setStatus(backup.getStatus());<NEW_LINE>response.setVolumes(new Gson().toJson(vm.getBackupVolumeList().toArray(), Backup.VolumeInfo[].class));<NEW_LINE>response.<MASK><NEW_LINE>response.setBackupOffering(offering.getName());<NEW_LINE>response.setAccountId(account.getUuid());<NEW_LINE>response.setAccount(account.getAccountName());<NEW_LINE>response.setDomainId(domain.getUuid());<NEW_LINE>response.setDomain(domain.getName());<NEW_LINE>response.setZoneId(zone.getUuid());<NEW_LINE>response.setZone(zone.getName());<NEW_LINE>response.setObjectName("backup");<NEW_LINE>return response;<NEW_LINE>}
setBackupOfferingId(offering.getUuid());
1,705,718
public void write(org.apache.thrift.protocol.TProtocol prot, TopologyTaskHbInfo struct) throws org.apache.thrift.TException {<NEW_LINE>TTupleProtocol oprot = (TTupleProtocol) prot;<NEW_LINE>oprot.writeString(struct.topologyId);<NEW_LINE>oprot.writeI32(struct.topologyMasterId);<NEW_LINE>BitSet optionals = new BitSet();<NEW_LINE>if (struct.is_set_taskHbs()) {<NEW_LINE>optionals.set(0);<NEW_LINE>}<NEW_LINE>oprot.writeBitSet(optionals, 1);<NEW_LINE>if (struct.is_set_taskHbs()) {<NEW_LINE>{<NEW_LINE>oprot.writeI32(<MASK><NEW_LINE>for (Map.Entry<Integer, TaskHeartbeat> _iter219 : struct.taskHbs.entrySet()) {<NEW_LINE>oprot.writeI32(_iter219.getKey());<NEW_LINE>_iter219.getValue().write(oprot);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
struct.taskHbs.size());
656,227
public boolean onTap(LatLong tapLatLong, Point layerXY, Point tapXY) {<NEW_LINE>this.expanded = !this.expanded;<NEW_LINE>double centerX = layerXY.x + this.getHorizontalOffset();<NEW_LINE>double centerY = layerXY.y + this.getVerticalOffset();<NEW_LINE>double radiusX = this.getBitmap<MASK><NEW_LINE>double radiusY = this.getBitmap().getHeight() / 2;<NEW_LINE>double distX = Math.abs(centerX - tapXY.x);<NEW_LINE>double distY = Math.abs(centerY - tapXY.y);<NEW_LINE>if (distX < radiusX && distY < radiusY) {<NEW_LINE>if (this.expanded) {<NEW_LINE>// remove all child markers<NEW_LINE>for (Layer elt : this.layers) {<NEW_LINE>if (elt instanceof ChildMarker) {<NEW_LINE>this.layers.remove(elt);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// begin with (n). than the child marker will be over the line.<NEW_LINE>int i = this.children.size();<NEW_LINE>for (ChildMarker marker : this.children) {<NEW_LINE>marker.init(i, getBitmap(), getHorizontalOffset(), getVerticalOffset());<NEW_LINE>// add child to layer<NEW_LINE>this.layers.add(marker);<NEW_LINE>i--;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// remove all child layers<NEW_LINE>for (ChildMarker childMarker : this.children) {<NEW_LINE>this.layers.remove(childMarker);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
().getWidth() / 2;
861,012
final CreateRoutingProfileResult executeCreateRoutingProfile(CreateRoutingProfileRequest createRoutingProfileRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createRoutingProfileRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateRoutingProfileRequest> request = null;<NEW_LINE>Response<CreateRoutingProfileResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateRoutingProfileRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createRoutingProfileRequest));<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, "Connect");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateRoutingProfile");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateRoutingProfileResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateRoutingProfileResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
720,518
private void loadNode1043() {<NEW_LINE>PropertyTypeNode node = new PropertyTypeNode(this.context, Identifiers.NamespaceMetadataType_IsNamespaceSubset, new QualifiedName(0, "IsNamespaceSubset"), new LocalizedText("en", "IsNamespaceSubset"), LocalizedText.NULL_VALUE, UInteger.valueOf(0), UInteger.valueOf(0), new DataValue(Variant.NULL_VALUE), Identifiers.Boolean, -1, new UInteger[] {}, UByte.valueOf(1), UByte.valueOf(1), 0.0, false);<NEW_LINE>node.addReference(new Reference(Identifiers.NamespaceMetadataType_IsNamespaceSubset, Identifiers.HasTypeDefinition, Identifiers.PropertyType<MASK><NEW_LINE>node.addReference(new Reference(Identifiers.NamespaceMetadataType_IsNamespaceSubset, Identifiers.HasModellingRule, Identifiers.ModellingRule_Mandatory.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.NamespaceMetadataType_IsNamespaceSubset, Identifiers.HasProperty, Identifiers.NamespaceMetadataType.expanded(), false));<NEW_LINE>this.nodeManager.addNode(node);<NEW_LINE>}
.expanded(), true));
72,132
public void run(RegressionEnvironment env) {<NEW_LINE>EPCompiled compiled;<NEW_LINE>DeploymentOptions options;<NEW_LINE>compiled = env.compile("select * from SupportBean(theString='ABC')");<NEW_LINE>options = new DeploymentOptions().setStatementSubstitutionParameter(prepared -> {<NEW_LINE>tryInvalidSetObject(prepared, stmt -> stmt.setObject("x", 10), "The statement has no substitution parameters");<NEW_LINE>tryInvalidSetObject(prepared, stmt -> stmt.setObject(1, 10), "The statement has no substitution parameters");<NEW_LINE>});<NEW_LINE>deployWithOptionsWUndeploy(env, compiled, options);<NEW_LINE>// numbered, untyped, casted at eventService<NEW_LINE>compiled = env.compile("select * from SupportBean(theString=cast(?, String))");<NEW_LINE>options = new DeploymentOptions().setStatementSubstitutionParameter(prepared -> {<NEW_LINE>tryInvalidSetObject(prepared, stmt -> stmt.setObject<MASK><NEW_LINE>tryInvalidSetObject(prepared, stmt -> stmt.setObject(0, "a"), "Invalid substitution parameter index, expected an index between 1 and 1");<NEW_LINE>tryInvalidSetObject(prepared, stmt -> stmt.setObject(2, "a"), "Invalid substitution parameter index, expected an index between 1 and 1");<NEW_LINE>prepared.setObject(1, "xxx");<NEW_LINE>});<NEW_LINE>deployWithOptionsWUndeploy(env, compiled, options);<NEW_LINE>// named, untyped, casted at eventService<NEW_LINE>compiled = env.compile("select * from SupportBean(theString=cast(?:p0, String))");<NEW_LINE>options = new DeploymentOptions().setStatementSubstitutionParameter(prepared -> {<NEW_LINE>tryInvalidSetObject(prepared, stmt -> stmt.setObject("x", 10), "Failed to find substitution parameter named 'x', available parameters are [p0]");<NEW_LINE>tryInvalidSetObject(prepared, stmt -> stmt.setObject(0, "a"), "Substitution parameter names have been provided for this statement, please set the value by name");<NEW_LINE>prepared.setObject("p0", "xxx");<NEW_LINE>});<NEW_LINE>deployWithOptionsWUndeploy(env, compiled, options);<NEW_LINE>}
("x", 10), "Substitution parameter names have not been provided for this statement");
616,283
private List<Wo> list(Business business, Wi wi) throws Exception {<NEW_LINE>List<Wo> wos = new ArrayList<>();<NEW_LINE>List<Person> people = business.person().pick(wi.getPersonList());<NEW_LINE>List<String> personIds = ListTools.extractProperty(people, JpaObject.id_FIELDNAME, String.class, true, true);<NEW_LINE>EntityManager em = business.entityManagerContainer(<MASK><NEW_LINE>CriteriaBuilder cb = em.getCriteriaBuilder();<NEW_LINE>CriteriaQuery<String> cq = cb.createQuery(String.class);<NEW_LINE>Root<Identity> root = cq.from(Identity.class);<NEW_LINE>Predicate p = root.get(Identity_.person).in(personIds);<NEW_LINE>List<String> os = em.createQuery(cq.select(root.get(Identity_.unit)).where(p)).getResultList().stream().distinct().collect(Collectors.toList());<NEW_LINE>List<String> unitIds = new ArrayList<>(os);<NEW_LINE>for (String str : os) {<NEW_LINE>unitIds.addAll(business.unit().listSupNested(str));<NEW_LINE>}<NEW_LINE>unitIds = ListTools.trim(unitIds, true, true);<NEW_LINE>List<Unit> units = business.unit().pick(unitIds);<NEW_LINE>units = business.unit().sort(units);<NEW_LINE>for (Unit o : units) {<NEW_LINE>wos.add(this.convert(business, o, Wo.class));<NEW_LINE>}<NEW_LINE>return wos;<NEW_LINE>}
).get(Identity.class);
293,054
public IterationScopeNode createIterationScope(FrameDescriptor frameDescriptor, JSFrameSlot blockScopeSlot) {<NEW_LINE>int numberOfSlots = frameDescriptor.getNumberOfSlots();<NEW_LINE>assert numberOfSlots > ScopeFrameNode.PARENT_SCOPE_SLOT_INDEX && ScopeFrameNode.PARENT_SCOPE_IDENTIFIER.equals(frameDescriptor.getSlotName(ScopeFrameNode.PARENT_SCOPE_SLOT_INDEX));<NEW_LINE>int numberOfSlotsToCopy = numberOfSlots - 1;<NEW_LINE>JSReadFrameSlotNode[<MASK><NEW_LINE>JSWriteFrameSlotNode[] writes = new JSWriteFrameSlotNode[numberOfSlotsToCopy];<NEW_LINE>int slotIndex = 0;<NEW_LINE>for (int i = 0; i < numberOfSlots; i++) {<NEW_LINE>if (i == ScopeFrameNode.PARENT_SCOPE_SLOT_INDEX) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>JSFrameSlot slot = JSFrameSlot.fromIndexedFrameSlot(frameDescriptor, i);<NEW_LINE>reads[slotIndex] = JSReadFrameSlotNode.create(slot, false);<NEW_LINE>writes[slotIndex] = JSWriteFrameSlotNode.create(slot, null, false);<NEW_LINE>slotIndex++;<NEW_LINE>}<NEW_LINE>assert slotIndex == numberOfSlotsToCopy;<NEW_LINE>return IterationScopeNode.create(frameDescriptor, reads, writes, blockScopeSlot.getIndex());<NEW_LINE>}
] reads = new JSReadFrameSlotNode[numberOfSlotsToCopy];
807,722
public void update(double value, long timestamp) {<NEW_LINE>rescaleIfNeeded();<NEW_LINE>lockForRegularUsage();<NEW_LINE>try {<NEW_LINE>final double priority = weight(timestamp - _startTime) / ThreadLocalRandom.current().nextDouble();<NEW_LINE>// TODO/FIXME: why is this unconditional? if newCount > size, should be decremented again...<NEW_LINE>final long newCount = _count.incrementAndGet();<NEW_LINE>if (newCount <= _size) {<NEW_LINE>_values.put(priority, value);<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>if (first < priority && _values.putIfAbsent(priority, value) == null) {<NEW_LINE>// ensure we always remove an item<NEW_LINE>while (_values.remove(first) == null) {<NEW_LINE>first = _values.firstKey();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// _count.set(_size); ? [TODO/FIXME: cheap; shouldn't hurt; better than not setting]<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>unlockForRegularUsage();<NEW_LINE>}<NEW_LINE>}
Double first = _values.firstKey();
1,286,243
public boolean storeById(String id, String report) throws IOException {<NEW_LINE>byte[] content = report.getBytes("utf-8");<NEW_LINE>int length = content.length;<NEW_LINE>byte[] num = String.valueOf(length).getBytes("utf-8");<NEW_LINE>m_writeLock.lock();<NEW_LINE>try {<NEW_LINE>m_writeDataFile.write(num);<NEW_LINE>m_writeDataFile.write('\n');<NEW_LINE>m_writeDataFile.write(content);<NEW_LINE>m_writeDataFile.write('\n');<NEW_LINE>m_writeDataFile.flush();<NEW_LINE>long offset = m_writeDataFileLength;<NEW_LINE>String line = id + '\t' + offset + '\n';<NEW_LINE>byte[] <MASK><NEW_LINE>m_writeDataFileLength += num.length + 1 + length + 1;<NEW_LINE>m_writeIndexFile.write(data);<NEW_LINE>m_writeIndexFile.flush();<NEW_LINE>m_idToOffsets.put(id, offset);<NEW_LINE>return true;<NEW_LINE>} finally {<NEW_LINE>m_writeLock.unlock();<NEW_LINE>}<NEW_LINE>}
data = line.getBytes("utf-8");
1,414,081
public static DescribeNasInstancesResponse unmarshall(DescribeNasInstancesResponse describeNasInstancesResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeNasInstancesResponse.setRequestId(_ctx.stringValue("DescribeNasInstancesResponse.RequestId"));<NEW_LINE>describeNasInstancesResponse.setSuccess(_ctx.booleanValue("DescribeNasInstancesResponse.Success"));<NEW_LINE>describeNasInstancesResponse.setCode(_ctx.stringValue("DescribeNasInstancesResponse.Code"));<NEW_LINE>describeNasInstancesResponse.setMessage(_ctx.stringValue("DescribeNasInstancesResponse.Message"));<NEW_LINE>describeNasInstancesResponse.setTotalCount(_ctx.longValue("DescribeNasInstancesResponse.TotalCount"));<NEW_LINE>describeNasInstancesResponse.setPageSize(_ctx.integerValue("DescribeNasInstancesResponse.PageSize"));<NEW_LINE>describeNasInstancesResponse.setPageNumber(_ctx.integerValue("DescribeNasInstancesResponse.PageNumber"));<NEW_LINE>List<NasInstance> nasInstances = new ArrayList<NasInstance>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeNasInstancesResponse.NasInstances.Length"); i++) {<NEW_LINE>NasInstance nasInstance = new NasInstance();<NEW_LINE>nasInstance.setFileSystemId(_ctx.stringValue("DescribeNasInstancesResponse.NasInstances[" + i + "].FileSystemId"));<NEW_LINE>nasInstance.setCreateTime(_ctx.longValue("DescribeNasInstancesResponse.NasInstances[" + i + "].CreateTime"));<NEW_LINE>nasInstance.setVaultId(_ctx.stringValue("DescribeNasInstancesResponse.NasInstances[" + i + "].VaultId"));<NEW_LINE>nasInstance.setDescription(_ctx.stringValue("DescribeNasInstancesResponse.NasInstances[" + i + "].Description"));<NEW_LINE>nasInstance.setRegionId(_ctx.stringValue("DescribeNasInstancesResponse.NasInstances[" + i + "].RegionId"));<NEW_LINE>nasInstance.setZoneId(_ctx.stringValue("DescribeNasInstancesResponse.NasInstances[" + i + "].ZoneId"));<NEW_LINE>nasInstance.setProtocolType(_ctx.stringValue("DescribeNasInstancesResponse.NasInstances[" + i + "].ProtocolType"));<NEW_LINE>nasInstance.setStorageType(_ctx.stringValue("DescribeNasInstancesResponse.NasInstances[" + i + "].StorageType"));<NEW_LINE>nasInstance.setStatus(_ctx.stringValue("DescribeNasInstancesResponse.NasInstances[" + i + "].Status"));<NEW_LINE>nasInstance.setMountTargetCount(_ctx.integerValue("DescribeNasInstancesResponse.NasInstances[" + i + "].MountTargetCount"));<NEW_LINE>nasInstance.setMeteredSize(_ctx.longValue<MASK><NEW_LINE>nasInstance.setFileSystemDesc(_ctx.stringValue("DescribeNasInstancesResponse.NasInstances[" + i + "].FileSystemDesc"));<NEW_LINE>nasInstances.add(nasInstance);<NEW_LINE>}<NEW_LINE>describeNasInstancesResponse.setNasInstances(nasInstances);<NEW_LINE>return describeNasInstancesResponse;<NEW_LINE>}
("DescribeNasInstancesResponse.NasInstances[" + i + "].MeteredSize"));
241,456
private void queryMultiDumpGraph(UAVHttpMessage data) {<NEW_LINE>String ipport = data.getRequest("ipport");<NEW_LINE>String timesStr = data.getRequest("times");<NEW_LINE>String <MASK><NEW_LINE>List<String> times = JSONHelper.toObjectArray(timesStr, String.class);<NEW_LINE>List<String> threadIds = JSONHelper.toObjectArray(threadIdsStr, String.class);<NEW_LINE>List<List<Map<String, Object>>> records = new ArrayList<>();<NEW_LINE>for (String time : times) {<NEW_LINE>long timestamp = DataConvertHelper.toLong(time, -1L);<NEW_LINE>// build query builder<NEW_LINE>BoolQueryBuilder queryBuilder = QueryBuilders.boolQuery();<NEW_LINE>queryBuilder.must(QueryBuilders.rangeQuery("time").gte(timestamp).lte(timestamp));<NEW_LINE>queryBuilder.must(QueryBuilders.termQuery("ipport", ipport));<NEW_LINE>SearchResponse sr = query(data, queryBuilder, null, buildSorts(data));<NEW_LINE>List<Map<String, Object>> record = getRecords(sr);<NEW_LINE>records.add(record);<NEW_LINE>}<NEW_LINE>ThreadAnalyser ta = (ThreadAnalyser) getConfigManager().getComponent(feature, "ThreadAnalyser");<NEW_LINE>Map<String, Object> rs = ta.queryMutilDumpGraph(threadIds, records);<NEW_LINE>data.putResponse("rs", JSONHelper.toString(rs));<NEW_LINE>}
threadIdsStr = data.getRequest("threadIds");
670,334
public static void main(final String[] args) throws IOException {<NEW_LINE>final String base = "/home/fwilhelm/Workspace/Development/Projects/" + "Jenetics/jenetics.tool/src/main/resources/io/jenetics/tool/moea";<NEW_LINE>final Path data = Paths.get(base, "circle_min_front.dat");<NEW_LINE>final Path output = Paths.get(base, "circle_min_front.svg");<NEW_LINE>final Engine<DoubleGene, Vec<double[]>> engine = Engine.builder(PROBLEM).alterers(new Mutator<>(0.1), new MeanAlterer<>()).offspringSelector(new TournamentSelector<>(3)).survivorsSelector(UFTournamentSelector.ofVec()).minimizing().build();<NEW_LINE>final ISeq<Phenotype<DoubleGene, Vec<double[]>>> front = engine.stream().limit(Limits.byFixedGeneration(100)).collect(MOEA.toParetoSet(IntRange.of(100, 150)));<NEW_LINE>final StringBuilder out = new StringBuilder();<NEW_LINE>out.append("#x y\n");<NEW_LINE>front.forEach(p -> {<NEW_LINE>out.append(p.fitness().data()[0]);<NEW_LINE>out.append(" ");<NEW_LINE>out.append(p.fitness().data()[1]);<NEW_LINE>out.append("\n");<NEW_LINE>});<NEW_LINE>Files.write(data, out.toString().getBytes());<NEW_LINE>final Gnuplot gnuplot = new Gnuplot(Paths<MASK><NEW_LINE>gnuplot.create(data, output);<NEW_LINE>}
.get(base, "circle_points.gp"));
1,607,098
protected void emitCode(SPIRVCompilationResultBuilder crb, SPIRVAssembler asm) {<NEW_LINE>Logger.traceCodeGen(Logger.BACKEND.SPIRV, "emit IndexedLoadMemCollectionAccess in address: " + address + "[ " + address.getIndex() + "] -- region: " + address.getMemoryRegion().<MASK><NEW_LINE>SPIRVKind spirvKind = (SPIRVKind) result.getPlatformKind();<NEW_LINE>address.emitForLoad(asm, spirvKind);<NEW_LINE>SPIRVId inBoundsAccess = asm.lookUpLIRInstructions(address);<NEW_LINE>SPIRVId genericResult = asm.module.getNextId();<NEW_LINE>SPIRVId ptrGeneric = asm.primitives.getPtrGenericPrimitive(spirvKind.getElementKind());<NEW_LINE>asm.currentBlockScope().add(new SPIRVOpPtrCastToGeneric(ptrGeneric, genericResult, inBoundsAccess));<NEW_LINE>SPIRVId setOpenCLImportId = asm.getOpenclImport();<NEW_LINE>SPIRVUnary.Intrinsic.OpenCLExtendedIntrinsic builtIn = SPIRVUnary.Intrinsic.OpenCLExtendedIntrinsic.VLOADN;<NEW_LINE>SPIRVId baseIndex;<NEW_LINE>if (offsetIndex instanceof ConstantValue) {<NEW_LINE>baseIndex = asm.lookUpConstant(((ConstantValue) offsetIndex).getConstant().toValueString(), (SPIRVKind) offsetIndex.getPlatformKind());<NEW_LINE>} else {<NEW_LINE>baseIndex = asm.lookUpConstant("0", SPIRVKind.OP_TYPE_INT_64);<NEW_LINE>}<NEW_LINE>SPIRVLiteralExtInstInteger intrinsic = new SPIRVLiteralExtInstInteger(builtIn.getValue(), builtIn.getName());<NEW_LINE>SPIRVMultipleOperands operandsIntrinsic = new SPIRVMultipleOperands(baseIndex, genericResult, new SPIRVLiteralInteger(spirvKind.getVectorLength()));<NEW_LINE>SPIRVId vectorTypeID = asm.primitives.getTypePrimitive(spirvKind);<NEW_LINE>SPIRVId loadId = asm.module.getNextId();<NEW_LINE>asm.currentBlockScope().add(new //<NEW_LINE>//<NEW_LINE>SPIRVOpExtInst(//<NEW_LINE>vectorTypeID, //<NEW_LINE>loadId, //<NEW_LINE>setOpenCLImportId, intrinsic, operandsIntrinsic));<NEW_LINE>asm.emitValue(crb, result);<NEW_LINE>emitStoreIfNeeded(asm, loadId, spirvKind);<NEW_LINE>}
getMemorySpace().getName());
1,038,881
public static void generateJaxWsArtifacts(Project project, FileObject targetFolder, String targetName, URL wsdlURL, String service, String port) throws Exception {<NEW_LINE>initProjectInfo(project);<NEW_LINE>JAXWSSupport jaxWsSupport = JAXWSSupport.<MASK><NEW_LINE>// NOI18N<NEW_LINE>String artifactsPckg = "service." + targetName.toLowerCase();<NEW_LINE>ClassPath classPath = ClassPath.getClassPath(targetFolder, ClassPath.SOURCE);<NEW_LINE>String serviceImplPath = classPath.getResourceName(targetFolder, '.', false);<NEW_LINE>boolean jsr109 = true;<NEW_LINE>JaxWsModel jaxWsModel = project.getLookup().lookup(JaxWsModel.class);<NEW_LINE>if (jaxWsModel != null) {<NEW_LINE>jsr109 = isJsr109(jaxWsModel);<NEW_LINE>}<NEW_LINE>jaxWsSupport.addService(targetName, serviceImplPath + "." + targetName, wsdlURL.toExternalForm(), service, port, artifactsPckg, jsr109, false);<NEW_LINE>}
getJAXWSSupport(project.getProjectDirectory());
1,162,617
public com.amazonaws.services.redshiftdataapi.model.ResourceNotFoundException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.redshiftdataapi.model.ResourceNotFoundException resourceNotFoundException = new com.amazonaws.services.redshiftdataapi.model.ResourceNotFoundException(null);<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE><MASK><NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("ResourceId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>resourceNotFoundException.setResourceId(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 resourceNotFoundException;<NEW_LINE>}
JsonToken token = context.getCurrentToken();
980,569
public DexAnnotationAble visitParameterAnnotation(final int index) {<NEW_LINE>if (parameterAnns == null) {<NEW_LINE>parameterAnns = new List[method.getParameterTypes().length];<NEW_LINE>}<NEW_LINE>// https://github.com/pxb1988/dex2jar/issues/485<NEW_LINE>// skip param annotation if out of range<NEW_LINE>if (index >= parameterAnns.length) {<NEW_LINE>System.err.println("WARN: parameter out-of-range in " + method);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>return new DexAnnotationAble() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public DexAnnotationVisitor visitAnnotation(String name, Visibility visibility) {<NEW_LINE>List<DexAnnotationNode> pas = parameterAnns[index];<NEW_LINE>if (pas == null) {<NEW_LINE>pas = new ArrayList<DexAnnotationNode>(5);<NEW_LINE>parameterAnns[index] = pas;<NEW_LINE>}<NEW_LINE>DexAnnotationNode annotation <MASK><NEW_LINE>pas.add(annotation);<NEW_LINE>return annotation;<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}
= new DexAnnotationNode(name, visibility);
1,284,825
private String logLevelToDescription(Level logLevel) {<NEW_LINE>String result = s_logger.localizeMessage("guiLogLevelOff");<NEW_LINE>if (logLevel.equals(Level.ALL)) {<NEW_LINE>result = s_logger.localizeMessage("guiLogLevelAll");<NEW_LINE>} else if (logLevel.equals(Level.FINEST)) {<NEW_LINE>result = s_logger.localizeMessage("guiLogLevelFinest");<NEW_LINE>} else if (logLevel.equals(Level.FINER)) {<NEW_LINE>result = s_logger.localizeMessage("guiLogLevelFiner");<NEW_LINE>} else if (logLevel.equals(Level.FINE)) {<NEW_LINE>result = s_logger.localizeMessage("guiLogLevelFine");<NEW_LINE>} else if (logLevel.equals(Level.CONFIG)) {<NEW_LINE>result = s_logger.localizeMessage("guiLogLevelConfig");<NEW_LINE>} else if (logLevel.equals(Level.INFO)) {<NEW_LINE>result = s_logger.localizeMessage("guiLogLevelInfo");<NEW_LINE>} else if (logLevel.equals(Level.WARNING)) {<NEW_LINE>result = s_logger.localizeMessage("guiLogLevelWarning");<NEW_LINE>} else if (logLevel.equals(Level.SEVERE)) {<NEW_LINE>result = s_logger.localizeMessage("guiLogLevelSevere");<NEW_LINE>} else if (logLevel.equals(Level.OFF)) {<NEW_LINE>result = s_logger.localizeMessage("guiLogLevelOff");<NEW_LINE>}<NEW_LINE>if (logLevel.equals(s_parameters.getDefaultLogLevel())) {<NEW_LINE>result = new StringBuffer(result).append(<MASK><NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
getDefaultMarker()).toString();
1,663,197
protected void writeValue(Value value) throws IOException, QueryResultHandlerException {<NEW_LINE>jg.writeStartObject();<NEW_LINE>if (value instanceof URI) {<NEW_LINE>jg.writeStringField("type", "uri");<NEW_LINE>jg.writeStringField("value", ((URI) value).toString());<NEW_LINE>} else if (value instanceof BNode) {<NEW_LINE><MASK><NEW_LINE>jg.writeStringField("value", ((BNode) value).getID());<NEW_LINE>} else if (value instanceof Literal) {<NEW_LINE>Literal lit = (Literal) value;<NEW_LINE>// TODO: Implement support for<NEW_LINE>// BasicWriterSettings.RDF_LANGSTRING_TO_LANG_LITERAL here<NEW_LINE>if (lit.getLanguage() != null) {<NEW_LINE>jg.writeObjectField("xml:lang", lit.getLanguage());<NEW_LINE>}<NEW_LINE>// TODO: Implement support for<NEW_LINE>// BasicWriterSettings.XSD_STRING_TO_PLAIN_LITERAL here<NEW_LINE>if (lit.getDatatype() != null) {<NEW_LINE>jg.writeObjectField("datatype", lit.getDatatype().stringValue());<NEW_LINE>}<NEW_LINE>jg.writeObjectField("type", "literal");<NEW_LINE>jg.writeObjectField("value", lit.getLabel());<NEW_LINE>} else {<NEW_LINE>throw new TupleQueryResultHandlerException("Unknown Value object type: " + value.getClass());<NEW_LINE>}<NEW_LINE>jg.writeEndObject();<NEW_LINE>}
jg.writeStringField("type", "bnode");
1,347,394
protected void executeExpression(ProcessInstance processInstance, ProcessDefinition procDefToMigrateTo, String preUpgradeJavaDelegateExpression, CommandContext commandContext) {<NEW_LINE>Expression expression = CommandContextUtil.getProcessEngineConfiguration(commandContext).getExpressionManager().createExpression(preUpgradeJavaDelegateExpression);<NEW_LINE>Object delegate = DelegateExpressionUtil.resolveDelegateExpression(expression, (VariableContainer) <MASK><NEW_LINE>if (delegate instanceof ActivityBehavior) {<NEW_LINE>CommandContextUtil.getProcessEngineConfiguration(commandContext).getDelegateInterceptor().handleInvocation(new ActivityBehaviorInvocation((ActivityBehavior) delegate, (ExecutionEntityImpl) processInstance));<NEW_LINE>} else if (delegate instanceof JavaDelegate) {<NEW_LINE>CommandContextUtil.getProcessEngineConfiguration(commandContext).getDelegateInterceptor().handleInvocation(new JavaDelegateInvocation((JavaDelegate) delegate, (ExecutionEntityImpl) processInstance));<NEW_LINE>} else {<NEW_LINE>throw new FlowableIllegalArgumentException("Delegate expression " + expression + " did neither resolve to an implementation of " + ActivityBehavior.class + " nor " + JavaDelegate.class);<NEW_LINE>}<NEW_LINE>}
processInstance, Collections.emptyList());
1,591,428
private void modifyRootElementAttrs(StringBuffer xmlBuffer) {<NEW_LINE>Map<String, String> nsAttrs = model.getXMLContentAttributes().getNamespaceToPrefixMap();<NEW_LINE>if (nsAttrs == null || nsAttrs.size() == 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int firstOccur = xmlBuffer.indexOf("xmlns");<NEW_LINE>int insertLoc = xmlBuffer.indexOf("xmlns", firstOccur + 1);<NEW_LINE>if (insertLoc == -1) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>StringBuffer sb = new StringBuffer();<NEW_LINE>for (Map.Entry<String, String> entry : nsAttrs.entrySet()) {<NEW_LINE>String ns = entry.getKey();<NEW_LINE>String nsPrefix = entry.getValue();<NEW_LINE>if ((nsPrefix != null) && (nsPrefix.trim().length() > 0)) {<NEW_LINE>String xmlnsString = "xmlns:" <MASK><NEW_LINE>if (xmlBuffer.indexOf(xmlnsString) == -1) {<NEW_LINE>xmlBuffer.insert(insertLoc, xmlnsString + "\n ");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>xmlBuffer.insert(insertLoc, sb.toString());<NEW_LINE>}
+ nsPrefix + "='" + ns + "'";
1,218,662
public static byte[] privKeyTweakAdd(byte[] privkey, byte[] tweak) throws AssertFailException {<NEW_LINE>Preconditions.checkArgument(privkey.length == 32);<NEW_LINE>ByteBuffer byteBuff = nativeECDSABuffer.get();<NEW_LINE>if (byteBuff == null || byteBuff.capacity() < privkey.length + tweak.length) {<NEW_LINE>byteBuff = ByteBuffer.allocateDirect(privkey.length + tweak.length);<NEW_LINE>byteBuff.order(ByteOrder.nativeOrder());<NEW_LINE>nativeECDSABuffer.set(byteBuff);<NEW_LINE>}<NEW_LINE>((Buffer) byteBuff).rewind();<NEW_LINE>byteBuff.put(privkey);<NEW_LINE>byteBuff.put(tweak);<NEW_LINE>byte[][] retByteArray;<NEW_LINE>r.lock();<NEW_LINE>try {<NEW_LINE>retByteArray = secp256k1_privkey_tweak_add(byteBuff, Secp256k1Context.getContext());<NEW_LINE>} finally {<NEW_LINE>r.unlock();<NEW_LINE>}<NEW_LINE>byte[] privArr = retByteArray[0];<NEW_LINE>int privLen = (byte) new BigInteger(new byte[] { retByteArray[1][0] <MASK><NEW_LINE>int retVal = new BigInteger(new byte[] { retByteArray[1][1] }).intValue();<NEW_LINE>assertEquals(privArr.length, privLen, "Got bad pubkey length.");<NEW_LINE>assertEquals(retVal, 1, "Failed return value check.");<NEW_LINE>return privArr;<NEW_LINE>}
}).intValue() & 0xFF;
1,764,338
public void runRat() {<NEW_LINE>ReportConfiguration reportConfiguration = new ReportConfiguration();<NEW_LINE>reportConfiguration.setAddingLicenses(true);<NEW_LINE>List<IHeaderMatcher> matchers = new ArrayList<>();<NEW_LINE>matchers.add(Defaults.createDefaultMatcher());<NEW_LINE>// BSD 4-clause stuff (is disallowed below)<NEW_LINE>// we keep this here, in case someone adds BSD code for some reason, it should never be allowed.<NEW_LINE>matchers.add(subStringMatcher("BSD4 ", "Original BSD License (with advertising clause)", "All advertising materials"));<NEW_LINE>// Apache<NEW_LINE>matchers.add(subStringMatcher("AL ", "Apache", "Licensed to Elasticsearch B.V. under one or more contributor"));<NEW_LINE>// Apache lz4-java<NEW_LINE>matchers.add(subStringMatcher("ALLZ4", "Apache LZ4-Java", "Copyright 2020 Adrien Grand and the lz4-java contributors"));<NEW_LINE>// Generated resources<NEW_LINE>matchers.add(subStringMatcher("GEN ", "Generated", "ANTLR GENERATED CODE"));<NEW_LINE>// Vendored Code<NEW_LINE>matchers.add(subStringMatcher("VEN ", "Vendored", "@notice"));<NEW_LINE>additionalLicenses.get().forEach(l -> matchers.add(subStringMatcher(l.licenseFamilyCategory, l.licenseFamilyName, l.substringPattern)));<NEW_LINE>reportConfiguration.setHeaderMatcher(new HeaderMatcherMultiplexer(matchers.toArray(IHeaderMatcher[]::new)));<NEW_LINE>reportConfiguration.setApprovedLicenseNames(approvedLicenses.stream().map(license -> {<NEW_LINE>SimpleLicenseFamily simpleLicenseFamily = new SimpleLicenseFamily();<NEW_LINE>simpleLicenseFamily.setFamilyName(license);<NEW_LINE>return simpleLicenseFamily;<NEW_LINE>}).toArray<MASK><NEW_LINE>File repFile = getReportFile().getAsFile().get();<NEW_LINE>ClaimStatistic stats = generateReport(reportConfiguration, repFile);<NEW_LINE>boolean unknownLicenses = stats.getNumUnknown() > 0;<NEW_LINE>boolean unApprovedLicenses = stats.getNumUnApproved() > 0;<NEW_LINE>if (unknownLicenses || unApprovedLicenses) {<NEW_LINE>getLogger().error("The following files contain unapproved license headers:");<NEW_LINE>unapprovedFiles(repFile).stream().forEachOrdered(unapprovedFile -> getLogger().error(unapprovedFile));<NEW_LINE>throw new GradleException("Check failed. License header problems were found. Full details: " + repFile.getAbsolutePath());<NEW_LINE>}<NEW_LINE>}
(SimpleLicenseFamily[]::new));
711,834
public Flux<NumericResponse<ReactiveListCommands.LPosCommand, Long>> lPos(Publisher<ReactiveListCommands.LPosCommand> commands) {<NEW_LINE>return execute(commands, command -> {<NEW_LINE>Assert.notNull(command.getKey(), "Key must not be null!");<NEW_LINE>Assert.notNull(command.getElement(), "Element must not be null!");<NEW_LINE>List<Object> params <MASK><NEW_LINE>byte[] keyBuf = toByteArray(command.getKey());<NEW_LINE>params.add(keyBuf);<NEW_LINE>params.add(toByteArray(command.getElement()));<NEW_LINE>if (command.getRank() != null) {<NEW_LINE>params.add("RANK");<NEW_LINE>params.add(command.getRank());<NEW_LINE>}<NEW_LINE>if (command.getCount() != null) {<NEW_LINE>params.add("COUNT");<NEW_LINE>params.add(command.getCount());<NEW_LINE>}<NEW_LINE>Mono<Long> m = read(keyBuf, ByteArrayCodec.INSTANCE, RedisCommands.LPOS, params.toArray());<NEW_LINE>return m.map(v -> new NumericResponse<>(command, v));<NEW_LINE>});<NEW_LINE>}
= new ArrayList<Object>();
727,190
public void addTorrentByMagnetUrl(String url, String title) {<NEW_LINE>// Since v39 Chrome sends application/x-www-form-urlencoded magnet links and most torrent clients do not understand those, so decode first<NEW_LINE>try {<NEW_LINE>url = URLDecoder.decode(url, "UTF-8");<NEW_LINE>} catch (UnsupportedEncodingException e) {<NEW_LINE>// Ignore: UTF-8 is always available on Android devices<NEW_LINE>} catch (IllegalArgumentException e) {<NEW_LINE>// Illegal character or escape sequence; fail task to show error<NEW_LINE>onCommunicationError(new DaemonTaskFailureResult(AddByMagnetUrlTask.create(currentConnection, url), new DaemonException(DaemonException.ExceptionType.MalformedUri, "Invalid characters in magnet uri")), false);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>AddByMagnetUrlTask addByMagnetUrlTask = AddByMagnetUrlTask.create(currentConnection, url);<NEW_LINE>if (!Daemon.supportsAddByMagnetUrl(currentConnection.getType())) {<NEW_LINE>// No support for magnet links: forcefully let the task fail to report the error<NEW_LINE>onCommunicationError(new DaemonTaskFailureResult(addByMagnetUrlTask, new DaemonException(DaemonException.ExceptionType.MethodUnsupported, currentConnection.getType().name() + " does not support magnet links")), false);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>DaemonTaskResult result = addByMagnetUrlTask.execute(log);<NEW_LINE>if (result instanceof DaemonTaskSuccessResult) {<NEW_LINE>onTaskSucceeded((DaemonTaskSuccessResult) result, getString(R<MASK><NEW_LINE>refreshTorrents();<NEW_LINE>} else {<NEW_LINE>onCommunicationError((DaemonTaskFailureResult) result, false);<NEW_LINE>}<NEW_LINE>}
.string.result_added, title));
1,229,578
public void handle(JsonNode packet) {<NEW_LINE>ChannelType type = ChannelType.fromId(packet.get("type").asInt());<NEW_LINE>switch(type) {<NEW_LINE>case SERVER_TEXT_CHANNEL:<NEW_LINE>handleServerTextChannel(packet);<NEW_LINE>break;<NEW_LINE>case PRIVATE_CHANNEL:<NEW_LINE>handlePrivateChannel(packet);<NEW_LINE>break;<NEW_LINE>case SERVER_VOICE_CHANNEL:<NEW_LINE>handleServerVoiceChannel(packet);<NEW_LINE>break;<NEW_LINE>case SERVER_STAGE_VOICE_CHANNEL:<NEW_LINE>handleServerStageVoiceChannel(packet);<NEW_LINE>break;<NEW_LINE>case GROUP_CHANNEL:<NEW_LINE>handleGroupChannel(packet);<NEW_LINE>break;<NEW_LINE>case CHANNEL_CATEGORY:<NEW_LINE>handleCategory(packet);<NEW_LINE>break;<NEW_LINE>case SERVER_NEWS_CHANNEL:<NEW_LINE>// TODO Handle server news channel differently<NEW_LINE>handleServerTextChannel(packet);<NEW_LINE>break;<NEW_LINE>case SERVER_STORE_CHANNEL:<NEW_LINE>// TODO Handle store channels<NEW_LINE><MASK><NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>logger.warn("Unknown or unexpected channel type. Your Javacord version might be out of date!");<NEW_LINE>}<NEW_LINE>api.removeChannelFromCache(packet.get("id").asLong());<NEW_LINE>}
logger.debug("Received CHANNEL_DELETE packet for a store channel. These are not supported in this" + " Javacord version and get ignored!");
785,479
protected String doIt() throws Exception {<NEW_LINE>log.info("ASP_Status=" + getStatus() + ", AD_Menu_ID=" + menuId + ", IsGenerateFields=" + isGenerateFields());<NEW_LINE>MClientInfo clientInfo = MClientInfo.get(getCtx(), getAD_Client_ID());<NEW_LINE>int AD_Tree_ID = clientInfo.getAD_Tree_Menu_ID();<NEW_LINE>// Yamel Senih [ 9223372036854775807 ]<NEW_LINE>// Change Constructor<NEW_LINE>MTree thisTree = new MTree(getCtx(), AD_Tree_ID, true, true, null, get_TrxName());<NEW_LINE>// End Yamel Senih<NEW_LINE>MTreeNode node;<NEW_LINE>if (menuId > 0)<NEW_LINE>node = thisTree.getRoot().findNode(menuId);<NEW_LINE>else<NEW_LINE>node = thisTree.getRoot();<NEW_LINE>// Navigate the menu and add every non-summary node<NEW_LINE>if (node != null && node.isSummary()) {<NEW_LINE>Enumeration<?> en = node.preorderEnumeration();<NEW_LINE>while (en.hasMoreElements()) {<NEW_LINE>MTreeNode nn = (MTreeNode) en.nextElement();<NEW_LINE>if (!nn.isSummary())<NEW_LINE>addNodeToLevel(nn);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (noWindows > 0)<NEW_LINE>addLog("@AD_Window_ID@ (" + noWindows + ")");<NEW_LINE>if (noTabs > 0)<NEW_LINE>addLog("@AD_Tab_ID@ (" + noTabs + ")");<NEW_LINE>if (noFields > 0)<NEW_LINE>addLog("@AD_Field_ID@ (" + noFields + ")");<NEW_LINE>if (noProcesses > 0)<NEW_LINE>addLog("@AD_Process_ID@ (" + noProcesses + ")");<NEW_LINE>if (noParameters > 0)<NEW_LINE>addLog("@AD_Process_Para_ID@ (" + noParameters + ")");<NEW_LINE>if (noForms > 0)<NEW_LINE>addLog("@AD_Form_ID@ (" + noForms + ")");<NEW_LINE>if (noBrowses > 0)<NEW_LINE><MASK><NEW_LINE>if (noTasks > 0)<NEW_LINE>addLog("@AD_Task_ID@ (" + noTasks + ")");<NEW_LINE>if (noWorkflows > 0)<NEW_LINE>addLog("@AD_Workflow_ID@ (" + noWorkflows + ")");<NEW_LINE>return "@OK@";<NEW_LINE>}
addLog("@AD_Browse_ID@ (" + noBrowses + ")");
236,906
public static Message decode(byte[] wire) {<NEW_LINE>if (wire.length < 98)<NEW_LINE>throw new RuntimeException("Bad message");<NEW_LINE>byte[] mdc = new byte[32];<NEW_LINE>System.arraycopy(wire, 0, mdc, 0, 32);<NEW_LINE>byte[] signature = new byte[65];<NEW_LINE>System.arraycopy(wire, 32, signature, 0, 65);<NEW_LINE>byte[] type = new byte[1];<NEW_LINE>type[0] = wire[97];<NEW_LINE>byte[] data = new byte[wire.length - 98];<NEW_LINE>System.arraycopy(wire, 98, data, 0, data.length);<NEW_LINE>byte[] mdcCheck = sha3(wire, 32, wire.length - 32);<NEW_LINE>int check = FastByteComparisons.compareTo(mdc, 0, mdc.length, <MASK><NEW_LINE>if (check != 0)<NEW_LINE>throw new RuntimeException("MDC check failed");<NEW_LINE>Message msg;<NEW_LINE>if (type[0] == 1)<NEW_LINE>msg = new PingMessage();<NEW_LINE>else if (type[0] == 2)<NEW_LINE>msg = new PongMessage();<NEW_LINE>else if (type[0] == 3)<NEW_LINE>msg = new FindNodeMessage();<NEW_LINE>else if (type[0] == 4)<NEW_LINE>msg = new NeighborsMessage();<NEW_LINE>else<NEW_LINE>throw new RuntimeException("Unknown RLPx message: " + type[0]);<NEW_LINE>msg.mdc = mdc;<NEW_LINE>msg.signature = signature;<NEW_LINE>msg.type = type;<NEW_LINE>msg.data = data;<NEW_LINE>msg.wire = wire;<NEW_LINE>msg.parse(data);<NEW_LINE>return msg;<NEW_LINE>}
mdcCheck, 0, mdcCheck.length);
1,586,217
private static int extractErrorPositionForPostgresql(Connection con, Statement stmt, Throwable ex, String sql) {<NEW_LINE>if (ex == null) {<NEW_LINE>return -1;<NEW_LINE>}<NEW_LINE>Class exceptionClass = ex.getClass();<NEW_LINE>if (exceptionClass.getName().equals("org.postgresql.util.PSQLException")) {<NEW_LINE>try {<NEW_LINE>Method getServerErrorMessage = exceptionClass.getMethod("getServerErrorMessage");<NEW_LINE>Object serverErrorMessage = getServerErrorMessage.invoke(ex);<NEW_LINE>Class messageClass = serverErrorMessage.getClass();<NEW_LINE>Method getPosition = messageClass.getMethod("getPosition");<NEW_LINE>Integer result = (Integer) getPosition.invoke(serverErrorMessage);<NEW_LINE>if (result != null && result > 0) {<NEW_LINE>return result - 1;<NEW_LINE>} else {<NEW_LINE>return -1;<NEW_LINE>}<NEW_LINE>} catch (NoSuchMethodException | SecurityException | IllegalAccessException | IllegalArgumentException | InvocationTargetException | NullPointerException innerEx) {<NEW_LINE>LOG.log(<MASK><NEW_LINE>return -1;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>LOG.log(Level.FINE, "Caught PostgreSQL exception, that is not subclass of PSQLException", ex);<NEW_LINE>return -1;<NEW_LINE>}<NEW_LINE>}
Level.FINE, "Failed to parse PostgreSQL error", innerEx);
298,937
private Node compileModel() {<NEW_LINE>Node model = new Node(meshName + "-ogremesh");<NEW_LINE>for (int i = 0; i < geoms.size(); i++) {<NEW_LINE>Geometry g = geoms.get(i);<NEW_LINE>Mesh m = g.getMesh();<NEW_LINE>// New code for buffer extract<NEW_LINE>if (sharedMesh != null && usesSharedMesh.get(i)) {<NEW_LINE>m.extractVertexData(sharedMesh);<NEW_LINE>}<NEW_LINE>model.attachChild(geoms.get(i));<NEW_LINE>}<NEW_LINE>// Do not attach shared geometry to the node!<NEW_LINE>if (animData != null) {<NEW_LINE>// This model uses animation<NEW_LINE>for (int i = 0; i < geoms.size(); i++) {<NEW_LINE>Geometry g = geoms.get(i);<NEW_LINE>Mesh m = geoms.get(i).getMesh();<NEW_LINE>m.generateBindPose();<NEW_LINE>}<NEW_LINE>// Put the animations in the AnimControl<NEW_LINE>HashMap<String, AnimClip> anims = new HashMap<>();<NEW_LINE>ArrayList<AnimClip> animList = animData.anims;<NEW_LINE>for (int i = 0; i < animList.size(); i++) {<NEW_LINE>AnimClip anim = animList.get(i);<NEW_LINE>anims.put(anim.getName(), anim);<NEW_LINE>}<NEW_LINE>AnimComposer composer = new AnimComposer();<NEW_LINE>for (AnimClip clip : anims.values()) {<NEW_LINE>composer.addAnimClip(clip);<NEW_LINE>}<NEW_LINE>model.addControl(composer);<NEW_LINE>// Put the skeleton in the skeleton control<NEW_LINE>SkinningControl skinningControl <MASK><NEW_LINE>// This will acquire the targets from the node<NEW_LINE>model.addControl(skinningControl);<NEW_LINE>}<NEW_LINE>return model;<NEW_LINE>}
= new SkinningControl(animData.armature);
742,368
public Source unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>Source source = new Source();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("Owner", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>source.setOwner(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("SourceIdentifier", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>source.setSourceIdentifier(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("SourceDetails", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>source.setSourceDetails(new ListUnmarshaller<SourceDetail>(SourceDetailJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("CustomPolicyDetails", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>source.setCustomPolicyDetails(CustomPolicyDetailsJsonUnmarshaller.getInstance().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 source;<NEW_LINE>}
String currentParentElement = context.getCurrentParentElement();
892,707
public void targetSelected(String field, Target node) {<NEW_LINE>List<String> <MASK><NEW_LINE>if (node != null) {<NEW_LINE>// The user has selected a new node<NEW_LINE>this.target = node;<NEW_LINE>if (node.getStartNode() != null) {<NEW_LINE>populateRequestField(node.getStartNode());<NEW_LINE>Session session = Model.getSingleton().getSession();<NEW_LINE>List<Context> contexts = session.getContextsForNode(node.getStartNode());<NEW_LINE>for (Context context : contexts) {<NEW_LINE>ctxNames.add(context.getName());<NEW_LINE>}<NEW_LINE>} else if (node.getContext() != null) {<NEW_LINE>ctxNames.add(node.getContext().getName());<NEW_LINE>}<NEW_LINE>this.setTech();<NEW_LINE>}<NEW_LINE>this.setComboFields(FIELD_CONTEXT, ctxNames, "");<NEW_LINE>this.getField(FIELD_CONTEXT).setEnabled(ctxNames.size() > 0);<NEW_LINE>}
ctxNames = new ArrayList<>();