Repository: apache/flink
File: flink-core/src/main/java/org/apache/flink/core/fs/FileSystem.java (Java)

Code before:
     */
    public static void initialize(Configuration config, @Nullable PluginManager pluginManager)
            throws IllegalConfigurationException {

        LOCK.lock();
        try {
            // make sure file systems are re-instantiated after re-configuration
            CACHE.clear();
            FS_FACTORIES.clear();

            Collection<Supplier<Iterator<FileSystemFactory>>> factorySuppliers = new ArrayList<>(2);
            factorySuppliers.add(() -> ServiceLoader.load(FileSystemFactory.class).iterator());

            if (pluginManager != null) {
                factorySuppliers.add(
                        () ->
                                Iterators.transform(
                                        pluginManager.load(FileSystemFactory.class),
                                        PluginFileSystemFactory::of));
            }

            final List<FileSystemFactory> fileSystemFactories =
                    loadFileSystemFactories(factorySuppliers);

            // Track registered priorities for factory selection
            final HashMap<String, Integer> registeredPriorities = new HashMap<>();

            // configure all file system factories
            for (FileSystemFactory factory : fileSystemFactories) {
                factory.configure(config);
                final String scheme = factory.getScheme();

                FileSystemFactory fsf =
                        ConnectionLimitingFactory.decorateIfLimited(factory, scheme, config);

                final String className = resolveFactoryClassName(factory);
                final int registeredPriority =
                        registeredPriorities.getOrDefault(scheme, Integer.MIN_VALUE);
                final int newPriority =
                        config.getOptional(CoreOptions.fileSystemFactoryPriority(scheme, className))
                                .orElse(factory.getPriority());

                LOG.info(
                        "{} filesystem factory {} for scheme '{}' "
                                + "with priority {} (highest registered priority: {})",
                        newPriority >= registeredPriority ? "Registering" : "Skipping",
                        className,
                        scheme,
                        newPriority,
                        registeredPriority);
                if (newPriority >= registeredPriority) {

Review comment (suggestion):

```suggestion
            final Map<String, Integer> registeredPriorities = new HashMap<>();
```

Code after:
     */
    public static void initialize(Configuration config, @Nullable PluginManager pluginManager)
            throws IllegalConfigurationException {

        LOCK.lock();
        try {
            // make sure file systems are re-instantiated after re-configuration
            CACHE.clear();
            FS_FACTORIES.clear();

            Collection<Supplier<Iterator<FileSystemFactory>>> factorySuppliers = new ArrayList<>(2);
            factorySuppliers.add(() -> ServiceLoader.load(FileSystemFactory.class).iterator());

            if (pluginManager != null) {
                factorySuppliers.add(
                        () ->
                                Iterators.transform(
                                        pluginManager.load(FileSystemFactory.class),
                                        PluginFileSystemFactory::of));
            }

            final List<FileSystemFactory> fileSystemFactories =
                    loadFileSystemFactories(factorySuppliers);

            // Track registered priorities for factory selection
            final Map<String, Integer> registeredPriorities = new HashMap<>();

            // configure all file system factories
            for (FileSystemFactory factory : fileSystemFactories) {
                factory.configure(config);
                final String scheme = factory.getScheme();

                FileSystemFactory fsf =
                        ConnectionLimitingFactory.decorateIfLimited(factory, scheme, config);

                final String className = resolveFactoryClassName(factory);
                final int registeredPriority =
                        registeredPriorities.getOrDefault(scheme, Integer.MIN_VALUE);
                final int newPriority =
                        config.getOptional(CoreOptions.fileSystemFactoryPriority(scheme, className))
                                .orElse(factory.getPriority());

                LOG.info(
                        "{} filesystem factory {} for scheme '{}' "
                                + "with priority {} (highest registered priority: {})",
                        newPriority >= registeredPriority ? "Registering" : "Skipping",
                        className,
                        scheme,
                        newPriority,
                        registeredPriority);
                if (newPriority >= registeredPriority) {