oracle/oci-java-sdk

Jersey3HttpClientBuilder.java from this OCI SDK library. oci-java-sdk-common-httpclient-jersey3-3.8.0.jar is not using the right constructor

Rashi0321 opened this issue · 1 comments

Error : java.lang.IllegalArgumentException: java.net.URISyntaxException: Relative path in absolute URI: http://hgbu-opera.cne-outbound-proxy.cfs.oraclecne3128/
at com.oracle.bmc.http.client.jersey3.Jersey3HttpClientBuilder.property(Jersey3HttpClientBuilder.java:176) ~[oci-java-sdk-common-httpclient-jersey3-3.8.0.jar:?]
at hgbu.opera.cn.publisher.producer.StreamProducer.lambda$initClients$0(StreamProducer.java:101) ~[hgbu-opera-publisher.jar:?]

Analysis :

OCI SDK code in that class com.oracle.bmc.http.client.jersey3.Jersey3HttpClientBuilder looks buggy (URI constructor usage doesn’t seem correct):
try {
this.properties.put("jersey.config.client.proxy.uri", new URI(scheme, address.getHostString(), Integer.toString(address.getPort()), (String)null));
} catch (URISyntaxException var7) {
throw new IllegalArgumentException(var7);
}
But there is another class for the same interface: com.oracle.bmc.http.client.jersey.JerseyHttpClientBuilder and its code looks good:
try {
this.properties.put("jersey.config.client.proxy.uri", new URI(scheme, (String)null, address.getHostString(), address.getPort(), (String)null, (String)null, (String)null));
} catch (URISyntaxException var7) {
throw new IllegalArgumentException(var7);
}