You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zeppelin.apache.org by "George Klimov (JIRA)" <ji...@apache.org> on 2019/02/17 17:47:00 UTC

[jira] [Created] (ZEPPELIN-4011) Fix Note#setName

George Klimov created ZEPPELIN-4011:
---------------------------------------

             Summary: Fix Note#setName
                 Key: ZEPPELIN-4011
                 URL: https://issues.apache.org/jira/browse/ZEPPELIN-4011
             Project: Zeppelin
          Issue Type: Bug
            Reporter: George Klimov
            Assignee: George Klimov
         Attachments: notepath.gif

Now note may move to the root directory after enabling cron in it. It caused by {{Note#setName}}
{code:java}
  public void setName(String name) {
    this.name = name;
    if (this.path == null) {
      if (name.startsWith("/")) {
        this.path = name;
      } else {
        this.path = "/" + name;
      }
    } else {
      int pos = this.path.indexOf("/");
      this.path = this.path.substring(0, pos + 1) + this.name;
    }
  }
{code}
{{int pos = this.path.indexOf("/");}} should be replaced with {{this.path.lastIndexOf("/")}}




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)