Is there a reason that ServletRequest.getRemoteAddr() returns the clients ip address as a string instead of as an int/long/IPSomethingInstance?
Or asked an other way: Is there any case where the value returned by getRemoteAddr() can’t be parsed as a numeric ip address?
Returning an ip address as a string, and then having the developer translate it to an ipV4/IpV6 address seems like a wrong design to me, unless there really is cases where the method returns something other then a string.
This method is there as a direct equivalent of the CGI variable
REMOTE_ADDR, so I would guess that’s the reason why it’s string. And for what’s the reason the CGI variable to be string – I don’t know.