equal
deleted
inserted
replaced
216 throws IOException |
216 throws IOException |
217 { |
217 { |
218 Objects.requireNonNull(name); |
218 Objects.requireNonNull(name); |
219 if (!supportedOptions().contains(name)) |
219 if (!supportedOptions().contains(name)) |
220 throw new UnsupportedOperationException("'" + name + "' not supported"); |
220 throw new UnsupportedOperationException("'" + name + "' not supported"); |
|
221 if (!name.type().isInstance(value)) |
|
222 throw new IllegalArgumentException("Invalid value '" + value + "'"); |
221 |
223 |
222 synchronized (stateLock) { |
224 synchronized (stateLock) { |
223 ensureOpen(); |
225 ensureOpen(); |
224 |
226 |
225 if (name == StandardSocketOptions.IP_TOS) { |
227 if (name == StandardSocketOptions.IP_TOS) { |