[jira] [Created] (GROOVY-9557) Bump gradle to 6.4.1

2020-05-15 Thread Paul King (Jira)
Paul King created GROOVY-9557:
-

 Summary: Bump gradle to 6.4.1
 Key: GROOVY-9557
 URL: https://issues.apache.org/jira/browse/GROOVY-9557
 Project: Groovy
  Issue Type: Dependency upgrade
Reporter: Paul King
Assignee: Paul King






--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Updated] (GROOVY-9556) Stub generated does not contain the effect of AST transformation during joint compilation

2020-05-15 Thread Daniel Sun (Jira)


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

Daniel Sun updated GROOVY-9556:
---
Summary: Stub generated does not contain the effect of AST transformation 
during joint compilation  (was: Joint compilation is broken in some cases)

> Stub generated does not contain the effect of AST transformation during joint 
> compilation
> -
>
> Key: GROOVY-9556
> URL: https://issues.apache.org/jira/browse/GROOVY-9556
> Project: Groovy
>  Issue Type: Bug
>Reporter: Daniel Sun
>Priority: Major
>
> http://groovy.329449.n5.nabble.com/More-Groovy-3-woes-td5768022.html
> {code:java}
> ===
> 194 ocs /tmp>  /*
>  * Copyright 2015 The Apache Software Foundation.
>  * OC: removed almost all code, leaving just what's needed to crash
>  */
> package org.apache.pdfbox.examples.signature;
> import java.io.IOException;
> import java.io.InputStream;
> import java.security.KeyStore;
> import java.security.KeyStoreException;
> import java.security.NoSuchAlgorithmException;
> import java.security.UnrecoverableKeyException;
> import java.security.cert.CertificateException;
> import 
> org.apache.pdfbox.pdmodel.interactive.digitalsignature.SignatureInterface;
> public abstract class CreateSignatureBase implements SignatureInterface
> {
> public CreateSignatureBase(KeyStore keystore, char[] pin)
> throws KeyStoreException, UnrecoverableKeyException, 
> NoSuchAlgorithmException, IOException, CertificateException
> { }
> @Override
> public byte[] sign(InputStream content) throws IOException
> {
> return null;
> }
> }
> 195 ocs /tmp>  package cz.ocs.utilities
> import groovy.transform.*
> import org.apache.pdfbox.pdmodel.*
> import org.apache.pdfbox.examples.signature.CreateSignatureBase
> @InheritConstructors class CreateSignature extends CreateSignatureBase {
> void signPDF(PDDocument pdd, OutputStream out) {
> }
> }
> 196 ocs /tmp> /usr/local/groovy-2.4.17/bin/groovyc -cp 
> /Extensions/pdfbox-2.0.17.jar -j myclass.groovy CreateSignatureBase.java
> 197 ocs /tmp> /usr/local/groovy-3.0.3/bin/groovyc -cp 
> /Extensions/pdfbox-2.0.17.jar -j myclass.groovy CreateSignatureBase.java
> org.codehaus.groovy.control.MultipleCompilationErrorsException: startup 
> failed:
> Compile error during compilation with javac.
> /var/folders/zh/h4cv6xjx033frtt9y72ch898gp/T/groovy-generated-8946934250394256568-java-source/cz/ocs/utilities/CreateSignature.java:12:
>  error: constructor CreateSignatureBase in class CreateSignatureBase cannot 
> be applied to given types;
> @groovy.transform.InheritConstructors() public class CreateSignature
>^
>   required: KeyStore,char[]
>   found: no arguments
>   reason: actual and formal argument lists differ in length
> 1 error
> 1 error
> 198 ocs /tmp>
> ===
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Created] (GROOVY-9556) Joint compilation is broken in some cases

2020-05-15 Thread Daniel Sun (Jira)
Daniel Sun created GROOVY-9556:
--

 Summary: Joint compilation is broken in some cases
 Key: GROOVY-9556
 URL: https://issues.apache.org/jira/browse/GROOVY-9556
 Project: Groovy
  Issue Type: Bug
Reporter: Daniel Sun



http://groovy.329449.n5.nabble.com/More-Groovy-3-woes-td5768022.html

{code:java}
===
194 ocs /tmp>   /usr/local/groovy-2.4.17/bin/groovyc -cp 
/Extensions/pdfbox-2.0.17.jar -j myclass.groovy CreateSignatureBase.java
197 ocs /tmp> /usr/local/groovy-3.0.3/bin/groovyc -cp 
/Extensions/pdfbox-2.0.17.jar -j myclass.groovy CreateSignatureBase.java
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
Compile error during compilation with javac.
/var/folders/zh/h4cv6xjx033frtt9y72ch898gp/T/groovy-generated-8946934250394256568-java-source/cz/ocs/utilities/CreateSignature.java:12:
 error: constructor CreateSignatureBase in class CreateSignatureBase cannot be 
applied to given types;
@groovy.transform.InheritConstructors() public class CreateSignature
   ^
  required: KeyStore,char[]
  found: no arguments
  reason: actual and formal argument lists differ in length
1 error


1 error

198 ocs /tmp>

===

{code}




--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Created] (GROOVY-9555) Generic return type with raw upper bound is not inferred from argument properly

2020-05-15 Thread Daniil Ovchinnikov (Jira)
Daniil Ovchinnikov created GROOVY-9555:
--

 Summary: Generic return type with raw upper bound is not inferred 
from argument properly
 Key: GROOVY-9555
 URL: https://issues.apache.org/jira/browse/GROOVY-9555
 Project: Groovy
  Issue Type: Bug
  Components: Static Type Checker
Affects Versions: 2.5.11
Reporter: Daniil Ovchinnikov


{code:title=classes.java}
interface I {}

class C implements I {}

interface Container {
 T getInstance(Class c);
}
{code}

{code:title=playground.groovy}
@groovy.transform.CompileStatic
def usage(Container pc) {
C instance = pc.getInstance(C)
println(instance)
}
{code}

{noformat}
$ groovy -version
Groovy Version: 2.5.11 JVM: 1.8.0_231 Vendor: Oracle Corporation OS: Mac OS X
$ javac classes.java
$ groovyc playground.groovy
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
playground.groovy: 3: [Static type checking] - Cannot assign value of type I  to variable of type C
 @ line 3, column 18.
   C instance = pc.getInstance(C)
^

1 error
{noformat}


PS real life use case:
- {{I}} is {{org.gradle.api.Plugin}}
- {{C}} is {{org.gradle.plugins.ear.EarPlugin}}
- {{Container#getInstance}} is 
{{org.gradle.api.plugins.PluginContainer#findPlugin}}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (GROOVY-9542) Illegal reflective access java.lang.AssertionError(java.lang.String)

2020-05-15 Thread Daniel Sun (Jira)


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

Daniel Sun commented on GROOVY-9542:


{{AssertionError}} has two constructors to match the argument of {{String}} 
type: [[private AssertionError(java.lang.String)]] and [[public 
AssertionError(java.lang.Object)]]

The calculated distance of the former constructor is 0, so it is chosen and 
warning is emitted...

But it's dangerous to change the logic of choosing constructor, because 
constructors may have different logic even if they have compatible parameter 
types.
However we have to change the logic... because the illegal acess will be 
forbidden in some futher Java release.




> Illegal reflective access java.lang.AssertionError(java.lang.String)
> 
>
> Key: GROOVY-9542
> URL: https://issues.apache.org/jira/browse/GROOVY-9542
> Project: Groovy
>  Issue Type: Bug
>Reporter: Daniel Sun
>Priority: Major
>
> ([https://github.com/apache/groovy/runs/647840451?check_suite_focus=true])
>  
> WARNING: Illegal reflective access by 
> org.codehaus.groovy.reflection.ReflectionUtils 
> ([file:/home/runner/work/groovy/groovy/target/libs/groovy-raw-4.0.0-SNAPSHOT.jar|file://home/runner/work/groovy/groovy/target/libs/groovy-raw-4.0.0-SNAPSHOT.jar])
>  to constructor java.lang.AssertionError(java.lang.String) 
>  [397|https://github.com/apache/groovy/runs/647840451#step:5:397]> Task 
> :groovy-test:test 
>  [398|https://github.com/apache/groovy/runs/647840451#step:5:398]WARNING: 
> Please consider reporting this to the maintainers of 
> org.codehaus.groovy.reflection.ReflectionUtils 
>  [399|https://github.com/apache/groovy/runs/647840451#step:5:399]WARNING: Use 
> --illegal-access=warn to enable warnings of further illegal reflective access 
> operations 
>  [400|https://github.com/apache/groovy/runs/647840451#step:5:400]WARNING: All 
> illegal access operations will be denied in a future release



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[GitHub] [groovy] cherylhughey opened a new pull request #1247: Update README.adoc

2020-05-15 Thread GitBox


cherylhughey opened a new pull request #1247:
URL: https://github.com/apache/groovy/pull/1247


   minor punctuation and spacing changes



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[jira] [Created] (GROOVY-9554) @Field variable access within closures broken

2020-05-15 Thread Jochen Eddelbuettel (Jira)
Jochen Eddelbuettel created GROOVY-9554:
---

 Summary: @Field variable access within closures broken
 Key: GROOVY-9554
 URL: https://issues.apache.org/jira/browse/GROOVY-9554
 Project: Groovy
  Issue Type: Bug
  Components: Compiler
Affects Versions: 3.0.3, 2.4.15
Reporter: Jochen Eddelbuettel


 
{code:java}
@groovy.transform.Field String abc
binding.variables.clear()
abc = "abc"
println binding.hasVariable("abc")
["D","E","F"].each { abc += it }
println binding.getVariable("abc")
assert abc == "abcDEF"
{code}
If a variable is declared using the @Field annotation, it can be assigned to in 
the main script body, but any assignment inside a closure (here the closure 
used with each) ends up in the script binding instead. Assignments within 
regular methods work fine, too. If the variables is accessed inside the closure 
and it is not in the binding, then the value will come from the field. As soon 
as it is in the binding, the binding variable takes precedence over the field. 
In both cases the field declared with @Field needs to have precedence over 
anything that is in the binding, just like local variables do.

  

 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)