auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public Boolean apply(EntryView.ReadWriteEntryView<K, Collection<V>> entryView) { boolean removed = false; try { <START> Collection<V> values = entryView.get(); <END> if(value == null) { entryView.remove(); removed = true; } else if (values.contains(value)){ Collection<V> newValues = new HashSet<>(); newValues.addAll(values); newValues.remove(value); if(newValues.isEmpty()) { entryView.remove(); } else { entryView.set(newValues); } removed = newValues.size() < values.size(); } } catch (NoSuchElementException ex) { } return removed; }</code><technical_language>Again, exception handling for regular control flow</technical_language>

Target:
public Boolean apply(EntryView.ReadWriteEntryView<K, Collection<V>> entryView) { Boolean removed; if (value == null) { removed = removeKey(entryView); } else { removed = removeKeyValue(entryView); } return removed; }
Source:
<code>public void tearDown() { <START> account.shutdown(); <END> }</code><technical_language>I this removed, setup code cookieBasedClient account</technical_language>

Target:
public void tearDown() { account.shutdown(); cookieBasedClient.shutdown(); }
Source:
<code>private List<Product> getProducts(boolean getRefs) throws CatalogException { IndexSearcher searcher = null; List<Product> products = new Vector<Product>(); try { try { reader = DirectoryReader.open(indexDir); } catch (IOException e) { e.printStackTrace(); } searcher = new IndexSearcher(reader); Term productIdTerm = new Term("myfield", "myvalue"); org.apache.lucene.search.Query query = new TermQuery(productIdTerm); Sort sort = new Sort(new SortField("CAS.ProductReceivedTime", SortField.Type.STRING, true)); TopDocs check = searcher.search(query, 1, sort); if(check.totalHits>0) { TopDocs topDocs = searcher.search(query, check.totalHits, sort); ScoreDoc[] hits = topDocs.scoreDocs; if (hits.length > 0) { for (ScoreDoc hit : hits) { Document productDoc = searcher.doc(hit.doc); CompleteProduct prod = toCompleteProduct(productDoc, getRefs, false); products.add(prod.getProduct()); } } else { LOG.log(Level.FINEST, "Request for products returned no results"); <START> return products; <END> } } } catch (IOException e) { LOG.log(Level.WARNING, "IOException when opening index directory: [" + indexFilePath + "] for search: Message: " + e.getMessage()); throw new CatalogException(e.getMessage(), e); } finally { if (searcher != null) { try { } catch (Exception ignore) { } } } return products; }</code><technical_language>remove this line right? returning products end of this method anyway</technical_language>

Target:
private List<Product> getProducts(boolean getRefs) throws CatalogException { IndexSearcher searcher = null; List<Product> products = new Vector<Product>(); try { try { reader = DirectoryReader.open(indexDir); } catch (IOException e) { e.printStackTrace(); } searcher = new IndexSearcher(reader); Term productIdTerm = new Term("myfield", "myvalue"); org.apache.lucene.search.Query query = new TermQuery(productIdTerm); Sort sort = new Sort(new SortField("CAS.ProductReceivedTime", SortField.Type.STRING, true)); TopDocs check = searcher.search(query, 1, sort); if(check.totalHits>0) { TopDocs topDocs = searcher.search(query, check.totalHits, sort); ScoreDoc[] hits = topDocs.scoreDocs; if (hits.length > 0) { for (ScoreDoc hit : hits) { Document productDoc = searcher.doc(hit.doc); CompleteProduct prod = toCompleteProduct(productDoc, getRefs, false); products.add(prod.getProduct()); } } else { LOG.log(Level.FINEST, "Request for products returned no results"); } } } catch (IOException e) { LOG.log(Level.WARNING, "IOException when opening index directory: [" + indexFilePath + "] for search: Message: " + e.getMessage()); throw new CatalogException(e.getMessage(), e); } finally { if (searcher != null) { try { } catch (Exception ignore) { } } } return products; }
Source:
<code>public static void addMappingsFrom(File file) { try { <START> addMappingsFrom(new FileInputStream(file)); <END> } catch (FileNotFoundException ex) { log.log(Level.SEVERE, "Failed loading SHA1 to CoordinateUtils mapping from " + file.toString() + ": " + ex.getMessage(), ex); } }</code><technical_language>closing file handles now? :)</technical_language>

Target:
public static void addMappingsFrom(File file) { try (FileInputStream inputStream = new FileInputStream(file)) { LineIterator it = IOUtils.lineIterator(inputStream, "UTF-8"); while (it.hasNext()) { String line = it.next(); if (line.startsWith("#") || line.trim().isEmpty()) continue; String[] parts = StringUtils.split(line, ' '); if (parts.length < 2) throw new IllegalArgumentException("Expected 'SHA1 GROUP_ID:ARTIFACT_ID:VERSION[:COORDINATE]', but was [" + line + "] in [" + file + "]"); addMapping(parts[0], parts[1]); } } catch (IOException e) { throw new WindupException("Failed to load SHA1 to " + Coordinate.class.getSimpleName() + " definitions from [" + file + "]", e); } }
Source:
<code>public void visitNode(Tree tree) { if (tree.is(Tree.Kind.METHOD)) { methodUsesLocks.push(false); } if (tree.is(Tree.Kind.METHOD_INVOCATION) <START> && (lockMethod.matches((MethodInvocationTree) tree) || tryLockMethod.matches((MethodInvocationTree) tree)) <END> && methodUsesLocks.size() != 1) { methodUsesLocks.pop(); methodUsesLocks.push(true); } if (hasSemantic() && tree.is(Tree.Kind.ASSIGNMENT)) { AssignmentExpressionTree aet = (AssignmentExpressionTree) tree; if (aet.variable().is(Tree.Kind.IDENTIFIER) && !isInSyncBlock() && !withinStaticInitializer.peek() && !isUsingLock()) { IdentifierTree variable = (IdentifierTree) aet.variable(); if (isStaticNotVolatileObject(variable)) { reportIssue(variable, "Synchronize this lazy initialization of '" + variable.name() + "'"); } } } if (tree.is(Tree.Kind.STATIC_INITIALIZER)) { withinStaticInitializer.push(true); } super.visitNode(tree); }</code><technical_language>LOCK_METHODS.anyMatch((MethodInvocationTree) tree)</technical_language>

Target:
public void visitNode(Tree tree) { if (tree.is(Tree.Kind.METHOD)) { methodUsesLocks.push(false); } if (tree.is(Tree.Kind.METHOD_INVOCATION) && (locks.anyMatch((MethodInvocationTree) tree)) && methodUsesLocks.size() != 1) { methodUsesLocks.pop(); methodUsesLocks.push(true); } if (hasSemantic() && tree.is(Tree.Kind.ASSIGNMENT)) { AssignmentExpressionTree aet = (AssignmentExpressionTree) tree; if (aet.variable().is(Tree.Kind.IDENTIFIER) && !isInSyncBlock() && !withinStaticInitializer.peek() && !isUsingLock()) { IdentifierTree variable = (IdentifierTree) aet.variable(); if (isStaticNotVolatileObject(variable)) { reportIssue(variable, "Synchronize this lazy initialization of '" + variable.name() + "'"); } } } if (tree.is(Tree.Kind.STATIC_INITIALIZER)) { withinStaticInitializer.push(true); } super.visitNode(tree); }
Source:
<code>public void verifyNoAsyncErrors() { for (Throwable e : asyncErrors) { <START> if (e instanceof AssertionError) throw (AssertionError) e; <END> else fail("Async error during test execution: " + e); } }</code><technical_language>this is currently working I guess, if wrap in RuntimeException</technical_language>

Target:
public void verifyNoAsyncErrors() { for (Throwable e : asyncErrors) { if (e instanceof AssertionError) { throw (AssertionError) e; } else { fail("Async error during test execution: " + e); } } }
Source:
<code>public void testInvalidKeyConfiguration() { TwitterComponent component = context().getComponent("twitter", TwitterComponent.class); TwitterComponentVerifier verifier = (TwitterComponentVerifier)component.getVerifier(); Map<String, Object> parameters = getParameters(); parameters.put("consumerKey", "invalid"); ComponentVerifier.Result result = verifier.verify(ComponentVerifier.Scope.CONNECTIVITY, parameters); Assert.assertEquals(ComponentVerifier.Result.Status.ERROR, result.getStatus()); Assert.assertEquals(1, result.getErrors().size()); Assert.assertEquals(VerificationError.StandardCode.AUTHENTICATION, result.getErrors().get(0).getCode()); Assert.assertEquals(401, result.getErrors().get(0).getDetails().get("twitter_status_code")); <START> Assert.assertEquals(32, result.getErrors().get(0).getDetails().get("twitter_error_code")); <END> }</code><technical_language>tests wrong details retrieved a key of type Attribute (and need implements equals)</technical_language>

Target:
public void testInvalidKeyConfiguration() { TwitterComponent component = context().getComponent("twitter", TwitterComponent.class); TwitterComponentVerifier verifier = (TwitterComponentVerifier)component.getVerifier(); Map<String, Object> parameters = getParameters(); parameters.put("consumerKey", "invalid"); ComponentVerifier.Result result = verifier.verify(ComponentVerifier.Scope.CONNECTIVITY, parameters); Assert.assertEquals(ComponentVerifier.Result.Status.ERROR, result.getStatus()); Assert.assertEquals(1, result.getErrors().size()); Assert.assertEquals(VerificationError.StandardCode.AUTHENTICATION, result.getErrors().get(0).getCode()); Assert.assertEquals(401, result.getErrors().get(0).getDetails().get(asAttribute("twitter_status_code"))); Assert.assertEquals(32, result.getErrors().get(0).getDetails().get(asAttribute("twitter_error_code"))); }
Source:
<code>public void destroySession(String sessionName, IProgressMonitor monitor) throws ExecutionException { String newName = formatParameter(sessionName); StringBuffer command = createCommand(LTTngControlServiceConstants.COMMAND_DESTROY_SESSION, newName); ICommandResult result = executeCommand(command.toString(), monitor, false); String[] errorOutput = result.getErrorOutput(); if (isError(result) && (errorOutput != null)) { int index = 0; while (index < errorOutput.length) { String line = errorOutput[index]; Matcher matcher = LTTngControlServiceConstants.SESSION_NOT_FOUND_ERROR_PATTERN.matcher(line); if (matcher.matches()) { return; } index++; <START> } <END> throw new ExecutionException(Messages.TraceControl_CommandError + " " + command.toString() + "\n" + formatOutput(result)); } Document doc = getDocumentFromStrings(result.getOutput()); NodeList sessions = doc.getElementsByTagName(MIStrings.SESSION); if (sessions.getLength() != 1) { throw new ExecutionException(NLS.bind(Messages.TraceControl_MiInvalidNumberOfElementError, MIStrings.SESSION)); } Node rawSessionName = getFirstOf(sessions.item(0).getChildNodes(), MIStrings.NAME); if (rawSessionName == null) { throw new ExecutionException(Messages.TraceControl_MiMissingRequiredError); } if (!rawSessionName.getTextContent().equals(sessionName)) { throw new ExecutionException(NLS.bind(Messages.TraceControl_UnexpectedValueError, rawSessionName.getTextContent(), sessionName)); } }</code><technical_language>copy</technical_language>

Target:
public void destroySession(String sessionName, IProgressMonitor monitor) throws ExecutionException { String newName = formatParameter(sessionName); StringBuffer command = createCommand(LTTngControlServiceConstants.COMMAND_DESTROY_SESSION, newName); ICommandResult result = executeCommand(command.toString(), monitor, false); String[] errorOutput = result.getErrorOutput(); if (isError(result) && (errorOutput != null)) { if (ignoredPattern(errorOutput, LTTngControlServiceConstants.SESSION_NOT_FOUND_ERROR_PATTERN)) { return; } throw new ExecutionException(Messages.TraceControl_CommandError + " " + command.toString() + "\n" + formatOutput(result)); } Document doc = getDocumentFromStrings(result.getOutput()); NodeList sessions = doc.getElementsByTagName(MIStrings.SESSION); if (sessions.getLength() != 1) { throw new ExecutionException(NLS.bind(Messages.TraceControl_MiInvalidNumberOfElementError, MIStrings.SESSION)); } Node rawSessionName = getFirstOf(sessions.item(0).getChildNodes(), MIStrings.NAME); if (rawSessionName == null) { throw new ExecutionException(Messages.TraceControl_MiMissingRequiredError); } if (!rawSessionName.getTextContent().equals(sessionName)) { throw new ExecutionException(NLS.bind(Messages.TraceControl_UnexpectedValueError, rawSessionName.getTextContent(), sessionName)); } }
Source:
<code>private static void assertXaException(ExceptionRunnable runnable, int errorCode) { try { runnable.run(); fail(); } catch (Exception e) { Exceptions.assertException(XAException.class, e); <START> assertEquals(errorCode, ((XAException) e).errorCode); <END> } }</code><technical_language>assertException here, do this: private static void assertXaException(ExceptionRunnable runnable, int errorCode) throws Exception { try { runnable.run(); fail(); } catch (XAException e) { assertEquals(errorCode, e.errorCode); } } move helper methods tests</technical_language>

Target:
private static void assertXaException(ExceptionRunnable runnable, int errorCode) throws Exception { try { runnable.run(); fail(); } catch (XAException e) { assertEquals(errorCode, e.errorCode); } }
Source:
<code>public void changeImageAlignment() { int numOfMedia = 3; List<String> wikiTexts = new ArrayList<String>(); wikiTexts.add("|centre"); wikiTexts.add("|left"); String randomArticleName = PageContent.ARTICLE_NAME_PREFIX + new VisualEditorPageObject(driver).getTimeStamp(); VisualEditorPageObject ve = new VisualEditorPageObject(driver).openVEOnArticle(wikiURL, randomArticleName); ve.verifyVEToolBarPresent(); ve.verifyEditorSurfacePresent(); VisualEditorAddMediaDialog mediaDialog = ve.clickImageButton(); mediaDialog = mediaDialog.searchMedia("h"); ve = mediaDialog.addExistingMedia(numOfMedia); ve.verifyMedias(numOfMedia); ve.verifyEditorSurfacePresent(); ve.verifyVEToolBarPresent(); ve.selectMediaByIndex(2); VisualEditorMediaSettingsDialog mediaSettingsDialog = ve.openMediaSettings(); mediaSettingsDialog.selectSettings(Setting.ADVANCED); mediaSettingsDialog.clickAlignment(Alignment.LEFT); ve = mediaSettingsDialog.clickApplyChangesButton(); ve.verifyEditorSurfacePresent(); ve.verifyVEToolBarPresent(); ve.selectMediaByIndex(0); mediaSettingsDialog = ve.openMediaSettings(); mediaSettingsDialog.selectSettings(Setting.ADVANCED); mediaSettingsDialog.clickAlignment(Alignment.CENTER); ve = mediaSettingsDialog.clickApplyChangesButton(); ve.verifyEditorSurfacePresent(); ve.verifyVEToolBarPresent(); VisualEditorSaveChangesDialog saveDialog = ve.clickPublishButton(); VisualEditorReviewChangesDialog reviewDialog = saveDialog.clickReviewYourChanges(); reviewDialog.verifyAddedDiffs(wikiTexts); saveDialog = reviewDialog.clickReturnToSaveFormButton(); ArticlePageObject article = saveDialog.savePage(); <START> article.verifyVEPublishComplete(); <END> }</code><technical_language>I try divide code meaningful chunks (small methods is method name)</technical_language>

Target:
public void changeImageAlignment() { int numOfMedia = 3; List<String> wikiTexts = new ArrayList<String>(); wikiTexts.add("|centre"); wikiTexts.add("|left"); String randomArticleName = PageContent.ARTICLE_NAME_PREFIX + new VisualEditorPageObject(driver).getTimeStamp(); VisualEditorPageObject ve = new VisualEditorPageObject(driver).openVEOnArticle(wikiURL, randomArticleName); VisualEditorAddMediaDialog mediaDialog = ve.searchImage("h"); ve = mediaDialog.addExistingMedia(numOfMedia); ve.verifyMedias(numOfMedia); ve.alignMedia(2, Alignment.LEFT); ve.alignMedia(0, Alignment.CENTER); ve.verifyEditorSurfacePresent(); ve.verifyVEToolBarPresent(); VisualEditorSaveChangesDialog saveDialog = ve.clickPublishButton(); VisualEditorReviewChangesDialog reviewDialog = saveDialog.clickReviewYourChanges(); reviewDialog.verifyAddedDiffs(wikiTexts); saveDialog = reviewDialog.clickReturnToSaveFormButton(); ArticlePageObject article = saveDialog.savePage(); article.verifyVEPublishComplete(); }
Source:
<code>void packageNameFilterInclude_matchingPackagesAreIncluded() { EngineDiscoveryRequest request = request().filters( PackageNameFilter.includePackageNames("org.junit.jupiter.engine")).build(); TestDescriptor engineDescriptor = engineDescriptor() .with( classTestDescriptor("matching", MatchingClass.class) ) .build(); applier.applyAllFilters(request, engineDescriptor); Stream<UniqueId> includedDescriptors = engineDescriptor.getDescendants().stream().map(TestDescriptor::getUniqueId); assertThat(includedDescriptors) <START> .containsExactly(UniqueId.root("class", "matching")); <END> }</code><technical_language>java assertThat(engineDescriptor.getDescendants()) .extracting(TestDescriptor::getUniqueId) .containsExactly(UniqueId.root("class", "matching"))</technical_language>

Target:
void packageNameFilterInclude_matchingPackagesAreIncluded() { EngineDiscoveryRequest request = request().filters( PackageNameFilter.includePackageNames("org.junit.jupiter.engine")).build(); TestDescriptor engineDescriptor = engineDescriptor() .with( classTestDescriptor("matching", MatchingClass.class) ) .build(); applier.applyAllFilters(request, engineDescriptor); assertThat(engineDescriptor.getDescendants()) .extracting(TestDescriptor::getUniqueId) .containsExactly(UniqueId.root("class", "matching")); }
Source:
<code>public static List<VerificationError> requiresAny(Map<String, Object> parameters, Collection<OptionsGroup> groups) { final List<VerificationError> verificationErrors = new ArrayList<>(); final Set<String> keys = new HashSet<>(parameters.keySet()); for (OptionsGroup group : groups) { final Set<String> required = required(group.getOptions()); final ResultErrorBuilder builder = new ResultErrorBuilder() <START> .code(VerificationError.StandardCode.INCOMPLETE_PARAMETER_GROUP) <END> .detail(VerificationError.GroupAttribute.GROUP_NAME, group.getName()) .detail(VerificationError.GroupAttribute.GROUP_OPTIONS, String.join(",", parameters(group.getOptions()))); if (keys.containsAll(required)) { final Set<String> excluded = excluded(group.getOptions()); final Set<String> shouldBeExcluded = new HashSet<>(keys); shouldBeExcluded.retainAll(excluded); if (shouldBeExcluded.isEmpty()) { return Collections.emptyList(); } shouldBeExcluded.forEach(builder::parameterKey); verificationErrors.add(builder.build()); } else { for (String option : required) { if (!parameters.containsKey(option)) { builder.parameterKey(option); } } verificationErrors.add(builder.build()); } } return verificationErrors; }</code><technical_language>Is true is INCOMPLETE_PARAMETER_GROUP ? another error code CONTRADICTING_PARAMETER_GROUP sense here,</technical_language>

Target:
public static List<VerificationError> requiresAny(Map<String, Object> parameters, Collection<OptionsGroup> groups) { final List<VerificationError> verificationErrors = new ArrayList<>(); final Set<String> keys = new HashSet<>(parameters.keySet()); for (OptionsGroup group : groups) { final Set<String> required = required(group.getOptions()); final Set<String> excluded = excluded(group.getOptions()); final ResultErrorBuilder builder = new ResultErrorBuilder() .code(VerificationError.StandardCode.ILLEGAL_PARAMETER_GROUP_COMBINATION) .detail(VerificationError.GroupAttribute.GROUP_NAME, group.getName()) .detail(VerificationError.GroupAttribute.GROUP_OPTIONS, String.join(",", parameters(group.getOptions()))); if (keys.containsAll(required)) { final Set<String> shouldBeExcluded = new HashSet<>(keys); shouldBeExcluded.retainAll(excluded); if (shouldBeExcluded.isEmpty()) { return Collections.emptyList(); } shouldBeExcluded.forEach(builder::parameterKey); verificationErrors.add(builder.build()); } else { for (String option : required) { if (!parameters.containsKey(option)) { builder.parameterKey(option); } } for (String option : excluded) { if (parameters.containsKey(option)) { builder.parameterKey(option); } } verificationErrors.add(builder.build()); } } return verificationErrors; }
Source:
<code>public void checkAttributeValue(PerunSessionImpl sess, User user, Attribute attribute) throws InternalErrorException, WrongAttributeValueException, WrongAttributeAssignmentException, WrongReferenceAttributeValueException { List<String> pshell = (List<String>) attribute.getValue(); if (pshell != null) <START> for(String shell : pshell){ <END> if(shell != null){ if(shell.isEmpty())throw new WrongAttributeValueException("shell cannot be empty"); else{ sess.getPerunBl().getModulesUtilsBl().checkFormatOfShell(shell, attribute); } } } }</code><technical_language>This syntax is confusing</technical_language>

Target:
public void checkAttributeValue(PerunSessionImpl sess, User user, Attribute attribute) throws InternalErrorException, WrongAttributeValueException, WrongAttributeAssignmentException, WrongReferenceAttributeValueException { List<String> pshell = (List<String>) attribute.getValue(); if (pshell != null){ for(String shell : pshell){ if(shell != null){ if(shell.isEmpty()){ throw new WrongAttributeValueException("shell cannot be empty"); }else{ sess.getPerunBl().getModulesUtilsBl().checkFormatOfShell(shell, attribute); } }else{ throw new WrongAttributeValueException("shell cannot be null"); } } } }
Source:
<code>public ChatComponent setObfuscated(boolean obfuscated) { <START> $lock.writeLock().lock(); <END> if (this.obfuscated == null) this.obfuscated = new AtomicBoolean(obfuscated); else this.obfuscated.set(obfuscated); $lock.writeLock().unlock(); return this; }</code><technical_language>THREAD-SAFETY This is a poor construct for a thread-safe class. save (that much) memory, solved a volatile boolean set false a default instead</technical_language>

Target:
public ChatComponent setObfuscated(boolean obfuscated) { if (this.obfuscated == null) this.obfuscated = new AtomicBoolean(obfuscated); else this.obfuscated.set(obfuscated); return this; }
Source:
<code>private Pattern compile(String name) throws MaxwellInvalidFilterException { if ( name.startsWith("/") ) { if ( !name.endsWith("/") ) { throw new MaxwellInvalidFilterException("Invalid regular expression: " + name); } return Pattern.compile(name.substring(1, name.length() - 1)); } else { <START> return Pattern.compile("^" + name.trim() + "$"); <END> } }</code><technical_language>er. Is this possible? Cmd line arguments separated spaces. more natural assumption db/table names spaces in (if mysql supports that), assume users provide db names --include_databases='db name','another db' option parser strip out quotes</technical_language>

Target:
private Pattern compile(String name) throws MaxwellInvalidFilterException { name = name.trim(); if ( name.startsWith("/") ) { if ( !name.endsWith("/") ) { throw new MaxwellInvalidFilterException("Invalid regular expression: " + name); } return Pattern.compile(name.substring(1, name.length() - 1)); } else { return Pattern.compile("^" + name + "$"); } }
Source:
<code>public static AlarmData copyFrom(IAlarmData source) { if (source == null) { return null; } AlarmData alarmData = new AlarmData(); alarmData.setReductionKey(source.getReductionKey()); alarmData.setAlarmType(source.getAlarmType()); alarmData.setClearKey(source.getClearKey()); alarmData.setAutoClean(source.getAutoClean()); alarmData.setX733AlarmType(source.getX733AlarmType()); alarmData.setX733ProbableCause(source.getX733ProbableCause()); alarmData.getUpdateFieldList().addAll( source.getUpdateFieldList().stream().map(UpdateField::copyFrom).collect(Collectors.toList())); alarmData.setManagedObject( <START> source.getManagedObject() == null ? null : ManagedObject.copyFrom(source.getManagedObject())); <END> return alarmData; }</code><technical_language>Minor nitpick. null check necessary copyFrom() methods handle null case. update this in other usages well</technical_language>

Target:
public static AlarmData copyFrom(IAlarmData source) { if (source == null) { return null; } AlarmData alarmData = new AlarmData(); alarmData.setReductionKey(source.getReductionKey()); alarmData.setAlarmType(source.getAlarmType()); alarmData.setClearKey(source.getClearKey()); alarmData.setAutoClean(source.getAutoClean()); alarmData.setX733AlarmType(source.getX733AlarmType()); alarmData.setX733ProbableCause(source.getX733ProbableCause()); alarmData.getUpdateFieldList().addAll( source.getUpdateFieldList().stream().map(UpdateField::copyFrom).collect(Collectors.toList())); alarmData.setManagedObject(ManagedObject.copyFrom(source.getManagedObject())); return alarmData; }
Source:
<code><START> private synchronized BulkMutation getOrAddBulkMutation(String tableName) { <END> if (tableToBulkMutation.containsKey(tableName)) { return tableToBulkMutation.get(tableName); } final BulkMutation bulkMutation = session .createBulkMutation( session .getOptions() .getInstanceName() .toTableName(tableName), session.createAsyncExecutor()); tableToBulkMutation.put(tableName, bulkMutation); return bulkMutation; }</code><technical_language>Synchronize private lock. <LINK_0></technical_language>

Target:
private BulkMutation getOrAddBulkMutation(String tableName) { synchronized (lock) { if (tableToBulkMutation.containsKey(tableName)) { return tableToBulkMutation.get(tableName); } final BulkMutation bulkMutation = session .createBulkMutation( session .getOptions() .getInstanceName() .toTableName(tableName), session.createAsyncExecutor()); tableToBulkMutation.put(tableName, bulkMutation); return bulkMutation; } }
Source:
<code>public void run(IProgressMonitor monitor) throws InvocationTargetException { if (operationResult != null) throw new IllegalStateException(CoreText.OperationAlreadyExecuted); EclipseGitProgressTransformer gitMonitor = new EclipseGitProgressTransformer( <START> SubMonitor.convert(monitor, 1)); <END> try (Git git = new Git(repository)) { FetchCommand command; if (rc == null) command = git.fetch().setRemote(uri.toPrivateString()) .setRefSpecs(specs); else command = git.fetch().setRemote(rc.getName()); command.setCredentialsProvider(credentialsProvider) .setTimeout(timeout).setDryRun(dryRun) .setProgressMonitor(gitMonitor); if (tagOpt != null) command.setTagOpt(tagOpt); try { operationResult = command.call(); } catch (JGitInternalException e) { throw new InvocationTargetException( e.getCause() != null ? e.getCause() : e); } catch (Exception e) { throw new InvocationTargetException(e); } } }</code><technical_language>pass monitor directly</technical_language>

Target:
public void run(IProgressMonitor monitor) throws InvocationTargetException { if (operationResult != null) throw new IllegalStateException(CoreText.OperationAlreadyExecuted); EclipseGitProgressTransformer gitMonitor = new EclipseGitProgressTransformer( monitor); try (Git git = new Git(repository)) { FetchCommand command; if (rc == null) command = git.fetch().setRemote(uri.toPrivateString()) .setRefSpecs(specs); else command = git.fetch().setRemote(rc.getName()); command.setCredentialsProvider(credentialsProvider) .setTimeout(timeout).setDryRun(dryRun) .setProgressMonitor(gitMonitor); if (tagOpt != null) command.setTagOpt(tagOpt); try { operationResult = command.call(); } catch (JGitInternalException e) { throw new InvocationTargetException( e.getCause() != null ? e.getCause() : e); } catch (Exception e) { throw new InvocationTargetException(e); } } }
Source:
<code>public boolean validate() throws Exception { CompilerEnvirons env = new CompilerEnvirons(); env.setRecoverFromErrors(true); Parser parser = new Parser(env, new JSErrorReporter()); AstRoot rootNode = parser.parse(script, null, 0); JSNodeVisitor nodeVisitor = new JSNodeVisitor(); rootNode.visit(nodeVisitor); <START> if (nodeVisitor.getRoot().visit(new JSSymbolVisitor())) { <END> return true; } return false; }</code><technical_language>simplified java return nodeVisitor.getRoot().visit(new JSSymbolVisitor());</technical_language>

Target:
public boolean validate() throws Exception { CompilerEnvirons env = new CompilerEnvirons(); env.setRecoverFromErrors(true); Parser parser = new Parser(env, new JSErrorReporter()); AstRoot rootNode = parser.parse(script, null, 0); JSNodeVisitor nodeVisitor = new JSNodeVisitor(); rootNode.visit(nodeVisitor); return nodeVisitor.getRoot().visit(); }
Source:
<code>private void writeCheckpointIfNeed() { if (commitNeeded) { throw new IllegalStateException("A checkpoint should only be written if the previous commit has completed" <START> + " and there is no new commit needed."); <END> } if (checkpoint != null) { stateMgr.checkpoint(checkpoint); checkpoint = null; } }</code><technical_language>is new commit needed -> this miss leading commitNeeded flag is a guard for this case. -- Also, if previous commit complete is here</technical_language>

Target:
private void writeCheckpointIfNeed() { if (commitNeeded) { log.error("Tried to write a checkpoint with pending uncommitted data, should complete the commit first."); throw new IllegalStateException("A checkpoint should only be written if no commit is needed."); } if (checkpoint != null) { stateMgr.checkpoint(checkpoint); checkpoint = null; } }
Source:
<code>public void analyse(Project project, SensorContext context) { this.context = context; List<SquidAstVisitor<Grammar>> visitors = Lists.newArrayList(checks.all()); visitors.add(new FileLinesVisitor(fileLinesContextFactory, fileSystem)); this.scanner = PythonAstScanner.create(createConfiguration(), visitors.toArray(new SquidAstVisitor[visitors.size()])); <START> scanner.scanFiles(Lists.newArrayList(fileSystem.files(fileSystem.predicates().hasLanguage(Python.KEY)))); <END> Collection<SourceCode> squidSourceFiles = scanner.getIndex().search(new QueryByType(SourceFile.class)); save(squidSourceFiles); }</code><technical_language>file predicate</technical_language>

Target:
public void analyse(Project project, SensorContext context) { this.context = context; List<SquidAstVisitor<Grammar>> visitors = Lists.newArrayList(checks.all()); visitors.add(new FileLinesVisitor(fileLinesContextFactory, fileSystem)); this.scanner = PythonAstScanner.create(createConfiguration(), visitors.toArray(new SquidAstVisitor[visitors.size()])); FilePredicates p = fileSystem.predicates(); scanner.scanFiles(Lists.newArrayList(fileSystem.files(p.and(p.hasType(InputFile.Type.MAIN), p.hasLanguage(Python.KEY))))); Collection<SourceCode> squidSourceFiles = scanner.getIndex().search(new QueryByType(SourceFile.class)); save(squidSourceFiles); }
Source:
<code>private String createAchFormattedRemittanceIdTextBasedOnInvoiceDataForDv(String invoiceNumber, Date invoiceDate, String customerPaymentDocumentNumber) { StringBuilder formattedRemittanceIdText = new StringBuilder(KFSConstants.EMPTY_STRING); if (StringUtils.isNotBlank(invoiceNumber) && ObjectUtils.isNotNull(invoiceDate)) { formattedRemittanceIdText.append(invoiceNumber); formattedRemittanceIdText.append(KFSConstants.BLANK_SPACE); formattedRemittanceIdText.append(CuDisbursementVoucherConstants.DV_EXTRACT_EDOC_NUMBER_PREFIX_IDENTIFIER); formattedRemittanceIdText.append(customerPaymentDocumentNumber); } else if (StringUtils.isNotBlank(customerPaymentDocumentNumber)) { formattedRemittanceIdText.append(CuDisbursementVoucherConstants.DV_EXTRACT_EDOC_NUMBER_PREFIX_IDENTIFIER); formattedRemittanceIdText.append(customerPaymentDocumentNumber); <START> } <END> return formattedRemittanceIdText.toString(); }</code><technical_language>error condition log if invoice number customer payment number blank</technical_language>

Target:
private String createAchFormattedRemittanceIdTextBasedOnInvoiceDataForDv(String invoiceNumber, Date invoiceDate, String customerPaymentDocumentNumber) { StringBuilder formattedRemittanceIdText = new StringBuilder(KFSConstants.EMPTY_STRING); if (StringUtils.isNotBlank(invoiceNumber) && ObjectUtils.isNotNull(invoiceDate)) { formattedRemittanceIdText.append(invoiceNumber); formattedRemittanceIdText.append(KFSConstants.BLANK_SPACE); formattedRemittanceIdText.append(CuDisbursementVoucherConstants.DV_EXTRACT_EDOC_NUMBER_PREFIX_IDENTIFIER); formattedRemittanceIdText.append(StringUtils.isNotBlank(customerPaymentDocumentNumber) ? customerPaymentDocumentNumber : KFSConstants.EMPTY_STRING); } else if (StringUtils.isNotBlank(customerPaymentDocumentNumber)) { formattedRemittanceIdText.append(CuDisbursementVoucherConstants.DV_EXTRACT_EDOC_NUMBER_PREFIX_IDENTIFIER); formattedRemittanceIdText.append(customerPaymentDocumentNumber); } return formattedRemittanceIdText.toString(); }
Source:
<code>public InteractiveUIContent build() { if (isSimple) { <START> Preconditions.checkArgument(defaultCheck == null || defaultCheck.size() == 1); <END> } boolean hasConfiguration = configurationUIRegistry != null; if (hasConfiguration) { Preconditions.checkArgument(configurationNodeKey != null); } final InteractiveUIContent interactiveUI = new InteractiveUIContent(parent, hasDescription, hasConfiguration); CheckboxTableViewer descriptorViewer = createViewer(interactiveUI); if (hasConfiguration) { createConfigurationComposite(interactiveUI); } setViewerInput(descriptorViewer); bindAndInit(interactiveUI, descriptorViewer); return interactiveUI; }</code><technical_language>Change this if Preconditions.checkArgument(!isSimple || defaultCheck == null || defaultCheck.size() == 1)</technical_language>

Target:
public InteractiveUIContent build() { Preconditions.checkArgument(!isSimple || defaultCheck == null || defaultCheck.size() == 1); boolean hasConfiguration = configurationUIRegistry != null; Preconditions.checkArgument(!hasConfiguration || configurationNodeKey != null); final InteractiveUIContent interactiveUI = new InteractiveUIContent(parent, hasDescription, hasConfiguration); CheckboxTableViewer descriptorViewer = createViewer(interactiveUI); if (hasConfiguration) { createConfigurationComposite(interactiveUI); } setViewerInput(descriptorViewer); bindAndInit(interactiveUI, descriptorViewer); return interactiveUI; }
Source:
<code>public static void checkPhysicalLogicalTypeCompatible( LogicalType physicalFieldType, LogicalType logicalFieldType, String physicalFieldName, String logicalFieldName, boolean isSource) { if (isSource) { checkIfCompatible( physicalFieldType, logicalFieldType, (cause) -> new ValidationException( String.format("Type %s of table field '%s' does not match with " + "the physical type %s of the '%s' field of the %s.", logicalFieldType, logicalFieldName, physicalFieldType, physicalFieldName, <START> "TableSource return type"), <END> cause)); } else { checkIfCompatible( logicalFieldType, physicalFieldType, (cause) -> new ValidationException( String.format("Type %s of table field '%s' does not match with " + "the physical type %s of the '%s' field of the %s.", logicalFieldType, logicalFieldName, physicalFieldType, physicalFieldName, "TableSink consumed type"), cause)); } }</code><technical_language>Lets inline argument</technical_language>

Target:
public static void checkPhysicalLogicalTypeCompatible( LogicalType physicalFieldType, LogicalType logicalFieldType, String physicalFieldName, String logicalFieldName, boolean isSource) { if (isSource) { checkIfCompatible( physicalFieldType, logicalFieldType, (cause) -> new ValidationException( String.format("Type %s of table field '%s' does not match with " + "the physical type %s of the '%s' field of the TableSource return type.", logicalFieldType, logicalFieldName, physicalFieldType, physicalFieldName), cause)); } else { checkIfCompatible( logicalFieldType, physicalFieldType, (cause) -> new ValidationException( String.format("Type %s of table field '%s' does not match with " + "the physical type %s of the '%s' field of the TableSink consumed type.", logicalFieldType, logicalFieldName, physicalFieldType, physicalFieldName), cause)); } }
Source:
<code>public SourceWithKeys(byte[] startKey, byte[] stopKey, long size) { if (stopKey.length > 0) { Preconditions.checkState(Bytes.compareTo(startKey, stopKey) < 0, "[startKey, stopKey]", new String(startKey), new String(stopKey)); Preconditions.checkState(size > 0); } this.startKey = startKey; this.stopKey = stopKey; this.estimatedSize = size; <START> LOG.debug("Creating split: {},", this); <END> }</code><technical_language>"Creating split: {}."</technical_language>

Target:
public SourceWithKeys(byte[] startKey, byte[] stopKey, long size) { if (stopKey.length > 0) { Preconditions.checkState(Bytes.compareTo(startKey, stopKey) < 0, "[startKey, stopKey]", new String(startKey), new String(stopKey)); Preconditions.checkState(size > 0); } this.startKey = startKey; this.stopKey = stopKey; this.estimatedSize = size; LOG.debug("Creating split: {}.", this); }
Source:
<code>void onEvents() { ReactingRepository repository = new ReactingRepository(); boundedContext().register(repository); ProjectId parentId = givenAggregateId("parent"); ProjectId childId = givenAggregateId("child"); TestEventFactory factory = TestEventFactory.newInstance(Identifier.pack(parentId), getClass()); AggProjectArchived msg = AggProjectArchived .newBuilder() .setProjectId(parentId) .addChildProjectId(childId) <START> .build(); <END> Event event = factory.createEvent(msg); boundedContext().eventBus() .post(event); Optional<ReactingAggregate> optional = repository.find(childId); assertTrue(optional.isPresent()); assertEquals(ReactingAggregate.PROJECT_ARCHIVED, optional.get() .state() .getValue()); }</code><technical_language>Please vBuild(). ErrorProne check is enabled soon</technical_language>

Target:
void onEvents() { ReactingRepository repository = new ReactingRepository(); boundedContext().register(repository); ProjectId parentId = givenAggregateId("parent"); ProjectId childId = givenAggregateId("child"); TestEventFactory factory = TestEventFactory.newInstance(Identifier.pack(parentId), getClass()); AggProjectArchived msg = AggProjectArchived .newBuilder() .setProjectId(parentId) .addChildProjectId(childId) .vBuild(); Event event = factory.createEvent(msg); boundedContext().eventBus() .post(event); Optional<ReactingAggregate> optional = repository.find(childId); assertTrue(optional.isPresent()); assertEquals(ReactingAggregate.PROJECT_ARCHIVED, optional.get() .state() .getValue()); }
Source:
<code>private void createSuperTypeCombo(Composite parent) { final Label label= new Label(parent, SWT.NONE); label.setText(RefactoringMessages.PullUpInputPage1_Select_destination); label.setLayoutData(new GridData()); fSuperTypesCombo= new Combo(parent, SWT.READ_ONLY); SWTUtil.setDefaultVisibleItemCount(fSuperTypesCombo); if (fCandidateTypes.length > 0) { for (IType <START> fCandidateType : <END> fCandidateTypes) { final String comboLabel= fCandidateType.getFullyQualifiedName('.'); fSuperTypesCombo.add(comboLabel); } fSuperTypesCombo.select(fCandidateTypes.length - 1); fSuperTypesCombo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); } }</code><technical_language>rename candidateType</technical_language>

Target:
private void createSuperTypeCombo(Composite parent) { final Label label= new Label(parent, SWT.NONE); label.setText(RefactoringMessages.PullUpInputPage1_Select_destination); label.setLayoutData(new GridData()); fSuperTypesCombo= new Combo(parent, SWT.READ_ONLY); SWTUtil.setDefaultVisibleItemCount(fSuperTypesCombo); if (fCandidateTypes.length > 0) { for (IType candidateType : fCandidateTypes) { final String comboLabel= candidateType.getFullyQualifiedName('.'); fSuperTypesCombo.add(comboLabel); } fSuperTypesCombo.select(fCandidateTypes.length - 1); fSuperTypesCombo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); } }
Source:
<code>private void requireNoActiveOrderOfSameType(Patient patient1, Patient patient2) { List<Order> ordersByPatient1 = Context.getOrderService().getAllOrdersByPatient(patient1); List<Order> ordersByPatient2 = Context.getOrderService().getAllOrdersByPatient(patient2); ordersByPatient1.forEach((Order order1)->{ ordersByPatient2.forEach((Order order2)->{ if(order1.isActive() && order2.isActive() && order1.getOrderType().equals(order2.getOrderType())){ log.debug("Merge operation cancelled: Cannot merge patient" + patient1.getPatientId() + " to patient" + patient2.getPatientId()); log.debug("Patients having active order of " + order1.getOrderType()); <START> throw new APIException("Patient.cannot.merge", (Object[]) null); <END> } }); }); }</code><technical_language>exception message reflect new business logic</technical_language>

Target:
private void requireNoActiveOrderOfSameType(Patient patient1, Patient patient2) { String messageKey = "Patient.merge.cannotHaveSameTypeActiveOrders"; List<Order> ordersByPatient1 = Context.getOrderService().getAllOrdersByPatient(patient1); List<Order> ordersByPatient2 = Context.getOrderService().getAllOrdersByPatient(patient2); ordersByPatient1.forEach((Order order1) -> { ordersByPatient2.forEach((Order order2) -> { if (order1.isActive() && order2.isActive() && order1.getOrderType().equals(order2.getOrderType())) { Object[] parameters = { patient1.getPatientId(), patient2.getPatientId(), order1.getOrderType() }; String message = Context.getMessageSourceService().getMessage(messageKey, parameters, Context.getLocale()); log.debug(message); throw new APIException(message); } }); }); }
Source:
<code><START> default <N> Optional<N> findParent(Class<N> type) { <END> Optional<Node> possibleParent = getParentNode(); while (possibleParent.isPresent()) { Node parent = possibleParent.get(); if (type.isAssignableFrom(parent.getClass())) { return Optional.of(type.cast(parent)); } possibleParent = parent.getParentNode(); } return Optional.empty(); }</code><technical_language>"ancestor" more correct here? parent is node, right</technical_language>

Target:
default <N> Optional<N> findParent(Class<N> type) { return findAncestor(type); }
Source:
<code>public boolean equals(Object o) { if (this == o) return true; <START> if (o == null || getClass() != o.getClass()) return false; <END> Foo foo1 = (Foo) o; return Objects.equals(this.foo, foo1.foo); }</code><technical_language>checkstyle</technical_language>

Target:
public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } Foo foo1 = (Foo) o; return this.foo != null ? this.foo.equals(foo1.foo) : foo1.foo == null; }
Source:
<code>public AttributeDefinition getAttributeDefinition() { AttributeDefinition attr = new AttributeDefinition(); attr.setNamespace(AttributesManager.NS_GROUP_RESOURCE_ATTR_DEF); attr.setFriendlyName("projectOwnerLogin"); <START> attr.setDisplayName("projectOwnerLogin"); <END> attr.setType(String.class.getName()); attr.setDescription("Login of user, who is owner of project directory."); return attr; }</code><technical_language>Please, text "Project owner login" (Name fixed sending this pool request) thank you</technical_language>

Target:
public AttributeDefinition getAttributeDefinition() { AttributeDefinition attr = new AttributeDefinition(); attr.setNamespace(AttributesManager.NS_GROUP_RESOURCE_ATTR_DEF); attr.setFriendlyName("projectOwnerLogin"); attr.setDisplayName("Project owner login"); attr.setType(String.class.getName()); attr.setDescription("Login of user, who is owner of project directory."); return attr; }
Source:
<code>private ReportInit() { <START> AsyncDataProvider.GetRedirectServletReportsPage(new AsyncQuery(this, <END> new INewAsyncCallback() { @Override public void OnSuccess(Object target, Object returnValue) { setReportBaseUrl((String) returnValue); } })); }</code><technical_language>please move this tot init() method</technical_language>

Target:
private ReportInit() { }
Source:
<code>public boolean noCredentials() { <START> return getElement(by.tagName("options")) == null; <END> }</code><technical_language>This is fragile report select/options tag in page. Btw, I presume meant option, options</technical_language>

Target:
public boolean noCredentials() { try { credentialId.resolve().findElement(by.tagName("option")); return false; } catch (NoSuchElementException ex){ return true; } }
Source:
<code>default Set<Image> getImageResponseFromQuay(String repo, String tagName) { <START> final String tagUrl = QUAY_URL + "repository/" + repo + "/tag/" + "?specificTag=" + tagName; <END> Optional<String> response; Map<String, String> errorMap = new HashMap<>(); try { URL url = new URL(tagUrl); response = Optional.of(IOUtils.toString(url, StandardCharsets.UTF_8)); } catch (IOException ex) { LOG.error("Unable to get response from Quay", ex); response = Optional.empty(); } Set<Image> quayImages = new HashSet<>(); if (response.isPresent()) { Map<String, ArrayList<Map<String, String>>> map = new HashMap<>(); String errorKey = "error_message"; map = (Map<String, ArrayList<Map<String, String>>>)GSON.fromJson(response.get(), map.getClass()); errorMap = (Map<String, String>)GSON.fromJson(response.get(), errorMap.getClass()); if (errorMap.get(errorKey) != null) { LOG.error("Error response from Quay: " + errorMap.get(errorKey)); } else { try { final List<Map<String, String>> array = map.get("tags"); for (Map<String, String> tag : array) { final String digest = tag.get("manifest_digest"); final String imageID = tag.get("image_id"); List<Checksum> checksums = new ArrayList<>(); checksums.add(new Checksum(digest.split(":")[0], digest.split(":")[1])); quayImages.add(new Image(checksums, repo, tagName, imageID, Registry.QUAY_IO)); } } catch (IndexOutOfBoundsException | NullPointerException ex) { LOG.error("Could not get checksum information for " + repo, ex); } } } else { LOG.error("Could not get response from Quay for " + repo); } return quayImages; }</code><technical_language>more readable swagger-java-quay-client. a series of PRs <LINK_0> demo it</technical_language>

Target:
default Set<Image> getImageResponseFromQuay(String repo, String tagName) { Set<Image> quayImages = new HashSet<>(); RepositoryApi api = new RepositoryApi(API_CLIENT); try { final QuayRepo quayRepo = api.getRepo(repo, false); QuayTag tag = quayRepo.getTags().get(tagName); if (tag == null) { LOG.error("Unable to get find tag: " + tagName + " from Quay in repo " + repo); return quayImages; } final String digest = tag.getManifestDigest(); final String imageID = tag.getImageId(); List<Checksum> checksums = Collections.singletonList(new Checksum(digest.split(":")[0], digest.split(":")[1])); quayImages.add(new Image(checksums, repo, tagName, imageID, Registry.QUAY_IO)); } catch (ApiException ex) { LOG.error("Could not read from " + repo, ex); } return quayImages; }
Source:
<code>protected PlotDatasetDto generatePlotDatasetDto(MetricDto metricDto) { List<PointDto> list = new ArrayList<PointDto>(); List<MetricValueDto> metricList = new ArrayList<MetricValueDto>(); for(MetricValueDto value :metricDto.getValues()) { metricList.add(value); } Collections.sort(metricList, new Comparator<MetricValueDto>() { @Override public int compare(MetricValueDto o1, MetricValueDto o2) { return o2.getSessionId() < o1.getSessionId() ? 1 : -1; } }); for (MetricValueDto value: metricList) { double temp = Double.parseDouble(value.getValue()); list.add(new PointDto(value.getSessionId(), temp)); } String legend = metricDto.getMetricName().getMetricDisplayName(); return new PlotDatasetDto( list, legend, <START> ColorCodeGenerator.getHexColorCode(metricDto.getMetricName().getMetricName(), new String()) <END> ); }</code><technical_language>propose replace new String() ""</technical_language>

Target:
protected PlotDatasetDto generatePlotDatasetDto(MetricDto metricDto) { List<PointDto> list = new ArrayList<PointDto>(); List<MetricValueDto> metricList = new ArrayList<MetricValueDto>(); for(MetricValueDto value :metricDto.getValues()) { metricList.add(value); } Collections.sort(metricList, new Comparator<MetricValueDto>() { @Override public int compare(MetricValueDto o1, MetricValueDto o2) { return o2.getSessionId() < o1.getSessionId() ? 1 : -1; } }); for (MetricValueDto value: metricList) { double temp = Double.parseDouble(value.getValue()); list.add(new PointDto(value.getSessionId(), temp)); } String legend = metricDto.getMetricName().getMetricDisplayName(); return new PlotDatasetDto( list, legend, ColorCodeGenerator.getHexColorCode(metricDto.getMetricName().getMetricName(), "") ); }
Source:
<code>public TestConfiguration(Class<?> testClass, Method testMethod, Collection<Class<?>> additionalClasses) { this.testClass = testClass; this.testMethod = testMethod; <START> this.additionalClasses = additionalClasses != null ? additionalClasses : new ArrayList<>(); <END> }</code><technical_language>Instead of allowing null for additionalClasses, I empty collection, mark parameter NonNull (or ParametersAreNonnullByDefault). I suppose need com.google.code.findbugs:jsr305 classpath (scope: provided)</technical_language>

Target:
public TestConfiguration(Class<?> testClass, Method testMethod, Collection<Class<?>> additionalClasses) { this.testClass = testClass; this.testMethod = testMethod; if (additionalClasses == null) { throw new NullPointerException("Expected AdditionalClasses not null."); } this.additionalClasses = additionalClasses; }