style: include LEST_LOST_EXCEPTION_STACK_TRACE (#5150)

This commit is contained in:
Piotr Idzik 2024-05-09 17:15:36 +02:00 committed by GitHub
parent ee6924a2a0
commit 7bff82f175
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 6 additions and 5 deletions

View File

@ -252,9 +252,6 @@
<Match>
<Bug pattern="FCCD_FIND_CLASS_CIRCULAR_DEPENDENCY" />
</Match>
<Match>
<Bug pattern="LEST_LOST_EXCEPTION_STACK_TRACE" />
</Match>
<Match>
<Bug pattern="PL_PARALLEL_LISTS" />
</Match>

View File

@ -10,4 +10,8 @@ public class EmptyHeapException extends Exception {
public EmptyHeapException(String message) {
super(message);
}
public EmptyHeapException(String message, Throwable cause) {
super(message, cause);
}
}

View File

@ -123,7 +123,7 @@ public class MaxHeap implements Heap {
try {
return extractMax();
} catch (Exception e) {
throw new EmptyHeapException("Heap is empty. Error retrieving element");
throw new EmptyHeapException("Heap is empty. Error retrieving element", e);
}
}
}

View File

@ -117,7 +117,7 @@ public class MinHeap implements Heap {
try {
return extractMin();
} catch (Exception e) {
throw new EmptyHeapException("Heap is empty. Error retrieving element");
throw new EmptyHeapException("Heap is empty. Error retrieving element", e);
}
}
}