You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by su...@apache.org on 2020/05/16 04:13:58 UTC

[groovy] branch danielsun/jointcompilation-20200516 updated (704c773 -> 2f7a956)

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

sunlan pushed a change to branch danielsun/jointcompilation-20200516
in repository https://gitbox.apache.org/repos/asf/groovy.git.


 discard 704c773  GROOVY-9556: Stub generated does not contain the effect of AST transformation during joint compilation
     new 2f7a956  Add a test for GROOVY-9556

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (704c773)
            \
             N -- N -- N   refs/heads/danielsun/jointcompilation-20200516 (2f7a956)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 1 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:
 .../java/org/codehaus/groovy/tools/javac/JavaAwareCompilationUnit.java  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


[groovy] 01/01: Add a test for GROOVY-9556

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

sunlan pushed a commit to branch danielsun/jointcompilation-20200516
in repository https://gitbox.apache.org/repos/asf/groovy.git

commit 2f7a956e76af61dbf922329c36264b4ee2784610
Author: Daniel Sun <su...@apache.org>
AuthorDate: Sat May 16 12:13:42 2020 +0800

    Add a test for GROOVY-9556
---
 src/test/groovy/bugs/Groovy9556.groovy | 83 ++++++++++++++++++++++++++++++++++
 1 file changed, 83 insertions(+)

diff --git a/src/test/groovy/bugs/Groovy9556.groovy b/src/test/groovy/bugs/Groovy9556.groovy
new file mode 100644
index 0000000..7e8c764
--- /dev/null
+++ b/src/test/groovy/bugs/Groovy9556.groovy
@@ -0,0 +1,83 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+package groovy.bugs
+
+import org.codehaus.groovy.control.CompilerConfiguration
+import org.codehaus.groovy.tools.javac.JavaAwareCompilationUnit
+import org.junit.Test
+
+final class Groovy9556 {
+// .\gradlew --no-daemon --max-workers 2 :test --tests groovy.bugs.Groovy9556 --debug-jvm
+    @Test
+    void testInheritConstructors() {
+        def config = new CompilerConfiguration(
+            targetDirectory: File.createTempDir(),
+            jointCompilationOptions: [memStub: true]
+        )
+
+        def parentDir = File.createTempDir()
+
+        try {
+            def a = new File(parentDir, 'CreateSignatureBase.java')
+            a.write '''
+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;
+
+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;
+    }
+}
+
+interface SignatureInterface {
+    byte[] sign(InputStream content) throws IOException;
+}
+            '''
+            def b = new File(parentDir, 'B.groovy')
+            b.write '''
+import groovy.transform.*
+
+@InheritConstructors class CreateSignature extends CreateSignatureBase {
+    void signPDF(String pdDocument, String out) {
+
+    }
+}
+            '''
+
+            def loader = new GroovyClassLoader(this.class.classLoader)
+            def cu = new JavaAwareCompilationUnit(config, loader)
+            cu.addSources(a, b)
+            cu.compile()
+        } finally {
+            parentDir.deleteDir()
+            config.targetDirectory.deleteDir()
+        }
+    }
+}