ZEPPELIN-501: fix NPE on Note creation by NotebookRepo, \wo DI constructor

This commit is contained in:
Alexander Bezzubov 2015-12-23 11:50:35 +09:00
parent cf44b1f8b1
commit 73a28bb574
2 changed files with 7 additions and 4 deletions

View file

@ -133,6 +133,10 @@ public class Note implements Serializable, JobListener {
this.repo = repo;
}
public void setIndex(SearchService index) {
this.index = index;
}
@SuppressWarnings("rawtypes")
public Map<String, List<AngularObject>> getAngularObjects() {
return angularObjects;

View file

@ -252,15 +252,14 @@ public class Notebook {
return null;
}
// set NoteInterpreterLoader
//Manually inject ALL dependencies, as DI constructor was NOT used
note.setIndex(this.notebookIndex);
NoteInterpreterLoader replLoader = new NoteInterpreterLoader(replFactory);
note.setReplLoader(replLoader);
replLoader.setNoteId(note.id());
// set JobListenerFactory
note.setJobListenerFactory(jobListenerFactory);
// set notebookRepo
note.setNotebookRepo(notebookRepo);
Map<String, SnapshotAngularObject> angularObjectSnapshot = new HashMap<>();