[1/6] groovy git commit: GROOVY-8143: Performance subproject included in release artifacts

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[1/6] groovy git commit: GROOVY-8143: Performance subproject included in release artifacts

paulk
Repository: groovy
Updated Branches:
  refs/heads/GROOVY_2_4_X 466c96878 -> 81f4fd62a


GROOVY-8143: Performance subproject included in release artifacts


Project: http://git-wip-us.apache.org/repos/asf/groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/a9a1b5b4
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/a9a1b5b4
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/a9a1b5b4

Branch: refs/heads/GROOVY_2_4_X
Commit: a9a1b5b434c11f99851ee76efd8bfd8cb20d5298
Parents: 466c968
Author: paulk <[hidden email]>
Authored: Fri Apr 21 19:47:17 2017 +1000
Committer: paulk <[hidden email]>
Committed: Fri Apr 21 20:18:16 2017 +1000

----------------------------------------------------------------------
 build.gradle          |   8 +--
 gradle/publish.gradle |  45 ++++++++------
 gradle/upload.gradle  | 152 +++++++++++++++++++++++----------------------
 3 files changed, 108 insertions(+), 97 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/a9a1b5b4/build.gradle
----------------------------------------------------------------------
diff --git a/build.gradle b/build.gradle
index 12bcc08..8b02c02 100644
--- a/build.gradle
+++ b/build.gradle
@@ -58,6 +58,10 @@ if (JavaVersion.current().java7Compatible) {
     }
 }
 
+ext.modules = {
+    subprojects.findAll{ !['performance', 'groovy-tests-vm8'].contains(it.name) }
+}
+
 apply from: 'gradle/filter.gradle'
 apply from: 'gradle/indy.gradle'
 apply from: 'gradle/publish.gradle'
@@ -357,10 +361,6 @@ task ensureGrammars {
 apply from: 'gradle/utils.gradle'
 apply from: 'gradle/wrapper.gradle'
 
-ext.modules = {
-    subprojects
-}
-
 task dgmConverter(dependsOn:compileJava) {
     description = 'Generates DGM info file required for faster startup.'
     def classesDir = sourceSets.main.output.classesDir

http://git-wip-us.apache.org/repos/asf/groovy/blob/a9a1b5b4/gradle/publish.gradle
----------------------------------------------------------------------
diff --git a/gradle/publish.gradle b/gradle/publish.gradle
index 260e09d..5a77ae1 100644
--- a/gradle/publish.gradle
+++ b/gradle/publish.gradle
@@ -33,23 +33,26 @@ if (!artifactoryUser) {
 }
 
 allprojects {
-    apply plugin: 'com.jfrog.artifactory-upload'
+    if (project == rootProject || rootProject.ext.modules().contains(project)) {
+        apply plugin: 'com.jfrog.artifactory-upload'
 
-    artifactory {
-        contextUrl = project.hasProperty('artifactoryContext') ? project.artifactoryContext : 'https://oss.jfrog.org'
-        resolve {
-            repository {
-                repoKey = 'libs-release'
+        artifactory {
+            contextUrl = project.hasProperty('artifactoryContext') ? project.artifactoryContext : 'https://oss.jfrog.org'
+            resolve {
+                repository {
+                    repoKey = 'libs-release'
+                }
             }
-        }
-        publish {
-            excludePatterns = 'org/codehaus/groovy/groovy/*/groovy-all-*,org/codehaus/groovy/groovy/*/groovy-backports-*,org/codehaus/groovy/groovy/*/groovy-binary-*'
-            repository {
-                repoKey = project.hasProperty('artifactoryRepoKey') ? project.artifactoryRepoKey : 'oss-snapshot-local' //The Artifactory repository key to publish to
-                //when using oss.jfrog.org the credentials are from Bintray. For local build we expect them to be found in
-                //~/.gradle/gradle.properties, otherwise to be set in the build server
-                username = rootProject.artifactoryUser
-                password = rootProject.artifactoryPassword
+            publish {
+                excludePatterns = "org/codehaus/groovy/groovy/*/groovy-all-*,org/codehaus/groovy/groovy/*/groovy-backports-*,org/codehaus/groovy/groovy/*/groovy-binary-*"
+                repository {
+                    repoKey = project.hasProperty('artifactoryRepoKey') ? project.artifactoryRepoKey : 'oss-snapshot-local'
+                    //The Artifactory repository key to publish to
+                    //when using oss.jfrog.org the credentials are from Bintray. For local build we expect them to be found in
+                    //~/.gradle/gradle.properties, otherwise to be set in the build server
+                    username = rootProject.artifactoryUser
+                    password = rootProject.artifactoryPassword
+                }
             }
         }
     }
@@ -82,10 +85,14 @@ artifactoryPublish {
 
         if (isReleaseVersion) {
             allprojects {
-                configurations.archives.artifacts.findAll{ it.name == project.name && it.type == 'jar' && it.extension == 'jar' && !it.classifier }.each {
-                    // add pom signatures
-                    def pomSigLocation = "$project.projectDir/target/poms/pom-${project == rootProject ? 'groovy' : 'default'}.xml.asc"
-                    deployDetails.add(newDetails(it, file(pomSigLocation), 'pom.asc', 'pom'))
+                if (project == rootProject || rootProject.ext.modules().contains(project)) {
+                    configurations.archives.artifacts.findAll {
+                        it.name == project.name && it.type == 'jar' && it.extension == 'jar' && !it.classifier
+                    }.each {
+                        // add pom signatures
+                        def pomSigLocation = "$project.projectDir/target/poms/pom-${project == rootProject ? 'groovy' : 'default'}.xml.asc"
+                        deployDetails.add(newDetails(it, file(pomSigLocation), 'pom.asc', 'pom'))
+                    }
                 }
             }
         }

http://git-wip-us.apache.org/repos/asf/groovy/blob/a9a1b5b4/gradle/upload.gradle
----------------------------------------------------------------------
diff --git a/gradle/upload.gradle b/gradle/upload.gradle
index 50926ec..c5a77bd 100644
--- a/gradle/upload.gradle
+++ b/gradle/upload.gradle
@@ -31,9 +31,11 @@ def removeJarjaredDependencies = { p ->
 }
 
 allprojects {
-    apply plugin: 'maven'
-    apply from: "${rootProject.projectDir}/gradle/pomconfigurer.gradle"
-    install.dependsOn checkCompatibility
+    if (project == rootProject || modules().contains(project)) {
+        apply plugin: 'maven'
+        apply from: "${rootProject.projectDir}/gradle/pomconfigurer.gradle"
+        install.dependsOn checkCompatibility
+    }
 }
 
 apply from: 'gradle/backports.gradle'
@@ -42,95 +44,97 @@ ext.basename = { String s -> s.take(s.lastIndexOf('.')) }
 ext.deriveFile = { File archive, String suffix -> new File(archive.parent, basename(archive.name) + "-${suffix}.jar") }
 
 allprojects {
-    ext.signWithClassifier = { String c, File f ->
-        if (rootProject.isReleaseVersion) {
-            signing.sign(c, f)
-            def ascFile = new File(f.parent, f.name + '.asc')
-            if (ascFile.exists()) {
-                project.artifacts.add('archives', ascFile) {
-                    classifier = c
-                    type = 'asc'
-                    extension = 'jar.asc'
+    if (project == rootProject || modules().contains(project)) {
+        ext.signWithClassifier = { String c, File f ->
+            if (rootProject.isReleaseVersion) {
+                signing.sign(c, f)
+                def ascFile = new File(f.parent, f.name + '.asc')
+                if (ascFile.exists()) {
+                    project.artifacts.add('archives', ascFile) {
+                        classifier = c
+                        type = 'asc'
+                        extension = 'jar.asc'
+                    }
                 }
             }
         }
-    }
 
-    ext.signArchiveTask = { archiveTask ->
-        if (rootProject.isReleaseVersion) {
-            signing.sign(archiveTask.classifier, archiveTask.archivePath)
-            def ascFile = new File(archiveTask.destinationDir, archiveTask.archiveName + '.asc')
-            if (ascFile.exists()) {
-                project.artifacts.add('archives', ascFile) {
-                    name = archiveTask.baseName
-                    classifier = archiveTask.classifier
-                    type = 'asc'
-                    extension = archiveTask.extension + '.asc'
+        ext.signArchiveTask = { archiveTask ->
+            if (rootProject.isReleaseVersion) {
+                signing.sign(archiveTask.classifier, archiveTask.archivePath)
+                def ascFile = new File(archiveTask.destinationDir, archiveTask.archiveName + '.asc')
+                if (ascFile.exists()) {
+                    project.artifacts.add('archives', ascFile) {
+                        name = archiveTask.baseName
+                        classifier = archiveTask.classifier
+                        type = 'asc'
+                        extension = archiveTask.extension + '.asc'
+                    }
                 }
             }
         }
-    }
 
-    uploadArchives {
-        repositories {
-            mavenDeployer {
-                pom pomConfigureClosure
-                beforeDeployment { MavenDeployment deployment -> if (rootProject.isReleaseVersion) signing.signPom(deployment) }
+        uploadArchives {
+            repositories {
+                mavenDeployer {
+                    pom pomConfigureClosure
+                    beforeDeployment { MavenDeployment deployment -> if (rootProject.isReleaseVersion) signing.signPom(deployment) }
+                }
             }
         }
-    }
 
-    install {
-        repositories {
-            mavenInstaller {
-                pom pomConfigureClosure
-                beforeDeployment { MavenDeployment deployment -> if (rootProject.isReleaseVersion) signing.signPom(deployment) }
+        install {
+            repositories {
+                mavenInstaller {
+                    pom pomConfigureClosure
+                    beforeDeployment { MavenDeployment deployment -> if (rootProject.isReleaseVersion) signing.signPom(deployment) }
+                }
             }
         }
-    }
 
-    artifacts {
-        archives jar
-        archives sourceJar
-        archives javadocJar
-        archives groovydocJar
-    }
+        artifacts {
+            archives jar
+            archives sourceJar
+            archives javadocJar
+            archives groovydocJar
+        }
 
-    [uploadArchives, install]*.with {
-        // dependency on jarAllAll should in theory be replaced with jar, jarWithIndy but
-        // in practice, it is faster
-        dependsOn([jarAllAll, sourceJar, javadocJar, groovydocJar])
-        doFirst {
-            if (rootProject.useIndy()) {
-                new GradleException('You cannot use uploadArchives or install task with the flag [indy] turned'
-                        +' on because the build handles indy artifacts by itself in that case.')
-            }
-            def indyJar = rootProject.ext.deriveFile(jar.archivePath, 'indy')
-            if (indyJar.exists()) {
-                project.artifacts.add('archives', indyJar)
-            }
-            def grooidJar = rootProject.ext.deriveFile(jar.archivePath, 'grooid')
-            if (grooidJar.exists()) {
-                project.artifacts.add('archives', grooidJar)
+        [uploadArchives, install]*.with {
+            // dependency on jarAllAll should in theory be replaced with jar, jarWithIndy but
+            // in practice, it is faster
+            dependsOn([jarAllAll, sourceJar, javadocJar, groovydocJar])
+            doFirst {
+                if (rootProject.useIndy()) {
+                    new GradleException('You cannot use uploadArchives or install task with the flag [indy] turned'
+                            + ' on because the build handles indy artifacts by itself in that case.')
+                }
+                def indyJar = rootProject.ext.deriveFile(jar.archivePath, 'indy')
+                if (indyJar.exists()) {
+                    project.artifacts.add('archives', indyJar)
+                }
+                def grooidJar = rootProject.ext.deriveFile(jar.archivePath, 'grooid')
+                if (grooidJar.exists()) {
+                    project.artifacts.add('archives', grooidJar)
+                }
             }
         }
-    }
 
-    install {
-        doFirst {
-            // gradle doesn't expect us to mutate configurations like we do here
-            // so signing the configuration won't work and we do it manually here
-            signArchiveTask(jar)
-            signArchiveTask(sourceJar)
-            signArchiveTask(javadocJar)
-            signArchiveTask(groovydocJar)
-            def indyJar = rootProject.ext.deriveFile(jar.archivePath, 'indy')
-            if (indyJar.exists()) {
-                signWithClassifier('indy', indyJar)
-            }
-            def grooidJar = rootProject.ext.deriveFile(jar.archivePath, 'grooid')
-            if (grooidJar.exists()) {
-                signWithClassifier('grooid', grooidJar)
+        install {
+            doFirst {
+                // gradle doesn't expect us to mutate configurations like we do here
+                // so signing the configuration won't work and we do it manually here
+                signArchiveTask(jar)
+                signArchiveTask(sourceJar)
+                signArchiveTask(javadocJar)
+                signArchiveTask(groovydocJar)
+                def indyJar = rootProject.ext.deriveFile(jar.archivePath, 'indy')
+                if (indyJar.exists()) {
+                    signWithClassifier('indy', indyJar)
+                }
+                def grooidJar = rootProject.ext.deriveFile(jar.archivePath, 'grooid')
+                if (grooidJar.exists()) {
+                    signWithClassifier('grooid', grooidJar)
+                }
             }
         }
     }

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[2/6] groovy git commit: GROOVY-7879 Groovy calls wrong method if there is a static method on an interface

paulk
GROOVY-7879 Groovy calls wrong method if there is a static method on an interface


Project: http://git-wip-us.apache.org/repos/asf/groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/6d0ca01b
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/6d0ca01b
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/6d0ca01b

Branch: refs/heads/GROOVY_2_4_X
Commit: 6d0ca01b430201ef6a05f25f1cfd3cf72c973da1
Parents: a9a1b5b
Author: Dmitrii Kahmitov <[hidden email]>
Authored: Wed Apr 5 09:49:54 2017 +0300
Committer: paulk <[hidden email]>
Committed: Fri Apr 21 20:19:05 2017 +1000

----------------------------------------------------------------------
 .../runtime/metaclass/MetaMethodIndex.java      | 14 +++++--
 .../runtime/methoddispatching/BarOne.java       | 25 ++++++++++++
 .../runtime/methoddispatching/BarThree.java     | 25 ++++++++++++
 .../runtime/methoddispatching/BarTwo.java       | 25 ++++++++++++
 .../runtime/methoddispatching/FooOne.java       | 25 ++++++++++++
 .../runtime/methoddispatching/FooThree.java     | 33 +++++++++++++++
 .../runtime/methoddispatching/FooTwo.java       | 29 ++++++++++++++
 .../StaticMethodOverloadTest.groovy             | 42 ++++++++++++++++++++
 8 files changed, 214 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/6d0ca01b/src/main/org/codehaus/groovy/runtime/metaclass/MetaMethodIndex.java
----------------------------------------------------------------------
diff --git a/src/main/org/codehaus/groovy/runtime/metaclass/MetaMethodIndex.java b/src/main/org/codehaus/groovy/runtime/metaclass/MetaMethodIndex.java
index 0598f9a..c442e48 100644
--- a/src/main/org/codehaus/groovy/runtime/metaclass/MetaMethodIndex.java
+++ b/src/main/org/codehaus/groovy/runtime/metaclass/MetaMethodIndex.java
@@ -315,7 +315,7 @@ public class MetaMethodIndex {
         Object oldListOrMethod = e.methodsForSuper;
         if (oldListOrMethod == null)
           return;
-        
+
         if (oldListOrMethod instanceof FastArray) {
             FastArray oldList = (FastArray) oldListOrMethod;
             int len1 = oldList.size();
@@ -346,7 +346,7 @@ public class MetaMethodIndex {
         Object oldListOrMethod = from.methods;
         if (oldListOrMethod == null)
           return;
-        
+
         if (oldListOrMethod instanceof FastArray) {
             FastArray oldList = (FastArray) oldListOrMethod;
             Entry e = null;
@@ -381,7 +381,10 @@ public class MetaMethodIndex {
                 return list;
             } else {
                 if (match.isPrivate()
-                        || (!isNonRealMethod(match) && match.getDeclaringClass().isInterface() && !method.getDeclaringClass().isInterface())) {
+                        || (!isNonRealMethod(match)
+                            && match.getDeclaringClass().isInterface()
+                            && !method.getDeclaringClass().isInterface()
+                            && !method.isStatic())) {
                     // do not overwrite interface methods with instance methods
                     // do not overwrite private methods
                     // Note: private methods from parent classes are not shown here,
@@ -413,7 +416,10 @@ public class MetaMethodIndex {
                 MetaMethod match = (MetaMethod) list.get(found);
                 if (match==method) return o;
                 if (match.isPrivate()
-                        || (!isNonRealMethod(match) && match.getDeclaringClass().isInterface() && !method.getDeclaringClass().isInterface())) {
+                        || (!isNonRealMethod(match)
+                            && match.getDeclaringClass().isInterface()
+                            && !method.getDeclaringClass().isInterface()
+                            && !method.isStatic())) {
                     // do not overwrite interface methods with instance methods
                     // do not overwrite private methods
                     // Note: private methods from parent classes are not shown here,

http://git-wip-us.apache.org/repos/asf/groovy/blob/6d0ca01b/src/test/org/codehaus/groovy/runtime/methoddispatching/BarOne.java
----------------------------------------------------------------------
diff --git a/src/test/org/codehaus/groovy/runtime/methoddispatching/BarOne.java b/src/test/org/codehaus/groovy/runtime/methoddispatching/BarOne.java
new file mode 100644
index 0000000..56daeeb
--- /dev/null
+++ b/src/test/org/codehaus/groovy/runtime/methoddispatching/BarOne.java
@@ -0,0 +1,25 @@
+/*
+ *  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 org.codehaus.groovy.runtime.methoddispatching;
+
+class BarOne implements FooOne {
+    static String foo() {
+        return "I'm Bar";
+    }
+}

http://git-wip-us.apache.org/repos/asf/groovy/blob/6d0ca01b/src/test/org/codehaus/groovy/runtime/methoddispatching/BarThree.java
----------------------------------------------------------------------
diff --git a/src/test/org/codehaus/groovy/runtime/methoddispatching/BarThree.java b/src/test/org/codehaus/groovy/runtime/methoddispatching/BarThree.java
new file mode 100644
index 0000000..63686b3
--- /dev/null
+++ b/src/test/org/codehaus/groovy/runtime/methoddispatching/BarThree.java
@@ -0,0 +1,25 @@
+/*
+ *  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 org.codehaus.groovy.runtime.methoddispatching;
+
+class BarThree implements FooThree {
+    static String foo() {
+        return "I'm Bar";
+    }
+}

http://git-wip-us.apache.org/repos/asf/groovy/blob/6d0ca01b/src/test/org/codehaus/groovy/runtime/methoddispatching/BarTwo.java
----------------------------------------------------------------------
diff --git a/src/test/org/codehaus/groovy/runtime/methoddispatching/BarTwo.java b/src/test/org/codehaus/groovy/runtime/methoddispatching/BarTwo.java
new file mode 100644
index 0000000..84a8f02
--- /dev/null
+++ b/src/test/org/codehaus/groovy/runtime/methoddispatching/BarTwo.java
@@ -0,0 +1,25 @@
+/*
+ *  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 org.codehaus.groovy.runtime.methoddispatching;
+
+class BarTwo implements FooTwo {
+    static String foo() {
+        return "I'm Bar";
+    }
+}

http://git-wip-us.apache.org/repos/asf/groovy/blob/6d0ca01b/src/test/org/codehaus/groovy/runtime/methoddispatching/FooOne.java
----------------------------------------------------------------------
diff --git a/src/test/org/codehaus/groovy/runtime/methoddispatching/FooOne.java b/src/test/org/codehaus/groovy/runtime/methoddispatching/FooOne.java
new file mode 100644
index 0000000..f1bac0f
--- /dev/null
+++ b/src/test/org/codehaus/groovy/runtime/methoddispatching/FooOne.java
@@ -0,0 +1,25 @@
+/*
+ *  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 org.codehaus.groovy.runtime.methoddispatching;
+
+interface FooOne {
+    static String foo() {
+        return "I'm Foo";
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/6d0ca01b/src/test/org/codehaus/groovy/runtime/methoddispatching/FooThree.java
----------------------------------------------------------------------
diff --git a/src/test/org/codehaus/groovy/runtime/methoddispatching/FooThree.java b/src/test/org/codehaus/groovy/runtime/methoddispatching/FooThree.java
new file mode 100644
index 0000000..9f897ea
--- /dev/null
+++ b/src/test/org/codehaus/groovy/runtime/methoddispatching/FooThree.java
@@ -0,0 +1,33 @@
+/*
+ *  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 org.codehaus.groovy.runtime.methoddispatching;
+
+interface FooThree {
+    static String foo() {
+        return "I'm Foo";
+    }
+
+    static String foo(int num) {
+        return String.valueOf(num);
+    }
+
+    static String foo(boolean bool) {
+        return String.valueOf(bool);
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/6d0ca01b/src/test/org/codehaus/groovy/runtime/methoddispatching/FooTwo.java
----------------------------------------------------------------------
diff --git a/src/test/org/codehaus/groovy/runtime/methoddispatching/FooTwo.java b/src/test/org/codehaus/groovy/runtime/methoddispatching/FooTwo.java
new file mode 100644
index 0000000..b7b315b
--- /dev/null
+++ b/src/test/org/codehaus/groovy/runtime/methoddispatching/FooTwo.java
@@ -0,0 +1,29 @@
+/*
+ *  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 org.codehaus.groovy.runtime.methoddispatching;
+
+interface FooTwo {
+    static String foo() {
+        return "I'm Foo";
+    }
+
+    static String foo(int num) {
+        return String.valueOf(num);
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/6d0ca01b/src/test/org/codehaus/groovy/runtime/methoddispatching/StaticMethodOverloadTest.groovy
----------------------------------------------------------------------
diff --git a/src/test/org/codehaus/groovy/runtime/methoddispatching/StaticMethodOverloadTest.groovy b/src/test/org/codehaus/groovy/runtime/methoddispatching/StaticMethodOverloadTest.groovy
new file mode 100644
index 0000000..2df115f
--- /dev/null
+++ b/src/test/org/codehaus/groovy/runtime/methoddispatching/StaticMethodOverloadTest.groovy
@@ -0,0 +1,42 @@
+/*
+ *  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 org.codehaus.groovy.runtime.methoddispatching
+
+class StaticMethodOverloadTest extends GroovyTestCase {
+    void testOneStaticMethod() throws Exception {
+        assert FooOne.foo() == "I'm Foo"
+        assert BarOne.foo() == "I'm Bar"
+    }
+
+    void testTwoStaticMethods() {
+        assert FooTwo.foo(42) == '42'
+        assert FooTwo.foo() == "I'm Foo"
+        assert BarTwo.foo(42) == '42'
+        assert BarTwo.foo() == "I'm Bar"
+    }
+
+    void testMoreThanTwoStaticMethods() {
+        assert FooThree.foo(42) == '42'
+        assert FooThree.foo() == "I'm Foo"
+        assert FooThree.foo(true) == 'true'
+        assert BarThree.foo(42) == '42'
+        assert BarThree.foo() == "I'm Bar"
+        assert BarThree.foo(true) == 'true'
+    }
+}

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[3/6] groovy git commit: GROOVY-7879 Groovy calls wrong method if there is a static method on an interface * @CompileStatic test cases added * Test with more than two methods changed so it's valid Java code (JLS8, 8.4.8 Inheritance, Overriding, and Hidin

paulk
In reply to this post by paulk
GROOVY-7879 Groovy calls wrong method if there is a static method on an interface * @CompileStatic test cases added * Test with more than two methods changed so it's valid Java code (JLS8, 8.4.8 Inheritance, Overriding, and Hiding)


Project: http://git-wip-us.apache.org/repos/asf/groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/d0e7fd94
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/d0e7fd94
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/d0e7fd94

Branch: refs/heads/GROOVY_2_4_X
Commit: d0e7fd942c695b4ca7d01aa9f8820d5f8772dd24
Parents: 6d0ca01
Author: Dmitrii Kahmitov <[hidden email]>
Authored: Sun Apr 9 00:18:47 2017 +0300
Committer: paulk <[hidden email]>
Committed: Fri Apr 21 20:19:06 2017 +1000

----------------------------------------------------------------------
 .../runtime/methoddispatching/BarOne.java       | 25 -----------
 .../runtime/methoddispatching/BarThree.java     | 25 -----------
 .../runtime/methoddispatching/BarTwo.java       | 25 -----------
 .../runtime/methoddispatching/FooOne.java       | 10 ++++-
 .../runtime/methoddispatching/FooThree.java     | 32 +++++++++++---
 .../runtime/methoddispatching/FooTwo.java       | 24 +++++++++--
 ...StaticMethodOverloadCompileStaticTest.groovy | 45 ++++++++++++++++++++
 .../StaticMethodOverloadTest.groovy             | 26 +++++------
 8 files changed, 112 insertions(+), 100 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/d0e7fd94/src/test/org/codehaus/groovy/runtime/methoddispatching/BarOne.java
----------------------------------------------------------------------
diff --git a/src/test/org/codehaus/groovy/runtime/methoddispatching/BarOne.java b/src/test/org/codehaus/groovy/runtime/methoddispatching/BarOne.java
deleted file mode 100644
index 56daeeb..0000000
--- a/src/test/org/codehaus/groovy/runtime/methoddispatching/BarOne.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- *  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 org.codehaus.groovy.runtime.methoddispatching;
-
-class BarOne implements FooOne {
-    static String foo() {
-        return "I'm Bar";
-    }
-}

http://git-wip-us.apache.org/repos/asf/groovy/blob/d0e7fd94/src/test/org/codehaus/groovy/runtime/methoddispatching/BarThree.java
----------------------------------------------------------------------
diff --git a/src/test/org/codehaus/groovy/runtime/methoddispatching/BarThree.java b/src/test/org/codehaus/groovy/runtime/methoddispatching/BarThree.java
deleted file mode 100644
index 63686b3..0000000
--- a/src/test/org/codehaus/groovy/runtime/methoddispatching/BarThree.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- *  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 org.codehaus.groovy.runtime.methoddispatching;
-
-class BarThree implements FooThree {
-    static String foo() {
-        return "I'm Bar";
-    }
-}

http://git-wip-us.apache.org/repos/asf/groovy/blob/d0e7fd94/src/test/org/codehaus/groovy/runtime/methoddispatching/BarTwo.java
----------------------------------------------------------------------
diff --git a/src/test/org/codehaus/groovy/runtime/methoddispatching/BarTwo.java b/src/test/org/codehaus/groovy/runtime/methoddispatching/BarTwo.java
deleted file mode 100644
index 84a8f02..0000000
--- a/src/test/org/codehaus/groovy/runtime/methoddispatching/BarTwo.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- *  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 org.codehaus.groovy.runtime.methoddispatching;
-
-class BarTwo implements FooTwo {
-    static String foo() {
-        return "I'm Bar";
-    }
-}

http://git-wip-us.apache.org/repos/asf/groovy/blob/d0e7fd94/src/test/org/codehaus/groovy/runtime/methoddispatching/FooOne.java
----------------------------------------------------------------------
diff --git a/src/test/org/codehaus/groovy/runtime/methoddispatching/FooOne.java b/src/test/org/codehaus/groovy/runtime/methoddispatching/FooOne.java
index f1bac0f..25e11c1 100644
--- a/src/test/org/codehaus/groovy/runtime/methoddispatching/FooOne.java
+++ b/src/test/org/codehaus/groovy/runtime/methoddispatching/FooOne.java
@@ -20,6 +20,12 @@ package org.codehaus.groovy.runtime.methoddispatching;
 
 interface FooOne {
     static String foo() {
-        return "I'm Foo";
+        return "FooOne.foo()";
     }
-}
\ No newline at end of file
+}
+
+class BarOne implements FooOne {
+    static String foo() {
+        return "BarOne.foo()";
+    }
+}

http://git-wip-us.apache.org/repos/asf/groovy/blob/d0e7fd94/src/test/org/codehaus/groovy/runtime/methoddispatching/FooThree.java
----------------------------------------------------------------------
diff --git a/src/test/org/codehaus/groovy/runtime/methoddispatching/FooThree.java b/src/test/org/codehaus/groovy/runtime/methoddispatching/FooThree.java
index 9f897ea..5c0c7cb 100644
--- a/src/test/org/codehaus/groovy/runtime/methoddispatching/FooThree.java
+++ b/src/test/org/codehaus/groovy/runtime/methoddispatching/FooThree.java
@@ -18,16 +18,36 @@
  */
 package org.codehaus.groovy.runtime.methoddispatching;
 
+import org.codehaus.groovy.runtime.metaclass.MetaMethodIndex;
+
+/**
+ * To test the case when we call a static method on a class and while we load all the methods from its interface,
+ * {@link MetaMethodIndex.Entry} contains more than one method from interface already
+ */
 interface FooThree {
     static String foo() {
-        return "I'm Foo";
+        return "FooThree.foo()";
+    }
+
+    static String foo(int a) {
+        return String.format("FooThree.foo(%1$d)", a);
+    }
+
+    static String foo(int a, int b) {
+        return String.format("FooThree.foo(%1$d, %2$d)", a, b);
+    }
+}
+
+class BarThree implements FooThree {
+    static String foo() {
+        return "BarThree.foo()";
     }
 
-    static String foo(int num) {
-        return String.valueOf(num);
+    static String foo(int a) {
+        return String.format("BarThree.foo(%1$d)", a);
     }
 
-    static String foo(boolean bool) {
-        return String.valueOf(bool);
+    static String foo(int a, int b) {
+        return String.format("BarThree.foo(%1$d, %2$d)", a, b);
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/groovy/blob/d0e7fd94/src/test/org/codehaus/groovy/runtime/methoddispatching/FooTwo.java
----------------------------------------------------------------------
diff --git a/src/test/org/codehaus/groovy/runtime/methoddispatching/FooTwo.java b/src/test/org/codehaus/groovy/runtime/methoddispatching/FooTwo.java
index b7b315b..ec54c49 100644
--- a/src/test/org/codehaus/groovy/runtime/methoddispatching/FooTwo.java
+++ b/src/test/org/codehaus/groovy/runtime/methoddispatching/FooTwo.java
@@ -18,12 +18,28 @@
  */
 package org.codehaus.groovy.runtime.methoddispatching;
 
+import org.codehaus.groovy.runtime.metaclass.MetaMethodIndex;
+
+/**
+ * To test the case when we call a static method on a class and {@link MetaMethodIndex.Entry}
+ * contains more than one method from interface already
+ */
 interface FooTwo {
     static String foo() {
-        return "I'm Foo";
+        return "FooTwo.foo()";
+    }
+
+    static String foo(int a) {
+        return String.format("FooTwo.foo(%1$d)", a);
+    }
+}
+
+class BarTwo implements FooTwo {
+    static String foo() {
+        return "BarTwo.foo()";
     }
 
-    static String foo(int num) {
-        return String.valueOf(num);
+    static String foo(int a) {
+        return String.format("BarTwo.foo(%1$d)", a);
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/groovy/blob/d0e7fd94/src/test/org/codehaus/groovy/runtime/methoddispatching/StaticMethodOverloadCompileStaticTest.groovy
----------------------------------------------------------------------
diff --git a/src/test/org/codehaus/groovy/runtime/methoddispatching/StaticMethodOverloadCompileStaticTest.groovy b/src/test/org/codehaus/groovy/runtime/methoddispatching/StaticMethodOverloadCompileStaticTest.groovy
new file mode 100644
index 0000000..ba4e1d1
--- /dev/null
+++ b/src/test/org/codehaus/groovy/runtime/methoddispatching/StaticMethodOverloadCompileStaticTest.groovy
@@ -0,0 +1,45 @@
+/*
+ *  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 org.codehaus.groovy.runtime.methoddispatching
+
+import groovy.transform.CompileStatic
+
+@CompileStatic
+class StaticMethodOverloadCompileStaticTest extends GroovyTestCase {
+    void testOneStaticMethod() {
+        assert FooOne.foo() == "FooOne.foo()"
+        assert BarOne.foo() == "BarOne.foo()"
+    }
+
+    void testTwoStaticMethods() {
+        assert FooTwo.foo() == "FooTwo.foo()"
+        assert FooTwo.foo(0) == "FooTwo.foo(0)"
+        assert BarTwo.foo() == "BarTwo.foo()"
+        assert BarTwo.foo(0) == "BarTwo.foo(0)"
+    }
+
+    void testMoreThanTwoStaticMethods() {
+        assert FooThree.foo() == "FooThree.foo()"
+        assert FooThree.foo(0) == "FooThree.foo(0)"
+        assert FooThree.foo(0, 1) == "FooThree.foo(0, 1)"
+        assert BarThree.foo() == "BarThree.foo()"
+        assert BarThree.foo(0) == "BarThree.foo(0)"
+        assert BarThree.foo(0, 1) == "BarThree.foo(0, 1)"
+    }
+}

http://git-wip-us.apache.org/repos/asf/groovy/blob/d0e7fd94/src/test/org/codehaus/groovy/runtime/methoddispatching/StaticMethodOverloadTest.groovy
----------------------------------------------------------------------
diff --git a/src/test/org/codehaus/groovy/runtime/methoddispatching/StaticMethodOverloadTest.groovy b/src/test/org/codehaus/groovy/runtime/methoddispatching/StaticMethodOverloadTest.groovy
index 2df115f..e12af7a 100644
--- a/src/test/org/codehaus/groovy/runtime/methoddispatching/StaticMethodOverloadTest.groovy
+++ b/src/test/org/codehaus/groovy/runtime/methoddispatching/StaticMethodOverloadTest.groovy
@@ -19,24 +19,24 @@
 package org.codehaus.groovy.runtime.methoddispatching
 
 class StaticMethodOverloadTest extends GroovyTestCase {
-    void testOneStaticMethod() throws Exception {
-        assert FooOne.foo() == "I'm Foo"
-        assert BarOne.foo() == "I'm Bar"
+    void testOneStaticMethod() {
+        assert FooOne.foo() == "FooOne.foo()"
+        assert BarOne.foo() == "BarOne.foo()"
     }
 
     void testTwoStaticMethods() {
-        assert FooTwo.foo(42) == '42'
-        assert FooTwo.foo() == "I'm Foo"
-        assert BarTwo.foo(42) == '42'
-        assert BarTwo.foo() == "I'm Bar"
+        assert FooTwo.foo() == "FooTwo.foo()"
+        assert FooTwo.foo(0) == "FooTwo.foo(0)"
+        assert BarTwo.foo() == "BarTwo.foo()"
+        assert BarTwo.foo(0) == "BarTwo.foo(0)"
     }
 
     void testMoreThanTwoStaticMethods() {
-        assert FooThree.foo(42) == '42'
-        assert FooThree.foo() == "I'm Foo"
-        assert FooThree.foo(true) == 'true'
-        assert BarThree.foo(42) == '42'
-        assert BarThree.foo() == "I'm Bar"
-        assert BarThree.foo(true) == 'true'
+        assert FooThree.foo() == "FooThree.foo()"
+        assert FooThree.foo(0) == "FooThree.foo(0)"
+        assert FooThree.foo(0, 1) == "FooThree.foo(0, 1)"
+        assert BarThree.foo() == "BarThree.foo()"
+        assert BarThree.foo(0) == "BarThree.foo(0)"
+        assert BarThree.foo(0, 1) == "BarThree.foo(0, 1)"
     }
 }

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[4/6] groovy git commit: GROOVY-7879: Groovy calls wrong method if there is a static method on an interface (minor refactor - closes #521)

paulk
In reply to this post by paulk
GROOVY-7879: Groovy calls wrong method if there is a static method on an interface (minor refactor - closes #521)


Project: http://git-wip-us.apache.org/repos/asf/groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/a4ca1d26
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/a4ca1d26
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/a4ca1d26

Branch: refs/heads/GROOVY_2_4_X
Commit: a4ca1d261cd3561c1e57cee88ebec6d6a13788eb
Parents: d0e7fd9
Author: paulk <[hidden email]>
Authored: Fri Apr 21 13:49:29 2017 +1000
Committer: paulk <[hidden email]>
Committed: Fri Apr 21 20:19:07 2017 +1000

----------------------------------------------------------------------
 .../runtime/methoddispatching/FooOne.java       | 31 ------------
 .../runtime/methoddispatching/FooThree.java     | 53 --------------------
 .../runtime/methoddispatching/FooTwo.java       | 45 -----------------
 ...StaticMethodOverloadCompileStaticTest.groovy | 45 -----------------
 .../StaticMethodOverloadTest.groovy             | 42 ----------------
 .../runtime/methoddispatching/vm8/FooOne.java   | 31 ++++++++++++
 .../runtime/methoddispatching/vm8/FooThree.java | 53 ++++++++++++++++++++
 .../runtime/methoddispatching/vm8/FooTwo.java   | 45 +++++++++++++++++
 ...StaticMethodOverloadCompileStaticTest.groovy | 45 +++++++++++++++++
 .../vm8/StaticMethodOverloadTest.groovy         | 42 ++++++++++++++++
 10 files changed, 216 insertions(+), 216 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/a4ca1d26/src/test/org/codehaus/groovy/runtime/methoddispatching/FooOne.java
----------------------------------------------------------------------
diff --git a/src/test/org/codehaus/groovy/runtime/methoddispatching/FooOne.java b/src/test/org/codehaus/groovy/runtime/methoddispatching/FooOne.java
deleted file mode 100644
index 25e11c1..0000000
--- a/src/test/org/codehaus/groovy/runtime/methoddispatching/FooOne.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- *  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 org.codehaus.groovy.runtime.methoddispatching;
-
-interface FooOne {
-    static String foo() {
-        return "FooOne.foo()";
-    }
-}
-
-class BarOne implements FooOne {
-    static String foo() {
-        return "BarOne.foo()";
-    }
-}

http://git-wip-us.apache.org/repos/asf/groovy/blob/a4ca1d26/src/test/org/codehaus/groovy/runtime/methoddispatching/FooThree.java
----------------------------------------------------------------------
diff --git a/src/test/org/codehaus/groovy/runtime/methoddispatching/FooThree.java b/src/test/org/codehaus/groovy/runtime/methoddispatching/FooThree.java
deleted file mode 100644
index 5c0c7cb..0000000
--- a/src/test/org/codehaus/groovy/runtime/methoddispatching/FooThree.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- *  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 org.codehaus.groovy.runtime.methoddispatching;
-
-import org.codehaus.groovy.runtime.metaclass.MetaMethodIndex;
-
-/**
- * To test the case when we call a static method on a class and while we load all the methods from its interface,
- * {@link MetaMethodIndex.Entry} contains more than one method from interface already
- */
-interface FooThree {
-    static String foo() {
-        return "FooThree.foo()";
-    }
-
-    static String foo(int a) {
-        return String.format("FooThree.foo(%1$d)", a);
-    }
-
-    static String foo(int a, int b) {
-        return String.format("FooThree.foo(%1$d, %2$d)", a, b);
-    }
-}
-
-class BarThree implements FooThree {
-    static String foo() {
-        return "BarThree.foo()";
-    }
-
-    static String foo(int a) {
-        return String.format("BarThree.foo(%1$d)", a);
-    }
-
-    static String foo(int a, int b) {
-        return String.format("BarThree.foo(%1$d, %2$d)", a, b);
-    }
-}

http://git-wip-us.apache.org/repos/asf/groovy/blob/a4ca1d26/src/test/org/codehaus/groovy/runtime/methoddispatching/FooTwo.java
----------------------------------------------------------------------
diff --git a/src/test/org/codehaus/groovy/runtime/methoddispatching/FooTwo.java b/src/test/org/codehaus/groovy/runtime/methoddispatching/FooTwo.java
deleted file mode 100644
index ec54c49..0000000
--- a/src/test/org/codehaus/groovy/runtime/methoddispatching/FooTwo.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- *  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 org.codehaus.groovy.runtime.methoddispatching;
-
-import org.codehaus.groovy.runtime.metaclass.MetaMethodIndex;
-
-/**
- * To test the case when we call a static method on a class and {@link MetaMethodIndex.Entry}
- * contains more than one method from interface already
- */
-interface FooTwo {
-    static String foo() {
-        return "FooTwo.foo()";
-    }
-
-    static String foo(int a) {
-        return String.format("FooTwo.foo(%1$d)", a);
-    }
-}
-
-class BarTwo implements FooTwo {
-    static String foo() {
-        return "BarTwo.foo()";
-    }
-
-    static String foo(int a) {
-        return String.format("BarTwo.foo(%1$d)", a);
-    }
-}

http://git-wip-us.apache.org/repos/asf/groovy/blob/a4ca1d26/src/test/org/codehaus/groovy/runtime/methoddispatching/StaticMethodOverloadCompileStaticTest.groovy
----------------------------------------------------------------------
diff --git a/src/test/org/codehaus/groovy/runtime/methoddispatching/StaticMethodOverloadCompileStaticTest.groovy b/src/test/org/codehaus/groovy/runtime/methoddispatching/StaticMethodOverloadCompileStaticTest.groovy
deleted file mode 100644
index ba4e1d1..0000000
--- a/src/test/org/codehaus/groovy/runtime/methoddispatching/StaticMethodOverloadCompileStaticTest.groovy
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- *  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 org.codehaus.groovy.runtime.methoddispatching
-
-import groovy.transform.CompileStatic
-
-@CompileStatic
-class StaticMethodOverloadCompileStaticTest extends GroovyTestCase {
-    void testOneStaticMethod() {
-        assert FooOne.foo() == "FooOne.foo()"
-        assert BarOne.foo() == "BarOne.foo()"
-    }
-
-    void testTwoStaticMethods() {
-        assert FooTwo.foo() == "FooTwo.foo()"
-        assert FooTwo.foo(0) == "FooTwo.foo(0)"
-        assert BarTwo.foo() == "BarTwo.foo()"
-        assert BarTwo.foo(0) == "BarTwo.foo(0)"
-    }
-
-    void testMoreThanTwoStaticMethods() {
-        assert FooThree.foo() == "FooThree.foo()"
-        assert FooThree.foo(0) == "FooThree.foo(0)"
-        assert FooThree.foo(0, 1) == "FooThree.foo(0, 1)"
-        assert BarThree.foo() == "BarThree.foo()"
-        assert BarThree.foo(0) == "BarThree.foo(0)"
-        assert BarThree.foo(0, 1) == "BarThree.foo(0, 1)"
-    }
-}

http://git-wip-us.apache.org/repos/asf/groovy/blob/a4ca1d26/src/test/org/codehaus/groovy/runtime/methoddispatching/StaticMethodOverloadTest.groovy
----------------------------------------------------------------------
diff --git a/src/test/org/codehaus/groovy/runtime/methoddispatching/StaticMethodOverloadTest.groovy b/src/test/org/codehaus/groovy/runtime/methoddispatching/StaticMethodOverloadTest.groovy
deleted file mode 100644
index e12af7a..0000000
--- a/src/test/org/codehaus/groovy/runtime/methoddispatching/StaticMethodOverloadTest.groovy
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- *  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 org.codehaus.groovy.runtime.methoddispatching
-
-class StaticMethodOverloadTest extends GroovyTestCase {
-    void testOneStaticMethod() {
-        assert FooOne.foo() == "FooOne.foo()"
-        assert BarOne.foo() == "BarOne.foo()"
-    }
-
-    void testTwoStaticMethods() {
-        assert FooTwo.foo() == "FooTwo.foo()"
-        assert FooTwo.foo(0) == "FooTwo.foo(0)"
-        assert BarTwo.foo() == "BarTwo.foo()"
-        assert BarTwo.foo(0) == "BarTwo.foo(0)"
-    }
-
-    void testMoreThanTwoStaticMethods() {
-        assert FooThree.foo() == "FooThree.foo()"
-        assert FooThree.foo(0) == "FooThree.foo(0)"
-        assert FooThree.foo(0, 1) == "FooThree.foo(0, 1)"
-        assert BarThree.foo() == "BarThree.foo()"
-        assert BarThree.foo(0) == "BarThree.foo(0)"
-        assert BarThree.foo(0, 1) == "BarThree.foo(0, 1)"
-    }
-}

http://git-wip-us.apache.org/repos/asf/groovy/blob/a4ca1d26/src/test/org/codehaus/groovy/runtime/methoddispatching/vm8/FooOne.java
----------------------------------------------------------------------
diff --git a/src/test/org/codehaus/groovy/runtime/methoddispatching/vm8/FooOne.java b/src/test/org/codehaus/groovy/runtime/methoddispatching/vm8/FooOne.java
new file mode 100644
index 0000000..7e50432
--- /dev/null
+++ b/src/test/org/codehaus/groovy/runtime/methoddispatching/vm8/FooOne.java
@@ -0,0 +1,31 @@
+/*
+ *  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 org.codehaus.groovy.runtime.methoddispatching.vm8;
+
+interface FooOne {
+    static String foo() {
+        return "FooOne.foo()";
+    }
+}
+
+class BarOne implements FooOne {
+    static String foo() {
+        return "BarOne.foo()";
+    }
+}

http://git-wip-us.apache.org/repos/asf/groovy/blob/a4ca1d26/src/test/org/codehaus/groovy/runtime/methoddispatching/vm8/FooThree.java
----------------------------------------------------------------------
diff --git a/src/test/org/codehaus/groovy/runtime/methoddispatching/vm8/FooThree.java b/src/test/org/codehaus/groovy/runtime/methoddispatching/vm8/FooThree.java
new file mode 100644
index 0000000..d74871b
--- /dev/null
+++ b/src/test/org/codehaus/groovy/runtime/methoddispatching/vm8/FooThree.java
@@ -0,0 +1,53 @@
+/*
+ *  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 org.codehaus.groovy.runtime.methoddispatching.vm8;
+
+import org.codehaus.groovy.runtime.metaclass.MetaMethodIndex;
+
+/**
+ * To test the case when we call a static method on a class and while we load all the methods from its interface,
+ * {@link MetaMethodIndex.Entry} contains more than one method from interface already
+ */
+interface FooThree {
+    static String foo() {
+        return "FooThree.foo()";
+    }
+
+    static String foo(int a) {
+        return String.format("FooThree.foo(%1$d)", a);
+    }
+
+    static String foo(int a, int b) {
+        return String.format("FooThree.foo(%1$d, %2$d)", a, b);
+    }
+}
+
+class BarThree implements FooThree {
+    static String foo() {
+        return "BarThree.foo()";
+    }
+
+    static String foo(int a) {
+        return String.format("BarThree.foo(%1$d)", a);
+    }
+
+    static String foo(int a, int b) {
+        return String.format("BarThree.foo(%1$d, %2$d)", a, b);
+    }
+}

http://git-wip-us.apache.org/repos/asf/groovy/blob/a4ca1d26/src/test/org/codehaus/groovy/runtime/methoddispatching/vm8/FooTwo.java
----------------------------------------------------------------------
diff --git a/src/test/org/codehaus/groovy/runtime/methoddispatching/vm8/FooTwo.java b/src/test/org/codehaus/groovy/runtime/methoddispatching/vm8/FooTwo.java
new file mode 100644
index 0000000..f91e9d8
--- /dev/null
+++ b/src/test/org/codehaus/groovy/runtime/methoddispatching/vm8/FooTwo.java
@@ -0,0 +1,45 @@
+/*
+ *  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 org.codehaus.groovy.runtime.methoddispatching.vm8;
+
+import org.codehaus.groovy.runtime.metaclass.MetaMethodIndex;
+
+/**
+ * To test the case when we call a static method on a class and {@link MetaMethodIndex.Entry}
+ * contains more than one method from interface already
+ */
+interface FooTwo {
+    static String foo() {
+        return "FooTwo.foo()";
+    }
+
+    static String foo(int a) {
+        return String.format("FooTwo.foo(%1$d)", a);
+    }
+}
+
+class BarTwo implements FooTwo {
+    static String foo() {
+        return "BarTwo.foo()";
+    }
+
+    static String foo(int a) {
+        return String.format("BarTwo.foo(%1$d)", a);
+    }
+}

http://git-wip-us.apache.org/repos/asf/groovy/blob/a4ca1d26/src/test/org/codehaus/groovy/runtime/methoddispatching/vm8/StaticMethodOverloadCompileStaticTest.groovy
----------------------------------------------------------------------
diff --git a/src/test/org/codehaus/groovy/runtime/methoddispatching/vm8/StaticMethodOverloadCompileStaticTest.groovy b/src/test/org/codehaus/groovy/runtime/methoddispatching/vm8/StaticMethodOverloadCompileStaticTest.groovy
new file mode 100644
index 0000000..b62b978
--- /dev/null
+++ b/src/test/org/codehaus/groovy/runtime/methoddispatching/vm8/StaticMethodOverloadCompileStaticTest.groovy
@@ -0,0 +1,45 @@
+/*
+ *  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 org.codehaus.groovy.runtime.methoddispatching.vm8
+
+import groovy.transform.CompileStatic
+
+@CompileStatic
+class StaticMethodOverloadCompileStaticTest extends GroovyTestCase {
+    void testOneStaticMethod() {
+        assert FooOne.foo() == "FooOne.foo()"
+        assert BarOne.foo() == "BarOne.foo()"
+    }
+
+    void testTwoStaticMethods() {
+        assert FooTwo.foo() == "FooTwo.foo()"
+        assert FooTwo.foo(0) == "FooTwo.foo(0)"
+        assert BarTwo.foo() == "BarTwo.foo()"
+        assert BarTwo.foo(0) == "BarTwo.foo(0)"
+    }
+
+    void testMoreThanTwoStaticMethods() {
+        assert FooThree.foo() == "FooThree.foo()"
+        assert FooThree.foo(0) == "FooThree.foo(0)"
+        assert FooThree.foo(0, 1) == "FooThree.foo(0, 1)"
+        assert BarThree.foo() == "BarThree.foo()"
+        assert BarThree.foo(0) == "BarThree.foo(0)"
+        assert BarThree.foo(0, 1) == "BarThree.foo(0, 1)"
+    }
+}

http://git-wip-us.apache.org/repos/asf/groovy/blob/a4ca1d26/src/test/org/codehaus/groovy/runtime/methoddispatching/vm8/StaticMethodOverloadTest.groovy
----------------------------------------------------------------------
diff --git a/src/test/org/codehaus/groovy/runtime/methoddispatching/vm8/StaticMethodOverloadTest.groovy b/src/test/org/codehaus/groovy/runtime/methoddispatching/vm8/StaticMethodOverloadTest.groovy
new file mode 100644
index 0000000..1442421
--- /dev/null
+++ b/src/test/org/codehaus/groovy/runtime/methoddispatching/vm8/StaticMethodOverloadTest.groovy
@@ -0,0 +1,42 @@
+/*
+ *  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 org.codehaus.groovy.runtime.methoddispatching.vm8
+
+class StaticMethodOverloadTest extends GroovyTestCase {
+    void testOneStaticMethod() {
+        assert FooOne.foo() == "FooOne.foo()"
+        assert BarOne.foo() == "BarOne.foo()"
+    }
+
+    void testTwoStaticMethods() {
+        assert FooTwo.foo() == "FooTwo.foo()"
+        assert FooTwo.foo(0) == "FooTwo.foo(0)"
+        assert BarTwo.foo() == "BarTwo.foo()"
+        assert BarTwo.foo(0) == "BarTwo.foo(0)"
+    }
+
+    void testMoreThanTwoStaticMethods() {
+        assert FooThree.foo() == "FooThree.foo()"
+        assert FooThree.foo(0) == "FooThree.foo(0)"
+        assert FooThree.foo(0, 1) == "FooThree.foo(0, 1)"
+        assert BarThree.foo() == "BarThree.foo()"
+        assert BarThree.foo(0) == "BarThree.foo(0)"
+        assert BarThree.foo(0, 1) == "BarThree.foo(0, 1)"
+    }
+}

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[5/6] groovy git commit: GROOVY-7879: Groovy calls wrong method if there is a static method on an interface (tests only for JDK8+)

paulk
In reply to this post by paulk
GROOVY-7879: Groovy calls wrong method if there is a static method on an interface (tests only for JDK8+)


Project: http://git-wip-us.apache.org/repos/asf/groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/81151692
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/81151692
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/81151692

Branch: refs/heads/GROOVY_2_4_X
Commit: 8115169292988f74a8fdfd37c928d4ab14908865
Parents: a4ca1d2
Author: paulk <[hidden email]>
Authored: Fri Apr 21 19:46:44 2017 +1000
Committer: paulk <[hidden email]>
Committed: Fri Apr 21 20:19:48 2017 +1000

----------------------------------------------------------------------
 settings.gradle                                 |  1 +
 .../runtime/methoddispatching/vm8/FooOne.java   | 31 ------------
 .../runtime/methoddispatching/vm8/FooThree.java | 53 --------------------
 .../runtime/methoddispatching/vm8/FooTwo.java   | 45 -----------------
 ...StaticMethodOverloadCompileStaticTest.groovy | 45 -----------------
 .../vm8/StaticMethodOverloadTest.groovy         | 42 ----------------
 subprojects/groovy-tests-vm8/build.gradle       | 42 ++++++++++++++++
 7 files changed, 43 insertions(+), 216 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/81151692/settings.gradle
----------------------------------------------------------------------
diff --git a/settings.gradle b/settings.gradle
index 2322a62..38300b4 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -30,6 +30,7 @@ def subprojects = ['groovy-ant',
         'groovy-swing',
         'groovy-templates',
         'groovy-test',
+        'groovy-tests-vm8',
         'groovy-testng',
         'groovy-xml'
 ]

http://git-wip-us.apache.org/repos/asf/groovy/blob/81151692/src/test/org/codehaus/groovy/runtime/methoddispatching/vm8/FooOne.java
----------------------------------------------------------------------
diff --git a/src/test/org/codehaus/groovy/runtime/methoddispatching/vm8/FooOne.java b/src/test/org/codehaus/groovy/runtime/methoddispatching/vm8/FooOne.java
deleted file mode 100644
index 7e50432..0000000
--- a/src/test/org/codehaus/groovy/runtime/methoddispatching/vm8/FooOne.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- *  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 org.codehaus.groovy.runtime.methoddispatching.vm8;
-
-interface FooOne {
-    static String foo() {
-        return "FooOne.foo()";
-    }
-}
-
-class BarOne implements FooOne {
-    static String foo() {
-        return "BarOne.foo()";
-    }
-}

http://git-wip-us.apache.org/repos/asf/groovy/blob/81151692/src/test/org/codehaus/groovy/runtime/methoddispatching/vm8/FooThree.java
----------------------------------------------------------------------
diff --git a/src/test/org/codehaus/groovy/runtime/methoddispatching/vm8/FooThree.java b/src/test/org/codehaus/groovy/runtime/methoddispatching/vm8/FooThree.java
deleted file mode 100644
index d74871b..0000000
--- a/src/test/org/codehaus/groovy/runtime/methoddispatching/vm8/FooThree.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- *  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 org.codehaus.groovy.runtime.methoddispatching.vm8;
-
-import org.codehaus.groovy.runtime.metaclass.MetaMethodIndex;
-
-/**
- * To test the case when we call a static method on a class and while we load all the methods from its interface,
- * {@link MetaMethodIndex.Entry} contains more than one method from interface already
- */
-interface FooThree {
-    static String foo() {
-        return "FooThree.foo()";
-    }
-
-    static String foo(int a) {
-        return String.format("FooThree.foo(%1$d)", a);
-    }
-
-    static String foo(int a, int b) {
-        return String.format("FooThree.foo(%1$d, %2$d)", a, b);
-    }
-}
-
-class BarThree implements FooThree {
-    static String foo() {
-        return "BarThree.foo()";
-    }
-
-    static String foo(int a) {
-        return String.format("BarThree.foo(%1$d)", a);
-    }
-
-    static String foo(int a, int b) {
-        return String.format("BarThree.foo(%1$d, %2$d)", a, b);
-    }
-}

http://git-wip-us.apache.org/repos/asf/groovy/blob/81151692/src/test/org/codehaus/groovy/runtime/methoddispatching/vm8/FooTwo.java
----------------------------------------------------------------------
diff --git a/src/test/org/codehaus/groovy/runtime/methoddispatching/vm8/FooTwo.java b/src/test/org/codehaus/groovy/runtime/methoddispatching/vm8/FooTwo.java
deleted file mode 100644
index f91e9d8..0000000
--- a/src/test/org/codehaus/groovy/runtime/methoddispatching/vm8/FooTwo.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- *  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 org.codehaus.groovy.runtime.methoddispatching.vm8;
-
-import org.codehaus.groovy.runtime.metaclass.MetaMethodIndex;
-
-/**
- * To test the case when we call a static method on a class and {@link MetaMethodIndex.Entry}
- * contains more than one method from interface already
- */
-interface FooTwo {
-    static String foo() {
-        return "FooTwo.foo()";
-    }
-
-    static String foo(int a) {
-        return String.format("FooTwo.foo(%1$d)", a);
-    }
-}
-
-class BarTwo implements FooTwo {
-    static String foo() {
-        return "BarTwo.foo()";
-    }
-
-    static String foo(int a) {
-        return String.format("BarTwo.foo(%1$d)", a);
-    }
-}

http://git-wip-us.apache.org/repos/asf/groovy/blob/81151692/src/test/org/codehaus/groovy/runtime/methoddispatching/vm8/StaticMethodOverloadCompileStaticTest.groovy
----------------------------------------------------------------------
diff --git a/src/test/org/codehaus/groovy/runtime/methoddispatching/vm8/StaticMethodOverloadCompileStaticTest.groovy b/src/test/org/codehaus/groovy/runtime/methoddispatching/vm8/StaticMethodOverloadCompileStaticTest.groovy
deleted file mode 100644
index b62b978..0000000
--- a/src/test/org/codehaus/groovy/runtime/methoddispatching/vm8/StaticMethodOverloadCompileStaticTest.groovy
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- *  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 org.codehaus.groovy.runtime.methoddispatching.vm8
-
-import groovy.transform.CompileStatic
-
-@CompileStatic
-class StaticMethodOverloadCompileStaticTest extends GroovyTestCase {
-    void testOneStaticMethod() {
-        assert FooOne.foo() == "FooOne.foo()"
-        assert BarOne.foo() == "BarOne.foo()"
-    }
-
-    void testTwoStaticMethods() {
-        assert FooTwo.foo() == "FooTwo.foo()"
-        assert FooTwo.foo(0) == "FooTwo.foo(0)"
-        assert BarTwo.foo() == "BarTwo.foo()"
-        assert BarTwo.foo(0) == "BarTwo.foo(0)"
-    }
-
-    void testMoreThanTwoStaticMethods() {
-        assert FooThree.foo() == "FooThree.foo()"
-        assert FooThree.foo(0) == "FooThree.foo(0)"
-        assert FooThree.foo(0, 1) == "FooThree.foo(0, 1)"
-        assert BarThree.foo() == "BarThree.foo()"
-        assert BarThree.foo(0) == "BarThree.foo(0)"
-        assert BarThree.foo(0, 1) == "BarThree.foo(0, 1)"
-    }
-}

http://git-wip-us.apache.org/repos/asf/groovy/blob/81151692/src/test/org/codehaus/groovy/runtime/methoddispatching/vm8/StaticMethodOverloadTest.groovy
----------------------------------------------------------------------
diff --git a/src/test/org/codehaus/groovy/runtime/methoddispatching/vm8/StaticMethodOverloadTest.groovy b/src/test/org/codehaus/groovy/runtime/methoddispatching/vm8/StaticMethodOverloadTest.groovy
deleted file mode 100644
index 1442421..0000000
--- a/src/test/org/codehaus/groovy/runtime/methoddispatching/vm8/StaticMethodOverloadTest.groovy
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- *  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 org.codehaus.groovy.runtime.methoddispatching.vm8
-
-class StaticMethodOverloadTest extends GroovyTestCase {
-    void testOneStaticMethod() {
-        assert FooOne.foo() == "FooOne.foo()"
-        assert BarOne.foo() == "BarOne.foo()"
-    }
-
-    void testTwoStaticMethods() {
-        assert FooTwo.foo() == "FooTwo.foo()"
-        assert FooTwo.foo(0) == "FooTwo.foo(0)"
-        assert BarTwo.foo() == "BarTwo.foo()"
-        assert BarTwo.foo(0) == "BarTwo.foo(0)"
-    }
-
-    void testMoreThanTwoStaticMethods() {
-        assert FooThree.foo() == "FooThree.foo()"
-        assert FooThree.foo(0) == "FooThree.foo(0)"
-        assert FooThree.foo(0, 1) == "FooThree.foo(0, 1)"
-        assert BarThree.foo() == "BarThree.foo()"
-        assert BarThree.foo(0) == "BarThree.foo(0)"
-        assert BarThree.foo(0, 1) == "BarThree.foo(0, 1)"
-    }
-}

http://git-wip-us.apache.org/repos/asf/groovy/blob/81151692/subprojects/groovy-tests-vm8/build.gradle
----------------------------------------------------------------------
diff --git a/subprojects/groovy-tests-vm8/build.gradle b/subprojects/groovy-tests-vm8/build.gradle
new file mode 100644
index 0000000..82c9330
--- /dev/null
+++ b/subprojects/groovy-tests-vm8/build.gradle
@@ -0,0 +1,42 @@
+/*
+ *  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.
+ */
+dependencies {
+    compile rootProject
+    testCompile project(':groovy-test')
+}
+
+tasks.withType(JavaCompile) {
+    sourceCompatibility = 1.8
+    targetCompatibility = 1.8
+}
+
+sourceSets {
+    test {
+        java {
+            if (!JavaVersion.current().isJava8Compatible()) {
+                exclude '**/vm8/*'
+            }
+        }
+        groovy {
+            if (!JavaVersion.current().isJava8Compatible()) {
+                exclude '**/vm8/*'
+            }
+        }
+    }
+}

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[6/6] groovy git commit: GROOVY-7879: Groovy calls wrong method if there is a static method on an interface (tests only for JDK8+)

paulk
In reply to this post by paulk
GROOVY-7879: Groovy calls wrong method if there is a static method on an interface (tests only for JDK8+)


Project: http://git-wip-us.apache.org/repos/asf/groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/81f4fd62
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/81f4fd62
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/81f4fd62

Branch: refs/heads/GROOVY_2_4_X
Commit: 81f4fd62a86035a7eb4ecd28dab02da22829101c
Parents: 8115169
Author: paulk <[hidden email]>
Authored: Fri Apr 21 20:11:21 2017 +1000
Committer: paulk <[hidden email]>
Committed: Fri Apr 21 20:19:49 2017 +1000

----------------------------------------------------------------------
 ...StaticMethodOverloadCompileStaticTest.groovy | 45 +++++++++++++++++
 .../vm8/StaticMethodOverloadTest.groovy         | 42 ++++++++++++++++
 .../runtime/methoddispatching/vm8/FooOne.java   | 31 ++++++++++++
 .../runtime/methoddispatching/vm8/FooThree.java | 53 ++++++++++++++++++++
 .../runtime/methoddispatching/vm8/FooTwo.java   | 45 +++++++++++++++++
 5 files changed, 216 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/81f4fd62/subprojects/groovy-tests-vm8/src/test/groovy/org/apache/groovy/runtime/methoddispatching/vm8/StaticMethodOverloadCompileStaticTest.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-tests-vm8/src/test/groovy/org/apache/groovy/runtime/methoddispatching/vm8/StaticMethodOverloadCompileStaticTest.groovy b/subprojects/groovy-tests-vm8/src/test/groovy/org/apache/groovy/runtime/methoddispatching/vm8/StaticMethodOverloadCompileStaticTest.groovy
new file mode 100644
index 0000000..b43de1e
--- /dev/null
+++ b/subprojects/groovy-tests-vm8/src/test/groovy/org/apache/groovy/runtime/methoddispatching/vm8/StaticMethodOverloadCompileStaticTest.groovy
@@ -0,0 +1,45 @@
+/*
+ *  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 org.apache.groovy.runtime.methoddispatching.vm8
+
+import groovy.transform.CompileStatic
+
+@CompileStatic
+class StaticMethodOverloadCompileStaticTest extends GroovyTestCase {
+    void testOneStaticMethod() {
+        assert FooOne.foo() == "FooOne.foo()"
+        assert BarOne.foo() == "BarOne.foo()"
+    }
+
+    void testTwoStaticMethods() {
+        assert FooTwo.foo() == "FooTwo.foo()"
+        assert FooTwo.foo(0) == "FooTwo.foo(0)"
+        assert BarTwo.foo() == "BarTwo.foo()"
+        assert BarTwo.foo(0) == "BarTwo.foo(0)"
+    }
+
+    void testMoreThanTwoStaticMethods() {
+        assert FooThree.foo() == "FooThree.foo()"
+        assert FooThree.foo(0) == "FooThree.foo(0)"
+        assert FooThree.foo(0, 1) == "FooThree.foo(0, 1)"
+        assert BarThree.foo() == "BarThree.foo()"
+        assert BarThree.foo(0) == "BarThree.foo(0)"
+        assert BarThree.foo(0, 1) == "BarThree.foo(0, 1)"
+    }
+}

http://git-wip-us.apache.org/repos/asf/groovy/blob/81f4fd62/subprojects/groovy-tests-vm8/src/test/groovy/org/apache/groovy/runtime/methoddispatching/vm8/StaticMethodOverloadTest.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-tests-vm8/src/test/groovy/org/apache/groovy/runtime/methoddispatching/vm8/StaticMethodOverloadTest.groovy b/subprojects/groovy-tests-vm8/src/test/groovy/org/apache/groovy/runtime/methoddispatching/vm8/StaticMethodOverloadTest.groovy
new file mode 100644
index 0000000..df9c87a
--- /dev/null
+++ b/subprojects/groovy-tests-vm8/src/test/groovy/org/apache/groovy/runtime/methoddispatching/vm8/StaticMethodOverloadTest.groovy
@@ -0,0 +1,42 @@
+/*
+ *  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 org.apache.groovy.runtime.methoddispatching.vm8
+
+class StaticMethodOverloadTest extends GroovyTestCase {
+    void testOneStaticMethod() {
+        assert FooOne.foo() == "FooOne.foo()"
+        assert BarOne.foo() == "BarOne.foo()"
+    }
+
+    void testTwoStaticMethods() {
+        assert FooTwo.foo() == "FooTwo.foo()"
+        assert FooTwo.foo(0) == "FooTwo.foo(0)"
+        assert BarTwo.foo() == "BarTwo.foo()"
+        assert BarTwo.foo(0) == "BarTwo.foo(0)"
+    }
+
+    void testMoreThanTwoStaticMethods() {
+        assert FooThree.foo() == "FooThree.foo()"
+        assert FooThree.foo(0) == "FooThree.foo(0)"
+        assert FooThree.foo(0, 1) == "FooThree.foo(0, 1)"
+        assert BarThree.foo() == "BarThree.foo()"
+        assert BarThree.foo(0) == "BarThree.foo(0)"
+        assert BarThree.foo(0, 1) == "BarThree.foo(0, 1)"
+    }
+}

http://git-wip-us.apache.org/repos/asf/groovy/blob/81f4fd62/subprojects/groovy-tests-vm8/src/test/java/org/apache/groovy/runtime/methoddispatching/vm8/FooOne.java
----------------------------------------------------------------------
diff --git a/subprojects/groovy-tests-vm8/src/test/java/org/apache/groovy/runtime/methoddispatching/vm8/FooOne.java b/subprojects/groovy-tests-vm8/src/test/java/org/apache/groovy/runtime/methoddispatching/vm8/FooOne.java
new file mode 100644
index 0000000..300a385
--- /dev/null
+++ b/subprojects/groovy-tests-vm8/src/test/java/org/apache/groovy/runtime/methoddispatching/vm8/FooOne.java
@@ -0,0 +1,31 @@
+/*
+ *  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 org.apache.groovy.runtime.methoddispatching.vm8;
+
+interface FooOne {
+    static String foo() {
+        return "FooOne.foo()";
+    }
+}
+
+class BarOne implements FooOne {
+    static String foo() {
+        return "BarOne.foo()";
+    }
+}

http://git-wip-us.apache.org/repos/asf/groovy/blob/81f4fd62/subprojects/groovy-tests-vm8/src/test/java/org/apache/groovy/runtime/methoddispatching/vm8/FooThree.java
----------------------------------------------------------------------
diff --git a/subprojects/groovy-tests-vm8/src/test/java/org/apache/groovy/runtime/methoddispatching/vm8/FooThree.java b/subprojects/groovy-tests-vm8/src/test/java/org/apache/groovy/runtime/methoddispatching/vm8/FooThree.java
new file mode 100644
index 0000000..55dbc09
--- /dev/null
+++ b/subprojects/groovy-tests-vm8/src/test/java/org/apache/groovy/runtime/methoddispatching/vm8/FooThree.java
@@ -0,0 +1,53 @@
+/*
+ *  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 org.apache.groovy.runtime.methoddispatching.vm8;
+
+import org.codehaus.groovy.runtime.metaclass.MetaMethodIndex;
+
+/**
+ * To test the case when we call a static method on a class and while we load all the methods from its interface,
+ * {@link MetaMethodIndex.Entry} contains more than one method from interface already
+ */
+interface FooThree {
+    static String foo() {
+        return "FooThree.foo()";
+    }
+
+    static String foo(int a) {
+        return String.format("FooThree.foo(%1$d)", a);
+    }
+
+    static String foo(int a, int b) {
+        return String.format("FooThree.foo(%1$d, %2$d)", a, b);
+    }
+}
+
+class BarThree implements FooThree {
+    static String foo() {
+        return "BarThree.foo()";
+    }
+
+    static String foo(int a) {
+        return String.format("BarThree.foo(%1$d)", a);
+    }
+
+    static String foo(int a, int b) {
+        return String.format("BarThree.foo(%1$d, %2$d)", a, b);
+    }
+}

http://git-wip-us.apache.org/repos/asf/groovy/blob/81f4fd62/subprojects/groovy-tests-vm8/src/test/java/org/apache/groovy/runtime/methoddispatching/vm8/FooTwo.java
----------------------------------------------------------------------
diff --git a/subprojects/groovy-tests-vm8/src/test/java/org/apache/groovy/runtime/methoddispatching/vm8/FooTwo.java b/subprojects/groovy-tests-vm8/src/test/java/org/apache/groovy/runtime/methoddispatching/vm8/FooTwo.java
new file mode 100644
index 0000000..11d230f
--- /dev/null
+++ b/subprojects/groovy-tests-vm8/src/test/java/org/apache/groovy/runtime/methoddispatching/vm8/FooTwo.java
@@ -0,0 +1,45 @@
+/*
+ *  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 org.apache.groovy.runtime.methoddispatching.vm8;
+
+import org.codehaus.groovy.runtime.metaclass.MetaMethodIndex;
+
+/**
+ * To test the case when we call a static method on a class and {@link MetaMethodIndex.Entry}
+ * contains more than one method from interface already
+ */
+interface FooTwo {
+    static String foo() {
+        return "FooTwo.foo()";
+    }
+
+    static String foo(int a) {
+        return String.format("FooTwo.foo(%1$d)", a);
+    }
+}
+
+class BarTwo implements FooTwo {
+    static String foo() {
+        return "BarTwo.foo()";
+    }
+
+    static String foo(int a) {
+        return String.format("BarTwo.foo(%1$d)", a);
+    }
+}

Loading...