Skip to content

Commit

Permalink
Merge pull request #29 from a14n/no-type-initialing-formals
Browse files Browse the repository at this point in the history
Don't type annotate initializing formals
  • Loading branch information
achilleasa authored Sep 23, 2019
2 parents 33971e2 + 0e0710b commit 531971b
Show file tree
Hide file tree
Showing 16 changed files with 32 additions and 26 deletions.
2 changes: 1 addition & 1 deletion lib/src/authentication/amq_plain_authenticator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class AmqPlainAuthenticator implements Authenticator {
final String password;

/// Create a new [PlainAuthenticator] with the specified [userName] and [password]
const AmqPlainAuthenticator(String this.userName, String this.password);
const AmqPlainAuthenticator(this.userName, this.password);

/// Get the class of this authenticator
String get saslType => "AMQPLAIN";
Expand Down
2 changes: 1 addition & 1 deletion lib/src/authentication/plain_authenticator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class PlainAuthenticator implements Authenticator {
final String password;

/// Create a new [PlainAuthenticator] with the specified [userName] and [password]
const PlainAuthenticator(String this.userName, String this.password);
const PlainAuthenticator(this.userName, this.password);

/// Get the class of this authenticator
String get saslType => "PLAIN";
Expand Down
18 changes: 9 additions & 9 deletions lib/src/client/connection_settings.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ class ConnectionSettings {
// Tuning settings
TuningSettings tuningSettings;

ConnectionSettings(
{String this.host = "127.0.0.1",
int this.port = 5672,
String this.virtualHost = "/",
Authenticator this.authProvider =
const PlainAuthenticator("guest", "guest"),
int this.maxConnectionAttempts = 1,
Duration this.reconnectWaitTime = const Duration(milliseconds: 1500),
TuningSettings this.tuningSettings}) {
ConnectionSettings({
this.host = "127.0.0.1",
this.port = 5672,
this.virtualHost = "/",
this.authProvider = const PlainAuthenticator("guest", "guest"),
this.maxConnectionAttempts = 1,
this.reconnectWaitTime = const Duration(milliseconds: 1500),
this.tuningSettings,
}) {
if (this.tuningSettings == null) {
tuningSettings = TuningSettings();
}
Expand Down
3 changes: 1 addition & 2 deletions lib/src/client/impl/amqp_message_impl.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ class _AmqpMessageImpl implements AmqpMessage {

MessageProperties get properties => message.properties;

_AmqpMessageImpl.fromDecodedMessage(
_ConsumerImpl this.consumer, DecodedMessage this.message);
_AmqpMessageImpl.fromDecodedMessage(this.consumer, this.message);

Uint8List get payload => message.payload;

Expand Down
2 changes: 1 addition & 1 deletion lib/src/client/impl/channel_impl.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class _ChannelImpl implements Channel {
Exception _channelCloseException;
final _basicReturnStream = StreamController<BasicReturnMessage>.broadcast();

_ChannelImpl(this.channelId, _ClientImpl this._client) {
_ChannelImpl(this.channelId, this._client) {
_frameWriter = FrameWriter(_client.tuningSettings);
_pendingOperations = ListQueue<Completer>();
_pendingOperationPayloads = ListQueue<Object>();
Expand Down
5 changes: 4 additions & 1 deletion lib/src/client/impl/consumer_impl.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ class _ConsumerImpl implements Consumer {
String get tag => _tag;

_ConsumerImpl(
_ChannelImpl this.channel, _QueueImpl this.queue, String this._tag);
this.channel,
this.queue,
this._tag,
);

StreamSubscription<AmqpMessage> listen(void onData(AmqpMessage event),
{Function onError, void onDone(), bool cancelOnError}) =>
Expand Down
2 changes: 1 addition & 1 deletion lib/src/client/impl/exchange_impl.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class _ExchangeImpl implements Exchange {
final ExchangeType type;
final _ChannelImpl channel;

_ExchangeImpl(_ChannelImpl this.channel, this._name, this.type);
_ExchangeImpl(this.channel, this._name, this.type);

String get name => _name;

Expand Down
2 changes: 1 addition & 1 deletion lib/src/client/impl/queue_impl.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class _QueueImpl implements Queue {
int _consumerCount;
final _ChannelImpl channel;

_QueueImpl(_ChannelImpl this.channel, this._name);
_QueueImpl(this.channel, this._name);

String get name => _name;

Expand Down
8 changes: 6 additions & 2 deletions lib/src/exceptions/connection_exception.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,12 @@ class ConnectionException implements Exception {
final int classId;
final int methodId;

ConnectionException(String this.message, ErrorType this.errorType,
int this.classId, int this.methodId);
ConnectionException(
this.message,
this.errorType,
this.classId,
this.methodId,
);

String toString() {
return "ConnectionException(${ErrorType.nameOf(errorType)}): ${message}";
Expand Down
2 changes: 1 addition & 1 deletion lib/src/exceptions/connection_failed_exception.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ part of dart_amqp.exceptions;
class ConnectionFailedException implements Exception {
final String message;

ConnectionFailedException(String this.message);
ConnectionFailedException(this.message);

String toString() {
return "ConnectionFailedException: ${message}";
Expand Down
2 changes: 1 addition & 1 deletion lib/src/exceptions/fatal_exception.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ part of dart_amqp.exceptions;
class FatalException implements Exception {
final String message;

FatalException(String this.message);
FatalException(this.message);

String toString() {
return "FatalException: ${message}";
Expand Down
2 changes: 1 addition & 1 deletion lib/src/protocol/frame/impl/decoded_message_impl.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class DecodedMessageImpl implements DecodedMessage {
ChunkedOutputWriter payloadBuffer;
Uint8List payload;

DecodedMessageImpl(this.channel, Message this.message);
DecodedMessageImpl(this.channel, this.message);

MessageProperties get properties => contentHeader?.properties;

Expand Down
2 changes: 1 addition & 1 deletion lib/src/protocol/frame/impl/heartbeat_frame_impl.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ part of dart_amqp.protocol;
class HeartbeatFrameImpl implements DecodedMessage {
final int channel;

HeartbeatFrameImpl(int this.channel);
HeartbeatFrameImpl(this.channel);

// String toString() {
// StringBuffer sb = new StringBuffer("""
Expand Down
2 changes: 1 addition & 1 deletion lib/src/protocol/frame/raw_frame.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class RawFrame {
final FrameHeader header;
final ByteData payload;

RawFrame(FrameHeader this.header, ByteData this.payload);
RawFrame(this.header, this.payload);

// String toString() {
// return """
Expand Down
2 changes: 1 addition & 1 deletion lib/src/protocol/io/frame_writer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class FrameWriter {

final TuningSettings _tuningSettings;

FrameWriter(TuningSettings this._tuningSettings)
FrameWriter(this._tuningSettings)
: _frameHeader = FrameHeader(),
_contentHeader = ContentHeader(),
_bufferEncoder = TypeEncoder(),
Expand Down
2 changes: 1 addition & 1 deletion lib/src/protocol/stream/type_decoder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class TypeDecoder {
ByteData _buffer;
final Endian endianess = Endian.big;

TypeDecoder.fromBuffer(ByteData this._buffer);
TypeDecoder.fromBuffer(this._buffer);

int readInt8() {
return _buffer.getInt8(_offset++);
Expand Down

0 comments on commit 531971b

Please sign in to comment.