I run into this problem but not with the String mentioned in the description. Instead, with "%AD".
String test = UriBuilder.fromPath("https://dummy.com").queryParam("param", "%AD").build().toURL().toString();
The encoded String is https://dummy.com?param=%AD
The expected URI should be https://dummy.com?param=%25AD
The method queryParam(...) only behaves like this when the two characters following the "%" are hexadecimal. I.e, the method "com.sun.jersey.api.uri.UriComponent.isHexCharacter(char)" returns true for the characters following the "%".
I am afraid the behavior of UriBuilderImpl is correct because it tries to guess when a parameter is already encoded.
I am not sure if its ok to comment in a closed issue. Sorry if it is not.
Should I create a new issue or ask in the Jersey's mailing list first?