You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by dk...@apache.org on 2019/11/01 18:49:44 UTC
[sling-org-apache-sling-app-cms] branch master updated (0e49770 ->
c4663a3)
This is an automated email from the ASF dual-hosted git repository.
dklco pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-app-cms.git.
from 0e49770 Ignoring Sonar false flag
new 00297c0 Minor - Fixing Findbugs issues
new c4663a3 Minor - Fixing the version of thumbnailator so it doesn't occasionally use an unreleased 0.4.9 version on builds
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.../main/java/org/apache/sling/cms/AuthorizableWrapper.java | 8 ++++++++
.../java/org/apache/sling/cms/core/internal/CommonUtils.java | 3 +++
.../sling/cms/core/internal/filters/EditIncludeFilter.java | 4 ++--
.../cms/core/internal/models/AuthorizableWrapperImpl.java | 3 +--
.../sling/cms/core/internal/operations/MembersOperation.java | 4 +---
.../cms/core/internal/operations/MembershipOperation.java | 7 +++----
.../sling/cms/core/internal/rewriter/HTML5Serializer.java | 3 +--
.../java/org/apache/sling/cms/core/models/SearchResults.java | 2 +-
pom.xml | 10 +++++-----
9 files changed, 25 insertions(+), 19 deletions(-)
[sling-org-apache-sling-app-cms] 02/02: Minor - Fixing the version
of thumbnailator so it doesn't occasionally use an unreleased 0.4.9 version
on builds
Posted by dk...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
dklco pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-app-cms.git
commit c4663a33ac7daceac59aae7802b7d2968eff2783
Author: Dan Klco <dk...@apache.org>
AuthorDate: Fri Nov 1 14:49:36 2019 -0400
Minor - Fixing the version of thumbnailator so it doesn't occasionally use an unreleased 0.4.9 version on builds
---
pom.xml | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/pom.xml b/pom.xml
index c941211..bb013be 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional
- information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except
- in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to
- in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See
+<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional
+ information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except
+ in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to
+ in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See
the License for the specific language governing permissions and limitations under the License. -->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
@@ -250,7 +250,7 @@
<dependency>
<groupId>net.coobird</groupId>
<artifactId>thumbnailator</artifactId>
- <version>[0.4, 0.5)</version>
+ <version>0.4.8</version>
<scope>provided</scope>
</dependency>
<dependency>
[sling-org-apache-sling-app-cms] 01/02: Minor - Fixing Findbugs
issues
Posted by dk...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
dklco pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-app-cms.git
commit 00297c075f216302305a418d7fea753a8dfafc23
Author: Dan Klco <dk...@apache.org>
AuthorDate: Fri Nov 1 14:49:00 2019 -0400
Minor - Fixing Findbugs issues
---
api/src/main/java/org/apache/sling/cms/AuthorizableWrapper.java | 8 ++++++++
.../main/java/org/apache/sling/cms/core/internal/CommonUtils.java | 3 +++
.../apache/sling/cms/core/internal/filters/EditIncludeFilter.java | 4 ++--
.../sling/cms/core/internal/models/AuthorizableWrapperImpl.java | 3 +--
.../sling/cms/core/internal/operations/MembersOperation.java | 4 +---
.../sling/cms/core/internal/operations/MembershipOperation.java | 7 +++----
.../apache/sling/cms/core/internal/rewriter/HTML5Serializer.java | 3 +--
.../main/java/org/apache/sling/cms/core/models/SearchResults.java | 2 +-
8 files changed, 20 insertions(+), 14 deletions(-)
diff --git a/api/src/main/java/org/apache/sling/cms/AuthorizableWrapper.java b/api/src/main/java/org/apache/sling/cms/AuthorizableWrapper.java
index 417f420..5408aab 100644
--- a/api/src/main/java/org/apache/sling/cms/AuthorizableWrapper.java
+++ b/api/src/main/java/org/apache/sling/cms/AuthorizableWrapper.java
@@ -20,6 +20,7 @@ import java.util.Iterator;
import org.apache.jackrabbit.api.security.user.Authorizable;
import org.apache.jackrabbit.api.security.user.Group;
+import org.jetbrains.annotations.NotNull;
/**
* A wrapper for working with JackRabbit Authorizables in JSPs and Sling Models
@@ -32,6 +33,7 @@ public interface AuthorizableWrapper {
*
* @return a JackRabbit Authorizable
*/
+ @NotNull
Authorizable getAuthorizable();
/**
@@ -40,6 +42,7 @@ public interface AuthorizableWrapper {
*
* @return the declared members of this authorizable
*/
+ @NotNull
Iterator<Authorizable> getDeclaredMembers();
/**
@@ -47,6 +50,7 @@ public interface AuthorizableWrapper {
*
* @return the direct membership
*/
+ @NotNull
Iterator<Group> getDeclaredMembership();
/**
@@ -55,6 +59,7 @@ public interface AuthorizableWrapper {
*
* @return the groups the user belongs to
*/
+ @NotNull
Iterator<String> getGroupNames();
/**
@@ -62,6 +67,7 @@ public interface AuthorizableWrapper {
*
* @return the current user's ID
*/
+ @NotNull
public String getId();
/**
@@ -70,6 +76,7 @@ public interface AuthorizableWrapper {
*
* @return the transitive members of this authorizable
*/
+ @NotNull
Iterator<Authorizable> getMembers();
/**
@@ -77,6 +84,7 @@ public interface AuthorizableWrapper {
*
* @return the transitive membership
*/
+ @NotNull
Iterator<Group> getMembership();
/**
diff --git a/core/src/main/java/org/apache/sling/cms/core/internal/CommonUtils.java b/core/src/main/java/org/apache/sling/cms/core/internal/CommonUtils.java
index 1f411d8..29992ab 100644
--- a/core/src/main/java/org/apache/sling/cms/core/internal/CommonUtils.java
+++ b/core/src/main/java/org/apache/sling/cms/core/internal/CommonUtils.java
@@ -31,6 +31,9 @@ public class CommonUtils {
private static final Logger log = LoggerFactory.getLogger(CommonUtils.class);
+ private CommonUtils() {
+ }
+
public static final UserManager getUserManager(ResourceResolver resolver) throws RepositoryException {
return Optional.ofNullable(resolver.adaptTo(Session.class)).map(session -> {
UserManager userManager = null;
diff --git a/core/src/main/java/org/apache/sling/cms/core/internal/filters/EditIncludeFilter.java b/core/src/main/java/org/apache/sling/cms/core/internal/filters/EditIncludeFilter.java
index b770257..946c6b0 100644
--- a/core/src/main/java/org/apache/sling/cms/core/internal/filters/EditIncludeFilter.java
+++ b/core/src/main/java/org/apache/sling/cms/core/internal/filters/EditIncludeFilter.java
@@ -67,7 +67,7 @@ public class EditIncludeFilter implements Filter {
SlingHttpServletRequest slingRequest = (SlingHttpServletRequest) request;
Resource resource = slingRequest.getResource();
Boolean container = isContainer(resource);
- Boolean writeDropTarget = shouldWriteDropTarget(slingRequest);
+ boolean writeDropTarget = shouldWriteDropTarget(slingRequest);
writer = response.getWriter();
if (writeDropTarget) {
this.writeDropTarget(resource, writer, "before " + resource.getName());
@@ -96,7 +96,7 @@ public class EditIncludeFilter implements Filter {
private boolean isContainer(Resource resource) {
EditableResource er = new EditableResourceImpl(resource);
- if (er != null && er.getComponent() != null) {
+ if (er.getComponent() != null) {
return er.getComponent().isContainer();
} else {
return false;
diff --git a/core/src/main/java/org/apache/sling/cms/core/internal/models/AuthorizableWrapperImpl.java b/core/src/main/java/org/apache/sling/cms/core/internal/models/AuthorizableWrapperImpl.java
index a170163..add2b3b 100644
--- a/core/src/main/java/org/apache/sling/cms/core/internal/models/AuthorizableWrapperImpl.java
+++ b/core/src/main/java/org/apache/sling/cms/core/internal/models/AuthorizableWrapperImpl.java
@@ -48,8 +48,7 @@ public class AuthorizableWrapperImpl implements AuthorizableWrapper {
authorizable = CommonUtils.getUserManager(resolver).getAuthorizable(resolver.getUserID());
}
- public AuthorizableWrapperImpl(Resource resource)
- throws AccessDeniedException, UnsupportedRepositoryOperationException, RepositoryException {
+ public AuthorizableWrapperImpl(Resource resource) throws RepositoryException {
this.authorizable = CommonUtils.getUserManager(resource.getResourceResolver())
.getAuthorizableByPath(resource.getPath());
if (authorizable == null) {
diff --git a/core/src/main/java/org/apache/sling/cms/core/internal/operations/MembersOperation.java b/core/src/main/java/org/apache/sling/cms/core/internal/operations/MembersOperation.java
index c21c661..4a9f855 100644
--- a/core/src/main/java/org/apache/sling/cms/core/internal/operations/MembersOperation.java
+++ b/core/src/main/java/org/apache/sling/cms/core/internal/operations/MembersOperation.java
@@ -52,9 +52,7 @@ public class MembersOperation implements PostOperation {
try {
List<String> auths = new ArrayList<>();
- Optional.ofNullable(request.getParameterValues(PN_MEMBERS)).ifPresent(p -> {
- auths.addAll(Arrays.asList(p));
- });
+ Optional.ofNullable(request.getParameterValues(PN_MEMBERS)).ifPresent(p -> auths.addAll(Arrays.asList(p)));
AuthorizableWrapper groupWrapper = request.getResource().adaptTo(AuthorizableWrapper.class);
if (!groupWrapper.getAuthorizable().isGroup()) {
diff --git a/core/src/main/java/org/apache/sling/cms/core/internal/operations/MembershipOperation.java b/core/src/main/java/org/apache/sling/cms/core/internal/operations/MembershipOperation.java
index 36e49c1..a814614 100644
--- a/core/src/main/java/org/apache/sling/cms/core/internal/operations/MembershipOperation.java
+++ b/core/src/main/java/org/apache/sling/cms/core/internal/operations/MembershipOperation.java
@@ -52,10 +52,9 @@ public class MembershipOperation implements PostOperation {
try {
List<String> groups = new ArrayList<>();
- Optional.ofNullable(request.getParameterValues(PN_MEMBERSHIP)).ifPresent(p -> {
- groups.addAll(Arrays.asList(p));
- });
-
+ Optional.ofNullable(request.getParameterValues(PN_MEMBERSHIP))
+ .ifPresent(p -> groups.addAll(Arrays.asList(p)));
+
AuthorizableWrapper authWrapper = request.getResource().adaptTo(AuthorizableWrapper.class);
Authorizable auth = authWrapper.getAuthorizable();
diff --git a/core/src/main/java/org/apache/sling/cms/core/internal/rewriter/HTML5Serializer.java b/core/src/main/java/org/apache/sling/cms/core/internal/rewriter/HTML5Serializer.java
index 35976a4..4b5627c 100644
--- a/core/src/main/java/org/apache/sling/cms/core/internal/rewriter/HTML5Serializer.java
+++ b/core/src/main/java/org/apache/sling/cms/core/internal/rewriter/HTML5Serializer.java
@@ -47,8 +47,7 @@ public class HTML5Serializer implements Serializer {
private static final Set<String> emptyTags = new HashSet<>();
static {
emptyTags.addAll(Arrays.asList("br", "area", "link", "img", "param", "hr", "input", "col", "base", "meta"));
-
- };
+ }
private PrintWriter writer;
private ConfigurationResourceResolver resolver;
diff --git a/core/src/main/java/org/apache/sling/cms/core/models/SearchResults.java b/core/src/main/java/org/apache/sling/cms/core/models/SearchResults.java
index 0327419..c1628ec 100644
--- a/core/src/main/java/org/apache/sling/cms/core/models/SearchResults.java
+++ b/core/src/main/java/org/apache/sling/cms/core/models/SearchResults.java
@@ -55,7 +55,7 @@ public class SearchResults {
path = request.getParameter("path");
}
- term = Text.escapeIllegalXpathSearchChars(request.getParameter("term")).replaceAll("'", "''");
+ term = Text.escapeIllegalXpathSearchChars(request.getParameter("term")).replace("'", "''");
this.request = request;
}