Reamer commented on code in PR #4977:
URL: https://github.com/apache/zeppelin/pull/4977#discussion_r2231757167


##########
zeppelin-zengine/src/main/java/org/apache/zeppelin/interpreter/InterpreterSettingManager.java:
##########
@@ -309,9 +313,14 @@ private void loadFromFile() throws IOException {
     }
 
     if (infoSaving.interpreterRepositories != null) {
-      for (RemoteRepository repo : infoSaving.interpreterRepositories) {
-        if (!dependencyResolver.getRepos().contains(repo)) {
+      for (Repository repo : infoSaving.interpreterRepositories) {
+        // Check if repository already exists to avoid duplicates
+        boolean exists = this.interpreterRepositories.stream()
+            .anyMatch(r -> r.getId().equals(repo.getId()));
+        if (!exists) {

Review Comment:
   Good catch @ankursaini2006 
   @renechoi Please delete the existing repository and overwrite it with the 
repository loaded by the file.
   If all repositories have the same Id, the last one wins.
   
   Btw. I think the data structure here is wrong. It would be better to choose 
a Map<Id, Repository> here, then there would be no duplicates.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to