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 2024/04/09 08:41:44 UTC
(sling-org-apache-sling-contentparser-xml) branch feature/SLING-12281-parent-60 created (now c74bfdc)
This is an automated email from the ASF dual-hosted git repository.
sseifert pushed a change to branch feature/SLING-12281-parent-60
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-contentparser-xml.git
at c74bfdc SLING-12281 ignore spotless code reformatting commit in git blame
This branch includes the following new commits:
new 5b7a0d3 SLING-12281 Update to Parent 60, Java 11 Minimum Version
new fbd2043 SLING-12281 apply spotless code formatting
new c74bfdc SLING-12281 ignore spotless code reformatting commit in git blame
The 3 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.
(sling-org-apache-sling-contentparser-xml) 03/03: SLING-12281 ignore spotless code reformatting commit in git blame
Posted by ss...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
sseifert pushed a commit to branch feature/SLING-12281-parent-60
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-contentparser-xml.git
commit c74bfdc6d4fd784c5bf9dd1ac13705e409b4472a
Author: Stefan Seifert <st...@users.noreply.github.com>
AuthorDate: Tue Apr 9 10:40:20 2024 +0200
SLING-12281 ignore spotless code reformatting commit in git blame
---
.git-blame-ignore-revs | 1 +
1 file changed, 1 insertion(+)
diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs
new file mode 100644
index 0000000..6cb1e68
--- /dev/null
+++ b/.git-blame-ignore-revs
@@ -0,0 +1 @@
+fbd204302edd7f5c27be5199b20b5795e2398337
\ No newline at end of file
(sling-org-apache-sling-contentparser-xml) 02/03: SLING-12281 apply spotless code formatting
Posted by ss...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
sseifert pushed a commit to branch feature/SLING-12281-parent-60
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-contentparser-xml.git
commit fbd204302edd7f5c27be5199b20b5795e2398337
Author: Stefan Seifert <st...@users.noreply.github.com>
AuthorDate: Tue Apr 9 10:33:21 2024 +0200
SLING-12281 apply spotless code formatting
---
pom.xml | 32 ++++++------
.../xml/internal/XMLContentParser.java | 58 ++++++++++------------
.../xml/internal/XMLContentParserTest.java | 55 ++++++++++----------
3 files changed, 72 insertions(+), 73 deletions(-)
diff --git a/pom.xml b/pom.xml
index f04d783..8d4b9a0 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
+<?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
@@ -30,29 +30,15 @@
<version>2.0.1-SNAPSHOT</version>
<name>Apache Sling Content Parser for XML</name>
- <description>
- Apache Sling Content Parser for resource trees stored in XML files
- </description>
+ <description>Apache Sling Content Parser for resource trees stored in XML files</description>
<scm>
<connection>scm:git:https://gitbox.apache.org/repos/asf/sling-org-apache-sling-contentparser-xml.git</connection>
<developerConnection>scm:git:https://gitbox.apache.org/repos/asf/sling-org-apache-sling-contentparser-xml.git</developerConnection>
- <url>https://github.com/apache/sling-org-apache-sling-contentparser-xml.git</url>
<tag>HEAD</tag>
+ <url>https://github.com/apache/sling-org-apache-sling-contentparser-xml.git</url>
</scm>
- <build>
- <plugins>
- <plugin>
- <groupId>biz.aQute.bnd</groupId>
- <artifactId>bnd-baseline-maven-plugin</artifactId>
- <configuration>
- <failOnMissing>false</failOnMissing>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
<dependencies>
<dependency>
<groupId>org.apache.sling</groupId>
@@ -83,4 +69,16 @@
<scope>test</scope>
</dependency>
</dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>biz.aQute.bnd</groupId>
+ <artifactId>bnd-baseline-maven-plugin</artifactId>
+ <configuration>
+ <failOnMissing>false</failOnMissing>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
</project>
diff --git a/src/main/java/org/apache/sling/contentparser/xml/internal/XMLContentParser.java b/src/main/java/org/apache/sling/contentparser/xml/internal/XMLContentParser.java
index 7a9612e..6776b44 100644
--- a/src/main/java/org/apache/sling/contentparser/xml/internal/XMLContentParser.java
+++ b/src/main/java/org/apache/sling/contentparser/xml/internal/XMLContentParser.java
@@ -1,23 +1,27 @@
-/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ~ 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.
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
package org.apache.sling.contentparser.xml.internal;
+import javax.xml.XMLConstants;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+
import java.io.IOException;
import java.io.InputStream;
import java.math.BigDecimal;
@@ -26,10 +30,6 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import javax.xml.XMLConstants;
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-
import org.apache.commons.lang3.StringUtils;
import org.apache.sling.contentparser.api.ContentHandler;
import org.apache.sling.contentparser.api.ContentParser;
@@ -45,11 +45,7 @@ import org.w3c.dom.NodeList;
* Parses XML files that contains content fragments.
* Instance of this class is thread-safe.
*/
-@Component(
- property = {
- ContentParser.SERVICE_PROPERTY_CONTENT_TYPE + "=xml"
- }
-)
+@Component(property = {ContentParser.SERVICE_PROPERTY_CONTENT_TYPE + "=xml"})
public final class XMLContentParser implements ContentParser {
private static final String JCR_PRIMARY_TYPE = "jcr:primaryType";
@@ -79,7 +75,8 @@ public final class XMLContentParser implements ContentParser {
}
}
- private void parse(ContentHandler handler, Element element, ParserOptions parserOptions, String parentPath) throws IOException {
+ private void parse(ContentHandler handler, Element element, ParserOptions parserOptions, String parentPath)
+ throws IOException {
// build node path
String path;
if (parentPath == null) {
@@ -99,7 +96,8 @@ public final class XMLContentParser implements ContentParser {
// primary node type and mixins
String primaryType = getChildText(element, "primaryNodeType");
- if (StringUtils.isNotBlank(primaryType) && !parserOptions.getIgnorePropertyNames().contains(JCR_PRIMARY_TYPE)) {
+ if (StringUtils.isNotBlank(primaryType)
+ && !parserOptions.getIgnorePropertyNames().contains(JCR_PRIMARY_TYPE)) {
properties.put(JCR_PRIMARY_TYPE, primaryType);
}
String[] mixins = getChildTextArray(element, "mixinNodeType");
@@ -155,7 +153,6 @@ public final class XMLContentParser implements ContentParser {
for (Element node : nodeElements) {
parse(handler, node, parserOptions, path);
}
-
}
private List<Element> getChildren(Element element, String childName) {
@@ -225,5 +222,4 @@ public final class XMLContentParser implements ContentParser {
}
return ParserHelper.convertSingleTypeArray(result);
}
-
}
diff --git a/src/test/java/org/apache/sling/contentparser/xml/internal/XMLContentParserTest.java b/src/test/java/org/apache/sling/contentparser/xml/internal/XMLContentParserTest.java
index a801746..0709249 100644
--- a/src/test/java/org/apache/sling/contentparser/xml/internal/XMLContentParserTest.java
+++ b/src/test/java/org/apache/sling/contentparser/xml/internal/XMLContentParserTest.java
@@ -1,21 +1,21 @@
-/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ~ 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.
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
package org.apache.sling.contentparser.xml.internal;
import java.io.File;
@@ -70,9 +70,10 @@ public class XMLContentParserTest {
assertEquals(new BigDecimal("1.2345"), props.get("decimalProp"));
assertEquals(true, props.get("booleanProp"));
- assertArrayEquals(new Long[]{1234567890123L, 55L}, (Long[]) props.get("longPropMulti"));
- assertArrayEquals(new BigDecimal[]{new BigDecimal("1.2345"), new BigDecimal("1.1")}, (BigDecimal[]) props.get("decimalPropMulti"));
- assertArrayEquals(new Boolean[]{true, false}, (Boolean[]) props.get("booleanPropMulti"));
+ assertArrayEquals(new Long[] {1234567890123L, 55L}, (Long[]) props.get("longPropMulti"));
+ assertArrayEquals(new BigDecimal[] {new BigDecimal("1.2345"), new BigDecimal("1.1")}, (BigDecimal[])
+ props.get("decimalPropMulti"));
+ assertArrayEquals(new Boolean[] {true, false}, (Boolean[]) props.get("booleanPropMulti"));
}
@Test
@@ -132,9 +133,14 @@ public class XMLContentParserTest {
@Test
public void testIgnoreResourcesProperties() throws Exception {
- ContentElement content = TestUtils.parse(underTest,
- new ParserOptions().ignoreResourceNames(Collections.unmodifiableSet(new HashSet<>(Arrays.asList("header", "newslist"))))
- .ignorePropertyNames(Collections.unmodifiableSet(new HashSet<>(Collections.singletonList("jcr:title")))), file);
+ ContentElement content = TestUtils.parse(
+ underTest,
+ new ParserOptions()
+ .ignoreResourceNames(
+ Collections.unmodifiableSet(new HashSet<>(Arrays.asList("header", "newslist"))))
+ .ignorePropertyNames(
+ Collections.unmodifiableSet(new HashSet<>(Collections.singletonList("jcr:title")))),
+ file);
ContentElement child = content.getChild("jcr:content");
assertNotNull("Expected child at jcr:content", child);
Map<String, Object> props = child.getProperties();
@@ -166,5 +172,4 @@ public class XMLContentParserTest {
invalidChild = content.getChild("/jcr:content");
assertNull(invalidChild);
}
-
}
(sling-org-apache-sling-contentparser-xml) 01/03: SLING-12281 Update to Parent 60, Java 11 Minimum Version
Posted by ss...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
sseifert pushed a commit to branch feature/SLING-12281-parent-60
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-contentparser-xml.git
commit 5b7a0d3ec3ba3ac288577e191dc16fcf3b68f931
Author: Stefan Seifert <st...@users.noreply.github.com>
AuthorDate: Tue Apr 9 10:30:40 2024 +0200
SLING-12281 Update to Parent 60, Java 11 Minimum Version
---
.sling-module.json | 5 +++++
pom.xml | 2 +-
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/.sling-module.json b/.sling-module.json
new file mode 100644
index 0000000..cfad4d2
--- /dev/null
+++ b/.sling-module.json
@@ -0,0 +1,5 @@
+{
+ "jenkins": {
+ "jdks": [17, 21]
+ }
+}
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
index 88be1fc..f04d783 100644
--- a/pom.xml
+++ b/pom.xml
@@ -22,7 +22,7 @@
<parent>
<groupId>org.apache.sling</groupId>
<artifactId>sling-bundle-parent</artifactId>
- <version>52</version>
+ <version>60</version>
<relativePath />
</parent>