You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ss...@apache.org on 2017/12/01 15:00:39 UTC
[sling-org-apache-sling-models-impl] branch master updated (09f4505
-> 2e2d545)
This is an automated email from the ASF dual-hosted git repository.
sseifert pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-models-impl.git.
from 09f4505 SLING-7213 - Add a default .gitignore file to every module
new 3c7bd79 ignore dependency-reduced-pom.xml
new 2e2d545 cosmetic: eliminate some code warnings, organize imports
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:
.gitignore | 1 +
.../org/apache/sling/models/impl/ExportServlet.java | 17 ++++++++---------
.../impl/ResourceOverridingRequestWrapper.java | 21 ++++++++++-----------
.../sling/models/impl/AdapterFactoryTest.java | 6 ++++++
.../sling/models/impl/AnnotationConflictsTest.java | 2 ++
.../apache/sling/models/impl/PostConstructTest.java | 2 +-
6 files changed, 28 insertions(+), 21 deletions(-)
--
To stop receiving notification emails like this one, please contact
['"commits@sling.apache.org" <co...@sling.apache.org>'].
[sling-org-apache-sling-models-impl] 02/02: cosmetic: eliminate
some code warnings, organize imports
Posted by ss...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
sseifert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-models-impl.git
commit 2e2d545d1f954bc9f773a0e4151065fb6392ca2d
Author: sseifert <ss...@pro-vision.de>
AuthorDate: Fri Dec 1 16:00:32 2017 +0100
cosmetic: eliminate some code warnings, organize imports
---
.../org/apache/sling/models/impl/ExportServlet.java | 17 ++++++++---------
.../impl/ResourceOverridingRequestWrapper.java | 21 ++++++++++-----------
.../sling/models/impl/AdapterFactoryTest.java | 6 ++++++
.../sling/models/impl/AnnotationConflictsTest.java | 2 ++
.../apache/sling/models/impl/PostConstructTest.java | 2 +-
5 files changed, 27 insertions(+), 21 deletions(-)
diff --git a/src/main/java/org/apache/sling/models/impl/ExportServlet.java b/src/main/java/org/apache/sling/models/impl/ExportServlet.java
index 433c118..2ac4b33 100644
--- a/src/main/java/org/apache/sling/models/impl/ExportServlet.java
+++ b/src/main/java/org/apache/sling/models/impl/ExportServlet.java
@@ -18,17 +18,20 @@
*/
package org.apache.sling.models.impl;
+import static org.apache.sling.api.scripting.SlingBindings.LOG;
+import static org.apache.sling.api.scripting.SlingBindings.OUT;
+import static org.apache.sling.api.scripting.SlingBindings.READER;
+import static org.apache.sling.api.scripting.SlingBindings.REQUEST;
+import static org.apache.sling.api.scripting.SlingBindings.RESOURCE;
+import static org.apache.sling.api.scripting.SlingBindings.RESPONSE;
+import static org.apache.sling.api.scripting.SlingBindings.SLING;
+
import java.io.BufferedReader;
import java.io.IOException;
import java.io.StringReader;
-import java.util.Arrays;
-import java.util.Collection;
import java.util.HashMap;
-import java.util.HashSet;
import java.util.Map;
-import java.util.Set;
-import javax.script.ScriptEngineFactory;
import javax.script.SimpleBindings;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletResponse;
@@ -41,16 +44,12 @@ import org.apache.sling.api.servlets.SlingSafeMethodsServlet;
import org.apache.sling.models.factory.ExportException;
import org.apache.sling.models.factory.MissingExporterException;
import org.apache.sling.models.factory.ModelFactory;
-import org.apache.sling.scripting.api.BindingsValuesProvider;
import org.apache.sling.scripting.api.BindingsValuesProvidersByContext;
import org.apache.sling.scripting.core.ScriptHelper;
-import org.apache.sling.scripting.core.impl.helper.ProtectedBindings;
import org.osgi.framework.BundleContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import static org.apache.sling.api.scripting.SlingBindings.*;
-
@SuppressWarnings("serial")
class ExportServlet extends SlingSafeMethodsServlet {
diff --git a/src/main/java/org/apache/sling/models/impl/ResourceOverridingRequestWrapper.java b/src/main/java/org/apache/sling/models/impl/ResourceOverridingRequestWrapper.java
index cd44f93..803e040 100644
--- a/src/main/java/org/apache/sling/models/impl/ResourceOverridingRequestWrapper.java
+++ b/src/main/java/org/apache/sling/models/impl/ResourceOverridingRequestWrapper.java
@@ -16,23 +16,22 @@
*/
package org.apache.sling.models.impl;
+import static org.apache.sling.api.scripting.SlingBindings.LOG;
+import static org.apache.sling.api.scripting.SlingBindings.OUT;
+import static org.apache.sling.api.scripting.SlingBindings.READER;
+import static org.apache.sling.api.scripting.SlingBindings.REQUEST;
+import static org.apache.sling.api.scripting.SlingBindings.RESOURCE;
+import static org.apache.sling.api.scripting.SlingBindings.RESPONSE;
+import static org.apache.sling.api.scripting.SlingBindings.SLING;
+
+import javax.script.SimpleBindings;
+
import org.apache.sling.api.SlingHttpServletRequest;
import org.apache.sling.api.adapter.AdapterManager;
import org.apache.sling.api.resource.Resource;
import org.apache.sling.api.scripting.SlingBindings;
import org.apache.sling.api.wrappers.SlingHttpServletRequestWrapper;
-import org.apache.sling.scripting.api.BindingsValuesProvider;
import org.apache.sling.scripting.api.BindingsValuesProvidersByContext;
-import org.apache.sling.scripting.core.impl.helper.ProtectedBindings;
-
-import javax.script.ScriptEngineFactory;
-import javax.script.SimpleBindings;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Set;
-
-import static org.apache.sling.api.scripting.SlingBindings.*;
/**
* This request wrapper allows to adapt the given resource and request to a Sling Model
diff --git a/src/test/java/org/apache/sling/models/impl/AdapterFactoryTest.java b/src/test/java/org/apache/sling/models/impl/AdapterFactoryTest.java
index a08be88..96bdc56 100644
--- a/src/test/java/org/apache/sling/models/impl/AdapterFactoryTest.java
+++ b/src/test/java/org/apache/sling/models/impl/AdapterFactoryTest.java
@@ -177,6 +177,7 @@ public class AdapterFactoryTest {
}
@Test
+ @SuppressWarnings("unchecked")
public void testSelectExporterByName() throws Exception {
Result<Object> result = mock(Result.class);
when(result.wasSuccessful()).thenReturn(true);
@@ -187,6 +188,7 @@ public class AdapterFactoryTest {
}
@Test
+ @SuppressWarnings("unchecked")
public void testSelectExporterByType() throws Exception {
Result<Object> result = mock(Result.class);
when(result.wasSuccessful()).thenReturn(true);
@@ -197,6 +199,7 @@ public class AdapterFactoryTest {
}
@Test(expected = MissingExporterException.class)
+ @SuppressWarnings("unchecked")
public void testSelectExporterByNameAndWrongType() throws Exception {
Result<Object> result = mock(Result.class);
when(result.wasSuccessful()).thenReturn(true);
@@ -213,6 +216,7 @@ public class AdapterFactoryTest {
@CheckForNull
@Override
+ @SuppressWarnings("unchecked")
public <T> T export(@Nonnull Object o, @Nonnull Class<T> aClass, @Nonnull Map<String, String> map) throws ExportException {
if (aClass == String.class) {
return (T) "Export from first";
@@ -228,6 +232,7 @@ public class AdapterFactoryTest {
}
}
+ @SuppressWarnings("unchecked")
private static class SecondStringExporter implements ModelExporter {
@Override
public boolean isSupported(@Nonnull Class<?> aClass) {
@@ -251,6 +256,7 @@ public class AdapterFactoryTest {
}
}
+ @SuppressWarnings("unchecked")
private static class FirstIntegerExporter implements ModelExporter {
@Override
public boolean isSupported(@Nonnull Class<?> aClass) {
diff --git a/src/test/java/org/apache/sling/models/impl/AnnotationConflictsTest.java b/src/test/java/org/apache/sling/models/impl/AnnotationConflictsTest.java
index 4f2ba80..fef63b1 100644
--- a/src/test/java/org/apache/sling/models/impl/AnnotationConflictsTest.java
+++ b/src/test/java/org/apache/sling/models/impl/AnnotationConflictsTest.java
@@ -78,6 +78,7 @@ public class AnnotationConflictsTest {
}
@Test
+ @SuppressWarnings("unchecked")
public void testSucessfulAdaptations() {
for (Class<?> clazz : this.getClass().getDeclaredClasses()) {
if (!clazz.isInterface() && clazz.getSimpleName().startsWith("Successful")) {
@@ -87,6 +88,7 @@ public class AnnotationConflictsTest {
}
@Test
+ @SuppressWarnings("unchecked")
public void testFailingAdaptations() {
for (Class<?> clazz : this.getClass().getDeclaredClasses()) {
if (!clazz.isInterface() && clazz.getSimpleName().startsWith("Failing")) {
diff --git a/src/test/java/org/apache/sling/models/impl/PostConstructTest.java b/src/test/java/org/apache/sling/models/impl/PostConstructTest.java
index b6ba448..8b476f2 100644
--- a/src/test/java/org/apache/sling/models/impl/PostConstructTest.java
+++ b/src/test/java/org/apache/sling/models/impl/PostConstructTest.java
@@ -96,7 +96,7 @@ public class PostConstructTest {
@Test(expected = IllegalStateException.class)
public void testPostConstructMethodWhichReturnsFalseCreateModel() {
- FalsePostConstuctModel model = factory.createModel(resource, FalsePostConstuctModel.class);
+ factory.createModel(resource, FalsePostConstuctModel.class);
}
@Test
--
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.
[sling-org-apache-sling-models-impl] 01/02: ignore
dependency-reduced-pom.xml
Posted by ss...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
sseifert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-models-impl.git
commit 3c7bd79543f7b6cbde81c00567c80afffb02dc60
Author: sseifert <ss...@pro-vision.de>
AuthorDate: Fri Dec 1 16:00:04 2017 +0100
ignore dependency-reduced-pom.xml
---
.gitignore | 1 +
1 file changed, 1 insertion(+)
diff --git a/.gitignore b/.gitignore
index 5b783ed..12746f7 100644
--- a/.gitignore
+++ b/.gitignore
@@ -15,3 +15,4 @@ maven-eclipse.xml
.DS_Store
jcr.log
atlassian-ide-plugin.xml
+dependency-reduced-pom.xml
--
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.