idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
1,822,401 | static boolean updateProp(InplaceEditor ine) {<NEW_LINE>// System.err.println("UPDATEPROP(inplaceEditor)");<NEW_LINE>Component c = ine.getComponent();<NEW_LINE>Cursor oldCursor = c.getCursor();<NEW_LINE>try {<NEW_LINE>c.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));<NEW_LINE>Object o = ine.getValue();<NEW_LINE>Exception e = updatePropertyEditor(ine.getPropertyEditor(), o);<NEW_LINE>// System.err.println("UPDATE PROPERTY EDITOR RETURNED " + e);<NEW_LINE>// NOI18N<NEW_LINE>String newValString = (o == null) ? NbBundle.getMessage(PropUtils.class, "NULL") : o.toString();<NEW_LINE>if (e != null) {<NEW_LINE>PropertyModel pm = ine.getPropertyModel();<NEW_LINE>String propName;<NEW_LINE>if (pm instanceof NodePropertyModel) {<NEW_LINE>Node.Property p = ((NodePropertyModel) pm).getProperty();<NEW_LINE>propName = p.getDisplayName();<NEW_LINE>} else if (pm instanceof DefaultPropertyModel) {<NEW_LINE>propName = ((DefaultPropertyModel) pm).propertyName;<NEW_LINE>} else {<NEW_LINE>// who knows what it is...<NEW_LINE>// NOI18N<NEW_LINE>propName = NbBundle.getMessage(PropUtils.class, "MSG_unknown_property_name");<NEW_LINE>}<NEW_LINE>processThrowable(e, propName, newValString);<NEW_LINE>}<NEW_LINE>boolean result = (e == null) ? PropUtils.updateProp(ine.getPropertyModel(), ine.<MASK><NEW_LINE>// System.err.println("Returning " + result);<NEW_LINE>return result;<NEW_LINE>} finally {<NEW_LINE>c.setCursor(oldCursor);<NEW_LINE>}<NEW_LINE>} | getPropertyEditor(), newValString) : false; |
1,453,382 | private List<Genome> resetSpecies(List<Genome> inputGenomes) {<NEW_LINE>final List<Genome> result = new ArrayList<Genome>();<NEW_LINE>final Object[] speciesArray = this.population.getSpecies().toArray();<NEW_LINE>// Add the genomes<NEW_LINE>for (final Genome genome : inputGenomes) {<NEW_LINE>result.add(genome);<NEW_LINE>}<NEW_LINE>for (final Object element : speciesArray) {<NEW_LINE><MASK><NEW_LINE>s.purge();<NEW_LINE>// did the leader die? If so, disband the species. (but don't kill<NEW_LINE>// the genomes)<NEW_LINE>if (!inputGenomes.contains(s.getLeader())) {<NEW_LINE>removeSpecies(s);<NEW_LINE>} else if (s.getGensNoImprovement() > this.numGensAllowedNoImprovement) {<NEW_LINE>removeSpecies(s);<NEW_LINE>}<NEW_LINE>// remove the leader from the list we return. the leader already has<NEW_LINE>// a species<NEW_LINE>result.remove(s.getLeader());<NEW_LINE>}<NEW_LINE>if (this.population.getSpecies().size() == 0) {<NEW_LINE>throw new AIFHError("Can't speciate, the population is empty.");<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | final BasicSpecies s = (BasicSpecies) element; |
1,850,569 | static EnvSet envSetFromStarlark(StarlarkInfo envSetStruct) throws EvalException {<NEW_LINE>checkRightProviderType(envSetStruct, "env_set");<NEW_LINE>ImmutableSet<String> actions = getStringSetFromStarlarkProviderField(envSetStruct, "actions");<NEW_LINE>if (actions.isEmpty()) {<NEW_LINE>throw infoError(envSetStruct, "actions parameter of env_set must be a nonempty list.");<NEW_LINE>}<NEW_LINE>ImmutableList.Builder<EnvEntry> envEntryBuilder = ImmutableList.builder();<NEW_LINE>ImmutableList<StarlarkInfo> envEntryStructs = getStarlarkProviderListFromStarlarkField(envSetStruct, "env_entries");<NEW_LINE>for (StarlarkInfo envEntryStruct : envEntryStructs) {<NEW_LINE>envEntryBuilder.add(envEntryFromStarlark(envEntryStruct));<NEW_LINE>}<NEW_LINE>ImmutableSet.Builder<WithFeatureSet> withFeatureSetBuilder = ImmutableSet.builder();<NEW_LINE>ImmutableList<StarlarkInfo> <MASK><NEW_LINE>for (StarlarkInfo withFeatureSetStruct : withFeatureSetStructs) {<NEW_LINE>withFeatureSetBuilder.add(withFeatureSetFromStarlark(withFeatureSetStruct));<NEW_LINE>}<NEW_LINE>return new EnvSet(actions, envEntryBuilder.build(), withFeatureSetBuilder.build());<NEW_LINE>} | withFeatureSetStructs = getStarlarkProviderListFromStarlarkField(envSetStruct, "with_features"); |
1,740,656 | public CustomerOptionValue populate(PersistableCustomerOptionValue source, CustomerOptionValue target, MerchantStore store, Language language) throws ConversionException {<NEW_LINE>Validate.notNull(languageService, "Requires to set LanguageService");<NEW_LINE>try {<NEW_LINE>target.<MASK><NEW_LINE>target.setMerchantStore(store);<NEW_LINE>target.setSortOrder(source.getOrder());<NEW_LINE>if (!CollectionUtils.isEmpty(source.getDescriptions())) {<NEW_LINE>Set<com.salesmanager.core.model.customer.attribute.CustomerOptionValueDescription> descriptions = new HashSet<com.salesmanager.core.model.customer.attribute.CustomerOptionValueDescription>();<NEW_LINE>for (CustomerOptionValueDescription desc : source.getDescriptions()) {<NEW_LINE>com.salesmanager.core.model.customer.attribute.CustomerOptionValueDescription description = new com.salesmanager.core.model.customer.attribute.CustomerOptionValueDescription();<NEW_LINE>Language lang = languageService.getByCode(desc.getLanguage());<NEW_LINE>if (lang == null) {<NEW_LINE>throw new ConversionException("Language is null for code " + description.getLanguage() + " use language ISO code [en, fr ...]");<NEW_LINE>}<NEW_LINE>description.setLanguage(lang);<NEW_LINE>description.setName(desc.getName());<NEW_LINE>description.setTitle(desc.getTitle());<NEW_LINE>description.setCustomerOptionValue(target);<NEW_LINE>descriptions.add(description);<NEW_LINE>}<NEW_LINE>target.setDescriptions(descriptions);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new ConversionException(e);<NEW_LINE>}<NEW_LINE>return target;<NEW_LINE>} | setCode(source.getCode()); |
1,347,124 | private void init_standard_header_with_expandcollapse_button_custom_area() {<NEW_LINE>// Create a Card<NEW_LINE>Card card = new Card(getActivity());<NEW_LINE>// Create a CardHeader<NEW_LINE>CardHeader header = new CardHeader(getActivity());<NEW_LINE>// Set the header title<NEW_LINE>header.setTitle(getString(R.string.demo_header_basetitle));<NEW_LINE>// Set visible the expand/collapse button<NEW_LINE>header.setButtonExpandVisible(true);<NEW_LINE>// Add Header to card<NEW_LINE>card.addCardHeader(header);<NEW_LINE>// This provides a simple (and useless) expand area<NEW_LINE>CustomExpandCard expand <MASK><NEW_LINE>// Add Expand Area to Card<NEW_LINE>card.addCardExpand(expand);<NEW_LINE>// Set card in the CardViewNative<NEW_LINE>final CardViewNative cardViewNative = (CardViewNative) getActivity().findViewById(R.id.carddemo_header_expand_custom_area);<NEW_LINE>// It is not required.<NEW_LINE>card.setOnExpandAnimatorEndListener(new Card.OnExpandAnimatorEndListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onExpandEnd(Card card) {<NEW_LINE>// TODO: check if hidden area is visible and it would be better an animator to do this<NEW_LINE>}<NEW_LINE>});<NEW_LINE>cardViewNative.setCard(card);<NEW_LINE>} | = new CustomExpandCard(getActivity()); |
808,825 | final ImportStacksToStackSetResult executeImportStacksToStackSet(ImportStacksToStackSetRequest importStacksToStackSetRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(importStacksToStackSetRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ImportStacksToStackSetRequest> request = null;<NEW_LINE>Response<ImportStacksToStackSetResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ImportStacksToStackSetRequestMarshaller().marshall(super.beforeMarshalling(importStacksToStackSetRequest));<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, "CloudFormation");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ImportStacksToStackSet");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<ImportStacksToStackSetResult> responseHandler = new StaxResponseHandler<ImportStacksToStackSetResult>(new ImportStacksToStackSetResultStaxUnmarshaller());<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,401,948 | static <// / @Generated("This method was generated using jOOQ-tools")<NEW_LINE>T1, T2, T3, T4, T5, T6, T7, T8, T9, R> Seq<R> zip(Seq<? extends T1> s1, Seq<? extends T2> s2, Seq<? extends T3> s3, Seq<? extends T4> s4, Seq<? extends T5> s5, Seq<? extends T6> s6, Seq<? extends T7> s7, Seq<? extends T8> s8, Seq<? extends T9> s9, Function9<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? super T8, ? super T9, ? extends R> zipper) {<NEW_LINE>final Iterator<? extends T1> it1 = s1.iterator();<NEW_LINE>final Iterator<? extends T2> it2 = s2.iterator();<NEW_LINE>final Iterator<? extends T3<MASK><NEW_LINE>final Iterator<? extends T4> it4 = s4.iterator();<NEW_LINE>final Iterator<? extends T5> it5 = s5.iterator();<NEW_LINE>final Iterator<? extends T6> it6 = s6.iterator();<NEW_LINE>final Iterator<? extends T7> it7 = s7.iterator();<NEW_LINE>final Iterator<? extends T8> it8 = s8.iterator();<NEW_LINE>final Iterator<? extends T9> it9 = s9.iterator();<NEW_LINE>class Zip implements Iterator<R> {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean hasNext() {<NEW_LINE>return it1.hasNext() && it2.hasNext() && it3.hasNext() && it4.hasNext() && it5.hasNext() && it6.hasNext() && it7.hasNext() && it8.hasNext() && it9.hasNext();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public R next() {<NEW_LINE>return zipper.apply(it1.next(), it2.next(), it3.next(), it4.next(), it5.next(), it6.next(), it7.next(), it8.next(), it9.next());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return seq(new Zip());<NEW_LINE>} | > it3 = s3.iterator(); |
1,374,146 | public static void main(String[] args) throws IOException, ConnectorException, InterruptedException {<NEW_LINE>String start = args.length > 0 ? args[0] : null;<NEW_LINE>if (start != null) {<NEW_LINE>String[] args2 = Arrays.copyOfRange(args, 1, args.length);<NEW_LINE>if (HELLO_WORLD.equals(start)) {<NEW_LINE>GETClient.main(args2);<NEW_LINE>return;<NEW_LINE>} else if (MULTICAST.equals(start)) {<NEW_LINE>MulticastTestClient.main(args2);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>System.out.println("(c) 2020, Bosch.IO GmbH and others");<NEW_LINE>System.out.println();<NEW_LINE>System.out.println("Usage: " + Client.class.getSimpleName() + " (" + HELLO_WORLD + "|" + MULTICAST + ")");<NEW_LINE>if (start != null) {<NEW_LINE>System.out.println(" '" + start + "' is not supported!");<NEW_LINE>}<NEW_LINE>System.exit(-1);<NEW_LINE>} | System.out.println("\nCalifornium (Cf) Server-Starter"); |
620,276 | public ExternalTaskExecutionInfo produce() {<NEW_LINE>TreePath[] selectionPaths = getSelectionPaths();<NEW_LINE>if (selectionPaths == null || selectionPaths.length == 0) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>Map<String, ExternalTaskExecutionInfo> map = ContainerUtil.newHashMap();<NEW_LINE>for (TreePath selectionPath : selectionPaths) {<NEW_LINE>Object component = selectionPath.getLastPathComponent();<NEW_LINE>if (!(component instanceof ExternalSystemNode)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>Object element = ((ExternalSystemNode) component).getDescriptor().getElement();<NEW_LINE>if (element instanceof ExternalTaskExecutionInfo) {<NEW_LINE>ExternalTaskExecutionInfo taskExecutionInfo = (ExternalTaskExecutionInfo) element;<NEW_LINE>ExternalSystemTaskExecutionSettings executionSettings = taskExecutionInfo.getSettings();<NEW_LINE>String key = executionSettings.getExternalSystemIdString() + executionSettings.getExternalProjectPath() + executionSettings.getVmOptions();<NEW_LINE>ExternalTaskExecutionInfo executionInfo = map.get(key);<NEW_LINE>if (executionInfo == null) {<NEW_LINE>ExternalSystemTaskExecutionSettings taskExecutionSettings = new ExternalSystemTaskExecutionSettings();<NEW_LINE>taskExecutionSettings.setExternalProjectPath(executionSettings.getExternalProjectPath());<NEW_LINE>taskExecutionSettings.setExternalSystemIdString(executionSettings.getExternalSystemIdString());<NEW_LINE>taskExecutionSettings.<MASK><NEW_LINE>executionInfo = new ExternalTaskExecutionInfo(taskExecutionSettings, taskExecutionInfo.getExecutorId());<NEW_LINE>map.put(key, executionInfo);<NEW_LINE>}<NEW_LINE>executionInfo.getSettings().getTaskNames().addAll(executionSettings.getTaskNames());<NEW_LINE>executionInfo.getSettings().getTaskDescriptions().addAll(executionSettings.getTaskDescriptions());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Disable tasks execution if it comes from different projects<NEW_LINE>if (map.values().size() != 1)<NEW_LINE>return null;<NEW_LINE>return map.values().iterator().next();<NEW_LINE>} | setVmOptions(executionSettings.getVmOptions()); |
338,584 | public static boolean updatePassword(String ApplicationRoot, String userName, String currentPassword, String newPassword) {<NEW_LINE>log.debug("*** Setter.updatePassword ***");<NEW_LINE>boolean result = false;<NEW_LINE>Connection conn;<NEW_LINE>try {<NEW_LINE>conn = Database.getCoreConnection(ApplicationRoot);<NEW_LINE>} catch (SQLException e) {<NEW_LINE>log.debug(<MASK><NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>log.debug("Checking current password");<NEW_LINE>String[] user = Getter.authUser(ApplicationRoot, userName, currentPassword);<NEW_LINE>if (user == null || user[0].isEmpty()) {<NEW_LINE>// Wrong password<NEW_LINE>log.debug("Current password incorrect!");<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (user != null && !user[0].isEmpty()) {<NEW_LINE>// Correct password, proceed<NEW_LINE>log.debug("Hashing password");<NEW_LINE>Argon2 argon2 = Argon2Factory.create();<NEW_LINE>String newHash = argon2.hash(10, 65536, 1, newPassword.toCharArray());<NEW_LINE>// TODO: wipe password from memory after hashing<NEW_LINE>log.debug("Preparing userPasswordChange call");<NEW_LINE>CallableStatement callstmnt;<NEW_LINE>try {<NEW_LINE>callstmnt = conn.prepareCall("call userPasswordChange(?, ?)");<NEW_LINE>callstmnt.setString(1, userName);<NEW_LINE>callstmnt.setString(2, newHash);<NEW_LINE>log.debug("Executing userPasswordChange");<NEW_LINE>callstmnt.execute();<NEW_LINE>result = true;<NEW_LINE>} catch (SQLException e) {<NEW_LINE>log.debug("Could not update password: " + e.toString());<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>log.debug("Could not verify password!");<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>Database.closeConnection(conn);<NEW_LINE>log.debug("*** END updatePassword ***");<NEW_LINE>return result;<NEW_LINE>} | "Could not get core connection: " + e.toString()); |
1,490,228 | private Optional<EnumDescriptorProto> generateValueSetEnum(ValueSet valueSet) {<NEW_LINE>String url = valueSet.getUrl().getValue();<NEW_LINE>List<ValueSet.Compose.ConceptSet> includes = valueSet.getCompose().getIncludeList();<NEW_LINE>Map<String, ValueSet.Compose.ConceptSet> excludesBySystem = valueSet.getCompose().getExcludeList().stream().collect(Collectors.toMap(exclude -> exclude.getSystem().getValue(), exclude -> exclude));<NEW_LINE>EnumDescriptorProto.Builder builder = EnumDescriptorProto.newBuilder().setName("Value");<NEW_LINE>builder.getOptionsBuilder().setExtension(Annotations.enumValuesetUrl, url);<NEW_LINE>builder.addValue(EnumValueDescriptorProto.newBuilder().setNumber(0).setName("INVALID_UNINITIALIZED"));<NEW_LINE>int enumNumber = 1;<NEW_LINE>for (ValueSet.Compose.ConceptSet conceptSet : includes) {<NEW_LINE>if (!conceptSet.getValueSetList().isEmpty()) {<NEW_LINE>printNoEnumWarning(url, "Complex ConceptSets are not yet implemented");<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>List<EnumValueDescriptorProto.Builder> enums = getEnumsForValueConceptSet(conceptSet, excludesBySystem.getOrDefault(conceptSet.getSystem().getValue(), ValueSet.Compose<MASK><NEW_LINE>for (EnumValueDescriptorProto.Builder valueBuilder : enums) {<NEW_LINE>if (valueBuilder == null) {<NEW_LINE>printNoEnumWarning(url, "Unable to find all codes for system: " + conceptSet.getSystem().getValue());<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>builder.addValue(valueBuilder.setNumber(enumNumber++));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (builder.getValueCount() == 1) {<NEW_LINE>// Note: 1 because we start by adding the INVALID_UNINITIALIZED code<NEW_LINE>printNoEnumWarning(url, "no codes found");<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>builder = dedupValueSetEnum(builder);<NEW_LINE>return Optional.of(builder.build());<NEW_LINE>} | .ConceptSet.getDefaultInstance())); |
1,218,768 | public void persist(SubJobInfo subJobInfo) throws QueryFailedException, EntranceIllegalParamException {<NEW_LINE>if (null == subJobInfo || null == subJobInfo.getSubJobDetail()) {<NEW_LINE>throw new EntranceIllegalParamException(20004, "JobDetail can not be null, unable to do persist operation");<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>JobRespProtocol jobRespProtocol = sendToJobHistoryAndRetry(jobReqInsert, "subJobInfo of job" + subJobInfo.getJobReq().getId());<NEW_LINE>if (jobRespProtocol != null) {<NEW_LINE>Map<String, Object> data = jobRespProtocol.getData();<NEW_LINE>Object object = data.get(JobRequestConstants.JOB_ID());<NEW_LINE>if (object == null) {<NEW_LINE>throw new QueryFailedException(20011, "Insert jobDetail failed, reason: " + jobRespProtocol.getMsg());<NEW_LINE>}<NEW_LINE>String jobIdStr = object.toString();<NEW_LINE>Long jobId = Long.parseLong(jobIdStr);<NEW_LINE>subJobInfo.getSubJobDetail().setId(jobId);<NEW_LINE>}<NEW_LINE>} | JobDetailReqInsert jobReqInsert = new JobDetailReqInsert(subJobInfo); |
1,443,481 | public void readFields(DataInput in) throws IOException {<NEW_LINE>super.readFields(in);<NEW_LINE>id = in.readLong();<NEW_LINE>fullQualifiedName = Text.readString(in);<NEW_LINE>// read groups<NEW_LINE>int numTables = in.readInt();<NEW_LINE>for (int i = 0; i < numTables; ++i) {<NEW_LINE>Table table = Table.read(in);<NEW_LINE>table.setQualifiedDbName(fullQualifiedName);<NEW_LINE>String tableName = table.getName();<NEW_LINE>nameToTable.put(tableName, table);<NEW_LINE>idToTable.put(table.getId(), table);<NEW_LINE>lowerCaseToTableName.put(<MASK><NEW_LINE>}<NEW_LINE>// read quota<NEW_LINE>dataQuotaBytes = in.readLong();<NEW_LINE>clusterName = Text.readString(in);<NEW_LINE>dbState = DbState.valueOf(Text.readString(in));<NEW_LINE>attachDbName = Text.readString(in);<NEW_LINE>int numEntries = in.readInt();<NEW_LINE>for (int i = 0; i < numEntries; ++i) {<NEW_LINE>String name = Text.readString(in);<NEW_LINE>ImmutableList.Builder<Function> builder = ImmutableList.builder();<NEW_LINE>int numFunctions = in.readInt();<NEW_LINE>for (int j = 0; j < numFunctions; ++j) {<NEW_LINE>builder.add(Function.read(in));<NEW_LINE>}<NEW_LINE>name2Function.put(name, builder.build());<NEW_LINE>}<NEW_LINE>// read encryptKeys<NEW_LINE>if (Env.getCurrentEnvJournalVersion() >= FeMetaVersion.VERSION_102) {<NEW_LINE>dbEncryptKey = DatabaseEncryptKey.read(in);<NEW_LINE>}<NEW_LINE>replicaQuotaSize = in.readLong();<NEW_LINE>if (Env.getCurrentEnvJournalVersion() >= FeMetaVersion.VERSION_105) {<NEW_LINE>dbProperties = DatabaseProperty.read(in);<NEW_LINE>}<NEW_LINE>} | tableName.toLowerCase(), tableName); |
400,096 | public Object instantiate(RootBeanDefinition bd, @Nullable String beanName, BeanFactory owner, @Nullable Object factoryBean, final Method factoryMethod, Object... args) {<NEW_LINE>try {<NEW_LINE>ReflectionUtils.makeAccessible(factoryMethod);<NEW_LINE>Method priorInvokedFactoryMethod = currentlyInvokedFactoryMethod.get();<NEW_LINE>try {<NEW_LINE>currentlyInvokedFactoryMethod.set(factoryMethod);<NEW_LINE>Object result = factoryMethod.invoke(factoryBean, args);<NEW_LINE>if (result == null) {<NEW_LINE>result = new NullBean();<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} finally {<NEW_LINE>if (priorInvokedFactoryMethod != null) {<NEW_LINE>currentlyInvokedFactoryMethod.set(priorInvokedFactoryMethod);<NEW_LINE>} else {<NEW_LINE>currentlyInvokedFactoryMethod.remove();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (IllegalArgumentException ex) {<NEW_LINE>throw new BeanInstantiationException(factoryMethod, "Illegal arguments to factory method '" + factoryMethod.getName() + "'; " + "args: " + StringUtils.arrayToCommaDelimitedString(args), ex);<NEW_LINE>} catch (IllegalAccessException ex) {<NEW_LINE>throw new BeanInstantiationException(factoryMethod, "Cannot access factory method '" + factoryMethod.getName() + "'; is it public?", ex);<NEW_LINE>} catch (InvocationTargetException ex) {<NEW_LINE>String msg = "Factory method '" <MASK><NEW_LINE>if (bd.getFactoryBeanName() != null && owner instanceof ConfigurableBeanFactory && ((ConfigurableBeanFactory) owner).isCurrentlyInCreation(bd.getFactoryBeanName())) {<NEW_LINE>msg = "Circular reference involving containing bean '" + bd.getFactoryBeanName() + "' - consider " + "declaring the factory method as static for independence from its containing instance. " + msg;<NEW_LINE>}<NEW_LINE>throw new BeanInstantiationException(factoryMethod, msg, ex.getTargetException());<NEW_LINE>}<NEW_LINE>} | + factoryMethod.getName() + "' threw exception"; |
324,751 | public void onEightyByteMessage(final EightyByteMessage message) {<NEW_LINE>final ExcerptAppender appender = outputSupplier.get();<NEW_LINE>// DebugTimestamps.operationStart(DebugTimestamps.Operation.GET_WRITING_DOCUMENT);<NEW_LINE>@NotNull<NEW_LINE><MASK><NEW_LINE>// DebugTimestamps.operationEnd(DebugTimestamps.Operation.GET_WRITING_DOCUMENT);<NEW_LINE>try {<NEW_LINE>Wire wire = context.wire();<NEW_LINE>// log write<NEW_LINE>// DebugTimestamps.operationStart(DebugTimestamps.Operation.WRITE_EVENT);<NEW_LINE>try {<NEW_LINE>wire.write(MethodReader.HISTORY).marshallable(MessageHistory.get());<NEW_LINE>final ValueOut valueOut = wire.writeEventName("onEightyByteMessage");<NEW_LINE>valueOut.object(EightyByteMessage.class, message);<NEW_LINE>wire.padToCacheAlign();<NEW_LINE>} finally {<NEW_LINE>// DebugTimestamps.operationEnd(DebugTimestamps.Operation.WRITE_EVENT);<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>// DebugTimestamps.operationStart(DebugTimestamps.Operation.CLOSE_CONTEXT);<NEW_LINE>try {<NEW_LINE>context.close();<NEW_LINE>} finally {<NEW_LINE>// DebugTimestamps.operationEnd(DebugTimestamps.Operation.CLOSE_CONTEXT);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | DocumentContext context = appender.writingDocument(); |
899,309 | public List<Map.Entry<String, String>> scan(ClassFile classFile) {<NEW_LINE>List<Map.Entry<String, String>> entries = new ArrayList<>();<NEW_LINE>String className = classFile.getName();<NEW_LINE>if (resultFilter.test(className) && isPublic(classFile)) {<NEW_LINE>entries.add<MASK><NEW_LINE>if (includeFields) {<NEW_LINE>classFile.getFields().forEach(field -> entries.add(entry(className, field.getName())));<NEW_LINE>}<NEW_LINE>if (includeMethods) {<NEW_LINE>classFile.getMethods().stream().filter(this::isPublic).forEach(method -> entries.add(entry(className, method.getName() + "(" + String.join(", ", JavassistHelper.getParameters(method)) + ")")));<NEW_LINE>}<NEW_LINE>if (includeAnnotations) {<NEW_LINE>JavassistHelper.getAnnotations(classFile::getAttribute).stream().filter(resultFilter).forEach(annotation -> entries.add(entry(className, "@" + annotation)));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return entries;<NEW_LINE>} | (entry(className, "")); |
326,268 | private List<NameValueCountPair> groupByCreatorUnit(Business business, Predicate predicate) throws Exception {<NEW_LINE>EntityManager em = business.entityManagerContainer(<MASK><NEW_LINE>CriteriaBuilder cb = em.getCriteriaBuilder();<NEW_LINE>CriteriaQuery<Tuple> cq = cb.createQuery(Tuple.class);<NEW_LINE>Root<Task> root = cq.from(Task.class);<NEW_LINE>Path<String> pathCreatorUnit = root.get(Task_.creatorUnit);<NEW_LINE>cq.multiselect(pathCreatorUnit, cb.count(root)).where(predicate).groupBy(pathCreatorUnit);<NEW_LINE>List<Tuple> os = em.createQuery(cq).getResultList();<NEW_LINE>List<NameValueCountPair> list = new ArrayList<>();<NEW_LINE>NameValueCountPair pair = null;<NEW_LINE>for (Tuple o : os) {<NEW_LINE>pair = new NameValueCountPair();<NEW_LINE>pair.setName(o.get(pathCreatorUnit));<NEW_LINE>pair.setValue(o.get(pathCreatorUnit));<NEW_LINE>pair.setCount(o.get(1, Long.class));<NEW_LINE>list.add(pair);<NEW_LINE>}<NEW_LINE>return list.stream().sorted(Comparator.comparing(NameValueCountPair::getCount).reversed()).collect(Collectors.toList());<NEW_LINE>} | ).get(Task.class); |
573,188 | private void postCreateRecurringSnapshotForPolicy(long userId, long volumeId, long snapshotId, long policyId) {<NEW_LINE>// Use count query<NEW_LINE>SnapshotVO spstVO = _snapshotDao.findById(snapshotId);<NEW_LINE>Type type = spstVO.getRecurringType();<NEW_LINE>int maxSnaps = type.getMax();<NEW_LINE>List<SnapshotVO> <MASK><NEW_LINE>SnapshotPolicyVO policy = _snapshotPolicyDao.findById(policyId);<NEW_LINE>if (policy != null && policy.getMaxSnaps() < maxSnaps) {<NEW_LINE>maxSnaps = policy.getMaxSnaps();<NEW_LINE>}<NEW_LINE>while (snaps.size() > maxSnaps && snaps.size() > 1) {<NEW_LINE>SnapshotVO oldestSnapshot = snaps.get(0);<NEW_LINE>long oldSnapId = oldestSnapshot.getId();<NEW_LINE>if (policy != null) {<NEW_LINE>s_logger.debug("Max snaps: " + policy.getMaxSnaps() + " exceeded for snapshot policy with Id: " + policyId + ". Deleting oldest snapshot: " + oldSnapId);<NEW_LINE>}<NEW_LINE>if (deleteSnapshot(oldSnapId)) {<NEW_LINE>// log Snapshot delete event<NEW_LINE>ActionEventUtils.onCompletedActionEvent(User.UID_SYSTEM, oldestSnapshot.getAccountId(), EventVO.LEVEL_INFO, EventTypes.EVENT_SNAPSHOT_DELETE, "Successfully deleted oldest snapshot: " + oldSnapId, 0);<NEW_LINE>}<NEW_LINE>snaps.remove(oldestSnapshot);<NEW_LINE>}<NEW_LINE>} | snaps = listSnapsforVolumeTypeNotDestroyed(volumeId, type); |
1,565,715 | /* (non-Javadoc)<NEW_LINE>* @see tlc2.tool.fp.DiskFPSet.Flusher#mergeNewEntries(java.io.RandomAccessFile, java.io.RandomAccessFile)<NEW_LINE>*/<NEW_LINE>@Override<NEW_LINE>protected void mergeNewEntries(BufferedRandomAccessFile[] inRAFs, RandomAccessFile outRAF) throws IOException {<NEW_LINE>final int buffLen = buff.length;<NEW_LINE>// Precompute the maximum value of the new file<NEW_LINE>long maxVal = buff[buffLen - 1];<NEW_LINE>if (index != null) {<NEW_LINE>maxVal = Math.max(maxVal, index[index.length - 1]);<NEW_LINE>}<NEW_LINE>int indexLen = calculateIndexLen(buffLen);<NEW_LINE>index = new long[indexLen];<NEW_LINE>index[indexLen - 1] = maxVal;<NEW_LINE>currIndex = 0;<NEW_LINE>counter = 0;<NEW_LINE>// initialize positions in "buff" and "inRAF"<NEW_LINE>int i = 0;<NEW_LINE>// initialize only to make compiler happy<NEW_LINE>long value = 0L;<NEW_LINE>boolean eof = false;<NEW_LINE>if (fileCnt > 0) {<NEW_LINE>try {<NEW_LINE>value = inRAFs[0].readLong();<NEW_LINE>} catch (EOFException e) {<NEW_LINE>eof = true;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>eof = true;<NEW_LINE>}<NEW_LINE>// merge while both lists still have elements remaining<NEW_LINE>while (!eof && i < buffLen) {<NEW_LINE>if (value < buff[i]) {<NEW_LINE>writeFP(outRAF, value);<NEW_LINE>try {<NEW_LINE>value = inRAFs[0].readLong();<NEW_LINE>} catch (EOFException e) {<NEW_LINE>eof = true;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// prevent converting every long to String when assertion holds (this is expensive)<NEW_LINE>if (value == buff[i]) {<NEW_LINE>Assert.check(false, EC.TLC_FP_VALUE_ALREADY_ON_DISK, String.valueOf(value));<NEW_LINE>}<NEW_LINE>writeFP(outRAF, buff[i++]);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// write elements of remaining list<NEW_LINE>if (eof) {<NEW_LINE>while (i < buffLen) {<NEW_LINE>writeFP(outRAF, buff[i++]);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>do {<NEW_LINE>writeFP(outRAF, value);<NEW_LINE>try {<NEW_LINE>value = <MASK><NEW_LINE>} catch (EOFException e) {<NEW_LINE>eof = true;<NEW_LINE>}<NEW_LINE>} while (!eof);<NEW_LINE>}<NEW_LINE>Assert.check(currIndex == indexLen - 1, EC.SYSTEM_INDEX_ERROR);<NEW_LINE>// maintain object invariants<NEW_LINE>fileCnt += buffLen;<NEW_LINE>} | inRAFs[0].readLong(); |
1,143,510 | private ProcessPreconditionsResolution rejectIfSecurPharmAttributesAreNotOK(final HUEditorRow document) {<NEW_LINE>//<NEW_LINE>// OK if this is not a Pharma product<NEW_LINE>final HUEditorRowAttributes attributes = document.getAttributes();<NEW_LINE>if (!attributes.hasAttribute(AttributeConstants.ATTR_SecurPharmScannedStatus)) {<NEW_LINE>return ProcessPreconditionsResolution.accept();<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// NOK if SecurPharm connection is not configured and we deal with a pharma product<NEW_LINE>if (!securPharmService.hasConfig()) {<NEW_LINE>return ProcessPreconditionsResolution.reject("SecurPharm not configured");<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// NOK if not scanned and vendor != manufacturer<NEW_LINE>final BPartnerId vendorId = document.getBpartnerId();<NEW_LINE>final BPartnerId manufacturerId = productRepository.getById(document.getProductId()).getManufacturerId();<NEW_LINE>if (!BPartnerId.equals(vendorId, manufacturerId)) {<NEW_LINE>final SecurPharmAttributesStatus status = SecurPharmAttributesStatus.ofNullableCodeOrKnown(attributes.getValueAsString(AttributeConstants.ATTR_SecurPharmScannedStatus));<NEW_LINE>if (status.isUnknown()) {<NEW_LINE>return ProcessPreconditionsResolution.reject(Services.get(IMsgBL.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// OK<NEW_LINE>return ProcessPreconditionsResolution.accept();<NEW_LINE>} | class).getTranslatableMsgText(MSG_ScanRequired)); |
962,281 | final CreateThemeResult executeCreateTheme(CreateThemeRequest createThemeRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createThemeRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateThemeRequest> request = null;<NEW_LINE>Response<CreateThemeResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateThemeRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createThemeRequest));<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, "AmplifyUIBuilder");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateTheme");<NEW_LINE>request.<MASK><NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateThemeResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateThemeResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig); |
995,221 | private static void showArtifactViewer(NBVersionInfo info, Artifact artifact, List<ArtifactRepository> repos, String panelHint) {<NEW_LINE>ArtifactViewerFactory fact = Lookup.getDefault(<MASK><NEW_LINE>if (fact == null) {<NEW_LINE>Logger.getLogger(ArtifactViewer.class.getName()).info("No implementation of ArtifactViewerFactory available.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Lookup l;<NEW_LINE>if (info != null) {<NEW_LINE>l = fact.createLookup(info);<NEW_LINE>} else {<NEW_LINE>l = fact.createLookup(artifact, repos);<NEW_LINE>}<NEW_LINE>TopComponent tc = fact.createTopComponent(l);<NEW_LINE>tc.open();<NEW_LINE>tc.requestActive();<NEW_LINE>if (panelHint != null) {<NEW_LINE>MultiViewHandler hand = MultiViews.findMultiViewHandler(tc);<NEW_LINE>if (hand == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>for (MultiViewPerspective pers : hand.getPerspectives()) {<NEW_LINE>if (panelHint.equals(pers.preferredID())) {<NEW_LINE>hand.requestVisible(pers);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ).lookup(ArtifactViewerFactory.class); |
487,347 | public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable final Bundle savedInstanceState) {<NEW_LINE>if (isNewInstance()) {<NEW_LINE>mFragmentView = inflater.inflate(R.<MASK><NEW_LINE>mEmptyView = mFragmentView.findViewById(R.id.empty);<NEW_LINE>mRecyclerView = (RecyclerView) mFragmentView.findViewById(R.id.recycler_view);<NEW_LINE>mRecyclerView.setLayoutManager(new SnappyLinearLayoutManager(getActivity(), true));<NEW_LINE>mItemDecoration = new CommentItemDecoration(getActivity());<NEW_LINE>mRecyclerView.addItemDecoration(mItemDecoration);<NEW_LINE>mSwipeRefreshLayout = (SwipeRefreshLayout) mFragmentView.findViewById(R.id.swipe_layout);<NEW_LINE>mSwipeRefreshLayout.setColorSchemeResources(R.color.white);<NEW_LINE>mSwipeRefreshLayout.setProgressBackgroundColorSchemeResource(R.color.redA200);<NEW_LINE>mSwipeRefreshLayout.setOnRefreshListener(() -> {<NEW_LINE>if (TextUtils.isEmpty(mItemId)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>mCacheMode = ItemManager.MODE_NETWORK;<NEW_LINE>if (mAdapter != null) {<NEW_LINE>mAdapter.setCacheMode(mCacheMode);<NEW_LINE>}<NEW_LINE>loadKidData();<NEW_LINE>});<NEW_LINE>}<NEW_LINE>return mFragmentView;<NEW_LINE>} | layout.fragment_item, container, false); |
737,155 | private void buildTablePartitionInfoAndTopology() {<NEW_LINE>CreateTablePreparedData indexTablePreparedData = gsiPreparedData.getIndexTablePreparedData();<NEW_LINE>SqlDdl sqlDdl = (SqlDdl) relDdl.sqlNode;<NEW_LINE>if (sqlDdl.getKind() == SqlKind.CREATE_TABLE || sqlDdl.getKind() == SqlKind.ALTER_TABLE) {<NEW_LINE>refreshShardingInfo(gsiPreparedData.getIndexDefinition(), indexTablePreparedData);<NEW_LINE>} else if (sqlDdl.getKind() == SqlKind.CREATE_INDEX) {<NEW_LINE>refreshShardingInfo(gsiPreparedData.getSqlCreateIndex(), indexTablePreparedData);<NEW_LINE>} else {<NEW_LINE>throw new TddlRuntimeException(ErrorCode.ERR_DDL_JOB_UNSUPPORTED, "DDL Kind '" + sqlDdl.getKind() + "' for GSI creation");<NEW_LINE>}<NEW_LINE>indexTableBuilder = new CreatePartitionTableBuilder(relDdl, indexTablePreparedData, executionContext, PartitionTableType.GSI_TABLE);<NEW_LINE>PartitionInfo indexPartInfo = indexTableBuilder.getPartitionInfo();<NEW_LINE>PartitionInfo primaryPartitionInfo = gsiPreparedData.getPrimaryPartitionInfo();<NEW_LINE>if (indexPartInfo.equals(primaryPartitionInfo) && primaryPartitionInfo.getTableGroupId() == TableGroupRecord.INVALID_TABLE_GROUP_ID && indexPartInfo.getTableGroupId() == TableGroupRecord.INVALID_TABLE_GROUP_ID) {<NEW_LINE>physicalLocationAlignWithPrimaryTable(primaryPartitionInfo, indexPartInfo);<NEW_LINE>gsiPreparedData.setIndexAlignWithPrimaryTableGroup(true);<NEW_LINE>}<NEW_LINE>indexTableBuilder.buildTableRuleAndTopology();<NEW_LINE>this.gsiPreparedData.setIndexPartitionInfo(indexTableBuilder.getPartitionInfo());<NEW_LINE>this<MASK><NEW_LINE>this.tableTopology = indexTableBuilder.getTableTopology();<NEW_LINE>} | .partitionInfo = indexTableBuilder.getPartitionInfo(); |
893,540 | public void onClick(View v) {<NEW_LINE>final Context context = v.getContext();<NEW_LINE>if (v == developer) {<NEW_LINE>// open dev settings<NEW_LINE>Intent devIntent = new Intent(Settings.ACTION_APPLICATION_DEVELOPMENT_SETTINGS);<NEW_LINE>devIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);<NEW_LINE>ResolveInfo resolveInfo = context.getPackageManager().resolveActivity(devIntent, 0);<NEW_LINE>if (resolveInfo != null) {<NEW_LINE>context.startActivity(devIntent);<NEW_LINE>} else {<NEW_LINE>Toast.makeText(context, "Developer settings not available on device", Toast.LENGTH_SHORT).show();<NEW_LINE>}<NEW_LINE>} else if (v == battery) {<NEW_LINE>// try to find an app to handle battery settings<NEW_LINE>Intent batteryIntent = new Intent(Intent.ACTION_POWER_USAGE_SUMMARY);<NEW_LINE>batteryIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);<NEW_LINE>ResolveInfo resolveInfo = context.getPackageManager().resolveActivity(batteryIntent, 0);<NEW_LINE>if (resolveInfo != null) {<NEW_LINE>context.startActivity(batteryIntent);<NEW_LINE>} else {<NEW_LINE>Toast.makeText(context, "No app found to handle power usage intent", Toast.LENGTH_SHORT).show();<NEW_LINE>}<NEW_LINE>} else if (v == settings) {<NEW_LINE>// open android settings<NEW_LINE>Intent settingsIntent = new Intent(Settings.ACTION_SETTINGS);<NEW_LINE>settingsIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);<NEW_LINE>context.startActivity(settingsIntent);<NEW_LINE>} else if (v == info) {<NEW_LINE>Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);<NEW_LINE>intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);<NEW_LINE>intent.setData(Uri.parse("package:" + context.getPackageName()));<NEW_LINE>context.startActivity(intent);<NEW_LINE>} else if (v == uninstall) {<NEW_LINE>// open dialog to uninstall app<NEW_LINE>Uri packageURI = Uri.parse("package:" + context.getPackageName());<NEW_LINE>Intent uninstallIntent = new Intent(Intent.ACTION_DELETE, packageURI);<NEW_LINE>context.startActivity(uninstallIntent);<NEW_LINE>} else if (v == location) {<NEW_LINE>Intent locationIntent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS);<NEW_LINE><MASK><NEW_LINE>context.startActivity(locationIntent);<NEW_LINE>}<NEW_LINE>} | locationIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); |
1,108 | public static void main(String[] argv) {<NEW_LINE>StringBuffer latex = new StringBuffer();<NEW_LINE>latex.append("Sei $A$ ein Vektorraum und $f:A \\rightarrow \\mathcal{R}$ sei linear.\n");<NEW_LINE>latex.append("Wir wissen dass $u=\\pi$, und damit haben wir:");<NEW_LINE>latex.append("\\begin{align}");<NEW_LINE>latex.append("f(\\lambda u) = \\lambda f(u) = 0.");<NEW_LINE>latex.append("\\end{align}");<NEW_LINE>// TeXText tf = new TeXText(latex.toString());<NEW_LINE>TeXText tf = new TeXText("my formula: $x_2=3$hello world hello world hello world hello world hello world hello world hello world hello world hello world ");<NEW_LINE>JFrame jf = new JFrame();<NEW_LINE>jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);<NEW_LINE>JLabel jl = new JLabel();<NEW_LINE>// jl.setIcon(tf.createTeXIcon(12, TeXConstants.ALIGN_CENTER));<NEW_LINE>jl.setIcon(tf.createTeXIcon(TeXConstants.STYLE_DISPLAY, 16, TeXConstants.ALIGN_LEFT, 400));<NEW_LINE><MASK><NEW_LINE>cp.setLayout(new BorderLayout());<NEW_LINE>cp.add(jl, BorderLayout.CENTER);<NEW_LINE>jf.pack();<NEW_LINE>jf.setVisible(true);<NEW_LINE>// jf.setBounds(0, 0, 400, 300);<NEW_LINE>} | Container cp = jf.getContentPane(); |
268,935 | private void visitAliasDeclaration(AstNode aliasDeclNode) {<NEW_LINE>var parent = aliasDeclNode.getFirstAncestor(CxxGrammarImpl.functionDefinition, CxxGrammarImpl.classSpecifier);<NEW_LINE>// An alias declaration inside a function is not part of the public API<NEW_LINE>if (parent != null && parent.getType().equals(CxxGrammarImpl.functionDefinition)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (isPublicApiMember(aliasDeclNode)) {<NEW_LINE>AstNode aliasDeclIdNode = aliasDeclNode.getFirstDescendant(GenericTokenType.IDENTIFIER);<NEW_LINE>if (aliasDeclIdNode == null) {<NEW_LINE>LOG.error(<MASK><NEW_LINE>} else {<NEW_LINE>// Check if this is a template specification to adjust<NEW_LINE>// documentation node<NEW_LINE>var container = aliasDeclNode.getFirstAncestor(CxxGrammarImpl.templateDeclaration, CxxGrammarImpl.classSpecifier);<NEW_LINE>AstNode docNode;<NEW_LINE>if (container == null || container.getType().equals(CxxGrammarImpl.classSpecifier)) {<NEW_LINE>docNode = aliasDeclNode;<NEW_LINE>} else {<NEW_LINE>docNode = container;<NEW_LINE>}<NEW_LINE>// look for block documentation<NEW_LINE>List<Token> comments = getBlockDocumentation(docNode);<NEW_LINE>// documentation may be inlined<NEW_LINE>if (comments.isEmpty()) {<NEW_LINE>comments = getDeclaratorInlineComment(aliasDeclNode);<NEW_LINE>}<NEW_LINE>visitPublicApi(aliasDeclNode, aliasDeclIdNode.getTokenValue(), comments);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | "no identifier found at {}", aliasDeclNode.getTokenLine()); |
1,807,339 | protected void initView() {<NEW_LINE>// gles view<NEW_LINE>StackLayout.LayoutConfig config = new StackLayout.LayoutConfig(StackLayout.LayoutConfig.MATCH_PARENT, StackLayout.LayoutConfig.MATCH_PARENT);<NEW_LINE>mSurfaceProvider <MASK><NEW_LINE>mSurfaceProvider.getSurfaceOps().get().addCallback(this);<NEW_LINE>mSurfaceProvider.pinToZTop(false);<NEW_LINE>mRootLayout = new StackLayout(getContext());<NEW_LINE>mRootLayout.setLayoutConfig(config);<NEW_LINE>StackLayout.LayoutConfig layoutConfigSurfaceProvider = new StackLayout.LayoutConfig(StackLayout.LayoutConfig.MATCH_PARENT, StackLayout.LayoutConfig.MATCH_PARENT);<NEW_LINE>mRootLayout.addComponent(mSurfaceProvider, layoutConfigSurfaceProvider);<NEW_LINE>mSurfaceProvider.setKeyEventListener(this);<NEW_LINE>mSurfaceProvider.setFocusable(Component.FOCUS_ENABLE);<NEW_LINE>mSurfaceProvider.setTouchFocusable(true);<NEW_LINE>mSurfaceProvider.setFocusChangedListener(this);<NEW_LINE>mSurfaceProvider.setTouchEventListener(this);<NEW_LINE>mSurfaceProvider.setLayoutRefreshedListener(component -> {<NEW_LINE>// dispatch resize event<NEW_LINE>CocosHelper.runOnGameThreadAtForeground(() -> {<NEW_LINE>onOrientationChangedNative(getDisplayOrientation(), component.getWidth(), component.getHeight());<NEW_LINE>});<NEW_LINE>});<NEW_LINE>mSurfaceProvider.requestFocus();<NEW_LINE>if (mWebViewHelper == null) {<NEW_LINE>mWebViewHelper = new CocosWebViewHelper(mRootLayout);<NEW_LINE>}<NEW_LINE>if (mVideoHelper == null) {<NEW_LINE>mVideoHelper = new CocosVideoHelper(this, mRootLayout);<NEW_LINE>}<NEW_LINE>setUIContent(mRootLayout);<NEW_LINE>} | = new SurfaceProvider(getContext()); |
116,458 | public int compare(PluginInterface if0, PluginInterface if1) {<NEW_LINE>int result = 0;<NEW_LINE>switch(field) {<NEW_LINE>case FIELD_LOAD:<NEW_LINE>{<NEW_LINE>boolean b0 = if0.getPluginState().isLoadedAtStartup();<NEW_LINE>boolean b1 = if1.getPluginState().isLoadedAtStartup();<NEW_LINE>result = (b0 == b1 ? 0 : (b0 ? -1 : 1));<NEW_LINE>// Use the plugin ID name to sort by instead.<NEW_LINE>if (result == 0) {<NEW_LINE>result = if0.getPluginID().compareToIgnoreCase(if1.getPluginID());<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case FIELD_TYPE:<NEW_LINE>case FIELD_DIRECTORY:<NEW_LINE>{<NEW_LINE>result = getFieldValue(field, if0).compareToIgnoreCase(getFieldValue(field, if1));<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case FIELD_VERSION:<NEW_LINE>{<NEW_LINE>// XXX Not really right..<NEW_LINE>String s0 = if0.getPluginVersion();<NEW_LINE>String s1 = if1.getPluginVersion();<NEW_LINE>if (s0 == null)<NEW_LINE>s0 = "";<NEW_LINE>if (s1 == null)<NEW_LINE>s1 = "";<NEW_LINE>result = s0.compareToIgnoreCase(s1);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case FIELD_UNLOADABLE:<NEW_LINE>{<NEW_LINE>boolean b0 = if0<MASK><NEW_LINE>boolean b1 = if1.getPluginState().isUnloadable();<NEW_LINE>result = (b0 == b1 ? 0 : (b0 ? -1 : 1));<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (result == 0)<NEW_LINE>result = if0.getPluginName().compareToIgnoreCase(if1.getPluginName());<NEW_LINE>if (!ascending)<NEW_LINE>result *= -1;<NEW_LINE>return result;<NEW_LINE>} | .getPluginState().isUnloadable(); |
121,470 | public <T extends JpaObject> List<T> listEqualAndEqualAndSequenceAfter(Class<T> clz, String oneEqualAttribute, Object oneEqualValue, String twoEqualAttribute, Object twoEqualValue, Integer count, String sequence) throws Exception {<NEW_LINE>EntityManager em = this.get(clz);<NEW_LINE><MASK><NEW_LINE>CriteriaQuery<T> cq = cb.createQuery(clz);<NEW_LINE>Root<T> root = cq.from(clz);<NEW_LINE>Predicate p = cb.equal(root.get(oneEqualAttribute), oneEqualValue);<NEW_LINE>p = cb.and(p, cb.equal(root.get(twoEqualAttribute), twoEqualValue));<NEW_LINE>if (StringUtils.isNotEmpty(sequence)) {<NEW_LINE>p = cb.and(p, cb.greaterThan(root.get(JpaObject.sequence_FIELDNAME), sequence));<NEW_LINE>}<NEW_LINE>cq.select(root).where(p).orderBy(cb.asc(root.get(JpaObject.sequence_FIELDNAME)));<NEW_LINE>List<T> os = em.createQuery(cq).setMaxResults((count != null && count > 0) ? count : 100).getResultList();<NEW_LINE>List<T> list = new ArrayList<>(os);<NEW_LINE>return list;<NEW_LINE>} | CriteriaBuilder cb = em.getCriteriaBuilder(); |
837,776 | private void evaluateLayout() {<NEW_LINE>float dir = Math.signum(mTransitionGoalPosition - mTransitionLastPosition);<NEW_LINE>long currentTime = getNanoTime();<NEW_LINE>float deltaPos = 0f;<NEW_LINE>if (!(mInterpolator instanceof StopLogic)) {<NEW_LINE>// if we are not in a drag<NEW_LINE>deltaPos = dir * (currentTime - mTransitionLastTime) * 1E-9f / mTransitionDuration;<NEW_LINE>}<NEW_LINE>float position = mTransitionLastPosition + deltaPos;<NEW_LINE>boolean done = false;<NEW_LINE>if (mTransitionInstantly) {<NEW_LINE>position = mTransitionGoalPosition;<NEW_LINE>}<NEW_LINE>if ((dir > 0 && position >= mTransitionGoalPosition) || (dir <= 0 && position <= mTransitionGoalPosition)) {<NEW_LINE>position = mTransitionGoalPosition;<NEW_LINE>done = true;<NEW_LINE>}<NEW_LINE>if (mInterpolator != null && !done) {<NEW_LINE>if (mTemporalInterpolator) {<NEW_LINE>float time = (currentTime - mAnimationStartTime) * 1E-9f;<NEW_LINE>position = mInterpolator.getInterpolation(time);<NEW_LINE>} else {<NEW_LINE>position = mInterpolator.getInterpolation(position);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if ((dir > 0 && position >= mTransitionGoalPosition) || (dir <= 0 && position <= mTransitionGoalPosition)) {<NEW_LINE>position = mTransitionGoalPosition;<NEW_LINE>}<NEW_LINE>mPostInterpolationPosition = position;<NEW_LINE>int n = getChildCount();<NEW_LINE>long time = getNanoTime();<NEW_LINE>float interPos = mProgressInterpolator == null ? position : mProgressInterpolator.getInterpolation(position);<NEW_LINE>for (int i = 0; i < n; i++) {<NEW_LINE><MASK><NEW_LINE>final MotionController frame = mFrameArrayList.get(child);<NEW_LINE>if (frame != null) {<NEW_LINE>frame.interpolate(child, interPos, time, mKeyCache);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (mMeasureDuringTransition) {<NEW_LINE>requestLayout();<NEW_LINE>}<NEW_LINE>} | final View child = getChildAt(i); |
1,582,969 | public static ListResourcesResponse unmarshall(ListResourcesResponse listResourcesResponse, UnmarshallerContext _ctx) {<NEW_LINE>listResourcesResponse.setRequestId(_ctx.stringValue("ListResourcesResponse.RequestId"));<NEW_LINE>listResourcesResponse.setTotalCount(_ctx.integerValue("ListResourcesResponse.TotalCount"));<NEW_LINE>listResourcesResponse.setPageSize(_ctx.integerValue("ListResourcesResponse.PageSize"));<NEW_LINE>listResourcesResponse.setPageNumber(_ctx.integerValue("ListResourcesResponse.PageNumber"));<NEW_LINE>List<Resource> resources = new ArrayList<Resource>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListResourcesResponse.Resources.Length"); i++) {<NEW_LINE>Resource resource = new Resource();<NEW_LINE>resource.setService(_ctx.stringValue("ListResourcesResponse.Resources[" + i + "].Service"));<NEW_LINE>resource.setResourceType(_ctx.stringValue("ListResourcesResponse.Resources[" + i + "].ResourceType"));<NEW_LINE>resource.setResourceGroupId(_ctx.stringValue("ListResourcesResponse.Resources[" + i + "].ResourceGroupId"));<NEW_LINE>resource.setResourceId(_ctx.stringValue("ListResourcesResponse.Resources[" + i + "].ResourceId"));<NEW_LINE>resource.setCreateDate(_ctx.stringValue<MASK><NEW_LINE>resource.setRegionId(_ctx.stringValue("ListResourcesResponse.Resources[" + i + "].RegionId"));<NEW_LINE>resources.add(resource);<NEW_LINE>}<NEW_LINE>listResourcesResponse.setResources(resources);<NEW_LINE>return listResourcesResponse;<NEW_LINE>} | ("ListResourcesResponse.Resources[" + i + "].CreateDate")); |
946,790 | protected void handleUrlLoad(Uri uri) {<NEW_LINE>if (!uri.getScheme().equals("comment")) {<NEW_LINE>super.handleUrlLoad(uri);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int line = Integer.parseInt(uri.getQueryParameter("position"));<NEW_LINE>int leftLine = Integer.parseInt(uri.getQueryParameter("l"));<NEW_LINE>int rightLine = Integer.parseInt<MASK><NEW_LINE>boolean isRightLine = Boolean.parseBoolean(uri.getQueryParameter("isRightLine"));<NEW_LINE>String lineText = mDiffLines[line];<NEW_LINE>String idParam = uri.getQueryParameter("id");<NEW_LINE>long id = idParam != null ? Long.parseLong(idParam) : 0L;<NEW_LINE>CommentActionPopup p = new CommentActionPopup(id, line, lineText, leftLine, rightLine, mLastTouchDown.x, mLastTouchDown.y, isRightLine);<NEW_LINE>p.show();<NEW_LINE>} | (uri.getQueryParameter("r")); |
742,852 | private void processRelocationTables(ElfHeader elf, Listing listing) throws CancelledException {<NEW_LINE>monitor.setMessage("Processing relocation tables...");<NEW_LINE>ElfRelocationTable[] relocationTables = elf.getRelocationTables();<NEW_LINE>for (ElfRelocationTable relocationTable : relocationTables) {<NEW_LINE>monitor.checkCanceled();<NEW_LINE>ElfSectionHeader relocationSection = relocationTable.getTableSectionHeader();<NEW_LINE>String relocSectionName = "<section-not-found>";<NEW_LINE>if (relocationSection != null) {<NEW_LINE>relocSectionName = relocationSection.getNameAsString();<NEW_LINE>}<NEW_LINE>// elf.getSection(relocationTable.getFileOffset()); // may be null<NEW_LINE>Address relocationTableAddress = addr(relocationTable.getFileOffset());<NEW_LINE>try {<NEW_LINE>DataType dataType = relocationTable.toDataType();<NEW_LINE>if (dataType != null) {<NEW_LINE>createData(relocationTableAddress, dataType);<NEW_LINE>} else {<NEW_LINE>listing.setComment(<MASK><NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>messages.appendMsg("Could not markup relocation table for " + relocSectionName + " - " + e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | relocationTableAddress, CodeUnit.PRE_COMMENT, "ELF Relocation Table (markup not yet supported)"); |
1,150,581 | public static AssignRolesToUserResponse unmarshall(AssignRolesToUserResponse assignRolesToUserResponse, UnmarshallerContext context) {<NEW_LINE>assignRolesToUserResponse.setRequestId(context.stringValue("AssignRolesToUserResponse.RequestId"));<NEW_LINE>assignRolesToUserResponse.setSuccess(context.booleanValue("AssignRolesToUserResponse.Success"));<NEW_LINE>assignRolesToUserResponse.setCode(context.stringValue("AssignRolesToUserResponse.Code"));<NEW_LINE>assignRolesToUserResponse.setMessage(context.stringValue("AssignRolesToUserResponse.Message"));<NEW_LINE>assignRolesToUserResponse.setHttpStatusCode(context.integerValue("AssignRolesToUserResponse.HttpStatusCode"));<NEW_LINE>User user = new User();<NEW_LINE>user.setUserId(context.stringValue("AssignRolesToUserResponse.User.UserId"));<NEW_LINE>user.setRamId(context.stringValue("AssignRolesToUserResponse.User.RamId"));<NEW_LINE>user.setInstanceId(context.stringValue("AssignRolesToUserResponse.User.InstanceId"));<NEW_LINE>Detail detail = new Detail();<NEW_LINE>detail.setLoginName(context.stringValue("AssignRolesToUserResponse.User.Detail.LoginName"));<NEW_LINE>detail.setDisplayName(context.stringValue("AssignRolesToUserResponse.User.Detail.DisplayName"));<NEW_LINE>detail.setPhone(context.stringValue("AssignRolesToUserResponse.User.Detail.Phone"));<NEW_LINE>detail.setEmail(context.stringValue("AssignRolesToUserResponse.User.Detail.Email"));<NEW_LINE>detail.setDepartment(context.stringValue("AssignRolesToUserResponse.User.Detail.Department"));<NEW_LINE>user.setDetail(detail);<NEW_LINE>List<Role> roles = new ArrayList<Role>();<NEW_LINE>for (int i = 0; i < context.lengthValue("AssignRolesToUserResponse.User.Roles.Length"); i++) {<NEW_LINE>Role role = new Role();<NEW_LINE>role.setRoleId(context.stringValue("AssignRolesToUserResponse.User.Roles[" + i + "].RoleId"));<NEW_LINE>role.setInstanceId(context.stringValue("AssignRolesToUserResponse.User.Roles[" + i + "].InstanceId"));<NEW_LINE>role.setRoleName(context.stringValue("AssignRolesToUserResponse.User.Roles[" + i + "].RoleName"));<NEW_LINE>role.setRoleDescription(context.stringValue("AssignRolesToUserResponse.User.Roles[" + i + "].RoleDescription"));<NEW_LINE>roles.add(role);<NEW_LINE>}<NEW_LINE>user.setRoles(roles);<NEW_LINE>List<SkillLevel> skillLevels = new ArrayList<SkillLevel>();<NEW_LINE>for (int i = 0; i < context.lengthValue("AssignRolesToUserResponse.User.SkillLevels.Length"); i++) {<NEW_LINE>SkillLevel skillLevel = new SkillLevel();<NEW_LINE>skillLevel.setSkillLevelId(context.stringValue("AssignRolesToUserResponse.User.SkillLevels[" + i + "].SkillLevelId"));<NEW_LINE>skillLevel.setLevel(context.integerValue("AssignRolesToUserResponse.User.SkillLevels[" + i + "].Level"));<NEW_LINE>Skill skill = new Skill();<NEW_LINE>skill.setSkillGroupId(context.stringValue("AssignRolesToUserResponse.User.SkillLevels[" + i + "].Skill.SkillGroupId"));<NEW_LINE>skill.setInstanceId(context.stringValue("AssignRolesToUserResponse.User.SkillLevels[" + i + "].Skill.InstanceId"));<NEW_LINE>skill.setSkillGroupName(context.stringValue<MASK><NEW_LINE>skill.setSkillGroupDescription(context.stringValue("AssignRolesToUserResponse.User.SkillLevels[" + i + "].Skill.SkillGroupDescription"));<NEW_LINE>skillLevel.setSkill(skill);<NEW_LINE>skillLevels.add(skillLevel);<NEW_LINE>}<NEW_LINE>user.setSkillLevels(skillLevels);<NEW_LINE>assignRolesToUserResponse.setUser(user);<NEW_LINE>return assignRolesToUserResponse;<NEW_LINE>} | ("AssignRolesToUserResponse.User.SkillLevels[" + i + "].Skill.SkillGroupName")); |
240,401 | private final void generatePojoGetter0(TypedElementDefinition<?> column, @SuppressWarnings("unused") int index, JavaWriter out) {<NEW_LINE>final String columnTypeFull = getJavaType(column.getType(resolver(out, Mode.POJO)<MASK><NEW_LINE>final String columnType = out.ref(columnTypeFull);<NEW_LINE>final String columnGetter = getStrategy().getJavaGetterName(column, Mode.POJO);<NEW_LINE>final String columnMember = getStrategy().getJavaMemberName(column, Mode.POJO);<NEW_LINE>final String name = column.getQualifiedOutputName();<NEW_LINE>// Getter<NEW_LINE>if (!printDeprecationIfUnknownType(out, columnTypeFull))<NEW_LINE>out.javadoc("Getter for <code>%s</code>.[[before= ][%s]]", name, list(escapeEntities(comment(column))));<NEW_LINE>if (column instanceof ColumnDefinition)<NEW_LINE>printColumnJPAAnnotation(out, (ColumnDefinition) column);<NEW_LINE>printValidationAnnotation(out, column);<NEW_LINE>printNullableOrNonnullAnnotation(out, column);<NEW_LINE>if (scala) {<NEW_LINE>out.println("%sdef %s: %s = this.%s", visibility(generateInterfaces()), scalaWhitespaceSuffix(columnGetter), columnType, columnMember);<NEW_LINE>} else {<NEW_LINE>out.overrideIf(generateInterfaces());<NEW_LINE>out.println("%s%s %s() {", visibility(generateInterfaces()), columnType, columnGetter);<NEW_LINE>out.println("return this.%s;", columnMember);<NEW_LINE>out.println("}");<NEW_LINE>}<NEW_LINE>} | ), out, Mode.POJO); |
3,760 | public LoginResponse completeOpenIdLogin(String code, String state, String idToken) throws ApiException {<NEW_LINE>Object localVarPostBody = null;<NEW_LINE>// verify the required parameter 'code' is set<NEW_LINE>if (code == null) {<NEW_LINE>throw new ApiException(400, "Missing the required parameter 'code' when calling completeOpenIdLogin");<NEW_LINE>}<NEW_LINE>// verify the required parameter 'state' is set<NEW_LINE>if (state == null) {<NEW_LINE>throw new ApiException(400, "Missing the required parameter 'state' when calling completeOpenIdLogin");<NEW_LINE>}<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/v4/auth/openid/login";<NEW_LINE>// query params<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new <MASK><NEW_LINE>localVarQueryParams.addAll(apiClient.parameterToPairs("", "code", code));<NEW_LINE>localVarQueryParams.addAll(apiClient.parameterToPairs("", "id_token", idToken));<NEW_LINE>localVarQueryParams.addAll(apiClient.parameterToPairs("", "state", state));<NEW_LINE>final String[] localVarAccepts = { "application/json" };<NEW_LINE>final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>final String[] localVarContentTypes = {};<NEW_LINE>final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>String[] localVarAuthNames = new String[] {};<NEW_LINE>GenericType<LoginResponse> localVarReturnType = new GenericType<LoginResponse>() {<NEW_LINE>};<NEW_LINE>return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);<NEW_LINE>} | HashMap<String, Object>(); |
855,214 | public static SentryEnvelopeItem fromEvent(@NotNull final ISerializer serializer, @NotNull final SentryBaseEvent event) throws IOException {<NEW_LINE>Objects.requireNonNull(serializer, "ISerializer is required.");<NEW_LINE>Objects.requireNonNull(event, "SentryEvent is required.");<NEW_LINE>final CachedItem cachedItem = new CachedItem(() -> {<NEW_LINE>try (final ByteArrayOutputStream stream = new ByteArrayOutputStream();<NEW_LINE>final Writer writer = new BufferedWriter(new OutputStreamWriter(stream, UTF_8))) {<NEW_LINE><MASK><NEW_LINE>return stream.toByteArray();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>SentryEnvelopeItemHeader itemHeader = new SentryEnvelopeItemHeader(SentryItemType.resolve(event), () -> cachedItem.getBytes().length, "application/json", null);<NEW_LINE>// Don't use method reference. This can cause issues on Android<NEW_LINE>return new SentryEnvelopeItem(itemHeader, () -> cachedItem.getBytes());<NEW_LINE>} | serializer.serialize(event, writer); |
212,875 | private CodePointMapping buildCustomEncoding(String encodingName, AFMFile afm) {<NEW_LINE>int mappingCount = 0;<NEW_LINE>// Just count the first time...<NEW_LINE>List<AFMCharMetrics> chars = afm.getCharMetrics();<NEW_LINE>for (AFMCharMetrics charMetrics : chars) {<NEW_LINE>if (charMetrics.getCharCode() >= 0) {<NEW_LINE>mappingCount++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// ...and now build the table.<NEW_LINE>int[] table = new int[mappingCount * 2];<NEW_LINE>String[] charNameMap = new String[256];<NEW_LINE>int idx = 0;<NEW_LINE>for (AFMCharMetrics charMetrics : chars) {<NEW_LINE>if (charMetrics.getCharCode() >= 0) {<NEW_LINE>charNameMap[charMetrics.getCharCode()] = charMetrics.getCharName();<NEW_LINE>String unicodes = charMetrics.getUnicodeSequence();<NEW_LINE>if (unicodes == null) {<NEW_LINE><MASK><NEW_LINE>table[idx] = charMetrics.getCharCode();<NEW_LINE>idx++;<NEW_LINE>table[idx] = charMetrics.getCharCode();<NEW_LINE>idx++;<NEW_LINE>} else if (unicodes.length() == 1) {<NEW_LINE>table[idx] = charMetrics.getCharCode();<NEW_LINE>idx++;<NEW_LINE>table[idx] = unicodes.charAt(0);<NEW_LINE>idx++;<NEW_LINE>} else {<NEW_LINE>log.warn("Multi-character representation of glyph not currently supported: " + charMetrics);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new CodePointMapping(encodingName, table, charNameMap);<NEW_LINE>} | log.info("No Unicode mapping for glyph: " + charMetrics); |
496,401 | public static Object doProcess(Object input, Object start, Object length, Object replacement) {<NEW_LINE>if (input == null || start == null || length == null || replacement == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if ((input instanceof String || input instanceof Character) == false) {<NEW_LINE>throw new SqlIllegalArgumentException("A string/char is required; received [{}]", input);<NEW_LINE>}<NEW_LINE>if ((replacement instanceof String || replacement instanceof Character) == false) {<NEW_LINE>throw new SqlIllegalArgumentException("A string/char is required; received [{}]", replacement);<NEW_LINE>}<NEW_LINE>Check.isFixedNumberAndInRange(start, "start", (long) Integer.MIN_VALUE + 1, (long) Integer.MAX_VALUE);<NEW_LINE>Check.isFixedNumberAndInRange(length, "length", 0L<MASK><NEW_LINE>int startInt = ((Number) start).intValue() - 1;<NEW_LINE>int realStart = startInt < 0 ? 0 : startInt;<NEW_LINE>if (startInt > input.toString().length()) {<NEW_LINE>return input;<NEW_LINE>}<NEW_LINE>StringBuilder sb = new StringBuilder(input.toString());<NEW_LINE>String replString = (replacement.toString());<NEW_LINE>return sb.replace(realStart, realStart + ((Number) length).intValue(), replString).toString();<NEW_LINE>} | , (long) Integer.MAX_VALUE); |
545,756 | public static DescribeDBClusterPerformanceResponse unmarshall(DescribeDBClusterPerformanceResponse describeDBClusterPerformanceResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeDBClusterPerformanceResponse.setRequestId(_ctx.stringValue("DescribeDBClusterPerformanceResponse.RequestId"));<NEW_LINE>describeDBClusterPerformanceResponse.setEndTime(_ctx.stringValue("DescribeDBClusterPerformanceResponse.EndTime"));<NEW_LINE>describeDBClusterPerformanceResponse.setDBClusterId(_ctx.stringValue("DescribeDBClusterPerformanceResponse.DBClusterId"));<NEW_LINE>describeDBClusterPerformanceResponse.setStartTime(_ctx.stringValue("DescribeDBClusterPerformanceResponse.StartTime"));<NEW_LINE>List<PerformanceItem> performances = new ArrayList<PerformanceItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeDBClusterPerformanceResponse.Performances.Length"); i++) {<NEW_LINE>PerformanceItem performanceItem = new PerformanceItem();<NEW_LINE>performanceItem.setUnit(_ctx.stringValue("DescribeDBClusterPerformanceResponse.Performances[" + i + "].Unit"));<NEW_LINE>performanceItem.setKey(_ctx.stringValue("DescribeDBClusterPerformanceResponse.Performances[" + i + "].Key"));<NEW_LINE>List<SeriesItem> series = new ArrayList<SeriesItem>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("DescribeDBClusterPerformanceResponse.Performances[" + i + "].Series.Length"); j++) {<NEW_LINE>SeriesItem seriesItem = new SeriesItem();<NEW_LINE>seriesItem.setName(_ctx.stringValue("DescribeDBClusterPerformanceResponse.Performances[" + i + "].Series[" + j + "].Name"));<NEW_LINE>List<String> values = new ArrayList<String>();<NEW_LINE>for (int k = 0; k < _ctx.lengthValue("DescribeDBClusterPerformanceResponse.Performances[" + i + "].Series[" + j + "].Values.Length"); k++) {<NEW_LINE>values.add(_ctx.stringValue("DescribeDBClusterPerformanceResponse.Performances[" + i + "].Series[" + j <MASK><NEW_LINE>}<NEW_LINE>seriesItem.setValues(values);<NEW_LINE>series.add(seriesItem);<NEW_LINE>}<NEW_LINE>performanceItem.setSeries(series);<NEW_LINE>performances.add(performanceItem);<NEW_LINE>}<NEW_LINE>describeDBClusterPerformanceResponse.setPerformances(performances);<NEW_LINE>return describeDBClusterPerformanceResponse;<NEW_LINE>} | + "].Values[" + k + "]")); |
464,410 | private <T> void schedule(ScheduledCompletableFutureRecurring<T> recurringSchedule, SchedulerRunnable runnable, TemporalAdjuster temporalAdjuster) {<NEW_LINE>final Temporal newTime = recurringSchedule.getScheduledTime().with(temporalAdjuster);<NEW_LINE>final ScheduledCompletableFutureOnce<T> deferred = new ScheduledCompletableFutureOnce<><MASK><NEW_LINE>deferred.thenAccept(v -> {<NEW_LINE>if (temporalAdjuster instanceof SchedulerTemporalAdjuster) {<NEW_LINE>final SchedulerTemporalAdjuster schedulerTemporalAdjuster = (SchedulerTemporalAdjuster) temporalAdjuster;<NEW_LINE>if (!schedulerTemporalAdjuster.isDone(newTime)) {<NEW_LINE>schedule(recurringSchedule, runnable, temporalAdjuster);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>recurringSchedule.complete(v);<NEW_LINE>});<NEW_LINE>recurringSchedule.setScheduledPromise(deferred);<NEW_LINE>atInternal(deferred, () -> {<NEW_LINE>runnable.run();<NEW_LINE>return null;<NEW_LINE>});<NEW_LINE>} | (ZonedDateTime.from(newTime)); |
1,139,116 | public SoftwareTokenMfaConfigType unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>SoftwareTokenMfaConfigType softwareTokenMfaConfigType = new SoftwareTokenMfaConfigType();<NEW_LINE><MASK><NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return 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("Enabled", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>softwareTokenMfaConfigType.setEnabled(context.getUnmarshaller(Boolean.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 softwareTokenMfaConfigType;<NEW_LINE>} | int originalDepth = context.getCurrentDepth(); |
1,361,556 | public Sequence<T> applySubsampling(@NonNull Sequence<T> sequence, @NonNull AtomicLong nextRandom) {<NEW_LINE>Sequence<T> result = new Sequence<>();<NEW_LINE>// subsampling implementation, if subsampling threshold met, just continue to next element<NEW_LINE>if (sampling > 0) {<NEW_LINE>result.<MASK><NEW_LINE>if (sequence.getSequenceLabels() != null)<NEW_LINE>result.setSequenceLabels(sequence.getSequenceLabels());<NEW_LINE>if (sequence.getSequenceLabel() != null)<NEW_LINE>result.setSequenceLabel(sequence.getSequenceLabel());<NEW_LINE>for (T element : sequence.getElements()) {<NEW_LINE>double numWords = vocabCache.totalWordOccurrences();<NEW_LINE>double ran = (Math.sqrt(element.getElementFrequency() / (sampling * numWords)) + 1) * (sampling * numWords) / element.getElementFrequency();<NEW_LINE>nextRandom.set(Math.abs(nextRandom.get() * 25214903917L + 11));<NEW_LINE>if (ran < (nextRandom.get() & 0xFFFF) / (double) 65536) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>result.addElement(element);<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} else<NEW_LINE>return sequence;<NEW_LINE>} | setSequenceId(sequence.getSequenceId()); |
292,729 | public CompletionStage<Result> update(final String queries) {<NEW_LINE>return getRandomWorlds(queryCount(queries)).thenApplyAsync(worlds -> {<NEW_LINE>final Random random = ThreadLocalRandom.current();<NEW_LINE>for (final WorldRecord world : worlds) {<NEW_LINE>world.setRandomnumber((random.<MASK><NEW_LINE>}<NEW_LINE>final int batchSize = 25;<NEW_LINE>final int batches = ((worlds.size() / batchSize) + 1);<NEW_LINE>this.db.withConnection(connection -> {<NEW_LINE>final DSLContext sql = DSL.using(connection, DIALECT);<NEW_LINE>for (int i = 0; i < batches; ++i) {<NEW_LINE>sql.batchUpdate(worlds.subList(i * batchSize, Math.min((i + 1) * batchSize, worlds.size()))).execute();<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>});<NEW_LINE>return ok(worlds.formatJSON(JSON_FORMAT)).as(JSON);<NEW_LINE>}, dbEc);<NEW_LINE>} | nextInt(10000) + 1)); |
990,847 | public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) {<NEW_LINE>Permanent permanent = game.getPermanent(source.getSourceId());<NEW_LINE>if (permanent == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (permanent.getImprinted().isEmpty()) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>List<UUID> imprinted = permanent.getImprinted();<NEW_LINE>if (imprinted == null || imprinted.isEmpty()) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>Card card = game.getCard(imprinted.get(imprinted<MASK><NEW_LINE>if (card == null || !card.isCreature(game)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>switch(layer) {<NEW_LINE>case TypeChangingEffects_4:<NEW_LINE>permanent.copySubTypesFrom(game, card, SubTypeSet.CreatureType);<NEW_LINE>break;<NEW_LINE>case PTChangingEffects_7:<NEW_LINE>if (sublayer == SubLayer.SetPT_7b) {<NEW_LINE>permanent.getPower().setValue(card.getPower().getValue());<NEW_LINE>permanent.getToughness().setValue(card.getToughness().getValue());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | .size() - 1)); |
496,006 | private MappeableContainer ilazyorToRun(MappeableArrayContainer x) {<NEW_LINE>if (isFull()) {<NEW_LINE>return full();<NEW_LINE>}<NEW_LINE>final int nbrruns = this.nbrruns;<NEW_LINE>final int offset = Math.max(nbrruns, x.getCardinality());<NEW_LINE>copyToOffset(offset);<NEW_LINE>char[] vl = valueslength.array();<NEW_LINE>int rlepos = 0;<NEW_LINE>this.nbrruns = 0;<NEW_LINE>PeekableCharIterator i = x.getCharIterator();<NEW_LINE>while (i.hasNext() && (rlepos < nbrruns)) {<NEW_LINE>if ((getValue(vl, rlepos + offset)) - (i.peekNext()) <= 0) {<NEW_LINE>smartAppend(vl, getValue(vl, rlepos + offset), getLength(vl, rlepos + offset));<NEW_LINE>rlepos++;<NEW_LINE>} else {<NEW_LINE>smartAppend(vl, i.next());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (i.hasNext()) {<NEW_LINE>while (i.hasNext()) {<NEW_LINE>smartAppend(vl, i.next());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>while (rlepos < nbrruns) {<NEW_LINE>smartAppend(vl, getValue(vl, rlepos + offset), getLength<MASK><NEW_LINE>rlepos++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return convertToLazyBitmapIfNeeded();<NEW_LINE>} | (vl, rlepos + offset)); |
884,125 | protected String findPropertyName(ExecutableElement m) {<NEW_LINE>String name = m<MASK><NEW_LINE>if (!builder) {<NEW_LINE>if (!name.startsWith(SET_NAME_PREFIX) || name.length() == SET_NAME_PREFIX_LEN || !Character.isUpperCase(name.charAt(SET_NAME_PREFIX_LEN))) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// check number of parameters:<NEW_LINE>if (m.getParameters().size() != 1) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (builder) {<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>sb.append(Character.toLowerCase(name.charAt(0)));<NEW_LINE>if (name.length() > 1) {<NEW_LINE>sb.append(name.substring(1));<NEW_LINE>}<NEW_LINE>return // #223293: some builder methods start with uppercase, which is not a permitted name for a property<NEW_LINE>compilationInfo.getTypes().isAssignable(m.getReturnType(), m.getEnclosingElement().asType()) ? sb.toString() : null;<NEW_LINE>} else {<NEW_LINE>return m.getReturnType().getKind() == TypeKind.VOID ? getPropertyName(name.toString()) : null;<NEW_LINE>}<NEW_LINE>} | .getSimpleName().toString(); |
1,458,335 | public void caseLoadInst(LoadInst i) {<NEW_LINE>final int slot = localToSlot.get(i.getLocal());<NEW_LINE>i.getOpType().apply(new TypeSwitch() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void caseArrayType(ArrayType t) {<NEW_LINE>mv.visitVarInsn(Opcodes.ALOAD, slot);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void caseBooleanType(BooleanType t) {<NEW_LINE>mv.visitVarInsn(Opcodes.ILOAD, slot);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void caseByteType(ByteType t) {<NEW_LINE>mv.visitVarInsn(Opcodes.ILOAD, slot);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void caseCharType(CharType t) {<NEW_LINE>mv.visitVarInsn(Opcodes.ILOAD, slot);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void caseDoubleType(DoubleType t) {<NEW_LINE>mv.visitVarInsn(Opcodes.DLOAD, slot);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void caseFloatType(FloatType t) {<NEW_LINE>mv.<MASK><NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void caseIntType(IntType t) {<NEW_LINE>mv.visitVarInsn(Opcodes.ILOAD, slot);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void caseLongType(LongType t) {<NEW_LINE>mv.visitVarInsn(Opcodes.LLOAD, slot);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void caseRefType(RefType t) {<NEW_LINE>mv.visitVarInsn(Opcodes.ALOAD, slot);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void caseShortType(ShortType t) {<NEW_LINE>mv.visitVarInsn(Opcodes.ILOAD, slot);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void caseNullType(NullType t) {<NEW_LINE>mv.visitVarInsn(Opcodes.ALOAD, slot);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void defaultCase(Type t) {<NEW_LINE>throw new RuntimeException("Invalid local type: " + t);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | visitVarInsn(Opcodes.FLOAD, slot); |
1,587,270 | static boolean nukeExistingCluster(KV kvClient, String scope) throws Exception {<NEW_LINE>ByteSequence rootScopeKey = ByteSequence.from(scope, UTF_8);<NEW_LINE>GetResponse resp = msResult(kvClient.get(rootScopeKey));<NEW_LINE>if (resp.getCount() <= 0) {<NEW_LINE>log.info("There is no existing cluster with under scope '{}' in Etcd, " + "so exiting nuke operation", scope);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>String bookiesPath = getBookiesPath(scope);<NEW_LINE>String bookiesEndPath = getBookiesEndPath(scope);<NEW_LINE>resp = msResult(kvClient.get(ByteSequence.from(bookiesPath, UTF_8), GetOption.newBuilder().withRange(ByteSequence.from(bookiesEndPath, UTF_8)).withKeysOnly(<MASK><NEW_LINE>String writableBookiesPath = getWritableBookiesPath(scope);<NEW_LINE>String readonlyBookiesPath = getReadonlyBookiesPath(scope);<NEW_LINE>boolean hasBookiesAlive = false;<NEW_LINE>for (KeyValue kv : resp.getKvs()) {<NEW_LINE>String keyStr = new String(kv.getKey().getBytes(), UTF_8);<NEW_LINE>if (keyStr.equals(bookiesPath) || keyStr.equals(writableBookiesPath) || keyStr.equals(readonlyBookiesPath)) {<NEW_LINE>continue;<NEW_LINE>} else {<NEW_LINE>hasBookiesAlive = true;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (hasBookiesAlive) {<NEW_LINE>log.error("Bookies are still up and connected to this cluster, " + "stop all bookies before nuking the cluster");<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>DeleteResponse delResp = msResult(kvClient.delete(rootScopeKey, DeleteOption.newBuilder().withRange(ByteSequence.from(getScopeEndKey(scope), UTF_8)).build()));<NEW_LINE>log.info("Successfully nuked cluster under scope '{}' : {} kv pairs deleted", scope, delResp.getDeleted());<NEW_LINE>return true;<NEW_LINE>} | true).build())); |
845,811 | protected void logConfig(EGLConfig config) {<NEW_LINE>EGL10 egl = (EGL10) EGLContext.getEGL();<NEW_LINE>EGLDisplay display = egl.eglGetDisplay(EGL10.EGL_DEFAULT_DISPLAY);<NEW_LINE>int r = getAttrib(egl, display, config, EGL10.EGL_RED_SIZE, 0);<NEW_LINE>int g = getAttrib(egl, display, config, EGL10.EGL_GREEN_SIZE, 0);<NEW_LINE>int b = getAttrib(egl, display, config, EGL10.EGL_BLUE_SIZE, 0);<NEW_LINE>int a = getAttrib(egl, display, config, EGL10.EGL_ALPHA_SIZE, 0);<NEW_LINE>int d = getAttrib(egl, display, config, EGL10.EGL_DEPTH_SIZE, 0);<NEW_LINE>int s = getAttrib(egl, display, config, EGL10.EGL_STENCIL_SIZE, 0);<NEW_LINE>int samples = Math.max(getAttrib(egl, display, config, EGL10.EGL_SAMPLES, 0), getAttrib(egl, display, config, GdxEglConfigChooser.EGL_COVERAGE_SAMPLES_NV, 0));<NEW_LINE>boolean coverageSample = getAttrib(egl, display, config, GdxEglConfigChooser.EGL_COVERAGE_SAMPLES_NV, 0) != 0;<NEW_LINE>Gdx.app.log(LOG_TAG, "framebuffer: (" + r + ", " + g + ", " + b + ", " + a + ")");<NEW_LINE>Gdx.app.log(LOG_TAG, "depthbuffer: (" + d + ")");<NEW_LINE>Gdx.app.log(LOG_TAG, "stencilbuffer: (" + s + ")");<NEW_LINE>Gdx.app.log(<MASK><NEW_LINE>Gdx.app.log(LOG_TAG, "coverage sampling: (" + coverageSample + ")");<NEW_LINE>bufferFormat = new BufferFormat(r, g, b, a, d, s, samples, coverageSample);<NEW_LINE>} | LOG_TAG, "samples: (" + samples + ")"); |
152,993 | private int drawLabelString(Graphics g, Label l, String text, int x, int y, int textSpaceX, int textSpaceW) {<NEW_LINE>if (text.length() == 0) {<NEW_LINE>return 0;<NEW_LINE>}<NEW_LINE>Style style = l.getStyle();<NEW_LINE><MASK><NEW_LINE>int cy = g.getClipY();<NEW_LINE>int cw = g.getClipWidth();<NEW_LINE>int ch = g.getClipHeight();<NEW_LINE>// g.pushClip();<NEW_LINE>g.clipRect(textSpaceX, cy, textSpaceW, ch);<NEW_LINE>if (l.isTickerRunning()) {<NEW_LINE>Font font = style.getFont();<NEW_LINE>if (l.getShiftText() > 0) {<NEW_LINE>if (l.getShiftText() > textSpaceW) {<NEW_LINE>l.setShiftText(x - l.getX() - l.getStringWidth(font));<NEW_LINE>}<NEW_LINE>} else if (l.getShiftText() + l.getStringWidth(font) < 0) {<NEW_LINE>l.setShiftText(textSpaceW);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int drawnW = drawLabelText(g, l, text, x, y, textSpaceW);<NEW_LINE>g.setClip(cx, cy, cw, ch);<NEW_LINE>// g.popClip();<NEW_LINE>return drawnW;<NEW_LINE>} | int cx = g.getClipX(); |
22,875 | public static GetProductQuotaResponse unmarshall(GetProductQuotaResponse getProductQuotaResponse, UnmarshallerContext _ctx) {<NEW_LINE>getProductQuotaResponse.setRequestId(_ctx.stringValue("GetProductQuotaResponse.RequestId"));<NEW_LINE>Quota quota = new Quota();<NEW_LINE>quota.setQuotaDescription<MASK><NEW_LINE>quota.setConsumable(_ctx.booleanValue("GetProductQuotaResponse.Quota.Consumable"));<NEW_LINE>quota.setUnadjustableDetail(_ctx.stringValue("GetProductQuotaResponse.Quota.UnadjustableDetail"));<NEW_LINE>quota.setProductCode(_ctx.stringValue("GetProductQuotaResponse.Quota.ProductCode"));<NEW_LINE>quota.setTotalUsage(_ctx.floatValue("GetProductQuotaResponse.Quota.TotalUsage"));<NEW_LINE>quota.setQuotaType(_ctx.stringValue("GetProductQuotaResponse.Quota.QuotaType"));<NEW_LINE>quota.setDimensions(_ctx.mapValue("GetProductQuotaResponse.Quota.Dimensions"));<NEW_LINE>quota.setQuotaUnit(_ctx.stringValue("GetProductQuotaResponse.Quota.QuotaUnit"));<NEW_LINE>quota.setAdjustable(_ctx.booleanValue("GetProductQuotaResponse.Quota.Adjustable"));<NEW_LINE>quota.setQuotaActionCode(_ctx.stringValue("GetProductQuotaResponse.Quota.QuotaActionCode"));<NEW_LINE>quota.setQuotaName(_ctx.stringValue("GetProductQuotaResponse.Quota.QuotaName"));<NEW_LINE>quota.setQuotaArn(_ctx.stringValue("GetProductQuotaResponse.Quota.QuotaArn"));<NEW_LINE>quota.setTotalQuota(_ctx.floatValue("GetProductQuotaResponse.Quota.TotalQuota"));<NEW_LINE>quota.setApplicableType(_ctx.stringValue("GetProductQuotaResponse.Quota.ApplicableType"));<NEW_LINE>List<Float> applicableRange = new ArrayList<Float>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("GetProductQuotaResponse.Quota.ApplicableRange.Length"); i++) {<NEW_LINE>applicableRange.add(_ctx.floatValue("GetProductQuotaResponse.Quota.ApplicableRange[" + i + "]"));<NEW_LINE>}<NEW_LINE>quota.setApplicableRange(applicableRange);<NEW_LINE>Period period = new Period();<NEW_LINE>period.setPeriodValue(_ctx.integerValue("GetProductQuotaResponse.Quota.Period.PeriodValue"));<NEW_LINE>period.setPeriodUnit(_ctx.stringValue("GetProductQuotaResponse.Quota.Period.PeriodUnit"));<NEW_LINE>quota.setPeriod(period);<NEW_LINE>List<QuotaItemsItem> quotaItems = new ArrayList<QuotaItemsItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("GetProductQuotaResponse.Quota.QuotaItems.Length"); i++) {<NEW_LINE>QuotaItemsItem quotaItemsItem = new QuotaItemsItem();<NEW_LINE>quotaItemsItem.setUsage(_ctx.stringValue("GetProductQuotaResponse.Quota.QuotaItems[" + i + "].Usage"));<NEW_LINE>quotaItemsItem.setType(_ctx.stringValue("GetProductQuotaResponse.Quota.QuotaItems[" + i + "].Type"));<NEW_LINE>quotaItemsItem.setQuota(_ctx.stringValue("GetProductQuotaResponse.Quota.QuotaItems[" + i + "].Quota"));<NEW_LINE>quotaItemsItem.setQuotaUnit(_ctx.stringValue("GetProductQuotaResponse.Quota.QuotaItems[" + i + "].QuotaUnit"));<NEW_LINE>quotaItems.add(quotaItemsItem);<NEW_LINE>}<NEW_LINE>quota.setQuotaItems(quotaItems);<NEW_LINE>getProductQuotaResponse.setQuota(quota);<NEW_LINE>return getProductQuotaResponse;<NEW_LINE>} | (_ctx.stringValue("GetProductQuotaResponse.Quota.QuotaDescription")); |
413 | protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException {<NEW_LINE>SecurityContext context = SecurityContextHolder.getContext();<NEW_LINE>if (context != null && context.getAuthentication() != null && context.getAuthentication() instanceof UaaAuthentication) {<NEW_LINE>UaaAuthentication authentication = (UaaAuthentication) context.getAuthentication();<NEW_LINE>if (authentication.isAuthenticated() && OriginKeys.UAA.equals(authentication.getPrincipal().getOrigin()) && null != request.getSession(false)) {<NEW_LINE>boolean redirect = false;<NEW_LINE>String userId = authentication<MASK><NEW_LINE>try {<NEW_LINE>logger.debug("Evaluating user-id for session reset:" + userId);<NEW_LINE>UaaUserPrototype user = userDatabase.retrieveUserPrototypeById(userId);<NEW_LINE>Date lastModified;<NEW_LINE>if ((lastModified = user.getPasswordLastModified()) != null) {<NEW_LINE>long lastAuthTime = authentication.getAuthenticatedTime();<NEW_LINE>long passwordModTime = lastModified.getTime();<NEW_LINE>// if the password has changed after authentication time<NEW_LINE>if (hasPasswordChangedAfterAuthentication(lastAuthTime, passwordModTime)) {<NEW_LINE>logger.debug(String.format("Resetting user session for user ID: %s Auth Time: %s Password Change Time: %s", userId, lastAuthTime, passwordModTime));<NEW_LINE>redirect = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (UsernameNotFoundException x) {<NEW_LINE>logger.info("Authenticated user [" + userId + "] was not found in DB.");<NEW_LINE>redirect = true;<NEW_LINE>}<NEW_LINE>if (redirect) {<NEW_LINE>handleRedirect(request, response);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>filterChain.doFilter(request, response);<NEW_LINE>} | .getPrincipal().getId(); |
544,017 | ActionResult<Wo> execute(EffectivePerson effectivePerson, String id) throws Exception {<NEW_LINE>try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {<NEW_LINE>ActionResult<Wo> result = new ActionResult<>();<NEW_LINE>Application app = emc.<MASK><NEW_LINE>if (null == app) {<NEW_LINE>throw new ExceptionEntityNotExist(id, Application.class);<NEW_LINE>}<NEW_LINE>Wo wo = Wo.copier.copy(app);<NEW_LINE>wo.setAttList(emc.listEqual(Attachment.class, Attachment.application_FIELDNAME, wo.getId()));<NEW_LINE>InstallLog installLog = emc.find(id, InstallLog.class);<NEW_LINE>if (installLog != null && CommonStatus.VALID.getValue().equals(installLog.getStatus())) {<NEW_LINE>wo.setInstalledVersion(installLog.getVersion());<NEW_LINE>} else {<NEW_LINE>wo.setInstalledVersion("");<NEW_LINE>}<NEW_LINE>result.setData(wo);<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>} | find(id, Application.class); |
1,283,177 | synchronized boolean updateParams(CreateParams params, boolean executeViaDistributed) throws ODatabaseException {<NEW_LINE>if (executeViaDistributed) {<NEW_LINE>try {<NEW_LINE>return sendSequenceActionOverCluster(OSequenceAction.UPDATE, params);<NEW_LINE>} catch (InterruptedException | ExecutionException exc) {<NEW_LINE>OLogManager.instance().error(this, exc.getMessage(), exc, (Object[]) null);<NEW_LINE>throw new ODatabaseException(exc.getMessage());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>boolean any = false;<NEW_LINE>if (params.start != null && this.getStart() != params.start) {<NEW_LINE>this.setStart(params.start);<NEW_LINE>any = true;<NEW_LINE>}<NEW_LINE>if (params.increment != null && this.getIncrement() != params.increment) {<NEW_LINE>this.setIncrement(params.increment);<NEW_LINE>any = true;<NEW_LINE>}<NEW_LINE>if (params.limitValue != null && this.getLimitValue() != params.limitValue) {<NEW_LINE>this.setLimitValue(params.limitValue);<NEW_LINE>any = true;<NEW_LINE>}<NEW_LINE>if (params.orderType != null && this.getOrderType() != params.orderType) {<NEW_LINE><MASK><NEW_LINE>any = true;<NEW_LINE>}<NEW_LINE>if (params.recyclable != null && this.getRecyclable() != params.recyclable) {<NEW_LINE>this.setRecyclable(params.recyclable);<NEW_LINE>any = true;<NEW_LINE>}<NEW_LINE>if (params.turnLimitOff != null && params.turnLimitOff == true) {<NEW_LINE>this.setLimitValue(null);<NEW_LINE>}<NEW_LINE>if (params.currentValue != null && getValue() != params.currentValue) {<NEW_LINE>this.setValue(params.currentValue);<NEW_LINE>}<NEW_LINE>save();<NEW_LINE>return any;<NEW_LINE>} | this.setOrderType(params.orderType); |
697,544 | private static TsMethodModel createDeserializationGenericFunctionConstructor(SymbolTable symbolTable, TsModel tsModel, TsBeanModel bean) {<NEW_LINE>final Symbol beanIdentifier = symbolTable.getSymbol(bean.getOrigin());<NEW_LINE>List<TsType.GenericVariableType> typeParameters = getTypeParameters(bean.getOrigin());<NEW_LINE>final TsType.ReferenceType dataType = new TsType.GenericReferenceType(beanIdentifier, typeParameters);<NEW_LINE>final List<TsParameterModel> constructorFnOfParameters = getConstructorFnOfParameters(typeParameters);<NEW_LINE>final List<TsExpression> arguments = new ArrayList<>();<NEW_LINE>arguments.add(new TsIdentifierReference("data"));<NEW_LINE>for (TsParameterModel constructorFnOfParameter : constructorFnOfParameters) {<NEW_LINE>arguments.add(<MASK><NEW_LINE>}<NEW_LINE>final List<TsStatement> body = new ArrayList<>();<NEW_LINE>body.add(new TsReturnStatement(new TsArrowFunction(Arrays.asList(new TsParameter("data", null)), new TsCallExpression(new TsMemberExpression(new TsTypeReferenceExpression(new TsType.ReferenceType(beanIdentifier)), "fromData"), null, arguments))));<NEW_LINE>return new TsMethodModel("fromDataFn", TsModifierFlags.None.setStatic(), typeParameters, constructorFnOfParameters, new TsType.FunctionType(Arrays.asList(new TsParameter("data", dataType)), dataType), body, null);<NEW_LINE>} | new TsIdentifierReference(constructorFnOfParameter.name)); |
1,733,415 | public MethodNode generate() {<NEW_LINE>int size = Bytecode.getArgsSize(this.argTypes) + this.returnType.getSize() + (this.targetIsStatic ? 0 : 1);<NEW_LINE>MethodNode method = this.createMethod(size, size);<NEW_LINE>if (!this.targetIsStatic) {<NEW_LINE>method.instructions.add(new VarInsnNode(Opcodes.ALOAD, 0));<NEW_LINE>}<NEW_LINE>Bytecode.loadArgs(this.argTypes, method.instructions, this.info.isStatic ? 0 : 1);<NEW_LINE>boolean isPrivate = Bytecode.hasFlag(this.targetMethod, Opcodes.ACC_PRIVATE);<NEW_LINE>int opcode = this.targetIsStatic ? Opcodes.INVOKESTATIC : (isPrivate ? Opcodes.INVOKESPECIAL : Opcodes.INVOKEVIRTUAL);<NEW_LINE>method.instructions.add(new MethodInsnNode(opcode, this.info.getClassNode().name, this.targetMethod.name, this.targetMethod.desc, false));<NEW_LINE>method.instructions.add(new InsnNode(this.returnType.<MASK><NEW_LINE>return method;<NEW_LINE>} | getOpcode(Opcodes.IRETURN))); |
107,339 | public static <T> T serializeObject(T o, ODatabaseObject db) {<NEW_LINE>if (o instanceof Proxy) {<NEW_LINE>final ODocument iRecord = getDocument((Proxy) o);<NEW_LINE>Class<?> pojoClass = o<MASK><NEW_LINE>invokeCallback(pojoClass, o, iRecord, OBeforeSerialization.class);<NEW_LINE>invokeCallback(pojoClass, o, iRecord, OAfterSerialization.class);<NEW_LINE>return o;<NEW_LINE>}<NEW_LINE>Proxy proxiedObject = (Proxy) db.newInstance(o.getClass());<NEW_LINE>try {<NEW_LINE>return toStream(o, proxiedObject, db);<NEW_LINE>} catch (IllegalArgumentException e) {<NEW_LINE>throw OException.wrapException(new OSerializationException("Error serializing object of class " + o.getClass()), e);<NEW_LINE>} catch (IllegalAccessException e) {<NEW_LINE>throw OException.wrapException(new OSerializationException("Error serializing object of class " + o.getClass()), e);<NEW_LINE>}<NEW_LINE>} | .getClass().getSuperclass(); |
147,108 | static void BuildLexStatesTable() {<NEW_LINE>Iterator<TokenProduction> it = rexprlist.iterator();<NEW_LINE>TokenProduction tp;<NEW_LINE>int i;<NEW_LINE>String[] tmpLexStateName = new String[lexstate_I2S.size()];<NEW_LINE>while (it.hasNext()) {<NEW_LINE>tp = it.next();<NEW_LINE>List<RegExprSpec> respecs = tp.respecs;<NEW_LINE>List<TokenProduction> tps;<NEW_LINE>for (i = 0; i < tp.lexStates.length; i++) {<NEW_LINE>if ((tps = (List<TokenProduction>) allTpsForState.get(tp.lexStates[i])) == null) {<NEW_LINE>tmpLexStateName[maxLexStates++] = tp.lexStates[i];<NEW_LINE>allTpsForState.put(tp.lexStates[i], tps = new ArrayList());<NEW_LINE>}<NEW_LINE>tps.add(tp);<NEW_LINE>}<NEW_LINE>if (respecs == null || respecs.size() == 0)<NEW_LINE>continue;<NEW_LINE>RegularExpression re;<NEW_LINE>for (i = 0; i < respecs.size(); i++) if (maxOrdinal <= (re = ((RegExprSpec) respecs.get(i)).rexp).ordinal)<NEW_LINE>maxOrdinal = re.ordinal + 1;<NEW_LINE>}<NEW_LINE>kinds = new int[maxOrdinal];<NEW_LINE>toSkip = new long[maxOrdinal / 64 + 1];<NEW_LINE>toSpecial = new long[maxOrdinal / 64 + 1];<NEW_LINE>toMore = new long[maxOrdinal / 64 + 1];<NEW_LINE>toToken = new <MASK><NEW_LINE>toToken[0] = 1L;<NEW_LINE>actions = new Action[maxOrdinal];<NEW_LINE>actions[0] = actForEof;<NEW_LINE>hasTokenActions = actForEof != null;<NEW_LINE>initStates = new Hashtable();<NEW_LINE>canMatchAnyChar = new int[maxLexStates];<NEW_LINE>canLoop = new boolean[maxLexStates];<NEW_LINE>stateHasActions = new boolean[maxLexStates];<NEW_LINE>lexStateName = new String[maxLexStates];<NEW_LINE>singlesToSkip = new NfaState[maxLexStates];<NEW_LINE>System.arraycopy(tmpLexStateName, 0, lexStateName, 0, maxLexStates);<NEW_LINE>for (i = 0; i < maxLexStates; i++) canMatchAnyChar[i] = -1;<NEW_LINE>hasNfa = new boolean[maxLexStates];<NEW_LINE>mixed = new boolean[maxLexStates];<NEW_LINE>maxLongsReqd = new int[maxLexStates];<NEW_LINE>initMatch = new int[maxLexStates];<NEW_LINE>newLexState = new String[maxOrdinal];<NEW_LINE>newLexState[0] = nextStateForEof;<NEW_LINE>hasEmptyMatch = false;<NEW_LINE>lexStates = new int[maxOrdinal];<NEW_LINE>ignoreCase = new boolean[maxOrdinal];<NEW_LINE>rexprs = new RegularExpression[maxOrdinal];<NEW_LINE>RStringLiteral.allImages = new String[maxOrdinal];<NEW_LINE>canReachOnMore = new boolean[maxLexStates];<NEW_LINE>} | long[maxOrdinal / 64 + 1]; |
1,272,406 | ActionResult<List<NameValueCountPair>> execute(EffectivePerson effectivePerson, String applicationFlag) throws Exception {<NEW_LINE>try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {<NEW_LINE>ActionResult<List<NameValueCountPair>> result = new ActionResult<>();<NEW_LINE>Business business = new Business(emc);<NEW_LINE>Application application = business.<MASK><NEW_LINE>String applicationId = (null != application) ? application.getId() : applicationFlag;<NEW_LINE>EntityManager em = business.entityManagerContainer().get(WorkCompleted.class);<NEW_LINE>CriteriaBuilder cb = em.getCriteriaBuilder();<NEW_LINE>CriteriaQuery<String> cq = cb.createQuery(String.class);<NEW_LINE>Root<WorkCompleted> root = cq.from(WorkCompleted.class);<NEW_LINE>Predicate p = cb.equal(root.get(WorkCompleted_.creatorPerson), effectivePerson.getDistinguishedName());<NEW_LINE>p = cb.and(p, cb.equal(root.get(WorkCompleted_.application), applicationId));<NEW_LINE>cq.select(root.get(WorkCompleted_.process)).where(p);<NEW_LINE>List<String> os = em.createQuery(cq).getResultList().stream().distinct().collect(Collectors.toList());<NEW_LINE>List<NameValueCountPair> wos = new ArrayList<>();<NEW_LINE>for (String str : os) {<NEW_LINE>NameValueCountPair o = new NameValueCountPair();<NEW_LINE>Process process = business.process().pick(str);<NEW_LINE>if (null != process) {<NEW_LINE>o.setValue(process.getId());<NEW_LINE>o.setName(process.getName());<NEW_LINE>} else {<NEW_LINE>o.setValue(str);<NEW_LINE>o.setName(str);<NEW_LINE>}<NEW_LINE>wos.add(o);<NEW_LINE>}<NEW_LINE>SortTools.asc(wos, "name");<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>} | application().pick(applicationFlag); |
60,207 | protected void openWorkbook(OutputStream os) throws JRException {<NEW_LINE>rendererToImagePathMap = new HashMap<>();<NEW_LINE>// imageMaps = new HashMap();<NEW_LINE>// hyperlinksMap = new HashMap();<NEW_LINE>definedNames = new StringBuilder();<NEW_LINE>sheetMapping = new HashMap<>();<NEW_LINE>try {<NEW_LINE>String memoryThreshold = jasperPrint.getPropertiesMap().getProperty(FileBufferedOutputStream.PROPERTY_MEMORY_THRESHOLD);<NEW_LINE>xlsxZip = new XlsxZip(jasperReportsContext, getRepository(), memoryThreshold == null ? null : JRPropertiesUtil.asInteger(memoryThreshold));<NEW_LINE>wbHelper = new XlsxWorkbookHelper(jasperReportsContext, xlsxZip.getWorkbookEntry().getWriter(), definedNames);<NEW_LINE>wbHelper.exportHeader();<NEW_LINE>relsHelper = new XlsxRelsHelper(jasperReportsContext, xlsxZip.getRelsEntry().getWriter());<NEW_LINE>ctHelper = new XlsxContentTypesHelper(jasperReportsContext, xlsxZip.getContentTypesEntry().getWriter());<NEW_LINE>appHelper = new PropsAppHelper(jasperReportsContext, xlsxZip.getAppEntry().getWriter());<NEW_LINE>coreHelper = new PropsCoreHelper(jasperReportsContext, xlsxZip.<MASK><NEW_LINE>XlsxExporterConfiguration configuration = getCurrentConfiguration();<NEW_LINE>String macro = macroTemplate == null ? configuration.getMacroTemplate() : macroTemplate;<NEW_LINE>if (macro != null) {<NEW_LINE>xlsxZip.addMacro(macro);<NEW_LINE>relsHelper.setContainsMacro(true);<NEW_LINE>ctHelper.setContainsMacro(true);<NEW_LINE>}<NEW_LINE>relsHelper.exportHeader();<NEW_LINE>ctHelper.exportHeader();<NEW_LINE>appHelper.exportHeader();<NEW_LINE>String application = configuration.getMetadataApplication();<NEW_LINE>if (application == null) {<NEW_LINE>application = "JasperReports Library version " + Package.getPackage("net.sf.jasperreports.engine").getImplementationVersion();<NEW_LINE>}<NEW_LINE>appHelper.exportProperty(PropsAppHelper.PROPERTY_APPLICATION, application);<NEW_LINE>coreHelper.exportHeader();<NEW_LINE>String title = configuration.getMetadataTitle();<NEW_LINE>if (title != null) {<NEW_LINE>coreHelper.exportProperty(PropsCoreHelper.PROPERTY_TITLE, title);<NEW_LINE>}<NEW_LINE>String subject = configuration.getMetadataSubject();<NEW_LINE>if (subject != null) {<NEW_LINE>coreHelper.exportProperty(PropsCoreHelper.PROPERTY_SUBJECT, subject);<NEW_LINE>}<NEW_LINE>String author = configuration.getMetadataAuthor();<NEW_LINE>if (author != null) {<NEW_LINE>coreHelper.exportProperty(PropsCoreHelper.PROPERTY_CREATOR, author);<NEW_LINE>}<NEW_LINE>String keywords = configuration.getMetadataKeywords();<NEW_LINE>if (keywords != null) {<NEW_LINE>coreHelper.exportProperty(PropsCoreHelper.PROPERTY_KEYWORDS, keywords);<NEW_LINE>}<NEW_LINE>styleHelper = new XlsxStyleHelper(jasperReportsContext, xlsxZip.getStylesEntry().getWriter(), getExporterKey());<NEW_LINE>firstPageNotSet = true;<NEW_LINE>firstSheetName = null;<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new JRException(e);<NEW_LINE>}<NEW_LINE>} | getCoreEntry().getWriter()); |
1,044,822 | private static boolean compilesWithFix(Fix fix, VisitorState state, ImmutableList<String> extraOptions, boolean onlyInSameCompilationUnit, int maxErrors, int maxWarnings) {<NEW_LINE>if (fix.isEmpty() && extraOptions.isEmpty()) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>FixCompiler fixCompiler;<NEW_LINE>try {<NEW_LINE>fixCompiler = FixCompiler.create(fix, state);<NEW_LINE>} catch (IOException e) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>Result compilationResult = fixCompiler.compile(extraOptions);<NEW_LINE>URI modifiedFileUri = FixCompiler.getModifiedFileUri(state);<NEW_LINE>// If we reached the maximum number of diagnostics of a given kind without finding one in the<NEW_LINE>// modified compilation unit, we won't find any more diagnostics, but we can't be sure that<NEW_LINE>// there isn't an diagnostic, as the diagnostic may simply be the (max+1)-th diagnostic, and<NEW_LINE>// thus was dropped.<NEW_LINE>int countErrors = 0;<NEW_LINE>int countWarnings = 0;<NEW_LINE>boolean warningIsError = false;<NEW_LINE>boolean warningInSameCompilationUnit = false;<NEW_LINE>for (Diagnostic<? extends JavaFileObject> diagnostic : compilationResult.diagnostics()) {<NEW_LINE>warningIsError |= diagnostic.<MASK><NEW_LINE>JavaFileObject diagnosticSource = diagnostic.getSource();<NEW_LINE>// If the source's origin is unknown, assume that new diagnostics are due to a modification.<NEW_LINE>boolean diagnosticInSameCompilationUnit = diagnosticSource == null || diagnosticSource.toUri().equals(modifiedFileUri);<NEW_LINE>switch(diagnostic.getKind()) {<NEW_LINE>case ERROR:<NEW_LINE>++countErrors;<NEW_LINE>if (!onlyInSameCompilationUnit || diagnosticInSameCompilationUnit) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case WARNING:<NEW_LINE>++countWarnings;<NEW_LINE>warningInSameCompilationUnit |= diagnosticInSameCompilationUnit;<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if ((warningIsError && warningInSameCompilationUnit) || (countErrors >= maxErrors) || (countWarnings >= maxWarnings)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | getCode().equals("compiler.err.warnings.and.werror"); |
251,624 | private void emitRow(@Nullable GenericRowData physicalKeyRow, @Nullable GenericRowData physicalValueRow) {<NEW_LINE>final RowKind rowKind;<NEW_LINE>if (physicalValueRow == null) {<NEW_LINE>if (upsertMode) {<NEW_LINE>rowKind = RowKind.DELETE;<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>rowKind = physicalValueRow.getRowKind();<NEW_LINE>}<NEW_LINE>final int metadataArity = metadataConverters.length;<NEW_LINE>final GenericRowData producedRow = new GenericRowData(rowKind, physicalArity + metadataArity);<NEW_LINE>if (physicalValueRow != null) {<NEW_LINE>for (int valuePos = 0; valuePos < valueProjection.length; valuePos++) {<NEW_LINE>producedRow.setField(valueProjection[valuePos], physicalValueRow.getField(valuePos));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (int keyPos = 0; keyPos < keyProjection.length; keyPos++) {<NEW_LINE>assert physicalKeyRow != null;<NEW_LINE>producedRow.setField(keyProjection[keyPos], physicalKeyRow.getField(keyPos));<NEW_LINE>}<NEW_LINE>for (int metadataPos = 0; metadataPos < metadataArity; metadataPos++) {<NEW_LINE>producedRow.setField(physicalArity + metadataPos, metadataConverters[metadataPos].read(inputMessage));<NEW_LINE>}<NEW_LINE>outputCollector.collect(producedRow);<NEW_LINE>} | throw new DeserializationException("Invalid null value received in non-upsert mode. " + "Could not to set row kind for output record."); |
1,519,077 | public static <T extends ServiceDefinition> void build(T sd, final Class<?> interfaceClass) {<NEW_LINE>sd.setCanonicalName(interfaceClass.getCanonicalName());<NEW_LINE>sd.setCodeSource(ClassUtils.getCodeSource(interfaceClass));<NEW_LINE>Annotation[] classAnnotations = interfaceClass.getAnnotations();<NEW_LINE>sd.setAnnotations(annotationToStringList(classAnnotations));<NEW_LINE>TypeDefinitionBuilder builder = new TypeDefinitionBuilder();<NEW_LINE>List<Method> methods = ClassUtils.getPublicNonStaticMethods(interfaceClass);<NEW_LINE>for (Method method : methods) {<NEW_LINE>MethodDefinition md = new MethodDefinition();<NEW_LINE>md.setName(method.getName());<NEW_LINE>Annotation[] methodAnnotations = method.getAnnotations();<NEW_LINE>md.setAnnotations(annotationToStringList(methodAnnotations));<NEW_LINE>// Process parameter types.<NEW_LINE>Class<?>[] paramTypes = method.getParameterTypes();<NEW_LINE>Type[] genericParamTypes = method.getGenericParameterTypes();<NEW_LINE>String[] parameterTypes = new String[paramTypes.length];<NEW_LINE>for (int i = 0; i < paramTypes.length; i++) {<NEW_LINE>TypeDefinition td = builder.build(genericParamTypes[i], paramTypes[i]);<NEW_LINE>parameterTypes[i] = td.getType();<NEW_LINE>}<NEW_LINE>md.setParameterTypes(parameterTypes);<NEW_LINE>// Process return type.<NEW_LINE>TypeDefinition td = builder.build(method.getGenericReturnType(), method.getReturnType());<NEW_LINE>md.setReturnType(td.getType());<NEW_LINE>sd.<MASK><NEW_LINE>}<NEW_LINE>sd.setTypes(builder.getTypeDefinitions());<NEW_LINE>} | getMethods().add(md); |
1,290,210 | protected void paint(Event event, Object element) {<NEW_LINE>Rectangle tableItem = getBounds(event.item, event.index);<NEW_LINE>boolean isSelected = (event.detail & SWT.SELECTED) != 0 || (event.detail & SWT.HOT) != 0;<NEW_LINE>if (!isSelected)<NEW_LINE>fillBackground(event, element, tableItem);<NEW_LINE>Long value = getValue(element);<NEW_LINE>if (value == null)<NEW_LINE>return;<NEW_LINE>Color oldForeground = null;<NEW_LINE>Color newForeground = isSelected ? null : getForeground(element);<NEW_LINE>if (newForeground != null) {<NEW_LINE>oldForeground = event.gc.getForeground();<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>String text = FormatHelper.getSharesFormat().format(value / Values.Share.divider());<NEW_LINE>Rectangle size = getSize(event, text);<NEW_LINE>TextLayout textLayout = getSharedTextLayout(event.display);<NEW_LINE>textLayout.setText(text);<NEW_LINE>Rectangle layoutBounds = textLayout.getBounds();<NEW_LINE>int x = event.x + tableItem.width - Math.min(size.width, tableItem.width);<NEW_LINE>int y = event.y + Math.max(0, (tableItem.height - layoutBounds.height) / 2);<NEW_LINE>textLayout.draw(event.gc, x, y);<NEW_LINE>if (oldForeground != null)<NEW_LINE>event.gc.setForeground(oldForeground);<NEW_LINE>} | event.gc.setForeground(newForeground); |
1,082,872 | public static MessageHandlerMethodFactory messageHandlerMethodFactory(@Qualifier(IntegrationContextUtils.ARGUMENT_RESOLVER_MESSAGE_CONVERTER_BEAN_NAME) CompositeMessageConverter compositeMessageConverter, @Nullable Validator validator, ConfigurableListableBeanFactory clbf) {<NEW_LINE>DefaultMessageHandlerMethodFactory messageHandlerMethodFactory = new DefaultMessageHandlerMethodFactory();<NEW_LINE>messageHandlerMethodFactory.setMessageConverter(compositeMessageConverter);<NEW_LINE>List<HandlerMethodArgumentResolver> resolvers = new LinkedList<>();<NEW_LINE>resolvers.add(new SmartPayloadArgumentResolver(compositeMessageConverter, validator));<NEW_LINE>resolvers.add(new SmartMessageMethodArgumentResolver(compositeMessageConverter));<NEW_LINE>resolvers.add(new HeaderMethodArgumentResolver(clbf<MASK><NEW_LINE>resolvers.add(new HeadersMethodArgumentResolver());<NEW_LINE>// Copy the order from Spring Integration for compatibility with SI 5.2<NEW_LINE>resolvers.add(new PayloadExpressionArgumentResolver());<NEW_LINE>resolvers.add(new NullAwarePayloadArgumentResolver(compositeMessageConverter));<NEW_LINE>PayloadExpressionArgumentResolver payloadExpressionArgumentResolver = new PayloadExpressionArgumentResolver();<NEW_LINE>payloadExpressionArgumentResolver.setBeanFactory(clbf);<NEW_LINE>resolvers.add(payloadExpressionArgumentResolver);<NEW_LINE>PayloadsArgumentResolver payloadsArgumentResolver = new PayloadsArgumentResolver();<NEW_LINE>payloadsArgumentResolver.setBeanFactory(clbf);<NEW_LINE>resolvers.add(payloadsArgumentResolver);<NEW_LINE>MapArgumentResolver mapArgumentResolver = new MapArgumentResolver();<NEW_LINE>mapArgumentResolver.setBeanFactory(clbf);<NEW_LINE>resolvers.add(mapArgumentResolver);<NEW_LINE>messageHandlerMethodFactory.setArgumentResolvers(resolvers);<NEW_LINE>messageHandlerMethodFactory.setValidator(validator);<NEW_LINE>return messageHandlerMethodFactory;<NEW_LINE>} | .getConversionService(), clbf)); |
953,183 | public void validate() throws WizardValidationException {<NEW_LINE>// XXX this is little strange. Since this method is called first time the panel appears.<NEW_LINE>// So we have to do this null check (data are uninitialized)<NEW_LINE>String prjFolder = getData().getProjectFolder();<NEW_LINE>if (prjFolder != null) {<NEW_LINE>File prjFolderF = new File(prjFolder);<NEW_LINE>String name = getData().getProjectName();<NEW_LINE>String pattern;<NEW_LINE>String forbiddenChars;<NEW_LINE>if (Utilities.isWindows()) {<NEW_LINE>// NOI18N<NEW_LINE>pattern = ".*[\\/:*?\"<>|].*";<NEW_LINE>// NOI18N<NEW_LINE>forbiddenChars = "\\ / : * ? \" < > |";<NEW_LINE>} else {<NEW_LINE>// NOI18N<NEW_LINE>pattern = ".*[\\/].*";<NEW_LINE>// NOI18N<NEW_LINE>forbiddenChars = "\\ /";<NEW_LINE>}<NEW_LINE>// #145574: check for forbidden characters in FolderObject<NEW_LINE>if (Pattern.matches(pattern, name)) {<NEW_LINE>String message = NbBundle.getMessage(BasicInfoWizardPanel.class, "MSG_ProjectFolderInvalidCharacters");<NEW_LINE>message = <MASK><NEW_LINE>throw new WizardValidationException(getVisualPanel().nameValue, message, message);<NEW_LINE>}<NEW_LINE>if (prjFolderF.mkdir()) {<NEW_LINE>prjFolderF.delete();<NEW_LINE>} else {<NEW_LINE>String message = NbBundle.getMessage(BasicInfoWizardPanel.class, "MSG_UnableToCreateProjectFolder");<NEW_LINE>throw new WizardValidationException(getVisualPanel().nameValue, message, message);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | String.format(message, forbiddenChars); |
497,638 | protected void showUrl(String url, boolean removeToolbar, LoadHandler onLoad) {<NEW_LINE>if (appFrame_ != null) {<NEW_LINE>// first set the frame to about:blank so that the<NEW_LINE>// javascript "unload" event is triggered (this is<NEW_LINE>// used by bookdown to save/restore scroll position)<NEW_LINE>appFrame_.setUrl("about:blank");<NEW_LINE>rootPanel_.remove(appFrame_);<NEW_LINE>appFrame_ = null;<NEW_LINE>}<NEW_LINE>int widgetTop = toolbar_.getHeight() + 1;<NEW_LINE>if (removeToolbar) {<NEW_LINE>rootPanel_.remove(toolbar_);<NEW_LINE>widgetTop = 0;<NEW_LINE>}<NEW_LINE>appFrame_ = createAppFrame(url);<NEW_LINE>appFrame_.setSize("100%", "100%");<NEW_LINE>glassPanel_ = new AutoGlassPanel(appFrame_);<NEW_LINE>rootPanel_.add(glassPanel_);<NEW_LINE>rootPanel_.setWidgetLeftRight(glassPanel_, 0, Unit.<MASK><NEW_LINE>rootPanel_.setWidgetTopBottom(glassPanel_, widgetTop, Unit.PX, 0, Unit.PX);<NEW_LINE>if (onLoad != null) {<NEW_LINE>// run supplied load handler if present<NEW_LINE>appFrame_.addLoadHandler(onLoad);<NEW_LINE>}<NEW_LINE>} | PX, 0, Unit.PX); |
1,752,724 | private void cmd_archive() {<NEW_LINE>boolean success = false;<NEW_LINE>byte[] data = getPDFAsArray(file);<NEW_LINE>MArchive arc = null;<NEW_LINE>if (data != null) {<NEW_LINE>PrintInfo printInfo = null;<NEW_LINE>if (null != processInfo) {<NEW_LINE>printInfo = new PrintInfo(processInfo);<NEW_LINE>}<NEW_LINE>if (null != printInfo) {<NEW_LINE>arc = new MArchive(Env.getCtx(), printInfo, null);<NEW_LINE>}<NEW_LINE>if (null != arc) {<NEW_LINE>arc.setBinaryData(data);<NEW_LINE>arc.setAD_Process_ID(processInfo.getAD_Process_ID());<NEW_LINE>arc.setRecord_ID(processInfo.getRecord_ID());<NEW_LINE>arc.setName(processInfo.getTitle());<NEW_LINE>success = arc.save();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (success) {<NEW_LINE>FDialog.info(0, this, Msg.getMsg(ctx, "ArchiveSuccess", new Object[] { arc.getName() }));<NEW_LINE>log.log(Level.FINE, arc.getName() + <MASK><NEW_LINE>archive.setDisabled(Boolean.TRUE);<NEW_LINE>} else {<NEW_LINE>throw new AdempiereException("ArchiveError");<NEW_LINE>}<NEW_LINE>} | " Archived Into " + arc.getAD_Archive_ID()); |
669,555 | private void lowerAtomicStoreIndexedNode(StoreAtomicIndexedNode storeIndexed) {<NEW_LINE>StructuredGraph graph = storeIndexed.graph();<NEW_LINE>JavaKind elementKind = storeIndexed.elementKind();<NEW_LINE>ValueNode value = storeIndexed.value();<NEW_LINE>ValueNode array = storeIndexed.array();<NEW_LINE><MASK><NEW_LINE>ATOMIC_OPERATION operation = ATOMIC_OPERATION.CUSTOM;<NEW_LINE>if (value instanceof TornadoReduceAddNode) {<NEW_LINE>operation = ATOMIC_OPERATION.ADD;<NEW_LINE>} else if (value instanceof TornadoReduceSubNode) {<NEW_LINE>operation = ATOMIC_OPERATION.SUB;<NEW_LINE>} else if (value instanceof TornadoReduceMulNode) {<NEW_LINE>operation = ATOMIC_OPERATION.MUL;<NEW_LINE>}<NEW_LINE>AddressNode address = createArrayAddress(graph, array, elementKind, storeIndexed.index());<NEW_LINE>OCLWriteAtomicNode memoryWrite = graph.add(new OCLWriteAtomicNode(address, NamedLocationIdentity.getArrayLocation(elementKind), value, OnHeapMemoryAccess.BarrierType.NONE, accumulator, accumulator.stamp(NodeView.DEFAULT), storeIndexed.elementKind(), operation));<NEW_LINE>memoryWrite.setStateAfter(storeIndexed.stateAfter());<NEW_LINE>graph.replaceFixedWithFixed(storeIndexed, memoryWrite);<NEW_LINE>} | ValueNode accumulator = storeIndexed.getAccumulator(); |
1,851,502 | private void analyzeStarrocksJarUdtf() throws AnalysisException {<NEW_LINE>{<NEW_LINE>// TYPE[] process(INPUT)<NEW_LINE>Method method = mainClass.getMethod(PROCESS_METHOD_NAME, true);<NEW_LINE>mainClass.checkMethodNonStaticAndPublic(method);<NEW_LINE>mainClass.checkArgumentCount(method, argsDef.getArgTypes().length);<NEW_LINE>for (int i = 0; i < method.getParameters().length; i++) {<NEW_LINE>Parameter p = method.getParameters()[i];<NEW_LINE>mainClass.checkUdfType(method, argsDef.getArgTypes()[i], p.getType(), p.getName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final List<Type> argList = Arrays.stream(argsDef.getArgTypes()).collect(Collectors.toList());<NEW_LINE>TableFunction tableFunction = new TableFunction(functionName, Lists.newArrayList(functionName.getFunction()), argList, Lists.newArrayList(returnType.getType()));<NEW_LINE>tableFunction.setBinaryType(TFunctionBinaryType.SRJAR);<NEW_LINE>tableFunction.setChecksum(checksum);<NEW_LINE>tableFunction.setLocation(new HdfsURI(objectFile));<NEW_LINE>tableFunction.<MASK><NEW_LINE>function = tableFunction;<NEW_LINE>} | setSymbolName(mainClass.getCanonicalName()); |
765,557 | public PrioritizeBusinessGoals unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>PrioritizeBusinessGoals prioritizeBusinessGoals = new PrioritizeBusinessGoals();<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("businessGoals", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>prioritizeBusinessGoals.setBusinessGoals(BusinessGoalsJsonUnmarshaller.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 prioritizeBusinessGoals;<NEW_LINE>} | JsonToken token = context.getCurrentToken(); |
1,309,139 | public static void componentRenamed(RADComponent metacomp, String oldName, String newName) {<NEW_LINE>ResourceSupport support = getResourceSupport(metacomp);<NEW_LINE>if (support.isAutoMode()) {<NEW_LINE>support.renameDefaultKeysForComponent(metacomp, null, null, oldName, newName, false);<NEW_LINE>}<NEW_LINE>// hack: 'name' property needs special treatment<NEW_LINE>FormProperty nameProp = getNameProperty(metacomp);<NEW_LINE>if (nameProp != null && nameProp.isChanged()) {<NEW_LINE>// boolean fire = nameProp.isChangeFiring();<NEW_LINE>// nameProp.setChangeFiring(false); // don't want to record this change for undo/redo<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>if (oldName.equals(name) && !name.equals(newName)) {<NEW_LINE>nameProp.setValue(newName);<NEW_LINE>}<NEW_LINE>} catch (Exception ex) {<NEW_LINE>// should not happen<NEW_LINE>ErrorManager.getDefault().notify(ErrorManager.INFORMATIONAL, ex);<NEW_LINE>}<NEW_LINE>// nameProp.setChangeFiring(fire);<NEW_LINE>}<NEW_LINE>} | Object name = nameProp.getValue(); |
839,688 | private static void exportMultiPointToJson(MultiPoint mpt, SpatialReference spatialReference, JsonWriter jsonWriter, Map<String, Object> exportProperties) {<NEW_LINE>boolean bExportZs = mpt.hasAttribute(Semantics.Z);<NEW_LINE>boolean bExportMs = mpt.hasAttribute(Semantics.M);<NEW_LINE>boolean bPositionAsF = false;<NEW_LINE>int decimals = 17;<NEW_LINE>if (exportProperties != null) {<NEW_LINE>Object numberOfDecimalsXY = exportProperties.get("numberOfDecimalsXY");<NEW_LINE>if (numberOfDecimalsXY != null && numberOfDecimalsXY instanceof Number) {<NEW_LINE>bPositionAsF = true;<NEW_LINE>decimals = ((Number) numberOfDecimalsXY).intValue();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>jsonWriter.startObject();<NEW_LINE>if (bExportZs) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (bExportMs) {<NEW_LINE>jsonWriter.addPairBoolean("hasM", true);<NEW_LINE>}<NEW_LINE>jsonWriter.addPairArray("points");<NEW_LINE>if (!mpt.isEmpty()) {<NEW_LINE>// get impl<NEW_LINE>MultiPointImpl mpImpl = (MultiPointImpl) mpt._getImpl();<NEW_LINE>// for<NEW_LINE>// faster<NEW_LINE>// access<NEW_LINE>AttributeStreamOfDbl zs = null;<NEW_LINE>AttributeStreamOfDbl ms = null;<NEW_LINE>if (bExportZs) {<NEW_LINE>zs = (AttributeStreamOfDbl) mpImpl.getAttributeStreamRef(Semantics.Z);<NEW_LINE>}<NEW_LINE>if (bExportMs) {<NEW_LINE>ms = (AttributeStreamOfDbl) mpImpl.getAttributeStreamRef(Semantics.M);<NEW_LINE>}<NEW_LINE>Point2D pt = new Point2D();<NEW_LINE>int n = mpt.getPointCount();<NEW_LINE>for (int i = 0; i < n; i++) {<NEW_LINE>mpt.getXY(i, pt);<NEW_LINE>jsonWriter.addValueArray();<NEW_LINE>if (bPositionAsF) {<NEW_LINE>jsonWriter.addValueDouble(pt.x, decimals, true);<NEW_LINE>jsonWriter.addValueDouble(pt.y, decimals, true);<NEW_LINE>} else {<NEW_LINE>jsonWriter.addValueDouble(pt.x);<NEW_LINE>jsonWriter.addValueDouble(pt.y);<NEW_LINE>}<NEW_LINE>if (bExportZs) {<NEW_LINE>double z = zs.get(i);<NEW_LINE>jsonWriter.addValueDouble(z);<NEW_LINE>}<NEW_LINE>if (bExportMs) {<NEW_LINE>double m = ms.get(i);<NEW_LINE>jsonWriter.addValueDouble(m);<NEW_LINE>}<NEW_LINE>jsonWriter.endArray();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>jsonWriter.endArray();<NEW_LINE>if (spatialReference != null) {<NEW_LINE>writeSR(spatialReference, jsonWriter);<NEW_LINE>}<NEW_LINE>jsonWriter.endObject();<NEW_LINE>} | jsonWriter.addPairBoolean("hasZ", true); |
321,963 | public Request<DescribePrefixListsRequest> marshall(DescribePrefixListsRequest describePrefixListsRequest) {<NEW_LINE>if (describePrefixListsRequest == null) {<NEW_LINE>throw new AmazonClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>Request<DescribePrefixListsRequest> request = new DefaultRequest<DescribePrefixListsRequest>(describePrefixListsRequest, "AmazonEC2");<NEW_LINE>request.addParameter("Action", "DescribePrefixLists");<NEW_LINE><MASK><NEW_LINE>java.util.List<String> prefixListIdsList = describePrefixListsRequest.getPrefixListIds();<NEW_LINE>int prefixListIdsListIndex = 1;<NEW_LINE>for (String prefixListIdsListValue : prefixListIdsList) {<NEW_LINE>if (prefixListIdsListValue != null) {<NEW_LINE>request.addParameter("PrefixListId." + prefixListIdsListIndex, StringUtils.fromString(prefixListIdsListValue));<NEW_LINE>}<NEW_LINE>prefixListIdsListIndex++;<NEW_LINE>}<NEW_LINE>java.util.List<Filter> filtersList = describePrefixListsRequest.getFilters();<NEW_LINE>int filtersListIndex = 1;<NEW_LINE>for (Filter filtersListValue : filtersList) {<NEW_LINE>Filter filterMember = filtersListValue;<NEW_LINE>if (filterMember != null) {<NEW_LINE>if (filterMember.getName() != null) {<NEW_LINE>request.addParameter("Filter." + filtersListIndex + ".Name", StringUtils.fromString(filterMember.getName()));<NEW_LINE>}<NEW_LINE>java.util.List<String> valuesList = filterMember.getValues();<NEW_LINE>int valuesListIndex = 1;<NEW_LINE>for (String valuesListValue : valuesList) {<NEW_LINE>if (valuesListValue != null) {<NEW_LINE>request.addParameter("Filter." + filtersListIndex + ".Value." + valuesListIndex, StringUtils.fromString(valuesListValue));<NEW_LINE>}<NEW_LINE>valuesListIndex++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>filtersListIndex++;<NEW_LINE>}<NEW_LINE>if (describePrefixListsRequest.getMaxResults() != null) {<NEW_LINE>request.addParameter("MaxResults", StringUtils.fromInteger(describePrefixListsRequest.getMaxResults()));<NEW_LINE>}<NEW_LINE>if (describePrefixListsRequest.getNextToken() != null) {<NEW_LINE>request.addParameter("NextToken", StringUtils.fromString(describePrefixListsRequest.getNextToken()));<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>} | request.addParameter("Version", "2015-10-01"); |
934,272 | public boolean test() {<NEW_LINE>final Request request = prepareRequest(client, 12);<NEW_LINE>try {<NEW_LINE>request.addMessageObserver(new EndpointContextTracer() {<NEW_LINE><NEW_LINE>private final AtomicBoolean ready = new AtomicBoolean();<NEW_LINE><NEW_LINE>private final AtomicInteger counter = new AtomicInteger();<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onReadyToSend() {<NEW_LINE>if (ready.compareAndSet(false, true)) {<NEW_LINE>LOGGER.info("Request:{}{}", StringUtil.lineSeparator(), Utils.prettyPrint(request));<NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onConnecting() {<NEW_LINE>LOGGER.info(">>> CONNECTING <<<");<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onDtlsRetransmission(int flight) {<NEW_LINE>LOGGER.info(">>> DTLS retransmission, flight {}", flight);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onRetransmission() {<NEW_LINE>int count = counter.incrementAndGet();<NEW_LINE>LOGGER.info("Request: {} retransmissions{}{}", count, StringUtil.lineSeparator(), Utils.prettyPrint(request));<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected void onContextChanged(EndpointContext endpointContext) {<NEW_LINE>LOGGER.info("{}", Utils.prettyPrint(endpointContext));<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onAcknowledgement() {<NEW_LINE>LOGGER.info(">>> ACK <<<");<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onTimeout() {<NEW_LINE>LOGGER.info(">>> TIMEOUT <<<");<NEW_LINE>}<NEW_LINE>});<NEW_LINE>CoapResponse response = null;<NEW_LINE>;<NEW_LINE>if (request.isObserve()) {<NEW_LINE>clientObserveRelation = client.observeAndWait(new TestHandler(request));<NEW_LINE>response = clientObserveRelation.getCurrent();<NEW_LINE>} else {<NEW_LINE>response = client.advanced(request);<NEW_LINE>}<NEW_LINE>if (response != null) {<NEW_LINE>addToStatistic(response);<NEW_LINE>if (response.isSuccess()) {<NEW_LINE>if (LOGGER.isInfoEnabled()) {<NEW_LINE>LOGGER.info("Received response:{}{}", StringUtil.lineSeparator(), Utils.prettyPrint(response));<NEW_LINE>}<NEW_LINE>clientCounter.incrementAndGet();<NEW_LINE>checkReady(true, true);<NEW_LINE>return true;<NEW_LINE>} else {<NEW_LINE>LOGGER.warn("Received error response: {} - {}", response.getCode(), response.getResponseText());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>LOGGER.warn("Received no response!");<NEW_LINE>}<NEW_LINE>} catch (Exception ex) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | LOGGER.warn("Test failed!", ex); |
1,700,427 | public InternalAggregation doReduce(List<InternalAggregation> aggregations, ReduceContext reduceContext) {<NEW_LINE>reduceContext.consumeBucketsAndMaybeBreak(buckets.size());<NEW_LINE>long[] docCounts = new long[buckets.size()];<NEW_LINE>InternalAggregations[][] aggs = new InternalAggregations[buckets.size()][];<NEW_LINE>for (int i = 0; i < aggs.length; ++i) {<NEW_LINE>aggs[i] = new InternalAggregations[aggregations.size()];<NEW_LINE>}<NEW_LINE>for (int i = 0; i < aggregations.size(); ++i) {<NEW_LINE>InternalBinaryRange range = (InternalBinaryRange) aggregations.get(i);<NEW_LINE>if (range.buckets.size() != buckets.size()) {<NEW_LINE>throw new IllegalStateException("Expected [" + buckets.size() + "] buckets, but got [" + range.buckets.size() + "]");<NEW_LINE>}<NEW_LINE>for (int j = 0; j < buckets.size(); ++j) {<NEW_LINE>Bucket bucket = range.buckets.get(j);<NEW_LINE>docCounts[j] += bucket.docCount;<NEW_LINE>aggs[j][i] = bucket.aggregations;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>List<Bucket> buckets = new ArrayList<>(<MASK><NEW_LINE>for (int i = 0; i < this.buckets.size(); ++i) {<NEW_LINE>Bucket b = this.buckets.get(i);<NEW_LINE>buckets.add(new Bucket(format, keyed, b.key, b.from, b.to, docCounts[i], InternalAggregations.reduce(Arrays.asList(aggs[i]), reduceContext)));<NEW_LINE>}<NEW_LINE>return new InternalBinaryRange(name, format, keyed, buckets, pipelineAggregators(), metaData);<NEW_LINE>} | this.buckets.size()); |
472,233 | public void aggregateGroupBySV(int length, int[] groupKeyArray, GroupByResultHolder groupByResultHolder, Map<ExpressionContext, BlockValSet> blockValSetMap) {<NEW_LINE>BlockValSet blockValSet = blockValSetMap.get(_expression);<NEW_LINE>if (blockValSet.getValueType() != DataType.BYTES) {<NEW_LINE>long[<MASK><NEW_LINE>for (int i = 0; i < length; i++) {<NEW_LINE>getDefaultQuantileDigest(groupByResultHolder, groupKeyArray[i]).add(longValues[i]);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// Serialized QuantileDigest<NEW_LINE>byte[][] bytesValues = blockValSet.getBytesValuesSV();<NEW_LINE>for (int i = 0; i < length; i++) {<NEW_LINE>QuantileDigest value = ObjectSerDeUtils.QUANTILE_DIGEST_SER_DE.deserialize(bytesValues[i]);<NEW_LINE>int groupKey = groupKeyArray[i];<NEW_LINE>QuantileDigest quantileDigest = groupByResultHolder.getResult(groupKey);<NEW_LINE>if (quantileDigest != null) {<NEW_LINE>quantileDigest.merge(value);<NEW_LINE>} else {<NEW_LINE>groupByResultHolder.setValueForKey(groupKey, value);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ] longValues = blockValSet.getLongValuesSV(); |
934,549 | private final void initLanguageResources() {<NEW_LINE>languageResources = new TreeMap<String, List<String>>();<NEW_LINE>for (String language : languages) {<NEW_LINE>// opening the corresponding language resource file<NEW_LINE>String path = GrobidProperties.getGrobidHomePath() + "/lexicon/patent/" + language + ".local";<NEW_LINE>File localFile = new File(path);<NEW_LINE>if (!localFile.exists()) {<NEW_LINE>throw new GrobidResourceException("Cannot add language resources for patent processing (language '" + language + "'), because file '" + localFile.getAbsolutePath() + "' does not exists.");<NEW_LINE>}<NEW_LINE>if (!localFile.canRead()) {<NEW_LINE>throw new GrobidResourceException("Cannot add language resources for patent processing (language '" + language + "'), because cannot read file '" + localFile.getAbsolutePath() + "'.");<NEW_LINE>}<NEW_LINE>InputStream ist = null;<NEW_LINE>InputStreamReader isr = null;<NEW_LINE>BufferedReader dis = null;<NEW_LINE>try {<NEW_LINE>ist = new FileInputStream(localFile);<NEW_LINE>isr = new InputStreamReader(ist, "UTF8");<NEW_LINE>dis = new BufferedReader(isr);<NEW_LINE>String l = null;<NEW_LINE>while ((l = dis.readLine()) != null) {<NEW_LINE>if (l.length() == 0)<NEW_LINE>continue;<NEW_LINE>// the first token, separated by a '=', gives the authority name<NEW_LINE>String[] parts = l.split("=");<NEW_LINE>String authority = parts[0].trim();<NEW_LINE>// this will cover authority as well as some other patterns such as publication, application, ...<NEW_LINE>String expressions = parts[1].trim();<NEW_LINE>if (expressions.trim().length() > 0) {<NEW_LINE>String[] subparts = expressions.split(",");<NEW_LINE>List<String> listExpressions = new ArrayList<String>();<NEW_LINE>for (int i = 0; i < subparts.length; i++) {<NEW_LINE>listExpressions.add(subparts[i].trim());<NEW_LINE>}<NEW_LINE>languageResources.put(language + authority, listExpressions);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (FileNotFoundException e) {<NEW_LINE><MASK><NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new GrobidException("An exception occured while running Grobid.", e);<NEW_LINE>} finally {<NEW_LINE>IOUtils.closeQuietly(ist, isr, dis);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | throw new GrobidException("An exception occured while running Grobid.", e); |
1,240,444 | public Point scalePoint(Point p) {<NEW_LINE>if (image == null) {<NEW_LINE>return new Point(0, 0);<NEW_LINE>}<NEW_LINE>Insets ins = getInsets();<NEW_LINE>double sourceWidth = image.getWidth();<NEW_LINE>double sourceHeight = image.getHeight();<NEW_LINE>double destWidth = getWidth() - ins.left - ins.right;<NEW_LINE>double destHeight = getHeight() - ins.top - ins.bottom;<NEW_LINE>double widthRatio = sourceWidth / destWidth;<NEW_LINE>double heightRatio = sourceHeight / destHeight;<NEW_LINE>double scaledHeight, scaledWidth;<NEW_LINE>if (heightRatio > widthRatio) {<NEW_LINE>double aspectRatio = sourceWidth / sourceHeight;<NEW_LINE>scaledHeight = destHeight;<NEW_LINE>scaledWidth = (scaledHeight * aspectRatio);<NEW_LINE>} else {<NEW_LINE>double aspectRatio = sourceHeight / sourceWidth;<NEW_LINE>scaledWidth = destWidth;<NEW_LINE>scaledHeight = (scaledWidth * aspectRatio);<NEW_LINE>}<NEW_LINE>int imageX = (int) (ins.left + (destWidth / 2) - (scaledWidth / 2));<NEW_LINE>int imageY = (int) (ins.top + (destHeight / 2) - (scaledHeight / 2));<NEW_LINE>int x = (int) ((p.x - imageX) * (sourceWidth / scaledWidth));<NEW_LINE>int y = (int) ((p.y - imageY) * (sourceHeight / scaledHeight));<NEW_LINE>x = Math.max(x, 0);<NEW_LINE>x = Math.min(x, image.getWidth());<NEW_LINE>y = Math.max(y, 0);<NEW_LINE>y = Math.min(y, image.getHeight());<NEW_LINE><MASK><NEW_LINE>} | return new Point(x, y); |
921,093 | protected void prepare() {<NEW_LINE>ProcessInfoParameter[] para = getParameter();<NEW_LINE>for (int i = 0; i < para.length; i++) {<NEW_LINE>String name = <MASK><NEW_LINE>if (para[i].getParameter() == null)<NEW_LINE>;<NEW_LINE>else if (name.equals("C_AcctSchema_ID"))<NEW_LINE>p_C_AcctSchema_ID = ((BigDecimal) para[i].getParameter()).intValue();<NEW_LINE>else if (name.equals("C_ConversionType_ID"))<NEW_LINE>p_C_ConversionType_ID = ((BigDecimal) para[i].getParameter()).intValue();<NEW_LINE>else if (name.equals("StatementDate"))<NEW_LINE>p_StatementDate = (Timestamp) para[i].getParameter();<NEW_LINE>else if (name.equals("IsSOTrx") && para[i].getParameter() != null)<NEW_LINE>p_IsSOTrx = (String) para[i].getParameter();<NEW_LINE>else if (name.equals("C_Currency_ID"))<NEW_LINE>p_C_Currency_ID = ((BigDecimal) para[i].getParameter()).intValue();<NEW_LINE>else if (name.equals("AD_Org_ID"))<NEW_LINE>p_AD_Org_ID = ((BigDecimal) para[i].getParameter()).intValue();<NEW_LINE>else if (name.equals("C_BP_Group_ID"))<NEW_LINE>p_C_BP_Group_ID = ((BigDecimal) para[i].getParameter()).intValue();<NEW_LINE>else if (name.equals("C_BPartner_ID"))<NEW_LINE>p_C_BPartner_ID = ((BigDecimal) para[i].getParameter()).intValue();<NEW_LINE>else if (name.equals("ListSources"))<NEW_LINE>p_ListSources = "Y".equals(para[i].getParameter());<NEW_LINE>else if (name.equals("IsIncludePayments"))<NEW_LINE>p_IncludePayments = "Y".equals(para[i].getParameter());<NEW_LINE>else<NEW_LINE>log.log(Level.SEVERE, "Unknown Parameter: " + name);<NEW_LINE>}<NEW_LINE>// get currency_id for account schema<NEW_LINE>final MAcctSchema as = MAcctSchema.get(getCtx(), p_C_AcctSchema_ID);<NEW_LINE>as_C_Currency_ID = as.getC_Currency_ID();<NEW_LINE>if (p_StatementDate == null)<NEW_LINE>p_StatementDate = new Timestamp(System.currentTimeMillis());<NEW_LINE>else<NEW_LINE>m_statementOffset = TimeUtil.getDaysBetween(new Timestamp(System.currentTimeMillis()), p_StatementDate);<NEW_LINE>} | para[i].getParameterName(); |
1,824,554 | private boolean areThereNewFiles(final File installLocation) throws IOException {<NEW_LINE>LogManager.log("areThereNewFiles: location " + installLocation);<NEW_LINE>Set<File> installedFiles = new HashSet<File>();<NEW_LINE>Set<File> existentFilesList = FileUtils.getRecursiveFileSet(installLocation);<NEW_LINE>for (Product product : Registry.getInstance().getProductsToUninstall()) {<NEW_LINE>LogManager.log("Taking product " + product.getUid());<NEW_LINE>if (product.getUid().startsWith("nb-")) {<NEW_LINE>// load the installed files list for this product<NEW_LINE>try {<NEW_LINE>File installedFilesList = product.getInstalledFilesList();<NEW_LINE>if (installedFilesList.exists()) {<NEW_LINE>FilesList list = new FilesList().loadXmlGz(installedFilesList);<NEW_LINE>LogManager.log("loading files list for " + product.getUid());<NEW_LINE>installedFiles.addAll(list.toList());<NEW_LINE>}<NEW_LINE>} catch (XMLException e) {<NEW_LINE>LogManager.log(ErrorLevel.WARNING, <MASK><NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// add all updated files and downloaded plugins<NEW_LINE>installedFiles.addAll(UninstallUtils.getFilesToDeteleAfterUninstallation());<NEW_LINE>existentFilesList.removeAll(installedFiles);<NEW_LINE>// remove folders - there still might be some empty folders<NEW_LINE>Iterator<File> eflIterator = existentFilesList.iterator();<NEW_LINE>while (eflIterator.hasNext()) {<NEW_LINE>if (eflIterator.next().isDirectory()) {<NEW_LINE>eflIterator.remove();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>boolean result = !existentFilesList.isEmpty();<NEW_LINE>LogManager.log(ErrorLevel.DEBUG, "installedFiles " + Arrays.toString(installedFiles.toArray()));<NEW_LINE>LogManager.log(ErrorLevel.DEBUG, "existentFilesList after removal " + Arrays.toString(existentFilesList.toArray()));<NEW_LINE>LogManager.log("areThereNewFiles returned " + result);<NEW_LINE>return result;<NEW_LINE>} | "Error loading file list for " + product.getUid()); |
396,667 | public ProcessContext<CartOperationRequest> execute(ProcessContext<CartOperationRequest> context) throws Exception {<NEW_LINE><MASK><NEW_LINE>OrderItemRequestDTO orderItemRequestDTO = request.getItemRequest();<NEW_LINE>if (orderItemRequestDTO instanceof NonDiscreteOrderItemRequestDTO) {<NEW_LINE>return context;<NEW_LINE>}<NEW_LINE>Sku sku;<NEW_LINE>Long orderItemId = request.getItemRequest().getOrderItemId();<NEW_LINE>OrderItem orderItem = orderItemService.readOrderItemById(orderItemId);<NEW_LINE>if (orderItem instanceof DiscreteOrderItem) {<NEW_LINE>sku = ((DiscreteOrderItem) orderItem).getSku();<NEW_LINE>} else if (orderItem instanceof BundleOrderItem) {<NEW_LINE>sku = ((BundleOrderItem) orderItem).getSku();<NEW_LINE>} else {<NEW_LINE>LOG.warn("Could not check availability; did not recognize passed-in item " + orderItem.getClass().getName());<NEW_LINE>return context;<NEW_LINE>}<NEW_LINE>Order order = context.getSeedData().getOrder();<NEW_LINE>Integer requestedQuantity = request.getItemRequest().getQuantity();<NEW_LINE>Map<Sku, Integer> skuItems = new HashMap<>();<NEW_LINE>for (OrderItem orderItemFromOrder : order.getOrderItems()) {<NEW_LINE>Sku skuFromOrder = null;<NEW_LINE>if (orderItemFromOrder instanceof DiscreteOrderItem) {<NEW_LINE>skuFromOrder = ((DiscreteOrderItem) orderItemFromOrder).getSku();<NEW_LINE>} else if (orderItemFromOrder instanceof BundleOrderItem) {<NEW_LINE>skuFromOrder = ((BundleOrderItem) orderItemFromOrder).getSku();<NEW_LINE>}<NEW_LINE>if (skuFromOrder != null && skuFromOrder.equals(sku) && !orderItemFromOrder.equals(orderItem)) {<NEW_LINE>skuItems.merge(sku, orderItemFromOrder.getQuantity(), (oldVal, newVal) -> oldVal + newVal);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>skuItems.merge(sku, requestedQuantity, (oldVal, newVal) -> oldVal + newVal);<NEW_LINE>for (Map.Entry<Sku, Integer> entry : skuItems.entrySet()) {<NEW_LINE>checkSkuAvailability(order, entry.getKey(), entry.getValue());<NEW_LINE>}<NEW_LINE>Integer previousQty = orderItem.getQuantity();<NEW_LINE>for (OrderItem child : orderItem.getChildOrderItems()) {<NEW_LINE>Sku childSku = ((DiscreteOrderItem) child).getSku();<NEW_LINE>Integer childQuantity = child.getQuantity();<NEW_LINE>childQuantity = childQuantity / previousQty;<NEW_LINE>checkSkuAvailability(order, childSku, childQuantity * requestedQuantity);<NEW_LINE>}<NEW_LINE>return context;<NEW_LINE>} | CartOperationRequest request = context.getSeedData(); |
377,397 | public void update(EventBean[] newData, EventBean[] oldData) {<NEW_LINE>agentInstanceContext.getInstrumentationProvider().qInfraOnAction(OnTriggerType.ON_MERGE, newData, CollectionUtil.EVENTBEANARRAY_EMPTY);<NEW_LINE>if (newData == null) {<NEW_LINE>agentInstanceContext.getInstrumentationProvider().aInfraOnAction();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>OneEventCollection newColl = new OneEventCollection();<NEW_LINE>// first:named window, second: trigger, third:before-update (optional)<NEW_LINE>EventBean[] eventsPerStream = new EventBean[3];<NEW_LINE>for (EventBean trigger : newData) {<NEW_LINE>eventsPerStream[1] = trigger;<NEW_LINE>factory.getOnMergeHelper().getInsertUnmatched().apply(null, eventsPerStream, newColl, null, agentInstanceContext);<NEW_LINE>OnExprViewNamedWindowMerge.applyDelta(newColl, null, factory, rootView, agentInstanceContext, this);<NEW_LINE>newColl.clear();<NEW_LINE>}<NEW_LINE>agentInstanceContext<MASK><NEW_LINE>} | .getInstrumentationProvider().aInfraOnAction(); |
1,448,738 | public void updateFilters() {<NEW_LINE>updateList(R.id.domainlist, SettingValues.domainFilters, SettingValues.domainFilters::remove);<NEW_LINE>updateList(R.id.subredditlist, SettingValues.subredditFilters, SettingValues.subredditFilters::remove);<NEW_LINE>updateList(R.id.userlist, SettingValues.userFilters, SettingValues.userFilters::remove);<NEW_LINE>updateList(R.id.selftextlist, SettingValues.<MASK><NEW_LINE>updateList(R.id.titlelist, SettingValues.titleFilters, SettingValues.titleFilters::remove);<NEW_LINE>((LinearLayout) findViewById(R.id.flairlist)).removeAllViews();<NEW_LINE>for (String s : SettingValues.flairFilters) {<NEW_LINE>final View t = getLayoutInflater().inflate(R.layout.account_textview, (LinearLayout) findViewById(R.id.domainlist), false);<NEW_LINE>SpannableStringBuilder b = new SpannableStringBuilder();<NEW_LINE>String subname = s.split(":")[0];<NEW_LINE>SpannableStringBuilder subreddit = new SpannableStringBuilder(" /r/" + subname + " ");<NEW_LINE>if ((SettingValues.colorSubName && Palette.getColor(subname) != Palette.getDefaultColor())) {<NEW_LINE>subreddit.setSpan(new ForegroundColorSpan(Palette.getColor(subname)), 0, subreddit.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);<NEW_LINE>subreddit.setSpan(new StyleSpan(Typeface.BOLD), 0, subreddit.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);<NEW_LINE>}<NEW_LINE>b.append(subreddit).append(s.split(":")[1]);<NEW_LINE>((TextView) t.findViewById(R.id.name)).setText(b);<NEW_LINE>t.findViewById(R.id.remove).setOnClickListener(v -> {<NEW_LINE>SettingValues.flairFilters.remove(s);<NEW_LINE>updateFilters();<NEW_LINE>});<NEW_LINE>((LinearLayout) findViewById(R.id.flairlist)).addView(t);<NEW_LINE>}<NEW_LINE>} | textFilters, SettingValues.textFilters::remove); |
1,133,785 | private void readTables(Schema schema, ResultSet rsTable) throws SQLException {<NEW_LINE>if (SHOW_METADATA) {<NEW_LINE>final ResultSetMetaData rsmd = rsTable.getMetaData();<NEW_LINE>int numberOfColumns = rsmd.getColumnCount();<NEW_LINE>for (int x = 1; x <= numberOfColumns; x++) {<NEW_LINE>LOGGER.debug(rsmd.getColumnName(x) + ", " + rsmd.getColumnClassName(x) + ", " + rsmd.getColumnType(x));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>while (rsTable.next()) {<NEW_LINE>if (SHOW_METADATA) {<NEW_LINE>final ResultSetMetaData rsmd = rsTable.getMetaData();<NEW_LINE>int numberOfColumns = rsmd.getColumnCount();<NEW_LINE>for (int x = 1; x <= numberOfColumns; x++) {<NEW_LINE>LOGGER.debug(rsmd.getColumnName(x) + ":'" + rsTable.getObject(x) + "'");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final Table table = schema.mutator().addNewTable();<NEW_LINE>final String tableName = rsTable.getString("TABLE_NAME");<NEW_LINE>final String tableType = rsTable.getString("TABLE_TYPE");<NEW_LINE>table.mutator().setId(tableName);<NEW_LINE>table.<MASK><NEW_LINE>table.mutator().setView("VIEW".equals(tableType));<NEW_LINE>extraInfo("readTables(%s, ...) read %s", schema.getId(), table);<NEW_LINE>}<NEW_LINE>} | mutator().setName(tableName); |
1,641,632 | public int compare(Integer head1, Integer head2) {<NEW_LINE>if (head1.equals(head2)) {<NEW_LINE>return 0;<NEW_LINE>}<NEW_LINE>VcsRef ref1 = myRefsModel.bestRefToHead(head1);<NEW_LINE>VcsRef <MASK><NEW_LINE>if (ref1 == null) {<NEW_LINE>reportNoRefs(head1);<NEW_LINE>if (ref2 == null) {<NEW_LINE>reportNoRefs(head2);<NEW_LINE>return head1 - head2;<NEW_LINE>}<NEW_LINE>return 1;<NEW_LINE>}<NEW_LINE>if (ref2 == null) {<NEW_LINE>reportNoRefs(head2);<NEW_LINE>return -1;<NEW_LINE>}<NEW_LINE>if (ref1.equals(ref2)) {<NEW_LINE>LOG.warn("Different heads " + myHashGetter.fun(head1) + " and " + myHashGetter.fun(head2) + " contain the same reference " + ref1);<NEW_LINE>}<NEW_LINE>VirtualFile root1 = ref1.getRoot();<NEW_LINE>VirtualFile root2 = ref2.getRoot();<NEW_LINE>VcsLogRefManager refManager1 = myRefManagers.get(root1);<NEW_LINE>VcsLogRefManager refManager2 = myRefManagers.get(root2);<NEW_LINE>if (!refManager1.equals(refManager2)) {<NEW_LINE>return refManager1.toString().compareTo(refManager2.toString());<NEW_LINE>}<NEW_LINE>return refManager1.getBranchLayoutComparator().compare(ref1, ref2);<NEW_LINE>} | ref2 = myRefsModel.bestRefToHead(head2); |
1,244,745 | public void run() {<NEW_LINE>logger.info("Starting server.");<NEW_LINE>InetAddress localAddr = MaryProperties.needInetAddress("socket.addr");<NEW_LINE>int localPort = MaryProperties.needInteger("socket.port");<NEW_LINE>HttpParams params = new BasicHttpParams();<NEW_LINE>// 0 means no timeout, any positive value means time out in miliseconds (i.e. 50000 for 50 seconds)<NEW_LINE>params.setIntParameter(CoreConnectionPNames.SO_TIMEOUT, 0).setIntParameter(CoreConnectionPNames.SOCKET_BUFFER_SIZE, 8 * 1024).setBooleanParameter(CoreConnectionPNames.STALE_CONNECTION_CHECK, false).setBooleanParameter(CoreConnectionPNames.TCP_NODELAY, true).setParameter(CoreProtocolPNames.ORIGIN_SERVER, "HttpComponents/1.1");<NEW_LINE>BasicHttpProcessor httpproc = new BasicHttpProcessor();<NEW_LINE>httpproc.addInterceptor(new ResponseDate());<NEW_LINE>httpproc.addInterceptor(new ResponseServer());<NEW_LINE>httpproc.addInterceptor(new ResponseContent());<NEW_LINE>httpproc.addInterceptor(new ResponseConnControl());<NEW_LINE>BufferingHttpServiceHandler handler = new BufferingHttpServiceHandler(httpproc, new DefaultHttpResponseFactory(), new DefaultConnectionReuseStrategy(), params);<NEW_LINE>// Set up request handlers<NEW_LINE>HttpRequestHandlerRegistry registry = new HttpRequestHandlerRegistry();<NEW_LINE>registry.register("/process", new SynthesisRequestHandler());<NEW_LINE>InfoRequestHandler infoRH = new InfoRequestHandler();<NEW_LINE>registry.register("/version", infoRH);<NEW_LINE>registry.register("/datatypes", infoRH);<NEW_LINE>registry.register("/locales", infoRH);<NEW_LINE>registry.register("/voices", infoRH);<NEW_LINE>registry.register("/audioformats", infoRH);<NEW_LINE>registry.register("/exampletext", infoRH);<NEW_LINE>registry.register("/audioeffects", infoRH);<NEW_LINE>registry.register("/audioeffect-default-param", infoRH);<NEW_LINE>registry.register("/audioeffect-full", infoRH);<NEW_LINE>registry.register("/audioeffect-help", infoRH);<NEW_LINE>registry.register("/audioeffect-is-hmm-effect", infoRH);<NEW_LINE><MASK><NEW_LINE>registry.register("/features-discrete", infoRH);<NEW_LINE>registry.register("/vocalizations", infoRH);<NEW_LINE>registry.register("/styles", infoRH);<NEW_LINE>registry.register("*", new FileRequestHandler());<NEW_LINE>handler.setHandlerResolver(registry);<NEW_LINE>// Provide an event logger<NEW_LINE>handler.setEventListener(new EventLogger());<NEW_LINE>IOEventDispatch ioEventDispatch = new DefaultServerIOEventDispatch(handler, params);<NEW_LINE>int numParallelThreads = MaryProperties.getInteger("server.http.parallelthreads", 5);<NEW_LINE>logger.info("Waiting for client to connect on port " + localPort);<NEW_LINE>try {<NEW_LINE>ListeningIOReactor ioReactor = new DefaultListeningIOReactor(numParallelThreads, params);<NEW_LINE>ioReactor.listen(new InetSocketAddress(localAddr, localPort));<NEW_LINE>isReady = true;<NEW_LINE>ioReactor.execute(ioEventDispatch);<NEW_LINE>} catch (InterruptedIOException ex) {<NEW_LINE>logger.info("Interrupted", ex);<NEW_LINE>} catch (IOException e) {<NEW_LINE>logger.info("Problem with HTTP connection", e);<NEW_LINE>}<NEW_LINE>logger.debug("Shutdown");<NEW_LINE>} | registry.register("/features", infoRH); |
1,502,303 | public void onError(java.lang.Exception e) {<NEW_LINE>byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;<NEW_LINE>org.apache.thrift.TSerializable msg;<NEW_LINE>startUpdate_result result = new startUpdate_result();<NEW_LINE>if (e instanceof org.apache.accumulo.core.clientImpl.thrift.ThriftSecurityException) {<NEW_LINE>result.sec = (org.apache.accumulo.core.clientImpl.thrift.ThriftSecurityException) e;<NEW_LINE>result.setSecIsSet(true);<NEW_LINE>msg = result;<NEW_LINE>} else if (e instanceof org.apache.thrift.transport.TTransportException) {<NEW_LINE>_LOGGER.error("TTransportException inside handler", e);<NEW_LINE>fb.close();<NEW_LINE>return;<NEW_LINE>} else if (e instanceof org.apache.thrift.TApplicationException) {<NEW_LINE>_LOGGER.error("TApplicationException inside handler", e);<NEW_LINE>msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;<NEW_LINE>msg = (org.apache.thrift.TApplicationException) e;<NEW_LINE>} else {<NEW_LINE>_LOGGER.error("Exception inside handler", e);<NEW_LINE>msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;<NEW_LINE>msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.<MASK><NEW_LINE>}<NEW_LINE>try {<NEW_LINE>fcall.sendResponse(fb, msg, msgType, seqid);<NEW_LINE>} catch (java.lang.Exception ex) {<NEW_LINE>_LOGGER.error("Exception writing to internal frame buffer", ex);<NEW_LINE>fb.close();<NEW_LINE>}<NEW_LINE>} | INTERNAL_ERROR, e.getMessage()); |
1,751,325 | private static void createSummaries(SummaryGenerator generator, List<String> classesToAnalyze, final boolean doForceOverwrite, String toAnalyze, File outputFolder) {<NEW_LINE>ClassSummaries summaries = generator.createMethodSummaries(toAnalyze, classesToAnalyze, new IClassSummaryHandler() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean onBeforeAnalyzeClass(String className) {<NEW_LINE>// Are we forced to analyze all classes?<NEW_LINE>if (doForceOverwrite)<NEW_LINE>return true;<NEW_LINE>// If we already have a summary file for this class, we skip over it<NEW_LINE>String summaryFile = className + ".xml";<NEW_LINE>return !new File(outputFolder, summaryFile).exists();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onMethodFinished(String methodSignature, MethodSummaries summaries) {<NEW_LINE>System.out.println("Method " + methodSignature + " done.");<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClassFinished(ClassMethodSummaries summaries) {<NEW_LINE>// Write out the class<NEW_LINE>final String className = summaries.getClassName();<NEW_LINE>String summaryFile = className + ".xml";<NEW_LINE>write(summaries, summaryFile, outputFolder.getPath());<NEW_LINE>System.out.println("Class " + className + " done.");<NEW_LINE>}<NEW_LINE>});<NEW_LINE>if (summaries != null) {<NEW_LINE>if (!summaries.getDependencies().isEmpty()) {<NEW_LINE>System.out.println("Dependencies:");<NEW_LINE>for (String className : summaries.getDependencies()) System.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | out.println("\t" + className); |
1,044,071 | private static SearchResult retrieveCaches(@NonNull final OCApiConnector connector, @NonNull final GeocacheFilter filter, final int take, final int skip) {<NEW_LINE>// fill in the defaults<NEW_LINE>final Parameters params = new Parameters("search_method", METHOD_SEARCH_ALL);<NEW_LINE>final Map<String, String> valueMap = new LinkedHashMap<>();<NEW_LINE>valueMap.put("limit", "" + take);<NEW_LINE>valueMap.put("offset", "" + skip);<NEW_LINE>// search around current position by default<NEW_LINE>fillSearchParameterCenter(valueMap, params, null);<NEW_LINE>String finder = null;<NEW_LINE>for (BaseGeocacheFilter baseFilter : filter.getAndChainIfPossible()) {<NEW_LINE>if (baseFilter instanceof OriginGeocacheFilter && !((OriginGeocacheFilter) baseFilter).allowsCachesOf(connector)) {<NEW_LINE>// no need to search if connector is filtered out itself<NEW_LINE>return new SearchResult();<NEW_LINE>}<NEW_LINE>if (baseFilter instanceof LogEntryGeocacheFilter) {<NEW_LINE>finder = ((<MASK><NEW_LINE>}<NEW_LINE>fillForBasicFilter(baseFilter, params, valueMap, connector);<NEW_LINE>}<NEW_LINE>// do the search<NEW_LINE>final Pair<List<Geocache>, Boolean> rawResult = requestCachesWithMore(connector, params, valueMap, true);<NEW_LINE>final SearchResult result = new SearchResult(rawResult.first);<NEW_LINE>// store metainfo needed for later for paging<NEW_LINE>result.setLeftToFetch(connector, rawResult.second ? 1 : 0);<NEW_LINE>result.setToContext(connector, b -> b.putString(SEARCH_CONTEXT_FILTER, filter.toConfig()));<NEW_LINE>result.setToContext(connector, b -> b.putInt(SEARCH_CONTEXT_TOOK_TOTAL, skip + rawResult.first.size()));<NEW_LINE>if (finder != null) {<NEW_LINE>result.getSearchContext().putString(Geocache.SEARCHCONTEXT_FINDER, finder);<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | LogEntryGeocacheFilter) baseFilter).getFoundByUser(); |
300,126 | private Mono<Response<StringDictionaryInner>> listFunctionKeysWithResponseAsync(String resourceGroupName, String name, String functionName, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (name == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (functionName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter functionName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.listFunctionKeys(this.client.getEndpoint(), resourceGroupName, name, functionName, this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context);<NEW_LINE>} | error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); |
461,141 | private static void makeRowFactoryForLevel(String classNameRow, String classNameFactory, Class forgeClass, CodegenClassScope classScope, List<CodegenInnerClass> innerClasses, String providerClassName) {<NEW_LINE>CodegenMethod makeMethod = CodegenMethod.makeParentNode(AggregationRow.EPTYPE, AggregationServiceFactoryCompiler.class, CodegenSymbolProviderEmpty.INSTANCE, classScope);<NEW_LINE>List<CodegenTypedParam> rowCtorParams = new ArrayList<>();<NEW_LINE>rowCtorParams.add(new CodegenTypedParam(providerClassName, "o"));<NEW_LINE>CodegenCtor ctor = new CodegenCtor(forgeClass, classScope, rowCtorParams);<NEW_LINE>if (forgeClass == AggregationServiceNullFactory.INSTANCE.getClass()) {<NEW_LINE>makeMethod.getBlock().methodReturn(constantNull());<NEW_LINE>} else {<NEW_LINE>makeMethod.getBlock().methodReturn(CodegenExpressionBuilder.newInstance(classNameRow));<NEW_LINE>}<NEW_LINE>CodegenClassMethods methods = new CodegenClassMethods();<NEW_LINE>CodegenStackGenerator.<MASK><NEW_LINE>CodegenInnerClass innerClass = new CodegenInnerClass(classNameFactory, AggregationRowFactory.EPTYPE, ctor, Collections.emptyList(), methods);<NEW_LINE>innerClasses.add(innerClass);<NEW_LINE>} | recursiveBuildStack(makeMethod, "make", methods); |
9,589 | public static SceneGraphImage readFromJSON(String json) {<NEW_LINE>try {<NEW_LINE>SceneGraphImage img = new SceneGraphImage();<NEW_LINE>JSONObject obj = (JSONObject) JSONValue.parse(json);<NEW_LINE>JSONArray regions = (JSONArray) obj.get("regions");<NEW_LINE>if (regions != null) {<NEW_LINE>for (JSONObject region : (List<JSONObject>) regions) {<NEW_LINE>img.regions.add(SceneGraphImageRegion.fromJSONObject(img, region));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>JSONArray objects = (JSONArray) obj.get("objects");<NEW_LINE>for (JSONObject object : (List<JSONObject>) objects) {<NEW_LINE>img.objects.add(SceneGraphImageObject.fromJSONObject(img, object));<NEW_LINE>}<NEW_LINE>JSONArray attributes = (JSONArray) obj.get("attributes");<NEW_LINE>for (JSONObject object : (List<JSONObject>) attributes) {<NEW_LINE>img.addAttribute(SceneGraphImageAttribute.fromJSONObject(img, object));<NEW_LINE>}<NEW_LINE>JSONArray relationships = (JSONArray) obj.get("relationships");<NEW_LINE>for (JSONObject relation : (List<JSONObject>) relationships) {<NEW_LINE>img.addRelationship(SceneGraphImageRelationship.fromJSONObject(img, relation));<NEW_LINE>}<NEW_LINE>if (obj.get("id") instanceof Number) {<NEW_LINE>img.id = ((Number) obj.get("id")).intValue();<NEW_LINE>} else {<NEW_LINE>img.id = Integer.parseInt(((String) obj.get("id")));<NEW_LINE>}<NEW_LINE>img.height = ((Number) obj.get("height")).intValue();<NEW_LINE>img.width = ((Number) obj.get("width")).intValue();<NEW_LINE>img.url = (<MASK><NEW_LINE>return img;<NEW_LINE>} catch (Exception e) {<NEW_LINE>System.err.println("Couldn't parse " + json);<NEW_LINE>e.printStackTrace();<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>} | String) obj.get("url"); |
1,706,738 | private List<com.dianping.cat.home.service.entity.Domain> sort(ServiceReport serviceReport, final String sortBy) {<NEW_LINE>List<com.dianping.cat.home.service.entity.Domain> result = new ArrayList<com.dianping.cat.home.service.entity.Domain>(serviceReport.getDomains().values());<NEW_LINE>Collections.sort(result, new Comparator<com.dianping.cat.home.service.entity.Domain>() {<NEW_LINE><NEW_LINE>public int compare(com.dianping.cat.home.service.entity.Domain d1, com.dianping.cat.home.service.entity.Domain d2) {<NEW_LINE>if (sortBy.equals("failure")) {<NEW_LINE>return (int) (d2.getFailureCount(<MASK><NEW_LINE>} else if (sortBy.equals("total")) {<NEW_LINE>long value = d2.getTotalCount() - d1.getTotalCount();<NEW_LINE>if (value > 0) {<NEW_LINE>return 1;<NEW_LINE>} else {<NEW_LINE>return -1;<NEW_LINE>}<NEW_LINE>} else if (sortBy.equals("failurePercent")) {<NEW_LINE>return (int) (100000 * d2.getFailurePercent() - 100000 * d1.getFailurePercent());<NEW_LINE>} else if (sortBy.equals("availability")) {<NEW_LINE>return (int) (100000 * d2.getFailurePercent() - 100000 * d1.getFailurePercent());<NEW_LINE>} else {<NEW_LINE>return (int) (d2.getAvg() - d1.getAvg());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return result;<NEW_LINE>} | ) - d1.getFailureCount()); |
1,453,543 | public Result track() throws Exception {<NEW_LINE>if (!_isEnabled) {<NEW_LINE>// If tracking is disabled, simply return a 200.<NEW_LINE>return status(200);<NEW_LINE>}<NEW_LINE>JsonNode event;<NEW_LINE>try {<NEW_LINE>event = request().body().asJson();<NEW_LINE>} catch (Exception e) {<NEW_LINE>return badRequest();<NEW_LINE>}<NEW_LINE>final String actor = ctx().session().get(ACTOR);<NEW_LINE>try {<NEW_LINE>_logger.debug(String.format("Emitting product analytics event. actor: %s, event: %s", actor, event));<NEW_LINE>final ProducerRecord<String, String> record = new ProducerRecord<>(_topic, actor, event.toString());<NEW_LINE>_producer.send(record);<NEW_LINE>_producer.flush();<NEW_LINE>return ok();<NEW_LINE>} catch (Exception e) {<NEW_LINE>_logger.error(String.format("Failed to emit product analytics event. actor: %s, event: %s", actor, event));<NEW_LINE>return <MASK><NEW_LINE>}<NEW_LINE>} | internalServerError(e.getMessage()); |
518,588 | private static <T> TypeToken<T> of(@NonNull Type type) {<NEW_LINE>if (type instanceof WildcardType) {<NEW_LINE>if (((WildcardType) type).getLowerBounds().length == 0) {<NEW_LINE>return of(((WildcardType) type).getUpperBounds()[0]);<NEW_LINE>}<NEW_LINE>throw new IllegalArgumentException("<? super T> is not supported");<NEW_LINE>} else if (type instanceof GenericArrayType) {<NEW_LINE>Type componentType = ((GenericArrayType) type).getGenericComponentType();<NEW_LINE>return new ArrayToken<T>(TypeToken.of(componentType));<NEW_LINE>} else if (type instanceof ParameterizedType) {<NEW_LINE>ParameterizedType parameterizedType = (ParameterizedType) type;<NEW_LINE>// Safe because rawType of parameterizedType is always instance of Class<T><NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>Class<T> rawType = (Class<T>) parameterizedType.getRawType();<NEW_LINE>Type[] types = parameterizedType.getActualTypeArguments();<NEW_LINE>TypeToken[] typeTokens = new TypeToken[types.length];<NEW_LINE>for (int i = 0; i < types.length; i++) {<NEW_LINE>typeTokens[i] = TypeToken.of(types[i]);<NEW_LINE>}<NEW_LINE>return new ClassToken<T>(rawType, new TypeTokenContainer(typeTokens));<NEW_LINE>} else if (type instanceof Class<?>) {<NEW_LINE>// Safe because type is instance of Class<?><NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>Class<T> typeToken = (Class<T>) type;<NEW_LINE>if (typeToken.isArray()) {<NEW_LINE>Class<?<MASK><NEW_LINE>// Safe because typeToken is an Array and componentTypeToken will never be null<NEW_LINE>@SuppressWarnings("ConstantConditions")<NEW_LINE>ArrayToken<T> arrayToken = new ArrayToken<T>(TypeToken.of(componentTypeToken));<NEW_LINE>return arrayToken;<NEW_LINE>}<NEW_LINE>return new ClassToken<T>(typeToken);<NEW_LINE>} else {<NEW_LINE>throw new IllegalArgumentException("Type: " + type.toString() + " not supported.");<NEW_LINE>}<NEW_LINE>} | > componentTypeToken = typeToken.getComponentType(); |
1,056,055 | private void applyInternal(final SnapshotChunk snapshotChunk) throws SnapshotWriteException {<NEW_LINE>if (containsChunk(snapshotChunk.getChunkName())) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>checkSnapshotIdIsValid(snapshotChunk.getSnapshotId());<NEW_LINE>final long currentSnapshotChecksum = snapshotChunk.getSnapshotChecksum();<NEW_LINE>checkSnapshotChecksumIsValid(currentSnapshotChecksum);<NEW_LINE>final var currentTotalCount = snapshotChunk.getTotalCount();<NEW_LINE>checkTotalCountIsValid(currentTotalCount);<NEW_LINE>final String snapshotId = snapshotChunk.getSnapshotId();<NEW_LINE>final <MASK><NEW_LINE>if (snapshotStore.hasSnapshotId(snapshotId)) {<NEW_LINE>LOGGER.debug("Ignore snapshot snapshotChunk {}, because snapshot {} already exists.", chunkName, snapshotId);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>checkChunkChecksumIsValid(snapshotChunk, snapshotId, chunkName);<NEW_LINE>final var tmpSnapshotDirectory = directory;<NEW_LINE>try {<NEW_LINE>FileUtil.ensureDirectoryExists(tmpSnapshotDirectory);<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new SnapshotWriteException(String.format("Failed to ensure that directory %s exists.", tmpSnapshotDirectory), e);<NEW_LINE>}<NEW_LINE>final var snapshotFile = tmpSnapshotDirectory.resolve(chunkName);<NEW_LINE>if (Files.exists(snapshotFile)) {<NEW_LINE>throw new SnapshotWriteException(String.format("Received a snapshot snapshotChunk which already exist '%s'.", snapshotFile));<NEW_LINE>}<NEW_LINE>LOGGER.trace("Consume snapshot snapshotChunk {} of snapshot {}", chunkName, snapshotId);<NEW_LINE>writeReceivedSnapshotChunk(snapshotChunk, snapshotFile);<NEW_LINE>} | String chunkName = snapshotChunk.getChunkName(); |
1,315,953 | public Boolean delete(DeleteTransformRequest request, String operator) {<NEW_LINE>LOGGER.info("begin to logic delete transform for request={}", request);<NEW_LINE>Preconditions.checkNotNull(request, "delete request of transform cannot be null");<NEW_LINE>String groupId = request.getInlongGroupId();<NEW_LINE>String streamId = request.getInlongStreamId();<NEW_LINE>Preconditions.checkNotNull(groupId, ErrorCodeEnum.GROUP_ID_IS_EMPTY.getMessage());<NEW_LINE>Preconditions.checkNotNull(streamId, ErrorCodeEnum.STREAM_ID_IS_EMPTY.getMessage());<NEW_LINE><MASK><NEW_LINE>List<StreamTransformEntity> entityList = transformMapper.selectByRelatedId(groupId, streamId, request.getTransformName());<NEW_LINE>if (CollectionUtils.isNotEmpty(entityList)) {<NEW_LINE>for (StreamTransformEntity entity : entityList) {<NEW_LINE>Integer id = entity.getId();<NEW_LINE>entity.setIsDeleted(id);<NEW_LINE>entity.setModifier(operator);<NEW_LINE>int rowCount = transformMapper.updateByIdSelective(entity);<NEW_LINE>if (rowCount != InlongConstants.AFFECTED_ONE_ROW) {<NEW_LINE>LOGGER.error("transform has already updated with groupId={}, streamId={}, name={}, curVersion={}", entity.getInlongGroupId(), entity.getInlongStreamId(), entity.getTransformName(), entity.getVersion());<NEW_LINE>throw new BusinessException(ErrorCodeEnum.CONFIG_EXPIRED);<NEW_LINE>}<NEW_LINE>transformFieldMapper.deleteAll(id);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>LOGGER.info("success to logic delete transform for request={} by user={}", request, operator);<NEW_LINE>return true;<NEW_LINE>} | groupCheckService.checkGroupStatus(groupId, operator); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.