[jira] [Commented] (GROOVY-8362) Nested class is resolved via another nested class with package name

2018-01-03 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/GROOVY-8362?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16310700#comment-16310700
 ] 

ASF GitHub Bot commented on GROOVY-8362:


Github user asfgit closed the pull request at:

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


> Nested class is resolved via another nested class with package name
> ---
>
> Key: GROOVY-8362
> URL: https://issues.apache.org/jira/browse/GROOVY-8362
> Project: Groovy
>  Issue Type: Bug
>Reporter: Daniil Ovchinnikov
>Assignee: Jochen Theodorou
>Priority: Critical
> Fix For: 2.4.14
>
>
> {code:title=bugs/bugs.groovy}
> package bugs
> class Current {
>   static class bugs {
> static class Target {}
>   }
>   static usage() {
> new Target() // error expected
>   }
> }
> println Current.usage() // bugs.Current$bugs$Target@20d28811
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[GitHub] groovy pull request #647: GROOVY-8362: don't resolve class via class with pa...

2018-01-03 Thread asfgit
Github user asfgit closed the pull request at:

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


---


[jira] [Commented] (GROOVY-8362) Nested class is resolved via another nested class with package name

2018-01-03 Thread Paul King (JIRA)

[ 
https://issues.apache.org/jira/browse/GROOVY-8362?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16310697#comment-16310697
 ] 

Paul King commented on GROOVY-8362:
---

Proposed PR merged, thanks!

> Nested class is resolved via another nested class with package name
> ---
>
> Key: GROOVY-8362
> URL: https://issues.apache.org/jira/browse/GROOVY-8362
> Project: Groovy
>  Issue Type: Bug
>Reporter: Daniil Ovchinnikov
>Assignee: Jochen Theodorou
>Priority: Critical
> Fix For: 2.4.14
>
>
> {code:title=bugs/bugs.groovy}
> package bugs
> class Current {
>   static class bugs {
> static class Target {}
>   }
>   static usage() {
> new Target() // error expected
>   }
> }
> println Current.usage() // bugs.Current$bugs$Target@20d28811
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Resolved] (GROOVY-8362) Nested class is resolved via another nested class with package name

2018-01-03 Thread Paul King (JIRA)

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

Paul King resolved GROOVY-8362.
---
   Resolution: Fixed
Fix Version/s: 2.4.14

> Nested class is resolved via another nested class with package name
> ---
>
> Key: GROOVY-8362
> URL: https://issues.apache.org/jira/browse/GROOVY-8362
> Project: Groovy
>  Issue Type: Bug
>Reporter: Daniil Ovchinnikov
>Assignee: Jochen Theodorou
>Priority: Critical
> Fix For: 2.4.14
>
>
> {code:title=bugs/bugs.groovy}
> package bugs
> class Current {
>   static class bugs {
> static class Target {}
>   }
>   static usage() {
> new Target() // error expected
>   }
> }
> println Current.usage() // bugs.Current$bugs$Target@20d28811
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (GROOVY-8362) Nested class is resolved via another nested class with package name

2018-01-03 Thread Jochen Theodorou (JIRA)

[ 
https://issues.apache.org/jira/browse/GROOVY-8362?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16310632#comment-16310632
 ] 

Jochen Theodorou commented on GROOVY-8362:
--

looks good to me

> Nested class is resolved via another nested class with package name
> ---
>
> Key: GROOVY-8362
> URL: https://issues.apache.org/jira/browse/GROOVY-8362
> Project: Groovy
>  Issue Type: Bug
>Reporter: Daniil Ovchinnikov
>Assignee: Jochen Theodorou
>Priority: Critical
>
> {code:title=bugs/bugs.groovy}
> package bugs
> class Current {
>   static class bugs {
> static class Target {}
>   }
>   static usage() {
> new Target() // error expected
>   }
> }
> println Current.usage() // bugs.Current$bugs$Target@20d28811
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (GROOVY-8362) Nested class is resolved via another nested class with package name

2018-01-03 Thread Paul King (JIRA)

[ 
https://issues.apache.org/jira/browse/GROOVY-8362?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16310621#comment-16310621
 ] 

Paul King commented on GROOVY-8362:
---

[~blackdrag] This looks okay to me. What do you think?

> Nested class is resolved via another nested class with package name
> ---
>
> Key: GROOVY-8362
> URL: https://issues.apache.org/jira/browse/GROOVY-8362
> Project: Groovy
>  Issue Type: Bug
>Reporter: Daniil Ovchinnikov
>Assignee: Jochen Theodorou
>Priority: Critical
>
> {code:title=bugs/bugs.groovy}
> package bugs
> class Current {
>   static class bugs {
> static class Target {}
>   }
>   static usage() {
> new Target() // error expected
>   }
> }
> println Current.usage() // bugs.Current$bugs$Target@20d28811
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Resolved] (GROOVY-8430) @Field doesn't support final fields

2018-01-03 Thread Paul King (JIRA)

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

Paul King resolved GROOVY-8430.
---
   Resolution: Fixed
 Assignee: Paul King
Fix Version/s: 2.5.0-beta-3

Proposed PR merged. Groovy 2_4_X never provided the setter (it was part of 
allowing CLI builder annotation enhancements to work with scripts - AKA 
{{@OptionField}}) so fix wasn't required for that branch.

> @Field doesn't support final fields
> ---
>
> Key: GROOVY-8430
> URL: https://issues.apache.org/jira/browse/GROOVY-8430
> Project: Groovy
>  Issue Type: Bug
>Reporter: Paul King
>Assignee: Paul King
> Fix For: 2.5.0-beta-3
>
>
> We do slightly stricter checking of final modifiers for fields in 2.5 but 
> @Field has problems with code like this:
> {code}
> @Field final foo = 42
> {code}
> giving the error:
> {noformat}
> cannot modify final field 'foo' outside of constructor.
> {noformat}
> It turns out the {{setFoo}} method we create as a helper method shouldn't be 
> created for the final case.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (GROOVY-8430) @Field doesn't support final fields

2018-01-03 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/GROOVY-8430?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16310524#comment-16310524
 ] 

ASF GitHub Bot commented on GROOVY-8430:


Github user asfgit closed the pull request at:

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


> @Field doesn't support final fields
> ---
>
> Key: GROOVY-8430
> URL: https://issues.apache.org/jira/browse/GROOVY-8430
> Project: Groovy
>  Issue Type: Bug
>Reporter: Paul King
>
> We do slightly stricter checking of final modifiers for fields in 2.5 but 
> @Field has problems with code like this:
> {code}
> @Field final foo = 42
> {code}
> giving the error:
> {noformat}
> cannot modify final field 'foo' outside of constructor.
> {noformat}
> It turns out the {{setFoo}} method we create as a helper method shouldn't be 
> created for the final case.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[GitHub] groovy pull request #652: fix for: GROOVY-8430: @Field doesn't support final...

2018-01-03 Thread asfgit
Github user asfgit closed the pull request at:

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


---


[jira] [Commented] (GROOVY-8431) toDebugString method as a core concept

2018-01-03 Thread Paul King (JIRA)

[ 
https://issues.apache.org/jira/browse/GROOVY-8431?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16310437#comment-16310437
 ] 

Paul King commented on GROOVY-8431:
---

Some points to consider in no particular order:
* if any one has in-depth knowledge of what other languages provide in this 
area, please feel free to comment
* we already have the {{dump}} method - is that a suitable starting point?
* we should clarify the intent when we say "human" readable output - my guess 
is we mean suitable for consumption by a "human developer"
* we already have some methods with different but related functionality, 
can/should we be leveraging/generalising those methods, e.g. the output from 
failed assert statements, {{InvokerHelper#toArrayString(Object[] array, boolean 
verbose, int maxSize, boolean safe)}} and {{InvokerHelper#(Collection arg, int 
maxSize, boolean safe)}}
* we should consider previous requests to override the default {{toString}} for 
some of the built-in formatting and/or more generally, e.g. pr#566, 
GROOVY-3250, GROOVY-4654, GROOVY-4653, GROOVY-4302

> toDebugString method as a core concept
> --
>
> Key: GROOVY-8431
> URL: https://issues.apache.org/jira/browse/GROOVY-8431
> Project: Groovy
>  Issue Type: Proposal
>  Components: GEP, groovy-jdk
>Affects Versions: 3.x, 2.5.x
>Reporter: mgroovy
>  Labels: features
>
> * Groovy should introduce a toDebugString method as a core concept, to 
> separate debug to-string-conversion semantics from heavily oversubscribed 
> standard Java Object#toString.
> * The power of this feature as a core concept lies in support to create
> ## Easy to use, human readable debug output of any object
> ## Creating debug output of objects owned by other objects (i.e. hierarchical 
> debug output)
> * Adding this feature should be relatively simple, the challenge is to decide 
> what features/parameters toDebugString should have, because this will be hard 
> to change once the feature has been introduced.   
> * The default implementation could
> ## Call the Java default Object#toString method
> ## Automatically create a reflection based output (performance will probably 
> be bad for this, so it might be better to enable this behavior through an 
> annotation)
> ## Returns something along the line of getClass().simpleName + '@' + 
> System.identityHashcode(this) (though Object#toString is probably more useful)
> ## Fall back to the class' toString method (although in most cases it's most 
> likely not what the user wants/expects)
> * An extension would be for an overloaded toDebugString to take an 
> indentationLevel and indentationString parameter:
> {code}String toDebugString(int indentationLevel, String indentationString = 
> '\t'){code}
> ** Implementations would be expected to indent the resulting String 
> accordingly, which is very helpful for
> ### Complex objects which require a multi-line output to make sense of them 
> in a debug log
> ### Outputting inner objects (e.g. a collection) owned by an object
> ** Groovy default implementation could be, to indent the result of calling 
> toDebugString(), by scanning for newline sequences in the returned string
> * Questions:
> ## Is there a better name than the (relatively long) "toDebugString" ?
> *** toDebugString was suggested, since it is easy to discover, and its 
> purpose should immediately clear
> ## Should the return type of toDebugString be GString instead of String ?
> *** This would allow for Groovy to process the objects embedded in the 
> GString differently
> *** Having an additional GString toDebugGString() method might be an 
> alternative
> ## Should there be additional parameters such as a terseness/verboseness 
> parameter, which indicates how compact or verbose the generated debug string 
> should be (implementations would be free to ignore this, of course) ?



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Created] (GROOVY-8431) toDebugString method as a core concept

2018-01-03 Thread mgroovy (JIRA)
mgroovy created GROOVY-8431:
---

 Summary: toDebugString method as a core concept
 Key: GROOVY-8431
 URL: https://issues.apache.org/jira/browse/GROOVY-8431
 Project: Groovy
  Issue Type: Proposal
  Components: GEP, groovy-jdk
Affects Versions: 3.x, 2.5.x
Reporter: mgroovy


* Groovy should introduce a toDebugString method as a core concept, to separate 
debug to-string-conversion semantics from heavily oversubscribed standard Java 
Object#toString.
* The power of this feature as a core concept lies in support to create
## Easy to use, human readable debug output of any object
## Creating debug output of objects owned by other objects (i.e. hierarchical 
debug output)
* Adding this feature should be relatively simple, the challenge is to decide 
what features/parameters toDebugString should have, because this will be hard 
to change once the feature has been introduced.   
* The default implementation could
## Call the Java default Object#toString method
## Automatically create a reflection based output (performance will probably be 
bad for this, so it might be better to enable this behavior through an 
annotation)
## Returns something along the line of getClass().simpleName + '@' + 
System.identityHashcode(this) (though Object#toString is probably more useful)
## Fall back to the class' toString method (although in most cases it's most 
likely not what the user wants/expects)
* An extension would be for an overloaded toDebugString to take an 
indentationLevel and indentationString parameter:
{code}String toDebugString(int indentationLevel, String indentationString = 
'\t'){code}
** Implementations would be expected to indent the resulting String 
accordingly, which is very helpful for
### Complex objects which require a multi-line output to make sense of them in 
a debug log
### Outputting inner objects (e.g. a collection) owned by an object
** Groovy default implementation could be, to indent the result of calling 
toDebugString(), by scanning for newline sequences in the returned string
* Questions:
## Is there a better name than the (relatively long) "toDebugString" ?
*** toDebugString was suggested, since it is easy to discover, and its purpose 
should immediately clear
## Should the return type of toDebugString be GString instead of String ?
*** This would allow for Groovy to process the objects embedded in the GString 
differently
*** Having an additional GString toDebugGString() method might be an alternative
## Should there be additional parameters such as a terseness/verboseness 
parameter, which indicates how compact or verbose the generated debug string 
should be (implementations would be free to ignore this, of course) ?



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Resolved] (GROOVY-8429) Jar files under indy directory of distribution miss the file extension(i.e. jar)

2018-01-03 Thread Paul King (JIRA)

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

Paul King resolved GROOVY-8429.
---
   Resolution: Fixed
 Assignee: Paul King
Fix Version/s: 2.5.0-beta-3

I fixed the regex problem. I note that only the test artifact for grooid 
directory appears but I guess that is a separate issue.

>  Jar files under indy directory of distribution miss the file extension(i.e. 
> jar) 
> --
>
> Key: GROOVY-8429
> URL: https://issues.apache.org/jira/browse/GROOVY-8429
> Project: Groovy
>  Issue Type: Bug
>Reporter: Daniel Sun
>Assignee: Paul King
> Fix For: 2.5.0-beta-3
>
>
>  I found jar files under indy directory of distribution miss the file
> extension(i.e. jar)...
> *apache-groovy-binary-3.0.0-SNAPSHOT.zip\groovy-3.0.0-SNAPSHOT\indy*
> groovy-3.0.0-SNAPSHOT   groovy-macro-3.0.0-SNAPSHOT
> groovy-ant-3.0.0-SNAPSHOT   groovy-nio-3.0.0-SNAPSHOT
> groovy-bsf-3.0.0-SNAPSHOT   groovy-servlet-3.0.0-SNAPSHOT
> groovy-console-3.0.0-SNAPSHOT   groovy-sql-3.0.0-SNAPSHOT
> groovy-docgenerator-3.0.0-SNAPSHOT  groovy-swing-3.0.0-SNAPSHOT
> groovy-groovydoc-3.0.0-SNAPSHOT groovy-templates-3.0.0-SNAPSHOT
> groovy-groovysh-3.0.0-SNAPSHOT  groovy-test-3.0.0-SNAPSHOT
> groovy-jmx-3.0.0-SNAPSHOT   groovy-testng-3.0.0-SNAPSHOT
> groovy-json-3.0.0-SNAPSHOT  groovy-xml-3.0.0-SNAPSHOT
> groovy-jsr223-3.0.0-SNAPSHOT
> 2.6.0-SNAPSHOT and 2.5.0-SNAPSHOT have the same issue.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (GROOVY-8429) Jar files under indy directory of distribution miss the file extension(i.e. jar)

2018-01-03 Thread Paul King (JIRA)

[ 
https://issues.apache.org/jira/browse/GROOVY-8429?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16309275#comment-16309275
 ] 

Paul King commented on GROOVY-8429:
---

Looks like it applies to the grooid artifacts too - my guess is the rename 
regex is too aggressive. I'll try an experiment.

>  Jar files under indy directory of distribution miss the file extension(i.e. 
> jar) 
> --
>
> Key: GROOVY-8429
> URL: https://issues.apache.org/jira/browse/GROOVY-8429
> Project: Groovy
>  Issue Type: Bug
>Reporter: Daniel Sun
>
>  I found jar files under indy directory of distribution miss the file
> extension(i.e. jar)...
> *apache-groovy-binary-3.0.0-SNAPSHOT.zip\groovy-3.0.0-SNAPSHOT\indy*
> groovy-3.0.0-SNAPSHOT   groovy-macro-3.0.0-SNAPSHOT
> groovy-ant-3.0.0-SNAPSHOT   groovy-nio-3.0.0-SNAPSHOT
> groovy-bsf-3.0.0-SNAPSHOT   groovy-servlet-3.0.0-SNAPSHOT
> groovy-console-3.0.0-SNAPSHOT   groovy-sql-3.0.0-SNAPSHOT
> groovy-docgenerator-3.0.0-SNAPSHOT  groovy-swing-3.0.0-SNAPSHOT
> groovy-groovydoc-3.0.0-SNAPSHOT groovy-templates-3.0.0-SNAPSHOT
> groovy-groovysh-3.0.0-SNAPSHOT  groovy-test-3.0.0-SNAPSHOT
> groovy-jmx-3.0.0-SNAPSHOT   groovy-testng-3.0.0-SNAPSHOT
> groovy-json-3.0.0-SNAPSHOT  groovy-xml-3.0.0-SNAPSHOT
> groovy-jsr223-3.0.0-SNAPSHOT
> 2.6.0-SNAPSHOT and 2.5.0-SNAPSHOT have the same issue.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)