Library (@NotNull PackagingElementResolvingContext context) { String level = myLevel; String myLibraryName1 = myLibraryName; String moduleName = myModuleName; if (myStorage != null) { LibraryFilesPackagingElementEntity entity = (LibraryFilesPackagingElementEntity)getThisEntity(); level = getMyLevel(entity); myLibraryName1 = getMyLibraryName(entity); moduleName = getMyModuleName(entity); } if (moduleName == null && level != null && myLibraryName1 != null) { return context.findLibrary(level, myLibraryName1); } final ModulesProvider modulesProvider = context.getModulesProvider(); final Module module; if (moduleName != null) { module = modulesProvider.getModule(moduleName); if (module != null) { for (OrderEntry entry : modulesProvider.getRootModel(module).getOrderEntries()) { if (entry instanceof LibraryOrderEntry libraryEntry && libraryEntry.isModuleLevel()) { final String libraryName = libraryEntry.getLibraryName(); if (libraryName != null && libraryName.equals(myLibraryName)) { return libraryEntry.getLibrary(); } } } } } return null; }