You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by pa...@apache.org on 2019/04/18 12:06:43 UTC

[groovy] branch master updated (53345dc -> aafe51f)

This is an automated email from the ASF dual-hosted git repository.

paulk pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/groovy.git.


    from 53345dc  Allow illegal access scenarios to be tested using -Pgroovy.force.illegal.access=true property.
     new 079428f  fix unintended illegal access
     new 8cd2c08  fix unintended illegal access
     new fb5b6a0  fix unintended illegal access
     new aafe51f  fix unintended illegal access

The 4 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 src/test/gls/enums/EnumTest.groovy                         |  2 +-
 src/test/groovy/ui/GroovyMainTest.groovy                   |  4 ++++
 src/test/groovy/util/GroovyScriptEngineTest.groovy         |  5 ++++-
 .../inspect/swingui/ScriptToTreeNodeAdapterTest.groovy     | 14 ++++++++------
 .../src/test/groovy/groovy/swing/SwingBuilderTest.groovy   |  4 ++--
 5 files changed, 19 insertions(+), 10 deletions(-)


[groovy] 01/04: fix unintended illegal access

Posted by pa...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

paulk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/groovy.git

commit 079428f1e82b1c74575d782e2b8b90b8f603f345
Author: Paul King <pa...@asert.com.au>
AuthorDate: Thu Apr 18 13:32:28 2019 +1000

    fix unintended illegal access
---
 .../groovy-swing/src/test/groovy/groovy/swing/SwingBuilderTest.groovy | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/subprojects/groovy-swing/src/test/groovy/groovy/swing/SwingBuilderTest.groovy b/subprojects/groovy-swing/src/test/groovy/groovy/swing/SwingBuilderTest.groovy
index 9e6e1b1..61537dd 100644
--- a/subprojects/groovy-swing/src/test/groovy/groovy/swing/SwingBuilderTest.groovy
+++ b/subprojects/groovy-swing/src/test/groovy/groovy/swing/SwingBuilderTest.groovy
@@ -379,8 +379,8 @@ class SwingBuilderTest extends GroovySwingTestCase {
 
             def swing = new SwingBuilder()
             swing.panel(layout: new BorderLayout()) {
-                label(id: 'label0', text: 'Name0', mnemonic: 48)
-                label(id: 'label1', text: 'Name1', mnemonic: 'N')
+                label(id: 'label0', text: 'Name0', displayedMnemonic: 48)
+                label(id: 'label1', text: 'Name1', displayedMnemonic: 'N' as char)
             }
             int expected0 = '0'
             int expected1 = 'N'


[groovy] 03/04: fix unintended illegal access

Posted by pa...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

paulk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/groovy.git

commit fb5b6a03a04edccdc637132192cb5c0912639e35
Author: Paul King <pa...@asert.com.au>
AuthorDate: Thu Apr 18 21:25:58 2019 +1000

    fix unintended illegal access
---
 .../inspect/swingui/ScriptToTreeNodeAdapterTest.groovy     | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/subprojects/groovy-console/src/test/groovy/groovy/inspect/swingui/ScriptToTreeNodeAdapterTest.groovy b/subprojects/groovy-console/src/test/groovy/groovy/inspect/swingui/ScriptToTreeNodeAdapterTest.groovy
index 29dff39..2e64fea 100644
--- a/subprojects/groovy-console/src/test/groovy/groovy/inspect/swingui/ScriptToTreeNodeAdapterTest.groovy
+++ b/subprojects/groovy-console/src/test/groovy/groovy/inspect/swingui/ScriptToTreeNodeAdapterTest.groovy
@@ -84,9 +84,10 @@ class ScriptToTreeNodeAdapterTest extends GroovyTestCase {
      */
     private assertMapEntry(mapEntry, expectedKey, expectedValue) {
         assertNotNull('Could not locate 1st MapEntryExpression in AST', mapEntry)
-        assertEquals('Wrong # map entries', 2, mapEntry.children.size())
-        assertEquals('Wrong key', expectedKey, mapEntry.children[0].toString())
-        assertEquals('Wrong value', expectedValue, mapEntry.children[1].toString())
+        def children = mapEntry.children().toList()
+        assertEquals('Wrong # map entries', 2, children.size())
+        assertEquals('Wrong key', expectedKey, children[0].toString())
+        assertEquals('Wrong value', expectedValue, children[1].toString())
     }
 
     /**
@@ -222,10 +223,11 @@ class ScriptToTreeNodeAdapterTest extends GroovyTestCase {
         }
         assertNotNull('Could not locate NamedArgumentListExpression in AST', namedArgList)
 
-        assertEquals('Wrong # named arguments', 2, namedArgList.children.size())
+        def children = namedArgList.children().toList()
+        assertEquals('Wrong # named arguments', 2, children.size())
 
-        assertMapEntry(namedArgList.children[0], 'Constant - foo : java.lang.String', 'Constant - bar : java.lang.String')
-        assertMapEntry(namedArgList.children[1], 'Constant - baz : java.lang.String', 'Constant - qux : java.lang.String')
+        assertMapEntry(children[0], 'Constant - foo : java.lang.String', 'Constant - bar : java.lang.String')
+        assertMapEntry(children[1], 'Constant - baz : java.lang.String', 'Constant - qux : java.lang.String')
     }
 
     void testDynamicVariable() {


[groovy] 04/04: fix unintended illegal access

Posted by pa...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

paulk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/groovy.git

commit aafe51fa4dc4bc0cc9c6b19ed8ed93de83d38a44
Author: Paul King <pa...@asert.com.au>
AuthorDate: Thu Apr 18 21:44:33 2019 +1000

    fix unintended illegal access
---
 src/test/groovy/ui/GroovyMainTest.groovy           | 4 ++++
 src/test/groovy/util/GroovyScriptEngineTest.groovy | 5 ++++-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/test/groovy/ui/GroovyMainTest.groovy b/src/test/groovy/ui/GroovyMainTest.groovy
index 018bc41..6b8ed29 100644
--- a/src/test/groovy/ui/GroovyMainTest.groovy
+++ b/src/test/groovy/ui/GroovyMainTest.groovy
@@ -18,6 +18,8 @@
  */
 package groovy.ui
 
+import static groovy.test.GroovyAssert.isAtLeastJdk
+
 class GroovyMainTest extends GroovyTestCase {
     private baos = new ByteArrayOutputStream()
     private ps = new PrintStream(baos)
@@ -138,6 +140,8 @@ assert new MyConcreteClass() != null"""
     }
 
     void testGroovyASTDump() {
+        // current xstream causes illegal access errors on JDK9+ - skip on those JDK versions, get coverage on older versions
+        if (isAtLeastJdk('9.0')) return
 
         def temporaryDirectory = new File("target/tmp/testGroovyXMLAstGeneration/")
         temporaryDirectory.mkdirs()
diff --git a/src/test/groovy/util/GroovyScriptEngineTest.groovy b/src/test/groovy/util/GroovyScriptEngineTest.groovy
index b62e589..568173e 100644
--- a/src/test/groovy/util/GroovyScriptEngineTest.groovy
+++ b/src/test/groovy/util/GroovyScriptEngineTest.groovy
@@ -30,6 +30,8 @@ import org.junit.rules.TemporaryFolder
 import org.junit.runner.RunWith
 import org.junit.runners.JUnit4
 
+import static groovy.test.GroovyAssert.isAtLeastJdk
+
 @RunWith(JUnit4)
 class GroovyScriptEngineTest extends GroovyTestCase {
 
@@ -38,9 +40,10 @@ class GroovyScriptEngineTest extends GroovyTestCase {
 
     @Test
     void createASTDumpWhenScriptIsLoadedByName() {
+        // current xstream causes illegal access errors on JDK9+ - skip on those JDK versions, get coverage on older versions
+        if (isAtLeastJdk('9.0')) return
 
         def scriptFile = temporaryFolder.newFile('Script1.groovy')
-
         scriptFile << "assert 1 + 1 == 2" // the script just has to have _some_ content
 
         try {


[groovy] 02/04: fix unintended illegal access

Posted by pa...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

paulk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/groovy.git

commit 8cd2c0833504a3d247ddedc05461f146114887ec
Author: Paul King <pa...@asert.com.au>
AuthorDate: Thu Apr 18 20:57:51 2019 +1000

    fix unintended illegal access
---
 src/test/gls/enums/EnumTest.groovy | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/test/gls/enums/EnumTest.groovy b/src/test/gls/enums/EnumTest.groovy
index 684f55e..4f538d2 100644
--- a/src/test/gls/enums/EnumTest.groovy
+++ b/src/test/gls/enums/EnumTest.groovy
@@ -182,7 +182,7 @@ class EnumTest extends CompilableTestSupport {
     // the fix for GROOVY-3161
     def void testStaticEnumFieldWithEnumValues() {
         def allColors = GroovyColors3161.ALL_COLORS
-        assert allColors.size == 3
+        assert allColors.size() == 3
         assert allColors[0] == GroovyColors3161.red
         assert allColors[1] == GroovyColors3161.blue
         assert allColors[2] == GroovyColors3161.green