You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by jwagenleitner <gi...@git.apache.org> on 2017/05/20 16:49:07 UTC

[GitHub] groovy pull request #544: refactor: type safety and formatting

GitHub user jwagenleitner opened a pull request:

    https://github.com/apache/groovy/pull/544

    refactor: type safety and formatting

    

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/jwagenleitner/groovy refactor

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/groovy/pull/544.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #544
    
----
commit 71da9595ff1b3cda9534208620025efd739a1455
Author: John Wagenleitner <jw...@apache.org>
Date:   2017-05-20T16:00:23Z

    refactor: type safety

commit 5f2642b09f2625177b962ce4faa805e86229185d
Author: John Wagenleitner <jw...@apache.org>
Date:   2017-05-20T16:35:40Z

    refactor: formatting and type safety

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] groovy pull request #544: refactor: type safety and formatting

Posted by graemerocher <gi...@git.apache.org>.
Github user graemerocher commented on a diff in the pull request:

    https://github.com/apache/groovy/pull/544#discussion_r117615150
  
    --- Diff: src/main/org/codehaus/groovy/transform/trait/Traits.java ---
    @@ -355,19 +355,19 @@ static String getSuperTraitMethodName(ClassNode trait, String method) {
          */
         @Retention(RetentionPolicy.RUNTIME)
         @Target(ElementType.METHOD)
    -    public static @interface Implemented {}
    +    public @interface Implemented {}
    --- End diff --
    
    Ah of course.. silly me


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] groovy pull request #544: refactor: type safety and formatting

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/groovy/pull/544


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] groovy pull request #544: refactor: type safety and formatting

Posted by graemerocher <gi...@git.apache.org>.
Github user graemerocher commented on a diff in the pull request:

    https://github.com/apache/groovy/pull/544#discussion_r117614896
  
    --- Diff: src/main/org/codehaus/groovy/transform/trait/Traits.java ---
    @@ -355,19 +355,19 @@ static String getSuperTraitMethodName(ClassNode trait, String method) {
          */
         @Retention(RetentionPolicy.RUNTIME)
         @Target(ElementType.METHOD)
    -    public static @interface Implemented {}
    +    public @interface Implemented {}
    --- End diff --
    
    Also breaking. See https://github.com/grails/grails-data-mapping/blob/master/grails-datastore-core/src/main/groovy/org/grails/datastore/mapping/reflect/FieldEntityAccess.java#L504


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] groovy pull request #544: refactor: type safety and formatting

Posted by jwagenleitner <gi...@git.apache.org>.
Github user jwagenleitner commented on a diff in the pull request:

    https://github.com/apache/groovy/pull/544#discussion_r117615134
  
    --- Diff: src/main/org/codehaus/groovy/transform/trait/Traits.java ---
    @@ -355,19 +355,19 @@ static String getSuperTraitMethodName(ClassNode trait, String method) {
          */
         @Retention(RetentionPolicy.RUNTIME)
         @Target(ElementType.METHOD)
    -    public static @interface Implemented {}
    +    public @interface Implemented {}
     
         /**
          * Internal annotation used to indicate that a method is a bridge method to a trait
          * default implementation.
          */
         @Retention(RetentionPolicy.RUNTIME)
         @Target(ElementType.METHOD)
    -     public static @interface TraitBridge {
    --- End diff --
    
    The `static` modifier is redundant on inner interfaces. The bytecode will remain unchanged with or without the modifier so the code referenced should continue to work.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] groovy pull request #544: refactor: type safety and formatting

Posted by graemerocher <gi...@git.apache.org>.
Github user graemerocher commented on a diff in the pull request:

    https://github.com/apache/groovy/pull/544#discussion_r117614868
  
    --- Diff: src/main/org/codehaus/groovy/transform/trait/Traits.java ---
    @@ -355,19 +355,19 @@ static String getSuperTraitMethodName(ClassNode trait, String method) {
          */
         @Retention(RetentionPolicy.RUNTIME)
         @Target(ElementType.METHOD)
    -    public static @interface Implemented {}
    +    public @interface Implemented {}
     
         /**
          * Internal annotation used to indicate that a method is a bridge method to a trait
          * default implementation.
          */
         @Retention(RetentionPolicy.RUNTIME)
         @Target(ElementType.METHOD)
    -     public static @interface TraitBridge {
    --- End diff --
    
    This is a breaking change, some libraries like GORM needs to inspect this information in order to know whether a property or fields i provided by a trait. See https://github.com/grails/grails-data-mapping/blob/master/grails-datastore-core/src/main/groovy/org/grails/datastore/mapping/reflect/FieldEntityAccess.java#L227


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---