You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@zeppelin.apache.org by jo...@apache.org on 2026/07/13 01:07:19 UTC

(zeppelin) branch master updated: [ZEPPELIN-6506] Return empty list instead of null from completion() in Groovy interpreter

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

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


The following commit(s) were added to refs/heads/master by this push:
     new deb8c158eb [ZEPPELIN-6506] Return empty list instead of null from completion() in Groovy interpreter
deb8c158eb is described below

commit deb8c158eb5c3c742c903ce4586286935c8f0630
Author: Minho Jang <16...@users.noreply.github.com>
AuthorDate: Mon Jul 13 10:07:14 2026 +0900

    [ZEPPELIN-6506] Return empty list instead of null from completion() in Groovy interpreter
    
    ### What is this PR for?
    Fix `GroovyInterpreter.completion()` to return an empty list instead of null when autocomplete is not supported. This aligns with the collection-returning method contract (Effective Java Item 54), avoids potential NullPointerExceptions in the completion call chain, and provides a safer API for programmatic use.
    
    ### What type of PR is it?
    Bug Fix
    
    ### Todos
    * [x] Fix `GroovyInterpreter.completion()` to return an empty list instead of null
    
    ### What is the Jira issue?
    * https://issues.apache.org/jira/browse/ZEPPELIN-6506
    
    ### How should this be tested?
    * Run the existing Groovy interpreter tests to ensure no regressions.
    
    ### Screenshots (if appropriate)
    
    N/A
    
    ### Questions:
    * Does the license files need to update? No
    * Is there breaking changes for older versions? No
    * Does this needs documentation? No
    
    
    Closes #5287 from miinhho/master.
    
    Signed-off-by: Jongyoul Lee <jo...@gmail.com>
---
 groovy/src/main/java/org/apache/zeppelin/groovy/GroovyInterpreter.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/groovy/src/main/java/org/apache/zeppelin/groovy/GroovyInterpreter.java b/groovy/src/main/java/org/apache/zeppelin/groovy/GroovyInterpreter.java
index b8eef8c342..3c6cbed874 100644
--- a/groovy/src/main/java/org/apache/zeppelin/groovy/GroovyInterpreter.java
+++ b/groovy/src/main/java/org/apache/zeppelin/groovy/GroovyInterpreter.java
@@ -117,7 +117,7 @@ public class GroovyInterpreter extends Interpreter {
   @Override
   public List<InterpreterCompletion> completion(String buf, int cursor,
                                                 InterpreterContext interpreterContext) {
-    return null;
+    return Collections.emptyList();
   }
 
   @SuppressWarnings("unchecked")