8205623: Replace use of Class::getPackage with Class::getPackageName
Reviewed-by: jjg, erikj
This commit is contained in:
parent
140e7415ff
commit
4e844fe623
@ -675,8 +675,14 @@ public class ReflectionFactory {
|
|||||||
* @returns true if the two classes are in the same classloader and package
|
* @returns true if the two classes are in the same classloader and package
|
||||||
*/
|
*/
|
||||||
private static boolean packageEquals(Class<?> cl1, Class<?> cl2) {
|
private static boolean packageEquals(Class<?> cl1, Class<?> cl2) {
|
||||||
|
assert !cl1.isArray() && !cl2.isArray();
|
||||||
|
|
||||||
|
if (cl1 == cl2) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
return cl1.getClassLoader() == cl2.getClassLoader() &&
|
return cl1.getClassLoader() == cl2.getClassLoader() &&
|
||||||
Objects.equals(cl1.getPackage(), cl2.getPackage());
|
Objects.equals(cl1.getPackageName(), cl2.getPackageName());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -69,7 +69,7 @@ public abstract class BreakIteratorResourceBundle extends ResourceBundle {
|
|||||||
if (!info.containsKey(key)) {
|
if (!info.containsKey(key)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
String path = getClass().getPackage().getName().replace('.', '/')
|
String path = getClass().getPackageName().replace('.', '/')
|
||||||
+ '/' + info.getString(key);
|
+ '/' + info.getString(key);
|
||||||
byte[] data;
|
byte[] data;
|
||||||
try (InputStream is = getResourceAsStream(path)) {
|
try (InputStream is = getResourceAsStream(path)) {
|
||||||
|
@ -53,7 +53,7 @@ final class CatalogMessages {
|
|||||||
public static final String ERR_CREATING_URI = "FailedCreatingURI";
|
public static final String ERR_CREATING_URI = "FailedCreatingURI";
|
||||||
public static final String ERR_OTHER = "OtherError";
|
public static final String ERR_OTHER = "OtherError";
|
||||||
|
|
||||||
static final String bundleName = CatalogMessages.class.getPackage().getName() + ".CatalogMessages";
|
static final String bundleName = CatalogMessages.class.getPackageName() + ".CatalogMessages";
|
||||||
static ResourceBundle resourceBundle;
|
static ResourceBundle resourceBundle;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user