You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am sure that all the content I provide is in English.
Search before asking
I had searched in the issues and found no similar issues.
Apache Dubbo Component
Java SDK (apache/dubbo)
Dubbo Version
Dubbo3.2.9 Dubbo3.3.2
Jdk17
Steps to reproduce this issue
When a custom subclass of RegistryConfig is created with a simple class name different from 'RegistryConfig', it leads to an unexpected behavior where an IllegalStateException is thrown, reporting 'Registry not found:' along with the associated ID. This behavior indicates a bug because all subclasses of RegistryConfig should be recognized regardless of their simple names.
code likes below:
public class CustomRegistryConfig extend RegistryConfig{
//customize code
}
What you expected to happen
When processing CustomRegistryConfig, it should be treated as an instance of the RegistryConfig class type rather than being handled specifically as the CustomRegistryConfig class. This ensures consistency with the expected type handling in the system.
Anything else
The error in the AbstractConfigManager class's addConfig method stems from its logic, which currently relies on the simple name of the provided config class. However, the correct approach should involve using the simple name of the parent class that is listed in the supportedConfigTypes. This ensures consistency and proper type handling within the configuration management system.
Are you willing to submit a pull request to fix on your own?
Yes I am willing to submit a pull request on my own!
youjie23
changed the title
[Bug] When processing CustomRegistryConfig, it should be treated as an instance of the RegistryConfig class type rather than being handled specifically as the CustomRegistryConfig class
[Bug] An instance of the subclass of RegistryConfig should be added to configsCache as the RegistryConfig class type
Dec 24, 2024
youjie23
pushed a commit
to youjie23/dubbo
that referenced
this issue
Dec 24, 2024
Pre-check
Search before asking
Apache Dubbo Component
Java SDK (apache/dubbo)
Dubbo Version
Dubbo3.2.9 Dubbo3.3.2
Jdk17
Steps to reproduce this issue
When a custom subclass of
RegistryConfig
is created with a simple class name different from 'RegistryConfig', it leads to an unexpected behavior where anIllegalStateException
is thrown, reporting 'Registry not found:' along with the associated ID. This behavior indicates a bug because all subclasses ofRegistryConfig
should be recognized regardless of their simple names.code likes below:
What you expected to happen
When processing
CustomRegistryConfig
, it should be treated as an instance of theRegistryConfig
class type rather than being handled specifically as theCustomRegistryConfig
class. This ensures consistency with the expected type handling in the system.Anything else
The error in the
AbstractConfigManager
class'saddConfig
method stems from its logic, which currently relies on the simple name of the provided config class. However, the correct approach should involve using the simple name of the parent class that is listed in thesupportedConfigTypes
. This ensures consistency and proper type handling within the configuration management system.Are you willing to submit a pull request to fix on your own?
Code of Conduct
The text was updated successfully, but these errors were encountered: