mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 06:45:07 +02:00
8205623: Replace use of Class::getPackage with Class::getPackageName
Reviewed-by: jjg, erikj
This commit is contained in:
parent
140e7415ff
commit
4e844fe623
3 changed files with 9 additions and 3 deletions
|
@ -675,8 +675,14 @@ public class ReflectionFactory {
|
|||
* @returns true if the two classes are in the same classloader and package
|
||||
*/
|
||||
private static boolean packageEquals(Class<?> cl1, Class<?> cl2) {
|
||||
assert !cl1.isArray() && !cl2.isArray();
|
||||
|
||||
if (cl1 == cl2) {
|
||||
return true;
|
||||
}
|
||||
|
||||
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)) {
|
||||
return null;
|
||||
}
|
||||
String path = getClass().getPackage().getName().replace('.', '/')
|
||||
String path = getClass().getPackageName().replace('.', '/')
|
||||
+ '/' + info.getString(key);
|
||||
byte[] data;
|
||||
try (InputStream is = getResourceAsStream(path)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue