JDK-8237471 : DatagramPacket::setPort is missing its @throws IllegalArgumentException
  • Type: Enhancement
  • Component: core-libs
  • Sub-Component: java.net
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • Submitted: 2020-01-17
  • Updated: 2020-01-23
  • Resolved: 2020-01-23
Related Reports
Duplicate :  
Relates :  
Description
DatagramPacket::setPort is missing its `@throws IllegalArgumentException` from its spec for an out-of-range port numbers. 

Subsquently, several methods within this class which call on this method also don't declare this behaviour in their spec e.g. DatagramPacket::setSocketAddress, and several of the DatagramPacket contructors. 
Comments
Tracked as part of the broader JDK-7021373.
23-01-2020