File tree 4 files changed +6
-5
lines changed
src/main/java/com/thealgorithms/datastructures/heaps
4 files changed +6
-5
lines changed Original file line number Diff line number Diff line change 252
252
<Match >
253
253
<Bug pattern =" FCCD_FIND_CLASS_CIRCULAR_DEPENDENCY" />
254
254
</Match >
255
- <Match >
256
- <Bug pattern =" LEST_LOST_EXCEPTION_STACK_TRACE" />
257
- </Match >
258
255
<Match >
259
256
<Bug pattern =" PL_PARALLEL_LISTS" />
260
257
</Match >
Original file line number Diff line number Diff line change @@ -10,4 +10,8 @@ public class EmptyHeapException extends Exception {
10
10
public EmptyHeapException (String message ) {
11
11
super (message );
12
12
}
13
+
14
+ public EmptyHeapException (String message , Throwable cause ) {
15
+ super (message , cause );
16
+ }
13
17
}
Original file line number Diff line number Diff line change @@ -123,7 +123,7 @@ public HeapElement getElement() throws EmptyHeapException {
123
123
try {
124
124
return extractMax ();
125
125
} catch (Exception e ) {
126
- throw new EmptyHeapException ("Heap is empty. Error retrieving element" );
126
+ throw new EmptyHeapException ("Heap is empty. Error retrieving element" , e );
127
127
}
128
128
}
129
129
}
Original file line number Diff line number Diff line change @@ -117,7 +117,7 @@ public HeapElement getElement() throws EmptyHeapException {
117
117
try {
118
118
return extractMin ();
119
119
} catch (Exception e ) {
120
- throw new EmptyHeapException ("Heap is empty. Error retrieving element" );
120
+ throw new EmptyHeapException ("Heap is empty. Error retrieving element" , e );
121
121
}
122
122
}
123
123
}
You can’t perform that action at this time.
0 commit comments