This is an automated email from the ASF dual-hosted git repository.
cziegeler pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-api.git
The following commit(s) were added to refs/heads/master by this push:
new 1dccffe SLING-7798 : Switch from JSR-305 annotations to Jetbrains
Nullable/NotNull Annotations
1dccffe is described below
commit 1dccffe98b8106eea4fd1b0ef8c60baf14679ca6
Author: Carsten Ziegeler <[email protected]>
AuthorDate: Thu Aug 9 15:16:23 2018 +0200
SLING-7798 : Switch from JSR-305 annotations to Jetbrains Nullable/NotNull
Annotations
---
pom.xml | 6 ++-
.../apache/sling/api/SlingHttpServletRequest.java | 36 ++++++-------
.../org/apache/sling/api/adapter/Adaptable.java | 6 +--
.../apache/sling/api/adapter/AdapterFactory.java | 8 +--
.../apache/sling/api/adapter/AdapterManager.java | 8 +--
.../org/apache/sling/api/adapter/package-info.java | 2 +-
.../org/apache/sling/api/auth/Authenticator.java | 6 +--
.../org/apache/sling/api/auth/package-info.java | 2 +-
.../java/org/apache/sling/api/package-info.java | 2 +-
.../apache/sling/api/request/RequestParameter.java | 16 +++---
.../sling/api/request/RequestParameterMap.java | 8 +--
.../apache/sling/api/request/RequestPathInfo.java | 16 +++---
.../sling/api/request/RequestProgressTracker.java | 18 +++----
.../org/apache/sling/api/request/RequestUtil.java | 16 +++---
.../org/apache/sling/api/request/ResponseUtil.java | 4 +-
.../org/apache/sling/api/request/package-info.java | 2 +-
.../api/resource/AbstractResourceVisitor.java | 6 +--
.../sling/api/resource/NonExistingResource.java | 4 +-
.../resource/ParametrizableResourceProvider.java | 10 ++--
.../org/apache/sling/api/resource/Resource.java | 26 +++++-----
.../sling/api/resource/ResourceDecorator.java | 8 +--
.../sling/api/resource/ResourceMetadata.java | 28 +++++-----
.../sling/api/resource/ResourceProvider.java | 10 ++--
.../api/resource/ResourceProviderFactory.java | 6 +--
.../sling/api/resource/ResourceResolver.java | 48 ++++++++---------
.../api/resource/ResourceResolverFactory.java | 14 ++---
.../apache/sling/api/resource/ResourceUtil.java | 54 +++++++++----------
.../apache/sling/api/resource/ResourceWrapper.java | 4 +-
.../sling/api/resource/SyntheticResource.java | 10 ++--
.../org/apache/sling/api/resource/ValueMap.java | 8 +--
.../api/resource/observation/ResourceChange.java | 24 ++++-----
.../observation/ResourceChangeListener.java | 4 +-
.../api/resource/observation/package-info.java | 2 +-
.../apache/sling/api/resource/package-info.java | 2 +-
.../org/apache/sling/api/resource/path/Path.java | 6 +--
.../sling/api/resource/path/package-info.java | 2 +-
.../apache/sling/api/scripting/SlingBindings.java | 18 +++----
.../apache/sling/api/scripting/SlingScript.java | 8 +--
.../sling/api/scripting/SlingScriptHelper.java | 38 +++++++-------
.../sling/api/scripting/SlingScriptResolver.java | 6 +--
.../apache/sling/api/scripting/package-info.java | 2 +-
.../sling/api/security/ResourceAccessSecurity.java | 22 ++++----
.../apache/sling/api/security/package-info.java | 2 +-
.../apache/sling/api/servlets/OptingServlet.java | 4 +-
.../apache/sling/api/servlets/ServletResolver.java | 10 ++--
.../sling/api/servlets/SlingAllMethodsServlet.java | 22 ++++----
.../api/servlets/SlingSafeMethodsServlet.java | 38 +++++++-------
.../apache/sling/api/servlets/package-info.java | 2 +-
.../api/wrappers/ResourceResolverWrapper.java | 60 +++++++++++-----------
.../apache/sling/api/wrappers/package-info.java | 2 +-
.../spi/resource/provider/ObservationReporter.java | 10 ++--
.../resource/provider/ObserverConfiguration.java | 10 ++--
.../spi/resource/provider/ProviderContext.java | 4 +-
.../resource/provider/QueryLanguageProvider.java | 8 +--
.../spi/resource/provider/ResolveContext.java | 12 ++---
.../spi/resource/provider/ResourceContext.java | 4 +-
.../spi/resource/provider/ResourceProvider.java | 60 +++++++++++-----------
.../sling/spi/resource/provider/package-info.java | 2 +-
58 files changed, 389 insertions(+), 387 deletions(-)
diff --git a/pom.xml b/pom.xml
index 7b01d56..13aab1b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -67,8 +67,10 @@
<artifactId>slf4j-api</artifactId>
</dependency>
<dependency>
- <groupId>com.google.code.findbugs</groupId>
- <artifactId>jsr305</artifactId>
+ <groupId>org.jetbrains</groupId>
+ <artifactId>annotations</artifactId>
+ <version>16.0.2</version>
+ <scope>provided</scope>
</dependency>
<!-- No external dependency, we embed some util classes -->
<dependency>
diff --git a/src/main/java/org/apache/sling/api/SlingHttpServletRequest.java
b/src/main/java/org/apache/sling/api/SlingHttpServletRequest.java
index 463abf0..776e613 100644
--- a/src/main/java/org/apache/sling/api/SlingHttpServletRequest.java
+++ b/src/main/java/org/apache/sling/api/SlingHttpServletRequest.java
@@ -23,8 +23,8 @@ import java.util.List;
import java.util.Locale;
import java.util.ResourceBundle;
-import javax.annotation.CheckForNull;
-import javax.annotation.Nonnull;
+import org.jetbrains.annotations.Nullable;
+import org.jetbrains.annotations.NotNull;
import javax.servlet.RequestDispatcher;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
@@ -70,7 +70,7 @@ public interface SlingHttpServletRequest extends
HttpServletRequest, Adaptable {
*
* @return The <code>Resource</code> object of this request.
*/
- @Nonnull Resource getResource();
+ @NotNull Resource getResource();
/**
* Returns the {@link ResourceResolver} which resolved the
@@ -78,14 +78,14 @@ public interface SlingHttpServletRequest extends
HttpServletRequest, Adaptable {
*
* @return The resource resolver
*/
- @Nonnull ResourceResolver getResourceResolver();
+ @NotNull ResourceResolver getResourceResolver();
/**
* Returns the {@link RequestPathInfo} pertaining to this request.
*
* @return the request path info.
*/
- @Nonnull RequestPathInfo getRequestPathInfo();
+ @NotNull RequestPathInfo getRequestPathInfo();
/**
* Returns the value of a request parameter as a {@link RequestParameter},
@@ -109,7 +109,7 @@ public interface SlingHttpServletRequest extends
HttpServletRequest, Adaptable {
* @see RequestParameterMap#getValue(String)
* @throws IllegalArgumentException if name is <code>null</code>.
*/
- @CheckForNull RequestParameter getRequestParameter(@Nonnull String name);
+ @Nullable RequestParameter getRequestParameter(@NotNull String name);
/**
* Returns an array of {@link RequestParameter} objects containing all of
@@ -129,7 +129,7 @@ public interface SlingHttpServletRequest extends
HttpServletRequest, Adaptable {
* @see RequestParameterMap#getValues(String)
* @throws IllegalArgumentException if name is <code>null</code>.
*/
- @CheckForNull RequestParameter[] getRequestParameters(@Nonnull String
name);
+ @Nullable RequestParameter[] getRequestParameters(@NotNull String name);
/**
* Returns a <code>Map</code> of the parameters of this request.
@@ -145,7 +145,7 @@ public interface SlingHttpServletRequest extends
HttpServletRequest, Adaptable {
* parameter map are of type String. The values in the parameter
map
* are of type {@link RequestParameter} array
(<code>RequestParameter[]</code>).
*/
- @Nonnull RequestParameterMap getRequestParameterMap();
+ @NotNull RequestParameterMap getRequestParameterMap();
/**
* Returns the request parameters as instances of the
@@ -157,7 +157,7 @@ public interface SlingHttpServletRequest extends
HttpServletRequest, Adaptable {
* order.
* @since 2.3 (Sling API Bundle 2.6.0)
*/
- @Nonnull List<RequestParameter> getRequestParameterList();
+ @NotNull List<RequestParameter> getRequestParameterList();
/**
* Returns a <code>RequestDispatcher</code> object that acts as a wrapper
@@ -176,7 +176,7 @@ public interface SlingHttpServletRequest extends
HttpServletRequest, Adaptable {
* for the <code>resource</code> or <code>null</code> if an
* error occurs preparing the dispatcher.
*/
- @CheckForNull RequestDispatcher getRequestDispatcher(@Nonnull String path,
+ @Nullable RequestDispatcher getRequestDispatcher(@NotNull String path,
RequestDispatcherOptions options);
/**
@@ -195,7 +195,7 @@ public interface SlingHttpServletRequest extends
HttpServletRequest, Adaptable {
* for the <code>resource</code> or <code>null</code> if an
* error occurs preparing the dispatcher.
*/
- @CheckForNull RequestDispatcher getRequestDispatcher(@Nonnull Resource
resource,
+ @Nullable RequestDispatcher getRequestDispatcher(@NotNull Resource
resource,
RequestDispatcherOptions options);
/**
@@ -207,7 +207,7 @@ public interface SlingHttpServletRequest extends
HttpServletRequest, Adaptable {
* for the <code>resource</code> or <code>null</code> if an
* error occurs preparing the dispatcher.
*/
- @CheckForNull RequestDispatcher getRequestDispatcher(@Nonnull Resource
resource);
+ @Nullable RequestDispatcher getRequestDispatcher(@NotNull Resource
resource);
/**
* Returns the named cookie from the HTTP request or <code>null</code> if
@@ -216,7 +216,7 @@ public interface SlingHttpServletRequest extends
HttpServletRequest, Adaptable {
* @param name The name of the cookie to return.
* @return The named cookie or <code>null</code> if no such cookie exists.
*/
- @CheckForNull Cookie getCookie(String name);
+ @Nullable Cookie getCookie(String name);
/**
* Returns the framework preferred content type for the response. The
@@ -228,7 +228,7 @@ public interface SlingHttpServletRequest extends
HttpServletRequest, Adaptable {
*
* @return preferred MIME type of the response
*/
- @CheckForNull String getResponseContentType();
+ @Nullable String getResponseContentType();
/**
* Gets a list of content types which the framework accepts for the
@@ -243,7 +243,7 @@ public interface SlingHttpServletRequest extends
HttpServletRequest, Adaptable {
*
* @return ordered list of MIME types for the response
*/
- @Nonnull Enumeration<String> getResponseContentTypes();
+ @NotNull Enumeration<String> getResponseContentTypes();
/**
* Returns the resource bundle for the given locale.
@@ -253,7 +253,7 @@ public interface SlingHttpServletRequest extends
HttpServletRequest, Adaptable {
* {@link #getLocale()} is used to select the resource bundle.
* @return the resource bundle for the given locale
*/
- @CheckForNull ResourceBundle getResourceBundle(Locale locale);
+ @Nullable ResourceBundle getResourceBundle(Locale locale);
/**
* Returns the resource bundle of the given base name for the given locale.
@@ -267,11 +267,11 @@ public interface SlingHttpServletRequest extends
HttpServletRequest, Adaptable {
* {@link #getLocale()} is used to select the resource bundle.
* @return the resource bundle for the given locale
*/
- @CheckForNull ResourceBundle getResourceBundle(String baseName, Locale
locale);
+ @Nullable ResourceBundle getResourceBundle(String baseName, Locale locale);
/**
* Returns the {@link RequestProgressTracker} of this request.
* @return The request progress tracker.
*/
- @Nonnull RequestProgressTracker getRequestProgressTracker();
+ @NotNull RequestProgressTracker getRequestProgressTracker();
}
diff --git a/src/main/java/org/apache/sling/api/adapter/Adaptable.java
b/src/main/java/org/apache/sling/api/adapter/Adaptable.java
index 446827e..dac47dd 100644
--- a/src/main/java/org/apache/sling/api/adapter/Adaptable.java
+++ b/src/main/java/org/apache/sling/api/adapter/Adaptable.java
@@ -18,8 +18,8 @@
*/
package org.apache.sling.api.adapter;
-import javax.annotation.CheckForNull;
-import javax.annotation.Nonnull;
+import org.jetbrains.annotations.Nullable;
+import org.jetbrains.annotations.NotNull;
import org.osgi.annotation.versioning.ConsumerType;
@@ -52,6 +52,6 @@ public interface Adaptable {
* @return The adapter target or <code>null</code> if the object cannot
* adapt to the requested type
*/
- @CheckForNull <AdapterType> AdapterType adaptTo(@Nonnull
Class<AdapterType> type);
+ @Nullable <AdapterType> AdapterType adaptTo(@NotNull Class<AdapterType>
type);
}
diff --git a/src/main/java/org/apache/sling/api/adapter/AdapterFactory.java
b/src/main/java/org/apache/sling/api/adapter/AdapterFactory.java
index 01c2460..3224af5 100644
--- a/src/main/java/org/apache/sling/api/adapter/AdapterFactory.java
+++ b/src/main/java/org/apache/sling/api/adapter/AdapterFactory.java
@@ -18,8 +18,8 @@
*/
package org.apache.sling.api.adapter;
-import javax.annotation.CheckForNull;
-import javax.annotation.Nonnull;
+import org.jetbrains.annotations.Nullable;
+import org.jetbrains.annotations.NotNull;
import org.osgi.annotation.versioning.ConsumerType;
@@ -92,7 +92,7 @@ public interface AdapterFactory {
* @return The adapted object or <code>null</code> if this factory instance
* cannot adapt the object.
*/
- @CheckForNull <AdapterType> AdapterType getAdapter(@Nonnull Object
adaptable,
- @Nonnull Class<AdapterType> type);
+ @Nullable <AdapterType> AdapterType getAdapter(@NotNull Object adaptable,
+ @NotNull Class<AdapterType> type);
}
diff --git a/src/main/java/org/apache/sling/api/adapter/AdapterManager.java
b/src/main/java/org/apache/sling/api/adapter/AdapterManager.java
index e740257..81a22ae 100644
--- a/src/main/java/org/apache/sling/api/adapter/AdapterManager.java
+++ b/src/main/java/org/apache/sling/api/adapter/AdapterManager.java
@@ -18,8 +18,8 @@
*/
package org.apache.sling.api.adapter;
-import javax.annotation.CheckForNull;
-import javax.annotation.Nonnull;
+import org.jetbrains.annotations.Nullable;
+import org.jetbrains.annotations.NotNull;
import org.osgi.annotation.versioning.ProviderType;
@@ -60,7 +60,7 @@ public interface AdapterManager {
* or if the <code>adaptable</code> cannot be adapted for any other
* reason.
*/
- @CheckForNull <AdapterType> AdapterType getAdapter(@Nonnull Object
adaptable,
- @Nonnull Class<AdapterType> type);
+ @Nullable <AdapterType> AdapterType getAdapter(@NotNull Object adaptable,
+ @NotNull Class<AdapterType> type);
}
\ No newline at end of file
diff --git a/src/main/java/org/apache/sling/api/adapter/package-info.java
b/src/main/java/org/apache/sling/api/adapter/package-info.java
index b06cc07..d737b8c 100644
--- a/src/main/java/org/apache/sling/api/adapter/package-info.java
+++ b/src/main/java/org/apache/sling/api/adapter/package-info.java
@@ -17,7 +17,7 @@
* under the License.
*/
-@Version("2.2.2")
+@Version("2.2.3")
package org.apache.sling.api.adapter;
import org.osgi.annotation.versioning.Version;
diff --git a/src/main/java/org/apache/sling/api/auth/Authenticator.java
b/src/main/java/org/apache/sling/api/auth/Authenticator.java
index a5fdbbb..79bccec 100644
--- a/src/main/java/org/apache/sling/api/auth/Authenticator.java
+++ b/src/main/java/org/apache/sling/api/auth/Authenticator.java
@@ -18,7 +18,7 @@
*/
package org.apache.sling.api.auth;
-import javax.annotation.Nonnull;
+import org.jetbrains.annotations.NotNull;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@@ -116,7 +116,7 @@ public interface Authenticator {
* to authenticate a request user.
* @throws IllegalStateException If the response has already been
committed.
*/
- void login(@Nonnull HttpServletRequest request, @Nonnull
HttpServletResponse response);
+ void login(@NotNull HttpServletRequest request, @NotNull
HttpServletResponse response);
/**
* Logs out if the current request is authenticated.
@@ -133,5 +133,5 @@ public interface Authenticator {
* @param response The object representing the response to the client.
* @throws IllegalStateException If the response has already been
committed.
*/
- void logout(@Nonnull HttpServletRequest request, @Nonnull
HttpServletResponse response);
+ void logout(@NotNull HttpServletRequest request, @NotNull
HttpServletResponse response);
}
diff --git a/src/main/java/org/apache/sling/api/auth/package-info.java
b/src/main/java/org/apache/sling/api/auth/package-info.java
index 59e3734..6a3d9da 100644
--- a/src/main/java/org/apache/sling/api/auth/package-info.java
+++ b/src/main/java/org/apache/sling/api/auth/package-info.java
@@ -17,7 +17,7 @@
* under the License.
*/
-@Version("1.0.2")
+@Version("1.0.3")
package org.apache.sling.api.auth;
import org.osgi.annotation.versioning.Version;
diff --git a/src/main/java/org/apache/sling/api/package-info.java
b/src/main/java/org/apache/sling/api/package-info.java
index 1a9c591..ad81af1 100644
--- a/src/main/java/org/apache/sling/api/package-info.java
+++ b/src/main/java/org/apache/sling/api/package-info.java
@@ -17,7 +17,7 @@
* under the License.
*/
-@Version("2.3.2")
+@Version("2.3.3")
package org.apache.sling.api;
import org.osgi.annotation.versioning.Version;
diff --git a/src/main/java/org/apache/sling/api/request/RequestParameter.java
b/src/main/java/org/apache/sling/api/request/RequestParameter.java
index 535f9b0..e1b3a6a 100644
--- a/src/main/java/org/apache/sling/api/request/RequestParameter.java
+++ b/src/main/java/org/apache/sling/api/request/RequestParameter.java
@@ -22,8 +22,8 @@ import java.io.IOException;
import java.io.InputStream;
import java.io.UnsupportedEncodingException;
-import javax.annotation.CheckForNull;
-import javax.annotation.Nonnull;
+import org.jetbrains.annotations.Nullable;
+import org.jetbrains.annotations.NotNull;
import org.osgi.annotation.versioning.ProviderType;
@@ -45,7 +45,7 @@ public interface RequestParameter {
* @return the name of this {@code RequestParameter}
* @since 2.4 (Sling API Bundle 2.6)
*/
- @Nonnull String getName();
+ @NotNull String getName();
/**
* Determines whether or not this instance represents a simple form field
or
@@ -63,7 +63,7 @@ public interface RequestParameter {
* @return The content type passed by the browser or <code>null</code> if
* not defined.
*/
- @CheckForNull String getContentType();
+ @Nullable String getContentType();
/**
* Returns the size in bytes of the parameter.
@@ -91,7 +91,7 @@ public interface RequestParameter {
* file.
* @throws IOException if an error occurs.
*/
- @CheckForNull InputStream getInputStream() throws IOException;
+ @Nullable InputStream getInputStream() throws IOException;
/**
* Returns the original filename in the client's filesystem, as provided by
@@ -101,7 +101,7 @@ public interface RequestParameter {
*
* @return The original filename in the client's filesystem.
*/
- @CheckForNull String getFileName();
+ @Nullable String getFileName();
/**
* Returns the contents of the parameter as a String, using the default
@@ -110,7 +110,7 @@ public interface RequestParameter {
*
* @return The contents of the parameter, as a string.
*/
- @Nonnull String getString();
+ @NotNull String getString();
/**
* Returns the contents of the parameter as a String, using the specified
@@ -122,6 +122,6 @@ public interface RequestParameter {
* @throws UnsupportedEncodingException if the requested character encoding
* is not available.
*/
- @Nonnull String getString(@Nonnull String encoding) throws
UnsupportedEncodingException;
+ @NotNull String getString(@NotNull String encoding) throws
UnsupportedEncodingException;
}
diff --git
a/src/main/java/org/apache/sling/api/request/RequestParameterMap.java
b/src/main/java/org/apache/sling/api/request/RequestParameterMap.java
index c3adc04..bab958f 100644
--- a/src/main/java/org/apache/sling/api/request/RequestParameterMap.java
+++ b/src/main/java/org/apache/sling/api/request/RequestParameterMap.java
@@ -20,8 +20,8 @@ package org.apache.sling.api.request;
import java.util.Map;
-import javax.annotation.CheckForNull;
-import javax.annotation.Nonnull;
+import org.jetbrains.annotations.Nullable;
+import org.jetbrains.annotations.NotNull;
import org.osgi.annotation.versioning.ProviderType;
@@ -38,12 +38,12 @@ public interface RequestParameterMap extends Map<String,
RequestParameter[]> {
* @param name The parameter name
* @return The request parameter array or {@code null}.
*/
- @CheckForNull RequestParameter[] getValues(@Nonnull String name);
+ @Nullable RequestParameter[] getValues(@NotNull String name);
/**
* Returns the first value for the named parameter or null if none
* @param name The parameter name
* @return The request parameter or {@code null}.
*/
- @CheckForNull RequestParameter getValue(String name);
+ @Nullable RequestParameter getValue(String name);
}
diff --git a/src/main/java/org/apache/sling/api/request/RequestPathInfo.java
b/src/main/java/org/apache/sling/api/request/RequestPathInfo.java
index 2abb8eb..90dce48 100644
--- a/src/main/java/org/apache/sling/api/request/RequestPathInfo.java
+++ b/src/main/java/org/apache/sling/api/request/RequestPathInfo.java
@@ -16,8 +16,8 @@
*/
package org.apache.sling.api.request;
-import javax.annotation.CheckForNull;
-import javax.annotation.Nonnull;
+import org.jetbrains.annotations.Nullable;
+import org.jetbrains.annotations.NotNull;
import org.apache.sling.api.resource.Resource;
@@ -162,7 +162,7 @@ public interface RequestPathInfo {
* of the resource.
* @return The resource path
*/
- @Nonnull String getResourcePath();
+ @NotNull String getResourcePath();
/**
* Returns the extension from the URL or <code>null</code> if the request
@@ -173,7 +173,7 @@ public interface RequestPathInfo {
*
* @return The extension from the request URL.
*/
- @CheckForNull String getExtension();
+ @Nullable String getExtension();
/**
* Returns the selectors decoded from the request URL as string. Returns
@@ -185,7 +185,7 @@ public interface RequestPathInfo {
* @return The selector string or {@code null}
* @see #getSelectors()
*/
- @CheckForNull String getSelectorString();
+ @Nullable String getSelectorString();
/**
* Returns the selectors decoded from the request URL as an array of
@@ -199,7 +199,7 @@ public interface RequestPathInfo {
* @return An array of selectors
* @see #getSelectorString()
*/
- @Nonnull String[] getSelectors();
+ @NotNull String[] getSelectors();
/**
* Returns the suffix part of the URL or <code>null</code> if the request
@@ -210,7 +210,7 @@ public interface RequestPathInfo {
*
* @return The suffix part of the request URL.
*/
- @CheckForNull String getSuffix();
+ @Nullable String getSuffix();
/**
* Returns the resource addressed by the suffix or null if the request does
@@ -224,5 +224,5 @@ public interface RequestPathInfo {
*
* @since 2.3 (Sling API Bundle 2.3.2)
*/
- @CheckForNull Resource getSuffixResource();
+ @Nullable Resource getSuffixResource();
}
diff --git
a/src/main/java/org/apache/sling/api/request/RequestProgressTracker.java
b/src/main/java/org/apache/sling/api/request/RequestProgressTracker.java
index 38f6ef4..760c80b 100644
--- a/src/main/java/org/apache/sling/api/request/RequestProgressTracker.java
+++ b/src/main/java/org/apache/sling/api/request/RequestProgressTracker.java
@@ -21,8 +21,8 @@ package org.apache.sling.api.request;
import java.io.PrintWriter;
import java.util.Iterator;
-import javax.annotation.CheckForNull;
-import javax.annotation.Nonnull;
+import org.jetbrains.annotations.Nullable;
+import org.jetbrains.annotations.NotNull;
import org.osgi.annotation.versioning.ProviderType;
@@ -89,7 +89,7 @@ public interface RequestProgressTracker {
* Creates an entry with the given message
* @param message The message
*/
- void log(@Nonnull String message);
+ void log(@NotNull String message);
/**
* Creates an entry with a message constructed from the given
@@ -98,21 +98,21 @@ public interface RequestProgressTracker {
* @param format The message
* @param args Arguments for the message
*/
- void log(@Nonnull String format, Object... args);
+ void log(@NotNull String format, Object... args);
/**
* Starts a named timer. If a timer of the same name already exists, it is
* reset to the current time.
* @param timerName the name of the timer
*/
- void startTimer(@Nonnull String timerName);
+ void startTimer(@NotNull String timerName);
/**
* Logs an entry with the message set to the name of the timer and the
* number of milliseconds elapsed since the timer start.
* @param timerName the name of the timer
*/
- void logTimer(@Nonnull String timerName);
+ void logTimer(@NotNull String timerName);
/**
* Logs an entry with the message constructed from the given
@@ -122,20 +122,20 @@ public interface RequestProgressTracker {
* @param format The message
* @param args Arguments for the message
*/
- void logTimer(@Nonnull String timerName, @Nonnull String format, Object...
args);
+ void logTimer(@NotNull String timerName, @NotNull String format, Object...
args);
/**
* Returns an <code>Iterator</code> of tracking entries.
* If there are no messages <code>null</code> is returned.
* @return An iterator with the messages or {@code null}
*/
- @CheckForNull Iterator<String> getMessages();
+ @Nullable Iterator<String> getMessages();
/**
* Dumps the process timer entries to the given writer, one entry per line.
* @param writer Writer to dump to
*/
- void dump(@Nonnull PrintWriter writer);
+ void dump(@NotNull PrintWriter writer);
/**
* Call this when done processing the request - only the first call of
this
diff --git a/src/main/java/org/apache/sling/api/request/RequestUtil.java
b/src/main/java/org/apache/sling/api/request/RequestUtil.java
index f2d1030..ecfde67 100644
--- a/src/main/java/org/apache/sling/api/request/RequestUtil.java
+++ b/src/main/java/org/apache/sling/api/request/RequestUtil.java
@@ -22,8 +22,8 @@ import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
-import javax.annotation.CheckForNull;
-import javax.annotation.Nonnull;
+import org.jetbrains.annotations.Nullable;
+import org.jetbrains.annotations.NotNull;
import javax.servlet.Servlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@@ -56,7 +56,7 @@ public class RequestUtil {
* @return A Map indexed by the Token names where the values are Map
* instances indexed by parameter name
*/
- public static @Nonnull Map<String, Map<String, String>>
parserHeader(@Nonnull String value) {
+ public static @NotNull Map<String, Map<String, String>>
parserHeader(@NotNull String value) {
Map<String, Map<String, String>> result = new HashMap<String,
Map<String, String>>();
String[] tokens = value.split(",");
for (int i = 0; i < tokens.length; i++) {
@@ -97,7 +97,7 @@ public class RequestUtil {
* <code>Double</code> instances providing the value of the
* <code>q</code> parameter.
*/
- public static @Nonnull Map<String, Double> parserAcceptHeader(@Nonnull
String value) {
+ public static @NotNull Map<String, Double> parserAcceptHeader(@NotNull
String value) {
Map<String, Double> result = new HashMap<String, Double>();
String[] tokens = value.split(",");
for (int i = 0; i < tokens.length; i++) {
@@ -137,7 +137,7 @@ public class RequestUtil {
* @param servlet The servlet
* @return The name of the servlet.
*/
- public static @Nonnull String getServletName(@Nonnull Servlet servlet) {
+ public static @NotNull String getServletName(@NotNull Servlet servlet) {
String name = null;
if (servlet.getServletConfig() != null) {
@@ -164,8 +164,8 @@ public class RequestUtil {
* @return The previous value of the named request attribute or
* <code>null</code> if it was not set.
*/
- public static @CheckForNull Object setRequestAttribute(@Nonnull
HttpServletRequest request,
- @Nonnull String name, Object value) {
+ public static @Nullable Object setRequestAttribute(@NotNull
HttpServletRequest request,
+ @NotNull String name, Object value) {
Object oldValue = request.getAttribute(name);
if (value == null) {
request.removeAttribute(name);
@@ -183,7 +183,7 @@ public class RequestUtil {
* @param resp the response
* @return <code>true</code> if the response was set
*/
- public static boolean handleIfModifiedSince(@Nonnull
SlingHttpServletRequest req, @Nonnull HttpServletResponse resp){
+ public static boolean handleIfModifiedSince(@NotNull
SlingHttpServletRequest req, @NotNull HttpServletResponse resp){
boolean responseSet=false;
long
lastModified=req.getResource().getResourceMetadata().getModificationTime();
if (lastModified!=-1){
diff --git a/src/main/java/org/apache/sling/api/request/ResponseUtil.java
b/src/main/java/org/apache/sling/api/request/ResponseUtil.java
index f557788..fa29f4b 100644
--- a/src/main/java/org/apache/sling/api/request/ResponseUtil.java
+++ b/src/main/java/org/apache/sling/api/request/ResponseUtil.java
@@ -21,7 +21,7 @@ package org.apache.sling.api.request;
import java.io.IOException;
import java.io.Writer;
-import javax.annotation.Nonnull;
+import org.jetbrains.annotations.NotNull;
/**
* Response related utility methods
@@ -125,7 +125,7 @@ public class ResponseUtil {
* @param target writer
* @return Wrapped writer escaping XML
*/
- public static @Nonnull Writer getXmlEscapingWriter(@Nonnull Writer target)
{
+ public static @NotNull Writer getXmlEscapingWriter(@NotNull Writer target)
{
return new XmlEscapingWriter(target);
}
}
diff --git a/src/main/java/org/apache/sling/api/request/package-info.java
b/src/main/java/org/apache/sling/api/request/package-info.java
index 06b789b..640fdd7 100644
--- a/src/main/java/org/apache/sling/api/request/package-info.java
+++ b/src/main/java/org/apache/sling/api/request/package-info.java
@@ -17,7 +17,7 @@
* under the License.
*/
-@Version("2.4.2")
+@Version("2.4.3")
package org.apache.sling.api.request;
import org.osgi.annotation.versioning.Version;
diff --git
a/src/main/java/org/apache/sling/api/resource/AbstractResourceVisitor.java
b/src/main/java/org/apache/sling/api/resource/AbstractResourceVisitor.java
index f454d67..20f8fc3 100644
--- a/src/main/java/org/apache/sling/api/resource/AbstractResourceVisitor.java
+++ b/src/main/java/org/apache/sling/api/resource/AbstractResourceVisitor.java
@@ -20,7 +20,7 @@ package org.apache.sling.api.resource;
import java.util.Iterator;
-import javax.annotation.Nonnull;
+import org.jetbrains.annotations.NotNull;
/**
* The <code>AbstractResourceVisitor</code> helps in traversing a
@@ -47,7 +47,7 @@ public abstract class AbstractResourceVisitor {
* Visit the given resources.
* @param children The list of resources
*/
- protected void traverseChildren(final @Nonnull Iterator<Resource>
children) {
+ protected void traverseChildren(final @NotNull Iterator<Resource>
children) {
while (children.hasNext()) {
final Resource child = children.next();
@@ -59,5 +59,5 @@ public abstract class AbstractResourceVisitor {
* Implement this method to do actual work on the resources.
* @param res The resource
*/
- protected abstract void visit(final @Nonnull Resource res);
+ protected abstract void visit(final @NotNull Resource res);
}
diff --git
a/src/main/java/org/apache/sling/api/resource/NonExistingResource.java
b/src/main/java/org/apache/sling/api/resource/NonExistingResource.java
index 7e8c69e..bdb8bf4 100644
--- a/src/main/java/org/apache/sling/api/resource/NonExistingResource.java
+++ b/src/main/java/org/apache/sling/api/resource/NonExistingResource.java
@@ -18,7 +18,7 @@
*/
package org.apache.sling.api.resource;
-import javax.annotation.Nonnull;
+import org.jetbrains.annotations.NotNull;
/**
* Simple helper class representing nonexisting resources.
@@ -45,7 +45,7 @@ public final class NonExistingResource extends
SyntheticResource {
/**
* @see org.apache.sling.api.resource.SyntheticResource#getResourceType()
*/
- public final @Nonnull String getResourceType() {
+ public final @NotNull String getResourceType() {
// overwrite to prevent overwriting of this method in extensions of
// this class because the specific resource type is the marker of a
// NonExistingResource
diff --git
a/src/main/java/org/apache/sling/api/resource/ParametrizableResourceProvider.java
b/src/main/java/org/apache/sling/api/resource/ParametrizableResourceProvider.java
index 4940919..9667dfb 100644
---
a/src/main/java/org/apache/sling/api/resource/ParametrizableResourceProvider.java
+++
b/src/main/java/org/apache/sling/api/resource/ParametrizableResourceProvider.java
@@ -20,8 +20,8 @@ package org.apache.sling.api.resource;
import java.util.Map;
-import javax.annotation.CheckForNull;
-import javax.annotation.Nonnull;
+import org.jetbrains.annotations.Nullable;
+import org.jetbrains.annotations.NotNull;
import org.osgi.annotation.versioning.ConsumerType;
@@ -62,7 +62,7 @@ public interface ParametrizableResourceProvider {
* may be thrown in case of any problem creating the
<code>Resource</code> instance.
* @see ResourceProvider#getResource(ResourceResolver, String)
*/
- @CheckForNull Resource getResource(@Nonnull ResourceResolver
resourceResolver,
- @Nonnull String path,
- @Nonnull Map<String, String> parameters);
+ @Nullable Resource getResource(@NotNull ResourceResolver resourceResolver,
+ @NotNull String path,
+ @NotNull Map<String, String> parameters);
}
diff --git a/src/main/java/org/apache/sling/api/resource/Resource.java
b/src/main/java/org/apache/sling/api/resource/Resource.java
index 929c163..5907637 100644
--- a/src/main/java/org/apache/sling/api/resource/Resource.java
+++ b/src/main/java/org/apache/sling/api/resource/Resource.java
@@ -18,8 +18,8 @@ package org.apache.sling.api.resource;
import java.util.Iterator;
-import javax.annotation.CheckForNull;
-import javax.annotation.Nonnull;
+import org.jetbrains.annotations.Nullable;
+import org.jetbrains.annotations.NotNull;
import org.apache.sling.api.adapter.Adaptable;
@@ -66,7 +66,7 @@ public interface Resource extends Adaptable {
* Returns the absolute path of this resource in the resource tree.
* @return The resource path
*/
- @Nonnull String getPath();
+ @NotNull String getPath();
/**
* Returns the name of this resource. The name of a resource is the last
@@ -75,7 +75,7 @@ public interface Resource extends Adaptable {
* @return The resource name
* @since 2.1 (Sling API Bundle 2.2.0)
*/
- @Nonnull String getName();
+ @NotNull String getName();
/**
* Returns the parent resource or <code>null</code> if this resource
@@ -89,7 +89,7 @@ public interface Resource extends Adaptable {
* @since 2.1 (Sling API Bundle 2.1.0)
* @see ResourceResolver#getParent(Resource)
*/
- @CheckForNull Resource getParent();
+ @Nullable Resource getParent();
/**
* Returns an iterator of the direct children of this resource.
@@ -105,7 +105,7 @@ public interface Resource extends Adaptable {
* @since 2.1 (Sling API Bundle 2.1.0)
* @see ResourceResolver#listChildren(Resource)
*/
- @Nonnull Iterator<Resource> listChildren();
+ @NotNull Iterator<Resource> listChildren();
/**
* Returns an iterable of the direct children of this resource.
@@ -121,7 +121,7 @@ public interface Resource extends Adaptable {
* @since 2.2 (Sling API Bundle 2.2.0)
* @see ResourceResolver#getChildren(Resource)
*/
- @Nonnull Iterable<Resource> getChildren();
+ @NotNull Iterable<Resource> getChildren();
/**
* Returns the child at the given relative path of this resource or
@@ -139,7 +139,7 @@ public interface Resource extends Adaptable {
* @since 2.1 (Sling API Bundle 2.1.0)
* @see ResourceResolver#getResource(Resource, String)
*/
- @CheckForNull Resource getChild(@Nonnull String relPath);
+ @Nullable Resource getChild(@NotNull String relPath);
/**
* The resource type is meant to point to rendering/processing scripts,
@@ -153,7 +153,7 @@ public interface Resource extends Adaptable {
* existing, this method returns {@link #RESOURCE_TYPE_NON_EXISTING}.
* @return The resource type
*/
- @Nonnull String getResourceType();
+ @NotNull String getResourceType();
/**
* Returns the super type of the resource if the resource defines its
@@ -166,7 +166,7 @@ public interface Resource extends Adaptable {
* @throws IllegalStateException if this resource resolver has already been
* {@link ResourceResolver#close() closed}.
*/
- @CheckForNull String getResourceSuperType();
+ @Nullable String getResourceSuperType();
/**
* Checks if the resource has any child resources.
@@ -200,14 +200,14 @@ public interface Resource extends Adaptable {
* @return The resource meta data
* @see ResourceMetadata
*/
- @Nonnull ResourceMetadata getResourceMetadata();
+ @NotNull ResourceMetadata getResourceMetadata();
/**
* Returns the {@link ResourceResolver} from which this resource has been
* retrieved.
* @return The resource resolver
*/
- @Nonnull ResourceResolver getResourceResolver();
+ @NotNull ResourceResolver getResourceResolver();
/**
* Returns a value map for this resource.
@@ -215,5 +215,5 @@ public interface Resource extends Adaptable {
* @return A value map
* @since 2.5 (Sling API Bundle 2.7.0)
*/
- @Nonnull ValueMap getValueMap();
+ @NotNull ValueMap getValueMap();
}
diff --git a/src/main/java/org/apache/sling/api/resource/ResourceDecorator.java
b/src/main/java/org/apache/sling/api/resource/ResourceDecorator.java
index 57e5130..23095b5 100644
--- a/src/main/java/org/apache/sling/api/resource/ResourceDecorator.java
+++ b/src/main/java/org/apache/sling/api/resource/ResourceDecorator.java
@@ -16,8 +16,8 @@
*/
package org.apache.sling.api.resource;
-import javax.annotation.CheckForNull;
-import javax.annotation.Nonnull;
+import org.jetbrains.annotations.Nullable;
+import org.jetbrains.annotations.NotNull;
import javax.servlet.http.HttpServletRequest;
import org.osgi.annotation.versioning.ConsumerType;
@@ -45,7 +45,7 @@ public interface ResourceDecorator {
* @param resource The resource to decorate
* @return The decorated resource, the original resource or null.
*/
- @CheckForNull Resource decorate(@Nonnull Resource resource);
+ @Nullable Resource decorate(@NotNull Resource resource);
/**
* Decorate a resource.
@@ -61,5 +61,5 @@ public interface ResourceDecorator {
* @deprecated since 2.3.0 (and JCR Resource 2.1.0), this method will not
be invoked.
*/
@Deprecated
- @CheckForNull Resource decorate(@Nonnull Resource resource, @Nonnull
HttpServletRequest request);
+ @Nullable Resource decorate(@NotNull Resource resource, @NotNull
HttpServletRequest request);
}
diff --git a/src/main/java/org/apache/sling/api/resource/ResourceMetadata.java
b/src/main/java/org/apache/sling/api/resource/ResourceMetadata.java
index 039b9cd..479f1ce 100644
--- a/src/main/java/org/apache/sling/api/resource/ResourceMetadata.java
+++ b/src/main/java/org/apache/sling/api/resource/ResourceMetadata.java
@@ -25,8 +25,8 @@ import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Set;
-import javax.annotation.CheckForNull;
-import javax.annotation.Nonnull;
+import org.jetbrains.annotations.Nullable;
+import org.jetbrains.annotations.NotNull;
/**
* The <code>ResourceMetadata</code> interface defines the API for the
@@ -158,7 +158,7 @@ public class ResourceMetadata extends HashMap<String,
Object> {
* returned.
* @return The character encoding
*/
- public @CheckForNull String getCharacterEncoding() {
+ public @Nullable String getCharacterEncoding() {
Object value = get(CHARACTER_ENCODING);
if (value instanceof String) {
return (String) value;
@@ -184,7 +184,7 @@ public class ResourceMetadata extends HashMap<String,
Object> {
* returned.
* @return The content type
*/
- public @CheckForNull String getContentType() {
+ public @Nullable String getContentType() {
Object value = get(CONTENT_TYPE);
if (value instanceof String) {
return (String) value;
@@ -285,7 +285,7 @@ public class ResourceMetadata extends HashMap<String,
Object> {
* returned.
* @return The resolution path
*/
- public @CheckForNull String getResolutionPath() {
+ public @Nullable String getResolutionPath() {
Object value = get(RESOLUTION_PATH);
if (value instanceof String) {
return (String) value;
@@ -311,7 +311,7 @@ public class ResourceMetadata extends HashMap<String,
Object> {
* <code>null</code> is returned.
* @return The resolution path info
*/
- public @CheckForNull String getResolutionPathInfo() {
+ public @Nullable String getResolutionPathInfo() {
Object value = get(RESOLUTION_PATH_INFO);
if (value instanceof String) {
return (String) value;
@@ -342,7 +342,7 @@ public class ResourceMetadata extends HashMap<String,
Object> {
* @return The parameter map
*/
@SuppressWarnings("unchecked")
- public @CheckForNull Map<String, String> getParameterMap() {
+ public @Nullable Map<String, String> getParameterMap() {
Object value = get(PARAMETER_MAP);
if (value instanceof Map) {
return (Map<String, String>) value;
@@ -377,24 +377,24 @@ public class ResourceMetadata extends HashMap<String,
Object> {
}
@Override
- public Object put(@Nonnull final String key, final Object value) {
+ public Object put(@NotNull final String key, final Object value) {
this.checkReadOnly();
return super.put(key, value);
}
@Override
- public void putAll(@Nonnull final Map<? extends String, ? extends Object>
m) {
+ public void putAll(@NotNull final Map<? extends String, ? extends Object>
m) {
this.checkReadOnly();
super.putAll(m);
}
@Override
- public Object remove(@Nonnull final Object key) {
+ public Object remove(@NotNull final Object key) {
this.checkReadOnly();
return super.remove(key);
}
- protected void internalPut(@Nonnull String key, Object value) {
+ protected void internalPut(@NotNull String key, Object value) {
super.put(key, value);
}
@@ -425,19 +425,19 @@ public class ResourceMetadata extends HashMap<String,
Object> {
}
@Override
- public @Nonnull Set<Map.Entry<String, Object>> entrySet() {
+ public @NotNull Set<Map.Entry<String, Object>> entrySet() {
getLockedData();
return lockedEntrySet != null ? lockedEntrySet : super.entrySet();
}
@Override
- public @Nonnull Set<String> keySet() {
+ public @NotNull Set<String> keySet() {
getLockedData();
return lockedKeySet != null ? lockedKeySet : super.keySet();
}
@Override
- public @Nonnull Collection<Object> values() {
+ public @NotNull Collection<Object> values() {
getLockedData();
return lockedValues != null ? lockedValues : super.values();
}
diff --git a/src/main/java/org/apache/sling/api/resource/ResourceProvider.java
b/src/main/java/org/apache/sling/api/resource/ResourceProvider.java
index 1ae45eb..e33cbc8 100644
--- a/src/main/java/org/apache/sling/api/resource/ResourceProvider.java
+++ b/src/main/java/org/apache/sling/api/resource/ResourceProvider.java
@@ -20,8 +20,8 @@ package org.apache.sling.api.resource;
import java.util.Iterator;
-import javax.annotation.CheckForNull;
-import javax.annotation.Nonnull;
+import org.jetbrains.annotations.Nullable;
+import org.jetbrains.annotations.NotNull;
import javax.servlet.http.HttpServletRequest;
import org.osgi.annotation.versioning.ConsumerType;
@@ -116,7 +116,7 @@ public interface ResourceProvider {
* @deprecated since 2.2.0 (and JCR Resource 2.1.0), this method will not
be invoked.
*/
@Deprecated
- @CheckForNull Resource getResource(@Nonnull ResourceResolver
resourceResolver, @Nonnull HttpServletRequest request, @Nonnull String path);
+ @Nullable Resource getResource(@NotNull ResourceResolver resourceResolver,
@NotNull HttpServletRequest request, @NotNull String path);
/**
* Returns a resource from this resource provider or {@code null} if
@@ -137,7 +137,7 @@ public interface ResourceProvider {
* @throws org.apache.sling.api.SlingException
* may be thrown in case of any problem creating the {@code
Resource} instance.
*/
- @CheckForNull Resource getResource(@Nonnull ResourceResolver
resourceResolver, @Nonnull String path);
+ @Nullable Resource getResource(@NotNull ResourceResolver resourceResolver,
@NotNull String path);
/**
* Returns an {@code Iterator} of {@link Resource} objects loaded from
@@ -168,5 +168,5 @@ public interface ResourceProvider {
* @throws org.apache.sling.api.SlingException
* If any error occurs acquiring the child resource iterator.
*/
- @CheckForNull Iterator<Resource> listChildren(@Nonnull Resource parent);
+ @Nullable Iterator<Resource> listChildren(@NotNull Resource parent);
}
diff --git
a/src/main/java/org/apache/sling/api/resource/ResourceProviderFactory.java
b/src/main/java/org/apache/sling/api/resource/ResourceProviderFactory.java
index e3704bb..723489e 100644
--- a/src/main/java/org/apache/sling/api/resource/ResourceProviderFactory.java
+++ b/src/main/java/org/apache/sling/api/resource/ResourceProviderFactory.java
@@ -20,7 +20,7 @@ package org.apache.sling.api.resource;
import java.util.Map;
-import javax.annotation.Nonnull;
+import org.jetbrains.annotations.NotNull;
import org.osgi.annotation.versioning.ConsumerType;
@@ -102,7 +102,7 @@ public interface ResourceProviderFactory {
*
href="http://sling.apache.org/documentation/the-sling-engine/service-authentication.html">Service
* Authentication</a>
*/
- @Nonnull ResourceProvider getResourceProvider(Map<String, Object>
authenticationInfo) throws LoginException;
+ @NotNull ResourceProvider getResourceProvider(Map<String, Object>
authenticationInfo) throws LoginException;
/**
* Returns a new {@link ResourceProvider} instance with administrative
@@ -135,5 +135,5 @@ public interface ResourceProviderFactory {
* {@link ResourceResolverFactory#SUBSERVICE} properties.
*/
@Deprecated
- @Nonnull ResourceProvider getAdministrativeResourceProvider(Map<String,
Object> authenticationInfo) throws LoginException;
+ @NotNull ResourceProvider getAdministrativeResourceProvider(Map<String,
Object> authenticationInfo) throws LoginException;
}
diff --git a/src/main/java/org/apache/sling/api/resource/ResourceResolver.java
b/src/main/java/org/apache/sling/api/resource/ResourceResolver.java
index 36da95d..2899ea0 100644
--- a/src/main/java/org/apache/sling/api/resource/ResourceResolver.java
+++ b/src/main/java/org/apache/sling/api/resource/ResourceResolver.java
@@ -22,8 +22,8 @@ import java.io.Closeable;
import java.util.Iterator;
import java.util.Map;
-import javax.annotation.CheckForNull;
-import javax.annotation.Nonnull;
+import org.jetbrains.annotations.Nullable;
+import org.jetbrains.annotations.NotNull;
import javax.servlet.http.HttpServletRequest;
import org.apache.sling.api.adapter.Adaptable;
@@ -198,7 +198,7 @@ public interface ResourceResolver extends Adaptable,
Closeable {
* {@link #close() closed}.
* @since 2.0.4 (Sling API Bundle 2.0.4)
*/
- @Nonnull Resource resolve(@Nonnull HttpServletRequest request, @Nonnull
String absPath);
+ @NotNull Resource resolve(@NotNull HttpServletRequest request, @NotNull
String absPath);
/**
* Resolves the resource from the given absolute path. Returns a
@@ -226,7 +226,7 @@ public interface ResourceResolver extends Adaptable,
Closeable {
* @throws IllegalStateException if this resource resolver has already been
* {@link #close() closed}.
*/
- @Nonnull Resource resolve(@Nonnull String absPath);
+ @NotNull Resource resolve(@NotNull String absPath);
/**
* Resolves the resource from the given <code>HttpServletRequest</code>.
@@ -254,7 +254,7 @@ public interface ResourceResolver extends Adaptable,
Closeable {
* instead.
*/
@Deprecated
- @Nonnull Resource resolve(@Nonnull HttpServletRequest request);
+ @NotNull Resource resolve(@NotNull HttpServletRequest request);
/**
* Returns a path mapped from the (resource) path applying the reverse
@@ -277,7 +277,7 @@ public interface ResourceResolver extends Adaptable,
Closeable {
* @throws IllegalStateException if this resource resolver has already been
* {@link #close() closed}.
*/
- @Nonnull String map(@Nonnull String resourcePath);
+ @NotNull String map(@NotNull String resourcePath);
/**
* Returns an URL mapped from the (resource) path applying the reverse
@@ -306,7 +306,7 @@ public interface ResourceResolver extends Adaptable,
Closeable {
* {@link #close() closed}.
* @since 2.0.4 (Sling API Bundle 2.0.4)
*/
- @CheckForNull String map(@Nonnull HttpServletRequest request, @Nonnull
String resourcePath);
+ @Nullable String map(@NotNull HttpServletRequest request, @NotNull String
resourcePath);
/**
* Returns a {@link Resource} object for data located at the given path.
@@ -333,7 +333,7 @@ public interface ResourceResolver extends Adaptable,
Closeable {
* @throws IllegalStateException if this resource resolver has already been
* {@link #close() closed}.
*/
- @CheckForNull Resource getResource(@Nonnull String path);
+ @Nullable Resource getResource(@NotNull String path);
/**
* Returns a {@link Resource} object for data located at the given path.
@@ -363,7 +363,7 @@ public interface ResourceResolver extends Adaptable,
Closeable {
* @throws IllegalStateException if this resource resolver has already been
* {@link #close() closed}.
*/
- @CheckForNull Resource getResource(Resource base, @Nonnull String path);
+ @Nullable Resource getResource(Resource base, @NotNull String path);
/**
* Returns the search path used by the {@link #getResource(String)} method
@@ -387,7 +387,7 @@ public interface ResourceResolver extends Adaptable,
Closeable {
* @throws IllegalStateException if this resource resolver has already been
* {@link #close() closed}.
*/
- @Nonnull String[] getSearchPath();
+ @NotNull String[] getSearchPath();
/**
* Returns an <code>Iterator</code> of {@link Resource} objects loaded from
@@ -407,7 +407,7 @@ public interface ResourceResolver extends Adaptable,
Closeable {
* @throws IllegalStateException if this resource resolver has already been
* {@link #close() closed}.
*/
- @Nonnull Iterator<Resource> listChildren(@Nonnull Resource parent);
+ @NotNull Iterator<Resource> listChildren(@NotNull Resource parent);
/**
* Returns the parent resource of this resource.
@@ -425,7 +425,7 @@ public interface ResourceResolver extends Adaptable,
Closeable {
* {@link #close() closed}.
* @since 2.9 (Sling API Bundle 2.11.0)
*/
- @CheckForNull Resource getParent(@Nonnull Resource child);
+ @Nullable Resource getParent(@NotNull Resource child);
/**
* Returns an <code>Iterable</code> of {@link Resource} objects loaded from
@@ -446,7 +446,7 @@ public interface ResourceResolver extends Adaptable,
Closeable {
* {@link #close() closed}.
* @since 2.2 (Sling API Bundle 2.2.0)
*/
- @Nonnull Iterable<Resource> getChildren(@Nonnull Resource parent);
+ @NotNull Iterable<Resource> getChildren(@NotNull Resource parent);
/**
* Searches for resources using the given query formulated in the given
@@ -473,7 +473,7 @@ public interface ResourceResolver extends Adaptable,
Closeable {
* @throws IllegalStateException if this resource resolver has already been
* {@link #close() closed}.
*/
- @Nonnull Iterator<Resource> findResources(@Nonnull String query, String
language);
+ @NotNull Iterator<Resource> findResources(@NotNull String query, String
language);
/**
* Queries the storage using the given query formulated in the given
@@ -503,7 +503,7 @@ public interface ResourceResolver extends Adaptable,
Closeable {
* @throws IllegalStateException if this resource resolver has already been
* {@link #close() closed}.
*/
- @Nonnull Iterator<Map<String, Object>> queryResources(@Nonnull String
query, String language);
+ @NotNull Iterator<Map<String, Object>> queryResources(@NotNull String
query, String language);
/**
* Checks if the specified resource has any direct child resources.
@@ -515,7 +515,7 @@ public interface ResourceResolver extends Adaptable,
Closeable {
* {@link #close() closed}.
* @since 2.4.4 (Sling API Bundle 2.5.0)
*/
- boolean hasChildren(@Nonnull Resource resource);
+ boolean hasChildren(@NotNull Resource resource);
/**
* Returns a new <code>ResourceResolver</code> instance based on the given
@@ -545,7 +545,7 @@ public interface ResourceResolver extends Adaptable,
Closeable {
* {@link #close() closed}.
* @since 2.1 (Sling API Bundle 2.1.0)
*/
- @Nonnull ResourceResolver clone(Map<String, Object> authenticationInfo)
+ @NotNull ResourceResolver clone(Map<String, Object> authenticationInfo)
throws LoginException;
/**
@@ -591,7 +591,7 @@ public interface ResourceResolver extends Adaptable,
Closeable {
* {@link #close() closed}.
* @since 2.1 (Sling API Bundle 2.1.0)
*/
- @CheckForNull String getUserID();
+ @Nullable String getUserID();
/**
* Returns an iterator of attribute names whose value can be retrieved
@@ -602,7 +602,7 @@ public interface ResourceResolver extends Adaptable,
Closeable {
* @throws IllegalStateException if this resource resolver has already been
* {@link #close() closed}.
*/
- @Nonnull Iterator<String> getAttributeNames();
+ @NotNull Iterator<String> getAttributeNames();
/**
* Returns the value of the given resource resolver attribute or
@@ -617,7 +617,7 @@ public interface ResourceResolver extends Adaptable,
Closeable {
* @throws IllegalStateException if this resource resolver has already been
* {@link #close() closed}.
*/
- @CheckForNull Object getAttribute(@Nonnull String name);
+ @Nullable Object getAttribute(@NotNull String name);
/**
* Delete the resource
@@ -636,7 +636,7 @@ public interface ResourceResolver extends Adaptable,
Closeable {
* {@link #close() closed}.
* @since 2.2 (Sling API Bundle 2.2.0)
*/
- void delete(@Nonnull Resource resource)
+ void delete(@NotNull Resource resource)
throws PersistenceException;
/**
@@ -657,7 +657,7 @@ public interface ResourceResolver extends Adaptable,
Closeable {
* {@link #close() closed}.
* @since 2.2 (Sling API Bundle 2.2.0)
*/
- @Nonnull Resource create(@Nonnull Resource parent, @Nonnull String name,
Map<String, Object> properties)
+ @NotNull Resource create(@NotNull Resource parent, @NotNull String name,
Map<String, Object> properties)
throws PersistenceException;
/**
@@ -702,7 +702,7 @@ public interface ResourceResolver extends Adaptable,
Closeable {
* {@link #close() closed}.
* @since 2.3 (Sling API Bundle 2.4.0)
*/
- @CheckForNull String getParentResourceType(final Resource resource);
+ @Nullable String getParentResourceType(final Resource resource);
/**
* Returns the super type of the given resource type. This method converts
@@ -720,7 +720,7 @@ public interface ResourceResolver extends Adaptable,
Closeable {
* {@link #close() closed}.
* @since 2.3 (Sling API Bundle 2.4.0)
*/
- public @CheckForNull String getParentResourceType(final String
resourceType);
+ public @Nullable String getParentResourceType(final String resourceType);
/**
* Returns <code>true</code> if the resource type or any of the resource's
diff --git
a/src/main/java/org/apache/sling/api/resource/ResourceResolverFactory.java
b/src/main/java/org/apache/sling/api/resource/ResourceResolverFactory.java
index ee26de4..111c34c 100644
--- a/src/main/java/org/apache/sling/api/resource/ResourceResolverFactory.java
+++ b/src/main/java/org/apache/sling/api/resource/ResourceResolverFactory.java
@@ -21,8 +21,8 @@ package org.apache.sling.api.resource;
import java.util.List;
import java.util.Map;
-import javax.annotation.CheckForNull;
-import javax.annotation.Nonnull;
+import org.jetbrains.annotations.Nullable;
+import org.jetbrains.annotations.NotNull;
import org.osgi.annotation.versioning.ProviderType;
@@ -121,7 +121,7 @@ public interface ResourceResolverFactory {
* <code>ResourceResolver</code> with the provided credential
* data.
*/
- @Nonnull ResourceResolver getResourceResolver(Map<String, Object>
authenticationInfo) throws LoginException;
+ @NotNull ResourceResolver getResourceResolver(Map<String, Object>
authenticationInfo) throws LoginException;
/**
* Returns a new {@link ResourceResolver} instance with administrative
@@ -158,7 +158,7 @@ public interface ResourceResolverFactory {
* the {@link #getServiceResourceResolver(Map)} instead.
*/
@Deprecated
- @Nonnull ResourceResolver getAdministrativeResourceResolver(Map<String,
Object> authenticationInfo) throws LoginException;
+ @NotNull ResourceResolver getAdministrativeResourceResolver(Map<String,
Object> authenticationInfo) throws LoginException;
/**
* Returns a new {@link ResourceResolver} instance with privileges assigned
@@ -187,7 +187,7 @@ public interface ResourceResolverFactory {
*
href="http://sling.apache.org/documentation/the-sling-engine/service-authentication.html">Service
* Authentication</a>
*/
- @Nonnull ResourceResolver getServiceResourceResolver(Map<String, Object>
authenticationInfo) throws LoginException;
+ @NotNull ResourceResolver getServiceResourceResolver(Map<String, Object>
authenticationInfo) throws LoginException;
/**
* Returns the {@link ResourceResolver} for the current thread.
@@ -204,7 +204,7 @@ public interface ResourceResolverFactory {
*
* @since 2.6 (Sling API Bundle 2.8.0)
*/
- @CheckForNull ResourceResolver getThreadResourceResolver();
+ @Nullable ResourceResolver getThreadResourceResolver();
/**
* Returns the search path used by the resource resolvers to search for
@@ -219,5 +219,5 @@ public interface ResourceResolverFactory {
* @return An immutable list containing the search path
* @since 2.11 (Sling API Bundle 2.18.0)
*/
- @Nonnull List<String> getSearchPath();
+ @NotNull List<String> getSearchPath();
}
diff --git a/src/main/java/org/apache/sling/api/resource/ResourceUtil.java
b/src/main/java/org/apache/sling/api/resource/ResourceUtil.java
index 315355e..c1a0738 100644
--- a/src/main/java/org/apache/sling/api/resource/ResourceUtil.java
+++ b/src/main/java/org/apache/sling/api/resource/ResourceUtil.java
@@ -25,8 +25,8 @@ import java.util.Iterator;
import java.util.Map;
import java.util.NoSuchElementException;
-import javax.annotation.CheckForNull;
-import javax.annotation.Nonnull;
+import org.jetbrains.annotations.Nullable;
+import org.jetbrains.annotations.NotNull;
import org.apache.sling.api.wrappers.ValueMapDecorator;
@@ -47,7 +47,7 @@ public class ResourceUtil {
* @param path The path to normalize
* @return The normalized path or {@code null}.
*/
- public static @CheckForNull String normalize(@Nonnull String path) {
+ public static @Nullable String normalize(@NotNull String path) {
// don't care for empty paths
if (path.length() == 0) {
@@ -146,7 +146,7 @@ public class ResourceUtil {
* {@link #normalize(String)} method.
* @throws NullPointerException If <code>path</code> is <code>null</code>.
*/
- public static @CheckForNull String getParent(@Nonnull String path) {
+ public static @Nullable String getParent(@NotNull String path) {
if ("/".equals(path)) {
return null;
}
@@ -234,7 +234,7 @@ public class ResourceUtil {
* @deprecated since 2.1.0, use {@link Resource#getParent()} instead
*/
@Deprecated
- public static @CheckForNull Resource getParent(@Nonnull Resource rsrc) {
+ public static @Nullable Resource getParent(@NotNull Resource rsrc) {
return rsrc.getParent();
}
@@ -247,7 +247,7 @@ public class ResourceUtil {
* @deprecated since 2.1.0, use {@link Resource#getName()} instead
*/
@Deprecated
- public static @Nonnull String getName(@Nonnull Resource rsrc) {
+ public static @NotNull String getName(@NotNull Resource rsrc) {
/*
* Same as AbstractResource.getName() implementation to prevent
problems
* if there are implementations of the pre-2.1.0 Resource interface in
@@ -269,7 +269,7 @@ public class ResourceUtil {
* {@link #normalize(String)} method.
* @throws NullPointerException If <code>path</code> is <code>null</code>.
*/
- public static @Nonnull String getName(@Nonnull String path) {
+ public static @NotNull String getName(@NotNull String path) {
if ("/".equals(path)) {
return "";
}
@@ -298,7 +298,7 @@ public class ResourceUtil {
* <code>null</code> or not an instance of the
* <code>org.apache.sling.resource.SyntheticResource</code> class.
*/
- public static boolean isSyntheticResource(@Nonnull Resource res) {
+ public static boolean isSyntheticResource(@NotNull Resource res) {
if (res instanceof SyntheticResource) {
return true;
}
@@ -332,7 +332,7 @@ public class ResourceUtil {
* resource.
* @throws NullPointerException if <code>res</code> is <code>null</code>.
*/
- public static boolean isStarResource(@Nonnull Resource res) {
+ public static boolean isStarResource(@NotNull Resource res) {
return res.getPath().endsWith("/*");
}
@@ -350,7 +350,7 @@ public class ResourceUtil {
* non-existing resource.
* @throws NullPointerException if <code>res</code> is <code>null</code>.
*/
- public static boolean isNonExistingResource(@Nonnull Resource res) {
+ public static boolean isNonExistingResource(@NotNull Resource res) {
return
Resource.RESOURCE_TYPE_NON_EXISTING.equals(res.getResourceType());
}
@@ -372,7 +372,7 @@ public class ResourceUtil {
* @deprecated since 2.1.0, use {@link Resource#listChildren()} instead
*/
@Deprecated
- public static @Nonnull Iterator<Resource> listChildren(@Nonnull Resource
parent) {
+ public static @NotNull Iterator<Resource> listChildren(@NotNull Resource
parent) {
return parent.listChildren();
}
@@ -387,7 +387,7 @@ public class ResourceUtil {
* @param res The <code>Resource</code> to adapt to the value map.
* @return A value map.
*/
- public static @Nonnull ValueMap getValueMap(final Resource res) {
+ public static @NotNull ValueMap getValueMap(final Resource res) {
if ( res == null ) {
// use empty map
return new ValueMapDecorator(new HashMap<String, Object>());
@@ -404,7 +404,7 @@ public class ResourceUtil {
* @return The resource type as a path.
* @since 2.0.6 (Sling API Bundle 2.0.6)
*/
- public static @Nonnull String resourceTypeToPath(@Nonnull final String
type) {
+ public static @NotNull String resourceTypeToPath(@NotNull final String
type) {
return type.replace(':', '/');
}
@@ -432,8 +432,8 @@ public class ResourceUtil {
* @deprecated Use {@link ResourceResolver#getParentResourceType(String)}
*/
@Deprecated
- public static @CheckForNull String getResourceSuperType(
- final @Nonnull ResourceResolver resourceResolver, final String
resourceType) {
+ public static @Nullable String getResourceSuperType(
+ final @NotNull ResourceResolver resourceResolver, final String
resourceType) {
return resourceResolver.getParentResourceType(resourceType);
}
@@ -453,7 +453,7 @@ public class ResourceUtil {
* @deprecated Use {@link ResourceResolver#getParentResourceType(Resource)}
*/
@Deprecated
- public static @CheckForNull String findResourceSuperType(@Nonnull final
Resource resource) {
+ public static @Nullable String findResourceSuperType(@NotNull final
Resource resource) {
if ( resource == null ) {
return null;
}
@@ -481,7 +481,7 @@ public class ResourceUtil {
* @deprecated Use {@link ResourceResolver#isResourceType(Resource,
String)}
*/
@Deprecated
- public static boolean isA(@Nonnull final Resource resource, final String
resourceType) {
+ public static boolean isA(@NotNull final Resource resource, final String
resourceType) {
if ( resource == null ) {
return false;
}
@@ -502,7 +502,7 @@ public class ResourceUtil {
* @return An iterator of the adapted objects
* @since 2.0.6 (Sling API Bundle 2.0.6)
*/
- public static @Nonnull <T> Iterator<T> adaptTo(final @Nonnull
Iterator<Resource> iterator,
+ public static @NotNull <T> Iterator<T> adaptTo(final @NotNull
Iterator<Resource> iterator,
final Class<T> type) {
return new Iterator<T>() {
@@ -555,9 +555,9 @@ public class ResourceUtil {
* @throws PersistenceException If a persistence error occurs.
* @since 2.3.0 (Sling API Bundle 2.4.0)
*/
- public static @Nonnull Resource getOrCreateResource(
- final @Nonnull ResourceResolver resolver,
- final @Nonnull String path,
+ public static @NotNull Resource getOrCreateResource(
+ final @NotNull ResourceResolver resolver,
+ final @NotNull String path,
final String resourceType,
final String intermediateResourceType,
final boolean autoCommit)
@@ -590,9 +590,9 @@ public class ResourceUtil {
* @throws PersistenceException If a persistence error occurs.
* @since 2.3.0 (Sling API Bundle 2.4.0)
*/
- public static @Nonnull Resource getOrCreateResource(
- final @Nonnull ResourceResolver resolver,
- final @Nonnull String path,
+ public static @NotNull Resource getOrCreateResource(
+ final @NotNull ResourceResolver resolver,
+ final @NotNull String path,
final Map<String, Object> resourceProperties,
final String intermediateResourceType,
final boolean autoCommit)
@@ -748,7 +748,7 @@ public class ResourceUtil {
* @return The unwrapped resource
* @since 2.5 (Sling API Bundle 2.7.0)
*/
- public static @Nonnull Resource unwrap(final @Nonnull Resource rsrc) {
+ public static @NotNull Resource unwrap(final @NotNull Resource rsrc) {
Resource result = rsrc;
while ( result instanceof ResourceWrapper ) {
result = ((ResourceWrapper)result).getResource();
@@ -774,7 +774,7 @@ public class ResourceUtil {
this.max = (batchSize < 1 ? 50 : batchSize);
}
- public void delete(@Nonnull final Resource rsrc)
+ public void delete(@NotNull final Resource rsrc)
throws PersistenceException {
final ResourceResolver resolver = rsrc.getResourceResolver();
for(final Resource child : rsrc.getChildren()) {
@@ -801,7 +801,7 @@ public class ResourceUtil {
* @return A new batch resource remover.
* Since 2.6
*/
- public static @Nonnull BatchResourceRemover getBatchResourceRemover(final
int threshold) {
+ public static @NotNull BatchResourceRemover getBatchResourceRemover(final
int threshold) {
return new BatchResourceRemover(threshold);
}
}
diff --git a/src/main/java/org/apache/sling/api/resource/ResourceWrapper.java
b/src/main/java/org/apache/sling/api/resource/ResourceWrapper.java
index 1869a9d..27b4ce4 100644
--- a/src/main/java/org/apache/sling/api/resource/ResourceWrapper.java
+++ b/src/main/java/org/apache/sling/api/resource/ResourceWrapper.java
@@ -20,7 +20,7 @@ package org.apache.sling.api.resource;
import java.util.Iterator;
-import javax.annotation.Nonnull;
+import org.jetbrains.annotations.NotNull;
/**
* The <code>ResourceWrapper</code> is a wrapper for any <code>Resource</code>
@@ -38,7 +38,7 @@ public class ResourceWrapper implements Resource {
* <code>resource</code>.
* @param resource The resource to wrap
*/
- public ResourceWrapper(@Nonnull final Resource resource) {
+ public ResourceWrapper(@NotNull final Resource resource) {
this.resource = resource;
}
diff --git a/src/main/java/org/apache/sling/api/resource/SyntheticResource.java
b/src/main/java/org/apache/sling/api/resource/SyntheticResource.java
index fc9b59b..67f4d7c 100644
--- a/src/main/java/org/apache/sling/api/resource/SyntheticResource.java
+++ b/src/main/java/org/apache/sling/api/resource/SyntheticResource.java
@@ -18,7 +18,7 @@
*/
package org.apache.sling.api.resource;
-import javax.annotation.Nonnull;
+import org.jetbrains.annotations.NotNull;
/**
* The <code>SyntheticResource</code> class is a simple implementation of the
@@ -74,7 +74,7 @@ public class SyntheticResource extends AbstractResource {
* @see org.apache.sling.api.resource.Resource#getPath()
*/
@Override
- public @Nonnull String getPath() {
+ public @NotNull String getPath() {
return path;
}
@@ -82,7 +82,7 @@ public class SyntheticResource extends AbstractResource {
* @see org.apache.sling.api.resource.Resource#getResourceType()
*/
@Override
- public @Nonnull String getResourceType() {
+ public @NotNull String getResourceType() {
return resourceType;
}
@@ -99,7 +99,7 @@ public class SyntheticResource extends AbstractResource {
* resource as the {@link ResourceMetadata#RESOLUTION_PATH} property.
*/
@Override
- public @Nonnull ResourceMetadata getResourceMetadata() {
+ public @NotNull ResourceMetadata getResourceMetadata() {
return resourceMetadata;
}
@@ -108,7 +108,7 @@ public class SyntheticResource extends AbstractResource {
* is related or <code>null</code> if none.
*/
@Override
- public @Nonnull ResourceResolver getResourceResolver() {
+ public @NotNull ResourceResolver getResourceResolver() {
return resourceResolver;
}
diff --git a/src/main/java/org/apache/sling/api/resource/ValueMap.java
b/src/main/java/org/apache/sling/api/resource/ValueMap.java
index 5c5f2de..17bbaa3 100644
--- a/src/main/java/org/apache/sling/api/resource/ValueMap.java
+++ b/src/main/java/org/apache/sling/api/resource/ValueMap.java
@@ -21,8 +21,8 @@ package org.apache.sling.api.resource;
import java.util.Collections;
import java.util.Map;
-import javax.annotation.CheckForNull;
-import javax.annotation.Nonnull;
+import org.jetbrains.annotations.Nullable;
+import org.jetbrains.annotations.NotNull;
import org.apache.sling.api.wrappers.ValueMapDecorator;
@@ -65,7 +65,7 @@ public interface ValueMap extends Map<String, Object> {
* @return Return named value converted to type T or <code>null</code> if
* non existing or can't be converted.
*/
- @CheckForNull <T> T get(@Nonnull String name, @Nonnull Class<T> type);
+ @Nullable <T> T get(@NotNull String name, @NotNull Class<T> type);
/**
* Get a named property and convert it into the given type.
@@ -87,5 +87,5 @@ public interface ValueMap extends Map<String, Object> {
* @return Return named value converted to type T or the default value if
* non existing or can't be converted.
*/
- @Nonnull <T> T get(@Nonnull String name, @Nonnull T defaultValue);
+ @NotNull <T> T get(@NotNull String name, @NotNull T defaultValue);
}
diff --git
a/src/main/java/org/apache/sling/api/resource/observation/ResourceChange.java
b/src/main/java/org/apache/sling/api/resource/observation/ResourceChange.java
index f05d47e..da07a80 100644
---
a/src/main/java/org/apache/sling/api/resource/observation/ResourceChange.java
+++
b/src/main/java/org/apache/sling/api/resource/observation/ResourceChange.java
@@ -20,8 +20,8 @@ package org.apache.sling.api.resource.observation;
import java.util.Set;
-import javax.annotation.CheckForNull;
-import javax.annotation.Nonnull;
+import org.jetbrains.annotations.Nullable;
+import org.jetbrains.annotations.NotNull;
import org.osgi.annotation.versioning.ConsumerType;
@@ -86,8 +86,8 @@ public class ResourceChange {
* @param isExternal {code true} if the change happened on another node
* @since 1.2.0 (Sling API Bundle 2.15.0)
*/
- public ResourceChange(final @Nonnull ChangeType changeType,
- final @Nonnull String path,
+ public ResourceChange(final @NotNull ChangeType changeType,
+ final @NotNull String path,
final boolean isExternal) {
this.path = path;
this.changeType = changeType;
@@ -109,8 +109,8 @@ public class ResourceChange {
* @deprecated The sets of property names are not supported anymore.
*/
@Deprecated
- public ResourceChange(final @Nonnull ChangeType changeType,
- final @Nonnull String path,
+ public ResourceChange(final @NotNull ChangeType changeType,
+ final @NotNull String path,
final boolean isExternal,
final Set<String> addedPropertyNames,
final Set<String> changedPropertyNames,
@@ -127,7 +127,7 @@ public class ResourceChange {
* Get the resource path.
* @return The path to the resource.
*/
- public @Nonnull String getPath() {
+ public @NotNull String getPath() {
return this.path;
}
@@ -135,7 +135,7 @@ public class ResourceChange {
* Get the user id of the user initiating the change
* @return The user id or {@code null} if it's not available.
*/
- public @CheckForNull String getUserId() {
+ public @Nullable String getUserId() {
return null;
}
@@ -151,7 +151,7 @@ public class ResourceChange {
* Get the type of change
* @return The type of change
*/
- public @Nonnull ChangeType getType() {
+ public @NotNull ChangeType getType() {
return this.changeType;
}
@@ -169,7 +169,7 @@ public class ResourceChange {
* event, this should not be used anymore.
*/
@Deprecated
- public @CheckForNull Set<String> getChangedPropertyNames() {
+ public @Nullable Set<String> getChangedPropertyNames() {
return this.changedPropertyNames;
}
@@ -187,7 +187,7 @@ public class ResourceChange {
* event, this should not be used anymore.
*/
@Deprecated
- public @CheckForNull Set<String> getAddedPropertyNames() {
+ public @Nullable Set<String> getAddedPropertyNames() {
return this.addedPropertyNames;
}
@@ -205,7 +205,7 @@ public class ResourceChange {
* event, this should not be used anymore.
*/
@Deprecated
- public @CheckForNull Set<String> getRemovedPropertyNames() {
+ public @Nullable Set<String> getRemovedPropertyNames() {
return this.removedPropertyNames;
}
diff --git
a/src/main/java/org/apache/sling/api/resource/observation/ResourceChangeListener.java
b/src/main/java/org/apache/sling/api/resource/observation/ResourceChangeListener.java
index 5292247..0d9a184 100644
---
a/src/main/java/org/apache/sling/api/resource/observation/ResourceChangeListener.java
+++
b/src/main/java/org/apache/sling/api/resource/observation/ResourceChangeListener.java
@@ -20,7 +20,7 @@ package org.apache.sling.api.resource.observation;
import java.util.List;
-import javax.annotation.Nonnull;
+import org.jetbrains.annotations.NotNull;
import org.osgi.annotation.versioning.ConsumerType;
@@ -119,5 +119,5 @@ public interface ResourceChangeListener {
*
* @param changes The changes list. This list is immutable.
*/
- void onChange(@Nonnull List<ResourceChange> changes);
+ void onChange(@NotNull List<ResourceChange> changes);
}
diff --git
a/src/main/java/org/apache/sling/api/resource/observation/package-info.java
b/src/main/java/org/apache/sling/api/resource/observation/package-info.java
index a35c5c5..4eb0cdb 100644
--- a/src/main/java/org/apache/sling/api/resource/observation/package-info.java
+++ b/src/main/java/org/apache/sling/api/resource/observation/package-info.java
@@ -17,7 +17,7 @@
* under the License.
*/
-@Version("1.2.0")
+@Version("1.2.1")
package org.apache.sling.api.resource.observation;
import org.osgi.annotation.versioning.Version;
diff --git a/src/main/java/org/apache/sling/api/resource/package-info.java
b/src/main/java/org/apache/sling/api/resource/package-info.java
index 1ac279f..a6c739d 100644
--- a/src/main/java/org/apache/sling/api/resource/package-info.java
+++ b/src/main/java/org/apache/sling/api/resource/package-info.java
@@ -17,7 +17,7 @@
* under the License.
*/
-@Version("2.11")
+@Version("2.11.1")
package org.apache.sling.api.resource;
import org.osgi.annotation.versioning.Version;
diff --git a/src/main/java/org/apache/sling/api/resource/path/Path.java
b/src/main/java/org/apache/sling/api/resource/path/Path.java
index cef03e5..fc12efb 100644
--- a/src/main/java/org/apache/sling/api/resource/path/Path.java
+++ b/src/main/java/org/apache/sling/api/resource/path/Path.java
@@ -20,7 +20,7 @@ package org.apache.sling.api.resource.path;
import java.util.regex.Pattern;
-import javax.annotation.Nonnull;
+import org.jetbrains.annotations.NotNull;
/**
* Simple helper class for path matching.
@@ -54,7 +54,7 @@ public class Path implements Comparable<Path> {
* @throws NullPointerException If {@code otherPath} is {@code null}
* @throws IllegalArgumentException If the provided path is not absolute,
or if the glob pattern does not start with a slash.
*/
- public Path(@Nonnull final String path) {
+ public Path(@NotNull final String path) {
if ( path.equals("/") ) {
this.path = "/";
} else if ( path.endsWith("/") ) {
@@ -179,7 +179,7 @@ public class Path implements Comparable<Path> {
}
@Override
- public int compareTo(@Nonnull final Path o) {
+ public int compareTo(@NotNull final Path o) {
return this.getPath().compareTo(o.getPath());
}
diff --git a/src/main/java/org/apache/sling/api/resource/path/package-info.java
b/src/main/java/org/apache/sling/api/resource/path/package-info.java
index d5761a9..1c24194 100644
--- a/src/main/java/org/apache/sling/api/resource/path/package-info.java
+++ b/src/main/java/org/apache/sling/api/resource/path/package-info.java
@@ -17,7 +17,7 @@
* under the License.
*/
-@Version("1.2.0")
+@Version("1.2.1")
package org.apache.sling.api.resource.path;
import org.osgi.annotation.versioning.Version;
diff --git a/src/main/java/org/apache/sling/api/scripting/SlingBindings.java
b/src/main/java/org/apache/sling/api/scripting/SlingBindings.java
index b98a119..4212390 100644
--- a/src/main/java/org/apache/sling/api/scripting/SlingBindings.java
+++ b/src/main/java/org/apache/sling/api/scripting/SlingBindings.java
@@ -22,7 +22,7 @@ import java.io.PrintWriter;
import java.io.Reader;
import java.util.HashMap;
-import javax.annotation.CheckForNull;
+import org.jetbrains.annotations.Nullable;
import org.apache.sling.api.SlingHttpServletRequest;
import org.apache.sling.api.SlingHttpServletResponse;
@@ -225,7 +225,7 @@ public class SlingBindings extends HashMap<String, Object> {
* is returned.
* @return The logger or {@code null}
*/
- public @CheckForNull Logger getLog() {
+ public @Nullable Logger getLog() {
return this.get(LOG, Logger.class);
}
@@ -244,7 +244,7 @@ public class SlingBindings extends HashMap<String, Object> {
* returned.
* @return The print writer or {@code null}
*/
- public @CheckForNull PrintWriter getOut() {
+ public @Nullable PrintWriter getOut() {
return this.get(OUT, PrintWriter.class);
}
@@ -263,7 +263,7 @@ public class SlingBindings extends HashMap<String, Object> {
* <code>null</code> is returned.
* @return The request object or {@code null}
*/
- public @CheckForNull SlingHttpServletRequest getRequest() {
+ public @Nullable SlingHttpServletRequest getRequest() {
return this.get(REQUEST, SlingHttpServletRequest.class);
}
@@ -282,7 +282,7 @@ public class SlingBindings extends HashMap<String, Object> {
* returned.
* @return The reader or {@code null}.
*/
- public @CheckForNull Reader getReader() {
+ public @Nullable Reader getReader() {
return this.get(READER, Reader.class);
}
@@ -301,7 +301,7 @@ public class SlingBindings extends HashMap<String, Object> {
* returned.
* @return The resource or {@code null}.
*/
- public @CheckForNull Resource getResource() {
+ public @Nullable Resource getResource() {
return this.get(RESOURCE, Resource.class);
}
@@ -319,7 +319,7 @@ public class SlingBindings extends HashMap<String, Object> {
* returned.
* @return the bound {@link ResourceResolver} if one exists,
<code>null</code> otherwise
*/
- public @CheckForNull ResourceResolver getResourceResolver() {
+ public @Nullable ResourceResolver getResourceResolver() {
return this.get(RESOLVER, ResourceResolver.class);
}
@@ -338,7 +338,7 @@ public class SlingBindings extends HashMap<String, Object> {
* <code>null</code> is returned.
* @return The response or {@code null}.
*/
- public @CheckForNull SlingHttpServletResponse getResponse() {
+ public @Nullable SlingHttpServletResponse getResponse() {
return this.get(RESPONSE, SlingHttpServletResponse.class);
}
@@ -357,7 +357,7 @@ public class SlingBindings extends HashMap<String, Object> {
* is returned.
* @return The script helper or {@code null}.
*/
- public @CheckForNull SlingScriptHelper getSling() {
+ public @Nullable SlingScriptHelper getSling() {
return this.get(SLING, SlingScriptHelper.class);
}
}
diff --git a/src/main/java/org/apache/sling/api/scripting/SlingScript.java
b/src/main/java/org/apache/sling/api/scripting/SlingScript.java
index 18216aa..08a7041 100644
--- a/src/main/java/org/apache/sling/api/scripting/SlingScript.java
+++ b/src/main/java/org/apache/sling/api/scripting/SlingScript.java
@@ -18,7 +18,7 @@
*/
package org.apache.sling.api.scripting;
-import javax.annotation.Nonnull;
+import org.jetbrains.annotations.NotNull;
import org.apache.sling.api.resource.Resource;
@@ -42,7 +42,7 @@ public interface SlingScript {
* Returns the Resource providing the script source code.
* @return The script resource.
*/
- @Nonnull Resource getScriptResource();
+ @NotNull Resource getScriptResource();
/**
* Evaluates this script using the bound variables as global variables to
@@ -57,7 +57,7 @@ public interface SlingScript {
* script or preparing the script execution. The cause of the
* evaluation exception is available as the exception cause.
*/
- Object eval(@Nonnull SlingBindings props);
+ Object eval(@NotNull SlingBindings props);
/**
* Evaluates this script using the bound variables as global variables to
@@ -74,5 +74,5 @@ public interface SlingScript {
* script or preparing the script execution. The cause of the
* evaluation exception is available as the exception cause.
*/
- Object call(@Nonnull SlingBindings props, @Nonnull String method,
Object... args);
+ Object call(@NotNull SlingBindings props, @NotNull String method,
Object... args);
}
diff --git
a/src/main/java/org/apache/sling/api/scripting/SlingScriptHelper.java
b/src/main/java/org/apache/sling/api/scripting/SlingScriptHelper.java
index ba14c45..98b1ef7 100644
--- a/src/main/java/org/apache/sling/api/scripting/SlingScriptHelper.java
+++ b/src/main/java/org/apache/sling/api/scripting/SlingScriptHelper.java
@@ -18,8 +18,8 @@
*/
package org.apache.sling.api.scripting;
-import javax.annotation.CheckForNull;
-import javax.annotation.Nonnull;
+import org.jetbrains.annotations.Nullable;
+import org.jetbrains.annotations.NotNull;
import org.apache.sling.api.SlingHttpServletRequest;
import org.apache.sling.api.SlingHttpServletResponse;
@@ -41,20 +41,20 @@ public interface SlingScriptHelper {
* request.
* @return The request
*/
- @Nonnull SlingHttpServletRequest getRequest();
+ @NotNull SlingHttpServletRequest getRequest();
/**
* Returns the {@link SlingHttpServletResponse} representing the output of
* the request.
* @return The response
*/
- @Nonnull SlingHttpServletResponse getResponse();
+ @NotNull SlingHttpServletResponse getResponse();
/**
* Returns the {@link SlingScript} being called to handle the request.
* @return The script
*/
- @Nonnull SlingScript getScript();
+ @NotNull SlingScript getScript();
/**
* Same as {@link #include(String,RequestDispatcherOptions)}, but using
@@ -66,7 +66,7 @@ public interface SlingScriptHelper {
* @throws org.apache.sling.api.SlingServletException Wrapping a
<code>ServletException</code>
* thrown while handling the include.
*/
- void include(@Nonnull String path);
+ void include(@NotNull String path);
/**
* Helper method to include the result of processing the request for the
@@ -97,7 +97,7 @@ public interface SlingScriptHelper {
* @see RequestDispatcherOptions#RequestDispatcherOptions(String)
* @see #include(String, RequestDispatcherOptions)
*/
- void include(@Nonnull String path, String requestDispatcherOptions);
+ void include(@NotNull String path, String requestDispatcherOptions);
/**
* Helper method to include the result of processing the request for the
@@ -122,7 +122,7 @@ public interface SlingScriptHelper {
* @see RequestDispatcherOptions
* @see #include(String, String)
*/
- void include(@Nonnull String path, RequestDispatcherOptions options);
+ void include(@NotNull String path, RequestDispatcherOptions options);
/**
* Same as {@link #include(Resource,RequestDispatcherOptions)}, but using
@@ -134,7 +134,7 @@ public interface SlingScriptHelper {
* @throws org.apache.sling.api.SlingServletException Wrapping a
<code>ServletException</code>
* thrown while handling the include.
*/
- void include(@Nonnull Resource resource);
+ void include(@NotNull Resource resource);
/**
* Helper method to include the result of processing the request for the
@@ -165,7 +165,7 @@ public interface SlingScriptHelper {
* @see RequestDispatcherOptions#RequestDispatcherOptions(String)
* @see #include(String, RequestDispatcherOptions)
*/
- void include(@Nonnull Resource resource, String requestDispatcherOptions);
+ void include(@NotNull Resource resource, String requestDispatcherOptions);
/**
* Helper method to include the result of processing the request for the
@@ -190,7 +190,7 @@ public interface SlingScriptHelper {
* @see RequestDispatcherOptions
* @see #include(String, String)
*/
- void include(@Nonnull Resource resource, RequestDispatcherOptions options);
+ void include(@NotNull Resource resource, RequestDispatcherOptions options);
/**
* Same as {@link #forward(String,RequestDispatcherOptions)}, but using
@@ -202,7 +202,7 @@ public interface SlingScriptHelper {
* @throws org.apache.sling.api.SlingServletException Wrapping a
<code>ServletException</code>
* thrown while handling the forward.
*/
- void forward(@Nonnull String path);
+ void forward(@NotNull String path);
/**
* Helper method to forward the request to a Servlet or script for the
given
@@ -233,7 +233,7 @@ public interface SlingScriptHelper {
* @see RequestDispatcherOptions#RequestDispatcherOptions(String)
* @see #forward(String, RequestDispatcherOptions)
*/
- void forward(@Nonnull String path, String requestDispatcherOptions);
+ void forward(@NotNull String path, String requestDispatcherOptions);
/**
* Helper method to forward the request to a Servlet or script for the
given
@@ -258,7 +258,7 @@ public interface SlingScriptHelper {
* @throws IllegalStateException If the respoonse has already been
committed
* @see RequestDispatcherOptions
*/
- void forward(@Nonnull String path, RequestDispatcherOptions options);
+ void forward(@NotNull String path, RequestDispatcherOptions options);
/**
* Same as {@link #forward(Resource,RequestDispatcherOptions)}, but using
@@ -270,7 +270,7 @@ public interface SlingScriptHelper {
* @throws org.apache.sling.api.SlingServletException Wrapping a
<code>ServletException</code>
* thrown while handling the forward.
*/
- void forward(@Nonnull Resource resource);
+ void forward(@NotNull Resource resource);
/**
* Helper method to forward the request to a Servlet or script for the
given
@@ -301,7 +301,7 @@ public interface SlingScriptHelper {
* @see RequestDispatcherOptions#RequestDispatcherOptions(String)
* @see #forward(String, RequestDispatcherOptions)
*/
- void forward(@Nonnull Resource resource, String requestDispatcherOptions);
+ void forward(@NotNull Resource resource, String requestDispatcherOptions);
/**
* Helper method to forward the request to a Servlet or script for the
given
@@ -326,7 +326,7 @@ public interface SlingScriptHelper {
* @throws IllegalStateException If the respoonse has already been
committed
* @see RequestDispatcherOptions
*/
- void forward(@Nonnull Resource resource, RequestDispatcherOptions options);
+ void forward(@NotNull Resource resource, RequestDispatcherOptions options);
/**
* Lookup a single service.
@@ -341,7 +341,7 @@ public interface SlingScriptHelper {
* @param <ServiceType> The type (interface) of the service.
* @return The service instance, or {@code null} if no services are
registered which implement the specified class.
*/
- @CheckForNull <ServiceType> ServiceType getService(@Nonnull
Class<ServiceType> serviceType);
+ @Nullable <ServiceType> ServiceType getService(@NotNull Class<ServiceType>
serviceType);
/**
* Lookup one or several services.
@@ -361,7 +361,7 @@ public interface SlingScriptHelper {
*
* @see <a
href="https://osgi.org/javadoc/r5/core/org/osgi/framework/Filter.html">Filter
class in OSGi</a>
*/
- @CheckForNull <ServiceType> ServiceType[] getServices(@Nonnull
Class<ServiceType> serviceType,
+ @Nullable <ServiceType> ServiceType[] getServices(@NotNull
Class<ServiceType> serviceType,
String filter);
/**
diff --git
a/src/main/java/org/apache/sling/api/scripting/SlingScriptResolver.java
b/src/main/java/org/apache/sling/api/scripting/SlingScriptResolver.java
index 283b7bc..f2bef9d 100644
--- a/src/main/java/org/apache/sling/api/scripting/SlingScriptResolver.java
+++ b/src/main/java/org/apache/sling/api/scripting/SlingScriptResolver.java
@@ -16,8 +16,8 @@
*/
package org.apache.sling.api.scripting;
-import javax.annotation.CheckForNull;
-import javax.annotation.Nonnull;
+import org.jetbrains.annotations.Nullable;
+import org.jetbrains.annotations.NotNull;
import org.apache.sling.api.resource.ResourceResolver;
@@ -51,5 +51,5 @@ public interface SlingScriptResolver {
* <code>null</code> otherwise.
* @throws org.apache.sling.api.SlingException If an error occurrs trying
to resolve the name.
*/
- @CheckForNull SlingScript findScript(@Nonnull ResourceResolver
resourceResolver, @Nonnull String name);
+ @Nullable SlingScript findScript(@NotNull ResourceResolver
resourceResolver, @NotNull String name);
}
diff --git a/src/main/java/org/apache/sling/api/scripting/package-info.java
b/src/main/java/org/apache/sling/api/scripting/package-info.java
index aa8704a..f8aba07 100644
--- a/src/main/java/org/apache/sling/api/scripting/package-info.java
+++ b/src/main/java/org/apache/sling/api/scripting/package-info.java
@@ -17,7 +17,7 @@
* under the License.
*/
-@Version("2.3.1")
+@Version("2.3.2")
package org.apache.sling.api.scripting;
import org.osgi.annotation.versioning.Version;
diff --git
a/src/main/java/org/apache/sling/api/security/ResourceAccessSecurity.java
b/src/main/java/org/apache/sling/api/security/ResourceAccessSecurity.java
index 0d8c313..b6f8222 100644
--- a/src/main/java/org/apache/sling/api/security/ResourceAccessSecurity.java
+++ b/src/main/java/org/apache/sling/api/security/ResourceAccessSecurity.java
@@ -18,8 +18,8 @@
*/
package org.apache.sling.api.security;
-import javax.annotation.CheckForNull;
-import javax.annotation.Nonnull;
+import org.jetbrains.annotations.Nullable;
+import org.jetbrains.annotations.NotNull;
import org.apache.sling.api.resource.Resource;
import org.apache.sling.api.resource.ResourceResolver;
@@ -87,7 +87,7 @@ public interface ResourceAccessSecurity {
* @param resource The resource to test.
* @return null if {@link Resource} cannot be read
*/
- @CheckForNull Resource getReadableResource(Resource resource);
+ @Nullable Resource getReadableResource(Resource resource);
/**
* Check whether a resource can be created at the path.
@@ -96,28 +96,28 @@ public interface ResourceAccessSecurity {
* @return true if a {@link Resource} can be created at the supplied
* absolute path.
*/
- boolean canCreate(@Nonnull String absPathName, @Nonnull ResourceResolver
resourceResolver);
+ boolean canCreate(@NotNull String absPathName, @NotNull ResourceResolver
resourceResolver);
/**
* Check whether a resource can be updated at the path.
* @param resource The resource to test.
* @return true if supplied {@link Resource} can be updated
*/
- boolean canUpdate(@Nonnull Resource resource);
+ boolean canUpdate(@NotNull Resource resource);
/**
* Check whether a resource can be deleted at the path.
* @param resource The resource to test.
* @return true if supplied {@link Resource} can be deleted
*/
- boolean canDelete(@Nonnull Resource resource);
+ boolean canDelete(@NotNull Resource resource);
/**
* Check whether a resource can be executed at the path.
* @param resource The resource to test.
* @return true if supplied {@link Resource} can be executed as a script
*/
- boolean canExecute(@Nonnull Resource resource);
+ boolean canExecute(@NotNull Resource resource);
/**
* Check whether a value can be read
@@ -125,7 +125,7 @@ public interface ResourceAccessSecurity {
* @param valueName The name of the value
* @return true if the "valueName" value of supplied {@link Resource} can
be read
*/
- boolean canReadValue(@Nonnull Resource resource, @Nonnull String
valueName);
+ boolean canReadValue(@NotNull Resource resource, @NotNull String
valueName);
/**
* Check whether a value can be set
@@ -133,7 +133,7 @@ public interface ResourceAccessSecurity {
* @param valueName The name of the value
* @return true if the "valueName" value of supplied {@link Resource} can
be set
*/
- boolean canSetValue(@Nonnull Resource resource, @Nonnull String valueName);
+ boolean canSetValue(@NotNull Resource resource, @NotNull String valueName);
/**
* Check whether a value can be deleted
@@ -141,7 +141,7 @@ public interface ResourceAccessSecurity {
* @param valueName The name of the value
* @return true if the "valueName" value of supplied {@link Resource} can
be deleted
*/
- boolean canDeleteValue(@Nonnull Resource resource, @Nonnull String
valueName);
+ boolean canDeleteValue(@NotNull Resource resource, @NotNull String
valueName);
/**
* Optionally transform a query based on the current
@@ -158,7 +158,7 @@ public interface ResourceAccessSecurity {
* @return the transformed query
* @throws AccessSecurityException If access is denied
*/
- @Nonnull String transformQuery(@Nonnull String query, @Nonnull String
language, @Nonnull ResourceResolver resourceResolver)
+ @NotNull String transformQuery(@NotNull String query, @NotNull String
language, @NotNull ResourceResolver resourceResolver)
throws AccessSecurityException;
}
\ No newline at end of file
diff --git a/src/main/java/org/apache/sling/api/security/package-info.java
b/src/main/java/org/apache/sling/api/security/package-info.java
index 8b9ddeb..c9ada14 100644
--- a/src/main/java/org/apache/sling/api/security/package-info.java
+++ b/src/main/java/org/apache/sling/api/security/package-info.java
@@ -17,7 +17,7 @@
* under the License.
*/
-@Version("1.0.2")
+@Version("1.0.3")
package org.apache.sling.api.security;
import org.osgi.annotation.versioning.Version;
diff --git a/src/main/java/org/apache/sling/api/servlets/OptingServlet.java
b/src/main/java/org/apache/sling/api/servlets/OptingServlet.java
index 9873eab..4a56d94 100644
--- a/src/main/java/org/apache/sling/api/servlets/OptingServlet.java
+++ b/src/main/java/org/apache/sling/api/servlets/OptingServlet.java
@@ -18,7 +18,7 @@
*/
package org.apache.sling.api.servlets;
-import javax.annotation.Nonnull;
+import org.jetbrains.annotations.NotNull;
import javax.servlet.Servlet;
import org.apache.sling.api.SlingHttpServletRequest;
@@ -49,6 +49,6 @@ public interface OptingServlet extends Servlet {
* @return <code>true</code> if this servlet will handle the request,
* <code>false</code> otherwise
*/
- boolean accepts(@Nonnull SlingHttpServletRequest request);
+ boolean accepts(@NotNull SlingHttpServletRequest request);
}
diff --git a/src/main/java/org/apache/sling/api/servlets/ServletResolver.java
b/src/main/java/org/apache/sling/api/servlets/ServletResolver.java
index 6fcf40d..8cb8ae9 100644
--- a/src/main/java/org/apache/sling/api/servlets/ServletResolver.java
+++ b/src/main/java/org/apache/sling/api/servlets/ServletResolver.java
@@ -18,8 +18,8 @@
*/
package org.apache.sling.api.servlets;
-import javax.annotation.CheckForNull;
-import javax.annotation.Nonnull;
+import org.jetbrains.annotations.Nullable;
+import org.jetbrains.annotations.NotNull;
import javax.servlet.Servlet;
import org.apache.sling.api.SlingHttpServletRequest;
@@ -63,7 +63,7 @@ public interface ServletResolver {
* request.
* @throws NullPointerException If {@code request} is null.
*/
- @CheckForNull Servlet resolveServlet(@Nonnull SlingHttpServletRequest
request);
+ @Nullable Servlet resolveServlet(@NotNull SlingHttpServletRequest request);
/**
* Resolves a <code>javax.servlet.Servlet</code> whose
@@ -93,7 +93,7 @@ public interface ServletResolver {
* @throws IllegalArgumentException If {@code resource} is null.
* @since 2.1 (Sling API Bundle 2.1.0)
*/
- @CheckForNull Servlet resolveServlet(@Nonnull Resource resource, @Nonnull
String scriptName);
+ @Nullable Servlet resolveServlet(@NotNull Resource resource, @NotNull
String scriptName);
/**
* Resolves a <code>javax.servlet.Servlet</code> whose
@@ -120,6 +120,6 @@ public interface ServletResolver {
* @throws IllegalArgumentException If {@code resolver} is null.
* @since 2.1 (Sling API Bundle 2.1.0)
*/
- @CheckForNull Servlet resolveServlet(@Nonnull ResourceResolver resolver,
@Nonnull String scriptName);
+ @Nullable Servlet resolveServlet(@NotNull ResourceResolver resolver,
@NotNull String scriptName);
}
diff --git
a/src/main/java/org/apache/sling/api/servlets/SlingAllMethodsServlet.java
b/src/main/java/org/apache/sling/api/servlets/SlingAllMethodsServlet.java
index 4666bb9..7666fe9 100644
--- a/src/main/java/org/apache/sling/api/servlets/SlingAllMethodsServlet.java
+++ b/src/main/java/org/apache/sling/api/servlets/SlingAllMethodsServlet.java
@@ -20,7 +20,7 @@ import java.io.IOException;
import java.lang.reflect.Method;
import java.util.Map;
-import javax.annotation.Nonnull;
+import org.jetbrains.annotations.NotNull;
import javax.servlet.ServletException;
import org.apache.sling.api.SlingHttpServletRequest;
@@ -60,8 +60,8 @@ public class SlingAllMethodsServlet extends
SlingSafeMethodsServlet {
* @throws IOException If the error status cannot be reported back to the
* client.
*/
- protected void doPost(@Nonnull SlingHttpServletRequest request,
- @Nonnull SlingHttpServletResponse response) throws
ServletException,
+ protected void doPost(@NotNull SlingHttpServletRequest request,
+ @NotNull SlingHttpServletResponse response) throws
ServletException,
IOException {
handleMethodNotImplemented(request, response);
}
@@ -83,8 +83,8 @@ public class SlingAllMethodsServlet extends
SlingSafeMethodsServlet {
* @throws IOException If the error status cannot be reported back to the
* client.
*/
- protected void doPut(@Nonnull SlingHttpServletRequest request,
- @Nonnull SlingHttpServletResponse response) throws
ServletException,
+ protected void doPut(@NotNull SlingHttpServletRequest request,
+ @NotNull SlingHttpServletResponse response) throws
ServletException,
IOException {
handleMethodNotImplemented(request, response);
}
@@ -106,8 +106,8 @@ public class SlingAllMethodsServlet extends
SlingSafeMethodsServlet {
* @throws IOException If the error status cannot be reported back to the
* client.
*/
- protected void doDelete(@Nonnull SlingHttpServletRequest request,
- @Nonnull SlingHttpServletResponse response) throws
ServletException,
+ protected void doDelete(@NotNull SlingHttpServletRequest request,
+ @NotNull SlingHttpServletResponse response) throws
ServletException,
IOException {
handleMethodNotImplemented(request, response);
}
@@ -129,8 +129,8 @@ public class SlingAllMethodsServlet extends
SlingSafeMethodsServlet {
* @throws ServletException Forwarded from any of the dispatched methods
* @throws IOException Forwarded from any of the dispatched methods
*/
- protected boolean mayService(@Nonnull SlingHttpServletRequest request,
- @Nonnull SlingHttpServletResponse response) throws
ServletException,
+ protected boolean mayService(@NotNull SlingHttpServletRequest request,
+ @NotNull SlingHttpServletResponse response) throws
ServletException,
IOException {
// assume the method is known for now
@@ -173,8 +173,8 @@ public class SlingAllMethodsServlet extends
SlingSafeMethodsServlet {
* @return A <code>StringBuffer</code> containing the list of HTTP methods
* supported.
*/
- protected @Nonnull StringBuffer getAllowedRequestMethods(
- @Nonnull Map<String, Method> declaredMethods) {
+ protected @NotNull StringBuffer getAllowedRequestMethods(
+ @NotNull Map<String, Method> declaredMethods) {
StringBuffer allowBuf =
super.getAllowedRequestMethods(declaredMethods);
// add more method names depending on the methods found
diff --git
a/src/main/java/org/apache/sling/api/servlets/SlingSafeMethodsServlet.java
b/src/main/java/org/apache/sling/api/servlets/SlingSafeMethodsServlet.java
index 84d785b..1d25ce9 100644
--- a/src/main/java/org/apache/sling/api/servlets/SlingSafeMethodsServlet.java
+++ b/src/main/java/org/apache/sling/api/servlets/SlingSafeMethodsServlet.java
@@ -26,7 +26,7 @@ import java.util.Enumeration;
import java.util.HashMap;
import java.util.Map;
-import javax.annotation.Nonnull;
+import org.jetbrains.annotations.NotNull;
import javax.servlet.GenericServlet;
import javax.servlet.ServletException;
import javax.servlet.ServletOutputStream;
@@ -91,8 +91,8 @@ public class SlingSafeMethodsServlet extends GenericServlet {
* {@link #doGet(SlingHttpServletRequest,
SlingHttpServletResponse)}
* method called by this implementation.
*/
- protected void doHead(@Nonnull SlingHttpServletRequest request,
- @Nonnull SlingHttpServletResponse response) throws
ServletException,
+ protected void doHead(@NotNull SlingHttpServletRequest request,
+ @NotNull SlingHttpServletResponse response) throws
ServletException,
IOException {
// the null-output wrapper
@@ -122,8 +122,8 @@ public class SlingSafeMethodsServlet extends GenericServlet
{
* @throws IOException If the error status cannot be reported back to the
* client.
*/
- protected void doGet(@Nonnull SlingHttpServletRequest request,
- @Nonnull SlingHttpServletResponse response) throws
ServletException,
+ protected void doGet(@NotNull SlingHttpServletRequest request,
+ @NotNull SlingHttpServletResponse response) throws
ServletException,
IOException {
handleMethodNotImplemented(request, response);
}
@@ -146,8 +146,8 @@ public class SlingSafeMethodsServlet extends GenericServlet
{
* @throws ServletException Not thrown by this implementation.
* @throws IOException Not thrown by this implementation.
*/
- protected void doOptions(@Nonnull SlingHttpServletRequest request,
- @Nonnull SlingHttpServletResponse response) throws
ServletException,
+ protected void doOptions(@NotNull SlingHttpServletRequest request,
+ @NotNull SlingHttpServletResponse response) throws
ServletException,
IOException {
Map<String, Method> methods = getAllDeclaredMethods(getClass());
StringBuffer allowBuf = getAllowedRequestMethods(methods);
@@ -168,8 +168,8 @@ public class SlingSafeMethodsServlet extends GenericServlet
{
* @throws IOException May be thrown if there is an problem sending back
the
* request headers in the response stream.
*/
- protected void doTrace(@Nonnull SlingHttpServletRequest request,
- @Nonnull SlingHttpServletResponse response) throws
ServletException,
+ protected void doTrace(@NotNull SlingHttpServletRequest request,
+ @NotNull SlingHttpServletResponse response) throws
ServletException,
IOException {
String CRLF = "\r\n";
@@ -224,8 +224,8 @@ public class SlingSafeMethodsServlet extends GenericServlet
{
* @throws IOException If the error status cannot be reported back to the
* client.
*/
- protected void doGeneric(@Nonnull SlingHttpServletRequest request,
- @Nonnull SlingHttpServletResponse response) throws
ServletException,
+ protected void doGeneric(@NotNull SlingHttpServletRequest request,
+ @NotNull SlingHttpServletResponse response) throws
ServletException,
IOException {
handleMethodNotImplemented(request, response);
}
@@ -252,8 +252,8 @@ public class SlingSafeMethodsServlet extends GenericServlet
{
* @throws ServletException Forwarded from any of the dispatched methods
* @throws IOException Forwarded from any of the dispatched methods
*/
- protected boolean mayService(@Nonnull SlingHttpServletRequest request,
- @Nonnull SlingHttpServletResponse response) throws
ServletException,
+ protected boolean mayService(@NotNull SlingHttpServletRequest request,
+ @NotNull SlingHttpServletResponse response) throws
ServletException,
IOException {
// assume the method is known for now
@@ -288,8 +288,8 @@ public class SlingSafeMethodsServlet extends GenericServlet
{
* @param response The HTTP response to which the error status is sent.
* @throws IOException Thrown if the status cannot be sent to the client.
*/
- protected void handleMethodNotImplemented(@Nonnull SlingHttpServletRequest
request,
- @Nonnull SlingHttpServletResponse response) throws IOException {
+ protected void handleMethodNotImplemented(@NotNull SlingHttpServletRequest
request,
+ @NotNull SlingHttpServletResponse response) throws IOException {
String protocol = request.getProtocol();
String msg = "Method " + request.getMethod() + " not supported";
@@ -334,8 +334,8 @@ public class SlingSafeMethodsServlet extends GenericServlet
{
* {@link #doGeneric(SlingHttpServletRequest,
SlingHttpServletResponse)}
* methods.
*/
- protected void service(@Nonnull SlingHttpServletRequest request,
- @Nonnull SlingHttpServletResponse response) throws
ServletException,
+ protected void service(@NotNull SlingHttpServletRequest request,
+ @NotNull SlingHttpServletResponse response) throws
ServletException,
IOException {
// first try to handle the request by the known methods
@@ -365,7 +365,7 @@ public class SlingSafeMethodsServlet extends GenericServlet
{
* called.
*/
@Override
- public void service(@Nonnull ServletRequest req, @Nonnull ServletResponse
res)
+ public void service(@NotNull ServletRequest req, @NotNull ServletResponse
res)
throws ServletException, IOException {
if ((req instanceof SlingHttpServletRequest)
@@ -386,7 +386,7 @@ public class SlingSafeMethodsServlet extends GenericServlet
{
* class may overwrite to return more specific information.
*/
@Override
- public @Nonnull String getServletInfo() {
+ public @NotNull String getServletInfo() {
return getClass().getSimpleName();
}
diff --git a/src/main/java/org/apache/sling/api/servlets/package-info.java
b/src/main/java/org/apache/sling/api/servlets/package-info.java
index a864c85..b018388 100644
--- a/src/main/java/org/apache/sling/api/servlets/package-info.java
+++ b/src/main/java/org/apache/sling/api/servlets/package-info.java
@@ -17,7 +17,7 @@
* under the License.
*/
-@Version("2.2.0")
+@Version("2.2.1")
package org.apache.sling.api.servlets;
import org.osgi.annotation.versioning.Version;
diff --git
a/src/main/java/org/apache/sling/api/wrappers/ResourceResolverWrapper.java
b/src/main/java/org/apache/sling/api/wrappers/ResourceResolverWrapper.java
index b9d442e..67c2fbf 100644
--- a/src/main/java/org/apache/sling/api/wrappers/ResourceResolverWrapper.java
+++ b/src/main/java/org/apache/sling/api/wrappers/ResourceResolverWrapper.java
@@ -18,7 +18,7 @@ package org.apache.sling.api.wrappers;
import java.util.Iterator;
import java.util.Map;
-import javax.annotation.Nonnull;
+import org.jetbrains.annotations.NotNull;
import javax.servlet.http.HttpServletRequest;
import org.apache.sling.api.resource.LoginException;
@@ -60,9 +60,9 @@ public class ResourceResolverWrapper implements
ResourceResolver {
* the path before resolving it.
* @return a wrapped resource obtained through the wrapped resource
resolver
*/
- @Nonnull
+ @NotNull
@Override
- public Resource resolve(@Nonnull HttpServletRequest request, @Nonnull
String absPath) {
+ public Resource resolve(@NotNull HttpServletRequest request, @NotNull
String absPath) {
return ResourceResolverResourceWrapper.wrap(this,
wrapped.resolve(request, absPath));
}
@@ -76,9 +76,9 @@ public class ResourceResolverWrapper implements
ResourceResolver {
* the path before resolving it.
* @return a wrapped resource obtained through the wrapped resource
resolver
*/
- @Nonnull
+ @NotNull
@Override
- public Resource resolve(@Nonnull String absPath) {
+ public Resource resolve(@NotNull String absPath) {
return ResourceResolverResourceWrapper.wrap(this,
wrapped.resolve(absPath));
}
@@ -90,20 +90,20 @@ public class ResourceResolverWrapper implements
ResourceResolver {
* @return a wrapped resource obtained through the wrapped resource
resolver
*/
@SuppressWarnings("deprecation")
- @Nonnull
+ @NotNull
@Override
- public Resource resolve(@Nonnull HttpServletRequest request) {
+ public Resource resolve(@NotNull HttpServletRequest request) {
return ResourceResolverResourceWrapper.wrap(this,
wrapped.resolve(request));
}
- @Nonnull
+ @NotNull
@Override
- public String map(@Nonnull String resourcePath) {
+ public String map(@NotNull String resourcePath) {
return wrapped.map(resourcePath);
}
@Override
- public String map(@Nonnull HttpServletRequest request, @Nonnull String
resourcePath) {
+ public String map(@NotNull HttpServletRequest request, @NotNull String
resourcePath) {
return wrapped.map(request, resourcePath);
}
@@ -120,7 +120,7 @@ public class ResourceResolverWrapper implements
ResourceResolver {
* @return a wrapped resource obtained through the wrapped resource
resolver
*/
@Override
- public Resource getResource(@Nonnull String path) {
+ public Resource getResource(@NotNull String path) {
return ResourceResolverResourceWrapper.wrap(this,
wrapped.getResource(path));
}
@@ -140,11 +140,11 @@ public class ResourceResolverWrapper implements
ResourceResolver {
* @return a wrapped resource obtained through the wrapped resource
resolver
*/
@Override
- public Resource getResource(Resource base, @Nonnull String path) {
+ public Resource getResource(Resource base, @NotNull String path) {
return ResourceResolverResourceWrapper.wrap(this,
wrapped.getResource(base, path));
}
- @Nonnull
+ @NotNull
@Override
public String[] getSearchPath() {
return wrapped.getSearchPath();
@@ -156,9 +156,9 @@ public class ResourceResolverWrapper implements
ResourceResolver {
* @param parent The {@link Resource Resource} whose children are
requested.
* @return a wrapped iterator obtained through the wrapped resource
resolver
*/
- @Nonnull
+ @NotNull
@Override
- public Iterator<Resource> listChildren(@Nonnull Resource parent) {
+ public Iterator<Resource> listChildren(@NotNull Resource parent) {
return new ResourceIteratorWrapper(this, wrapped.listChildren(parent));
}
@@ -169,7 +169,7 @@ public class ResourceResolverWrapper implements
ResourceResolver {
* @return a wrapped resource obtained through the wrapped resource
resolver
*/
@Override
- public Resource getParent(@Nonnull Resource child) {
+ public Resource getParent(@NotNull Resource child) {
return ResourceResolverResourceWrapper.wrap(this,
wrapped.getParent(child));
}
@@ -179,9 +179,9 @@ public class ResourceResolverWrapper implements
ResourceResolver {
* @param parent The {@link Resource Resource} whose children are
requested.
* @return a wrapped iterable obtained through the wrapped resource
resolver
*/
- @Nonnull
+ @NotNull
@Override
- public Iterable<Resource> getChildren(@Nonnull final Resource parent) {
+ public Iterable<Resource> getChildren(@NotNull final Resource parent) {
final ResourceResolverWrapper resourceResolverWrapper = this;
return new Iterable<Resource>() {
@Override
@@ -201,20 +201,20 @@ public class ResourceResolverWrapper implements
ResourceResolver {
* is specified, "xpath" is used.
* @return a wrapped iterator obtained through the wrapped resource
resolver
*/
- @Nonnull
+ @NotNull
@Override
- public Iterator<Resource> findResources(@Nonnull String query, String
language) {
+ public Iterator<Resource> findResources(@NotNull String query, String
language) {
return new ResourceIteratorWrapper(this, wrapped.findResources(query,
language));
}
- @Nonnull
+ @NotNull
@Override
- public Iterator<Map<String, Object>> queryResources(@Nonnull String query,
String language) {
+ public Iterator<Map<String, Object>> queryResources(@NotNull String query,
String language) {
return wrapped.queryResources(query, language);
}
@Override
- public boolean hasChildren(@Nonnull Resource resource) {
+ public boolean hasChildren(@NotNull Resource resource) {
return wrapped.hasChildren(resource);
}
@@ -228,7 +228,7 @@ public class ResourceResolverWrapper implements
ResourceResolver {
* instance.
* @return a wrapped resource resolver
*/
- @Nonnull
+ @NotNull
@Override
public ResourceResolver clone(Map<String, Object> authenticationInfo)
throws LoginException {
ResourceResolver toWrap = wrapped.clone(authenticationInfo);
@@ -250,19 +250,19 @@ public class ResourceResolverWrapper implements
ResourceResolver {
return wrapped.getUserID();
}
- @Nonnull
+ @NotNull
@Override
public Iterator<String> getAttributeNames() {
return wrapped.getAttributeNames();
}
@Override
- public Object getAttribute(@Nonnull String name) {
+ public Object getAttribute(@NotNull String name) {
return wrapped.getAttribute(name);
}
@Override
- public void delete(@Nonnull Resource resource) throws PersistenceException
{
+ public void delete(@NotNull Resource resource) throws PersistenceException
{
wrapped.delete(resource);
}
@@ -274,9 +274,9 @@ public class ResourceResolverWrapper implements
ResourceResolver {
* @param properties Optional properties for the resource
* @return a wrapped resource obtained through the wrapped resource
resolver
*/
- @Nonnull
+ @NotNull
@Override
- public Resource create(@Nonnull Resource parent, @Nonnull String name,
Map<String, Object> properties) throws PersistenceException {
+ public Resource create(@NotNull Resource parent, @NotNull String name,
Map<String, Object> properties) throws PersistenceException {
return ResourceResolverResourceWrapper.wrap(this,
wrapped.create(parent, name, properties));
}
@@ -342,7 +342,7 @@ public class ResourceResolverWrapper implements
ResourceResolver {
}
@Override
- public <AdapterType> AdapterType adaptTo(@Nonnull Class<AdapterType> type)
{
+ public <AdapterType> AdapterType adaptTo(@NotNull Class<AdapterType> type)
{
return wrapped.adaptTo(type);
}
diff --git a/src/main/java/org/apache/sling/api/wrappers/package-info.java
b/src/main/java/org/apache/sling/api/wrappers/package-info.java
index e527a18..b9ce055 100644
--- a/src/main/java/org/apache/sling/api/wrappers/package-info.java
+++ b/src/main/java/org/apache/sling/api/wrappers/package-info.java
@@ -17,7 +17,7 @@
* under the License.
*/
-@Version("2.6.1")
+@Version("2.6.2")
package org.apache.sling.api.wrappers;
import org.osgi.annotation.versioning.Version;
diff --git
a/src/main/java/org/apache/sling/spi/resource/provider/ObservationReporter.java
b/src/main/java/org/apache/sling/spi/resource/provider/ObservationReporter.java
index 2fc2f32..6a05f7f 100644
---
a/src/main/java/org/apache/sling/spi/resource/provider/ObservationReporter.java
+++
b/src/main/java/org/apache/sling/spi/resource/provider/ObservationReporter.java
@@ -20,7 +20,7 @@ package org.apache.sling.spi.resource.provider;
import java.util.List;
-import javax.annotation.Nonnull;
+import org.jetbrains.annotations.NotNull;
import org.apache.sling.api.resource.observation.ResourceChange;
import org.osgi.annotation.versioning.ProviderType;
@@ -40,7 +40,7 @@ public interface ObservationReporter {
* reporter is bound to.
* @return A list of observer configurations, the list might be empty.
*/
- @Nonnull List<ObserverConfiguration> getObserverConfigurations();
+ @NotNull List<ObserverConfiguration> getObserverConfigurations();
/**
* A resource provider can inform about a list of changes.
@@ -60,7 +60,7 @@ public interface ObservationReporter {
* @param changes The list of changes.
* @param distribute Whether the changes should be distributed to other
instances.
*/
- void reportChanges(@Nonnull Iterable<ResourceChange> changes, boolean
distribute);
+ void reportChanges(@NotNull Iterable<ResourceChange> changes, boolean
distribute);
/**
* A resource provider can inform about a list of changes.
@@ -81,7 +81,7 @@ public interface ObservationReporter {
* @param distribute Whether the changes should be distributed to other
instances.
* @since 1.1.0 (Sling API Bundle 2.15.0)
*/
- void reportChanges(@Nonnull ObserverConfiguration config,
- @Nonnull Iterable<ResourceChange> changes,
+ void reportChanges(@NotNull ObserverConfiguration config,
+ @NotNull Iterable<ResourceChange> changes,
boolean distribute);
}
diff --git
a/src/main/java/org/apache/sling/spi/resource/provider/ObserverConfiguration.java
b/src/main/java/org/apache/sling/spi/resource/provider/ObserverConfiguration.java
index 326e570..0c3f00e 100644
---
a/src/main/java/org/apache/sling/spi/resource/provider/ObserverConfiguration.java
+++
b/src/main/java/org/apache/sling/spi/resource/provider/ObserverConfiguration.java
@@ -20,7 +20,7 @@ package org.apache.sling.spi.resource.provider;
import java.util.Set;
-import javax.annotation.Nonnull;
+import org.jetbrains.annotations.NotNull;
import org.apache.sling.api.resource.observation.ResourceChange;
import org.apache.sling.api.resource.path.PathSet;
@@ -55,20 +55,20 @@ public interface ObserverConfiguration {
* The set of paths this listener is interested in. Each entry is absolute.
* @return Non empty set of paths
*/
- @Nonnull PathSet getPaths();
+ @NotNull PathSet getPaths();
/**
* The set of excluded paths.
* All the paths are sub paths from one entry of {@link #getPaths()}
* @return A set of excluded paths, might be empty.
*/
- @Nonnull PathSet getExcludedPaths();
+ @NotNull PathSet getExcludedPaths();
/**
* The set of types listeners are interested in.
* @return Non empty set of types
*/
- @Nonnull Set<ResourceChange.ChangeType> getChangeTypes();
+ @NotNull Set<ResourceChange.ChangeType> getChangeTypes();
/**
* Set containing the set of property names which
@@ -77,7 +77,7 @@ public interface ObserverConfiguration {
* underlying might ignore this.
* @return Set containing the set of property names or {@code null}
*/
- @Nonnull Set<String> getPropertyNamesHint();
+ @NotNull Set<String> getPropertyNamesHint();
/**
* Checks whether a path matches one of the paths of this configuration
diff --git
a/src/main/java/org/apache/sling/spi/resource/provider/ProviderContext.java
b/src/main/java/org/apache/sling/spi/resource/provider/ProviderContext.java
index 64025c6..d5abb0d 100644
--- a/src/main/java/org/apache/sling/spi/resource/provider/ProviderContext.java
+++ b/src/main/java/org/apache/sling/spi/resource/provider/ProviderContext.java
@@ -18,7 +18,7 @@
*/
package org.apache.sling.spi.resource.provider;
-import javax.annotation.Nonnull;
+import org.jetbrains.annotations.NotNull;
import org.apache.sling.api.resource.path.PathSet;
import org.osgi.annotation.versioning.ProviderType;
@@ -47,7 +47,7 @@ public interface ProviderContext {
*
* @return The observation reporter.
*/
- @Nonnull ObservationReporter getObservationReporter();
+ @NotNull ObservationReporter getObservationReporter();
/**
* Set of paths which are "hidden" by other resource providers.
diff --git
a/src/main/java/org/apache/sling/spi/resource/provider/QueryLanguageProvider.java
b/src/main/java/org/apache/sling/spi/resource/provider/QueryLanguageProvider.java
index b733cec..7ba48fb 100644
---
a/src/main/java/org/apache/sling/spi/resource/provider/QueryLanguageProvider.java
+++
b/src/main/java/org/apache/sling/spi/resource/provider/QueryLanguageProvider.java
@@ -20,7 +20,7 @@ package org.apache.sling.spi.resource.provider;
import java.util.Iterator;
-import javax.annotation.Nonnull;
+import org.jetbrains.annotations.NotNull;
import org.apache.sling.api.resource.Resource;
import org.apache.sling.api.resource.ValueMap;
@@ -43,7 +43,7 @@ public interface QueryLanguageProvider<T> {
* @param ctx The resolve context
* @return The array of supported languages
*/
- String[] getSupportedLanguages(@Nonnull ResolveContext<T> ctx);
+ String[] getSupportedLanguages(@NotNull ResolveContext<T> ctx);
/**
* Searches for resources using the given query formulated in the given
@@ -70,7 +70,7 @@ public interface QueryLanguageProvider<T> {
* @throws IllegalStateException if this resource provider has already been
* closed.
*/
- Iterator<Resource> findResources(@Nonnull ResolveContext<T> ctx, String
query, String language);
+ Iterator<Resource> findResources(@NotNull ResolveContext<T> ctx, String
query, String language);
/**
* Queries the storage using the given query formulated in the given
@@ -100,5 +100,5 @@ public interface QueryLanguageProvider<T> {
* @throws IllegalStateException if this resource provider has already been
* closed.
*/
- Iterator<ValueMap> queryResources(@Nonnull ResolveContext<T> ctx, String
query, String language);
+ Iterator<ValueMap> queryResources(@NotNull ResolveContext<T> ctx, String
query, String language);
}
diff --git
a/src/main/java/org/apache/sling/spi/resource/provider/ResolveContext.java
b/src/main/java/org/apache/sling/spi/resource/provider/ResolveContext.java
index 62a4086..6837600 100644
--- a/src/main/java/org/apache/sling/spi/resource/provider/ResolveContext.java
+++ b/src/main/java/org/apache/sling/spi/resource/provider/ResolveContext.java
@@ -18,8 +18,8 @@
*/
package org.apache.sling.spi.resource.provider;
-import javax.annotation.CheckForNull;
-import javax.annotation.Nonnull;
+import org.jetbrains.annotations.Nullable;
+import org.jetbrains.annotations.NotNull;
import org.apache.sling.api.resource.ResourceResolver;
import org.osgi.annotation.versioning.ProviderType;
@@ -40,20 +40,20 @@ public interface ResolveContext<T> {
* Get the current resource resolver.
* @return The resource resolver.
*/
- @Nonnull ResourceResolver getResourceResolver();
+ @NotNull ResourceResolver getResourceResolver();
/**
* This is the object returned by {@link
ResourceProvider#authenticate(Map)}
* @return The data object or {@code null}
*/
- @CheckForNull T getProviderState();
+ @Nullable T getProviderState();
/**
* Return a resolve context for the parent resource provider.
* @return A resolve context or {@code null} if there is no parent.
* @see #getParentResourceProvider()
*/
- @CheckForNull ResolveContext<?> getParentResolveContext();
+ @Nullable ResolveContext<?> getParentResolveContext();
/**
* Return the parent resource provider.
@@ -62,5 +62,5 @@ public interface ResolveContext<T> {
* instance.
* @return The parent provider or {@code null} if there is no parent.
*/
- @CheckForNull ResourceProvider<?> getParentResourceProvider();
+ @Nullable ResourceProvider<?> getParentResourceProvider();
}
diff --git
a/src/main/java/org/apache/sling/spi/resource/provider/ResourceContext.java
b/src/main/java/org/apache/sling/spi/resource/provider/ResourceContext.java
index fe56011..15c925f 100644
--- a/src/main/java/org/apache/sling/spi/resource/provider/ResourceContext.java
+++ b/src/main/java/org/apache/sling/spi/resource/provider/ResourceContext.java
@@ -20,7 +20,7 @@ package org.apache.sling.spi.resource.provider;
import java.util.Map;
-import javax.annotation.CheckForNull;
+import org.jetbrains.annotations.Nullable;
import org.osgi.annotation.versioning.ProviderType;
@@ -38,7 +38,7 @@ public interface ResourceContext {
* map could contain the path parameters of the url.
* @return A non empty map with parameters or {@code null}.
*/
- @CheckForNull Map<String, String> getResolveParameters();
+ @Nullable Map<String, String> getResolveParameters();
/**
* "Empty" instance, not providing any additional information.
diff --git
a/src/main/java/org/apache/sling/spi/resource/provider/ResourceProvider.java
b/src/main/java/org/apache/sling/spi/resource/provider/ResourceProvider.java
index 2171519..0ced2e6 100644
--- a/src/main/java/org/apache/sling/spi/resource/provider/ResourceProvider.java
+++ b/src/main/java/org/apache/sling/spi/resource/provider/ResourceProvider.java
@@ -22,8 +22,8 @@ import java.util.Collection;
import java.util.Iterator;
import java.util.Map;
-import javax.annotation.CheckForNull;
-import javax.annotation.Nonnull;
+import org.jetbrains.annotations.Nullable;
+import org.jetbrains.annotations.NotNull;
import org.apache.sling.api.resource.LoginException;
import org.apache.sling.api.resource.PersistenceException;
@@ -237,7 +237,7 @@ public abstract class ResourceProvider<T> {
* it is used in the resource tree.
* @param ctx The context for this provider.
*/
- public void start(@Nonnull ProviderContext ctx) {
+ public void start(@NotNull ProviderContext ctx) {
this.ctx = ctx;
}
@@ -268,7 +268,7 @@ public abstract class ResourceProvider<T> {
* @return The provider context or {@code null} if the provider is
currently
* not used in the resource tree.
*/
- protected @CheckForNull ProviderContext getProviderContext() {
+ protected @Nullable ProviderContext getProviderContext() {
return this.ctx;
}
@@ -321,7 +321,7 @@ public abstract class ResourceProvider<T> {
*
href="http://sling.apache.org/documentation/the-sling-engine/service-authentication.html">Service
* Authentication</a>
*/
- public @CheckForNull T authenticate(final @Nonnull Map<String, Object>
authenticationInfo)
+ public @Nullable T authenticate(final @NotNull Map<String, Object>
authenticationInfo)
throws LoginException {
return null;
}
@@ -332,7 +332,7 @@ public abstract class ResourceProvider<T> {
*
* @param state The provider state returned by {@link #authenticate(Map)}.
*/
- public void logout(final @CheckForNull T state) {
+ public void logout(final @Nullable T state) {
// do nothing
}
@@ -346,7 +346,7 @@ public abstract class ResourceProvider<T> {
*
* @param ctx The {@link ResolveContext}.
*/
- public void refresh(final @Nonnull ResolveContext<T> ctx) {
+ public void refresh(final @NotNull ResolveContext<T> ctx) {
// nothing to do here
}
@@ -365,7 +365,7 @@ public abstract class ResourceProvider<T> {
* yet and is still active.. Once the resource provider has been
closed
* or is not active anymore, this method returns {@code false}.
*/
- public boolean isLive(final @Nonnull ResolveContext<T> ctx) {
+ public boolean isLive(final @NotNull ResolveContext<T> ctx) {
return true;
}
@@ -386,7 +386,7 @@ public abstract class ResourceProvider<T> {
* @throws org.apache.sling.api.SlingException
* may be thrown in case of any problem creating the {@code
Resource} instance.
*/
- public @CheckForNull Resource getParent(final @Nonnull ResolveContext<T>
ctx, final @Nonnull Resource child) {
+ public @Nullable Resource getParent(final @NotNull ResolveContext<T> ctx,
final @NotNull Resource child) {
final String parentPath = ResourceUtil.getParent(child.getPath());
if (parentPath == null) {
return null;
@@ -414,10 +414,10 @@ public abstract class ResourceProvider<T> {
* @throws org.apache.sling.api.SlingException
* may be thrown in case of any problem creating the {@code
Resource} instance.
*/
- public abstract @CheckForNull Resource getResource(@Nonnull final
ResolveContext<T> ctx,
- @Nonnull final String path,
- @Nonnull final ResourceContext resourceContext,
- @CheckForNull final Resource parent);
+ public abstract @Nullable Resource getResource(@NotNull final
ResolveContext<T> ctx,
+ @NotNull final String path,
+ @NotNull final ResourceContext resourceContext,
+ @Nullable final Resource parent);
/**
* Returns an {@code Iterator} of {@link Resource} objects loaded from
@@ -449,7 +449,7 @@ public abstract class ResourceProvider<T> {
* @throws org.apache.sling.api.SlingException
* If any error occurs acquiring the child resource iterator.
*/
- public abstract @CheckForNull Iterator<Resource> listChildren(final
@Nonnull ResolveContext<T> ctx, final @Nonnull Resource parent);
+ public abstract @Nullable Iterator<Resource> listChildren(final @NotNull
ResolveContext<T> ctx, final @NotNull Resource parent);
/**
* Returns a collection of attribute names whose value can be retrieved
@@ -463,7 +463,7 @@ public abstract class ResourceProvider<T> {
* @throws IllegalStateException if this resource provider has already been
* closed.
*/
- public @CheckForNull Collection<String> getAttributeNames(final @Nonnull
ResolveContext<T> ctx) {
+ public @Nullable Collection<String> getAttributeNames(final @NotNull
ResolveContext<T> ctx) {
return null;
}
@@ -482,7 +482,7 @@ public abstract class ResourceProvider<T> {
* @throws IllegalStateException
* if this resource provider has already been closed.
*/
- public @CheckForNull Object getAttribute(final @Nonnull ResolveContext<T>
ctx, final @Nonnull String name) {
+ public @Nullable Object getAttribute(final @NotNull ResolveContext<T> ctx,
final @NotNull String name) {
return null;
}
@@ -504,7 +504,7 @@ public abstract class ResourceProvider<T> {
*
* @throws PersistenceException If anything fails
*/
- public @Nonnull Resource create(final @Nonnull ResolveContext<T> ctx,
final String path, final Map<String, Object> properties)
+ public @NotNull Resource create(final @NotNull ResolveContext<T> ctx,
final String path, final Map<String, Object> properties)
throws PersistenceException {
throw new PersistenceException("create is not supported.");
}
@@ -522,7 +522,7 @@ public abstract class ResourceProvider<T> {
*
* @throws PersistenceException If anything fails
*/
- public void delete(final @Nonnull ResolveContext<T> ctx, final @Nonnull
Resource resource)
+ public void delete(final @NotNull ResolveContext<T> ctx, final @NotNull
Resource resource)
throws PersistenceException {
throw new PersistenceException("delete is not supported.");
}
@@ -535,7 +535,7 @@ public abstract class ResourceProvider<T> {
*
* @param ctx The {@link ResolveContext}.
*/
- public void revert(final @Nonnull ResolveContext<T> ctx) {
+ public void revert(final @NotNull ResolveContext<T> ctx) {
// nothing to do here
}
@@ -548,7 +548,7 @@ public abstract class ResourceProvider<T> {
* @param ctx The {@link ResolveContext}.
* @throws PersistenceException If anything fails
*/
- public void commit(final @Nonnull ResolveContext<T> ctx)
+ public void commit(final @NotNull ResolveContext<T> ctx)
throws PersistenceException {
// nothing to do here
}
@@ -562,7 +562,7 @@ public abstract class ResourceProvider<T> {
* @param ctx The {@link ResolveContext}.
* @return {@code true} if there are pending changes.
*/
- public boolean hasChanges(final @Nonnull ResolveContext<T> ctx) {
+ public boolean hasChanges(final @NotNull ResolveContext<T> ctx) {
return false;
}
@@ -576,7 +576,7 @@ public abstract class ResourceProvider<T> {
*
* @return A query language provider if this resource provider supports
this type of querying.
*/
- public @CheckForNull QueryLanguageProvider<T> getQueryLanguageProvider() {
+ public @Nullable QueryLanguageProvider<T> getQueryLanguageProvider() {
return null;
}
@@ -600,8 +600,8 @@ public abstract class ResourceProvider<T> {
* @return The adapter target or {@code null} if the provider cannot
* be adapt to the requested type.
*/
- public @CheckForNull <AdapterType> AdapterType adaptTo(final @Nonnull
ResolveContext<T> ctx,
- final @Nonnull Class<AdapterType> type) {
+ public @Nullable <AdapterType> AdapterType adaptTo(final @NotNull
ResolveContext<T> ctx,
+ final @NotNull Class<AdapterType> type) {
return null;
}
@@ -627,9 +627,9 @@ public abstract class ResourceProvider<T> {
* @throws PersistenceException If an error occurs.
* @return {@code true} if the provider can perform the copy
*/
- public boolean copy(final @Nonnull ResolveContext<T> ctx,
- final @Nonnull String srcAbsPath,
- final @Nonnull String destAbsPath) throws PersistenceException {
+ public boolean copy(final @NotNull ResolveContext<T> ctx,
+ final @NotNull String srcAbsPath,
+ final @NotNull String destAbsPath) throws PersistenceException {
return false;
}
@@ -655,9 +655,9 @@ public abstract class ResourceProvider<T> {
* @throws PersistenceException If an error occurs.
* @return {@code true} if the provider can perform the move
*/
- public boolean move(final @Nonnull ResolveContext<T> ctx,
- final @Nonnull String srcAbsPath,
- final @Nonnull String destAbsPath) throws PersistenceException {
+ public boolean move(final @NotNull ResolveContext<T> ctx,
+ final @NotNull String srcAbsPath,
+ final @NotNull String destAbsPath) throws PersistenceException {
return false;
}
}
diff --git
a/src/main/java/org/apache/sling/spi/resource/provider/package-info.java
b/src/main/java/org/apache/sling/spi/resource/provider/package-info.java
index f0818be..866f004 100644
--- a/src/main/java/org/apache/sling/spi/resource/provider/package-info.java
+++ b/src/main/java/org/apache/sling/spi/resource/provider/package-info.java
@@ -17,7 +17,7 @@
* under the License.
*/
-@Version("1.2.0")
+@Version("1.2.1")
package org.apache.sling.spi.resource.provider;
import org.osgi.annotation.versioning.Version;