You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by "ctubbsii (via GitHub)" <gi...@apache.org> on 2023/10/04 23:03:31 UTC
[PR] Bump spotbugs checks to rank 20 [accumulo-access]
ctubbsii opened a new pull request, #24:
URL: https://github.com/apache/accumulo-access/pull/24
Bump spotbugs aggressiveness to rank 20 and fix 2 new issues:
* Add missing serialVersionUID field for anonymous subclass of serializable class
* Make use of description field from test data to avoid spotbugs error about unused field (the alternative was to suppress it; I thought printing it was better, since the description is there for our convenience)
Also include trivial fixes from code review in #22:
* Simplified .equals to one line
* Use character class for matching on literal dot to avoid escape confusion with backslash
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Bump spotbugs checks to rank 20 [accumulo-access]
Posted by "ctubbsii (via GitHub)" <gi...@apache.org>.
ctubbsii merged PR #24:
URL: https://github.com/apache/accumulo-access/pull/24
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Bump spotbugs checks to rank 20 [accumulo-access]
Posted by "ctubbsii (via GitHub)" <gi...@apache.org>.
ctubbsii commented on code in PR #24:
URL: https://github.com/apache/accumulo-access/pull/24#discussion_r1346756008
##########
src/test/java/org/apache/accumulo/access/AccessExpressionBenchmark.java:
##########
@@ -117,8 +117,8 @@ List<String> getStringExpressions() {
return allTestExpressionsStr;
}
- public ArrayList<EvaluatorTests> getEvaluatorTests() {
- return evaluatorTests;
+ public List<EvaluatorTests> getEvaluatorTests() {
+ return List.copyOf(evaluatorTests);
Review Comment:
I switched to Collections.unmodifiableList instead. That avoids the copy, but keeps spotbugs happy because the encapsulated field is still only exposed in an immutable way.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Bump spotbugs checks to rank 20 [accumulo-access]
Posted by "keith-turner (via GitHub)" <gi...@apache.org>.
keith-turner commented on code in PR #24:
URL: https://github.com/apache/accumulo-access/pull/24#discussion_r1347695822
##########
src/test/java/org/apache/accumulo/access/AccessExpressionBenchmark.java:
##########
@@ -117,8 +117,8 @@ List<String> getStringExpressions() {
return allTestExpressionsStr;
}
- public ArrayList<EvaluatorTests> getEvaluatorTests() {
- return evaluatorTests;
+ public List<EvaluatorTests> getEvaluatorTests() {
+ return List.copyOf(evaluatorTests);
Review Comment:
I made another comment w/ a suggested code change about this, so resolving this comment.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Bump spotbugs checks to rank 20 [accumulo-access]
Posted by "keith-turner (via GitHub)" <gi...@apache.org>.
keith-turner commented on code in PR #24:
URL: https://github.com/apache/accumulo-access/pull/24#discussion_r1347695050
##########
src/test/java/org/apache/accumulo/access/AccessExpressionBenchmark.java:
##########
@@ -117,8 +118,8 @@ List<String> getStringExpressions() {
return allTestExpressionsStr;
}
- public ArrayList<EvaluatorTests> getEvaluatorTests() {
- return evaluatorTests;
+ public List<EvaluatorTests> getEvaluatorTests() {
+ return Collections.unmodifiableList(evaluatorTests);
}
Review Comment:
I experimented with this locally. I was curious why it complained about this method that returned a list and not others that returned a list. It was because the method was public, but it did not need to be public. So the following change avoids the spotbugs complaint w/o introducing any runtime overhead.
```suggestion
List<EvaluatorTests> getEvaluatorTests() {
return evaluatorTests;
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Bump spotbugs checks to rank 20 [accumulo-access]
Posted by "ctubbsii (via GitHub)" <gi...@apache.org>.
ctubbsii commented on code in PR #24:
URL: https://github.com/apache/accumulo-access/pull/24#discussion_r1347946006
##########
src/test/java/org/apache/accumulo/access/AccessExpressionBenchmark.java:
##########
@@ -117,8 +118,8 @@ List<String> getStringExpressions() {
return allTestExpressionsStr;
}
- public ArrayList<EvaluatorTests> getEvaluatorTests() {
- return evaluatorTests;
+ public List<EvaluatorTests> getEvaluatorTests() {
+ return Collections.unmodifiableList(evaluatorTests);
}
Review Comment:
Ah, okay. I didn't realize that it didn't need to be public. Thanks!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Bump spotbugs checks to rank 20 [accumulo-access]
Posted by "keith-turner (via GitHub)" <gi...@apache.org>.
keith-turner commented on code in PR #24:
URL: https://github.com/apache/accumulo-access/pull/24#discussion_r1346609283
##########
src/test/java/org/apache/accumulo/access/AccessExpressionBenchmark.java:
##########
@@ -117,8 +117,8 @@ List<String> getStringExpressions() {
return allTestExpressionsStr;
}
- public ArrayList<EvaluatorTests> getEvaluatorTests() {
- return evaluatorTests;
+ public List<EvaluatorTests> getEvaluatorTests() {
+ return List.copyOf(evaluatorTests);
Review Comment:
This copy will be done on each run of the benchmark that call this function, so it would be good to avoid it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org