id
stringlengths
36
36
text
stringlengths
1
1.25M
9f02f137-38df-4f70-9ed4-abf41b72e035
Sadari(int height, int lineCount, TreeMap<Point, SadariBridge> bridges) { this.height = height; this.lineCount = lineCount; this.bridges = bridges; }
65b77cd0-4b71-4519-8e05-e1479cf1f351
public int getHeight() { return height; }
776df5c0-cf67-4831-8cf7-b8fa84793420
public int getLineCount() { return lineCount; }
12638ae0-78df-494b-9d02-7088195a6dc0
public TreeMap<Point, SadariBridge> getBridges() { return bridges; }
021b5abe-a603-4f1a-afde-2db2b6d569be
public List<Point> getPath(int startingLine) { List<Point> path = Lists.newArrayList(); Point startingPoint = new Point(startingLine, 0); path.add(startingPoint); Point currentPoint = startingPoint; SadariBridge currentBridge = null; while ((currentBridge = nextBridge(c...
6903ca32-6319-4873-a42e-f7d99ea7b6c7
public SadariBridge nextBridge(Point point) { try { Point startPoint = point; Point endPoint = new Point(point.getX(), Integer.MAX_VALUE); Point nextBridgeFromPoint = bridges.subMap(startPoint, false, endPoint, false).firstKey(); return bridges.get(nextBridgeFromP...
9cf6f582-13fc-4965-baef-04ea7a392ce7
public String draw() { return SadariHelper.draw(this); }
1790bf42-a23c-4b7a-99b7-4d40bd71d737
public Point(int x, int y) { this.x = x; this.y = y; }
ade7d56f-e4c8-4387-8c49-fb953f814d42
public int getX() { return x; }
65150f0d-6c7c-41f9-8e7f-6bc27ae60311
public void setX(int x) { this.x = x; }
7ecdb8d1-a5c0-4f55-a0bc-966b4e15d82e
public int getY() { return y; }
cfb7e03a-5799-4668-8588-4ba3f62d1474
public void setY(int y) { this.y = y; }
9dc261e8-ba86-4e1d-89e5-b764d40872ec
@Override public boolean equals(Object obj) { if (obj instanceof Point) { Point other = (Point) obj; return Objects.equal(x, other.x) && Objects.equal(y, other.y); } return false; }
8c3fd895-801e-4e27-ac3d-368a5ba31644
@Override public int hashCode() { return Objects.hashCode(x, y); }
65e15b32-5bea-4ea2-b704-81e92c587a76
@Override public int compareTo(Point o) { return ComparisonChain.start().compare(x, o.x).compare(y, o.y).result(); }
12b92552-2b11-4d51-9561-420e86366a1f
@Override public String toString() { return Objects.toStringHelper(getClass()).add("x", x).add("y", y).toString(); }
833d688b-ad71-44be-b4b8-cf9b6bbea768
@Produces @RequestScoped public FacesContext facesContext() { return FacesContext.getCurrentInstance(); }
38c24041-02b8-4ee1-bbe6-6d9fe31a0b2d
public void put(LogStatement log) { logsByMessage.put(log.getMessage(), log); }
22c48262-a94f-4de2-83ff-cef65e335d3d
public int getNumberOfTotalLogMessages() { return logsByMessage.size(); }
720017b2-5d2d-4ff6-a4b7-7ff6e0f8a147
public int getNumberOfUniqueLogMessages() { return logsByMessage.keySet().size(); }
386a1750-d392-4c7c-9d2c-2f2e13116431
public Set<String> getUniqueMessageStrings() { return logsByMessage.keySet(); }
bab82543-c6f7-40b3-a878-d980c65f5147
public Collection<LogStatement> getLogStatements(String message) { return logsByMessage.get(message); }
6b9e788d-3194-41e3-989f-6449f5b219b1
public int getNumberOfStatements(String message) { return getLogStatements(message).size(); }
f48511c5-41dd-4ff5-918a-6edde7d7dfcd
public Collection<LogStatement> first10LogStatements(String message) { return logsByMessage.get(message).stream() .limit(10) .collect(Collectors.toList()); }
2afd24f2-27d9-468b-a3f4-91432777f34a
public Clazz getRootExceptionCause() { return rootExceptionCause; }
946a1ccd-3b54-4247-96a5-8eb8180707c4
public void setRootExceptionCause(Clazz rootExceptionCause) { this.rootExceptionCause = rootExceptionCause; }
182aadf0-4648-4efb-b0b3-554c553bc75c
public AtLine getExceptionOriginAtLine() { return exceptionOriginAtLine; }
50247fc8-95f3-4a7d-9aab-dba122ff7b04
public void setExceptionOriginAtLine(AtLine exceptionOriginAtLine) { this.exceptionOriginAtLine = exceptionOriginAtLine; }
ab5faeba-db21-462a-b3db-566d8e3602c2
public LogMessages getLogs() { return logs; }
9165303f-3e80-46d3-8dca-96dc10b8124e
public void setLogs(LogMessages logs) { this.logs = logs; }
ddfa2842-d160-4ad8-9749-0eff28c90444
public FullStackTrace(String lines, int numberOfLines) { this.lines = lines; this.numberOfLines = numberOfLines; }
d446730f-2e4e-4216-9bd0-ac4e40f451b7
public String getLines() { return lines; }
e6d1dd53-95c9-4f14-b58b-cd09c5a70362
public int getNumberOfLines() { return numberOfLines; }
354d6e6c-037e-440f-bcab-a8bbef9e5c47
@Override public String toString() { return "FullStackTrace{" + "lines='" + lines + '\'' + ", numberOfLines=" + numberOfLines + "} " + super.toString(); }
220386c0-af07-4275-9ae2-fd4f7b0656ef
public List<LogErrorSummary> errors(InputStream inputStream) { TokenParser tokenParser = new TokenParser(); List<LogStatement> statements = tokenParser.parseLogStatemens(inputStream); List<LogStatement> errors = filterErrors(statements); Map<LogsService.StackTraceKey, LogMessages> uniqueErrors = errorsWithSame...
8d8aec1b-b69f-4645-a5fa-969cc82d6c10
protected List<LogStatement> filterErrors(List<LogStatement> statements) { return statements.stream() .filter(log -> log.hasCausedBy()) .collect(Collectors.toList()); }
f0a7dd95-e0ac-499b-9af2-243f7e360f62
protected Map<StackTraceKey, LogMessages> errorsWithSameOrigin(List<LogStatement> errors) { Map<StackTraceKey, LogMessages> result = new HashMap<>(); for (LogStatement log : errors) { CausedBy causedBy = log.lastCausedBy(); Clazz causedByClazz = causedBy.getExceptionClazz(); AtLine atLine = causedBy.getA...
4d6bf2b9-096f-4dd6-be13-7462751b02c7
protected List<LogErrorSummary> categorizeErrors(Map<StackTraceKey, LogMessages> errors) { LinkedList<LogErrorSummary> result = new LinkedList<>(); for (StackTraceKey key : errors.keySet()) { LogMessages logs = errors.get(key); LogErrorSummary summary = new LogErrorSummary(); summary.setRootExceptionCaus...
5500d1ff-0c9e-472d-b09e-69bc5c8a0e2d
public StackTraceKey(Clazz causedByException, AtLine atLine) { this.causedByException = causedByException; this.atLine = atLine; }
d7ff8609-a143-4e9b-a95f-5bda32477263
public Clazz getCausedByException() { return causedByException; }
9fae4944-8a14-4fa5-99dc-3a8025708c3f
public AtLine getAtLine() { return atLine; }
98142e45-50c2-4f5f-a442-3a89a1bb64b7
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; StackTraceKey that = (StackTraceKey) o; if (atLine != null ? !atLine.equals(that.atLine) : that.atLine != null) return false; if (causedByException != null ? !causedByExc...
cc46afad-8f5f-40e2-b79a-12c39cc71d10
@Override public int hashCode() { int result = causedByException != null ? causedByException.hashCode() : 0; result = 31 * result + (atLine != null ? atLine.hashCode() : 0); return result; }
740e893d-0679-4274-a1f3-e0bdc5e85ed2
@Override public String toString() { return "StackTraceKey{" + "causedByException='" + causedByException + '\'' + ", atLine='" + atLine + '\'' + '}'; }
557d45d8-38b6-4c5b-94bd-7c5860292944
public List<LogStatement> parseLogStatemens(InputStream input) { List<LogStatement> result = new ArrayList<>(); try (BufferedReader reader = new BufferedReader(new InputStreamReader(input))) { tokenizer = new Tokenizer(reader); repeatUntilFalse(() -> parseLogStatement(result)); } catch (EndOfStreamExce...
fcb6f562-5e28-4a10-afd0-ea0b568cbcea
private void repeatUntilFalse(Supplier<Boolean> block) { while (block.get()) { // do nothing, just repeat until 'false' } }
6a782741-f9ce-4384-877d-e7c6d3177ad4
private boolean parseLogStatement(List<LogStatement> result) { LogStatement logStatement = lineParser.parseLogStatement(tokenizer.peekNextLine()); if (logStatement != null) { result.add(logStatement); tokenizer.advanceNextLine(); // sometimes there is "at line" before "caused by".. if there is an artific...
cf7facb1-5779-4d8b-83fe-f8e408cfa5b1
private boolean parseCausedBy(LogStatement logStatement) { CausedBy causedBy = lineParser.parseCausedBy(tokenizer.peekNextLine(), logStatement); if (causedBy != null) { tokenizer.advanceNextLine(); logStatement.addCausedBy(causedBy); repeatUntilFalse(() -> parseAtLine(logStatement)); parseMoreLine();...
2cbb4372-7435-4659-b7be-a2bcd8657abe
private boolean parseAtLine(LogStatement logStatement) { AtLine atLine = lineParser.parseAtLine(tokenizer.peekNextLine()); if (atLine != null) { tokenizer.advanceNextLine(); // when there was no caused by, just "at line" is found, we add an empty caused by if (!logStatement.hasCausedBy()) { logStateme...
d226bd85-8991-49ad-a3cb-dbd8423e0622
private boolean parseMoreLine() { if (lineParser.matchesMore(tokenizer.peekNextLine())) { tokenizer.advanceNextLine(); return true; } return false; }
267a7143-a91a-4403-9542-7da49632dfc1
Tokenizer(BufferedReader reader) { this.reader = reader; }
e8996a60-dc10-4826-b79b-229a5610107a
void clear() { reader = null; current = null; next = null; }
66463b12-69e0-4e8e-be79-7b4cba684cc0
String advanceNextLine() { if (next != null) { current = next; next = null; } else { current = readNextLine(); } return current; }
003c8d30-6f4c-4674-9619-697d127097d6
String peekNextLine() { if (next == null) { next = readNextLine(); } return next; }
590927f6-783f-4c06-b861-6d8274d878e9
private String readNextLine() { try { String line = reader.readLine(); if (line == null) { throw new EndOfStreamException(); } return line.trim(); } catch (IOException e) { throw new RuntimeException(e); } }
0e8e2ebc-6629-4e86-8290-76e7cb2968b5
public LogStatement parseLogStatement(String line) { Matcher matcher = LOG_MESSAGE_PATTERN.matcher(line); if (matcher.matches()) { String time = matcher.group("time"); LocalTime localTime = parseLocalTime(time); String levelString = matcher.group("level"); Level level = parseLevel(levelString); Str...
83f95221-8a74-4d45-8db2-ad28cd452f33
public CausedBy parseCausedBy(String line, LogStatement currentLogStatement) { Matcher matcher = CAUSED_BY_PATTERN.matcher(line); if (matcher.matches()) { String clazzString = matcher.group("class"); String message = matcher.group("message"); Clazz clazz = classRepository.cachedClazz(clazzString); bool...
dc34dc34-2a48-4a06-850f-5e3e099fd910
private Level parseLevel(String levelString) { return Level.valueOf(levelString); }
f5fe467e-0008-4e89-84f9-bc0f624cd26e
public LocalTime parseLocalTime(String time) { return LocalTime.parse(time); }
69b46012-21e3-425b-92db-5888a3b57e24
public AtLine parseAtLine(String line) { Matcher matcher = AT_LINE_PATTERN.matcher(line); if (matcher.matches()) { String clazzString = matcher.group("class"); String method = matcher.group("method"); String source = matcher.group("source"); Clazz clazz = classRepository.cachedClazz(clazzString); r...
ef8fe2ec-d9e8-454b-b4d6-555d5d6643a8
public boolean matchesMore(String line) { return MORE_PATTERN.matcher(line).matches(); }
30a42489-188b-42f1-b14a-07e75dccbe22
public Clazz cachedClazz(String name) { Clazz clazz = byName.get(name); if (clazz == null) { clazz = new Clazz(name); byName.put(name, clazz); } return clazz; }
3bc657d0-8e8b-4c4d-9626-c40275d51ca8
public AtLine(Clazz clazz, String method, String source) { this.clazz = clazz; this.method = method; this.source = source; }
9740f510-ce3d-4b45-9752-6d20415954dc
public String getReferenceRepresentation() { return clazz.getFullyQualifiedName() + "#" + method + " (" + source + ")"; }
b8847929-f6d6-4565-bc0e-0f5a867cc17b
public Clazz getClazz() { return clazz; }
070082ef-c6f1-4d8e-9603-92b8f01cff8e
public String getMethod() { return method; }
b5b6debc-f423-47a3-bdbb-87da80532e9c
public String getSource() { return source; }
4283458c-805c-4890-9d04-a4497e8afacc
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; AtLine atLine = (AtLine) o; if (clazz != null ? !clazz.equals(atLine.clazz) : atLine.clazz != null) return false; if (method != null ? !method.equals(atLine.method) : atLine.me...
2d88105b-fbde-4470-a63b-7b3738d06683
@Override public int hashCode() { int result = clazz != null ? clazz.hashCode() : 0; result = 31 * result + (method != null ? method.hashCode() : 0); result = 31 * result + (source != null ? source.hashCode() : 0); return result; }
fd48842c-a0f1-4905-acc2-5ee66cf676bc
@Override public String toString() { return "AtLine{" + "clazz=" + clazz + ", method='" + method + '\'' + ", source='" + source + '\'' + '}'; }
87fda2db-6f44-481f-ab67-b7b05f842e5d
public CausedBy(Clazz exceptionClazz, String message, boolean topLevelException) { this.exceptionClazz = exceptionClazz; this.message = message; this.topLevelException = topLevelException; }
12da5cf7-e1dc-4bdf-b2a2-2a01a6d345fc
public void addAtLine(AtLine atLine) { if (atLines.size() < MAX_TRACES) { atLines.add(atLine); } }
7c618611-1941-4276-bac0-9c53d815db81
public void appendReferenceRepresentation(StringBuilder sb) { if (!topLevelException) { sb.append("Caused by: "); } sb.append(exceptionClazz.getFullyQualifiedName()); if (!Strings.isNullOrEmpty(message)) { sb.append(": ").append(message); } }
1286f9ae-8a75-47a3-a5ed-a60a166ae344
public List<AtLine> getAtLines() { return atLines; }
3cd80044-13c5-4a91-b41e-34981912b741
public Clazz getExceptionClazz() { return exceptionClazz; }
9405323c-1f08-4834-a72a-2f1792ac5319
public String getMessage() { return message; }
2cd8a752-ba25-438a-a9fb-c1e0f1d10b84
public boolean isTopLevelException() { return topLevelException; }
e287898a-f153-4494-91a5-9d3665dd49e3
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; CausedBy causedBy = (CausedBy) o; if (topLevelException != causedBy.topLevelException) return false; if (atLines != null ? !atLines.equals(causedBy.atLines) : causedBy.atLines ...
e5888016-8af4-499a-80be-9e514e4f3d03
@Override public int hashCode() { int result = exceptionClazz != null ? exceptionClazz.hashCode() : 0; result = 31 * result + (message != null ? message.hashCode() : 0); result = 31 * result + (topLevelException ? 1 : 0); result = 31 * result + (atLines != null ? atLines.hashCode() : 0); return result; }
6f0dd1eb-ac78-4f51-b78d-9b5c4737f2b6
@Override public String toString() { return "CausedBy{" + "exceptionClazz=" + exceptionClazz + ", message='" + message + '\'' + ", topLevelException=" + topLevelException + ", atLines=" + atLines + '}'; }
6af22107-4bf6-4146-a0fe-a13aeb7e7e68
public Clazz(String fullyQualifiedName) { this.fullyQualifiedName = fullyQualifiedName; }
2ed51df6-ac92-45c5-aae8-fc0fdf36fb9c
public String getSimpleName() { String[] strings = BY_DOTS.split(fullyQualifiedName); return strings[strings.length - 1]; }
80d746ac-0507-481f-b2ed-97e722b66472
public String getFullyQualifiedName() { return fullyQualifiedName; }
c5865dcb-47d6-4923-b1fe-7d8668930007
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Clazz clazz = (Clazz) o; if (fullyQualifiedName != null ? !fullyQualifiedName.equals(clazz.fullyQualifiedName) : clazz.fullyQualifiedName != null) return false; return true...
6a7658e1-a673-42c5-bba0-dd7b17da464f
@Override public int hashCode() { return fullyQualifiedName != null ? fullyQualifiedName.hashCode() : 0; }
432dca48-f576-4feb-bd27-78a68a5a7821
@Override public String toString() { return "Clazz{" + "name='" + fullyQualifiedName + '\'' + '}'; }
b3094735-0e47-4d13-bad7-5d04013e9f2a
public LogStatement(LocalTime time, Level level, Clazz clazz, String message) { this.time = time; this.level = level; this.clazz = clazz; this.message = message; }
c1f5880b-d7f6-4cb6-be81-04fb27a31286
public boolean hasCausedBy() { return lastCausedBy != null; }
85305e0f-c081-4290-a51a-6daf573b6cc8
public CausedBy lastCausedBy() { if (lastCausedBy == null) { throw new IllegalStateException("No CausedBy element was inserted, can't retrieve last"); } return lastCausedBy; }
f6178c03-67f9-4f8a-b528-350bc7e85917
public void addCausedBy(CausedBy causedBy) { if (causedBies == null) { causedBies = new LinkedList<>(); } lastCausedBy = causedBy; causedBies.add(causedBy); }
17b4bc7e-57c3-46fb-b220-eda92be5a900
public void addMultiLineMessage(String message) { this.message += "\n" + message; }
69cfab32-f41d-4847-8a7a-881f04c97457
public FullStackTrace getFullStackTrace() { StringBuilder sb = new StringBuilder(); String ls = System.lineSeparator(); sb.append(time).append(" ").append(level) .append(" (").append(clazz.getFullyQualifiedName()).append(")") .append(" ").append(message) .append(ls); for (CausedBy causedBy : cause...
e18fbe12-2e3f-495d-ac5d-ff05a81309c4
public LocalTime getTime() { return time; }
fe3bcb23-d493-4c72-b33a-03b6d5d7f07f
public Level getLevel() { return level; }
36351a91-9fa9-4e0d-afc4-9ea3beab73f3
public Clazz getClazz() { return clazz; }
04249e08-5544-4c4f-ac6f-54bcec598626
public String getMessage() { return message; }
7f19c836-26bf-4409-9597-e1ed2491b9a8
public List<CausedBy> getCausedBies() { return causedBies; }
b2952458-78df-4b84-b833-81e23f3428a6
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; LogStatement that = (LogStatement) o; if (causedBies != null ? !causedBies.equals(that.causedBies) : that.causedBies != null) return false; if (clazz != null ? !clazz.equals(th...
50bb4d06-b258-48d3-8d22-f64b2e9eb7b4
@Override public int hashCode() { int result = time != null ? time.hashCode() : 0; result = 31 * result + (level != null ? level.hashCode() : 0); result = 31 * result + (clazz != null ? clazz.hashCode() : 0); result = 31 * result + (message != null ? message.hashCode() : 0); result = 31 * result + (lastCause...
6f647121-52fc-4ac9-be5a-1c70437c3ec4
@Override public String toString() { return "LogStatement{" + "time=" + time + ", level=" + level + ", clazz='" + clazz + '\'' + ", message='" + message + '\'' + ", causedBies=" + causedBies + '}'; }