-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Fix conditions that always evaluate to false #5188
Conversation
} | ||
} finally { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@aloubyansky I need you to take a look at this one (hide whitespace changes for a much smaller diff). Right now, removing this code doesn't change the plugin behaviour, but I'm pretty sure that's not the way we'd want to fix this class.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it's not about just fixing this class, it's about fixing the tools. I think it's ok to merge it. The buildFile
is closed in AddExtensions.
@@ -46,10 +46,10 @@ public void handle(RoutingContext event) { | |||
String stack = ""; | |||
Throwable exception = event.failure(); | |||
if (showStack && exception != null) { | |||
details = generateHeaderMessage(exception, uuid == null ? null : uuid.toString()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See line 44: String uuid = BASE_ID + ERROR_COUNT.incrementAndGet();
@@ -256,8 +256,6 @@ public Object invoke(Object proxy, Method method, Object[] args) throws Throwabl | |||
return null; | |||
} | |||
ProxyInstance instance = getProxyInstance(returnType); | |||
if (instance == null) | |||
return null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getProxyInstance(returnType);
never returns null
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sold on this one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unless I'm missing something, the only value that can be returned from getProxyInstance(returnType);
comes from https://github.com/quarkusio/quarkus/blob/master/core/deployment/src/main/java/io/quarkus/deployment/recording/BytecodeRecorderImpl.java#L312-L313
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not about missing something. It's just that doesn't cost anything to have it there so I would keep it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's back with curly braces in bonus!
} catch (IOException e) { | ||
throw new MojoExecutionException("Unable to update the pom.xml file", e); | ||
throw new MojoExecutionException("Failed initialize project configuration tools", e); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
throw new MojoExecutionException("Failed initialize project configuration tools", e); | |
throw new MojoExecutionException("Failed to initialize the project's build descriptor", e); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed, thanks for the suggestion!
74ed236
to
aa0680a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a few comments.
@@ -39,7 +39,7 @@ public String test() { | |||
return "someSecret=" + someSecret + "; expected: " + expectedPassword; | |||
} | |||
String password = ConfigProviderResolver.instance().getConfig().getValue("password", String.class); | |||
if (!expectedPassword.equals(someSecret)) { | |||
if (!password.equals(someSecret)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one makes sense but @vsevel could you have a look?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the second case should be between password
and expectedPassword
(not between password
and someSecret
) - although checking password
against someSecret
was already fixing the issue because we checked just before that someSecret
is equal to expectedPassword
password
and someSecret
are calculated, expectedPassword
is the reference (could be a constant)
so something like this is more appropriate:
String password = ConfigProviderResolver.instance().getConfig().getValue("password", String.class);
if (!expectedPassword.equals(password)) {
return "password=" + password + "; expected: " + expectedPassword;
}
thanks for catching that one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @vsevel! I changed the code according to your suggestion.
stack = generateStackTrace(exception); | ||
|
||
} else if (uuid != null) { | ||
} else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK for these two.
@@ -256,8 +256,6 @@ public Object invoke(Object proxy, Method method, Object[] args) throws Throwabl | |||
return null; | |||
} | |||
ProxyInstance instance = getProxyInstance(returnType); | |||
if (instance == null) | |||
return null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sold on this one.
aa0680a
to
90f0001
Compare
@gsmet It should be all good now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Thanks! |
No description provided.