Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Comparing String with Map in KafkaConnectApiImpl #3978

Closed
scholzj opened this issue Nov 19, 2020 · 0 comments · Fixed by #3987
Closed

[Bug] Comparing String with Map in KafkaConnectApiImpl #3978

scholzj opened this issue Nov 19, 2020 · 0 comments · Fixed by #3987
Labels

Comments

@scholzj
Copy link
Member

scholzj commented Nov 19, 2020

In the KafkaConnectApiImpl we seem to use equals() to compare String with Map<String, String>. That seems suspicious. We should investigate if that is correct and fix it if needed. The issue seems to be in this code segment (right now on lines 408-421):

        OrderedProperties ops = new OrderedProperties();
        ops.addStringPairs(desiredLogging);
        ops.asMap().entrySet().forEach(entry -> {
            // set desired loggers to desired levels
            if (entry.getKey().equals("log4j.rootLogger")) {
                if (!entry.getValue().equals(fetchedLoggers.get("root"))) {
                    updateLoggers.put("root", entry.getValue());
                }
            } else if (entry.getKey().startsWith("log4j.logger.")) {
                if (!entry.getValue().equals(fetchedLoggers.get(entry.getKey().substring("log4j.logger.".length())))) {
                    updateLoggers.put(entry.getKey().substring("log4j.logger.".length()), entry.getValue());
                }
            }
        });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant