Using Transfer Learning for Code-Related Tasks
Paper • 2206.08574 • Published
pre-training stringlengths 1 450k |
|---|
@ Override public void execute ( ) throws BuildException { if ( ! StringUtils . hasText ( this . refid ) ) { throw new BuildException ( "@refid has no text" ) ; } getProject ( ) . addReference ( this . refid , getClass ( ) . getClassLoader ( ) ) ; } |
private void run ( String [ ] args ) { Restarter . initialize ( args , RestartInitializer . NONE ) ; SpringApplication application = new SpringApplication ( RemoteClientConfiguration . class ) ; application . setWebApplicationType ( WebApplicationType . NONE ) ; application . setBanner ( getBanner ( ) ) ; application .... |
private Collection < ApplicationContextInitializer < ? > > getInitializers ( ) { List < ApplicationContextInitializer < ? > > initializers = new ArrayList <> ( ) ; initializers . add ( new RestartScopeInitializer ( ) ) ; return initializers ; } |
private Collection < ApplicationListener < ? > > getListeners ( ) { List < ApplicationListener < ? > > listeners = new ArrayList <> ( ) ; listeners . add ( new AnsiOutputApplicationListener ( ) ) ; listeners . add ( new ConfigFileApplicationListener ( ) ) ; listeners . add ( new ClasspathLoggingApplicationListener ( ) ... |
@ ConditionalOnMissingBean @ Bean ( KafkaStreamsDefaultConfiguration . DEFAULT_STREAMS_CONFIG_BEAN_NAME ) public KafkaStreamsConfiguration defaultKafkaStreamsConfig ( Environment environment ) { Map < String , Object > streamsProperties = this . properties . buildStreamsProperties ( ) ; if ( this . properties . getStre... |
@ Bean public KafkaStreamsFactoryBeanConfigurer kafkaStreamsFactoryBeanConfigurer ( @ Qualifier ( KafkaStreamsDefaultConfiguration . DEFAULT_STREAMS_BUILDER_BEAN_NAME ) StreamsBuilderFactoryBean factoryBean ) { return new KafkaStreamsFactoryBeanConfigurer ( this . properties , factoryBean ) ; } |
public RetryTemplate createRetryTemplate ( RabbitProperties . Retry properties , RabbitRetryTemplateCustomizer . Target target ) { PropertyMapper map = PropertyMapper . get ( ) ; RetryTemplate template = new RetryTemplate ( ) ; SimpleRetryPolicy policy = new SimpleRetryPolicy ( ) ; map . from ( properties :: getMaxAtte... |
@ Override public boolean isTemplateAvailable ( String view , Environment environment , ClassLoader classLoader , ResourceLoader resourceLoader ) { if ( ClassUtils . isPresent ( this . className , classLoader ) ) { Binder binder = Binder . get ( environment ) ; TemplateAvailabilityProperties properties = binder . bind ... |
private boolean isTemplateAvailable ( String view , ResourceLoader resourceLoader , TemplateAvailabilityProperties properties ) { String location = properties . getPrefix ( ) + view + properties . getSuffix ( ) ; for ( String path : properties . getLoaderPath ( ) ) { if ( resourceLoader . getResource ( path + location ... |
protected final void bindIndexed ( ConfigurationPropertyName name , Bindable < ? > target , AggregateElementBinder elementBinder , ResolvableType aggregateType , ResolvableType elementType , IndexedCollectionSupplier result ) { for ( ConfigurationPropertySource source : getContext ( ) . getSources ( ) ) { bindIndexed (... |
private void bindIndexed ( ConfigurationPropertySource source , ConfigurationPropertyName root , Bindable < ? > target , AggregateElementBinder elementBinder , IndexedCollectionSupplier collection , ResolvableType aggregateType , ResolvableType elementType ) { ConfigurationProperty property = source . getConfigurationP... |
private void bindValue ( Bindable < ? > target , Collection < Object > collection , ResolvableType aggregateType , ResolvableType elementType , Object value ) { if ( value instanceof String && ! StringUtils . hasText ( ( String ) value ) ) { return ; } Object aggregate = convert ( value , aggregateType , target . getAn... |
private void bindIndexed ( ConfigurationPropertySource source , ConfigurationPropertyName root , AggregateElementBinder elementBinder , IndexedCollectionSupplier collection , ResolvableType elementType ) { MultiValueMap < String , ConfigurationProperty > knownIndexedChildren = getKnownIndexedChildren ( source , root ) ... |
private MultiValueMap < String , ConfigurationProperty > getKnownIndexedChildren ( ConfigurationPropertySource source , ConfigurationPropertyName root ) { MultiValueMap < String , ConfigurationProperty > children = new LinkedMultiValueMap <> ( ) ; if ( ! ( source instanceof IterableConfigurationPropertySource ) ) { ret... |
private void assertNoUnboundChildren ( MultiValueMap < String , ConfigurationProperty > children ) { if ( ! children . isEmpty ( ) ) { throw new UnboundConfigurationPropertiesException ( children . values ( ) . stream ( ) . flatMap ( List :: stream ) . collect ( Collectors . toCollection ( TreeSet :: new ) ) ) ; } } |
private < C > C convert ( Object value , ResolvableType type , Annotation ... annotations ) { value = getContext ( ) . getPlaceholdersResolver ( ) . resolvePlaceholders ( value ) ; return getContext ( ) . getConverter ( ) . convert ( value , type , annotations ) ; } |
@ Override public void customize ( Server server ) { ForwardedRequestCustomizer customizer = new ForwardedRequestCustomizer ( ) ; for ( Connector connector : server . getConnectors ( ) ) { for ( ConnectionFactory connectionFactory : connector . getConnectionFactories ( ) ) { if ( connectionFactory instanceof HttpConfig... |
@ Bean @ ConditionalOnMissingBean public TransportClient elasticsearchClient ( ) throws Exception { TransportClientFactoryBean factory = new TransportClientFactoryBean ( ) ; factory . setClusterNodes ( this . properties . getClusterNodes ( ) ) ; factory . setProperties ( createProperties ( ) ) ; factory . afterProperti... |
private Properties createProperties ( ) { Properties properties = new Properties ( ) ; properties . put ( "cluster.name" , this . properties . getClusterName ( ) ) ; properties . putAll ( this . properties . getProperties ( ) ) ; return properties ; } |
private void markAsProcessed ( Element element ) { if ( element instanceof TypeElement ) { this . processedSourceTypes . add ( this . typeUtils . getQualifiedName ( element ) ) ; } } |
public boolean hasSimilarGroup ( ItemMetadata metadata ) { if ( ! metadata . isOfItemType ( ItemMetadata . ItemType . GROUP ) ) { throw new IllegalStateException ( "item " + metadata + " must be a group" ) ; } for ( ItemMetadata existing : this . metadataItems ) { if ( existing . isOfItemType ( ItemMetadata . ItemType ... |
public ConfigurationMetadata getMetadata ( ) { ConfigurationMetadata metadata = new ConfigurationMetadata ( ) ; for ( ItemMetadata item : this . metadataItems ) { metadata . add ( item ) ; } if ( this . previousMetadata != null ) { List < ItemMetadata > items = this . previousMetadata . getItems ( ) ; for ( ItemMetadat... |
private boolean shouldBeMerged ( ItemMetadata itemMetadata ) { String sourceType = itemMetadata . getSourceType ( ) ; return ( sourceType != null && ! deletedInCurrentBuild ( sourceType ) && ! processedInCurrentBuild ( sourceType ) ) ; } |
@ Override public void postProcessBeanFactory ( ConfigurableListableBeanFactory beanFactory ) throws BeansException { if ( isRunningInEmbeddedWebServer ( ) ) { ClassPathScanningCandidateComponentProvider componentProvider = createComponentProvider ( ) ; for ( String packageToScan : this . packagesToScan ) { scanPackage... |
private void scanPackage ( ClassPathScanningCandidateComponentProvider componentProvider , String packageToScan ) { for ( BeanDefinition candidate : componentProvider . findCandidateComponents ( packageToScan ) ) { if ( candidate instanceof ScannedGenericBeanDefinition ) { for ( ServletComponentHandler handler : HANDLE... |
private ClassPathScanningCandidateComponentProvider createComponentProvider ( ) { ClassPathScanningCandidateComponentProvider componentProvider = new ClassPathScanningCandidateComponentProvider ( false ) ; componentProvider . setEnvironment ( this . applicationContext . getEnvironment ( ) ) ; componentProvider . setRes... |
@ Override public Map < String , Object > parseMap ( String json ) { return tryParse ( ( ) -> getObjectMapper ( ) . readValue ( json , MAP_TYPE ) , Exception . class ) ; } |
@ Override public List < Object > parseList ( String json ) { return tryParse ( ( ) -> getObjectMapper ( ) . readValue ( json , LIST_TYPE ) , Exception . class ) ; } |
@ ReadOperation public EnvironmentDescriptor environment ( @ Nullable String pattern ) { if ( StringUtils . hasText ( pattern ) ) { return getEnvironmentDescriptor ( Pattern . compile ( pattern ) . asPredicate ( ) ) ; } return getEnvironmentDescriptor ( ( name ) - > true ) ; } |
private EnvironmentDescriptor getEnvironmentDescriptor ( Predicate < String > propertyNamePredicate ) { PlaceholdersResolver resolver = getResolver ( ) ; List < PropertySourceDescriptor > propertySources = new ArrayList <> ( ) ; getPropertySourcesAsMap ( ) . forEach ( ( sourceName , source ) -> { if ( source instanceof... |
private EnvironmentEntryDescriptor getEnvironmentEntryDescriptor ( String propertyName ) { Map < String , PropertyValueDescriptor > descriptors = getPropertySourceDescriptors ( propertyName ) ; PropertySummaryDescriptor summary = getPropertySummaryDescriptor ( descriptors ) ; return new EnvironmentEntryDescriptor ( sum... |
private List < PropertySourceEntryDescriptor > toPropertySourceDescriptors ( Map < String , PropertyValueDescriptor > descriptors ) { List < PropertySourceEntryDescriptor > result = new ArrayList <> ( ) ; descriptors . forEach ( ( name , property ) -> result . add ( new PropertySourceEntryDescriptor ( name , property )... |
private PropertySummaryDescriptor getPropertySummaryDescriptor ( Map < String , PropertyValueDescriptor > descriptors ) { for ( Map . Entry < String , PropertyValueDescriptor > entry : descriptors . entrySet ( ) ) { if ( entry . getValue ( ) != null ) { return new PropertySummaryDescriptor ( entry . getKey ( ) , entry ... |
private Map < String , PropertyValueDescriptor > getPropertySourceDescriptors ( String propertyName ) { Map < String , PropertyValueDescriptor > propertySources = new LinkedHashMap <> ( ) ; PlaceholdersResolver resolver = getResolver ( ) ; getPropertySourcesAsMap ( ) . forEach ( ( sourceName , source ) -> propertySourc... |
private PropertySourceDescriptor describeSource ( String sourceName , EnumerablePropertySource < ? > source , PlaceholdersResolver resolver , Predicate < String > namePredicate ) { Map < String , PropertyValueDescriptor > properties = new LinkedHashMap <> ( ) ; Stream . of ( source . getPropertyNames ( ) ) . filter ( n... |
@ SuppressWarnings ( "unchecked" ) private PropertyValueDescriptor describeValueOf ( String name , PropertySource < ? > source , PlaceholdersResolver resolver ) { Object resolved = resolver . resolvePlaceholders ( source . getProperty ( name ) ) ; String origin = ( ( source instanceof OriginLookup ) ? getOrigin ( ( Ori... |
private String getOrigin ( OriginLookup < Object > lookup , String name ) { Origin origin = lookup . getOrigin ( name ) ; return ( origin != null ) ? origin . toString ( ) : null ; } |
private Map < String , PropertySource < ? > > getPropertySourcesAsMap ( ) { Map < String , PropertySource < ? > > map = new LinkedHashMap <> ( ) ; for ( PropertySource < ? > source : getPropertySources ( ) ) { if ( ! ConfigurationPropertySources . isAttachedConfigurationPropertySource ( source ) ) { extract ( "" , map ... |
private void extract ( String root , Map < String , PropertySource < ? > > map , PropertySource < ? > source ) { if ( source instanceof CompositePropertySource ) { for ( PropertySource < ? > nest : ( ( CompositePropertySource ) source ) . getPropertySources ( ) ) { extract ( source . getName ( ) + ":" , map , nest ) ; ... |
public Object sanitize ( String name , Object object ) { return this . sanitizer . sanitize ( name , object ) ; } |
@ Bean @ ConditionalOnMissingBean ( RedisConnectionFactory . class ) public LettuceConnectionFactory redisConnectionFactory ( ObjectProvider < LettuceClientConfigurationBuilderCustomizer > builderCustomizers , ClientResources clientResources ) throws UnknownHostException { LettuceClientConfiguration clientConfig = getL... |
private LettuceConnectionFactory createLettuceConnectionFactory ( LettuceClientConfiguration clientConfiguration ) { if ( getSentinelConfig ( ) != null ) { return new LettuceConnectionFactory ( getSentinelConfig ( ) , clientConfiguration ) ; } if ( getClusterConfiguration ( ) != null ) { return new LettuceConnectionFac... |
private LettuceClientConfiguration getLettuceClientConfiguration ( ObjectProvider < LettuceClientConfigurationBuilderCustomizer > builderCustomizers , ClientResources clientResources , Pool pool ) { LettuceClientConfigurationBuilder builder = createBuilder ( pool ) ; applyProperties ( builder ) ; if ( StringUtils . has... |
private LettuceClientConfigurationBuilder createBuilder ( Pool pool ) { if ( pool == null ) { return LettuceClientConfiguration . builder ( ) ; } return new PoolBuilderFactory ( ) . createBuilder ( pool ) ; } |
private LettuceClientConfigurationBuilder applyProperties ( LettuceClientConfiguration . LettuceClientConfigurationBuilder builder ) { if ( getProperties ( ) . isSsl ( ) ) { builder . useSsl ( ) ; } if ( getProperties ( ) . getTimeout ( ) != null ) { builder . commandTimeout ( getProperties ( ) . getTimeout ( ) ) ; } i... |
private void customizeConfigurationFromUrl ( LettuceClientConfiguration . LettuceClientConfigurationBuilder builder ) { ConnectionInfo connectionInfo = parseUrl ( getProperties ( ) . getUrl ( ) ) ; if ( connectionInfo . isUseSsl ( ) ) { builder . useSsl ( ) ; } } |
public void setServletRegistrationBeans ( Collection < ? extends ServletRegistrationBean < ? > > servletRegistrationBeans ) { Assert . notNull ( servletRegistrationBeans , "ServletRegistrationBeans must not be null" ) ; this . servletRegistrationBeans = new LinkedHashSet <> ( servletRegistrationBeans ) ; } |
public void addServletRegistrationBeans ( ServletRegistrationBean < ? > ... servletRegistrationBeans ) { Assert . notNull ( servletRegistrationBeans , "ServletRegistrationBeans must not be null" ) ; Collections . addAll ( this . servletRegistrationBeans , servletRegistrationBeans ) ; } |
public void setServletNames ( Collection < String > servletNames ) { Assert . notNull ( servletNames , "ServletNames must not be null" ) ; this . servletNames = new LinkedHashSet <> ( servletNames ) ; } |
public void addServletNames ( String ... servletNames ) { Assert . notNull ( servletNames , "ServletNames must not be null" ) ; this . servletNames . addAll ( Arrays . asList ( servletNames ) ) ; } |
public void setUrlPatterns ( Collection < String > urlPatterns ) { Assert . notNull ( urlPatterns , "UrlPatterns must not be null" ) ; this . urlPatterns = new LinkedHashSet <> ( urlPatterns ) ; } |
public void addUrlPatterns ( String ... urlPatterns ) { Assert . notNull ( urlPatterns , "UrlPatterns must not be null" ) ; Collections . addAll ( this . urlPatterns , urlPatterns ) ; } |
public void setDispatcherTypes ( DispatcherType first , DispatcherType ... rest ) { this . dispatcherTypes = EnumSet . of ( first , rest ) ; } |
@ Override protected String getDescription ( ) { Filter filter = getFilter ( ) ; Assert . notNull ( filter , "Filter must not be null" ) ; return "filter " + getOrDeduceName ( filter ) ; } |
@ Override protected Dynamic addRegistration ( String description , ServletContext servletContext ) { Filter filter = getFilter ( ) ; return servletContext . addFilter ( getOrDeduceName ( filter ) , filter ) ; } |
@ Override protected void configure ( FilterRegistration . Dynamic registration ) { super . configure ( registration ) ; EnumSet < DispatcherType > dispatcherTypes = this . dispatcherTypes ; if ( dispatcherTypes == null ) { dispatcherTypes = EnumSet . of ( DispatcherType . REQUEST ) ; } Set < String > servletNames = ne... |
@ Override protected AbstractUrlBasedView createView ( String viewName ) { MustacheView view = ( MustacheView ) super . createView ( viewName ) ; view . setCompiler ( this . compiler ) ; view . setCharset ( this . charset ) ; return view ; } |
@ ServiceActivator public String hello ( File input ) throws Exception { FileInputStream in = new FileInputStream ( input ) ; String name = new String ( StreamUtils . copyToByteArray ( in ) ) ; in . close ( ) ; return this . helloWorldService . getHelloMessage ( name ) ; } |
@ Override public void onApplicationEvent ( WebServerInitializedEvent event ) { String propertyName = "local." + getName ( event . getApplicationContext ( ) ) + ".port" ; setPortProperty ( event . getApplicationContext ( ) , propertyName , event . getWebServer ( ) . getPort ( ) ) ; } |
private String getName ( WebServerApplicationContext context ) { String name = context . getServerNamespace ( ) ; return StringUtils . hasText ( name ) ? name : "server" ; } |
private void setPortProperty ( ApplicationContext context , String propertyName , int port ) { if ( context instanceof ConfigurableApplicationContext ) { setPortProperty ( ( ( ConfigurableApplicationContext ) context ) . getEnvironment ( ) , propertyName , port ) ; } if ( context . getParent ( ) != null ) { setPortProp... |
@ SuppressWarnings ( "unchecked" ) private void setPortProperty ( ConfigurableEnvironment environment , String propertyName , int port ) { MutablePropertySources sources = environment . getPropertySources ( ) ; PropertySource < ? > source = sources . get ( "server.ports" ) ; if ( source == null ) { source = new MapProp... |
private String buildName ( String prefix , String name ) { StringBuilder fullName = new StringBuilder ( ) ; if ( prefix != null ) { if ( prefix . endsWith ( "." ) ) { prefix = prefix . substring ( 0 , prefix . length ( ) - 1 ) ; } fullName . append ( prefix ) ; } if ( name != null ) { if ( fullName . length ( ) > 0 ) {... |
protected void buildToStringProperty ( StringBuilder string , String property , Object value ) { if ( value != null ) { string . append ( " " ) . append ( property ) . append ( ":" ) . append ( value ) ; } } |
public static ItemMetadata newGroup ( String name , String type , String sourceType , String sourceMethod ) { return new ItemMetadata ( ItemType . GROUP , name , null , type , sourceType , sourceMethod , null , null , null ) ; } |
public static ItemMetadata newProperty ( String prefix , String name , String type , String sourceType , String sourceMethod , String description , Object defaultValue , ItemDeprecation deprecation ) { return new ItemMetadata ( ItemType . PROPERTY , prefix , name , type , sourceType , sourceMethod , description , defau... |
public static String newItemMetadataPrefix ( String prefix , String suffix ) { return prefix . toLowerCase ( Locale . ENGLISH ) + ConfigurationMetadata . toDashedCase ( suffix ) ; } |
@ Bean @ ConditionalOnBean ( FindByIndexNameSessionRepository . class ) @ ConditionalOnMissingBean public SessionsEndpoint sessionEndpoint ( FindByIndexNameSessionRepository < ? extends Session > sessionRepository ) { return new SessionsEndpoint ( sessionRepository ) ; } |
@ Override public void run ( String ... args ) throws Exception { this . repository . deleteAll ( ) ; // insert some products this . repository . save ( new Product ( "1" , "Nintendo Entertainment System" ) ) ; this . repository . save ( new Product ( "2" , "Sega Megadrive" ) ) ; this . repository . save ( new Product ... |
@ Bean @ ConditionalOnEnabledInfoContributor ( "env" ) @ Order ( DEFAULT_ORDER ) public EnvironmentInfoContributor envInfoContributor ( ConfigurableEnvironment environment ) { return new EnvironmentInfoContributor ( environment ) ; } |
@ Bean @ ConditionalOnEnabledInfoContributor ( "git" ) @ ConditionalOnSingleCandidate ( GitProperties . class ) @ ConditionalOnMissingBean @ Order ( DEFAULT_ORDER ) public GitInfoContributor gitInfoContributor ( GitProperties gitProperties , InfoContributorProperties infoContributorProperties ) { return new GitInfoCont... |
@ Bean @ ConditionalOnEnabledInfoContributor ( "build" ) @ ConditionalOnSingleCandidate ( BuildProperties . class ) @ Order ( DEFAULT_ORDER ) public InfoContributor buildInfoContributor ( BuildProperties buildProperties ) { return new BuildInfoContributor ( buildProperties ) ; } |
@ PostConstruct public void checkSessionTimeout ( ) { if ( this . timeout == null && this . serverProperties != null ) { this . timeout = this . serverProperties . getServlet ( ) . getSession ( ) . getTimeout ( ) ; } } |
@ Override public void setApplicationContext ( ApplicationContext applicationContext ) throws BeansException { this . applicationContext = applicationContext ; this . propertySources = new PropertySourcesDeducer ( applicationContext ) . getPropertySources ( ) ; this . configurationPropertiesValidator = getConfiguration... |
public < T > BindResult < T > bind ( Bindable < T > target ) { ConfigurationProperties annotation = target . getAnnotation ( ConfigurationProperties . class ) ; Assert . state ( annotation != null , ( ) -> "Missing @ConfigurationProperties on " + target ) ; List < Validator > validators = getValidators ( target ) ; Bin... |
private Validator getConfigurationPropertiesValidator ( ApplicationContext applicationContext , String validatorBeanName ) { if ( applicationContext . containsBean ( validatorBeanName ) ) { return applicationContext . getBean ( validatorBeanName , Validator . class ) ; } return null ; } |
private List < Validator > getValidators ( Bindable < ? > target ) { List < Validator > validators = new ArrayList <> ( 3 ) ; if ( this . configurationPropertiesValidator != null ) { validators . add ( this . configurationPropertiesValidator ) ; } if ( this . jsr303Present && target . getAnnotation ( Validated . class ... |
private BindHandler getBindHandler ( ConfigurationProperties annotation , List < Validator > validators ) { BindHandler handler = new IgnoreTopLevelConverterNotFoundBindHandler ( ) ; if ( annotation . ignoreInvalidFields ( ) ) { handler = new IgnoreErrorsBindHandler ( handler ) ; } if ( ! annotation . ignoreUnknownFiel... |
private List < ConfigurationPropertiesBindHandlerAdvisor > getBindHandlerAdvisors ( ) { return this . applicationContext . getBeanProvider ( ConfigurationPropertiesBindHandlerAdvisor . class ) . orderedStream ( ) . collect ( Collectors . toList ( ) ) ; } |
private Binder getBinder ( ) { if ( this . binder == null ) { this . binder = new Binder ( getConfigurationPropertySources ( ) , getPropertySourcesPlaceholdersResolver ( ) , getConversionService ( ) , getPropertyEditorInitializer ( ) ) ; } return this . binder ; } |
private Consumer < PropertyEditorRegistry > getPropertyEditorInitializer ( ) { if ( this . applicationContext instanceof ConfigurableApplicationContext ) { return ( ( ConfigurableApplicationContext ) this . applicationContext ) . getBeanFactory ( ) :: copyRegisteredEditorsTo ; } return null ; } |
@ Override public Hotel getHotel ( City city , String name ) { Assert . notNull ( city , "City must not be null" ) ; Assert . hasLength ( name , "Name must not be empty" ) ; return this . hotelRepository . findByCityAndName ( city , name ) ; } |
@ Override public Page < Review > getReviews ( Hotel hotel , Pageable pageable ) { Assert . notNull ( hotel , "Hotel must not be null" ) ; return this . reviewRepository . findByHotel ( hotel , pageable ) ; } |
@ Override public Review getReview ( Hotel hotel , int reviewNumber ) { Assert . notNull ( hotel , "Hotel must not be null" ) ; return this . reviewRepository . findByHotelAndIndex ( hotel , reviewNumber ) ; } |
@ Override public Review addReview ( Hotel hotel , ReviewDetails details ) { Review review = new Review ( hotel , 1 , details ) ; return this . reviewRepository . save ( review ) ; } |
@ Override public ReviewsSummary getReviewSummary ( Hotel hotel ) { List < RatingCount > ratingCounts = this . hotelRepository . findRatingCounts ( hotel ) ; return new ReviewsSummaryImpl ( ratingCounts ) ; } |
@ Bean @ ConditionalOnMissingBean public CharacterEncodingFilter characterEncodingFilter ( ) { CharacterEncodingFilter filter = new OrderedCharacterEncodingFilter ( ) ; filter . setEncoding ( this . properties . getCharset ( ) . name ( ) ) ; filter . setForceRequestEncoding ( this . properties . shouldForce ( Type . RE... |
public String getVersion ( String artifactId , String defaultVersion ) { String version = this . dependencyResolutionContext . getArtifactCoordinatesResolver ( ) . getVersion ( artifactId ) ; if ( version == null ) { version = defaultVersion ; } return version ; } |
public DependencyCustomizer ifAnyMissingClasses ( String ... classNames ) { return new DependencyCustomizer ( this ) { @ Override protected boolean canAdd ( ) { for ( String className : classNames ) { try { DependencyCustomizer . this . loader . loadClass ( className ) ; } catch ( Exception ex ) { return true ; } } ret... |
public DependencyCustomizer ifAllMissingClasses ( String ... classNames ) { return new DependencyCustomizer ( this ) { @ Override protected boolean canAdd ( ) { for ( String className : classNames ) { try { DependencyCustomizer . this . loader . loadClass ( className ) ; return false ; } catch ( Exception ex ) { // swa... |
public DependencyCustomizer ifAllResourcesPresent ( String ... paths ) { return new DependencyCustomizer ( this ) { @ Override protected boolean canAdd ( ) { for ( String path : paths ) { try { if ( DependencyCustomizer . this . loader . getResource ( path ) == null ) { return false ; } return true ; } catch ( Exceptio... |
public DependencyCustomizer add ( String ... modules ) { for ( String module : modules ) { add ( module , null , null , true ) ; } return this ; } |
public DependencyCustomizer add ( String module , boolean transitive ) { return add ( module , null , null , transitive ) ; } |
public DependencyCustomizer add ( String module , String classifier , String type , boolean transitive ) { if ( canAdd ( ) ) { ArtifactCoordinatesResolver artifactCoordinatesResolver = this . dependencyResolutionContext . getArtifactCoordinatesResolver ( ) ; this . classNode . addAnnotation ( createGrabAnnotation ( art... |
private AnnotationNode createGrabAnnotation ( String group , String module , String version , String classifier , String type , boolean transitive ) { AnnotationNode annotationNode = new AnnotationNode ( new ClassNode ( Grab . class ) ) ; annotationNode . addMember ( "group" , new ConstantExpression ( group ) ) ; annot... |
public static HealthIndicatorRegistry get ( ApplicationContext applicationContext ) { Map < String , HealthIndicator > indicators = new LinkedHashMap <> ( ) ; indicators . putAll ( applicationContext . getBeansOfType ( HealthIndicator . class ) ) ; if ( ClassUtils . isPresent ( "reactor.core.publisher.Flux" , null ) ) ... |
public static void throwIfHasInvalidChars ( CharSequence name , List < Character > invalidCharacters ) { if ( ! invalidCharacters . isEmpty ( ) ) { throw new InvalidConfigurationPropertyNameException ( name , invalidCharacters ) ; } } |
@ Bean ( BOOKMARK_MANAGER_BEAN_NAME ) @ ConditionalOnWebApplication @ Scope ( value = WebApplicationContext . SCOPE_REQUEST , proxyMode = ScopedProxyMode . INTERFACES ) public BookmarkManager requestScopedBookmarkManager ( ) { return new CaffeineBookmarkManager ( ) ; } |
protected void applyProperties ( FreeMarkerConfigurationFactory factory ) { factory . setTemplateLoaderPaths ( this . properties . getTemplateLoaderPath ( ) ) ; factory . setPreferFileSystemAccess ( this . properties . isPreferFileSystemAccess ( ) ) ; factory . setDefaultEncoding ( this . properties . getCharsetName ( ... |
@ Override public void run ( String ... args ) { System . out . println ( this . helloWorldService . getHelloMessage ( ) ) ; if ( args . length > 0 && args [ 0 ] . equals ( "exitcode" ) ) { throw new ExitException ( ) ; } } |
@article{Mastropaolo2022TransferLearningForCodeRelatedTasks
title={Using Transfer Learning for Code-Related Tasks},
author={Mastropaolo, Antonio and Cooper, Nathan and Nader Palacio, David and Scalabrino, Simone and
Poshyvanyk, Denys and Oliveto, Rocco and Bavota, Gabriele},
journal={arXiv preprint arXiv:2206.08574},
year={2022}
}