[CONJ-813] setConfiguration not being called on classes that extend ConfigurableSocketFactory Created: 2020-08-06  Updated: 2020-09-23  Resolved: 2020-08-17

Status: Closed
Project: MariaDB Connector/J
Component/s: configuration
Affects Version/s: None
Fix Version/s: 2.7.0

Type: Bug Priority: Major
Reporter: Shahmir Noorani Assignee: Diego Dupin
Resolution: Fixed Votes: 0
Labels: None


 Description   

In my project, I have a class that extends ConfigurableSocketFactory, but the setConfiguration method is never called. I added a breakpoint to if (socketFactoryClass.isInstance(ConfigurableSocketFactory.class)) {, and the expression was evaluating to false.

From my googling, I landed at https://stackoverflow.com/questions/31083699/java-class-isinstance-always-returns-false, which indicated that the evaluation was being done backwards.

When I evaluated ConfigurableSocketFactory.class.isInstance(socketFactory), the result was true



 Comments   
Comment by Shahmir Noorani [ 2020-08-06 ]

I've created a PR that fixes this issue:

https://github.com/mariadb-corporation/mariadb-connector-j/pull/157

Could y'all please take a look and merge it? Thanks!

Comment by Diego Dupin [ 2020-08-17 ]

thanks for the report and good fix.
This is now merged in develop branch.
This will be released in 2.6.3 version

Generated at Thu Feb 08 03:18:30 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.