You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by GitBox <gi...@apache.org> on 2018/05/09 14:49:29 UTC

[GitHub] jmark99 closed pull request #476: ACCUMULO-2537 Add @Override Annotations

jmark99 closed pull request #476: ACCUMULO-2537 Add @Override Annotations
URL: https://github.com/apache/accumulo/pull/476
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/core/src/main/java/org/apache/accumulo/core/client/impl/TableOperationsHelper.java b/core/src/main/java/org/apache/accumulo/core/client/impl/TableOperationsHelper.java
index 755cb095b2..7e107ef70a 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/impl/TableOperationsHelper.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/impl/TableOperationsHelper.java
@@ -175,6 +175,7 @@ public void checkIteratorConflicts(String tableName, IteratorSetting setting,
     checkIteratorConflicts(iteratorProps, setting, scopes);
   }
 
+  @Override
   public int addConstraint(String tableName, String constraintClassName)
       throws AccumuloException, AccumuloSecurityException, TableNotFoundException {
     TreeSet<Integer> constraintNumbers = new TreeSet<>();
diff --git a/core/src/main/java/org/apache/accumulo/core/iterators/user/SeekingFilter.java b/core/src/main/java/org/apache/accumulo/core/iterators/user/SeekingFilter.java
index 79ee0ba37a..b3ef9bc120 100644
--- a/core/src/main/java/org/apache/accumulo/core/iterators/user/SeekingFilter.java
+++ b/core/src/main/java/org/apache/accumulo/core/iterators/user/SeekingFilter.java
@@ -77,6 +77,7 @@ public static FilterResult of(boolean accept, AdvanceResult advance) {
       return accept ? PASSES.get(advance) : FAILS.get(advance);
     }
 
+    @Override
     public String toString() {
       return "Acc: " + accept + " Adv: " + advance;
     }
diff --git a/core/src/main/java/org/apache/accumulo/core/summary/Gatherer.java b/core/src/main/java/org/apache/accumulo/core/summary/Gatherer.java
index 8163cd16b9..9d99078967 100644
--- a/core/src/main/java/org/apache/accumulo/core/summary/Gatherer.java
+++ b/core/src/main/java/org/apache/accumulo/core/summary/Gatherer.java
@@ -656,6 +656,7 @@ public Text getEndRow() {
       return endRow;
     }
 
+    @Override
     public String toString() {
       return startRow + " " + endRow;
     }
diff --git a/iterator-test-harness/src/main/java/org/apache/accumulo/iteratortest/testcases/InstantiationTestCase.java b/iterator-test-harness/src/main/java/org/apache/accumulo/iteratortest/testcases/InstantiationTestCase.java
index 65f93e2e2f..a36650c827 100644
--- a/iterator-test-harness/src/main/java/org/apache/accumulo/iteratortest/testcases/InstantiationTestCase.java
+++ b/iterator-test-harness/src/main/java/org/apache/accumulo/iteratortest/testcases/InstantiationTestCase.java
@@ -43,6 +43,7 @@ public IteratorTestOutput test(IteratorTestInput testInput) {
     return new IteratorTestOutput(TestOutcome.PASSED);
   }
 
+  @Override
   public boolean verify(IteratorTestOutput expected, IteratorTestOutput actual) {
     // Ignore what the user provided as expected output, just check that we instantiated the
     // iterator successfully.
diff --git a/iterator-test-harness/src/main/java/org/apache/accumulo/iteratortest/testcases/OutputVerifyingTestCase.java b/iterator-test-harness/src/main/java/org/apache/accumulo/iteratortest/testcases/OutputVerifyingTestCase.java
index f5e966b04c..84ba2be48b 100644
--- a/iterator-test-harness/src/main/java/org/apache/accumulo/iteratortest/testcases/OutputVerifyingTestCase.java
+++ b/iterator-test-harness/src/main/java/org/apache/accumulo/iteratortest/testcases/OutputVerifyingTestCase.java
@@ -24,6 +24,7 @@
  */
 public abstract class OutputVerifyingTestCase implements IteratorTestCase {
 
+  @Override
   public boolean verify(IteratorTestOutput expected, IteratorTestOutput actual) {
     return expected.equals(actual);
   }
diff --git a/pom.xml b/pom.xml
index a76a375ebb..7f545e68f1 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1776,6 +1776,40 @@
         <findbugs.excludeFilterFile>src/main/findbugs/exclude-filter.xml</findbugs.excludeFilterFile>
       </properties>
     </profile>
+    <profile>
+      <!-- This profile uses the google errorprone compiler to enforce use of the Override
+      annotation where needed. Auto-generated code is not checked. -->
+      <id>use-errorprone</id>
+      <build>
+        <plugins>
+          <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-compiler-plugin</artifactId>
+            <configuration>
+              <compilerId>javac-with-errorprone</compilerId>
+              <forceJavacCompilerUse>true</forceJavacCompilerUse>
+              <compilerArgs>
+                <arg>-XepDisableAllChecks</arg>
+                <arg>-Xep:MissingOverride:ERROR</arg>
+                <arg>-XepExcludedPaths:.*/(proto|thrift|generated-sources)/.*</arg>
+              </compilerArgs>
+            </configuration>
+            <dependencies>
+              <dependency>
+                <groupId>com.google.errorprone</groupId>
+                <artifactId>error_prone_core</artifactId>
+                <version>2.3.1</version>
+              </dependency>
+              <dependency>
+                <groupId>org.codehaus.plexus</groupId>
+                <artifactId>plexus-compiler-javac-errorprone</artifactId>
+                <version>2.8</version>
+              </dependency>
+            </dependencies>
+          </plugin>
+        </plugins>
+      </build>
+    </profile>
     <!-- Active by default, build against Hadoop 2 -->
     <profile>
       <id>hadoop-default</id>
diff --git a/test/src/main/java/org/apache/accumulo/test/GenerateSequentialRFile.java b/test/src/main/java/org/apache/accumulo/test/GenerateSequentialRFile.java
index 416f3c26a5..8c90ae3fc2 100644
--- a/test/src/main/java/org/apache/accumulo/test/GenerateSequentialRFile.java
+++ b/test/src/main/java/org/apache/accumulo/test/GenerateSequentialRFile.java
@@ -53,6 +53,7 @@ public GenerateSequentialRFile(Opts opts) {
     long valuesPerRow = 42000;
   }
 
+  @Override
   public void run() {
     try {
       final Configuration conf = new Configuration();
diff --git a/test/src/main/java/org/apache/accumulo/test/functional/ConcurrentDeleteTableIT.java b/test/src/main/java/org/apache/accumulo/test/functional/ConcurrentDeleteTableIT.java
index aa43b50052..8c7c7f18db 100644
--- a/test/src/main/java/org/apache/accumulo/test/functional/ConcurrentDeleteTableIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/functional/ConcurrentDeleteTableIT.java
@@ -125,6 +125,7 @@ public void run() {
       this.cdl = cdl;
     }
 
+    @Override
     public void run() {
       try {
         cdl.countDown();
diff --git a/test/src/main/java/org/apache/accumulo/test/functional/SessionBlockVerifyIT.java b/test/src/main/java/org/apache/accumulo/test/functional/SessionBlockVerifyIT.java
index 9fa939783c..5f34ac9a3b 100644
--- a/test/src/main/java/org/apache/accumulo/test/functional/SessionBlockVerifyIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/functional/SessionBlockVerifyIT.java
@@ -80,6 +80,7 @@ protected String getMaxIdleTimeString() {
   ExecutorService service = Executors.newFixedThreadPool(10);
 
   @Test
+  @Override
   public void run() throws Exception {
     Connector c = getConnector();
     String tableName = getUniqueNames(1)[0];
diff --git a/test/src/main/java/org/apache/accumulo/test/functional/SummaryIT.java b/test/src/main/java/org/apache/accumulo/test/functional/SummaryIT.java
index 66d3689da8..fdfa97530b 100644
--- a/test/src/main/java/org/apache/accumulo/test/functional/SummaryIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/functional/SummaryIT.java
@@ -446,6 +446,7 @@ public boolean shouldCompact(MajorCompactionRequest request) throws IOException
       return true;
     }
 
+    @Override
     public void gatherInformation(MajorCompactionRequest request) throws IOException {
       List<Summary> summaries = request.getSummaries(request.getFiles().keySet(),
           conf -> conf.getClassName().contains("FooCounter"));


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services