fix Loader visibility

GitOrigin-RevId: ed7401b7533173e4807484171872e42823d093fd
This commit is contained in:
Vladimir Krivosheev
2025-02-10 09:25:10 +01:00
committed by intellij-monorepo-bot
parent 3bc0ba729a
commit 3d2bc0a6d6
6 changed files with 17 additions and 27 deletions

View File

@@ -1,18 +1,4 @@
/*
* Copyright 2000-2016 JetBrains s.r.o.
*
* Licensed 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.
*/
// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package com.intellij.compiler.instrumentation;
import java.io.IOException;
@@ -25,7 +11,7 @@ import java.util.*;
/**
* Invoked via reflection from InstrumentationClassFinder
*/
public class JrtLoader extends InstrumentationClassFinder.ClassFinderClasspath.Loader{
public final class JrtLoader extends InstrumentationClassFinder.ClassFinderClasspath.Loader {
private static final URI ROOT_URI = URI.create("jrt:/");
private static final InstrumentationClassFinder.Resource NULL_RESOURCE = ()-> null;
private List<Path> myRoots;

View File

@@ -533,7 +533,7 @@ public class InstrumentationClassFinder {
}
abstract static class Loader {
public abstract static class Loader {
protected static final String JAR_PROTOCOL = "jar";
protected static final String FILE_PROTOCOL = "file";
protected static final String JRT_PROTOCOL = "jrt";

View File

@@ -1,4 +1,4 @@
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package com.intellij.util.lang;
import org.jetbrains.annotations.ApiStatus;
@@ -48,7 +48,7 @@ public final class ClassPath {
private int searchOffset = 0;
private final @NotNull Function<Path, ResourceFile> resourceFileFactory;
final boolean mimicJarUrlConnection;
public final boolean mimicJarUrlConnection;
private final List<Loader> loaders = new ArrayList<>();
private volatile boolean allUrlsWereProcessed;

View File

@@ -1,6 +1,7 @@
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package com.intellij.util.lang;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -19,7 +20,8 @@ import java.util.function.BiConsumer;
import java.util.function.Predicate;
import java.util.jar.Attributes;
final class JarLoader implements Loader {
@ApiStatus.Internal
public final class JarLoader implements Loader {
enum Attribute {
SPEC_TITLE, SPEC_VERSION, SPEC_VENDOR, CLASS_PATH, IMPL_TITLE, IMPL_VERSION, IMPL_VENDOR
}
@@ -35,8 +37,8 @@ final class JarLoader implements Loader {
new AbstractMap.SimpleImmutableEntry<>(Attribute.IMPL_VENDOR, Attributes.Name.IMPLEMENTATION_VENDOR)
};
final ClassPath configuration;
final URL url;
public final ClassPath configuration;
public final URL url;
public final ResourceFile zipFile;
private final Path path;

View File

@@ -1,6 +1,7 @@
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package com.intellij.util.lang;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.Nullable;
import java.io.IOException;
@@ -12,7 +13,8 @@ import java.util.function.Predicate;
/**
* An object responsible for loading classes and resources from a particular classpath element: a jar or a directory.
*/
interface Loader {
@ApiStatus.Internal
public interface Loader {
Path getPath();
@Nullable Resource getResource(String name);

View File

@@ -1,4 +1,4 @@
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package com.intellij.util.lang;
import org.jetbrains.annotations.ApiStatus;
@@ -23,7 +23,7 @@ public final class ImmutableZipEntry {
final int compressedSize;
private final byte method;
final String name;
public final String name;
// headerOffset and nameLengthInBytes
private final long offsets;