I really just did an extract method on this out of UniqueIdGenerator.  We
can change it if you want, but the getIpAddress() is a specific (not
InetAddress api call).  I left getLocalHost() passing through the
UnknownHostException so people could use that API if they want the
exception to come back. It is also a pretty rare thing to happen since they
would have to not have a network card or a non-working network card to get
that to work.


On Mon, Apr 21, 2014 at 7:38 AM, John DeRegnaucourt <
notifications@github.com> wrote:

> In src/main/java/com/cedarsoftware/util/InetAddressUtilities.java:
>
> > + *         See the License for the specific language governing permissions and
> > + *         limitations under the License.
> > + */
> > +public class InetAddressUtilities
> > +{
> > +    private static final Log LOG = LogFactory.getLog(InetAddressUtilities.class);
> > +
> > +    private InetAddressUtilities() {
> > +        super();
> > +    }
> > +
> > +    public static InetAddress getLocalHost() throws UnknownHostException {
> > +        return InetAddress.getLocalHost();
> > +    }
> > +
> > +    public static byte[] getIpAddress() {
>
> I don't believe this exception can be swallowed. I think the caller needs
> to know if the host IP was not obtained.
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/jdereg/java-util/pull/5/files#r11806379>
> .
>