-
Notifications
You must be signed in to change notification settings - Fork 791
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 and/or ignore spotbugs errors #1325
fix and/or ignore spotbugs errors #1325
Conversation
@@ -46,7 +46,7 @@ abstract class SmokeTest extends Specification { | |||
|
|||
private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper() | |||
|
|||
protected static OkHttpClient client = OkHttpUtils.client() | |||
protected static final OkHttpClient CLIENT = OkHttpUtils.client() |
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.
Can we instead ignore this rule? I think @trask will object, but why static final variable MUST be in uppercase?
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.
spotBugs actually doesn't complain about the uppercase, just the missing final
declaration. As for the uppercase, I believe it's a JLS convention for constants, but given the naming exception done for loggers, I don't see why it cannot be the same here - just possibly, have to look out for other static analysis checkers complaining about 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.
I don't think JLS has any naming conventions. Has 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.
https://docs.oracle.com/javase/specs/jls/se11/html/jls-6.html look for "Constant Names" section.
Emphasis, mine.
The names of constants in interface types should be, and final variables of class types may conventionally be, a sequence of one or more words, acronyms, or abbreviations, all uppercase
The capitalisation could have been a misrepresentation though, and the intent may have been to use them for primitives, but it somehow stuck for everything
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.
Can we instead ignore this rule? I think @trask will object, but why static final variable MUST be in uppercase?
I do not object 😂
static final variables should only be uppercase if they are constants, see https://google.github.io/styleguide/javaguide.html#s5.2.4-constant-names for "what is a constant"
Should be fixed: set attribute only if it is not null.
@mateuszrzeszutek please remind me, why do we need this class which largely duplicates superclass?
Main branch does not 86 lines in |
It doesn't really duplicate its superclass, it only extends those methods that it absolutely needs to. Though I agree that its name is somewhere between "uncreative" and "terrible", but I didn't have any better idea when I wrote it 😛 |
how about |
* GrpcHelper: methodName should not be set in the span if null * GrpcHelper: fix warnings instead of hiding by using Callable
|
003b520
to
bd9cf5d
Compare
I believe that |
Odd failures for |
jms is a known flaky test |
ah thanks, @iNikem , is there any way to manually kick the build again? |
I will wait, maybe #1327 will fix this |
CircleCI is flaky lately (maybe running out of money with all the free alternatives? :P) Sorry if it looks a little weird @imavroukakis but we may close/open PRs to retrigger the build :) |
...gent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/config/AgentConfigBuilder.java
Outdated
Show resolved
Hide resolved
Finally, I know how it happens but not why This works
This doesn't:
I don't quite know why the test chokes with the lambda, maybe this has to do something with how it's called from Groovy? |
That might be caused by the fact that |
Hmm, I don't understand your point, can you explain? The issue here is that, whilst the Groovy |
Wait, Groovy |
Beats me why CircleCI does not kick in... |
😄 it's just the |
@imavroukakis I am still looking into why it fails to kick in, but please run |
Guess we have to go full uppercase for this @iNikem after all. |
@imavroukakis I don't know if this is important, but you may want to fix this: |
Ah thanks, it seems to be picking up the wrong key in GH. |
circleCI exploded
|
And now it's run out of space.apparently.
|
Yea, I am trying to understand that disk space issue |
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 @imavroukakis 👍
I'll submit a separate PR to update the codenarc configuration to avoid having to use uppercase for (non-constant) static final fields (in groovy)
There are a couple of spotbugs complaints that I'd like some feedback on
API for
setAttribute
strongly advises againstnull
. If it's still ok to passnull
here we can add a spotbugs exclusion otherwise, is an empty string an acceptable value?I think this can be safely ignored
This is probably a false positive as it is used in
HttpClientTracer
, do you agree?