public Note call() throws GitAPIException {checkCallable();NoteMap map = NoteMap.newEmptyMap();RevCommit notesCommit = null;try (RevWalk walk = new RevWalk(repo);ObjectInserter inserter = repo.newObjectInserter()) {Ref ref = repo.findRef(notesRef);if (ref != null) {notesCommit = walk.parseCommit(ref.getObjectId());map = NoteMap.read(walk.getObjectReader(), notesCommit);}map.set(id, message, inserter);commitNoteMap(repo, notesRef, walk, map, notesCommit, inserter,"Notes added by 'git notes add'"); return map.getNote(id);} catch (IOException e) {throw new JGitInternalException(e.getMessage(), e);}}

public Note call ( ) throws GitAPIException { checkCallable ( ) ; NoteMap map = NoteMap . newEmptyMap ( ) ; RevCommit notesCommit = null ; try ( RevWalk walk = new RevWalk ( repo ) ; ObjectInserter inserter = repo . newObjectInserter ( ) ) { Ref ref = repo . findRef ( notesRef ) ; if ( ref != null ) { notesCommit = walk . parseCommit ( ref . getObjectId ( ) ) ; map = NoteMap . read ( walk . getObjectReader ( ) , notesCommit ) ; } map . set ( id , message , inserter ) ; commitNoteMap ( repo , notesRef , walk , map , notesCommit , inserter , "Notes added by 'git notes add'" ) ; return map . getNote ( id ) ; } catch ( IOException e ) { throw new JGitInternalException ( e . getMessage ( ) , e ) ; } }
public override Note Call(){CheckCallable();RevWalk walk = new RevWalk(repo);ObjectInserter inserter = repo.NewObjectInserter();NoteMap map = NoteMap.NewEmptyMap();RevCommit notesCommit = null;try{Ref @ref = repo.GetRef(notesRef);if (@ref != null){notesCommit = walk.ParseCommit(@ref.GetObjectId());map = NoteMap.Read(walk.GetObjectReader(), notesCommit);}map.Set(id, message, inserter);CommitNoteMap(walk, map, notesCommit, inserter, "Notes added by 'git notes add'");return map.GetNote(id);}catch (IOException e){throw new JGitInternalException(e.Message, e);}finally{inserter.Release();walk.Release();}}
