You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "bdelacretaz (via GitHub)" <gi...@apache.org> on 2025/07/11 09:47:50 UTC
[PR] SLING-12739 - Use more specific ResourcePredicate interface [sling-org-apache-sling-servlets-resolver]
bdelacretaz opened a new pull request, #60:
URL: https://github.com/apache/sling-org-apache-sling-servlets-resolver/pull/60
Based on the ongoing discussion at https://lists.apache.org/thread/515lpjlnxshzjxjbntwn5t651bomxk52
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@sling.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] SLING-12739 - Use more specific ResourcePredicate interface [sling-org-apache-sling-servlets-resolver]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #60:
URL: https://github.com/apache/sling-org-apache-sling-servlets-resolver/pull/60#issuecomment-3061711040
## [](https://sonarcloud.io/dashboard?id=apache_sling-org-apache-sling-servlets-resolver&pullRequest=60) **Quality Gate failed**
Failed conditions
 [B Maintainability Rating on New Code](https://sonarcloud.io/dashboard?id=apache_sling-org-apache-sling-servlets-resolver&pullRequest=60) (required ≥ A)
 [B Reliability Rating on New Code](https://sonarcloud.io/dashboard?id=apache_sling-org-apache-sling-servlets-resolver&pullRequest=60) (required ≥ A)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_sling-org-apache-sling-servlets-resolver&pullRequest=60)
##
 Catch issues before they fail your Quality Gate with our IDE extension  [SonarQube for IDE](https://www.sonarsource.com/products/sonarlint/features/connected-mode/?referrer=pull-request)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@sling.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] SLING-12739 - Use more specific ResourcePredicate interface [sling-org-apache-sling-servlets-resolver]
Posted by "bdelacretaz (via GitHub)" <gi...@apache.org>.
bdelacretaz merged PR #60:
URL: https://github.com/apache/sling-org-apache-sling-servlets-resolver/pull/60
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@sling.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] SLING-12739 - Use more specific ResourcePredicate interface [sling-org-apache-sling-servlets-resolver]
Posted by "kwin (via GitHub)" <gi...@apache.org>.
kwin commented on code in PR #60:
URL: https://github.com/apache/sling-org-apache-sling-servlets-resolver/pull/60#discussion_r2200283771
##########
src/main/java/org/apache/sling/servlets/resolver/api/ResourcePredicate.java:
##########
@@ -0,0 +1,36 @@
+/*
+ * 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.servlets.resolver.api;
+
+import java.util.function.Predicate;
+
+import org.apache.sling.api.resource.Resource;
+import org.osgi.annotation.versioning.ConsumerType;
+
+/** Created for https://issues.apache.org/jira/browse/SLING-12739
+ * to hide specific scripts or servlets from the resolution
+ * mechanism. Can be used for "soft deprecation" of scripts and
+ * servlets for example.
+ *
+ * @returns true if the supplied Resource must be ignored by
+ * the servlets resolver.
+ */
+@ConsumerType
+public interface ResourcePredicate extends Predicate<Resource> {
Review Comment:
I would give it a more specific classname (even if the package name is already kind of specific) like `ServletResourceHidePredicate`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@sling.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] SLING-12739 - Use more specific ResourcePredicate interface [sling-org-apache-sling-servlets-resolver]
Posted by "bdelacretaz (via GitHub)" <gi...@apache.org>.
bdelacretaz commented on code in PR #60:
URL: https://github.com/apache/sling-org-apache-sling-servlets-resolver/pull/60#discussion_r2200335766
##########
src/main/java/org/apache/sling/servlets/resolver/api/ResourcePredicate.java:
##########
@@ -0,0 +1,36 @@
+/*
+ * 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.servlets.resolver.api;
+
+import java.util.function.Predicate;
+
+import org.apache.sling.api.resource.Resource;
+import org.osgi.annotation.versioning.ConsumerType;
+
+/** Created for https://issues.apache.org/jira/browse/SLING-12739
+ * to hide specific scripts or servlets from the resolution
+ * mechanism. Can be used for "soft deprecation" of scripts and
+ * servlets for example.
+ *
+ * @returns true if the supplied Resource must be ignored by
+ * the servlets resolver.
+ */
+@ConsumerType
+public interface ResourcePredicate extends Predicate<Resource> {
Review Comment:
Agreed, Good Names Are Always Good - WDYT of `IgnoredServletResourcePredicate` that I just pushed?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@sling.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] SLING-12739 - Use more specific ResourcePredicate interface [sling-org-apache-sling-servlets-resolver]
Posted by "kwin (via GitHub)" <gi...@apache.org>.
kwin commented on code in PR #60:
URL: https://github.com/apache/sling-org-apache-sling-servlets-resolver/pull/60#discussion_r2200318495
##########
src/main/java/org/apache/sling/servlets/resolver/api/ResourcePredicate.java:
##########
@@ -0,0 +1,36 @@
+/*
+ * 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.servlets.resolver.api;
+
+import java.util.function.Predicate;
+
+import org.apache.sling.api.resource.Resource;
+import org.osgi.annotation.versioning.ConsumerType;
+
+/** Created for https://issues.apache.org/jira/browse/SLING-12739
+ * to hide specific scripts or servlets from the resolution
+ * mechanism. Can be used for "soft deprecation" of scripts and
+ * servlets for example.
+ *
+ * @returns true if the supplied Resource must be ignored by
+ * the servlets resolver.
+ */
+@ConsumerType
+public interface ResourcePredicate extends Predicate<Resource> {
Review Comment:
This is more to reduce chances for name clashes when working in an IDE which tries to establish the package import automatically. I can imagine we might have a similarly named class in some other package, therefore I am big fan of concise (verbose) class names.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@sling.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] SLING-12739 - Use more specific ResourcePredicate interface [sling-org-apache-sling-servlets-resolver]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #60:
URL: https://github.com/apache/sling-org-apache-sling-servlets-resolver/pull/60#issuecomment-3061639995
## [](https://sonarcloud.io/dashboard?id=apache_sling-org-apache-sling-servlets-resolver&pullRequest=60) **Quality Gate failed**
Failed conditions
 [B Reliability Rating on New Code](https://sonarcloud.io/dashboard?id=apache_sling-org-apache-sling-servlets-resolver&pullRequest=60) (required ≥ A)
 [B Maintainability Rating on New Code](https://sonarcloud.io/dashboard?id=apache_sling-org-apache-sling-servlets-resolver&pullRequest=60) (required ≥ A)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_sling-org-apache-sling-servlets-resolver&pullRequest=60)
##
 Catch issues before they fail your Quality Gate with our IDE extension  [SonarQube for IDE](https://www.sonarsource.com/products/sonarlint/features/connected-mode/?referrer=pull-request)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@sling.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] SLING-12739 - Use more specific ResourcePredicate interface [sling-org-apache-sling-servlets-resolver]
Posted by "bdelacretaz (via GitHub)" <gi...@apache.org>.
bdelacretaz commented on code in PR #60:
URL: https://github.com/apache/sling-org-apache-sling-servlets-resolver/pull/60#discussion_r2200298866
##########
src/main/java/org/apache/sling/servlets/resolver/api/ResourcePredicate.java:
##########
@@ -0,0 +1,36 @@
+/*
+ * 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.servlets.resolver.api;
+
+import java.util.function.Predicate;
+
+import org.apache.sling.api.resource.Resource;
+import org.osgi.annotation.versioning.ConsumerType;
+
+/** Created for https://issues.apache.org/jira/browse/SLING-12739
+ * to hide specific scripts or servlets from the resolution
+ * mechanism. Can be used for "soft deprecation" of scripts and
+ * servlets for example.
+ *
+ * @returns true if the supplied Resource must be ignored by
+ * the servlets resolver.
+ */
+@ConsumerType
+public interface ResourcePredicate extends Predicate<Resource> {
Review Comment:
I also saw this, just pushed changes that rename it to `IgnoredResourcePredicate`, does that work for you?
The full name clearly indicates that it's for the servlets resolver, `org.apache.sling.servlets.resolver.api.IgnoredResourcePredicate`
And I think "ignored" is more correct, as the Resource is still there, just ignored
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@sling.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] SLING-12739 - Use more specific ResourcePredicate interface [sling-org-apache-sling-servlets-resolver]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #60:
URL: https://github.com/apache/sling-org-apache-sling-servlets-resolver/pull/60#issuecomment-3061607753
## [](https://sonarcloud.io/dashboard?id=apache_sling-org-apache-sling-servlets-resolver&pullRequest=60) **Quality Gate failed**
Failed conditions
 [B Reliability Rating on New Code](https://sonarcloud.io/dashboard?id=apache_sling-org-apache-sling-servlets-resolver&pullRequest=60) (required ≥ A)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_sling-org-apache-sling-servlets-resolver&pullRequest=60)
##
 Catch issues before they fail your Quality Gate with our IDE extension  [SonarQube for IDE](https://www.sonarsource.com/products/sonarlint/features/connected-mode/?referrer=pull-request)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@sling.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] SLING-12739 - Use more specific ResourcePredicate interface [sling-org-apache-sling-servlets-resolver]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #60:
URL: https://github.com/apache/sling-org-apache-sling-servlets-resolver/pull/60#issuecomment-3061581794
## [](https://sonarcloud.io/dashboard?id=apache_sling-org-apache-sling-servlets-resolver&pullRequest=60) **Quality Gate failed**
Failed conditions
 [B Reliability Rating on New Code](https://sonarcloud.io/dashboard?id=apache_sling-org-apache-sling-servlets-resolver&pullRequest=60) (required ≥ A)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_sling-org-apache-sling-servlets-resolver&pullRequest=60)
##
 Catch issues before they fail your Quality Gate with our IDE extension  [SonarQube for IDE](https://www.sonarsource.com/products/sonarlint/features/connected-mode/?referrer=pull-request)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@sling.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org