Erste Version für Testate 1b und 2b
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class TraceableMediaLibrary extends MediaLibrary {
|
||||
|
||||
private List<StackTraceElement> stackTrace = new ArrayList<>();
|
||||
|
||||
public TraceableMediaLibrary(int maxItems, int maxDuration) {
|
||||
super(maxItems, maxDuration);
|
||||
}
|
||||
|
||||
public List<StackTraceElement> getStackTrace() {
|
||||
return stackTrace;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int lastIndexOf(String name, int startIndex) {
|
||||
StackTraceElement[] elements = Thread.currentThread().getStackTrace();
|
||||
this.stackTrace = Arrays.stream(elements).collect(Collectors.toList());
|
||||
return super.lastIndexOf(name, startIndex);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user