[ 
https://issues.apache.org/jira/browse/SOLR-15054?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17250662#comment-17250662
 ] 

Timothy Potter edited comment on SOLR-15054 at 12/16/20, 10:00 PM:
-------------------------------------------------------------------

I think it was Mike's changes in this merge actually -> 
https://github.com/apache/lucene-solr/pull/2120/files#diff-838f63a8d7b764661b66c758c19cfe6f3d6454b328a1b5f52f75480530b0cfe7R428
  ... Unless I'm missing something there [~erickerickson], where did you see it 
was my changes for SOLR-12182? 

Regardless, I can fix it up no problem ... I don't think the test logic should 
require {{private}} methods to be {{final}}. In fact, my IDE actually marks 
that as unnecessary ;-) So I think the right fix here is to change the test as 
follows: 

{code}
diff --git 
a/solr/core/src/test/org/apache/solr/core/ConfigureRecoveryStrategyTest.java 
b/solr/core/src/test/org/apache/solr/core/ConfigureRecoveryStrategyTest.java
index 0a988f6e747..246ed981137 100644
--- a/solr/core/src/test/org/apache/solr/core/ConfigureRecoveryStrategyTest.java
+++ b/solr/core/src/test/org/apache/solr/core/ConfigureRecoveryStrategyTest.java
@@ -66,7 +66,7 @@ public class ConfigureRecoveryStrategyTest extends 
SolrTestCaseJ4 {
 
   public void testAlmostAllMethodsAreFinal() throws Exception {
     for (Method m : RecoveryStrategy.class.getDeclaredMethods()) {
-      if (Modifier.isStatic(m.getModifiers())) continue;
+      if (Modifier.isStatic(m.getModifiers()) || 
Modifier.isPrivate(m.getModifiers())) continue;
       final String methodName = m.getName();
       if ("getReplicateLeaderUrl".equals(methodName)) {
         assertFalse(m.toString(), Modifier.isFinal(m.getModifiers()));
{code}


was (Author: thelabdude):
I think it was Mike's changes in this merge actually ->  ... Unless I'm missing 
something there [~erickerickson]. Regardless, I don't think the test logic 
should require {{private}} methods to be {{final}}. In fact, my IDE actually 
marks that as unnecessary ;-) So I think the right fix here is to change the 
test as follows: 

{code}
diff --git 
a/solr/core/src/test/org/apache/solr/core/ConfigureRecoveryStrategyTest.java 
b/solr/core/src/test/org/apache/solr/core/ConfigureRecoveryStrategyTest.java
index 0a988f6e747..246ed981137 100644
--- a/solr/core/src/test/org/apache/solr/core/ConfigureRecoveryStrategyTest.java
+++ b/solr/core/src/test/org/apache/solr/core/ConfigureRecoveryStrategyTest.java
@@ -66,7 +66,7 @@ public class ConfigureRecoveryStrategyTest extends 
SolrTestCaseJ4 {
 
   public void testAlmostAllMethodsAreFinal() throws Exception {
     for (Method m : RecoveryStrategy.class.getDeclaredMethods()) {
-      if (Modifier.isStatic(m.getModifiers())) continue;
+      if (Modifier.isStatic(m.getModifiers()) || 
Modifier.isPrivate(m.getModifiers())) continue;
       final String methodName = m.getName();
       if ("getReplicateLeaderUrl".equals(methodName)) {
         assertFalse(m.toString(), Modifier.isFinal(m.getModifiers()));
{code}

> Reproducible test failure 
> ConfigureRecoveryStrategyTest.testAlmostAllMethodsAreFinal
> ------------------------------------------------------------------------------------
>
>                 Key: SOLR-15054
>                 URL: https://issues.apache.org/jira/browse/SOLR-15054
>             Project: Solr
>          Issue Type: Bug
>      Security Level: Public(Default Security Level. Issues are Public) 
>          Components: Tests
>    Affects Versions: master (9.0)
>            Reporter: Erick Erickson
>            Priority: Major
>         Attachments: Screen Shot 2020-12-16 at 2.59.57 PM.png
>
>
> Reproduce with:
> ./gradlew test --tests 
> ConfigureRecoveryStrategyTest.testAlmostAllMethodsAreFinal 
> -Dtests.seed=6E36F4B900CC2D0B -Dtests.multiplier=3 -Dtests.slow=true 
> -Dtests.locale=ccp -Dtests.timezone=ART -Dtests.asserts=true 
> -Dtests.file.encoding=UTF-8
> Git bisect identifies SOLR-12182 as the commit that introduced this, pinging 
> [~thelabdude]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to