You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-commits@jackrabbit.apache.org by re...@apache.org on 2019/10/23 17:22:18 UTC

svn commit: r1868815 - in /jackrabbit/oak/trunk: oak-commons/ oak-commons/src/main/java/org/apache/jackrabbit/oak/commons/annotations/ oak-core-spi/src/main/java/org/apache/jackrabbit/oak/cache/

Author: reschke
Date: Wed Oct 23 17:22:17 2019
New Revision: 1868815

URL: http://svn.apache.org/viewvc?rev=1868815&view=rev
Log:
OAK-8707: Mark exported APIs that we don't want to expose with an @Internal annotation

Added:
    jackrabbit/oak/trunk/oak-commons/src/main/java/org/apache/jackrabbit/oak/commons/annotations/
    jackrabbit/oak/trunk/oak-commons/src/main/java/org/apache/jackrabbit/oak/commons/annotations/Internal.java   (with props)
    jackrabbit/oak/trunk/oak-commons/src/main/java/org/apache/jackrabbit/oak/commons/annotations/package-info.java   (with props)
Modified:
    jackrabbit/oak/trunk/oak-commons/pom.xml
    jackrabbit/oak/trunk/oak-core-spi/src/main/java/org/apache/jackrabbit/oak/cache/CacheLIRS.java
    jackrabbit/oak/trunk/oak-core-spi/src/main/java/org/apache/jackrabbit/oak/cache/package-info.java

Modified: jackrabbit/oak/trunk/oak-commons/pom.xml
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-commons/pom.xml?rev=1868815&r1=1868814&r2=1868815&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-commons/pom.xml (original)
+++ jackrabbit/oak/trunk/oak-commons/pom.xml Wed Oct 23 17:22:17 2019
@@ -49,6 +49,14 @@
               <!-- OAK-7182 -->${guava.osgi.import},
               *
             </Import-Package>
+            <Export-Package>
+              org.apache.jackrabbit.oak.commons,
+              org.apache.jackrabbit.oak.commons.cache,
+              org.apache.jackrabbit.oak.commons.concurrent,
+              org.apache.jackrabbit.oak.commons.io,
+              org.apache.jackrabbit.oak.commons.json,
+              org.apache.jackrabbit.oak.commons.sort
+            </Export-Package>
           </instructions>
         </configuration>
       </plugin>

Added: jackrabbit/oak/trunk/oak-commons/src/main/java/org/apache/jackrabbit/oak/commons/annotations/Internal.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-commons/src/main/java/org/apache/jackrabbit/oak/commons/annotations/Internal.java?rev=1868815&view=auto
==============================================================================
--- jackrabbit/oak/trunk/oak-commons/src/main/java/org/apache/jackrabbit/oak/commons/annotations/Internal.java (added)
+++ jackrabbit/oak/trunk/oak-commons/src/main/java/org/apache/jackrabbit/oak/commons/annotations/Internal.java Wed Oct 23 17:22:17 2019
@@ -0,0 +1,57 @@
+/*
+ * 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.jackrabbit.oak.commons.annotations;
+
+import static java.lang.annotation.ElementType.ANNOTATION_TYPE;
+import static java.lang.annotation.ElementType.CONSTRUCTOR;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PACKAGE;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.CLASS;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+/**
+ * Elements annotated @Internal are -- although possibly exported -- intended
+ * for Oak's internal use only. Such elements are not public by design and
+ * likely to be removed, have their signature change, or have their access level
+ * decreased in future versions without notice. @Internal elements are eligible
+ * for immediate modification or removal and are not subject to any policies
+ * with respect to deprecation.
+ * <p>
+ * Note that Oak APIs are considered internal use by default, unless the package
+ * they appear in is annotated with a {@link @Version} annotation with a value
+ * greater than "1.0.0".
+ */
+@Documented
+@Retention(CLASS)
+@Target({ TYPE, METHOD, CONSTRUCTOR, ANNOTATION_TYPE, PACKAGE })
+public @interface Internal {
+    /**
+     * @return (optional) reason for being internal
+     */
+    String reason() default "";
+
+    /**
+     * @return (optional) first package version making this API internal
+     */
+    String since() default "";
+}

Propchange: jackrabbit/oak/trunk/oak-commons/src/main/java/org/apache/jackrabbit/oak/commons/annotations/Internal.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jackrabbit/oak/trunk/oak-commons/src/main/java/org/apache/jackrabbit/oak/commons/annotations/Internal.java
------------------------------------------------------------------------------
    svn:executable = *

Added: jackrabbit/oak/trunk/oak-commons/src/main/java/org/apache/jackrabbit/oak/commons/annotations/package-info.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-commons/src/main/java/org/apache/jackrabbit/oak/commons/annotations/package-info.java?rev=1868815&view=auto
==============================================================================
--- jackrabbit/oak/trunk/oak-commons/src/main/java/org/apache/jackrabbit/oak/commons/annotations/package-info.java (added)
+++ jackrabbit/oak/trunk/oak-commons/src/main/java/org/apache/jackrabbit/oak/commons/annotations/package-info.java Wed Oct 23 17:22:17 2019
@@ -0,0 +1,23 @@
+/*
+ * 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.
+ */
+/**
+ * Annotations for internal use in Oak.
+ */
+@Internal
+package org.apache.jackrabbit.oak.commons.annotations;

Propchange: jackrabbit/oak/trunk/oak-commons/src/main/java/org/apache/jackrabbit/oak/commons/annotations/package-info.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jackrabbit/oak/trunk/oak-commons/src/main/java/org/apache/jackrabbit/oak/commons/annotations/package-info.java
------------------------------------------------------------------------------
    svn:executable = *

Modified: jackrabbit/oak/trunk/oak-core-spi/src/main/java/org/apache/jackrabbit/oak/cache/CacheLIRS.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core-spi/src/main/java/org/apache/jackrabbit/oak/cache/CacheLIRS.java?rev=1868815&r1=1868814&r2=1868815&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core-spi/src/main/java/org/apache/jackrabbit/oak/cache/CacheLIRS.java (original)
+++ jackrabbit/oak/trunk/oak-core-spi/src/main/java/org/apache/jackrabbit/oak/cache/CacheLIRS.java Wed Oct 23 17:22:17 2019
@@ -41,6 +41,7 @@ import com.google.common.collect.Immutab
 import com.google.common.util.concurrent.ListenableFuture;
 import com.google.common.util.concurrent.UncheckedExecutionException;
 
+import org.apache.jackrabbit.oak.commons.annotations.Internal;
 import org.apache.jackrabbit.oak.spi.GuavaDeprecation;
 import org.jetbrains.annotations.NotNull;
 import org.jetbrains.annotations.Nullable;
@@ -78,6 +79,7 @@ import org.slf4j.LoggerFactory;
  * @param <K> the key type
  * @param <V> the value type
  */
+@Internal(since = "1.1.1")
 public class CacheLIRS<K, V> implements LoadingCache<K, V> {
 
     static final Logger LOG = LoggerFactory.getLogger(CacheLIRS.class);

Modified: jackrabbit/oak/trunk/oak-core-spi/src/main/java/org/apache/jackrabbit/oak/cache/package-info.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core-spi/src/main/java/org/apache/jackrabbit/oak/cache/package-info.java?rev=1868815&r1=1868814&r2=1868815&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core-spi/src/main/java/org/apache/jackrabbit/oak/cache/package-info.java (original)
+++ jackrabbit/oak/trunk/oak-core-spi/src/main/java/org/apache/jackrabbit/oak/cache/package-info.java Wed Oct 23 17:22:17 2019
@@ -18,7 +18,9 @@
 /**
  * <em>For Oak internal use only. Do not use outside Oak components.</em>
  */
-@Version("1.1.0")
+@Internal(since = "1.1.1")
+@Version("1.1.1")
 package org.apache.jackrabbit.oak.cache;
 
+import org.apache.jackrabbit.oak.commons.annotations.Internal;
 import org.osgi.annotation.versioning.Version;
\ No newline at end of file