Re: [VOTE] Release Apache Sling OSGi Feature Maven Plugin 1.8.4

2024-06-25 Thread Jörg Hoh
+1

Am Fr., 21. Juni 2024 um 23:13 Uhr schrieb Robert Munteanu <
romb...@apache.org>:

> Hi,
>
> We solved 4 issues in this release:
>
> https://issues.apache.org/jira/secure/ReleaseNote.jspa?projectId=12310710=12354617=Text
>
> Staging repository:
> https://repository.apache.org/content/repositories/orgapachesling-2868/
>
> You can use this UNIX script to download the release and verify the
> signatures:
>
> https://raw.githubusercontent.com/apache/sling-tooling-release/master/check_staged_release.sh
>
> Usage:
> sh check_staged_release.sh 2868 /tmp/sling-staging
>
> Please vote to approve this release:
>
>   [ ] +1 Approve the release
>   [ ]  0 Don't care
>   [ ] -1 Don't release, because ...
>
> This majority vote is open for at least 72 hours.
>
> Regards,
> Robert Munteanu
>


-- 
https://cqdump.joerghoh.de


Re: [VOTE] Release Apache Sling Feature Model Analyser 2.0.8

2024-06-25 Thread Jörg Hoh
+1

Am Fr., 21. Juni 2024 um 23:14 Uhr schrieb Robert Munteanu <
romb...@apache.org>:

> Hi,
>
> We solved 3 issues in this release:
>
> https://issues.apache.org/jira/secure/ReleaseNote.jspa?projectId=12310710=12354844=Text
>
> Staging repository:
> https://repository.apache.org/content/repositories/orgapachesling-2869/
>
> You can use this UNIX script to download the release and verify the
> signatures:
>
> https://raw.githubusercontent.com/apache/sling-tooling-release/master/check_staged_release.sh
>
> Usage:
> sh check_staged_release.sh 2869 /tmp/sling-staging
>
> Please vote to approve this release:
>
>   [ ] +1 Approve the release
>   [ ]  0 Don't care
>   [ ] -1 Don't release, because ...
>
> This majority vote is open for at least 72 hours.
>
> Regards,
> Robert Munteanu
>


-- 
https://cqdump.joerghoh.de


Re: [VOTE] Release Apache Sling Models API 1.5.2, Models Implementation 1.7.0

2024-06-25 Thread Robert Munteanu
On Tue, 2024-06-25 at 15:08 +, Stefan Seifert wrote:
> Please vote to approve this release:

+1
Robert


RE: [VOTE] Release Apache Sling Models API 1.5.2, Models Implementation 1.7.0

2024-06-25 Thread Stefan Seifert
+1

stefan


[VOTE] Release Apache Sling Models API 1.5.2, Models Implementation 1.7.0

2024-06-25 Thread Stefan Seifert
Hi,

Models API 1.5.2  (3 issues)
https://issues.apache.org/jira/secure/ReleaseNote.jspa?version=12353054=Text=12310710

Models Implementation 1.7.0  (4 issues)
https://issues.apache.org/jira/secure/ReleaseNote.jspa?version=12353296=Text=12310710

Staging repository:
https://repository.apache.org/content/repositories/orgapachesling-2870/

You can use this UNIX script to download the release and verify the signatures:
https://raw.githubusercontent.com/apache/sling-tooling-release/master/check_staged_release.sh

Usage:
sh check_staged_release.sh 2870 /tmp/sling-staging

Please vote to approve this release:

  [ ] +1 Approve the release
  [ ]  0 Don't care
  [ ] -1 Don't release, because ...

This majority vote is open for at least 72 hours.

stefan


[jira] [Assigned] (SLING-11917) Sling Models: Support parameter name evaluation in constructor injection

2024-06-25 Thread Stefan Seifert (Jira)


 [ 
https://issues.apache.org/jira/browse/SLING-11917?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Stefan Seifert reassigned SLING-11917:
--

Assignee: Konrad Windszus

> Sling Models: Support parameter name evaluation in constructor injection
> 
>
> Key: SLING-11917
> URL: https://issues.apache.org/jira/browse/SLING-11917
> Project: Sling
>  Issue Type: Improvement
>Reporter: Konrad Windszus
>Assignee: Konrad Windszus
>Priority: Major
> Fix For: Models Implementation 1.7.0
>
>
> https://openjdk.org/jeps/118 introduced support of retrieving parameter names 
> at run time through reflection. This should be leveraged in constructor 
> injection in Sling Models to not be forced to use the {{@Named}} annotation.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Updated] (SLING-12273) Build breaks on Java 21, Update to Parent 60

2024-06-25 Thread Stefan Seifert (Jira)


 [ 
https://issues.apache.org/jira/browse/SLING-12273?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Stefan Seifert updated SLING-12273:
---
Summary: Build breaks on Java 21, Update to Parent 60  (was: Build breaks 
on Java 21)

> Build breaks on Java 21, Update to Parent 60
> 
>
> Key: SLING-12273
> URL: https://issues.apache.org/jira/browse/SLING-12273
> Project: Sling
>  Issue Type: Improvement
>  Components: Sling Models
>Affects Versions: Models API 1.5.0
>Reporter: Konrad Windszus
>Assignee: Konrad Windszus
>Priority: Major
> Fix For: Models API 1.5.2
>
>
> The following error is emitted in during building with Maven 
> (https://ci-builds.apache.org/blue/organizations/jenkins/Sling%2Fmodules%2Fsling-org-apache-sling-models-api/detail/master/212/pipeline/)
> {code}
> [INFO] --- invoker:3.3.0:run (integration-test) @ org.apache.sling.models.api 
> ---
> [INFO] Building: validating-annotation-processor/pom.xml
> [INFO] run post-build script verify.groovy
> [INFO]   BUG! exception in phase 'semantic analysis' in source unit 
> 'Script1.groovy' Unsupported class file major version 65
> [INFO]   validating-annotation-processor/pom.xml .. FAILED 
> (15.5 s)
> [INFO] -
> [INFO] Build Summary:
> [INFO]   Passed: 0, Failed: 1, Errors: 0, Skipped: 0
> [INFO] -
> [ERROR] The following builds failed:
> [ERROR] *  validating-annotation-processor/pom.xml
> [INFO] -
> [INFO] 
> 
> [INFO] BUILD FAILURE
> [INFO] 
> 
> [INFO] Total time:  51.891 s
> [INFO] Finished at: 2024-03-15T23:26:49Z
> [INFO] 
> 
> [INFO] [jenkins-event-spy] Generated 
> /home/jenkins/workspace/g-apache-sling-models-api_master/jdk_21_latest@tmp/withMaven74374c80/maven-spy-20240315-232556-91012999432982760308630.log
> [ERROR] Failed to execute goal 
> org.apache.maven.plugins:maven-invoker-plugin:3.3.0:run (integration-test) on 
> project org.apache.sling.models.api: 1 build failed. See console output above 
> for details. -> [Help 1]
> org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute 
> goal org.apache.maven.plugins:maven-invoker-plugin:3.3.0:run 
> (integration-test) on project org.apache.sling.models.api: 1 build failed. 
> See console output above for details.
> at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 
> (MojoExecutor.java:333)
> at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute 
> (MojoExecutor.java:316)
> at org.apache.maven.lifecycle.internal.MojoExecutor.execute 
> (MojoExecutor.java:212)
> at org.apache.maven.lifecycle.internal.MojoExecutor.execute 
> (MojoExecutor.java:174)
> at org.apache.maven.lifecycle.internal.MojoExecutor.access$000 
> (MojoExecutor.java:75)
> at org.apache.maven.lifecycle.internal.MojoExecutor$1.run 
> (MojoExecutor.java:162)
> at org.apache.maven.plugin.DefaultMojosExecutionStrategy.execute 
> (DefaultMojosExecutionStrategy.java:39)
> at org.apache.maven.lifecycle.internal.MojoExecutor.execute 
> (MojoExecutor.java:159)
> at 
> org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject 
> (LifecycleModuleBuilder.java:105)
> at 
> org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject 
> (LifecycleModuleBuilder.java:73)
> at 
> org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build
>  (SingleThreadedBuilder.java:53)
> at org.apache.maven.lifecycle.internal.LifecycleStarter.execute 
> (LifecycleStarter.java:118)
> at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:261)
> at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:173)
> at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:101)
> at org.apache.maven.cli.MavenCli.execute (MavenCli.java:906)
> at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:283)
> at org.apache.maven.cli.MavenCli.main (MavenCli.java:206)
> at jdk.internal.reflect.DirectMethodHandleAccessor.invoke 
> (DirectMethodHandleAccessor.java:103)
> at java.lang.reflect.Method.invoke (Method.java:580)
> at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced 
> (Launcher.java:283)
> at org.codehaus.plexus.classworlds.launcher.Launcher.launch 
> (Launcher.java:226)
> at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode 
> (Launcher.java:407)
> at org.codehaus.plexus.classworlds.launcher.Launcher.main 
> (Launcher.java:348)
> Caused by: 

[jira] [Resolved] (SLING-11917) Sling Models: Support parameter name evaluation in constructor injection

2024-06-25 Thread Konrad Windszus (Jira)


 [ 
https://issues.apache.org/jira/browse/SLING-11917?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Konrad Windszus resolved SLING-11917.
-
Resolution: Fixed

Fixed in 
https://github.com/apache/sling-org-apache-sling-models-impl/commit/e8ca8371c1fbf264f7051eb2e6e5ca1d09796652.

> Sling Models: Support parameter name evaluation in constructor injection
> 
>
> Key: SLING-11917
> URL: https://issues.apache.org/jira/browse/SLING-11917
> Project: Sling
>  Issue Type: Improvement
>Reporter: Konrad Windszus
>Priority: Major
> Fix For: Models Implementation 1.7.0
>
>
> https://openjdk.org/jeps/118 introduced support of retrieving parameter names 
> at run time through reflection. This should be leveraged in constructor 
> injection in Sling Models to not be forced to use the {{@Named}} annotation.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Resolved] (SLING-12360) Models: Update to Parent 60, Java 11 Minimum Version

2024-06-25 Thread Stefan Seifert (Jira)


 [ 
https://issues.apache.org/jira/browse/SLING-12360?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Stefan Seifert resolved SLING-12360.

Resolution: Fixed

impl
 * 
[https://github.com/apache/sling-org-apache-sling-models-impl/commit/cc4ac50b5be64ba7cb91dee511978a0fc592e370]
 * 
[https://github.com/apache/sling-org-apache-sling-models-impl/commit/fcb45ad9be1930e0ee5956e45a2dddf2387a4453]
 * 
[https://github.com/apache/sling-org-apache-sling-models-impl/commit/164b9f32401c088609a8abffc0d3eba7ec959ef5]

jackson exporter
 * 
[https://github.com/apache/sling-org-apache-sling-models-jacksonexporter/commit/4fe850b4f3b6bf4d3d4908d32e10965575309942]
 * 
[https://github.com/apache/sling-org-apache-sling-models-jacksonexporter/commit/66a0c832c57e40b85a33b8a0463fc05383057d87]
 * 
[https://github.com/apache/sling-org-apache-sling-models-jacksonexporter/commit/777eaffa7851722bc5a2eceef7ffcc3701df266d]

models caconfig
 * 
[https://github.com/apache/sling-org-apache-sling-models-caconfig/commit/098970bb8e0ad0da65348756a93be02071986d38]
 * 
[https://github.com/apache/sling-org-apache-sling-models-caconfig/commit/f043041308758eca9138fb42e04643fd612a1bd0]
 * 
[https://github.com/apache/sling-org-apache-sling-models-caconfig/commit/a63749c6608c9f2e737dfe5f6f00b217cb7afa42]

models bnd plugin
 * 
[https://github.com/apache/sling-org-apache-sling-bnd-models/commit/4b7ee02af75cd1e4684064c28affd6981d227d39]
 * 
[https://github.com/apache/sling-org-apache-sling-bnd-models/commit/0e11beb1435229fc18310abf5e4a8719952e4d2d]
 * 
[https://github.com/apache/sling-org-apache-sling-bnd-models/commit/211d811d62dc1096f057209448792b6eb031bc2c]

 

> Models: Update to Parent 60, Java 11 Minimum Version
> 
>
> Key: SLING-12360
> URL: https://issues.apache.org/jira/browse/SLING-12360
> Project: Sling
>  Issue Type: Improvement
>  Components: Sling Models
>Reporter: Stefan Seifert
>Assignee: Stefan Seifert
>Priority: Major
> Fix For: Models Context-Aware Configuration 1.0.4, Models 
> Implementation 1.7.0, Models Jackson Exporter 1.1.6, Sling Models bnd Plugin 
> 1.0.2
>
>
> update to parent 60, see also [https://cwiki.apache.org/confluence/x/SI75E]
> this drops java 8 support, and instead supports java 11, 17, 21 - build is 
> done with java 17
> minimum java requirement for runtime is java 11



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


Re: [VOTE] Release Apache Sling OSGi Feature Maven Plugin 1.8.4

2024-06-25 Thread Robert Munteanu
On Fri, 2024-06-21 at 21:13 +, Robert Munteanu wrote:
> Please vote to approve this release:

+1
Robert


signature.asc
Description: This is a digitally signed message part


Re: [VOTE] Release Apache Sling Feature Model Analyser 2.0.8

2024-06-25 Thread Robert Munteanu
On Fri, 2024-06-21 at 21:14 +, Robert Munteanu wrote:
> Please vote to approve this release:

+1
Robert


signature.asc
Description: This is a digitally signed message part


[jira] [Resolved] (SLING-12361) caconfig: Update to Parent 60, Java 11 Minimum Version

2024-06-25 Thread Stefan Seifert (Jira)


 [ 
https://issues.apache.org/jira/browse/SLING-12361?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Stefan Seifert resolved SLING-12361.

Resolution: Fixed

api
 * 
[https://github.com/apache/sling-org-apache-sling-caconfig-api/commit/e20383050d57bfd549c7afcd616873583c0cfaff]
 * 
[https://github.com/apache/sling-org-apache-sling-caconfig-api/commit/3278436d6b9a86702067c0b3812010f5fba3a3aa]
 * 
[https://github.com/apache/sling-org-apache-sling-caconfig-api/commit/f78856e56fb024f3191436d72706e7914f733b99]

spi
 * 
[https://github.com/apache/sling-org-apache-sling-caconfig-spi/commit/794bf3387100902ec47c4a785803f2bc3473da15]
 * 
[https://github.com/apache/sling-org-apache-sling-caconfig-spi/commit/da624284af085acec003dfa96db5ff753b348d8d]
 * 
[https://github.com/apache/sling-org-apache-sling-caconfig-spi/commit/3a9399466b0af35d7c7f2e9110d1c2178574906e]

impl
 * 
[https://github.com/apache/sling-org-apache-sling-caconfig-impl/commit/9c31071e482e3af758f166f3a332a561157d8611]
 * 
[https://github.com/apache/sling-org-apache-sling-caconfig-impl/commit/91dd7cb4fa07252beeac7ac2a8c6c2e80713a8fc]
 * 
[https://github.com/apache/sling-org-apache-sling-caconfig-impl/commit/9f5f501b0f8dc36e26889e693c1b82aed0c83088]

bnd plugin
 * 
[https://github.com/apache/sling-org-apache-sling-caconfig-bnd-plugin/commit/80577e102c746ae8e8f66e1b709c1dfe2d3789d8]
 * 
[https://github.com/apache/sling-org-apache-sling-caconfig-bnd-plugin/commit/de19fab14fbf05e06d6897047688439fb721b46e]
 * 
[https://github.com/apache/sling-org-apache-sling-caconfig-bnd-plugin/commit/2d9039395e1676cb39317c2b0fb198bc7e9a0ba1]

 

> caconfig: Update to Parent 60, Java 11 Minimum Version
> --
>
> Key: SLING-12361
> URL: https://issues.apache.org/jira/browse/SLING-12361
> Project: Sling
>  Issue Type: Improvement
>  Components: Extensions
>Reporter: Stefan Seifert
>Assignee: Stefan Seifert
>Priority: Major
> Fix For: Context-Aware Configuration bnd Plugin 1.0.4, 
> Context-Aware Configuration API 1.3.2, Context-Aware Configuration SPI 1.4.2, 
> Context-Aware Configuration Impl 1.6.2
>
>
> update to parent 60, see also [https://cwiki.apache.org/confluence/x/SI75E]
> this drops java 8 support, and instead supports java 11, 17, 21 - build is 
> done with java 17
> minimum java requirement for runtime is java 11



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Updated] (SLING-12359) Sling Models: Support constructor injection for Java Record classes

2024-06-25 Thread Robert Munteanu (Jira)


 [ 
https://issues.apache.org/jira/browse/SLING-12359?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Robert Munteanu updated SLING-12359:

Labels: Sling-13-Release-Notes  (was: )

> Sling Models: Support constructor injection for Java Record classes
> ---
>
> Key: SLING-12359
> URL: https://issues.apache.org/jira/browse/SLING-12359
> Project: Sling
>  Issue Type: Improvement
>  Components: Sling Models
>Affects Versions: Models Implementation 1.6.4
>Reporter: Herman Ciechanowiec
>Assignee: Stefan Seifert
>Priority: Major
>  Labels: Sling-13-Release-Notes
> Fix For: Models Implementation 1.7.0
>
>
> Java 14 introduced support for record classes, and Apache Sling 12 by default 
> runs with Java 17, allowing the use of records.
> Although Apache Sling 12 supports record classes, the current latest version 
> of Apache Sling Models Implementation does not fully support injection in 
> relation to records. Specifically, for records, the Apache Sling Models 
> Implementation *does* support constructor injection similarly to a usual 
> class if there is an *explicit* constructor annotated with 
> `javax.inject.Inject`:
> {code:java}
> @Model(
> adaptables = {Resource.class, SlingHttpServletRequest.class},
> defaultInjectionStrategy = DefaultInjectionStrategy.REQUIRED
> )
> public record StudentModel(String name, int age) {
> @Inject
> public StudentModel(
> @ValueMapValue(name = "name") @Default(values = "unknown")
> String name, 
> @ValueMapValue(name = "age") @Default(intValues = 0)
> int age
> ) {
> this.name = name;
> this.age = age;
> }
> }
> {code}
> However, for records, Apache Sling Models Implementation *does not* support 
> constructor injection if there is an *implicit* constructor. Such a 
> constructor cannot be annotated with `javax.inject.Inject` and will not be 
> picked up during injection. Therefore, such a Sling Model will not be 
> instantiated at all:
> {code:java}
> @Model(
> adaptables = {Resource.class, SlingHttpServletRequest.class},
> defaultInjectionStrategy = DefaultInjectionStrategy.REQUIRED
> )
> public record StudentModel(
> @ValueMapValue(name = "name") @Default(values = "unknown")
> String name,
> @ValueMapValue(name = "age") @Default(intValues = 0)
> int age
> ) {}
> {code}
> The above issue should be addressed by introducing support for injection in 
> records' implicit constructors.
> Note:
> 1. For records, only constructor injection is supported since records cannot 
> have instance fields (code with such fields will not compile).
> 2. Apache Sling Models Implementation is currently based on Java 8 and may 
> also be executed in a Java 8 environment. Therefore, the records check should 
> be introduced via dynamic loading of the `java.lang.Record` class.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Resolved] (SLING-12359) Sling Models: Support constructor injection for Java Record classes

2024-06-25 Thread Stefan Seifert (Jira)


 [ 
https://issues.apache.org/jira/browse/SLING-12359?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Stefan Seifert resolved SLING-12359.

Resolution: Fixed

https://github.com/apache/sling-org-apache-sling-models-impl/commit/9d1c72501226d3dfdfb0644c5632f5e29be5370e

> Sling Models: Support constructor injection for Java Record classes
> ---
>
> Key: SLING-12359
> URL: https://issues.apache.org/jira/browse/SLING-12359
> Project: Sling
>  Issue Type: Improvement
>  Components: Sling Models
>Affects Versions: Models Implementation 1.6.4
>Reporter: Herman Ciechanowiec
>Assignee: Stefan Seifert
>Priority: Major
> Fix For: Models Implementation 1.6.6
>
>
> Java 14 introduced support for record classes, and Apache Sling 12 by default 
> runs with Java 17, allowing the use of records.
> Although Apache Sling 12 supports record classes, the current latest version 
> of Apache Sling Models Implementation does not fully support injection in 
> relation to records. Specifically, for records, the Apache Sling Models 
> Implementation *does* support constructor injection similarly to a usual 
> class if there is an *explicit* constructor annotated with 
> `javax.inject.Inject`:
> {code:java}
> @Model(
> adaptables = {Resource.class, SlingHttpServletRequest.class},
> defaultInjectionStrategy = DefaultInjectionStrategy.REQUIRED
> )
> public record StudentModel(String name, int age) {
> @Inject
> public StudentModel(
> @ValueMapValue(name = "name") @Default(values = "unknown")
> String name, 
> @ValueMapValue(name = "age") @Default(intValues = 0)
> int age
> ) {
> this.name = name;
> this.age = age;
> }
> }
> {code}
> However, for records, Apache Sling Models Implementation *does not* support 
> constructor injection if there is an *implicit* constructor. Such a 
> constructor cannot be annotated with `javax.inject.Inject` and will not be 
> picked up during injection. Therefore, such a Sling Model will not be 
> instantiated at all:
> {code:java}
> @Model(
> adaptables = {Resource.class, SlingHttpServletRequest.class},
> defaultInjectionStrategy = DefaultInjectionStrategy.REQUIRED
> )
> public record StudentModel(
> @ValueMapValue(name = "name") @Default(values = "unknown")
> String name,
> @ValueMapValue(name = "age") @Default(intValues = 0)
> int age
> ) {}
> {code}
> The above issue should be addressed by introducing support for injection in 
> records' implicit constructors.
> Note:
> 1. For records, only constructor injection is supported since records cannot 
> have instance fields (code with such fields will not compile).
> 2. Apache Sling Models Implementation is currently based on Java 8 and may 
> also be executed in a Java 8 environment. Therefore, the records check should 
> be introduced via dynamic loading of the `java.lang.Record` class.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Updated] (SLING-12359) Sling Models: Support constructor injection for Java Record classes

2024-06-25 Thread Stefan Seifert (Jira)


 [ 
https://issues.apache.org/jira/browse/SLING-12359?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Stefan Seifert updated SLING-12359:
---
Summary: Sling Models: Support constructor injection for Java Record 
classes  (was: Extend records support)

> Sling Models: Support constructor injection for Java Record classes
> ---
>
> Key: SLING-12359
> URL: https://issues.apache.org/jira/browse/SLING-12359
> Project: Sling
>  Issue Type: Improvement
>  Components: Sling Models
>Affects Versions: Models Implementation 1.6.4
>Reporter: Herman Ciechanowiec
>Assignee: Stefan Seifert
>Priority: Major
> Fix For: Models Implementation 1.6.6
>
>
> Java 14 introduced support for record classes, and Apache Sling 12 by default 
> runs with Java 17, allowing the use of records.
> Although Apache Sling 12 supports record classes, the current latest version 
> of Apache Sling Models Implementation does not fully support injection in 
> relation to records. Specifically, for records, the Apache Sling Models 
> Implementation *does* support constructor injection similarly to a usual 
> class if there is an *explicit* constructor annotated with 
> `javax.inject.Inject`:
> {code:java}
> @Model(
> adaptables = {Resource.class, SlingHttpServletRequest.class},
> defaultInjectionStrategy = DefaultInjectionStrategy.REQUIRED
> )
> public record StudentModel(String name, int age) {
> @Inject
> public StudentModel(
> @ValueMapValue(name = "name") @Default(values = "unknown")
> String name, 
> @ValueMapValue(name = "age") @Default(intValues = 0)
> int age
> ) {
> this.name = name;
> this.age = age;
> }
> }
> {code}
> However, for records, Apache Sling Models Implementation *does not* support 
> constructor injection if there is an *implicit* constructor. Such a 
> constructor cannot be annotated with `javax.inject.Inject` and will not be 
> picked up during injection. Therefore, such a Sling Model will not be 
> instantiated at all:
> {code:java}
> @Model(
> adaptables = {Resource.class, SlingHttpServletRequest.class},
> defaultInjectionStrategy = DefaultInjectionStrategy.REQUIRED
> )
> public record StudentModel(
> @ValueMapValue(name = "name") @Default(values = "unknown")
> String name,
> @ValueMapValue(name = "age") @Default(intValues = 0)
> int age
> ) {}
> {code}
> The above issue should be addressed by introducing support for injection in 
> records' implicit constructors.
> Note:
> 1. For records, only constructor injection is supported since records cannot 
> have instance fields (code with such fields will not compile).
> 2. Apache Sling Models Implementation is currently based on Java 8 and may 
> also be executed in a Java 8 environment. Therefore, the records check should 
> be introduced via dynamic loading of the `java.lang.Record` class.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Assigned] (SLING-12358) Introduce error metric that counts up once for each package that can not be applied

2024-06-25 Thread Christian Schneider (Jira)


 [ 
https://issues.apache.org/jira/browse/SLING-12358?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Christian Schneider reassigned SLING-12358:
---

Assignee: Christian Schneider

> Introduce error metric that counts up once for each package that can not be 
> applied
> ---
>
> Key: SLING-12358
> URL: https://issues.apache.org/jira/browse/SLING-12358
> Project: Sling
>  Issue Type: Improvement
>  Components: Content Distribution
>Reporter: Christian Schneider
>Assignee: Christian Schneider
>Priority: Major
> Fix For: Content Distribution Journal Core 0.4.0
>
>
> We already have a metric that counts every failure to apply a package. 
> As we retry indefinitely this metric counts every package multiple times. So 
> it is not a good metric for computing error rate. 
> We should introduce a metric that counts up only once for each package that 
> can not be applied.
> We can for example count up only on the first retry of the package or on the 
> 10th retry.
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Resolved] (SLING-12214) Use constants for topic names

2024-06-25 Thread Christian Schneider (Jira)


 [ 
https://issues.apache.org/jira/browse/SLING-12214?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Christian Schneider resolved SLING-12214.
-
Resolution: Fixed

> Use constants for topic names
> -
>
> Key: SLING-12214
> URL: https://issues.apache.org/jira/browse/SLING-12214
> Project: Sling
>  Issue Type: Improvement
>  Components: Content Distribution
>Reporter: Christian Schneider
>Assignee: Christian Schneider
>Priority: Major
> Fix For: Content Distribution Journal Core 0.4.0
>
>
> Since a while we are using symbolic topic names instead of actual topic names.
> This means that for example the package topic is always named "package". We 
> should now also change this in the code to move away from the Topics service 
> and configuration to just use plain constants. This makes the code a bit 
> simpler.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)