commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brit...@apache.org
Subject [lang] Remove annotations for documenting concurrency behavior.
Date Wed, 17 May 2017 14:22:59 GMT
Repository: commons-lang
Updated Branches:
  refs/heads/master 5a87fa172 -> 796b051f2


Remove annotations for documenting concurrency behavior.

As discussed on the ML, we need more time to figure out the design of
this annotations. So I'm removing them in order to get the next release
out of the door.


Project: http://git-wip-us.apache.org/repos/asf/commons-lang/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-lang/commit/796b051f
Tree: http://git-wip-us.apache.org/repos/asf/commons-lang/tree/796b051f
Diff: http://git-wip-us.apache.org/repos/asf/commons-lang/diff/796b051f

Branch: refs/heads/master
Commit: 796b051f28ca96f1dbbd5dfe4b5cae5579d0d14e
Parents: 5a87fa1
Author: Benedikt Ritter <britter@apache.org>
Authored: Wed May 17 10:21:41 2017 -0400
Committer: Benedikt Ritter <britter@apache.org>
Committed: Wed May 17 10:21:41 2017 -0400

----------------------------------------------------------------------
 .../lang3/concurrent/annotation/Contract.java   | 50 ---------------
 .../lang3/concurrent/annotation/GuardedBy.java  | 39 ------------
 .../lang3/concurrent/annotation/Immutable.java  | 33 ----------
 .../concurrent/annotation/NotThreadSafe.java    | 35 -----------
 .../lang3/concurrent/annotation/ThreadSafe.java | 35 -----------
 .../annotation/ThreadingBehavior.java           | 66 --------------------
 .../concurrent/annotation/package-info.java     | 22 -------
 .../annotation/AnnotationTestUtils.java         | 50 ---------------
 .../concurrent/annotation/ContractTest.java     | 38 -----------
 .../annotation/ContractTestFixture.java         | 25 --------
 .../concurrent/annotation/GuardedByTest.java    | 65 -------------------
 .../annotation/GuardedByTestFixture.java        | 32 ----------
 .../concurrent/annotation/ImmutableTest.java    | 38 -----------
 .../annotation/ImmutableTestFixture.java        | 25 --------
 .../annotation/NotThreadSafeTest.java           | 39 ------------
 .../annotation/NotThreadSafeTestFixture.java    | 25 --------
 .../concurrent/annotation/ThreadSafeTest.java   | 39 ------------
 .../annotation/ThreadSafeTestFixture.java       | 25 --------
 18 files changed, 681 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-lang/blob/796b051f/src/main/java/org/apache/commons/lang3/concurrent/annotation/Contract.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/lang3/concurrent/annotation/Contract.java b/src/main/java/org/apache/commons/lang3/concurrent/annotation/Contract.java
deleted file mode 100644
index e34bb95..0000000
--- a/src/main/java/org/apache/commons/lang3/concurrent/annotation/Contract.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * ====================================================================
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- */
-package org.apache.commons.lang3.concurrent.annotation;
-
-import java.lang.annotation.Documented;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * This annotation defines behavioral contract enforced at runtime by instances of annotated
classes.
- */
-@Documented
-@Target(ElementType.TYPE)
-@Retention(RetentionPolicy.CLASS)
-public @interface Contract {
-
-    /**
-     * Defines behavioral contract enforced at runtime by instances of annotated classes.
-     * 
-     * @return The behavioral contract enforced at runtime by instances of annotated classes.
-     */
-    ThreadingBehavior threading() default ThreadingBehavior.UNSAFE;
-
-}

http://git-wip-us.apache.org/repos/asf/commons-lang/blob/796b051f/src/main/java/org/apache/commons/lang3/concurrent/annotation/GuardedBy.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/lang3/concurrent/annotation/GuardedBy.java b/src/main/java/org/apache/commons/lang3/concurrent/annotation/GuardedBy.java
deleted file mode 100644
index abd2416..0000000
--- a/src/main/java/org/apache/commons/lang3/concurrent/annotation/GuardedBy.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.commons.lang3.concurrent.annotation;
-
-import java.lang.annotation.Documented;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * Describes the lock which guards a field or method.
- */
-@Documented
-@Target({ ElementType.FIELD, ElementType.METHOD })
-@Retention(RetentionPolicy.CLASS)
-public @interface GuardedBy {
-
-    /**
-     * Gets the lock which guards a field or method.
-     * 
-     * @return the lock which guards a field or method.
-     */
-    String value();
-}

http://git-wip-us.apache.org/repos/asf/commons-lang/blob/796b051f/src/main/java/org/apache/commons/lang3/concurrent/annotation/Immutable.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/lang3/concurrent/annotation/Immutable.java b/src/main/java/org/apache/commons/lang3/concurrent/annotation/Immutable.java
deleted file mode 100644
index 0de343c..0000000
--- a/src/main/java/org/apache/commons/lang3/concurrent/annotation/Immutable.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.commons.lang3.concurrent.annotation;
-
-import java.lang.annotation.Documented;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * Describes a type as immutable.
- */
-@Documented
-@Target(ElementType.TYPE)
-@Retention(RetentionPolicy.CLASS)
-public @interface Immutable {
-    // marker annotation, empty body
-}

http://git-wip-us.apache.org/repos/asf/commons-lang/blob/796b051f/src/main/java/org/apache/commons/lang3/concurrent/annotation/NotThreadSafe.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/lang3/concurrent/annotation/NotThreadSafe.java
b/src/main/java/org/apache/commons/lang3/concurrent/annotation/NotThreadSafe.java
deleted file mode 100644
index 78b2b03..0000000
--- a/src/main/java/org/apache/commons/lang3/concurrent/annotation/NotThreadSafe.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.commons.lang3.concurrent.annotation;
-
-import java.lang.annotation.Documented;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * Describes this type as not thread-safe.
- * 
- * @see ThreadSafe
- */
-@Documented
-@Target(ElementType.TYPE)
-@Retention(RetentionPolicy.CLASS)
-public @interface NotThreadSafe {
-    // marker annotation, empty body
-}

http://git-wip-us.apache.org/repos/asf/commons-lang/blob/796b051f/src/main/java/org/apache/commons/lang3/concurrent/annotation/ThreadSafe.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/lang3/concurrent/annotation/ThreadSafe.java
b/src/main/java/org/apache/commons/lang3/concurrent/annotation/ThreadSafe.java
deleted file mode 100644
index cef8c64..0000000
--- a/src/main/java/org/apache/commons/lang3/concurrent/annotation/ThreadSafe.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.commons.lang3.concurrent.annotation;
-
-import java.lang.annotation.Documented;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * Describes this type as thread-safe.
- * 
- * @see NotThreadSafe
- */
-@Documented
-@Target(ElementType.TYPE)
-@Retention(RetentionPolicy.CLASS)
-public @interface ThreadSafe {
-    // marker annotation, empty body
-}

http://git-wip-us.apache.org/repos/asf/commons-lang/blob/796b051f/src/main/java/org/apache/commons/lang3/concurrent/annotation/ThreadingBehavior.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/lang3/concurrent/annotation/ThreadingBehavior.java
b/src/main/java/org/apache/commons/lang3/concurrent/annotation/ThreadingBehavior.java
deleted file mode 100644
index e03b164..0000000
--- a/src/main/java/org/apache/commons/lang3/concurrent/annotation/ThreadingBehavior.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * ====================================================================
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- */
-package org.apache.commons.lang3.concurrent.annotation;
-
-/**
- * Defines types of threading behavior enforced at runtime.
- */
-public enum ThreadingBehavior {
-
-    /**
-     * Instances of classes with the given contract are expected to be fully immutable and
thread-safe.
-     */
-    IMMUTABLE,
-
-    /**
-     * Instances of classes with the given contract are expected to be immutable if their
dependencies injected at
-     * construction time are immutable and are expected to be thread-safe if their dependencies
are thread-safe.
-     */
-    IMMUTABLE_CONDITIONAL,
-
-    /**
-     * Instances of classes with the given contract are expected to maintain no state and
to be thread-safe.
-     */
-    STATELESS,
-
-    /**
-     * Instances of classes with the given contract are expected to be fully thread-safe.
-     */
-    SAFE,
-
-    /**
-     * Instances of classes with the given contract are expected to be thread-safe if their
dependencies injected at
-     * construction time are thread-safe.
-     */
-    SAFE_CONDITIONAL,
-
-    /**
-     * Instances of classes with the given contract are expected to be non thread-safe.
-     */
-    UNSAFE
-
-}

http://git-wip-us.apache.org/repos/asf/commons-lang/blob/796b051f/src/main/java/org/apache/commons/lang3/concurrent/annotation/package-info.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/lang3/concurrent/annotation/package-info.java
b/src/main/java/org/apache/commons/lang3/concurrent/annotation/package-info.java
deleted file mode 100644
index 3f29ebf..0000000
--- a/src/main/java/org/apache/commons/lang3/concurrent/annotation/package-info.java
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * <p>Provides annotations to document classes' thread safety</p>
- *
- * @since 3.6
- */
-package org.apache.commons.lang3.concurrent.annotation;

http://git-wip-us.apache.org/repos/asf/commons-lang/blob/796b051f/src/test/java/org/apache/commons/lang3/concurrent/annotation/AnnotationTestUtils.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/lang3/concurrent/annotation/AnnotationTestUtils.java
b/src/test/java/org/apache/commons/lang3/concurrent/annotation/AnnotationTestUtils.java
deleted file mode 100644
index ea4bb3e..0000000
--- a/src/test/java/org/apache/commons/lang3/concurrent/annotation/AnnotationTestUtils.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.commons.lang3.concurrent.annotation;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Method;
-
-import org.apache.bcel.Repository;
-import org.apache.bcel.classfile.AnnotationEntry;
-import org.apache.bcel.classfile.ElementValuePair;
-import org.apache.bcel.classfile.JavaClass;
-import org.apache.commons.lang3.reflect.MethodUtils;
-import org.junit.Assert;
-
-class AnnotationTestUtils {
-
-    public static void testClassAnnotationInClassFile(final String className, final String
annotationType) throws Exception {
-        final JavaClass clazz = Repository.lookupClass(className);
-        final AnnotationEntry[] annotationEntries = clazz.getAnnotationEntries();
-        Assert.assertNotNull(annotationEntries);
-        Assert.assertEquals(1, annotationEntries.length);
-        final AnnotationEntry annotationEntry = annotationEntries[0];
-        Assert.assertEquals(annotationType, annotationEntry .getAnnotationType());
-        final ElementValuePair[] elementValuePairs = annotationEntry.getElementValuePairs();
-        Assert.assertNotNull(elementValuePairs);
-        Assert.assertEquals(0, elementValuePairs.length);
-    }
-
-    public static void testMethodAnnotationNotRetainedAtRuntime(final Class<?> cls,
-            final Class<? extends Annotation> annotationCls) {
-        final Method[] methods = MethodUtils.getMethodsWithAnnotation(cls, annotationCls);
-        Assert.assertNotNull(methods);
-        Assert.assertEquals(0, methods.length);
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/commons-lang/blob/796b051f/src/test/java/org/apache/commons/lang3/concurrent/annotation/ContractTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/lang3/concurrent/annotation/ContractTest.java
b/src/test/java/org/apache/commons/lang3/concurrent/annotation/ContractTest.java
deleted file mode 100644
index affa786..0000000
--- a/src/test/java/org/apache/commons/lang3/concurrent/annotation/ContractTest.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.commons.lang3.concurrent.annotation;
-
-import org.junit.Test;
-
-/**
- * Tests {@link Contract}.
- */
-public class ContractTest {
-
-    @Test
-    public void testClassAnnotationInClassFile() throws Exception {
-        AnnotationTestUtils.testClassAnnotationInClassFile(
-                "org.apache.commons.lang3.concurrent.annotation.ContractTestFixture",
-                "Lorg/apache/commons/lang3/concurrent/annotation/Contract;");
-    }
-
-    @Test
-    public void testMethodAnnotationNotRetainedAtRuntime() {
-        AnnotationTestUtils.testMethodAnnotationNotRetainedAtRuntime(ContractTestFixture.class,
Contract.class);
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/commons-lang/blob/796b051f/src/test/java/org/apache/commons/lang3/concurrent/annotation/ContractTestFixture.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/lang3/concurrent/annotation/ContractTestFixture.java
b/src/test/java/org/apache/commons/lang3/concurrent/annotation/ContractTestFixture.java
deleted file mode 100644
index 6d254b1..0000000
--- a/src/test/java/org/apache/commons/lang3/concurrent/annotation/ContractTestFixture.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.commons.lang3.concurrent.annotation;
-
-/**
- * Tests {@link Immutable}.
- */
-@Contract()
-public class ContractTestFixture {
-    // empty
-}

http://git-wip-us.apache.org/repos/asf/commons-lang/blob/796b051f/src/test/java/org/apache/commons/lang3/concurrent/annotation/GuardedByTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/lang3/concurrent/annotation/GuardedByTest.java
b/src/test/java/org/apache/commons/lang3/concurrent/annotation/GuardedByTest.java
deleted file mode 100644
index ecdd4ad..0000000
--- a/src/test/java/org/apache/commons/lang3/concurrent/annotation/GuardedByTest.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.commons.lang3.concurrent.annotation;
-
-import org.apache.bcel.Repository;
-import org.apache.bcel.classfile.AnnotationEntry;
-import org.apache.bcel.classfile.ElementValue;
-import org.apache.bcel.classfile.ElementValuePair;
-import org.apache.bcel.classfile.JavaClass;
-import org.junit.Assert;
-import org.junit.Test;
-
-/**
- * Tests {@link GuardedBy}.
- */
-public class GuardedByTest {
-
-    private org.apache.bcel.classfile.Method getBcelMethod(final JavaClass clazz, final String
name) {
-        for (final org.apache.bcel.classfile.Method method : clazz.getMethods()) {
-            if (method.getName().equals(name)) {
-                return method;
-            }
-        }
-        return null;
-    }
-
-    @Test
-    public void testMethodAnnotationInClassFile() throws Exception {
-        final JavaClass clazz = Repository.lookupClass("org.apache.commons.lang3.concurrent.annotation.GuardedByTestFixture");
-        final org.apache.bcel.classfile.Method method = getBcelMethod(clazz, "foo");
-        Assert.assertNotNull(method);
-        final AnnotationEntry[] annotationEntries = method.getAnnotationEntries();
-        Assert.assertNotNull(annotationEntries);
-        Assert.assertEquals(1, annotationEntries.length);
-        final AnnotationEntry annotationEntry = annotationEntries[0];
-        Assert.assertEquals("Lorg/apache/commons/lang3/concurrent/annotation/GuardedBy;",
annotationEntry .getAnnotationType());
-        final ElementValuePair[] elementValuePairs = annotationEntry.getElementValuePairs();
-        Assert.assertNotNull(elementValuePairs);
-        Assert.assertEquals(1, elementValuePairs.length);
-        final ElementValuePair elementValuePair = elementValuePairs[0];
-        final ElementValue value = elementValuePair.getValue();
-        Assert.assertNotNull(value);
-        Assert.assertEquals("bar", value.toString());
-    }
-
-    @Test
-    public void testMethodAnnotationNotRetainedAtRuntime() {
-        AnnotationTestUtils.testMethodAnnotationNotRetainedAtRuntime(GuardedByTestFixture.class,
GuardedBy.class);
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/commons-lang/blob/796b051f/src/test/java/org/apache/commons/lang3/concurrent/annotation/GuardedByTestFixture.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/lang3/concurrent/annotation/GuardedByTestFixture.java
b/src/test/java/org/apache/commons/lang3/concurrent/annotation/GuardedByTestFixture.java
deleted file mode 100644
index 89bd3f7..0000000
--- a/src/test/java/org/apache/commons/lang3/concurrent/annotation/GuardedByTestFixture.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.commons.lang3.concurrent.annotation;
-
-/**
- * Tests {@link GuardedBy}.
- */
-public class GuardedByTestFixture {
-
-    @GuardedBy("ping")
-    private Object pong;
-    
-    @GuardedBy("bar")
-    public void foo() {
-        // empty
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/commons-lang/blob/796b051f/src/test/java/org/apache/commons/lang3/concurrent/annotation/ImmutableTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/lang3/concurrent/annotation/ImmutableTest.java
b/src/test/java/org/apache/commons/lang3/concurrent/annotation/ImmutableTest.java
deleted file mode 100644
index deef67d..0000000
--- a/src/test/java/org/apache/commons/lang3/concurrent/annotation/ImmutableTest.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.commons.lang3.concurrent.annotation;
-
-import org.junit.Test;
-
-/**
- * Tests {@link GuardedBy}.
- */
-public class ImmutableTest {
-
-    @Test
-    public void testClassAnnotationInClassFile() throws Exception {
-        AnnotationTestUtils.testClassAnnotationInClassFile(
-                "org.apache.commons.lang3.concurrent.annotation.ImmutableTestFixture",
-                "Lorg/apache/commons/lang3/concurrent/annotation/Immutable;");
-    }
-
-    @Test
-    public void testMethodAnnotationNotRetainedAtRuntime() {
-        AnnotationTestUtils.testMethodAnnotationNotRetainedAtRuntime(ImmutableTestFixture.class,
Immutable.class);
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/commons-lang/blob/796b051f/src/test/java/org/apache/commons/lang3/concurrent/annotation/ImmutableTestFixture.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/lang3/concurrent/annotation/ImmutableTestFixture.java
b/src/test/java/org/apache/commons/lang3/concurrent/annotation/ImmutableTestFixture.java
deleted file mode 100644
index c14debf..0000000
--- a/src/test/java/org/apache/commons/lang3/concurrent/annotation/ImmutableTestFixture.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.commons.lang3.concurrent.annotation;
-
-/**
- * Tests {@link Immutable}.
- */
-@Immutable
-public class ImmutableTestFixture {
-    // empty
-}

http://git-wip-us.apache.org/repos/asf/commons-lang/blob/796b051f/src/test/java/org/apache/commons/lang3/concurrent/annotation/NotThreadSafeTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/lang3/concurrent/annotation/NotThreadSafeTest.java
b/src/test/java/org/apache/commons/lang3/concurrent/annotation/NotThreadSafeTest.java
deleted file mode 100644
index 616152c..0000000
--- a/src/test/java/org/apache/commons/lang3/concurrent/annotation/NotThreadSafeTest.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.commons.lang3.concurrent.annotation;
-
-import org.junit.Test;
-
-/**
- * Tests {@link NotThreadSafe}.
- */
-public class NotThreadSafeTest {
-
-    @Test
-    public void testClassAnnotationInClassFile() throws Exception {
-        AnnotationTestUtils.testClassAnnotationInClassFile(
-                "org.apache.commons.lang3.concurrent.annotation.NotThreadSafeTestFixture",
-                "Lorg/apache/commons/lang3/concurrent/annotation/NotThreadSafe;");
-    }
-
-    @Test
-    public void testMethodAnnotationNotRetainedAtRuntime() {
-        AnnotationTestUtils.testMethodAnnotationNotRetainedAtRuntime(NotThreadSafeTestFixture.class,
-                NotThreadSafe.class);
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/commons-lang/blob/796b051f/src/test/java/org/apache/commons/lang3/concurrent/annotation/NotThreadSafeTestFixture.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/lang3/concurrent/annotation/NotThreadSafeTestFixture.java
b/src/test/java/org/apache/commons/lang3/concurrent/annotation/NotThreadSafeTestFixture.java
deleted file mode 100644
index a11ac3f..0000000
--- a/src/test/java/org/apache/commons/lang3/concurrent/annotation/NotThreadSafeTestFixture.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.commons.lang3.concurrent.annotation;
-
-/**
- * Tests {@link NotThreadSafe}.
- */
-@NotThreadSafe
-public class NotThreadSafeTestFixture {
-    // empty
-}

http://git-wip-us.apache.org/repos/asf/commons-lang/blob/796b051f/src/test/java/org/apache/commons/lang3/concurrent/annotation/ThreadSafeTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/lang3/concurrent/annotation/ThreadSafeTest.java
b/src/test/java/org/apache/commons/lang3/concurrent/annotation/ThreadSafeTest.java
deleted file mode 100644
index 8d387fb..0000000
--- a/src/test/java/org/apache/commons/lang3/concurrent/annotation/ThreadSafeTest.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.commons.lang3.concurrent.annotation;
-
-import org.junit.Test;
-
-/**
- * Tests {@link ThreadSafe}.
- */
-public class ThreadSafeTest {
-
-    @Test
-    public void testClassAnnotationInClassFile() throws Exception {
-        AnnotationTestUtils.testClassAnnotationInClassFile(
-                "org.apache.commons.lang3.concurrent.annotation.ThreadSafeTestFixture",
-                "Lorg/apache/commons/lang3/concurrent/annotation/ThreadSafe;");
-    }
-
-    @Test
-    public void testMethodAnnotationNotRetainedAtRuntime() {
-        AnnotationTestUtils.testMethodAnnotationNotRetainedAtRuntime(ThreadSafeTestFixture.class,
-                ThreadSafe.class);
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/commons-lang/blob/796b051f/src/test/java/org/apache/commons/lang3/concurrent/annotation/ThreadSafeTestFixture.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/lang3/concurrent/annotation/ThreadSafeTestFixture.java
b/src/test/java/org/apache/commons/lang3/concurrent/annotation/ThreadSafeTestFixture.java
deleted file mode 100644
index 81ef775..0000000
--- a/src/test/java/org/apache/commons/lang3/concurrent/annotation/ThreadSafeTestFixture.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.commons.lang3.concurrent.annotation;
-
-/**
- * Tests {@link ThreadSafe}.
- */
-@ThreadSafe
-public class ThreadSafeTestFixture {
-    // empty
-}


Mime
View raw message