Return-Path: X-Original-To: apmail-hbase-commits-archive@www.apache.org Delivered-To: apmail-hbase-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E6AED17ECD for ; Mon, 11 May 2015 06:29:43 +0000 (UTC) Received: (qmail 43310 invoked by uid 500); 11 May 2015 06:29:43 -0000 Delivered-To: apmail-hbase-commits-archive@hbase.apache.org Received: (qmail 43263 invoked by uid 500); 11 May 2015 06:29:43 -0000 Mailing-List: contact commits-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hbase.apache.org Delivered-To: mailing list commits@hbase.apache.org Received: (qmail 43254 invoked by uid 99); 11 May 2015 06:29:43 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 11 May 2015 06:29:43 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 909F4DFA6D; Mon, 11 May 2015 06:29:43 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: busbey@apache.org To: commits@hbase.apache.org Message-Id: <00cbbc287769460ca26af4154aa24219@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: hbase git commit: HBASE-13611 update clover profile to work with clover 4.x and maven 3. Date: Mon, 11 May 2015 06:29:43 +0000 (UTC) Repository: hbase Updated Branches: refs/heads/branch-1 8673a7df9 -> 6213fa2fc HBASE-13611 update clover profile to work with clover 4.x and maven 3. * change pom to use a maven 3 compat version of clover * add clover to javadoc plugin deps so that instrumented doclet works * modify IA annotation test to filter out clover instrumentation * make splitlog counters check for atomiclong before casting Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/6213fa2f Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/6213fa2f Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/6213fa2f Branch: refs/heads/branch-1 Commit: 6213fa2fce452dace06c0ec0396cb5fe420afe4d Parents: 8673a7d Author: Sean Busbey Authored: Fri May 1 23:53:13 2015 -0500 Committer: Sean Busbey Committed: Mon May 11 01:23:35 2015 -0500 ---------------------------------------------------------------------- .../hbase/TestInterfaceAudienceAnnotations.java | 27 +++++++++++++++++++- .../apache/hadoop/hbase/SplitLogCounters.java | 5 +++- pom.xml | 22 ++++++++++++---- 3 files changed, 47 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hbase/blob/6213fa2f/hbase-client/src/test/java/org/apache/hadoop/hbase/TestInterfaceAudienceAnnotations.java ---------------------------------------------------------------------- diff --git a/hbase-client/src/test/java/org/apache/hadoop/hbase/TestInterfaceAudienceAnnotations.java b/hbase-client/src/test/java/org/apache/hadoop/hbase/TestInterfaceAudienceAnnotations.java index ace11ec..be79278 100644 --- a/hbase-client/src/test/java/org/apache/hadoop/hbase/TestInterfaceAudienceAnnotations.java +++ b/hbase-client/src/test/java/org/apache/hadoop/hbase/TestInterfaceAudienceAnnotations.java @@ -199,6 +199,29 @@ public class TestInterfaceAudienceAnnotations { } /** + * Selects classes that appear to be source instrumentation from Clover. + * Clover generates instrumented code in order to calculate coverage. Part of the + * generated source is a static inner class on each source class. + * + * - has an enclosing class + * - enclosing class is not an interface + * - name starts with "__CLR" + */ + class CloverInstrumentationFilter implements ClassFinder.ClassFilter { + @Override + public boolean isCandidateClass(Class clazz) { + boolean clover = false; + final Class enclosing = clazz.getEnclosingClass(); + if (enclosing != null) { + if (!(enclosing.isInterface())) { + clover = clazz.getSimpleName().startsWith("__CLR"); + } + } + return clover; + } + } + + /** * Checks whether all the classes in client and common modules contain * {@link InterfaceAudience} annotations. */ @@ -212,6 +235,7 @@ public class TestInterfaceAudienceAnnotations { // NOT test classes // AND NOT generated classes // AND are NOT annotated with InterfaceAudience + // AND are NOT from Clover rewriting sources ClassFinder classFinder = new ClassFinder( new MainCodeResourcePathFilter(), new Not((FileNameFilter)new TestFileNameFilter()), @@ -219,7 +243,8 @@ public class TestInterfaceAudienceAnnotations { new Not(new TestClassFilter()), new Not(new GeneratedClassFilter()), new Not(new IsInterfaceStabilityClassFilter()), - new Not(new InterfaceAudienceAnnotatedClassFilter())) + new Not(new InterfaceAudienceAnnotatedClassFilter()), + new Not(new CloverInstrumentationFilter())) ); Set> classes = classFinder.findClasses(false); http://git-wip-us.apache.org/repos/asf/hbase/blob/6213fa2f/hbase-server/src/main/java/org/apache/hadoop/hbase/SplitLogCounters.java ---------------------------------------------------------------------- diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/SplitLogCounters.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/SplitLogCounters.java index 6af5045..bde1b88 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/SplitLogCounters.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/SplitLogCounters.java @@ -88,7 +88,10 @@ public class SplitLogCounters { public static void resetCounters() throws Exception { Class cl = SplitLogCounters.class; for (Field fld : cl.getDeclaredFields()) { - if (!fld.isSynthetic()) ((AtomicLong)fld.get(null)).set(0); + /* Guard against source instrumentation. */ + if ((!fld.isSynthetic()) && (AtomicLong.class.isAssignableFrom(fld.getType()))) { + ((AtomicLong)fld.get(null)).set(0); + } } } } http://git-wip-us.apache.org/repos/asf/hbase/blob/6213fa2f/pom.xml ---------------------------------------------------------------------- diff --git a/pom.xml b/pom.xml index be83ca6..3e91394 100644 --- a/pom.xml +++ b/pom.xml @@ -1096,7 +1096,7 @@ 3.4.6 1.7.7 0.0.1-SNAPSHOT - 2.6.3 + 4.0.3 2.3.1 1.3.3 4.0.23.Final @@ -2233,9 +2233,8 @@ + The report will be generated under target/site/clover/index.html when you run + MAVEN_OPTS="-Xmx2048m -XX:MaxPermSize=512m" mvn clean package -Pclover site --> clover @@ -2246,10 +2245,23 @@ ${user.home}/.clover.license - 2.6.3 + + + org.apache.maven.plugins + maven-javadoc-plugin + + + com.atlassian.maven.plugins + maven-clover2-plugin + ${clover.version} + + + com.atlassian.maven.plugins maven-clover2-plugin