]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-15487 change quickfix type to be false by default (Solving issue with Oracle)
authorPierre <pierre.guillot@sonarsource.com>
Mon, 18 Oct 2021 14:42:53 +0000 (16:42 +0200)
committersonartech <sonartech@sonarsource.com>
Tue, 19 Oct 2021 20:03:22 +0000 (20:03 +0000)
server/sonar-db-dao/src/main/java/org/sonar/db/issue/IssueDto.java
server/sonar-db-dao/src/test/java/org/sonar/db/issue/IssueDaoTest.java

index 80a8bc524d22bfc14c6b396973a69d83934eff74..f1bc641966572294b694c4440d2fda6308550f6f 100644 (file)
@@ -76,7 +76,7 @@ public final class IssueDto implements Serializable {
   private byte[] locations;
   private long createdAt;
   private long updatedAt;
-  private Boolean quickFixAvailable;
+  private boolean quickFixAvailable;
 
   // functional dates stored as Long
   private Long issueCreationDate;
@@ -693,12 +693,11 @@ public final class IssueDto implements Serializable {
     return this;
   }
 
-  @CheckForNull
-  public Boolean isQuickFixAvailable() {
+  public boolean isQuickFixAvailable() {
     return quickFixAvailable;
   }
 
-  public IssueDto setQuickFixAvailable(@Nullable Boolean quickFixAvailable) {
+  public IssueDto setQuickFixAvailable(boolean quickFixAvailable) {
     this.quickFixAvailable = quickFixAvailable;
     return this;
   }
@@ -758,7 +757,7 @@ public final class IssueDto implements Serializable {
     issue.setSelectedAt(selectedAt);
     issue.setLocations(parseLocations());
     issue.setIsFromExternalRuleEngine(isExternal);
-    issue.setQuickFixAvailable(quickFixAvailable != null && quickFixAvailable);
+    issue.setQuickFixAvailable(quickFixAvailable);
     return issue;
   }
 }
index d0a921dbb1ea39a967968d88be4e52c2a6d2e745..0ee427cdeca9d1e780c1ce25983027147d205eac 100644 (file)
@@ -46,6 +46,7 @@ import static java.util.Arrays.asList;
 import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
 import static org.apache.commons.lang.math.RandomUtils.nextInt;
 import static org.assertj.core.api.Assertions.assertThat;
+import static org.junit.Assert.assertFalse;
 import static org.junit.rules.ExpectedException.none;
 import static org.sonar.db.component.ComponentTesting.newDirectory;
 import static org.sonar.db.component.ComponentTesting.newFileDto;
@@ -107,7 +108,7 @@ public class IssueDaoTest {
     assertThat(issue.getLocations()).isNull();
     assertThat(issue.parseLocations()).isNull();
     assertThat(issue.isExternal()).isTrue();
-    assertThat(issue.isQuickFixAvailable()).isNull();
+    assertFalse(issue.isQuickFixAvailable());
   }
 
   @Test
@@ -467,7 +468,6 @@ public class IssueDaoTest {
     dto.setIssueCreationTime(1_450_000_000_000L);
     dto.setIssueUpdateTime(1_450_000_000_000L);
     dto.setIssueCloseTime(1_450_000_000_000L);
-    dto.setQuickFixAvailable(null);
     return dto;
   }