Skip to content

Commit cc0999b

Browse files
committed
shorten code here and there.
1 parent 4391ec9 commit cc0999b

1 file changed

Lines changed: 6 additions & 23 deletions

File tree

src/net/sharksystem/asap/engine/ASAPEngine.java

Lines changed: 6 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -632,34 +632,16 @@ public void handleASAPInterest(ASAP_Interest_PDU_1_0 asapInterest, ASAP_1_0 prot
632632
int lastEra = this.getPreviousEra(this.era);
633633

634634
//<<<<<<<<<<<<<<<<<<debug
635-
b = new StringBuilder();
636-
b.append(this.getLogStart());
637-
b.append("workingEra: ");
638-
b.append(workingEra);
639-
b.append(" | lastEra: ");
640-
b.append(lastEra);
641-
b.append(" | this.era: ");
642-
b.append(this.era);
635+
b = new StringBuilder(); b.append(this.getLogStart()); b.append("workingEra: "); b.append(workingEra);
636+
b.append(" | lastEra: "); b.append(lastEra); b.append(" | this.era: "); b.append(this.era);
643637
System.out.println(b.toString());
644638
//>>>>>>>>>>>>>>>>>>>debug
645639

646640
// make a breakpoint here
647641
if (this.memento != null) this.memento.save(this);
648-
//<<<<<<<<<<<<<<<<<<debug
649-
b = new StringBuilder();
650-
b.append(this.getLogStart());
651-
b.append("memento saved");
652-
System.out.println(b.toString());
653-
//>>>>>>>>>>>>>>>>>>>debug
654642

655643
this.sendChunks(this.owner, senderID, this.getChunkStorage(), protocol, workingEra, lastEra, os, true);
656-
657-
//<<<<<<<<<<<<<<<<<<debug
658-
b = new StringBuilder();
659-
b.append(this.getLogStart());
660-
b.append("ended iterating local chunks");
661-
System.out.println(b.toString());
662-
//>>>>>>>>>>>>>>>>>>>debug
644+
Log.writeLog(this, "ended iterating local chunks");
663645
}
664646

665647
if(this.routingAllowed()) {
@@ -691,11 +673,12 @@ public void handleASAPInterest(ASAP_Interest_PDU_1_0 asapInterest, ASAP_1_0 prot
691673
false);
692674
}
693675
catch(ASAPException e) {
694-
Log.writeLogErr(this, "internal problem: we know sender but cannot access its storage");
676+
Log.writeLogErr(this, this.toString(),
677+
"internal problem: we know sender but cannot access its storage");
695678
}
696679
}
697680
} else {
698-
System.out.println(this.getLogStart() + "engine does not send received chunks");
681+
Log.writeLog(this, this.toString(), "engine does not send received chunks");
699682
}
700683
}
701684

0 commit comments

Comments
 (0)