mirror of
https://github.com/openjdk/jdk.git
synced 2026-02-20 23:36:18 +00:00
8148981: remove ResolvedJavaType.getClassFilePath()
Reviewed-by: twisti
This commit is contained in:
parent
76b459d629
commit
56c2dccccf
@ -33,7 +33,6 @@ import java.lang.reflect.Array;
|
||||
import java.lang.reflect.Constructor;
|
||||
import java.lang.reflect.Method;
|
||||
import java.lang.reflect.Modifier;
|
||||
import java.net.URL;
|
||||
import java.nio.ByteOrder;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
@ -49,7 +48,6 @@ import jdk.vm.ci.meta.Constant;
|
||||
import jdk.vm.ci.meta.JavaConstant;
|
||||
import jdk.vm.ci.meta.JavaKind;
|
||||
import jdk.vm.ci.meta.JavaType;
|
||||
import jdk.vm.ci.meta.MetaUtil;
|
||||
import jdk.vm.ci.meta.ModifiersProvider;
|
||||
import jdk.vm.ci.meta.ResolvedJavaField;
|
||||
import jdk.vm.ci.meta.ResolvedJavaMethod;
|
||||
@ -838,12 +836,6 @@ final class HotSpotResolvedObjectTypeImpl extends HotSpotResolvedJavaType implem
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public URL getClassFilePath() {
|
||||
Class<?> cls = mirror();
|
||||
return cls.getResource(MetaUtil.getSimpleName(cls, true).replace('.', '$') + ".class");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isLocal() {
|
||||
return mirror().isLocalClass();
|
||||
|
||||
@ -27,7 +27,6 @@ import static java.util.Objects.requireNonNull;
|
||||
import java.lang.annotation.Annotation;
|
||||
import java.lang.reflect.Array;
|
||||
import java.lang.reflect.Modifier;
|
||||
import java.net.URL;
|
||||
|
||||
import jdk.vm.ci.common.JVMCIError;
|
||||
import jdk.vm.ci.meta.Assumptions.AssumptionResult;
|
||||
@ -239,11 +238,6 @@ public final class HotSpotResolvedPrimitiveType extends HotSpotResolvedJavaType
|
||||
return kind.toJavaClass();
|
||||
}
|
||||
|
||||
@Override
|
||||
public URL getClassFilePath() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isLocal() {
|
||||
return false;
|
||||
|
||||
@ -23,7 +23,6 @@
|
||||
package jdk.vm.ci.meta;
|
||||
|
||||
import java.lang.annotation.Annotation;
|
||||
import java.net.URL;
|
||||
|
||||
import jdk.vm.ci.meta.Assumptions.AssumptionResult;
|
||||
|
||||
@ -307,11 +306,6 @@ public interface ResolvedJavaType extends JavaType, ModifiersProvider {
|
||||
*/
|
||||
String getSourceFileName();
|
||||
|
||||
/**
|
||||
* Returns the class file path - if available - of this type, or {@code null}.
|
||||
*/
|
||||
URL getClassFilePath();
|
||||
|
||||
/**
|
||||
* Returns {@code true} if the type is a local type.
|
||||
*/
|
||||
|
||||
@ -47,7 +47,6 @@ import java.lang.annotation.Annotation;
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Method;
|
||||
import java.lang.reflect.Modifier;
|
||||
import java.net.URL;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
@ -849,23 +848,6 @@ public class TestResolvedJavaType extends TypeUniverse {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void classFilePathTest() {
|
||||
for (Class<?> c : classes) {
|
||||
ResolvedJavaType type = metaAccess.lookupJavaType(c);
|
||||
URL path = type.getClassFilePath();
|
||||
if (type.isPrimitive() || type.isArray()) {
|
||||
assertEquals(null, path);
|
||||
} else {
|
||||
assertNotNull(path);
|
||||
String pathString = path.getPath();
|
||||
if (type.isLocal() || type.isMember()) {
|
||||
assertTrue(pathString.indexOf('$') > 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void isTrustedInterfaceTypeTest() {
|
||||
for (Class<?> c : classes) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user