Skip to content

Commit

Permalink
Simplify BacktraceAttributes business logic
Browse files Browse the repository at this point in the history
  • Loading branch information
Konrad Dysput committed Nov 12, 2024
1 parent 1e1660b commit 7871a13
Showing 1 changed file with 4 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public BacktraceAttributes(Context context, BacktraceReport report, Map<String,
this.setExceptionAttributes(report);
}
if (clientAttributes != null) {
this.convertClientAttributes(clientAttributes);
this.convertAttributes(clientAttributes);
}
if (report != null && clientAttributes != null) {
BacktraceReport.concatAttributes(report, clientAttributes);
Expand Down Expand Up @@ -181,15 +181,6 @@ private int getScreenBrightness() {
0);
}

/**
* Divide client attributes into primitive and complex attributes and add to this object
*
* @param clientAttributes client's attributes
*/
private void convertClientAttributes(Map<String, Object> clientAttributes) {
convertAttributes(clientAttributes);
}

/**
* Divide report attributes into primitive and complex attributes and add to this object
*
Expand All @@ -205,6 +196,9 @@ private void convertReportAttributes(BacktraceReport report) {
}

private void convertAttributes(Map<String, Object> clientAttributes) {
if (clientAttributes == null || clientAttributes.isEmpty()) {
return;
}
ReportDataAttributes data = ReportDataBuilder.getReportAttributes(clientAttributes);
this.attributes.putAll(data.getAttributes());
this.complexAttributes.putAll(data.getAnnotations());
Expand Down

0 comments on commit 7871a13

Please sign in to comment.