Skip to content

Commit

Permalink
[io/doc] Make FileSystemEvent.toString() consistent across subclasses.
Browse files Browse the repository at this point in the history
Change-Id: I76bbe9b58bdee5594917410c69513160f25e519e
CoreLibraryReviewExempt: Only changes `toString`
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/329641
Commit-Queue: Brian Quinlan <[email protected]>
Reviewed-by: Alexander Aprelev <[email protected]>
  • Loading branch information
brianquinlan authored and Commit Queue committed Oct 10, 2023
1 parent 5daaa7d commit 2b137b4
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions sdk/lib/io/file_system_entity.dart
Original file line number Diff line number Diff line change
Expand Up @@ -912,7 +912,8 @@ final class FileSystemCreateEvent extends FileSystemEvent {
FileSystemCreateEvent(String path, bool isDirectory)
: super._(FileSystemEvent.create, path, isDirectory);

String toString() => "FileSystemCreateEvent('$path')";
String toString() =>
"FileSystemCreateEvent('$path', isDirectory=$isDirectory)";
}

/// File system event for modifications of file system objects.
Expand All @@ -926,7 +927,8 @@ final class FileSystemModifyEvent extends FileSystemEvent {
: super._(FileSystemEvent.modify, path, isDirectory);

String toString() =>
"FileSystemModifyEvent('$path', contentChanged=$contentChanged)";
"FileSystemModifyEvent('$path', isDirectory=$isDirectory, "
"contentChanged=$contentChanged)";
}

/// File system event for deletion of file system objects.
Expand All @@ -935,7 +937,8 @@ final class FileSystemDeleteEvent extends FileSystemEvent {
FileSystemDeleteEvent(String path, bool isDirectory)
: super._(FileSystemEvent.delete, path, isDirectory);

String toString() => "FileSystemDeleteEvent('$path')";
String toString() =>
"FileSystemDeleteEvent('$path', isDirectory=$isDirectory)";
}

/// File system event for moving of file system objects.
Expand All @@ -952,13 +955,8 @@ final class FileSystemMoveEvent extends FileSystemEvent {
FileSystemMoveEvent(String path, bool isDirectory, this.destination)
: super._(FileSystemEvent.move, path, isDirectory);

String toString() {
var buffer = new StringBuffer();
buffer.write("FileSystemMoveEvent('$path'");
if (destination != null) buffer.write(", '$destination'");
buffer.write(')');
return buffer.toString();
}
String toString() => "FileSystemMoveEvent('$path', "
"isDirectory=$isDirectory, destination=$destination)";
}

abstract class _FileSystemWatcher {
Expand Down

0 comments on commit 2b137b4

Please sign in to comment.