Skip to content

Commit 1f8f73c

Browse files
committed
Cleanup more code
1 parent c368e7a commit 1f8f73c

4 files changed

Lines changed: 9 additions & 10 deletions

File tree

zeppelin-server/src/main/java/org/apache/zeppelin/socket/NotebookServer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1685,7 +1685,7 @@ public void onOutputUpdated(String noteId, String paragraphId, int index,
16851685
try {
16861686
Note note = getNotebook().getNote(noteId);
16871687
if (note == null) {
1688-
LOG.warn("Note " + noteId + " note found");
1688+
LOG.warn("Note {} note found", noteId);
16891689
return;
16901690
}
16911691
Paragraph paragraph = note.getParagraph(paragraphId);

zeppelin-server/src/test/java/org/apache/zeppelin/rest/NotebookRestApiTest.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242
import java.io.IOException;
4343
import java.nio.charset.StandardCharsets;
4444
import java.util.HashMap;
45-
import java.util.LinkedHashMap;
4645
import java.util.List;
4746
import java.util.Map;
4847
import java.util.Set;
@@ -136,7 +135,7 @@ public void testRunParagraphJob() throws Exception {
136135
assertEquals("OK", resp.get("status"));
137136
post.close();
138137
p.waitUntilFinished();
139-
assertNotEquals(p.getStatus(), Job.Status.FINISHED);
138+
assertNotEquals(Job.Status.FINISHED, p.getStatus());
140139
} finally {
141140
// cleanup
142141
if (null != note1) {
@@ -167,7 +166,7 @@ public void testRunParagraphSynchronously() throws IOException {
167166
new TypeToken<Map<String, Object>>() {}.getType());
168167
assertEquals("OK", resp.get("status"));
169168
post.close();
170-
assertNotEquals(p.getStatus(), Job.Status.READY);
169+
assertNotEquals(Job.Status.READY, p.getStatus());
171170

172171
// Check if the paragraph is emptied
173172
assertEquals(title, p.getTitle());
@@ -189,7 +188,7 @@ public void testRunParagraphSynchronously() throws IOException {
189188
assertTrue(interpreterResults.get(0).toString(),
190189
interpreterResults.get(0).get("data").toString().contains("invalid_cmd: command not found"));
191190
post.close();
192-
assertNotEquals(p.getStatus(), Job.Status.READY);
191+
assertNotEquals(Job.Status.READY, p.getStatus());
193192

194193
// Check if the paragraph is emptied
195194
assertEquals(title, p.getTitle());

zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/Note.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ public String getPath() {
188188
}
189189

190190
public String getParentPath() {
191-
int pos = path.lastIndexOf("/");
191+
int pos = path.lastIndexOf('/');
192192
if (pos == 0) {
193193
return "/";
194194
} else {
@@ -197,7 +197,7 @@ public String getParentPath() {
197197
}
198198

199199
private String getName(String path) {
200-
int pos = path.lastIndexOf("/");
200+
int pos = path.lastIndexOf('/');
201201
return path.substring(pos + 1);
202202
}
203203

@@ -329,7 +329,7 @@ public void setName(String name) {
329329
this.path = "/" + name;
330330
}
331331
} else {
332-
int pos = this.path.lastIndexOf("/");
332+
int pos = this.path.lastIndexOf('/');
333333
this.path = this.path.substring(0, pos + 1) + this.name;
334334
}
335335
}

zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/NoteManager.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -367,12 +367,12 @@ public Folder getTrashFolder() {
367367
}
368368

369369
private String getFolderName(String notePath) {
370-
int pos = notePath.lastIndexOf("/");
370+
int pos = notePath.lastIndexOf('/');
371371
return notePath.substring(0, pos);
372372
}
373373

374374
private String getNoteName(String notePath) {
375-
int pos = notePath.lastIndexOf("/");
375+
int pos = notePath.lastIndexOf('/');
376376
return notePath.substring(pos + 1);
377377
}
378378

0 commit comments

Comments
 (0)