[jira] [Updated] (GROOVY-8006) [PARROT] Allow dropping 'def' or type in try with resources

2019-05-20 Thread Paul King (JIRA)


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

Paul King updated GROOVY-8006:
--
Summary: [PARROT] Allow dropping 'def' or type in try with resources  (was: 
[parrot] Allow dropping 'def' or type in try with resources)

> [PARROT] Allow dropping 'def' or type in try with resources
> ---
>
> Key: GROOVY-8006
> URL: https://issues.apache.org/jira/browse/GROOVY-8006
> Project: Groovy
>  Issue Type: Improvement
> Environment: Parrot parser
>Reporter: Guillaume Laforge
>Assignee: Daniel Sun
>Priority: Major
>
> With try with resources, it would be nice to be able the type or def, just 
> like in the classical for loop:
> {code}
> import java.util.zip.GZIPOutputStream


> def input = new File('./NOTICE')
> 
def output = new File('/tmp/zipped.zip')


> try (
> 
   fin = new FileInputStream(input);

>out = new GZIPOutputStream(new FileOutputStream(output))

> ) {

> byte[] buffer = new byte[4096]

> int nread = 0

> while ((nread = fin.read(buffer)) != -1) {
> 
out.write(buffer, 0, nread)

> }

> }
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Updated] (GROOVY-8006) [parrot] Allow dropping 'def' or type in try with resources

2016-11-25 Thread Guillaume Laforge (JIRA)

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

Guillaume Laforge updated GROOVY-8006:
--
Assignee: Daniel.Sun

> [parrot] Allow dropping 'def' or type in try with resources
> ---
>
> Key: GROOVY-8006
> URL: https://issues.apache.org/jira/browse/GROOVY-8006
> Project: Groovy
>  Issue Type: Improvement
> Environment: Parrot parser
>Reporter: Guillaume Laforge
>Assignee: Daniel.Sun
>
> With try with resources, it would be nice to be able the type or def, just 
> like in the classical for loop:
> {code}
> import java.util.zip.GZIPOutputStream


> def input = new File('./NOTICE')
> 
def output = new File('/tmp/zipped.zip')


> try (
> 
   fin = new FileInputStream(input);

>out = new GZIPOutputStream(new FileOutputStream(output))

> ) {

> byte[] buffer = new byte[4096]

> int nread = 0

> while ((nread = fin.read(buffer)) != -1) {
> 
out.write(buffer, 0, nread)

> }

> }
> {code}



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


[jira] [Updated] (GROOVY-8006) [parrot] Allow dropping 'def' or type in try with resources

2016-11-25 Thread Guillaume Laforge (JIRA)

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

Guillaume Laforge updated GROOVY-8006:
--
Summary: [parrot] Allow dropping 'def' or type in try with resources  (was: 
Allow dropping 'def' or type in try with resources)

> [parrot] Allow dropping 'def' or type in try with resources
> ---
>
> Key: GROOVY-8006
> URL: https://issues.apache.org/jira/browse/GROOVY-8006
> Project: Groovy
>  Issue Type: Improvement
> Environment: Parrot parser
>Reporter: Guillaume Laforge
>
> With try with resources, it would be nice to be able the type or def, just 
> like in the classical for loop:
> {code}
> import java.util.zip.GZIPOutputStream


> def input = new File('./NOTICE')
> 
def output = new File('/tmp/zipped.zip')


> try (
> 
   fin = new FileInputStream(input);

>out = new GZIPOutputStream(new FileOutputStream(output))

> ) {

> byte[] buffer = new byte[4096]

> int nread = 0

> while ((nread = fin.read(buffer)) != -1) {
> 
out.write(buffer, 0, nread)

> }

> }
> {code}



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