Skip to content

Commit

Permalink
chore: remove unused code (#1252)
Browse files Browse the repository at this point in the history
  • Loading branch information
incendial authored Feb 6, 2023
1 parent e893df5 commit 3637a22
Show file tree
Hide file tree
Showing 8 changed files with 4 additions and 48 deletions.
3 changes: 0 additions & 3 deletions dart/test/http_client/tracing_client_test.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import 'package:http/http.dart';
import 'package:http/testing.dart';
import 'package:mockito/mockito.dart';
import 'package:sentry/sentry.dart';
import 'package:sentry/src/http_client/tracing_client.dart';
import 'package:sentry/src/sentry_tracer.dart';
Expand Down Expand Up @@ -194,8 +193,6 @@ MockClient createThrowingClient() {
);
}

class CloseableMockClient extends Mock implements BaseClient {}

class Fixture {
final _options = SentryOptions(dsn: fakeDsn);
late Hub _hub;
Expand Down
8 changes: 0 additions & 8 deletions dart/test/mocks.dart
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,6 @@ final fakeEvent = SentryEvent(
),
);

/// Doesn't do anything with the events
class NoOpEventProcessor extends EventProcessor {
@override
FutureOr<SentryEvent?> apply(SentryEvent event, {hint}) {
return event;
}
}

/// Always returns null and thus drops all events
class DropAllEventProcessor extends EventProcessor {
@override
Expand Down
4 changes: 1 addition & 3 deletions dart/test/sentry_envelope_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,4 @@ void main() {
});
}

class NonEncodable {
final String message = 'Hello World';
}
class NonEncodable {}
9 changes: 0 additions & 9 deletions dart/test/sentry_user_feedback_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -171,15 +171,6 @@ class SentryUserFeedbackWithoutAssert implements SentryUserFeedback {
this.comments,
});

factory SentryUserFeedbackWithoutAssert.fromJson(Map<String, dynamic> json) {
return SentryUserFeedbackWithoutAssert(
eventId: SentryId.fromId(json['event_id']),
name: json['name'],
email: json['email'],
comments: json['comments'],
);
}

@override
final SentryId eventId;

Expand Down
13 changes: 0 additions & 13 deletions dart/test/transport/http_transport_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,13 @@ import 'package:sentry/src/client_reports/discard_reason.dart';
import 'package:sentry/src/sentry_envelope_header.dart';
import 'package:sentry/src/sentry_envelope_item_header.dart';
import 'package:sentry/src/sentry_item_type.dart';
import 'package:sentry/src/sentry_tracer.dart';
import 'package:sentry/src/transport/data_category.dart';
import 'package:sentry/src/transport/http_transport.dart';
import 'package:sentry/src/transport/rate_limiter.dart';
import 'package:test/test.dart';

import '../mocks.dart';
import '../mocks/mock_client_report_recorder.dart';
import '../mocks/mock_hub.dart';

void main() {
SentryEnvelope givenEnvelope() {
Expand Down Expand Up @@ -236,15 +234,4 @@ class Fixture {
options.recorder = clientReportRecorder;
return HttpTransport(options, rateLimiter);
}

SentryTracer createTracer({
bool? sampled = true,
}) {
final context = SentryTransactionContext(
'name',
'op',
samplingDecision: SentryTracesSamplingDecision(sampled!),
);
return SentryTracer(context, MockHub());
}
}
6 changes: 3 additions & 3 deletions flutter/example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -112,13 +112,13 @@ class MainScaffold extends StatelessWidget {
),
IconButton(
onPressed: () {
themeProvider.updatePrimatryColor(Colors.orange);
themeProvider.updatePrimaryColor(Colors.orange);
},
icon: const Icon(Icons.circle, color: Colors.orange),
),
IconButton(
onPressed: () {
themeProvider.updatePrimatryColor(Colors.green);
themeProvider.updatePrimaryColor(Colors.green);
},
icon: const Icon(Icons.circle, color: Colors.lime),
),
Expand Down Expand Up @@ -677,7 +677,7 @@ class ThemeProvider extends ChangeNotifier {
notifyListeners();
}

void updatePrimatryColor(MaterialColor color) {
void updatePrimaryColor(MaterialColor color) {
if (theme.brightness == Brightness.light) {
theme = ThemeData(primarySwatch: color, brightness: theme.brightness);
} else {
Expand Down
8 changes: 0 additions & 8 deletions flutter/lib/src/jvm/jvm_exception.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,6 @@ class JvmException {
return _parse(exception);
}

static JvmException? tryParse(String exception) {
try {
return JvmException.parse(exception);
} catch (_) {
return null;
}
}

final String? thread;
final String? type;
final String? description;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@ void main() {
}

class Fixture {
final hub = MockHub();
final options = SentryFlutterOptions(dsn: fakeDsn);

LoadReleaseIntegration getIntegration({PackageLoader? loader}) {
Expand Down

0 comments on commit 3637a22

Please sign in to comment.