[jira] [Updated] (GROOVY-7544) Nearly Duplicate sections in documentation

2015-08-07 Thread Aseem Bansal (JIRA)

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

Aseem Bansal updated GROOVY-7544:
-
Description: 
I was reading the documentation when I noticed that these two sections 
* http://www.groovy-lang.org/download.html
* http://www.groovy-lang.org/install.html

are nearly duplicate. It seems that due to duplicatacy both of them have some 
information which the other one does not have. It would be better to merge them 
into single section.

I would suggest to just keep the download section as it is better looking. 
Merge the extra information from install section and then delete the install 
section. 

  was:
I was reading the documentation when I noticed that these two sections 
* http://www.groovy-lang.org/download.html
* http://www.groovy-lang.org/install.html

are nearly duplicate. It seems that due to duplicatacy both of them have some 
information which the other ne does not have. It would be better to merge them 
into single section.


> Nearly Duplicate sections in documentation
> --
>
> Key: GROOVY-7544
> URL: https://issues.apache.org/jira/browse/GROOVY-7544
> Project: Groovy
>  Issue Type: Improvement
>  Components: Documentation
>Affects Versions: 2.4.4
>Reporter: Aseem Bansal
>
> I was reading the documentation when I noticed that these two sections 
> * http://www.groovy-lang.org/download.html
> * http://www.groovy-lang.org/install.html
> are nearly duplicate. It seems that due to duplicatacy both of them have some 
> information which the other one does not have. It would be better to merge 
> them into single section.
> I would suggest to just keep the download section as it is better looking. 
> Merge the extra information from install section and then delete the install 
> section. 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Created] (GROOVY-7544) Nearly Duplicate sections in documentation

2015-08-07 Thread Aseem Bansal (JIRA)
Aseem Bansal created GROOVY-7544:


 Summary: Nearly Duplicate sections in documentation
 Key: GROOVY-7544
 URL: https://issues.apache.org/jira/browse/GROOVY-7544
 Project: Groovy
  Issue Type: Improvement
  Components: Documentation
Affects Versions: 2.4.4
Reporter: Aseem Bansal


I was reading the documentation when I noticed that these two sections 
* http://www.groovy-lang.org/download.html
* http://www.groovy-lang.org/install.html

are nearly duplicate. It seems that due to duplicatacy both of them have some 
information which the other ne does not have. It would be better to merge them 
into single section.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[GitHub] incubator-groovy pull request: Minor changes

2015-08-07 Thread anshbansal
GitHub user anshbansal opened a pull request:

https://github.com/apache/incubator-groovy/pull/81

Minor changes

These are extra keywords not different.

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

$ git pull https://github.com/anshbansal/incubator-groovy patch-6

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

https://github.com/apache/incubator-groovy/pull/81.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 #81


commit 884bdd42d97c78305d51f3d9022daae538c68926
Author: Aseem Bansal 
Date:   2015-08-07T20:31:32Z

Minor changes

These are extra keywords not different.




---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[jira] [Updated] (GROOVY-7543) Suggestion for Download page

2015-08-07 Thread Aseem Bansal (JIRA)

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

Aseem Bansal updated GROOVY-7543:
-
Description: 
On the groovy website download page http://www.groovy-lang.org/download.html 
there is a "System requirements" at the bottom.

It says "JVM Required". Is it minimum/maximum/only version of JVM supported? If 
it is based on some automated build to test compatibility it would be good to 
link that.

  was:
On the groovy website download page http://www.groovy-lang.org/download.html 
there is a "System requirements" at the bottom.

It says "JVM Required". Is it minimum/maximum/only ? If it is based on some 
automated build to test compatibility it would be good to link that.


> Suggestion for Download page
> 
>
> Key: GROOVY-7543
> URL: https://issues.apache.org/jira/browse/GROOVY-7543
> Project: Groovy
>  Issue Type: Improvement
>  Components: Documentation
>Affects Versions: 2.4.4
> Environment: Website
>Reporter: Aseem Bansal
>Priority: Trivial
>
> On the groovy website download page http://www.groovy-lang.org/download.html 
> there is a "System requirements" at the bottom.
> It says "JVM Required". Is it minimum/maximum/only version of JVM supported? 
> If it is based on some automated build to test compatibility it would be good 
> to link that.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Created] (GROOVY-7543) Suggestion for Download page

2015-08-07 Thread Aseem Bansal (JIRA)
Aseem Bansal created GROOVY-7543:


 Summary: Suggestion for Download page
 Key: GROOVY-7543
 URL: https://issues.apache.org/jira/browse/GROOVY-7543
 Project: Groovy
  Issue Type: Improvement
  Components: Documentation
Affects Versions: 2.4.4
 Environment: Website
Reporter: Aseem Bansal
Priority: Trivial


On the groovy website download page http://www.groovy-lang.org/download.html 
there is a "System requirements" at the bottom.

It says "JVM Required". Is it minimum/maximum/only ? If it is based on some 
automated build to test compatibility it would be good to link that.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Comment Edited] (GROOVY-7542) CompileStatic class generation bug "register with message: rightShiftUnsigned and arguments X"

2015-08-07 Thread Matias Bjarland (JIRA)

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

Matias Bjarland edited comment on GROOVY-7542 at 8/7/15 11:46 AM:
--

An additional nugget of information on this issue. Pasting in my original (non 
simplified...kind of...left out the lengthy 'table' def) code: 

{code:language=groovy}
@CompileStatic
long crc64(File file) {
  long register = 0xfac432b10cd5e44aL
  def table = []

  int KB = 1024
  int MB = 1024*KB

  file.eachByte(MB) { byte[] buf, int bytesRead ->
buf[0..(bytesRead-1)].each { long element -> 
  long tmp = register

  int t = (int) (tmp >>> 56 ^ element)
  tmp <<= 8
  tmp ^= table[t]

  register = tmp
} 
  }

  register
}
{code}

assigning the variable 'register' to  'tmp' and then performing the shift 
operations on 'tmp' resolves the issue. Performing the operations directly on 
'register' above causes the same error as in the issue description. 


was (Author: mbjarland):
An additional nugget of information on this issue. Pasting in my original (non 
simplified...kind of...left out the lengthy 'table' def) code: 

{code:language=groovy}
@CompileStatic
long crc64(File file) {
  long register = 0xfac432b10cd5e44aL
  def table = []

  int KB = 1024
  int MB = 1024*KB

  file.eachByte(MB) { byte[] buf, int bytesRead ->
buf[0, bytesRead-1].each { long element -> 
  long tmp = register

  int t = (int) (tmp >>> 56 ^ element)
  tmp <<= 8
  tmp ^= table[t]

  register = tmp
} 
  }

  register
}
{code}

assigning the variable 'register' to  'tmp' and then performing the shift 
operations on 'tmp' resolves the issue. Performing the operations directly on 
'register' above causes the same error as in the issue description. 

> CompileStatic class generation bug "register with message: rightShiftUnsigned 
> and arguments X"
> --
>
> Key: GROOVY-7542
> URL: https://issues.apache.org/jira/browse/GROOVY-7542
> Project: Groovy
>  Issue Type: Bug
>  Components: Static compilation
>Affects Versions: 2.4.4
> Environment: Groovy Version: 2.4.4 JVM: 1.7.0_55 Vendor: Oracle 
> Corporation OS: Linux
>Reporter: Matias Bjarland
>
> Error caused by the following code snippet (was in the process of coding a 
> crc64 algorithm): 
> {code:language=groovy}
> import groovy.transform.CompileStatic 
> test()
> @CompileStatic
> def test() {
>   long register = 0xfac432b10cd5e44aL  
>   
>   [1,2,3].each { int element -> 
> int t = (int) (register >>> 56 ^ (long) element) & 0xff
>   }  
> }
> {code}
> execution example: 
> {code}
> $ groovy test.groovy 
> Caught: BUG! exception in phase 'class generation' in source unit 
> '/home/mbjarland/test.groovy' At line 11 column 20
> On receiver: register with message: rightShiftUnsigned and arguments: 56
> This method should not have been called. Please try to create a simple 
> example reproducing this error and filea bug report at 
> https://issues.apache.org/jira/browse/GROOVY
> BUG! exception in phase 'class generation' in source unit 
> '/home/mbjarland/projects/kohler.project/projects/full-publish/test.groovy' 
> At line 11 column 20
> On receiver: register with message: rightShiftUnsigned and arguments: 56
> This method should not have been called. Please try to create a simple 
> example reproducing this error and filea bug report at 
> https://issues.apache.org/jira/browse/GROOVY
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (GROOVY-7540) Add a method to StringGroovyMethods for replacing String pairs supplied as a Map

2015-08-07 Thread Jochen Kemnade (JIRA)

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

Jochen Kemnade commented on GROOVY-7540:


Then I guess we still have to create a ReplaceState object even if we're not 
going to replace anything. But the StringBuilder init could be moved down to 
line 2888.
We could determine the correct size for the StringBuilder, but that might be 
more resource-intensive than having it expand on demand. We could just go for x 
* text.length() and hope that it will be enough. I'd prefer a larger factor 
though, maybe even 100%.

> Add a method to StringGroovyMethods for replacing String pairs supplied as a 
> Map
> 
>
> Key: GROOVY-7540
> URL: https://issues.apache.org/jira/browse/GROOVY-7540
> Project: Groovy
>  Issue Type: Improvement
>Reporter: Jochen Kemnade
>Priority: Minor
>
> It should be possible to use a map with {{collectReplacements}}, like in
> {code}
> "f006ar".collectReplacements(["0":"o", "6":"b"])
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (GROOVY-7542) CompileStatic class generation bug "register with message: rightShiftUnsigned and arguments X"

2015-08-07 Thread Matias Bjarland (JIRA)

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

Matias Bjarland commented on GROOVY-7542:
-

An additional nugget of information on this issue. Pasting in my original (non 
simplified...kind of...left out the lengthy 'table' def) code: 

{code:language=groovy}
@CompileStatic
long crc64(File file) {
  long register = 0xfac432b10cd5e44aL
  def table = []

  int KB = 1024
  int MB = 1024*KB

  file.eachByte(MB) { byte[] buf, int bytesRead ->
buf[0, bytesRead-1].each { long element -> 
  long tmp = register

  int t = (int) (tmp >>> 56 ^ element)
  tmp <<= 8
  tmp ^= table[t]

  register = tmp
} 
  }

  register
}
{code}

assigning the variable 'register' to  'tmp' and then performing the shift 
operations on 'tmp' resolves the issue. Performing the operations directly on 
'register' above causes the same error as in the issue description. 

> CompileStatic class generation bug "register with message: rightShiftUnsigned 
> and arguments X"
> --
>
> Key: GROOVY-7542
> URL: https://issues.apache.org/jira/browse/GROOVY-7542
> Project: Groovy
>  Issue Type: Bug
>  Components: Static compilation
>Affects Versions: 2.4.4
> Environment: Groovy Version: 2.4.4 JVM: 1.7.0_55 Vendor: Oracle 
> Corporation OS: Linux
>Reporter: Matias Bjarland
>
> Error caused by the following code snippet (was in the process of coding a 
> crc64 algorithm): 
> {code:language=groovy}
> import groovy.transform.CompileStatic 
> test()
> @CompileStatic
> def test() {
>   long register = 0xfac432b10cd5e44aL  
>   
>   [1,2,3].each { int element -> 
> int t = (int) (register >>> 56 ^ (long) element) & 0xff
>   }  
> }
> {code}
> execution example: 
> {code}
> $ groovy test.groovy 
> Caught: BUG! exception in phase 'class generation' in source unit 
> '/home/mbjarland/test.groovy' At line 11 column 20
> On receiver: register with message: rightShiftUnsigned and arguments: 56
> This method should not have been called. Please try to create a simple 
> example reproducing this error and filea bug report at 
> https://issues.apache.org/jira/browse/GROOVY
> BUG! exception in phase 'class generation' in source unit 
> '/home/mbjarland/projects/kohler.project/projects/full-publish/test.groovy' 
> At line 11 column 20
> On receiver: register with message: rightShiftUnsigned and arguments: 56
> This method should not have been called. Please try to create a simple 
> example reproducing this error and filea bug report at 
> https://issues.apache.org/jira/browse/GROOVY
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (GROOVY-7540) Add a method to StringGroovyMethods for replacing String pairs supplied as a Map

2015-08-07 Thread Paul King (JIRA)

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

Paul King commented on GROOVY-7540:
---

Yes, groovyTestCase is a nice feature.

There is a rather complicated guess at StringBuilder size in the Apache method 
which I didn't carry over and a worse case guess could easily consume large 
amounts of memory. There might be a compromise approach - perhaps something as 
simple as checking if any replacement is bigger than the original and if so, 
add (say) 20% otherwise just use the original size.

The early returns are well catered for - once at the beginning and then a 
boolean array allows pairs to be ignored once they become irrelevant.

> Add a method to StringGroovyMethods for replacing String pairs supplied as a 
> Map
> 
>
> Key: GROOVY-7540
> URL: https://issues.apache.org/jira/browse/GROOVY-7540
> Project: Groovy
>  Issue Type: Improvement
>Reporter: Jochen Kemnade
>Priority: Minor
>
> It should be possible to use a map with {{collectReplacements}}, like in
> {code}
> "f006ar".collectReplacements(["0":"o", "6":"b"])
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (GROOVY-7540) Add a method to StringGroovyMethods for replacing String pairs supplied as a Map

2015-08-07 Thread Jochen Kemnade (JIRA)

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

Jochen Kemnade commented on GROOVY-7540:


Is the content of {{}} run as part of the test 
suite? Neat!
It looks good to me. The StringBuilder initialization could be tweaked though, 
it could be initialized with a definite capacity to avoid calls to 
ensureCapacity later. The hard part is to know the correct size. If I'm not 
mistaken, the worst case is {noformat}text.length() * 
ceil(max(replacements.values()*.length()) / 
min(replacements.keySet()*.length()){noformat}. And if 
{noformat}replacements.keySet().find{text.indexOf(it) >= 0} == null{noformat}, 
we can exit early to improve the performance of things like 
{noformat}'foobar'.replace([x:'y']){noformat}.

> Add a method to StringGroovyMethods for replacing String pairs supplied as a 
> Map
> 
>
> Key: GROOVY-7540
> URL: https://issues.apache.org/jira/browse/GROOVY-7540
> Project: Groovy
>  Issue Type: Improvement
>Reporter: Jochen Kemnade
>Priority: Minor
>
> It should be possible to use a map with {{collectReplacements}}, like in
> {code}
> "f006ar".collectReplacements(["0":"o", "6":"b"])
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (GROOVY-7540) Add a method to StringGroovyMethods for replacing String pairs supplied as a Map

2015-08-07 Thread Paul King (JIRA)

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

Paul King commented on GROOVY-7540:
---

let me know if the PR looks like what you want

> Add a method to StringGroovyMethods for replacing String pairs supplied as a 
> Map
> 
>
> Key: GROOVY-7540
> URL: https://issues.apache.org/jira/browse/GROOVY-7540
> Project: Groovy
>  Issue Type: Improvement
>Reporter: Jochen Kemnade
>Priority: Minor
>
> It should be possible to use a map with {{collectReplacements}}, like in
> {code}
> "f006ar".collectReplacements(["0":"o", "6":"b"])
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (GROOVY-7540) Add a method to StringGroovyMethods for replacing String pairs supplied as a Map

2015-08-07 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on GROOVY-7540:


GitHub user paulk-asert opened a pull request:

https://github.com/apache/incubator-groovy/pull/80

GROOVY-7540: Add a method to StringGroovyMethods for replacing String…

… pairs supplied as a Map

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

$ git pull https://github.com/paulk-asert/incubator-groovy groovy7540

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

https://github.com/apache/incubator-groovy/pull/80.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 #80


commit 96db0005e8774bc45c4111ad057ece7d09e161c3
Author: Paul King 
Date:   2015-08-07T10:06:12Z

GROOVY-7540: Add a method to StringGroovyMethods for replacing String pairs 
supplied as a Map




> Add a method to StringGroovyMethods for replacing String pairs supplied as a 
> Map
> 
>
> Key: GROOVY-7540
> URL: https://issues.apache.org/jira/browse/GROOVY-7540
> Project: Groovy
>  Issue Type: Improvement
>Reporter: Jochen Kemnade
>Priority: Minor
>
> It should be possible to use a map with {{collectReplacements}}, like in
> {code}
> "f006ar".collectReplacements(["0":"o", "6":"b"])
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[GitHub] incubator-groovy pull request: GROOVY-7540: Add a method to String...

2015-08-07 Thread paulk-asert
GitHub user paulk-asert opened a pull request:

https://github.com/apache/incubator-groovy/pull/80

GROOVY-7540: Add a method to StringGroovyMethods for replacing String…

… pairs supplied as a Map

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

$ git pull https://github.com/paulk-asert/incubator-groovy groovy7540

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

https://github.com/apache/incubator-groovy/pull/80.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 #80


commit 96db0005e8774bc45c4111ad057ece7d09e161c3
Author: Paul King 
Date:   2015-08-07T10:06:12Z

GROOVY-7540: Add a method to StringGroovyMethods for replacing String pairs 
supplied as a Map




---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[jira] [Updated] (GROOVY-7540) Add a method to StringGroovyMethods for replacing String pairs supplied as a Map

2015-08-07 Thread Paul King (JIRA)

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

Paul King updated GROOVY-7540:
--
Summary: Add a method to StringGroovyMethods for replacing String pairs 
supplied as a Map  (was: Add StringGroovyMethods.collectReplacements(String, 
Map))

> Add a method to StringGroovyMethods for replacing String pairs supplied as a 
> Map
> 
>
> Key: GROOVY-7540
> URL: https://issues.apache.org/jira/browse/GROOVY-7540
> Project: Groovy
>  Issue Type: Improvement
>Reporter: Jochen Kemnade
>Priority: Minor
>
> It should be possible to use a map with {{collectReplacements}}, like in
> {code}
> "f006ar".collectReplacements(["0":"o", "6":"b"])
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)