Skip to content

Commit

Permalink
Merge pull request #3016 from pdbain-ibm/cleanup
Browse files Browse the repository at this point in the history
Fix package checking for array types
  • Loading branch information
DanHeidinga committed Sep 25, 2018
2 parents f4dcaaa + ce58f60 commit 854b625
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -313,12 +313,20 @@ private static boolean isSamePackage(Class<?> a, Class<?> b){
return true;
}

while (a.isArray()) {
a = a.getComponentType();
}

while (b.isArray()) {
b = b.getComponentType();
}

VMLangAccess vma = getVMLangAccess();

String packageName1 = vma.getPackageName(a);
String packageName2 = vma.getPackageName(b);
// If the string value is different, they're definitely not related
if((packageName1 == null) || (packageName2 == null) || !packageName1.equals(packageName2)) {
if ((packageName1 == null) || (packageName2 == null) || !packageName1.equals(packageName2)) {
return false;
}

Expand Down

0 comments on commit 854b625

Please sign in to comment.