auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>protected void testExecute() throws Exception { loginAsStudent(student1InCourse1.getGoogleId()); ______TS("Not enough parameters"); verifyHttpParameterFailure(); verifyHttpParameterFailure(Const.ParamsNames.INTENT, Intent.STUDENT_SUBMISSION.toString()); ______TS("Typical success case, student"); <START> String[] params = new String[] { <END> Const.ParamsNames.INTENT, Intent.STUDENT_SUBMISSION.toString(), Const.ParamsNames.FEEDBACK_RESPONSE_ID, typicalResponse.getId(), }; DeleteFeedbackResponseAction a = getAction(params); JsonResult r = getJsonResult(a); assertEquals(HttpStatus.SC_OK, r.getStatusCode()); assertNull(logic.getFeedbackResponse(typicalResponse.getId())); ______TS("Typical success case, instructor"); loginAsInstructor(instructor1OfCourse1.getGoogleId()); params = new String[] { Const.ParamsNames.INTENT, Intent.INSTRUCTOR_SUBMISSION.toString(), Const.ParamsNames.FEEDBACK_RESPONSE_ID, typicalResponse3.getId(), }; a = getAction(params); r = getJsonResult(a); assertEquals(HttpStatus.SC_OK, r.getStatusCode()); assertNull(logic.getFeedbackResponse(typicalResponse3.getId())); }</code><technical_language>Test deleting response again</technical_language>

Target:
protected void testExecute() throws Exception { loginAsStudent(student1InCourse1.getGoogleId()); ______TS("Not enough parameters"); verifyHttpParameterFailure(); verifyHttpParameterFailure(Const.ParamsNames.INTENT, Intent.STUDENT_SUBMISSION.toString()); ______TS("Typical success case, student"); String[] params = new String[] { Const.ParamsNames.INTENT, Intent.STUDENT_SUBMISSION.toString(), Const.ParamsNames.FEEDBACK_RESPONSE_ID, typicalResponse.getId(), }; DeleteFeedbackResponseAction a = getAction(params); JsonResult r = getJsonResult(a); assertEquals(HttpStatus.SC_OK, r.getStatusCode()); assertNull(logic.getFeedbackResponse(typicalResponse.getId())); a = getAction(params); DeleteFeedbackResponseAction finalAction = a; assertThrows(NullPointerException.class, () -> getJsonResult(finalAction)); ______TS("Typical success case, instructor"); loginAsInstructor(instructor1OfCourse1.getGoogleId()); params = new String[] { Const.ParamsNames.INTENT, Intent.INSTRUCTOR_SUBMISSION.toString(), Const.ParamsNames.FEEDBACK_RESPONSE_ID, typicalResponse3.getId(), }; a = getAction(params); r = getJsonResult(a); assertEquals(HttpStatus.SC_OK, r.getStatusCode()); assertNull(logic.getFeedbackResponse(typicalResponse3.getId())); a = getAction(params); DeleteFeedbackResponseAction finalA = a; assertThrows(NullPointerException.class, () -> getJsonResult(finalA)); }
Source:
<code>public void participantAdded(final ChatParticipant chatParticipant) { if (chatters == null) { return; } chatters.put(chatParticipant, ""); updateConnections(); chatMessageListeners.forEach( listener -> <START> listener.addStatusMessage(chatParticipant.getPlayerName() + " has joined", true)); <END> }</code><technical_language>Ah yeah, this reminds me, addStatusMessage, is A STATUS!! is a player 'status' in chat, text in parentheses next a players name. I forget this is a addChatEvent, is a player status... I need fix API, boolean parameter is pretty messy. EG: listener.joinEvent(PlayerName) listener.slapEvent(PlayerName) do @RoiEXLab</technical_language>

Target:
public void participantAdded(final ChatParticipant chatParticipant) { if (chatters == null) { return; } chatters.put(chatParticipant, ""); updateConnections(); chatMessageListeners.forEach( listener -> listener.playerJoined(chatParticipant.getPlayerName() + " has joined")); }
Source:
<code>private static boolean evalExpression(Expression expression, Set<String> tags) { switch (expression.kind()) { case IDENTIFIER: Identifier ident = (Identifier) expression; return tags.contains(ident.getName()); case BINARY_OPERATOR: BinaryOperatorExpression boe = (BinaryOperatorExpression) expression; switch (boe.getOperator()) { case OR: return evalExpression(boe.getX(), tags) || evalExpression(boe.getY(), tags); case AND: return evalExpression(boe.getX(), tags) && evalExpression(boe.getY(), tags); default: <START> throw new FilterEvaluationException( <END> String.format("Got %s but expected 'and' or 'or'", boe.getOperator())); } case UNARY_OPERATOR: UnaryOperatorExpression uoe = (UnaryOperatorExpression) expression; if (uoe.getOperator() == TokenKind.NOT) { return !evalExpression(uoe.getX(), tags); } else { throw new FilterEvaluationException(String.format("Got %s but expected 'not'", uoe.getOperator())); } default: throw new FilterEvaluationException(String.format("Unsupported expression kind: %s", expression.kind())); } }</code><technical_language>IllegalArgumentException. verified expression is valid</technical_language>

Target:
private static boolean evalExpression(Expression expression, Set<String> tags) { switch (expression.kind()) { case IDENTIFIER: Identifier ident = (Identifier) expression; return tags.contains(ident.getName()); case BINARY_OPERATOR: BinaryOperatorExpression boe = (BinaryOperatorExpression) expression; switch (boe.getOperator()) { case OR: return evalExpression(boe.getX(), tags) || evalExpression(boe.getY(), tags); case AND: return evalExpression(boe.getX(), tags) && evalExpression(boe.getY(), tags); default: throw new IllegalStateException( String.format("Got %s but expected 'and' or 'or'", boe.getOperator())); } case UNARY_OPERATOR: UnaryOperatorExpression uoe = (UnaryOperatorExpression) expression; if (uoe.getOperator() == TokenKind.NOT) { return !evalExpression(uoe.getX(), tags); } else { throw new IllegalStateException(String.format("Got %s but expected 'not'", uoe.getOperator())); } default: throw new IllegalStateException(String.format("Unsupported expression kind: %s", expression.kind())); } }
Source:
<code>public void should_parse_modern_table() { AggregateParser parser = new AggregateParser(new DataTypeCqlNameParser(), context); AggregateMetadata aggregate = parser.parseAggregate(SUM_AND_TO_STRING_ROW_3_0, KEYSPACE_ID, Collections.emptyMap()); assertThat(aggregate.getKeyspace().asInternal()).isEqualTo("ks"); assertThat(aggregate.getSignature().getName().asInternal()).isEqualTo("sum_and_to_string"); assertThat(aggregate.getSignature().getParameterTypes()).containsExactly(DataTypes.INT); FunctionSignature stateFuncSignature = aggregate.getStateFuncSignature(); assertThat(stateFuncSignature.getName().asInternal()).isEqualTo("plus"); assertThat(stateFuncSignature.getParameterTypes()) .containsExactly(DataTypes.INT, DataTypes.INT); assertThat(aggregate.getStateType()).isEqualTo(DataTypes.INT); Optional<FunctionSignature> finalFuncSignature = aggregate.getFinalFuncSignature(); assertThat(finalFuncSignature).isPresent(); assertThat(finalFuncSignature.get().getName().asInternal()).isEqualTo("to_string"); <START> assertThat(finalFuncSignature.get().getParameterTypes()).containsExactly(DataTypes.INT); <END> assertThat(aggregate.getReturnType()).isEqualTo(DataTypes.TEXT); assertThat(aggregate.getInitCond().get()).isInstanceOf(Integer.class).isEqualTo(0); }</code><technical_language>rewrite this in a slightly prettier assertThat(finalFuncSignature).hasValueSatisfying(signature -> { ... })</technical_language>

Target:
public void should_parse_modern_table() { AggregateParser parser = new AggregateParser(new DataTypeCqlNameParser(), context); AggregateMetadata aggregate = parser.parseAggregate(SUM_AND_TO_STRING_ROW_3_0, KEYSPACE_ID, Collections.emptyMap()); assertThat(aggregate.getKeyspace().asInternal()).isEqualTo("ks"); assertThat(aggregate.getSignature().getName().asInternal()).isEqualTo("sum_and_to_string"); assertThat(aggregate.getSignature().getParameterTypes()).containsExactly(DataTypes.INT); FunctionSignature stateFuncSignature = aggregate.getStateFuncSignature(); assertThat(stateFuncSignature.getName().asInternal()).isEqualTo("plus"); assertThat(stateFuncSignature.getParameterTypes()) .containsExactly(DataTypes.INT, DataTypes.INT); assertThat(aggregate.getStateType()).isEqualTo(DataTypes.INT); Optional<FunctionSignature> finalFuncSignature = aggregate.getFinalFuncSignature(); assertThat(finalFuncSignature).isPresent(); assertThat(finalFuncSignature) .hasValueSatisfying( signature -> { assertThat(signature.getName().asInternal()).isEqualTo("to_string"); assertThat(signature.getParameterTypes()).containsExactly(DataTypes.INT); }); assertThat(aggregate.getReturnType()).isEqualTo(DataTypes.TEXT); assertThat(aggregate.getInitCond().get()).isInstanceOf(Integer.class).isEqualTo(0); }
Source:
<code>public boolean isNull() { boolean localIsNull = true; <START> if (numElements > 1) { <END> int i; for (i = 0; i < numElements; i++) { if (dvd[i] == null || dvd[i].isNull()) break; } if (i == numElements) localIsNull = false; } setIsNull(localIsNull); return localIsNull; }</code><technical_language>check of numElements > 1 here? if numElements=1, set nullability correctly</technical_language>

Target:
public boolean isNull() { boolean localIsNull = true; int i; for (i = 0; i < numElements; i++) { if (dvd[i] == null || dvd[i].isNull()) break; } if (i == numElements) localIsNull = false; setIsNull(localIsNull); return localIsNull; }
Source:
<code>public static PeriodicSchedule of(Collection<SchedulePeriod> periods) { ArgChecker.notEmpty(periods, "periods"); <START> ArrayList<SchedulePeriod> mutable = Lists.newArrayList(periods); <END> mutable.sort(Comparator.naturalOrder()); return new PeriodicSchedule(mutable); }</code><technical_language>periods.stream().sort(Comparator.naturalOrder())...</technical_language>

Target:
public static PeriodicSchedule of(Collection<SchedulePeriod> periods) { ArgChecker.notEmpty(periods, "periods"); ImmutableList<SchedulePeriod> sorted = periods.stream() .sorted(Comparator.naturalOrder()) .collect(Guavate.toImmutableList()); return new PeriodicSchedule(sorted); }
Source:
<code><START> public void close() throws IOException { <END> closed = true; }</code><technical_language>exception is redundant</technical_language>

Target:
public void close() { closed = true; }
Source:
<code><START> private static String findSecretFallback(String xml) { <END> Matcher matcher = Pattern.compile(">\\{(.*)\\}<|>(.*)\\=<").matcher(xml); while(matcher.find()) { String secret = matcher.group(); if(secret.length() > 1) secret = secret.substring(1,secret.length()-1); if ((Secret.decrypt(secret)) != null || SecretBytes.isSecretBytes(secret)) { xml = StringUtils.replace(xml, secret, SECRET_MARKER); } } return xml; }</code><technical_language>This method works a fallback, I bit concerned corner-cases. if file is damaged, e.g. if } is missing? add risks this implementation</technical_language>

Target:
private static String findSecretFallback(String xml) { Matcher matcher = SECRET_PATTERN.matcher(xml); while(matcher.find()) { String secret = matcher.group(); if(secret.length() > 1) secret = secret.substring(1,secret.length()-1); if ((Secret.decrypt(secret)) != null || SecretBytes.isSecretBytes(secret)) { xml = StringUtils.replace(xml, secret, SECRET_MARKER); } } return xml; }
Source:
<code>boolean isEmpty() { <START> return (validIndexSegments.isEmpty()); <END> }</code><technical_language>minor: braces unnecessary</technical_language>

Target:
boolean isEmpty() { return validIndexSegments.isEmpty(); }
Source:
<code><START> public static List<String> getOtherSchemes() { <END> return otherSchemes; }</code><technical_language>this private</technical_language>

Target:
private List<String> getOtherSchemes() { return otherSchemes; }
Source:
<code>void emitError(Throwable t) { set(STATE_TERMINATED); if (!isUnsubscribed()) { try { <START> if (!isUnsubscribed()) { <END> subscriber.onError(t); } } catch (Throwable inner) { Exceptions.throwIfFatal(inner); CompositeException composite = new CompositeException(t, inner); RxJavaPlugins.getInstance().getErrorHandler().handleError(composite); } } }</code><technical_language>This redundant? checked lines</technical_language>

Target:
void emitError(Throwable t) { set(STATE_TERMINATED); if (!isUnsubscribed()) { try { subscriber.onError(t); } catch (Throwable inner) { Exceptions.throwIfFatal(inner); CompositeException composite = new CompositeException(t, inner); RxJavaPlugins.getInstance().getErrorHandler().handleError(composite); } } }
Source:
<code>private void buildStatisticsViewers(final ITmfTrace trace, final TmfTimeRange timeRange, final boolean isGlobal) { final TmfStatisticsTree statsData = TmfStatisticsTreeManager.getStatTree(getTreeID()); if (statsData == null) { return; } Map<ITmfTrace, Job> updateJobs; if (isGlobal) { updateJobs = fUpdateJobsGlobal; fTimeRange = timeRange; } else { updateJobs = fUpdateJobsPartial; fTimeRangePartial = timeRange; } for (ITmfTrace aTrace : TmfTraceManager.getTraceSet(trace)) { aTrace = checkNotNull(aTrace); if (!isListeningTo(aTrace)) { continue; } final TmfStatisticsModule statsMod = TmfTraceUtils.getAnalysisModuleOfClass(aTrace, TmfStatisticsModule.class, TmfStatisticsModule.ID); if (statsMod == null) { continue; } Job job = updateJobs.get(aTrace); if (job == null) { job = new StatisticsUpdateJob("Statistics <START> update", <END> aTrace, isGlobal, statsMod, this); updateJobs.put(aTrace, job); job.setSystem(true); job.schedule(); } } }</code><technical_language>this need externalized</technical_language>

Target:
private void buildStatisticsViewers(final ITmfTrace trace, final TmfTimeRange timeRange, final boolean isGlobal) { final TmfStatisticsTree statsData = TmfStatisticsTreeManager.getStatTree(getTreeID()); if (statsData == null) { return; } Map<ITmfTrace, Job> updateJobs; if (isGlobal) { updateJobs = fUpdateJobsGlobal; fTimeRange = timeRange; } else { updateJobs = fUpdateJobsPartial; fTimeRangePartial = timeRange; } for (ITmfTrace aTrace : TmfTraceManager.getTraceSet(trace)) { aTrace = checkNotNull(aTrace); if (!isListeningTo(aTrace)) { continue; } final TmfStatisticsModule statsMod = TmfTraceUtils.getAnalysisModuleOfClass(aTrace, TmfStatisticsModule.class, TmfStatisticsModule.ID); if (statsMod == null) { continue; } Job job = updateJobs.get(aTrace); if (job == null) { job = new StatisticsUpdateJob(Messages.TmfStatisticsView_TmfStatisticsUpdateName, aTrace, isGlobal, statsMod, this); updateJobs.put(aTrace, job); job.setSystem(true); job.schedule(); } } }
Source:
<code>public List<Question> listDisplayNameQuestionsBySurveyId(Long surveyId) { PersistenceManager pm = PersistenceFilter.getManager(); javax.jdo.Query query = pm.newQuery(Question.class); query.setFilter("surveyId == surveyIdParam && localeNameFlag == true"); query.declareParameters("Long surveyIdParam"); query.setOrdering("order asc"); List<Question> results = (List<Question>) query.execute( surveyId); if (results != null && results.size() > 0) { return results; } else { <START> return null; <END> } }</code><technical_language>I prefer API return null values (e.g. Collections.empyList()) this avoids need checking for null callers of this functions. More at: <LINK_0></technical_language>

Target:
public List<Question> listDisplayNameQuestionsBySurveyId(Long surveyId) { PersistenceManager pm = PersistenceFilter.getManager(); javax.jdo.Query query = pm.newQuery(Question.class); query.setFilter("surveyId == surveyIdParam && localeNameFlag == true"); query.declareParameters("Long surveyIdParam"); query.setOrdering("order asc"); List<Question> results = (List<Question>) query.execute( surveyId); if (results != null && results.size() > 0) { return results; } else { return Collections.emptyList(); } }
Source:
<code>SupersonicOsmNetworkReader createInstance() { if (coordinateTransformation == null) { throw new IllegalArgumentException("Target coordinate transformation is required parameter!"); } OsmNetworkParser parser = new OsmNetworkParser( coordinateTransformation, linkProperties, includeLinkAtCoordWithHierarchy, Executors.newWorkStealingPool()); return new SupersonicOsmNetworkReader( parser, preserveNodeWithId, includeLinkAtCoordWithHierarchy, afterLinkCreated, adjustFreeSpeed <START> ); <END> }</code><technical_language>flag</technical_language>

Target:
SupersonicOsmNetworkReader createInstance() { if (coordinateTransformation == null) { throw new IllegalArgumentException("Target coordinate transformation is required parameter!"); } OsmNetworkParser parser = new OsmNetworkParser( coordinateTransformation, linkProperties, includeLinkAtCoordWithHierarchy, Executors.newWorkStealingPool()); return new SupersonicOsmNetworkReader( parser, preserveNodeWithId, includeLinkAtCoordWithHierarchy, afterLinkCreated, freeSpeedFactor, adjustCapacityLength ); }
Source:
<code>public IngestPackage(ArticlePackage articlePackage, ArticleMetadata articleMetadata, ArticleCustomMetadata customMetadata) { this.articlePackage = articlePackage; this.articleMetadata = articleMetadata; <START> this.articleCustomMetadata = customMetadata; <END> }</code><technical_language>Objects.requireNonNull please</technical_language>

Target:
public IngestPackage(ArticlePackage articlePackage, ArticleMetadata articleMetadata, ArticleCustomMetadata customMetadata) { this.articlePackage = Objects.requireNonNull(articlePackage); this.articleMetadata = Objects.requireNonNull(articleMetadata); this.articleCustomMetadata = Objects.requireNonNull(customMetadata); }
Source:
<code>private static long retrieveIsoFileSize(Map.Entry<String, Map<String, String>> isoFileWithMetadata) { String sizeValue = isoFileWithMetadata.getValue().get("size"); if (sizeValue == null) { return DEFAULT_ISO_FILE_SIZE; } try { return Long.valueOf(sizeValue); } catch (NumberFormatException e) { log.errorFormat("File's '{0}' size is illegal number", isoFileWithMetadata.getKey(), e); <START> return DEFAULT_ISO_FILE_SIZE; <END> } }</code><technical_language>return means "size is available", a default</technical_language>

Target:
private static long retrieveIsoFileSize(Map.Entry<String, Map<String, String>> isoFileWithMetadata) { String sizeValue = isoFileWithMetadata.getValue().get("size"); if (sizeValue == null) { return SIZE_IS_NOT_AVAILABLE; } try { return Long.valueOf(sizeValue); } catch (NumberFormatException e) { log.errorFormat("File's '{0}' size is illegal number", isoFileWithMetadata.getKey(), e); return SIZE_IS_NOT_AVAILABLE; } }
Source:
<code>private boolean add(WebSocketPassiveScanner passiveScanner){ if(getPassiveScannersSet().contains(passiveScanner)){ <START> LOGGER.warn("Insertion prevent in order to avoid the duplication"); <END> return false; } boolean result = getPassiveScannersSet().add(passiveScanner); if(result){ isIteratorUpdated = false; } return result; }</code><technical_language>this include some details scanner name collided something</technical_language>

Target:
public synchronized boolean add(WebSocketPassiveScanner passiveScanner) { if (passiveScanner == null) { throw new IllegalArgumentException("Parameter passiveScanner must not be null."); } WebSocketPassiveScannerDecorator wsPlugin = new WebSocketPassiveScannerDecorator(passiveScanner); return addPlugin(wsPlugin); }
Source:
<code>public int hashCode() { return Objects.hash( generatedId, <START> getName(), <END> getType(), getId(), getReference(), getReferenceContent(), getSelector(), getEntrypoints(), getImage(), getMemoryLimit(), getMountSources(), getCommand(), getArgs(), getVolumes(), getEnv(), getEndpoints()); }</code><technical_language>In equals method changed usage of getter field. Please do same, revert changes in equals</technical_language>

Target:
public int hashCode() { return Objects.hash( generatedId, alias, type, componentId, reference, referenceContent, image, memoryLimit, getSelector(), getEntrypoints(), getMountSources(), getCommand(), getArgs(), getVolumes(), getEnv(), getEndpoints()); }
Source:
<code>private void ping() throws IOException, InterruptedException { Future<?> f = channel.callAsync(new Ping()); long start = System.currentTimeMillis(); <START> long end = System.nanoTime() + (timeout * 1000L); <END> long remaining = end - System.nanoTime(); do { try { f.get(Math.max(10000,remaining),TimeUnit.NANOSECONDS); return; } catch (ExecutionException e) { if (e.getCause() instanceof RequestAbortedException) return; onDead(e); return; } catch (TimeoutException e) { } remaining = end - System.nanoTime(); } while(remaining>0); onDead(new TimeoutException("Ping started at "+start+" hasn't completed by "+System.currentTimeMillis())); }</code><technical_language>1ms=1e6ns</technical_language>

Target:
private void ping() throws IOException, InterruptedException { Future<?> f = channel.callAsync(new Ping()); long start = System.currentTimeMillis(); long end = System.nanoTime() + TimeUnit.MILLISECONDS.toNanos(timeout); long remaining = end - System.nanoTime(); do { try { f.get(Math.max(TimeUnit.MILLISECONDS.toNanos(10),remaining),TimeUnit.NANOSECONDS); return; } catch (ExecutionException e) { if (e.getCause() instanceof RequestAbortedException) return; onDead(e); return; } catch (TimeoutException e) { } remaining = end - System.nanoTime(); } while(remaining>0); onDead(new TimeoutException("Ping started at "+start+" hasn't completed by "+System.currentTimeMillis())); }
Source:
<code>public void init(MapBackedPreferences preferences) { INSTANCE.preferences = preferences; emptyNode = preferences.node("emptyNode"); buildIdToUnameLookup(); buildBackCompatMapping(); validateTree(); <START> log.debugFormat("Osinfo Repository:\n {0}", toString()); <END> }</code><technical_language>toString() is some work, call if log.debugEnabled()</technical_language>

Target:
public void init(MapBackedPreferences preferences) { INSTANCE.preferences = preferences; emptyNode = preferences.node("emptyNode"); buildIdToUnameLookup(); buildBackCompatMapping(); validateTree(); if (log.isDebugEnabled()) { log.debugFormat("Osinfo Repository:\n {0}", toString()); } }
Source:
<code>public void onNewDynamicDependency(final @Observes AddPomDependencyEvent event) { final Path projectPathOptional = event.getProjectPath(); <START> final DependencyType dependencyTypeOptional = event.getDependencyType(); <END> addDependenciesToPom(projectPathOptional, mapper.getDependencies(dependencyTypeOptional)); }</code><technical_language>nitpick: dependencyTypeOptional is longer valid name method return optional.. for projectPathOptional</technical_language>

Target:
public void onNewDynamicDependency(final @Observes AddPomDependencyEvent event) { final Path projectPath = event.getProjectPath(); final DependencyType dependencyType = event.getDependencyType(); addDependenciesToPom(projectPath, mapper.getDependencies(dependencyType)); }
Source:
<code>public AlterReplicaLogDirsResponse getErrorResponse(int throttleTimeMs, Throwable e) { AlterReplicaLogDirsResponseData data = new AlterReplicaLogDirsResponseData(); <START> data.setResults(this.data.dirs().stream().flatMap(x -> { Stream<AlterReplicaLogDirTopicResult> y = x.topics().stream().map(topic -> { <END> return new AlterReplicaLogDirTopicResult() .setTopicName(topic.name()) .setPartitions( topic.partitions().stream().map(partitionId -> { return new AlterReplicaLogDirsResponseData.AlterReplicaLogDirPartitionResult() .setErrorCode(Errors.forException(e).code()) .setPartitionIndex(partitionId); }).collect(Collectors.toList())); }); return y; }).collect(Collectors.toList())); return new AlterReplicaLogDirsResponse(data.setThrottleTimeMs(throttleTimeMs)); }</code><technical_language>please names x y</technical_language>

Target:
public AlterReplicaLogDirsResponse getErrorResponse(int throttleTimeMs, Throwable e) { AlterReplicaLogDirsResponseData data = new AlterReplicaLogDirsResponseData(); data.setResults(this.data.dirs().stream().flatMap(alterDir -> alterDir.topics().stream().map(topic -> new AlterReplicaLogDirTopicResult() .setTopicName(topic.name()) .setPartitions(topic.partitions().stream().map(partitionId -> new AlterReplicaLogDirsResponseData.AlterReplicaLogDirPartitionResult() .setErrorCode(Errors.forException(e).code()) .setPartitionIndex(partitionId)).collect(Collectors.toList())))).collect(Collectors.toList())); return new AlterReplicaLogDirsResponse(data.setThrottleTimeMs(throttleTimeMs)); }
Source:
<code>private double[] getNumericalPercentages( int classNum, RangedClassifier classifier, FeatureCollection collection) throws IOException { double max = ((Number) classifier.getMax(classifier.getSize() - 1)).doubleValue(); double min = ((Number) classifier.getMin(0)).doubleValue(); double classWidth = (max - min) / classNum; Subtract subtract = FF.subtract(getParameters().get(0), FF.literal(min)); Divide divide = FF.divide(subtract, FF.literal(classWidth)); GroupByVisitor groupBy = new GroupByVisitor( Aggregate.COUNT, getParameters().get(0), Arrays.asList(divide), null); collection.accepts(groupBy, null); <START> Object[] result = groupBy.getResult().toArray(); <END> return calculateNumerical(result, classifier, collection.size(), classNum, min, classWidth); }</code><technical_language>I get result a map, turn array? result is bizarre, is array of arrays</technical_language>

Target:
private double[] getNumericalPercentages( int classNum, RangedClassifier classifier, FeatureCollection collection) throws IOException { double max = ((Number) classifier.getMax(classifier.getSize() - 1)).doubleValue(); double min = ((Number) classifier.getMin(0)).doubleValue(); double classWidth = (max - min) / classNum; Subtract subtract = FF.subtract(getParameters().get(0), FF.literal(min)); Divide divide = FF.divide(subtract, FF.literal(classWidth)); Function abs = FF.function("abs", divide); GroupByVisitor groupBy = new GroupByVisitor( Aggregate.COUNT, getParameters().get(0), Arrays.asList(abs), null); collection.accepts(groupBy, null); Map<List<Integer>, Integer> result = groupBy.getResult().toMap(); return calculateNumericalPercentages(result, collection.size(), classNum); }
Source:
<code>public void createXClasses() throws DocumentAccessException { LOGGER.info("create classes for database '{}'", webUtils.getWikiRef()); <START> for (ClassDefinition classDef : Utils.getComponentList(ClassDefinition.class)) { <END> if (!isBlacklisted(classDef)) { createXClass(classDef); LOGGER.debug("created class '{}'", classDef.getName()); } else { LOGGER.info("skipping blacklisted class '{}'", classDef.getName()); } } }</code><technical_language>defining a @Requirement for ClassDefinition list</technical_language>

Target:
public void createXClasses() { LOGGER.info("create classes for database '{}'", webUtils.getWikiRef()); for (ClassPackage classPackage : classPackages) { if (classPackage.isActivated()) { try { createXClasses(classPackage); } catch (XClassCreateException exc) { LOGGER.error("failed to create classes for package '{}'", classPackage.getName(), exc); } } else { LOGGER.info("skipping package '{}'", classPackage.getName()); } } }
Source:
<code>public void should_pass_if_difference_is_equal_to_given_percentage() { bigDecimals.assertIsCloseToPercentage(someInfo(), ONE, ONE, withPercentage(ZERO)); <START> bigDecimals.assertIsCloseToPercentage(someInfo(), ONE, TWO, withPercentage(valueOf(100))); <END> }</code><technical_language>If wrong, difference = 1 allowed margin is 2, difference != allowed margin. need move this should_pass_if_difference_is_less_than_given_percentage</technical_language>

Target:
public void should_pass_if_difference_is_equal_to_given_percentage() { bigDecimals.assertIsCloseToPercentage(someInfo(), ONE, ONE, withPercentage(ZERO)); bigDecimals.assertIsCloseToPercentage(someInfo(), ONE, TWO, withPercentage(valueOf(50))); }
Source:
<code>public MachineResolver( String pluginPublisher, String pluginName, Pair<String, String> projectsRootPathEnvVar, Container container, CheContainer cheContainer, String defaultSidecarMemoryLimitBytes, List<ChePluginEndpoint> containerEndpoints, Map<String, String> wsAttributes) { this.pluginName = pluginName; <START> this.pluginPublisherName = pluginPublisher + "/" + pluginName; <END> this.container = container; this.cheContainer = cheContainer; this.defaultSidecarMemoryLimitBytes = defaultSidecarMemoryLimitBytes; this.containerEndpoints = containerEndpoints; this.wsAttributes = wsAttributes != null ? wsAttributes : Collections.emptyMap(); this.projectsRootPathEnvVar = projectsRootPathEnvVar; }</code><technical_language>pluginPublisher (without Name)? reads slightly Name part redundant</technical_language>

Target:
public MachineResolver( String pluginPublisher, String pluginName, Pair<String, String> projectsRootPathEnvVar, Container container, CheContainer cheContainer, String defaultSidecarMemoryLimitBytes, List<ChePluginEndpoint> containerEndpoints, Map<String, String> wsAttributes) { this.pluginPublisherAndName = pluginPublisher + "/" + pluginName; this.container = container; this.cheContainer = cheContainer; this.defaultSidecarMemoryLimitBytes = defaultSidecarMemoryLimitBytes; this.containerEndpoints = containerEndpoints; this.wsAttributes = wsAttributes != null ? wsAttributes : Collections.emptyMap(); this.projectsRootPathEnvVar = projectsRootPathEnvVar; }
Source:
<code>public ResourcePath getParent() { if(!hasParent()){ throw new UnsupportedOperationException("I am on the root level already"); } <START> return new ResourcePath(this.m_elements.subList(0, this.m_elements.size()-1)); <END> }</code><technical_language>this.m_</technical_language>

Target:
public ResourcePath getParent() { if(!hasParent()){ throw new UnsupportedOperationException("I am on the root level already"); } return new ResourcePath(this.elements.subList(0, this.elements.size()-1)); }
Source:
<code>public static boolean matchingRowColumn(final Cell left, final Cell right) { short lrowlength = left.getRowLength(); short rrowlength = right.getRowLength(); byte lfamlength = left.getFamilyLength(); byte rfamlength = right.getFamilyLength(); int lqlength = left.getQualifierLength(); int rqlength = right.getQualifierLength(); <START> if ((lrowlength + lfamlength + lqlength) != (rrowlength + rfamlength + rqlength)) { <END> return false; } if (!matchingRows(left, lrowlength, right, rrowlength)) { return false; } return matchingColumn(left, lfamlength, lqlength, right, rfamlength, rqlength); }</code><technical_language>More efficient is ((lrowlength == rrowlength) && (lfamlength == rfamlength) && (lqlength == rqlength)</technical_language>

Target:
public static boolean matchingRowColumn(final Cell left, final Cell right) { short lrowlength = left.getRowLength(); short rrowlength = right.getRowLength(); if (lrowlength != rrowlength) { return false; } byte lfamlength = left.getFamilyLength(); byte rfamlength = right.getFamilyLength(); if (lfamlength != rfamlength) { return false; } int lqlength = left.getQualifierLength(); int rqlength = right.getQualifierLength(); if (lqlength != rqlength) { return false; } if (!matchingRows(left, lrowlength, right, rrowlength)) { return false; } return matchingColumn(left, lfamlength, lqlength, right, rfamlength, rqlength); }
Source:
<code>public NanoHTTPD.Response serve(IHTTPSession session) { Method method = session.getMethod(); NanoHTTPD.Response res = null; try { for (String uri : route_priority) { Router r = routerArray.get(uri); switch (method) { case GET: res = r.doGet(session); break; case PUT: res = r.doPut(session); break; case POST: res = r.doPost(session); break; case DELETE: res = r.doDelete(session); break; case HEAD: res = r.doHead(session); break; case OPTIONS: res = r.doOptions(session); break; case TRACE: res = r.doTrace(session); break; case CONNECT: res = r.doConnect(session); break; case PATCH: res = r.doPatch(session); break; default: res = new IStatusResponse(Response.Status.METHOD_NOT_ALLOWED); } if (res != null) return res; } <START> } catch (Exception e) { <END> return new IStatusResponse(Response.Status.INTERNAL_ERROR); } return new IStatusResponse(Response.Status.NOT_FOUND); }</code><technical_language>this place lose original exception. place argument of IStatusResponse (add constructor some arguments). is more frendly for user/developer. And, of course, print stac trace console</technical_language>

Target:
public NanoHTTPD.Response serve(IHTTPSession session) { Method method = session.getMethod(); NanoHTTPD.Response res = null; try { for (String uri : route_priority) { Router r = routerArray.get(uri); switch (method) { case GET: res = r.doGet(session); break; case PUT: res = r.doPut(session); break; case POST: res = r.doPost(session); break; case DELETE: res = r.doDelete(session); break; case HEAD: res = r.doHead(session); break; case OPTIONS: res = r.doOptions(session); break; case TRACE: res = r.doTrace(session); break; case CONNECT: res = r.doConnect(session); break; case PATCH: res = r.doPatch(session); break; default: res = new IStatusResponse(Response.Status.METHOD_NOT_ALLOWED); } if (res != null) return res; } } catch (Exception e) { ByteArrayOutputStream baos = new ByteArrayOutputStream(); e.printStackTrace(new PrintStream(baos)); if (outputStackTrace) { return new IStatusResponse(Response.Status.INTERNAL_ERROR, MIME_PLAINTEXT, new ByteArrayInputStream(baos.toByteArray()), baos.toByteArray().length); } else { return new IStatusResponse(Response.Status.INTERNAL_ERROR); } } return new IStatusResponse(Response.Status.NOT_FOUND); }
Source:
<code>public String[] getFilePaths(RepoObject repoObject) throws RepoException { <START> return new String[]{}; END> }</code><technical_language>I this is picky, consistent return here? In FileSystemStoreService.java, return "new String[0]" I pick stick it. faster read understand code if</technical_language>

Target:
public String[] getFilePaths(RepoObject repoObject) throws RepoException { return new String[0]; }
Source:
<code>public void checkAttributeValue(PerunSessionImpl sess, Resource resource, Group group, Attribute attribute) throws InternalErrorException, WrongAttributeValueException, WrongReferenceAttributeValueException, WrongAttributeAssignmentException { String attributeValue; if(attribute.getValue() == null) { return; } if(attribute.getValue() instanceof String) { attributeValue = (String) attribute.getValue(); if (!pattern.matcher(attributeValue).matches()) { <START> throw new WrongAttributeValueException(attribute, "Invalid attribute adName value. It should contain only letters, digits, hyphens or dots."); <END> } } else { throw new WrongAttributeValueException(attribute, "Attribute adName value must be a String."); } Attribute resourceAdOuName; try { resourceAdOuName = sess.getPerunBl().getAttributesManagerBl().getAttribute(sess, resource, A_R_D_AD_OU_NAME); } catch (AttributeNotExistsException ex) { throw new ConsistencyErrorException(ex); } if(resourceAdOuName.getValue() == null) { return; } List<Group> groupsWithSameADNameInSameOu = sess.getPerunBl().getSearcherBl().getGroupsByGroupResourceSetting(sess, attribute, resourceAdOuName); if(!groupsWithSameADNameInSameOu.isEmpty()) { throw new WrongReferenceAttributeValueException(attribute, resourceAdOuName, group, resource, resource, null, "Attribute AD Name can't be set for group and resource in this OU, because this value is already " + "set for different group and resource in the same OU!"); } }</code><technical_language>Please mention underscore allowed character, allowed \\w in a regex correct redmine task description. Also, regex complex ? @licehammer I \\w contains \\d - <LINK_0> \\w</technical_language>

Target:
public void checkAttributeValue(PerunSessionImpl sess, Resource resource, Group group, Attribute attribute) throws InternalErrorException, WrongAttributeValueException, WrongReferenceAttributeValueException, WrongAttributeAssignmentException { String attributeValue; if(attribute.getValue() == null) { return; } if(attribute.getValue() instanceof String) { attributeValue = (String) attribute.getValue(); if (!pattern.matcher(attributeValue).matches()) { throw new WrongAttributeValueException(attribute, "Invalid attribute adName value. It should contain only letters, digits, hyphens, underscores or dots."); } } else { throw new WrongAttributeValueException(attribute, "Attribute adName value must be a String."); } Attribute resourceAdOuName; try { resourceAdOuName = sess.getPerunBl().getAttributesManagerBl().getAttribute(sess, resource, A_R_D_AD_OU_NAME); } catch (AttributeNotExistsException ex) { throw new ConsistencyErrorException(ex); } if(resourceAdOuName.getValue() == null) { return; } List<Group> groupsWithSameADNameInSameOu = sess.getPerunBl().getSearcherBl().getGroupsByGroupResourceSetting(sess, attribute, resourceAdOuName); if(!groupsWithSameADNameInSameOu.isEmpty()) { throw new WrongReferenceAttributeValueException(attribute, resourceAdOuName, group, resource, resource, null, "Attribute AD Name can't be set for group and resource in this OU, because this value is already " + "set for different group and resource in the same OU!"); } }
Source:
<code>public void testStopEarly() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(RegexpCheck.class); checkConfig.addAttribute("format", "a"); checkConfig.addAttribute("illegalPattern", "false"); checkConfig.addAttribute("duplicateLimit", "-1"); final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; <START> verify(checkConfig, getPath("InputStopEarly.java"), expected); <END> }</code><technical_language>Name InputRegexpCheckStopEarly</technical_language>

Target:
public void testStopEarly() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(RegexpCheck.class); checkConfig.addAttribute("format", "a"); checkConfig.addAttribute("illegalPattern", "false"); checkConfig.addAttribute("duplicateLimit", "-1"); final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verify(checkConfig, getPath("InputRegexpCheckStopEarly.java"), expected); }
Source:
<code>public void beforeStep(StepExecution stepExecution) { importContentFileUtils.deleteAllContentFiles(rawJudgmentClass); File contentSourceDir = new File(importContentDir); Collection<File> importFiles = importFileUtils.listImportFiles(importDir); Collection<File> contentFiles = Lists.newArrayList(); for (File importFile : importFiles) { File contentFile = importContentFileFinder.findContentFile(contentSourceDir, importFile); contentFiles.add(contentFile); } for (File contentFile : contentFiles) { importContentFileUtils.copyContentFile(contentFile, rawJudgmentClass); <START> } <END> }</code><technical_language>I move lines 43-57 ImportContentFileUtils.copySourceContentFiles(importContentDir, importSourceContentDir) is remove importContentFileUtils FileUtils.copyDir instead</technical_language>

Target:
public void beforeStep(StepExecution stepExecution) { deleteDownloadedContentFiles(); downloadContentFiles(); }
Source:
<code>private void addDrops(Player p, Set<ItemStack> customDrops, List<ItemStack> drops) { int random = ThreadLocalRandom.current().nextInt(100); for (ItemStack drop : customDrops) { if (Slimefun.hasUnlocked(p, drop, true)) { SlimefunItem sfi = SlimefunItem.getByItem(drop); if (sfi instanceof RandomMobDrop && ((RandomMobDrop)sfi).getDropChance() <= random) continue; <START> if (circuitBoard != null && circuitBoard.isItem(drop) && !circuitBoard.isDroppedFromGolems()) <END> continue; drops.add(drop.clone()); } } }</code><technical_language>need this CircuitBoard variable this point anymore. check if sfi is instance of Circuit Board, performance wise done operations earlier</technical_language>

Target:
private void addDrops(Player p, Set<ItemStack> customDrops, List<ItemStack> drops) { int random = ThreadLocalRandom.current().nextInt(100); for (ItemStack drop : customDrops) { if (Slimefun.hasUnlocked(p, drop, true)) { SlimefunItem sfi = SlimefunItem.getByItem(drop); if (sfi instanceof RandomMobDrop && ((RandomMobDrop)sfi).getDropChance() <= random) continue; if (sfi instanceof BasicCircuitBoard && !((BasicCircuitBoard)sfi).isDroppedFromGolems()) continue; drops.add(drop.clone()); } } }
Source:
<code>void addContextEntry(final int index) { expression.ifPresent(c -> { final ContextEntry ce = new ContextEntry(); ce.setVariable(new InformationItem()); sessionCommandManager.execute((AbstractCanvasHandler) sessionManager.getCurrentSession().getCanvasHandler(), new AddContextEntryCommand(c, ce, model, new DMNGridRow(), index, uiModelMapper, () -> { resize(); <START> startEditingCell(index, ContextUIModelMapperHelper.NAME_COLUMN_COUNT); <END> })); }); }</code><technical_language>point of view, argument ContextUIModelMapperHelper.NAME_COLUMN_COUNT is slightly confusing this place startEditingCell expects row column indexes</technical_language>

Target:
void addContextEntry(final int index) { expression.ifPresent(c -> { final ContextEntry ce = new ContextEntry(); final InformationItem informationItem = new InformationItem(); informationItem.setName(new Name()); ce.setVariable(informationItem); final CommandResult<CanvasViolation> result = sessionCommandManager.execute((AbstractCanvasHandler) sessionManager.getCurrentSession().getCanvasHandler(), new AddContextEntryCommand(c, ce, model, new DMNGridRow(), index, uiModelMapper, this::resize)); if (!CommandUtils.isError(result)) { selectCell(index, ContextUIModelMapperHelper.NAME_COLUMN_INDEX, false, false); startEditingCell(index, ContextUIModelMapperHelper.NAME_COLUMN_INDEX); } }); }
Source:
<code>public boolean setReplicaStoppedState(List<ReplicaId> replicaIds, boolean markStop) { Set<String> replicasToUpdate = new HashSet<>(); for (ReplicaId replicaId : replicaIds) { if (!(replicaId instanceof AmbryReplica)) { throw new IllegalArgumentException( "HelixParticipant only works with the AmbryReplica implementation of ReplicaId"); } replicasToUpdate.add(replicaId.getPartitionId().toPathString()); } boolean setStoppedResult; synchronized (helixAdministrationLock) { logger.trace("Getting stopped replicas from instanceConfig"); List<String> stoppedListInHelix = getStoppedReplicas(); <START> if (stoppedListInHelix == null) { <END> stoppedListInHelix = new ArrayList<>(); } Set<String> stoppedSet = new HashSet<>(stoppedListInHelix); boolean stoppedSetUpdated = markStop ? stoppedSet.addAll(replicasToUpdate) : stoppedSet.removeAll(replicasToUpdate); if(stoppedSetUpdated){ logger.trace("Updating the stopped list in Helix InstanceConfig"); setStoppedResult = setStoppedReplicas(new ArrayList<>(stoppedSet)); }else{ logger.trace("No replicas should be added or removed, no need to update the stopped list"); setStoppedResult = true; } } return setStoppedResult; }</code><technical_language>this check longer required right? getStoppedReplicas() return null</technical_language>

Target:
public boolean setReplicaStoppedState(List<ReplicaId> replicaIds, boolean markStop) { Set<String> replicasToUpdate = new HashSet<>(); for (ReplicaId replicaId : replicaIds) { if (!(replicaId instanceof AmbryReplica)) { throw new IllegalArgumentException( "HelixParticipant only works with the AmbryReplica implementation of ReplicaId"); } replicasToUpdate.add(replicaId.getPartitionId().toPathString()); } boolean setStoppedResult; synchronized (helixAdministrationLock) { logger.trace("Getting stopped replicas from instanceConfig"); List<String> stoppedListInHelix = getStoppedReplicas(); Set<String> stoppedSet = new HashSet<>(stoppedListInHelix); boolean stoppedSetUpdated = markStop ? stoppedSet.addAll(replicasToUpdate) : stoppedSet.removeAll(replicasToUpdate); if (stoppedSetUpdated) { logger.trace("Updating the stopped list in Helix InstanceConfig"); setStoppedResult = setStoppedReplicas(new ArrayList<>(stoppedSet)); } else { logger.trace("No replicas should be added or removed, no need to update the stopped list"); setStoppedResult = true; } } return setStoppedResult; }
Source:
<code>public Object visitGetKeyValueCommand(InvocationContext ctx, GetKeyValueCommand command) throws Throwable { Object returnValue; if (ctx.isOriginLocal()) { Object key = command.getKey(); if (command.hasFlag(Flag.CACHE_MODE_LOCAL) || command.hasFlag(Flag.SKIP_REMOTE_LOOKUP) || command.hasFlag(Flag.IGNORE_RETURN_VALUES) <START> || dataContainer.containsKey(key)) { <END> return invokeNextInterceptor(ctx, command); } L1WriteSynchronizer l1WriteSync = new L1WriteSynchronizer(dataContainer, l1Lifespan, stateTransferLock); L1WriteSynchronizer presentSync = concurrentWrites.putIfAbsent(key, l1WriteSync); if (presentSync == null) { try { returnValue = invokeNextInterceptor(ctx, command); l1WriteSync.runL1UpdateIfPossible(returnValue, command); } catch (Throwable t) { l1WriteSync.retrievalEncounteredException(t); throw t; } finally { concurrentWrites.remove(key); } } else { log.tracef("Found current request for key %s, waiting for their invocation's response", key); try { returnValue = presentSync.get(); } catch (ExecutionException e) { throw e.getCause(); } } } else { returnValue = invokeNextInterceptor(ctx, command); if (returnValue != null) { l1Manager.addRequestor(command.getKey(), ctx.getOrigin()); } } return returnValue; }</code><technical_language>I a cdl.localNodeIsOwner(key) condition here, owners query for key other owners. I dataContainer.containsKey(key) is ok, key appeared in data container EntryWrappingInterceptor read it. command.perform() return null find in context, change owners</technical_language>

Target:
public Object visitGetKeyValueCommand(InvocationContext ctx, GetKeyValueCommand command) throws Throwable { Object returnValue; if (ctx.isOriginLocal()) { Object key = command.getKey(); if (command.hasFlag(Flag.CACHE_MODE_LOCAL) || command.hasFlag(Flag.SKIP_REMOTE_LOOKUP) || command.hasFlag(Flag.IGNORE_RETURN_VALUES) || cdl.localNodeIsOwner(key) || dataContainer.containsKey(key)) { return invokeNextInterceptor(ctx, command); } L1WriteSynchronizer l1WriteSync = new L1WriteSynchronizer(dataContainer, l1Lifespan, stateTransferLock, cdl); L1WriteSynchronizer presentSync = concurrentWrites.putIfAbsent(key, l1WriteSync); if (presentSync == null) { try { returnValue = invokeNextInterceptor(ctx, command); l1WriteSync.runL1UpdateIfPossible(returnValue, command); } catch (Throwable t) { l1WriteSync.retrievalEncounteredException(t); throw t; } finally { concurrentWrites.remove(key); } } else { if (trace) { log.tracef("Found current request for key %s, waiting for their invocation's response", key); } try { returnValue = presentSync.get(); } catch (ExecutionException e) { throw e.getCause(); } } } else { returnValue = invokeNextInterceptor(ctx, command); if (returnValue != null) { l1Manager.addRequestor(command.getKey(), ctx.getOrigin()); } } return returnValue; }
Source:
<code>public String toString() { <START> final List<String> segmentNames = this.mastSegments.values().stream().map(CdmaMastSegment::getMastSegment) <END> .collect(Collectors.toList()); return "CdmaRun [mastSegments=" + String.join(",", segmentNames) + "]"; }</code><technical_language>Consider using: final Set<String> segmentNames = this.mastSegments.keySet();</technical_language>

Target:
public String toString() { return "CdmaRun [mastSegments=" + this.mastSegments.keySet() + "]"; }
Source:
<code>public void submitWithCodeReviewRequest() throws IOException, ParseException, ExpiredException, IllegalArgumentException, TmcCoreException, URISyntaxException, NoLanguagePluginFoundException { Path testPath = Paths.get( "home", "test", "2014-mooc-no-deadline", "viikko1", "viikko1-Viikko1_001.Nimi"); settings.setCurrentCourse( rootFinder.getCurrentCourse(testPath.toString()).or(new Course())); ArgumentCaptor<Map> capture = ArgumentCaptor.forClass(Map.class); this.courseSubmitter = new ExerciseSubmitter(rootFinder, langs, urlCommunicator, tmcApi, settings); rootFinder.setReturnValue(testPath.toString()); courseSubmitter.submitWithCodeReviewRequest(testPath, "Help"); Mockito.verify(urlCommunicator) <START> .makePostWithByteArray(URI.create(anyString()), <END> any(byte[].class), anyMap(), capture.capture()); assertEquals("1", capture.getValue().get("request_review")); assertEquals("Help", capture.getValue().get("message_for_reviewer")); }</code><technical_language>prefer any(URI.class) this fundamentally different</technical_language>

Target:
public void submitWithCodeReviewRequest() throws IOException, ParseException, ExpiredException, IllegalArgumentException, TmcCoreException, URISyntaxException, NoLanguagePluginFoundException { Path testPath = Paths.get( "home", "test", "2014-mooc-no-deadline", "viikko1", "viikko1-Viikko1_001.Nimi"); settings.setCurrentCourse( rootFinder.getCurrentCourse(testPath.toString()).or(new Course())); ArgumentCaptor<Map> capture = ArgumentCaptor.forClass(Map.class); this.courseSubmitter = new ExerciseSubmitter(rootFinder, langs, urlCommunicator, tmcApi, settings); rootFinder.setReturnValue(testPath.toString()); courseSubmitter.submitWithCodeReviewRequest(testPath, "Help"); Mockito.verify(urlCommunicator) .makePostWithByteArray(Mockito.any(URI.class), any(byte[].class), anyMap(), capture.capture()); assertEquals("1", capture.getValue().get("request_review")); assertEquals("Help", capture.getValue().get("message_for_reviewer")); }