Skip to content

Commit

Permalink
Fix methods with void return type showing null as return value. Add m…
Browse files Browse the repository at this point in the history
…ore TODO notes.
  • Loading branch information
FeldrinH committed Sep 14, 2023
1 parent 4542361 commit a488da0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/main/java/ee/ut/dendroloj/SimpleTreeLayout.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ public static void init(Graph graph, JSlider stepSlider) {
}

public static void addStepAndUpdateGraph() {
// This method causes massive performance issues and extremely high memory usage for relatively small graphs.
// TODO: Investigate why and fix it. (Running Katsed.juhuslikHargnemine(8) with Dendrologist enabled provides a reproduction of the issue.)

boolean isLatestStepActive = activeStep == steps.size() - 1;
if (isLatestStepActive) {
activeStep += 1;
Expand Down Expand Up @@ -92,6 +95,8 @@ private static NodeMetaWrapper wrap(CallTreeNode node) {

private static void updateGraph(NodeMetaWrapper meta, boolean hideNewElements, List<Element> newElements,
double x, double y, double layerHeight, CallTreeNode parent) {
// TODO: Fix issues with laying out multiple call graphs at the same time.

// Currently mutable arguments and returns values show the value they had when they were first added to the graph.
// TODO: Show old values of mutable values when scrolling through history?

Expand Down
3 changes: 2 additions & 1 deletion src/main/java/ee/ut/dendroloj/TreeNode.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ public String argumentString() {
}

public String returnValueString() {
return valuesToString(new Object[]{returnValue});
// TODO: Is there a way to distinguish a null return value from returning nothing (return type void).
return returnValue == null ? "" : valuesToString(new Object[]{returnValue});
}

private static String valuesToString(Object[] values) {
Expand Down
2 changes: 2 additions & 0 deletions src/test/java/Katsed.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ static void juhuslikHargnemine(int n) {
public static void main(String[] args) {
Dendrologist.wakeUp(1.0, true);

// juhuslikHargnemine(8);
// fib(8);
pööraJupid(new int[]{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11});
}
}

0 comments on commit a488da0

Please sign in to comment.