Remove deprecated "SCREAMING CAPS" constants from dart:io.

Fixes #34218.

Bug: https://github.com/dart-lang/sdk/issues/34218
Change-Id: Ibe936dc6ed8951b2a0c53997b7d33bb8c7afe8cd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/236840
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
This commit is contained in:
Paul Berry 2022-03-17 23:00:57 +00:00 committed by Commit Bot
parent ef00a01289
commit fd02fec0fc
12 changed files with 31 additions and 231 deletions

View file

@ -57,6 +57,11 @@
throw UnsupportedError("keyLog not implemented");
```
- **Breaking Change** [#34218](https://github.com/dart-lang/sdk/issues/34218):
Constants in `dart:io` following the `SCREAMING_CAPS` convention have been
removed (they were previously deprecated). Please use the corresponding
`lowerCamelCase` constants instead.
- Add a optional `keyLog` parameter to `SecureSocket.connect` and
`SecureSocket.startConnect`.

View file

@ -389,23 +389,23 @@ class Process {
@patch
class InternetAddress {
@patch
static InternetAddress get LOOPBACK_IP_V4 {
throw UnsupportedError("InternetAddress.LOOPBACK_IP_V4");
static InternetAddress get loopbackIPv4 {
throw UnsupportedError("InternetAddress.loopbackIPv4");
}
@patch
static InternetAddress get LOOPBACK_IP_V6 {
throw UnsupportedError("InternetAddress.LOOPBACK_IP_V6");
static InternetAddress get loopbackIPv6 {
throw UnsupportedError("InternetAddress.loopbackIPv6");
}
@patch
static InternetAddress get ANY_IP_V4 {
throw UnsupportedError("InternetAddress.ANY_IP_V4");
static InternetAddress get anyIPv4 {
throw UnsupportedError("InternetAddress.anyIPv4");
}
@patch
static InternetAddress get ANY_IP_V6 {
throw UnsupportedError("InternetAddress.ANY_IP_V6");
static InternetAddress get anyIPv6 {
throw UnsupportedError("InternetAddress.anyIPv6");
}
@patch

View file

@ -389,23 +389,23 @@ class Process {
@patch
class InternetAddress {
@patch
static InternetAddress get LOOPBACK_IP_V4 {
throw new UnsupportedError("InternetAddress.LOOPBACK_IP_V4");
static InternetAddress get loopbackIPv4 {
throw new UnsupportedError("InternetAddress.loopbackIPv4");
}
@patch
static InternetAddress get LOOPBACK_IP_V6 {
throw new UnsupportedError("InternetAddress.LOOPBACK_IP_V6");
static InternetAddress get loopbackIPv6 {
throw new UnsupportedError("InternetAddress.loopbackIPv6");
}
@patch
static InternetAddress get ANY_IP_V4 {
throw new UnsupportedError("InternetAddress.ANY_IP_V4");
static InternetAddress get anyIPv4 {
throw new UnsupportedError("InternetAddress.anyIPv4");
}
@patch
static InternetAddress get ANY_IP_V6 {
throw new UnsupportedError("InternetAddress.ANY_IP_V6");
static InternetAddress get anyIPv6 {
throw new UnsupportedError("InternetAddress.anyIPv6");
}
@patch

View file

@ -48,22 +48,22 @@ class RawSocketOption {
@patch
class InternetAddress {
@patch
static InternetAddress get LOOPBACK_IP_V4 {
static InternetAddress get loopbackIPv4 {
return _InternetAddress.loopbackIPv4;
}
@patch
static InternetAddress get LOOPBACK_IP_V6 {
static InternetAddress get loopbackIPv6 {
return _InternetAddress.loopbackIPv6;
}
@patch
static InternetAddress get ANY_IP_V4 {
static InternetAddress get anyIPv4 {
return _InternetAddress.anyIPv4;
}
@patch
static InternetAddress get ANY_IP_V6 {
static InternetAddress get anyIPv6 {
return _InternetAddress.anyIPv6;
}

View file

@ -11,82 +11,52 @@ abstract class ZLibOption {
/// Minimal value for [ZLibCodec.windowBits], [ZLibEncoder.windowBits]
/// and [ZLibDecoder.windowBits].
static const int minWindowBits = 8;
@Deprecated("Use minWindowBits instead")
static const int MIN_WINDOW_BITS = 8;
/// Maximal value for [ZLibCodec.windowBits], [ZLibEncoder.windowBits]
/// and [ZLibDecoder.windowBits].
static const int maxWindowBits = 15;
@Deprecated("Use maxWindowBits instead")
static const int MAX_WINDOW_BITS = 15;
/// Default value for [ZLibCodec.windowBits], [ZLibEncoder.windowBits]
/// and [ZLibDecoder.windowBits].
static const int defaultWindowBits = 15;
@Deprecated("Use defaultWindowBits instead")
static const int DEFAULT_WINDOW_BITS = 15;
/// Minimal value for [ZLibCodec.level] and [ZLibEncoder.level].
static const int minLevel = -1;
@Deprecated("Use minLevel instead")
static const int MIN_LEVEL = -1;
/// Maximal value for [ZLibCodec.level] and [ZLibEncoder.level]
static const int maxLevel = 9;
@Deprecated("Use maxLevel instead")
static const int MAX_LEVEL = 9;
/// Default value for [ZLibCodec.level] and [ZLibEncoder.level].
static const int defaultLevel = 6;
@Deprecated("Use defaultLevel instead")
static const int DEFAULT_LEVEL = 6;
/// Minimal value for [ZLibCodec.memLevel] and [ZLibEncoder.memLevel].
static const int minMemLevel = 1;
@Deprecated("Use minMemLevel instead")
static const int MIN_MEM_LEVEL = 1;
/// Maximal value for [ZLibCodec.memLevel] and [ZLibEncoder.memLevel].
static const int maxMemLevel = 9;
@Deprecated("Use maxMemLevel instead")
static const int MAX_MEM_LEVEL = 9;
/// Default value for [ZLibCodec.memLevel] and [ZLibEncoder.memLevel].
static const int defaultMemLevel = 8;
@Deprecated("Use defaultMemLevel instead")
static const int DEFAULT_MEM_LEVEL = 8;
/// Recommended strategy for data produced by a filter (or predictor)
static const int strategyFiltered = 1;
@Deprecated("Use strategyFiltered instead")
static const int STRATEGY_FILTERED = 1;
/// Use this strategy to force Huffman encoding only (no string match)
static const int strategyHuffmanOnly = 2;
@Deprecated("Use strategyHuffmanOnly instead")
static const int STRATEGY_HUFFMAN_ONLY = 2;
/// Use this strategy to limit match distances to one (run-length encoding)
static const int strategyRle = 3;
@Deprecated("Use strategyRle instead")
static const int STRATEGY_RLE = 3;
/// This strategy prevents the use of dynamic Huffman codes, allowing for a
/// simpler decoder
static const int strategyFixed = 4;
@Deprecated("Use strategyFixed instead")
static const int STRATEGY_FIXED = 4;
/// Recommended strategy for normal data
static const int strategyDefault = 0;
@Deprecated("Use strategyDefault instead")
static const int STRATEGY_DEFAULT = 0;
}
/// An instance of the default implementation of the [ZLibCodec].
const ZLibCodec zlib = const ZLibCodec._default();
@Deprecated("Use zlib instead")
const ZLibCodec ZLIB = zlib;
/// The [ZLibCodec] encodes raw bytes to ZLib compressed bytes and decodes ZLib
/// compressed bytes to raw bytes.
@ -176,8 +146,6 @@ class ZLibCodec extends Codec<List<int>, List<int>> {
/// An instance of the default implementation of the [GZipCodec].
const GZipCodec gzip = const GZipCodec._default();
@Deprecated("Use gzip instead")
const GZipCodec GZIP = gzip;
/// The [GZipCodec] encodes raw bytes to GZip compressed bytes and decodes GZip
/// compressed bytes to raw bytes.

View file

@ -8,87 +8,43 @@ part of dart.io;
class FileMode {
/// The mode for opening a file only for reading.
static const read = const FileMode._internal(0);
@Deprecated("Use read instead")
static const READ = read;
/// Mode for opening a file for reading and writing. The file is
/// overwritten if it already exists. The file is created if it does not
/// already exist.
static const write = const FileMode._internal(1);
@Deprecated("Use write instead")
static const WRITE = write;
/// Mode for opening a file for reading and writing to the
/// end of it. The file is created if it does not already exist.
static const append = const FileMode._internal(2);
@Deprecated("Use append instead")
static const APPEND = append;
/// Mode for opening a file for writing *only*. The file is
/// overwritten if it already exists. The file is created if it does not
/// already exist.
static const writeOnly = const FileMode._internal(3);
@Deprecated("Use writeOnly instead")
static const WRITE_ONLY = writeOnly;
/// Mode for opening a file for writing *only* to the
/// end of it. The file is created if it does not already exist.
static const writeOnlyAppend = const FileMode._internal(4);
@Deprecated("Use writeOnlyAppend instead")
static const WRITE_ONLY_APPEND = writeOnlyAppend;
final int _mode;
const FileMode._internal(this._mode);
}
/// The mode for opening a file only for reading.
@Deprecated("Use FileMode.read instead")
const READ = FileMode.read;
/// The mode for opening a file for reading and writing. The file is
/// overwritten if it already exists. The file is created if it does not
/// already exist.
@Deprecated("Use FileMode.write instead")
const WRITE = FileMode.write;
/// The mode for opening a file for reading and writing to the
/// end of it. The file is created if it does not already exist.
@Deprecated("Use FileMode.append instead")
const APPEND = FileMode.append;
/// Mode for opening a file for writing *only*. The file is
/// overwritten if it already exists. The file is created if it does not
/// already exist.
@Deprecated("Use FileMode.writeOnly instead")
const WRITE_ONLY = FileMode.writeOnly;
/// Mode for opening a file for writing *only* to the
/// end of it. The file is created if it does not already exist.
@Deprecated("Use FileMode.writeOnlyAppend instead")
const WRITE_ONLY_APPEND = FileMode.writeOnlyAppend;
/// Type of lock when requesting a lock on a file.
class FileLock {
/// Shared file lock.
static const shared = const FileLock._internal(1);
@Deprecated("Use shared instead")
static const SHARED = shared;
/// Exclusive file lock.
static const exclusive = const FileLock._internal(2);
@Deprecated("Use exclusive instead")
static const EXCLUSIVE = exclusive;
/// Blocking shared file lock.
static const blockingShared = const FileLock._internal(3);
@Deprecated("Use blockingShared instead")
static const BLOCKING_SHARED = blockingShared;
/// Blocking exclusive file lock.
static const blockingExclusive = const FileLock._internal(4);
@Deprecated("Use blockingExclusive instead")
static const BLOCKING_EXCLUSIVE = blockingExclusive;
final int _type;

View file

@ -11,20 +11,12 @@ part of dart.io;
/// to indicate the object's type.
class FileSystemEntityType {
static const file = const FileSystemEntityType._internal(0);
@Deprecated("Use file instead")
static const FILE = file;
static const directory = const FileSystemEntityType._internal(1);
@Deprecated("Use directory instead")
static const DIRECTORY = directory;
static const link = const FileSystemEntityType._internal(2);
@Deprecated("Use link instead")
static const LINK = link;
static const notFound = const FileSystemEntityType._internal(3);
@Deprecated("Use notFound instead")
static const NOT_FOUND = notFound;
static const _typeList = const [
FileSystemEntityType.file,
@ -447,7 +439,7 @@ abstract class FileSystemEntity {
///
/// Use `events` to specify what events to listen for. The constants in
/// [FileSystemEvent] can be or'ed together to mix events. Default is
/// [FileSystemEvent.ALL].
/// [FileSystemEvent.all].
///
/// A move event may be reported as separate delete and create events.
Stream<FileSystemEvent> watch(
@ -870,29 +862,19 @@ abstract class FileSystemEntity {
class FileSystemEvent {
/// Bitfield for [FileSystemEntity.watch], to enable [FileSystemCreateEvent]s.
static const int create = 1 << 0;
@Deprecated("Use create instead")
static const int CREATE = 1 << 0;
/// Bitfield for [FileSystemEntity.watch], to enable [FileSystemModifyEvent]s.
static const int modify = 1 << 1;
@Deprecated("Use modify instead")
static const int MODIFY = 1 << 1;
/// Bitfield for [FileSystemEntity.watch], to enable [FileSystemDeleteEvent]s.
static const int delete = 1 << 2;
@Deprecated("Use delete instead")
static const int DELETE = 1 << 2;
/// Bitfield for [FileSystemEntity.watch], to enable [FileSystemMoveEvent]s.
static const int move = 1 << 3;
@Deprecated("Use move instead")
static const int MOVE = 1 << 3;
/// Bitfield for [FileSystemEntity.watch], for enabling all of [create],
/// [modify], [delete] and [move].
static const int all = create | modify | delete | move;
@Deprecated("Use all instead")
static const int ALL = create | modify | delete | move;
static const int _modifyAttributes = 1 << 4;
static const int _deleteSelf = 1 << 5;

View file

@ -130,24 +130,16 @@ class ProcessInfo {
class ProcessStartMode {
/// Normal child process.
static const normal = const ProcessStartMode._internal(0);
@Deprecated("Use normal instead")
static const NORMAL = normal;
/// Stdio handles are inherited by the child process.
static const inheritStdio = const ProcessStartMode._internal(1);
@Deprecated("Use inheritStdio instead")
static const INHERIT_STDIO = inheritStdio;
/// Detached child process with no open communication channel.
static const detached = const ProcessStartMode._internal(2);
@Deprecated("Use detached instead")
static const DETACHED = detached;
/// Detached child process with stdin, stdout and stderr still open
/// for communication with the child.
static const detachedWithStdio = const ProcessStartMode._internal(3);
@Deprecated("Use detachedWithStdio instead")
static const DETACHED_WITH_STDIO = detachedWithStdio;
static List<ProcessStartMode> get values => const <ProcessStartMode>[
normal,
@ -512,65 +504,6 @@ class ProcessSignal {
static const ProcessSignal sigpoll = const ProcessSignal._(29, "SIGPOLL");
static const ProcessSignal sigsys = const ProcessSignal._(31, "SIGSYS");
@Deprecated("Use sighup instead")
static const ProcessSignal SIGHUP = sighup;
@Deprecated("Use sigint instead")
static const ProcessSignal SIGINT = sigint;
@Deprecated("Use sigquit instead")
static const ProcessSignal SIGQUIT = sigquit;
@Deprecated("Use sigill instead")
static const ProcessSignal SIGILL = sigill;
@Deprecated("Use sigtrap instead")
static const ProcessSignal SIGTRAP = sigtrap;
@Deprecated("Use sigabrt instead")
static const ProcessSignal SIGABRT = sigabrt;
@Deprecated("Use sigbus instead")
static const ProcessSignal SIGBUS = sigbus;
@Deprecated("Use sigfpe instead")
static const ProcessSignal SIGFPE = sigfpe;
@Deprecated("Use sigkill instead")
static const ProcessSignal SIGKILL = sigkill;
@Deprecated("Use sigusr1 instead")
static const ProcessSignal SIGUSR1 = sigusr1;
@Deprecated("Use sigsegv instead")
static const ProcessSignal SIGSEGV = sigsegv;
@Deprecated("Use sigusr2 instead")
static const ProcessSignal SIGUSR2 = sigusr2;
@Deprecated("Use sigpipe instead")
static const ProcessSignal SIGPIPE = sigpipe;
@Deprecated("Use sigalrm instead")
static const ProcessSignal SIGALRM = sigalrm;
@Deprecated("Use sigterm instead")
static const ProcessSignal SIGTERM = sigterm;
@Deprecated("Use sigchld instead")
static const ProcessSignal SIGCHLD = sigchld;
@Deprecated("Use sigcont instead")
static const ProcessSignal SIGCONT = sigcont;
@Deprecated("Use sigstop instead")
static const ProcessSignal SIGSTOP = sigstop;
@Deprecated("Use sigtstp instead")
static const ProcessSignal SIGTSTP = sigtstp;
@Deprecated("Use sigttin instead")
static const ProcessSignal SIGTTIN = sigttin;
@Deprecated("Use sigttou instead")
static const ProcessSignal SIGTTOU = sigttou;
@Deprecated("Use sigurg instead")
static const ProcessSignal SIGURG = sigurg;
@Deprecated("Use sigxcpu instead")
static const ProcessSignal SIGXCPU = sigxcpu;
@Deprecated("Use sigxfsz instead")
static const ProcessSignal SIGXFSZ = sigxfsz;
@Deprecated("Use sigvtalrm instead")
static const ProcessSignal SIGVTALRM = sigvtalrm;
@Deprecated("Use sigprof instead")
static const ProcessSignal SIGPROF = sigprof;
@Deprecated("Use sigwinch instead")
static const ProcessSignal SIGWINCH = sigwinch;
@Deprecated("Use sigpoll instead")
static const ProcessSignal SIGPOLL = sigpoll;
@Deprecated("Use sigsys instead")
static const ProcessSignal SIGSYS = sigsys;
final int _signalNumber;
final String _name;

View file

@ -16,13 +16,6 @@ class InternetAddressType {
static const InternetAddressType unix = const InternetAddressType._(2);
static const InternetAddressType any = const InternetAddressType._(-1);
@Deprecated("Use IPv4 instead")
static const InternetAddressType IP_V4 = IPv4;
@Deprecated("Use IPv6 instead")
static const InternetAddressType IP_V6 = IPv6;
@Deprecated("Use any instead")
static const InternetAddressType ANY = any;
final int _value;
const InternetAddressType._(this._value);
@ -53,33 +46,25 @@ abstract class InternetAddress {
///
/// Use this address when listening on or connecting
/// to the loopback adapter using IP version 4 (IPv4).
static InternetAddress get loopbackIPv4 => LOOPBACK_IP_V4;
@Deprecated("Use loopbackIPv4 instead")
external static InternetAddress get LOOPBACK_IP_V4;
external static InternetAddress get loopbackIPv4;
/// IP version 6 loopback address.
///
/// Use this address when listening on or connecting to
/// the loopback adapter using IP version 6 (IPv6).
static InternetAddress get loopbackIPv6 => LOOPBACK_IP_V6;
@Deprecated("Use loopbackIPv6 instead")
external static InternetAddress get LOOPBACK_IP_V6;
external static InternetAddress get loopbackIPv6;
/// IP version 4 any address.
///
/// Use this address when listening on the addresses
/// of all adapters using IP version 4 (IPv4).
static InternetAddress get anyIPv4 => ANY_IP_V4;
@Deprecated("Use anyIPv4 instead")
external static InternetAddress get ANY_IP_V4;
external static InternetAddress get anyIPv4;
/// IP version 6 any address.
///
/// Use this address when listening on the addresses
/// of all adapters using IP version 6 (IPv6).
static InternetAddress get anyIPv6 => ANY_IP_V6;
@Deprecated("Use anyIPv6 instead")
external static InternetAddress get ANY_IP_V6;
external static InternetAddress get anyIPv6;
/// The address family of the [InternetAddress].
InternetAddressType get type;
@ -349,13 +334,6 @@ class SocketDirection {
static const SocketDirection send = const SocketDirection._(1);
static const SocketDirection both = const SocketDirection._(2);
@Deprecated("Use receive instead")
static const SocketDirection RECEIVE = receive;
@Deprecated("Use send instead")
static const SocketDirection SEND = send;
@Deprecated("Use both instead")
static const SocketDirection BOTH = both;
final _value;
const SocketDirection._(this._value);
@ -373,8 +351,6 @@ class SocketOption {
///
/// tcpNoDelay is disabled by default.
static const SocketOption tcpNoDelay = const SocketOption._(0);
@Deprecated("Use tcpNoDelay instead")
static const SocketOption TCP_NODELAY = tcpNoDelay;
static const SocketOption _ipMulticastLoop = const SocketOption._(1);
static const SocketOption _ipMulticastHops = const SocketOption._(2);
@ -504,15 +480,6 @@ class RawSocketEvent {
/// An event indicates the socket is closed.
static const RawSocketEvent closed = const RawSocketEvent._(3);
@Deprecated("Use read instead")
static const RawSocketEvent READ = read;
@Deprecated("Use write instead")
static const RawSocketEvent WRITE = write;
@Deprecated("Use readClosed instead")
static const RawSocketEvent READ_CLOSED = readClosed;
@Deprecated("Use closed instead")
static const RawSocketEvent CLOSED = closed;
final int _value;
const RawSocketEvent._(this._value);

View file

@ -348,15 +348,6 @@ class StdioType {
static const StdioType file = const StdioType._("file");
static const StdioType other = const StdioType._("other");
@Deprecated("Use terminal instead")
static const StdioType TERMINAL = terminal;
@Deprecated("Use pipe instead")
static const StdioType PIPE = pipe;
@Deprecated("Use file instead")
static const StdioType FILE = file;
@Deprecated("Use other instead")
static const StdioType OTHER = other;
final String name;
const StdioType._(this.name);
String toString() => "StdioType: $name";

View file

@ -12,8 +12,6 @@ part of dart.io;
/// On Windows this will use the currently active code page for the conversion.
/// On all other systems it will always use UTF-8.
const SystemEncoding systemEncoding = const SystemEncoding();
@Deprecated("Use systemEncoding instead")
const SystemEncoding SYSTEM_ENCODING = const SystemEncoding();
/// The system encoding is the current code page on Windows and UTF-8 on Linux
/// and Mac.

View file

@ -58,7 +58,7 @@ abstract class RawSynchronousSocket {
/// Shuts down a socket in the provided direction.
///
/// Calling shutdown will never throw an exception and calling it several times
/// is supported. If both [SocketDirection.RECEIVE] and [SocketDirection.SEND]
/// is supported. If both [SocketDirection.receive] and [SocketDirection.send]
/// directions are closed, the socket is closed completely, the same as if
/// [closeSync] has been called.
void shutdown(SocketDirection direction);