[jira] [Commented] (GROOVY-8846) Embeddable groovy-all-X.XX.jar and groovy-all-X.XX-indy.jar not Included in SDKMAN package(s)

2018-10-15 Thread Paul King (JIRA)


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

Paul King commented on GROOVY-8846:
---

Removal of the all jar was brought about by JDK9+ split package restriction. 
Instead, you can refer to the individual groovy jar files in the lib directory 
instead. You can select all of them or just the ones you need.

> Embeddable groovy-all-X.XX.jar and groovy-all-X.XX-indy.jar  not Included in 
> SDKMAN package(s)
> --
>
> Key: GROOVY-8846
> URL: https://issues.apache.org/jira/browse/GROOVY-8846
> Project: Groovy
>  Issue Type: Bug
>  Components: release
>Affects Versions: 2.5.2, 2.5.3
> Environment: Linux 64 bit
>Reporter: will mason
>Priority: Major
>
> h3.  Expected
> * Waned to configure {{groovy-all}} JAR for Netbeans and Gradle
> * Used SDKMAN as recommended for Ubuntu (Linux) systems
> * Neither recent version has the groogy-all embeddable folder
> * Not found in any of the {{candidate/groovy/}} folders of the packages.
> * As an extra step, I downloaded the available v2.5 ZIP files -- Not present 
> in these Also.
> ** Particularly the groovy-all is missing from the SDK bundle.  
> ** I fully expected an SDK to contain all the embeddable modules. 
> h3.  Requirement
> *  On the IDE page there's a link indicating Groovy is supported by netbeans
> * This support requires users to sent the Groovy-all library
> * The groovy that comes with Netbeans 8.2 is quite dated now and Netbeans 9 
> is not production ready.
> * Also Gradle ships with it's required  version of embeddable JAR(-s)
> **  It strikes me that if I wanted to test or use  gradle with a plugin or 
> code that might need a newer version  of Gradle that would not be easy to do 
> h3.  Mitigation / Workaround
> * I have not yet found a pre-build embeddable/groovy-all-XX JAR
> * I can only suggest we build out own



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


[jira] [Created] (GROOVY-8846) Embeddable groovy-all-X.XX.jar and groovy-all-X.XX-indy.jar not Included in SDKMAN package(s)

2018-10-15 Thread will mason (JIRA)
will mason created GROOVY-8846:
--

 Summary: Embeddable groovy-all-X.XX.jar and 
groovy-all-X.XX-indy.jar  not Included in SDKMAN package(s)
 Key: GROOVY-8846
 URL: https://issues.apache.org/jira/browse/GROOVY-8846
 Project: Groovy
  Issue Type: Bug
  Components: release
Affects Versions: 2.5.3, 2.5.2
 Environment: Linux 64 bit
Reporter: will mason


h3.  Expected

* Waned to configure {{groovy-all}} JAR for Netbeans and Gradle
* Used SDKMAN as recommended for Ubuntu (Linux) systems
* Neither recent version has the groogy-all embeddable folder
* Not found in any of the {{candidate/groovy/}} folders of the packages.
* As an extra step, I downloaded the available v2.5 ZIP files -- Not present in 
these Also.
** Particularly the groovy-all is missing from the SDK bundle.  
** I fully expected an SDK to contain all the embeddable modules. 

h3.  Requirement

*  On the IDE page there's a link indicating Groovy is supported by netbeans
* This support requires users to sent the Groovy-all library
* The groovy that comes with Netbeans 8.2 is quite dated now and Netbeans 9 is 
not production ready.
* Also Gradle ships with it's required  version of embeddable JAR(-s)
**  It strikes me that if I wanted to test or use  gradle with a plugin or code 
that might need a newer version  of Gradle that would not be easy to do 

h3.  Mitigation / Workaround

* I have not yet found a pre-build embeddable/groovy-all-XX JAR
* I can only suggest we build out own




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


[jira] [Commented] (GROOVY-8843) Fix illegal reflective access within o.c.g.vmplugin.v7.Java7

2018-10-15 Thread ASF GitHub Bot (JIRA)


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

ASF GitHub Bot commented on GROOVY-8843:


Github user paulk-asert commented on a diff in the pull request:

https://github.com/apache/groovy/pull/811#discussion_r225328503
  
--- Diff: src/main/java/org/codehaus/groovy/vmplugin/v9/Java9.java ---
@@ -18,14 +18,78 @@
  */
 package org.codehaus.groovy.vmplugin.v9;
 
+import org.codehaus.groovy.GroovyBugError;
 import org.codehaus.groovy.vmplugin.v8.Java8;
 
+import java.lang.invoke.MethodHandles;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+
 /**
- * Java 9 based functions will be added here if needed.
+ * Additional Java 9 based functions will be added here as needed.
  */
 public class Java9 extends Java8 {
+
+private static class LookupHolder {
+private static final Method PRIVATE_LOOKUP;
+private static final Constructor 
LOOKUP_Constructor;
+static {
+Constructor lookup = null;
+Method privateLookup = null;
+try { // java 9
+privateLookup = 
MethodHandles.class.getMethod("privateLookupIn", Class.class, 
MethodHandles.Lookup.class);
--- End diff --

We don't eventually, I was just letting the build be built from Java 8 
(with current warnings) until we get more things in place.


> Fix illegal reflective access within o.c.g.vmplugin.v7.Java7
> 
>
> Key: GROOVY-8843
> URL: https://issues.apache.org/jira/browse/GROOVY-8843
> Project: Groovy
>  Issue Type: Sub-task
>Reporter: Paul King
>Priority: Major
>




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


[GitHub] groovy pull request #811: GROOVY-8843: Fix illegal reflective access within ...

2018-10-15 Thread paulk-asert
Github user paulk-asert commented on a diff in the pull request:

https://github.com/apache/groovy/pull/811#discussion_r225328503
  
--- Diff: src/main/java/org/codehaus/groovy/vmplugin/v9/Java9.java ---
@@ -18,14 +18,78 @@
  */
 package org.codehaus.groovy.vmplugin.v9;
 
+import org.codehaus.groovy.GroovyBugError;
 import org.codehaus.groovy.vmplugin.v8.Java8;
 
+import java.lang.invoke.MethodHandles;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+
 /**
- * Java 9 based functions will be added here if needed.
+ * Additional Java 9 based functions will be added here as needed.
  */
 public class Java9 extends Java8 {
+
+private static class LookupHolder {
+private static final Method PRIVATE_LOOKUP;
+private static final Constructor 
LOOKUP_Constructor;
+static {
+Constructor lookup = null;
+Method privateLookup = null;
+try { // java 9
+privateLookup = 
MethodHandles.class.getMethod("privateLookupIn", Class.class, 
MethodHandles.Lookup.class);
--- End diff --

We don't eventually, I was just letting the build be built from Java 8 
(with current warnings) until we get more things in place.


---


[jira] [Commented] (GROOVY-8843) Fix illegal reflective access within o.c.g.vmplugin.v7.Java7

2018-10-15 Thread ASF GitHub Bot (JIRA)


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

ASF GitHub Bot commented on GROOVY-8843:


Github user blackdrag commented on a diff in the pull request:

https://github.com/apache/groovy/pull/811#discussion_r225293219
  
--- Diff: src/main/java/org/codehaus/groovy/vmplugin/v9/Java9.java ---
@@ -18,14 +18,78 @@
  */
 package org.codehaus.groovy.vmplugin.v9;
 
+import org.codehaus.groovy.GroovyBugError;
 import org.codehaus.groovy.vmplugin.v8.Java8;
 
+import java.lang.invoke.MethodHandles;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+
 /**
- * Java 9 based functions will be added here if needed.
+ * Additional Java 9 based functions will be added here as needed.
  */
 public class Java9 extends Java8 {
+
+private static class LookupHolder {
+private static final Method PRIVATE_LOOKUP;
+private static final Constructor 
LOOKUP_Constructor;
+static {
+Constructor lookup = null;
+Method privateLookup = null;
+try { // java 9
+privateLookup = 
MethodHandles.class.getMethod("privateLookupIn", Class.class, 
MethodHandles.Lookup.class);
--- End diff --

why do we do a reflective lookup here for a method that is public static? 
This is already the Java 9 module, so pre Java 9 code is of no concern... 
especially the NoSuchMethodException is supposed to never happen here


> Fix illegal reflective access within o.c.g.vmplugin.v7.Java7
> 
>
> Key: GROOVY-8843
> URL: https://issues.apache.org/jira/browse/GROOVY-8843
> Project: Groovy
>  Issue Type: Sub-task
>Reporter: Paul King
>Priority: Major
>




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


[jira] [Commented] (GROOVY-8843) Fix illegal reflective access within o.c.g.vmplugin.v7.Java7

2018-10-15 Thread ASF GitHub Bot (JIRA)


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

ASF GitHub Bot commented on GROOVY-8843:


Github user blackdrag commented on a diff in the pull request:

https://github.com/apache/groovy/pull/811#discussion_r225299922
  
--- Diff: src/main/java/org/codehaus/groovy/vmplugin/v9/Java9.java ---
@@ -18,14 +18,78 @@
  */
 package org.codehaus.groovy.vmplugin.v9;
 
+import org.codehaus.groovy.GroovyBugError;
 import org.codehaus.groovy.vmplugin.v8.Java8;
 
+import java.lang.invoke.MethodHandles;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+
 /**
- * Java 9 based functions will be added here if needed.
+ * Additional Java 9 based functions will be added here as needed.
  */
 public class Java9 extends Java8 {
+
+private static class LookupHolder {
+private static final Method PRIVATE_LOOKUP;
+private static final Constructor 
LOOKUP_Constructor;
+static {
+Constructor lookup = null;
+Method privateLookup = null;
+try { // java 9
+privateLookup = 
MethodHandles.class.getMethod("privateLookupIn", Class.class, 
MethodHandles.Lookup.class);
+} catch (final NoSuchMethodException e) { // java 8
+try {
+lookup = 
MethodHandles.Lookup.class.getDeclaredConstructor(Class.class, Integer.TYPE);
+if (!lookup.isAccessible()) {
+lookup.setAccessible(true);
+}
+} catch (final NoSuchMethodException ex) {
+throw new IllegalStateException("Incompatible JVM", e);
+}
+}
+PRIVATE_LOOKUP = privateLookup;
+LOOKUP_Constructor = lookup;
+}
+}
+
+private static Constructor 
getLookupConstructor() {
+return LookupHolder.LOOKUP_Constructor;
+}
+
+private static Method getPrivateLookup() {
+return LookupHolder.PRIVATE_LOOKUP;
+}
+
+public static MethodHandles.Lookup of(final Class declaringClass) {
+try {
+if (getPrivateLookup() != null) {
+return 
MethodHandles.Lookup.class.cast(getPrivateLookup().invoke(null, declaringClass, 
MethodHandles.lookup()));
+}
+return getLookupConstructor().newInstance(declaringClass, 
MethodHandles.Lookup.PRIVATE).in(declaringClass);
--- End diff --

If PRIVATE_LOOKUP lookup never fails as I think, then LOOKUP_Constructor 
will be always the same. Not sure if "in" 
(https://docs.oracle.com/javase/9/docs/api/java/lang/invoke/MethodHandles.Lookup.html#in-java.lang.Class-)
 then can still do something useful.


> Fix illegal reflective access within o.c.g.vmplugin.v7.Java7
> 
>
> Key: GROOVY-8843
> URL: https://issues.apache.org/jira/browse/GROOVY-8843
> Project: Groovy
>  Issue Type: Sub-task
>Reporter: Paul King
>Priority: Major
>




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


[jira] [Commented] (GROOVY-8843) Fix illegal reflective access within o.c.g.vmplugin.v7.Java7

2018-10-15 Thread ASF GitHub Bot (JIRA)


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

ASF GitHub Bot commented on GROOVY-8843:


Github user blackdrag commented on a diff in the pull request:

https://github.com/apache/groovy/pull/811#discussion_r225298000
  
--- Diff: src/main/java/org/codehaus/groovy/vmplugin/v9/Java9.java ---
@@ -18,14 +18,78 @@
  */
 package org.codehaus.groovy.vmplugin.v9;
 
+import org.codehaus.groovy.GroovyBugError;
 import org.codehaus.groovy.vmplugin.v8.Java8;
 
+import java.lang.invoke.MethodHandles;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+
 /**
- * Java 9 based functions will be added here if needed.
+ * Additional Java 9 based functions will be added here as needed.
  */
 public class Java9 extends Java8 {
+
+private static class LookupHolder {
+private static final Method PRIVATE_LOOKUP;
+private static final Constructor 
LOOKUP_Constructor;
+static {
+Constructor lookup = null;
+Method privateLookup = null;
+try { // java 9
+privateLookup = 
MethodHandles.class.getMethod("privateLookupIn", Class.class, 
MethodHandles.Lookup.class);
+} catch (final NoSuchMethodException e) { // java 8
+try {
+lookup = 
MethodHandles.Lookup.class.getDeclaredConstructor(Class.class, Integer.TYPE);
+if (!lookup.isAccessible()) {
--- End diff --

we can actually not rely on this being accessible... I am missing the 
IllegalAccessException and InaccessibleObjectException handling here... 


> Fix illegal reflective access within o.c.g.vmplugin.v7.Java7
> 
>
> Key: GROOVY-8843
> URL: https://issues.apache.org/jira/browse/GROOVY-8843
> Project: Groovy
>  Issue Type: Sub-task
>Reporter: Paul King
>Priority: Major
>




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


[GitHub] groovy pull request #811: GROOVY-8843: Fix illegal reflective access within ...

2018-10-15 Thread blackdrag
Github user blackdrag commented on a diff in the pull request:

https://github.com/apache/groovy/pull/811#discussion_r225293219
  
--- Diff: src/main/java/org/codehaus/groovy/vmplugin/v9/Java9.java ---
@@ -18,14 +18,78 @@
  */
 package org.codehaus.groovy.vmplugin.v9;
 
+import org.codehaus.groovy.GroovyBugError;
 import org.codehaus.groovy.vmplugin.v8.Java8;
 
+import java.lang.invoke.MethodHandles;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+
 /**
- * Java 9 based functions will be added here if needed.
+ * Additional Java 9 based functions will be added here as needed.
  */
 public class Java9 extends Java8 {
+
+private static class LookupHolder {
+private static final Method PRIVATE_LOOKUP;
+private static final Constructor 
LOOKUP_Constructor;
+static {
+Constructor lookup = null;
+Method privateLookup = null;
+try { // java 9
+privateLookup = 
MethodHandles.class.getMethod("privateLookupIn", Class.class, 
MethodHandles.Lookup.class);
--- End diff --

why do we do a reflective lookup here for a method that is public static? 
This is already the Java 9 module, so pre Java 9 code is of no concern... 
especially the NoSuchMethodException is supposed to never happen here


---


[GitHub] groovy pull request #811: GROOVY-8843: Fix illegal reflective access within ...

2018-10-15 Thread blackdrag
Github user blackdrag commented on a diff in the pull request:

https://github.com/apache/groovy/pull/811#discussion_r225299922
  
--- Diff: src/main/java/org/codehaus/groovy/vmplugin/v9/Java9.java ---
@@ -18,14 +18,78 @@
  */
 package org.codehaus.groovy.vmplugin.v9;
 
+import org.codehaus.groovy.GroovyBugError;
 import org.codehaus.groovy.vmplugin.v8.Java8;
 
+import java.lang.invoke.MethodHandles;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+
 /**
- * Java 9 based functions will be added here if needed.
+ * Additional Java 9 based functions will be added here as needed.
  */
 public class Java9 extends Java8 {
+
+private static class LookupHolder {
+private static final Method PRIVATE_LOOKUP;
+private static final Constructor 
LOOKUP_Constructor;
+static {
+Constructor lookup = null;
+Method privateLookup = null;
+try { // java 9
+privateLookup = 
MethodHandles.class.getMethod("privateLookupIn", Class.class, 
MethodHandles.Lookup.class);
+} catch (final NoSuchMethodException e) { // java 8
+try {
+lookup = 
MethodHandles.Lookup.class.getDeclaredConstructor(Class.class, Integer.TYPE);
+if (!lookup.isAccessible()) {
+lookup.setAccessible(true);
+}
+} catch (final NoSuchMethodException ex) {
+throw new IllegalStateException("Incompatible JVM", e);
+}
+}
+PRIVATE_LOOKUP = privateLookup;
+LOOKUP_Constructor = lookup;
+}
+}
+
+private static Constructor 
getLookupConstructor() {
+return LookupHolder.LOOKUP_Constructor;
+}
+
+private static Method getPrivateLookup() {
+return LookupHolder.PRIVATE_LOOKUP;
+}
+
+public static MethodHandles.Lookup of(final Class declaringClass) {
+try {
+if (getPrivateLookup() != null) {
+return 
MethodHandles.Lookup.class.cast(getPrivateLookup().invoke(null, declaringClass, 
MethodHandles.lookup()));
+}
+return getLookupConstructor().newInstance(declaringClass, 
MethodHandles.Lookup.PRIVATE).in(declaringClass);
--- End diff --

If PRIVATE_LOOKUP lookup never fails as I think, then LOOKUP_Constructor 
will be always the same. Not sure if "in" 
(https://docs.oracle.com/javase/9/docs/api/java/lang/invoke/MethodHandles.Lookup.html#in-java.lang.Class-)
 then can still do something useful.


---


[jira] [Commented] (GROOVY-8845) @DelegatesTo works only for the first vararg

2018-10-15 Thread Daniil Ovchinnikov (JIRA)


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

Daniil Ovchinnikov commented on GROOVY-8845:


Please close if this is intended.

> @DelegatesTo works only for the first vararg
> 
>
> Key: GROOVY-8845
> URL: https://issues.apache.org/jira/browse/GROOVY-8845
> Project: Groovy
>  Issue Type: Bug
>  Components: Static Type Checker
>Affects Versions: 2.5.3
>Reporter: Daniil Ovchinnikov
>Priority: Major
>
> {code:groovy}
> def md(@DelegatesTo.Target Object target, @DelegatesTo(strategy = 
> Closure.DELEGATE_FIRST) Closure... arg) {
> for (Closure a : arg) {
> a.delegate = target
> a.resolveStrategy = Closure.DELEGATE_FIRST
> a()
> }
> }
> class D {
>   def foo() { 42 }
> }
> @groovy.transform.CompileStatic
> def test() {
> md(
>   new D(), 
>   { print(foo()) }, 
> //  { print(foo()) }, // [Static type checking] - Cannot find matching 
> method ConsoleScript15#foo()
> //  { print(foo()) }, // [Static type checking] - Cannot find matching 
> method ConsoleScript15#foo()
> )
> }
> test()
> {code}



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


[jira] [Created] (GROOVY-8845) @DelegatesTo works only for the first vararg

2018-10-15 Thread Daniil Ovchinnikov (JIRA)
Daniil Ovchinnikov created GROOVY-8845:
--

 Summary: @DelegatesTo works only for the first vararg
 Key: GROOVY-8845
 URL: https://issues.apache.org/jira/browse/GROOVY-8845
 Project: Groovy
  Issue Type: Bug
  Components: Static Type Checker
Affects Versions: 2.5.3
Reporter: Daniil Ovchinnikov


{code:groovy}
def md(@DelegatesTo.Target Object target, @DelegatesTo(strategy = 
Closure.DELEGATE_FIRST) Closure... arg) {
for (Closure a : arg) {
a.delegate = target
a.resolveStrategy = Closure.DELEGATE_FIRST
a()
}
}

class D {
  def foo() { 42 }
}

@groovy.transform.CompileStatic
def test() {
md(
  new D(), 
  { print(foo()) }, 
//  { print(foo()) }, // [Static type checking] - Cannot find matching 
method ConsoleScript15#foo()
//  { print(foo()) }, // [Static type checking] - Cannot find matching 
method ConsoleScript15#foo()
)
}

test()
{code}



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


[jira] [Commented] (GROOVY-8844) MarkupTemplateEngine does not render main tag

2018-10-15 Thread Frank Becker (JIRA)


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

Frank Becker commented on GROOVY-8844:
--

Thanks for the quick response and the workaround, which works fine for me.

> MarkupTemplateEngine does not render main tag
> -
>
> Key: GROOVY-8844
> URL: https://issues.apache.org/jira/browse/GROOVY-8844
> Project: Groovy
>  Issue Type: Bug
>Affects Versions: 2.5.3
> Environment: groovy -version
> Groovy Version: 2.5.3 JVM: 11 Vendor: Oracle Corporation OS: Linux
> java -version
> openjdk version "11" 2018-09-25
> OpenJDK Runtime Environment 18.9 (build 11+28)
> OpenJDK 64-Bit Server VM 18.9 (build 11+28, mixed mode)
>Reporter: Frank Becker
>Priority: Major
> Attachments: MarkupTemplateBroken.groovy, exception.txt
>
>
> Since 2.5.3 the MarkupTemplateEngine does not render  tags anymore.
> Executing the following script throws an Exception. See exception.txt.
> {code}
> import groovy.text.markup.TemplateConfiguration
> import groovy.text.markup.MarkupTemplateEngine
> def config = new TemplateConfiguration()
> MarkupTemplateEngine engine = new MarkupTemplateEngine(config)
> def template = engine.createTemplate '''
>   html {
> head {
>   title('a title')
> }
> body {
>   main {
> p('inside main of body')
>   }
> }
>   }
> '''
> StringWriter rendered = new StringWriter()
> template.make().writeTo(rendered)
> assert rendered.toString() == "a 
> titleinside main of 
> body"
> {code}
> It's the same for jdk 8. With 2.5.2 the script executes successful.



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


[jira] [Commented] (GROOVY-8844) MarkupTemplateEngine does not render main tag

2018-10-15 Thread Paul King (JIRA)


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

Paul King commented on GROOVY-8844:
---

Looks like an unintended side-effect for the fix for GROOVY-8764 that we 
mustn't have had test coverage for. :(
 Temp workaround if it's possible for you is to use {{this.main}} instead of 
{{main}}.

> MarkupTemplateEngine does not render main tag
> -
>
> Key: GROOVY-8844
> URL: https://issues.apache.org/jira/browse/GROOVY-8844
> Project: Groovy
>  Issue Type: Bug
>Affects Versions: 2.5.3
> Environment: groovy -version
> Groovy Version: 2.5.3 JVM: 11 Vendor: Oracle Corporation OS: Linux
> java -version
> openjdk version "11" 2018-09-25
> OpenJDK Runtime Environment 18.9 (build 11+28)
> OpenJDK 64-Bit Server VM 18.9 (build 11+28, mixed mode)
>Reporter: Frank Becker
>Priority: Major
> Attachments: MarkupTemplateBroken.groovy, exception.txt
>
>
> Since 2.5.3 the MarkupTemplateEngine does not render  tags anymore.
> Executing the following script throws an Exception. See exception.txt.
> {code}
> import groovy.text.markup.TemplateConfiguration
> import groovy.text.markup.MarkupTemplateEngine
> def config = new TemplateConfiguration()
> MarkupTemplateEngine engine = new MarkupTemplateEngine(config)
> def template = engine.createTemplate '''
>   html {
> head {
>   title('a title')
> }
> body {
>   main {
> p('inside main of body')
>   }
> }
>   }
> '''
> StringWriter rendered = new StringWriter()
> template.make().writeTo(rendered)
> assert rendered.toString() == "a 
> titleinside main of 
> body"
> {code}
> It's the same for jdk 8. With 2.5.2 the script executes successful.



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


[jira] [Updated] (GROOVY-8844) MarkupTemplateEngine does not render main tag

2018-10-15 Thread Frank Becker (JIRA)


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

Frank Becker updated GROOVY-8844:
-
Description: 
Since 2.5.3 the MarkupTemplateEngine does not render  tags anymore.

Executing the following script throws an Exception. See exception.txt.
{code}
import groovy.text.markup.TemplateConfiguration
import groovy.text.markup.MarkupTemplateEngine


def config = new TemplateConfiguration()
MarkupTemplateEngine engine = new MarkupTemplateEngine(config)
def template = engine.createTemplate '''

  html {
head {
  title('a title')
}
body {
  main {
p('inside main of body')
  }
}
  }
'''

StringWriter rendered = new StringWriter()
template.make().writeTo(rendered)
assert rendered.toString() == "a 
titleinside main of body"
{code}

It's the same for jdk 8. With 2.5.2 the script executes successful.

  was:
Since 2.5.3 the MarkupTemplateEngine does not render  tags anymore.

Executing the following script throws an Exception. See exception.txt.
{code}
import groovy.text.markup.TemplateConfiguration
import groovy.text.markup.MarkupTemplateEngine


def config = new TemplateConfiguration()
MarkupTemplateEngine engine = new MarkupTemplateEngine(config)
def template = engine.createTemplate '''

  html {
head {
  title('a title')
}
body {
  main {
p('inside main of body')
  }
}
  }
'''

StringWriter rendered = new StringWriter()
template.make().writeTo(rendered)
assert rendered.toString() == "a 
titleinside main of body"
{code}

It's the same for jdk 8. With 2.5.2 the script executes sucessful.


> MarkupTemplateEngine does not render main tag
> -
>
> Key: GROOVY-8844
> URL: https://issues.apache.org/jira/browse/GROOVY-8844
> Project: Groovy
>  Issue Type: Bug
>Affects Versions: 2.5.3
> Environment: groovy -version
> Groovy Version: 2.5.3 JVM: 11 Vendor: Oracle Corporation OS: Linux
> java -version
> openjdk version "11" 2018-09-25
> OpenJDK Runtime Environment 18.9 (build 11+28)
> OpenJDK 64-Bit Server VM 18.9 (build 11+28, mixed mode)
>Reporter: Frank Becker
>Priority: Major
> Attachments: MarkupTemplateBroken.groovy, exception.txt
>
>
> Since 2.5.3 the MarkupTemplateEngine does not render  tags anymore.
> Executing the following script throws an Exception. See exception.txt.
> {code}
> import groovy.text.markup.TemplateConfiguration
> import groovy.text.markup.MarkupTemplateEngine
> def config = new TemplateConfiguration()
> MarkupTemplateEngine engine = new MarkupTemplateEngine(config)
> def template = engine.createTemplate '''
>   html {
> head {
>   title('a title')
> }
> body {
>   main {
> p('inside main of body')
>   }
> }
>   }
> '''
> StringWriter rendered = new StringWriter()
> template.make().writeTo(rendered)
> assert rendered.toString() == "a 
> titleinside main of 
> body"
> {code}
> It's the same for jdk 8. With 2.5.2 the script executes successful.



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


[jira] [Created] (GROOVY-8844) MarkupTemplateEngine does not render main tag

2018-10-15 Thread Frank Becker (JIRA)
Frank Becker created GROOVY-8844:


 Summary: MarkupTemplateEngine does not render main tag
 Key: GROOVY-8844
 URL: https://issues.apache.org/jira/browse/GROOVY-8844
 Project: Groovy
  Issue Type: Bug
Affects Versions: 2.5.3
 Environment: groovy -version
Groovy Version: 2.5.3 JVM: 11 Vendor: Oracle Corporation OS: Linux

java -version
openjdk version "11" 2018-09-25
OpenJDK Runtime Environment 18.9 (build 11+28)
OpenJDK 64-Bit Server VM 18.9 (build 11+28, mixed mode)

Reporter: Frank Becker
 Attachments: MarkupTemplateBroken.groovy, exception.txt

Since 2.5.3 the MarkupTemplateEngine does not render  tags anymore.

Executing the following script throws an Exception. See exception.txt.
{code}
import groovy.text.markup.TemplateConfiguration
import groovy.text.markup.MarkupTemplateEngine


def config = new TemplateConfiguration()
MarkupTemplateEngine engine = new MarkupTemplateEngine(config)
def template = engine.createTemplate '''

  html {
head {
  title('a title')
}
body {
  main {
p('inside main of body')
  }
}
  }
'''

StringWriter rendered = new StringWriter()
template.make().writeTo(rendered)
assert rendered.toString() == "a 
titleinside main of body"
{code}

It's the same for jdk 8. With 2.5.2 the script executes sucessful.



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


[jira] [Commented] (GROOVY-8843) Fix illegal reflective access within o.c.g.vmplugin.v7.Java7

2018-10-15 Thread ASF GitHub Bot (JIRA)


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

ASF GitHub Bot commented on GROOVY-8843:


GitHub user paulk-asert opened a pull request:

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

GROOVY-8843: Fix illegal reflective access within o.c.g.vmplugin.v7.J…

…ava7

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

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

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

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


commit 521532204f1f2f8997cf7811f509d86afeff6f7d
Author: Paul King 
Date:   2018-10-15T08:12:45Z

GROOVY-8843: Fix illegal reflective access within o.c.g.vmplugin.v7.Java7




> Fix illegal reflective access within o.c.g.vmplugin.v7.Java7
> 
>
> Key: GROOVY-8843
> URL: https://issues.apache.org/jira/browse/GROOVY-8843
> Project: Groovy
>  Issue Type: Sub-task
>Reporter: Paul King
>Priority: Major
>




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


[GitHub] groovy pull request #811: GROOVY-8843: Fix illegal reflective access within ...

2018-10-15 Thread paulk-asert
GitHub user paulk-asert opened a pull request:

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

GROOVY-8843: Fix illegal reflective access within o.c.g.vmplugin.v7.J…

…ava7

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

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

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

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


commit 521532204f1f2f8997cf7811f509d86afeff6f7d
Author: Paul King 
Date:   2018-10-15T08:12:45Z

GROOVY-8843: Fix illegal reflective access within o.c.g.vmplugin.v7.Java7




---


[jira] [Closed] (GROOVY-8460) Calling console.run() causes an error on Mac OS with Java 9

2018-10-15 Thread Paul King (JIRA)


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

Paul King closed GROOVY-8460.
-
Resolution: Duplicate
  Assignee: Paul King

I believe this duplicates GROOVY-8718. Please reopen if you believe that not to 
be the case.

> Calling console.run() causes an error on Mac OS with Java 9
> ---
>
> Key: GROOVY-8460
> URL: https://issues.apache.org/jira/browse/GROOVY-8460
> Project: Groovy
>  Issue Type: Bug
>  Components: Groovy Console
>Affects Versions: 2.4.13
> Environment: Mac OS, JAVA 9
>Reporter: Bart Jourquin
>Assignee: Paul King
>Priority: Major
>
> sample code:
> *groovy.ui.Console console = new groovy.ui.Console();*
> *console.run();*
>  
> This throws errors when run on Mac OS with JAVA 9:
> _org.codehaus.groovy.control.MultipleCompilationErrorsException: startup 
> failed:_
> _script15169878466701558877614.groovy: 6: unable to resolve class 
> MRJQuitHandler_ 
>  _@ line 6, column 1._
>    _class ConsoleMacOsSupport implements MRJQuitHandler, MRJAboutHandler {_
>    _^_
>  __ 
> _script15169878466701558877614.groovy: 6: unable to resolve class 
> MRJAboutHandler_ 
>  _@ line 6, column 1._
>    _class ConsoleMacOsSupport implements MRJQuitHandler, MRJAboutHandler {_
>    _^_
>  __ 
> _2 errors_
>  
> The issue is probably linked to the reflective access to internal Apple APIs 
> through the OSX Adapter, which is flagged as illegal and blocked in Java 9.
>  



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


[jira] [Created] (GROOVY-8843) Fix illegal reflective access within o.c.g.vmplugin.v7.Java7

2018-10-15 Thread Paul King (JIRA)
Paul King created GROOVY-8843:
-

 Summary: Fix illegal reflective access within 
o.c.g.vmplugin.v7.Java7
 Key: GROOVY-8843
 URL: https://issues.apache.org/jira/browse/GROOVY-8843
 Project: Groovy
  Issue Type: Sub-task
Reporter: Paul King






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