[ 
https://issues.apache.org/jira/browse/GROOVY-7252?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Eric Milles resolved GROOVY-7252.
---------------------------------
    Fix Version/s: 5.0.0-alpha-1
       Resolution: Fixed

https://github.com/apache/groovy/commit/5fe6fbc7dfef4df52fff6cf96a95b6d46d4fbf3c

> Integer literal not accepted for primitive short annotation attribute
> ---------------------------------------------------------------------
>
>                 Key: GROOVY-7252
>                 URL: https://issues.apache.org/jira/browse/GROOVY-7252
>             Project: Groovy
>          Issue Type: Bug
>          Components: Compiler
>    Affects Versions: 2.3.9
>            Reporter: Eric Rodriguez
>            Assignee: Eric Milles
>            Priority: Major
>              Labels: annotations
>             Fix For: 5.0.0-alpha-1
>
>
> This is a follow-up of GROOVY-6019
> Regarding this PR https://github.com/groovy/groovy-core/pull/143
> I'm trying to use spring-data-elasticsearch annotations
> {code:title=Document.java}
> @Persistent
> @Inherited
> @Retention(RetentionPolicy.RUNTIME)
> @Target({ElementType.TYPE})
> public @interface Document {
>       String indexName();
>       String type() default "";
>       short shards() default 5;
>       short replicas() default 1;
>       String refreshInterval() default "1s";
>       String indexStoreType() default "fs";
> }
> {code}
> Using groovy 2.3.9 and java 1.8.0_25 with this annotation:
> {code}
> @Document(indexName = "articles", type = "article", shards = 1, replicas = 0, 
> refreshInterval = "-1", indexStoreType = "memory")
> {code}
> I get the following errors:
> Error:(13, 62) Groovyc: Attribute 'shards' should have type 
> 'java.lang.Short'; but found type 'int' in 
> @org.springframework.data.elasticsearch.annotations.Document
> Error:(13, 76) Groovyc: Attribute 'replicas' should have type 
> 'java.lang.Short'; but found type 'int' in 
> @org.springframework.data.elasticsearch.annotations.Document
> Could this be a regression?



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to