mirror of
https://github.com/TheAlgorithms/Java.git
synced 2025-07-10 21:43:15 +08:00
style: include LEST_LOST_EXCEPTION_STACK_TRACE
(#5150)
This commit is contained in:
@ -252,9 +252,6 @@
|
|||||||
<Match>
|
<Match>
|
||||||
<Bug pattern="FCCD_FIND_CLASS_CIRCULAR_DEPENDENCY" />
|
<Bug pattern="FCCD_FIND_CLASS_CIRCULAR_DEPENDENCY" />
|
||||||
</Match>
|
</Match>
|
||||||
<Match>
|
|
||||||
<Bug pattern="LEST_LOST_EXCEPTION_STACK_TRACE" />
|
|
||||||
</Match>
|
|
||||||
<Match>
|
<Match>
|
||||||
<Bug pattern="PL_PARALLEL_LISTS" />
|
<Bug pattern="PL_PARALLEL_LISTS" />
|
||||||
</Match>
|
</Match>
|
||||||
|
@ -10,4 +10,8 @@ public class EmptyHeapException extends Exception {
|
|||||||
public EmptyHeapException(String message) {
|
public EmptyHeapException(String message) {
|
||||||
super(message);
|
super(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public EmptyHeapException(String message, Throwable cause) {
|
||||||
|
super(message, cause);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -123,7 +123,7 @@ public class MaxHeap implements Heap {
|
|||||||
try {
|
try {
|
||||||
return extractMax();
|
return extractMax();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new EmptyHeapException("Heap is empty. Error retrieving element");
|
throw new EmptyHeapException("Heap is empty. Error retrieving element", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -117,7 +117,7 @@ public class MinHeap implements Heap {
|
|||||||
try {
|
try {
|
||||||
return extractMin();
|
return extractMin();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new EmptyHeapException("Heap is empty. Error retrieving element");
|
throw new EmptyHeapException("Heap is empty. Error retrieving element", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user