List<CopyrightProfile> (File file) { try { List<CopyrightProfile> profiles = new ArrayList<>(); Element root = JDOMUtil.load(file); if (root.getName().equals("component")) { final Element copyrightElement = root.getChild("copyright"); if (copyrightElement != null) extractNewNoticeAndKeyword(copyrightElement, profiles); } else { for (Element component : root.getChildren("component")) { String name = component.getAttributeValue("name"); if (name.equals("CopyrightManager")) { for (Element o : component.getChildren("copyright")) { extractNewNoticeAndKeyword(o, profiles); } } else if (name.equals("copyright")) { extractNoticeAndKeyword(component, profiles); } } } return profiles; } catch (Exception e) { logger.info(e); Messages.showErrorDialog(e.getMessage(), CopyrightBundle.message("dialog.title.import.failure")); return null; } }