groovy git commit: GROOVY-8545: DGM#intersect(Set, Iterable) exception (minor refactor)

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

groovy git commit: GROOVY-8545: DGM#intersect(Set, Iterable) exception (minor refactor)

paulk
Repository: groovy
Updated Branches:
  refs/heads/master cc23c7be9 -> 66ada6915


GROOVY-8545: DGM#intersect(Set, Iterable) exception (minor refactor)


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

Branch: refs/heads/master
Commit: 66ada6915fedf9fad2c0723e6699e6fa6110fa6c
Parents: cc23c7b
Author: Paul King <[hidden email]>
Authored: Mon Apr 16 15:34:35 2018 +1000
Committer: Paul King <[hidden email]>
Committed: Mon Apr 16 15:34:35 2018 +1000

----------------------------------------------------------------------
 .../groovy/tools/shell/completion/ImportsSyntaxCompletor.groovy  | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/66ada691/subprojects/groovy-groovysh/src/main/groovy/org/codehaus/groovy/tools/shell/completion/ImportsSyntaxCompletor.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-groovysh/src/main/groovy/org/codehaus/groovy/tools/shell/completion/ImportsSyntaxCompletor.groovy b/subprojects/groovy-groovysh/src/main/groovy/org/codehaus/groovy/tools/shell/completion/ImportsSyntaxCompletor.groovy
index 67c9b22..19a55df 100644
--- a/subprojects/groovy-groovysh/src/main/groovy/org/codehaus/groovy/tools/shell/completion/ImportsSyntaxCompletor.groovy
+++ b/subprojects/groovy-groovysh/src/main/groovy/org/codehaus/groovy/tools/shell/completion/ImportsSyntaxCompletor.groovy
@@ -104,13 +104,13 @@ class ImportsSyntaxCompletor implements IdentifierCompletor {
                 String className = importSpec.substring(staticPrefix.length(), lastDotIndex)
                 Class clazz = shell.interp.evaluate([className]) as Class
                 if (clazz != null) {
-                    List<String> clazzSymbols = ReflectionCompletor.getPublicFieldsAndMethods(clazz, '')*.value
+                    Set<String> clazzSymbols = ReflectionCompletor.getPublicFieldsAndMethods(clazz, '')*.value
                     Collection<String> importedSymbols
                     if (symbolName == '*') {
                         importedSymbols = clazzSymbols
                     } else {
                         Set<String> acceptableMatches = [symbolName, symbolName + '(', symbolName + '()']
-                        importedSymbols = (acceptableMatches as Collection).intersect(clazzSymbols)
+                        importedSymbols = acceptableMatches.intersect(clazzSymbols)
                     }
                     matches.addAll(importedSymbols)
                 }