Source:
<code>public static IArtifactComparator getArtifactComparator(String comparatorID) <START> throws IllegalArgumentException { <END> List<IConfigurationElement> extensions = Stream.of(RegistryFactory.getRegistry().getConfigurationElementsFor(COMPARATOR_POINT)) .collect(Collectors.toList()); extensions.removeIf(extension -> extension.getAttribute(ATTR_ID).equals(ArtifactChecksumComparator.COMPARATOR_ID)); Optional<IArtifactComparator> artifactComparator = findComparatorConfiguration(comparatorID, extensions) .map(ArtifactComparatorFactory::createArtifactComparator); if (artifactComparator.isPresent()) return artifactComparator.get(); if (comparatorID != null && comparatorID.startsWith(ArtifactChecksumComparator.COMPARATOR_ID)) { Optional<ArtifactChecksumComparator> checksumComparator = getChecksumComparator(comparatorID); if (checksumComparator.isPresent()) return checksumComparator.get(); } if (comparatorID != null) { Stream<String> checksumComparators = Stream.of(ChecksumUtilities.getChecksumComparatorConfigurations()) .map(element -> element.getAttribute(CHECKSUM_ID)) .map(checksumId -> ArtifactChecksumComparator.COMPARATOR_ID.concat(".").concat(checksumId)); Stream<String> comparators = extensions.stream() .map(extension -> extension.getAttribute(ATTR_ID)); String availableComparators = Stream.concat(comparators, checksumComparators).collect(Collectors.joining(", ")); throw new IllegalArgumentException(NLS.bind(Messages.exception_comparatorNotFound, comparatorID, availableComparators)); } throw new IllegalArgumentException(Messages.exception_noComparators); }</code><technical_language>Please add throws for IllegalArgumentException, runtime exception is need declare explicitly</technical_language>

Target:
public static IArtifactComparator getArtifactComparator(String comparatorID) { List<IConfigurationElement> extensions = Stream.of(RegistryFactory.getRegistry().getConfigurationElementsFor(COMPARATOR_POINT)) .collect(Collectors.toList()); extensions.removeIf(extension -> extension.getAttribute(ATTR_ID).equals(ArtifactChecksumComparator.COMPARATOR_ID)); Optional<IArtifactComparator> artifactComparator = findComparatorConfiguration(comparatorID, extensions) .map(ArtifactComparatorFactory::createArtifactComparator); if (artifactComparator.isPresent()) return artifactComparator.get(); if (comparatorID != null && comparatorID.startsWith(ArtifactChecksumComparator.COMPARATOR_ID)) { Optional<ArtifactChecksumComparator> checksumComparator = getChecksumComparator(comparatorID); if (checksumComparator.isPresent()) return checksumComparator.get(); } if (comparatorID != null) { Stream<String> checksumComparators = Stream.of(ChecksumUtilities.getChecksumComparatorConfigurations()) .map(element -> element.getAttribute(CHECKSUM_ID)) .map(checksumId -> ArtifactChecksumComparator.COMPARATOR_ID.concat(".").concat(checksumId)); Stream<String> comparators = extensions.stream() .map(extension -> extension.getAttribute(ATTR_ID)); String availableComparators = Stream.concat(comparators, checksumComparators).collect(Collectors.joining(", ")); throw new IllegalArgumentException(NLS.bind(Messages.exception_comparatorNotFound, comparatorID, availableComparators)); } throw new IllegalArgumentException(Messages.exception_noComparators); }