bdelacretaz commented on code in PR #49:
URL: 
https://github.com/apache/sling-org-apache-sling-feature-analyser/pull/49#discussion_r1665628932


##########
src/main/java/org/apache/sling/feature/analyser/task/impl/CheckIncompatibleBundles.java:
##########
@@ -0,0 +1,95 @@
+/*
+ * 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.feature.analyser.task.impl;
+
+import jakarta.json.Json;
+import jakarta.json.JsonArray;
+import jakarta.json.JsonReader;
+import jakarta.json.stream.JsonParser;
+import org.apache.sling.feature.ArtifactId;
+import org.apache.sling.feature.analyser.task.AnalyserTask;
+import org.apache.sling.feature.analyser.task.AnalyserTaskContext;
+import org.apache.sling.feature.scanner.BundleDescriptor;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.StringReader;
+import java.nio.charset.StandardCharsets;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.stream.Collectors;
+import java.util.stream.IntStream;
+
+
+public class CheckIncompatibleBundles implements AnalyserTask {
+
+    private static final String UNSUPPORTED_BUNDLES_FILE_NAME = 
"unsupported_bundles.json";
+    private static final Logger LOGGER = 
LoggerFactory.getLogger(CheckIncompatibleBundles.class);
+
+    @Override
+    public String getName() {
+        return "Incompatible Bundle Check";
+    }
+
+    @Override
+    public String getId() {
+        return "check-incompatible-bundles";
+    }
+
+    @Override
+    public void execute(final AnalyserTaskContext ctx) throws IOException {
+        Collection<ArtifactId> unsupportedBundles = getUnsupportedBundles();
+        for (final BundleDescriptor info : 
ctx.getFeatureDescriptor().getBundleDescriptors()) {
+            if (matchesAnyOf(info.getArtifact().getId(), unsupportedBundles)) {
+                ctx.reportArtifactWarning(info.getArtifact().getId(), 
"Unsupported bundle with java 21");

Review Comment:
   Hardcoding this message here doesn't feel right, I assume that over time 
other reasons for incompatibility will happen, even if that's as simple as 
something like "Unsupported with Java 25".
   
   I'll suggest a small change to the JSON data file below to avoid this.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to