Skip to content
This repository was archived by the owner on May 28, 2018. It is now read-only.
This repository was archived by the owner on May 28, 2018. It is now read-only.

InetAddresses.isUriInetAddress(String) from the emdeded guava lib could be optimized #3506

@glassfishrobot

Description

@glassfishrobot

JerseyUriBuilder.host(String) employs InetAddresses.isUriInetAddress(String) that is embedded in jersey (repackaged or moved to uri.internal). The problem with InetAddresses.isUriInetAddress is that:
1- The flow is controlled by throwing an IllegalArgumentException which may cause a performance hit if the stack is deep (fillinstacktrace).
2- The message is passed to the exception using String.format which is also an uncalled for performance hit.
The remedy is quite simple, either change the guava dependency from 18 to 20 (it was fixed in that version) or just change the isUriInetAddress and forUriString to control the flow in a better way rather than using exceptions

Affected Versions

[2.22.2, 2.25.1]

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions