@Override public IBinaryNestedType[] getMemberTypes() { try (IReader rl = this.typeRef.lock()) { NdType type = this.typeRef.get(); if (type != null) { List<NdType> declaredTypes = type.getTypeId().getDeclaredTypes(); if (declaredTypes.isEmpty()) { return null; } NdResourceFile resFile = type.getResourceFile(); IString javaRoot = resFile.getPackageFragmentRoot(); // Filter out all the declared types which are at different java roots (only keep the ones belonging // to the same .jar file or to another .class file in the same folder). List<IBinaryNestedType> result = new ArrayList<>(); for (NdType next : declaredTypes) { NdResourceFile nextResFile = next.getResourceFile(); if (nextResFile.getPackageFragmentRoot().compare(javaRoot, true) == 0) { result.add(createBinaryNestedType(next)); } } return result.isEmpty() ? null : result.toArray(new IBinaryNestedType[result.size()]); } else { return null; } } }
@Override public IBinaryNestedType[] getMemberTypes() { try (IReader rl = this.typeRef.lock()) { NdType type = this.typeRef.get(); if (type != null) { List<NdType> declaredTypes = type.getTypeId().getDeclaredTypes(); if (declaredTypes.isEmpty()) { return null; } NdResourceFile resFile = type.getResourceFile(); IString javaRoot = resFile.getPackageFragmentRoot(); // Filter out all the declared types which are at different java roots (only keep the ones belonging // to the same .jar file or to another .class file in the same folder). List<IBinaryNestedType> result = new ArrayList<>(); for (NdType next : declaredTypes) { NdResourceFile nextResFile = next.getResourceFile(); if (nextResFile.getPackageFragmentRoot().compare(javaRoot, true) == 0) { result.add(createBinaryNestedType(next)); } } return result.isEmpty() ? null : result.toArray(new IBinaryNestedType[result.size()]); } else { return null; } } }