martinweiler commented on code in PR #3403: URL: https://github.com/apache/incubator-kie-kogito-runtimes/pull/3403#discussion_r1516719123
########## jbpm/jbpm-flow-migration/src/main/java/org/jbpm/flow/migration/impl/FileSystemMigrationPlanFileProvider.java: ########## @@ -0,0 +1,118 @@ +/* + * 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.jbpm.flow.migration.impl; + +import java.io.IOException; +import java.net.URI; +import java.net.URISyntaxException; +import java.nio.file.FileSystem; +import java.nio.file.FileSystems; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.function.Predicate; +import java.util.stream.Stream; + +import org.jbpm.flow.migration.MigrationPlanFile; +import org.jbpm.flow.migration.MigrationPlanFileProvider; +import org.jbpm.util.JbpmClassLoaderUtil; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import static java.util.Collections.emptyMap; + +public class FileSystemMigrationPlanFileProvider implements MigrationPlanFileProvider { + + private static final Logger LOGGER = LoggerFactory.getLogger(FileSystemMigrationPlanFileProvider.class); + + public static final String MIGRATION_PLAN_FOLDER = "/META-INF/migration-plan/"; + + private URI rootPath; + + public FileSystemMigrationPlanFileProvider() { + try { + this.rootPath = getClass().getResource(MIGRATION_PLAN_FOLDER).toURI(); Review Comment: Test failures in AsyncAPIIT and EmitEnumRPCGreetIT test classes: ``` Caused by: java.util.ServiceConfigurationError: org.jbpm.flow.migration.MigrationPlanFileProvider: Provider org.jbpm.flow.migration.impl.FileSystemMigrationPlanFileProvider could not be instantiated at java.base/java.util.ServiceLoader.fail(ServiceLoader.java:586) at java.base/java.util.ServiceLoader$ProviderImpl.newInstance(ServiceLoader.java:813) at java.base/java.util.ServiceLoader$ProviderImpl.get(ServiceLoader.java:729) at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197) at java.base/java.util.ServiceLoader$ProviderSpliterator.tryAdvance(ServiceLoader.java:1499) at java.base/java.util.Spliterator.forEachRemaining(Spliterator.java:332) at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509) at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921) at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:682) at org.jbpm.flow.migration.MigrationPlanFileProvider.findMigrationPlanFileProviders(MigrationPlanFileProvider.java:35) at org.jbpm.flow.migration.MigrationPlanProvider$MigrationPlanProviderBuilder.withEnvironmentDefaults(MigrationPlanProvider.java:84) at org.jbpm.flow.migration.MigrationPlanService.<init>(MigrationPlanService.java:43) at org.jbpm.flow.serialization.migration.StandardMigrationProcessInstanceMarshallerListener.<init>(StandardMigrationProcessInstanceMarshallerListener.java:38) ... Caused by: java.lang.NullPointerException: Cannot invoke "java.net.URL.toURI()" because the return value of "java.lang.Class.getResource(String)" is null ``` -- 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
