auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public SecurityGroup addIpPermission(IpPermission ipPermission, SecurityGroup group) { String region = AWSUtils.getRegionFromLocationOrNull(group.getLocation()); String name = group.getName(); String id = Iterables.get(client.getSecurityGroupApi().get().describeSecurityGroupsInRegion(region, name), 0).getId(); <START> <END> client.getSecurityGroupApi().get().authorizeSecurityGroupIngressInRegion(region, id, ipPermission); return getSecurityGroupById(new RegionAndName(region, group.getName()).slashEncode()); }</code><technical_language>[trivial] Remove added blank line</technical_language>

Target:
public SecurityGroup addIpPermission(IpPermission ipPermission, SecurityGroup group) { String region = AWSUtils.getRegionFromLocationOrNull(group.getLocation()); String name = group.getName(); String id = groupNameToId.apply(new RegionAndName(region, name).slashEncode()); client.getSecurityGroupApi().get().authorizeSecurityGroupIngressInRegion(region, id, ipPermission); return getSecurityGroupById(new RegionAndName(region, group.getName()).slashEncode()); }
Source:
<code>private static Object doClean(Object dirty, Map<Object, Object> processed) { if (dirty == null) { return null; } if (processed == null) { processed = new HashMap<>(); } if (processed.get(dirty) != null) { return processed.get(dirty); } if (isPrimitive(dirty)) { return dirty; } if (!processCollections(dirty, processed)) { <START> for (String getterName : ReflectionUtils.getGetterNames(dirty)) { <END> Object object = ReflectionUtils.get(dirty, getterName); if (object instanceof AbstractPersistentCollection) { ReflectionUtils.setIfPossible(dirty, getterName, doHibernateClean(object, processed)); } else { processed.put(dirty, dirty); doClean(object, processed); } } } return dirty; }</code><technical_language>cache results of reflection code here? all, a limited number of classes Hibernate related (so cache size small), storing this reflection code greatly improve performance</technical_language>

Target:
private static Object doClean(Object dirty, Map<Object, Object> processed) { if (dirty == null) { return null; } if (processed == null) { processed = new HashMap<>(); } if (isPrimitive(dirty)) { return dirty; } if (processed.get(dirty) != null) { return processed.get(dirty); } if (!processCollections(dirty, processed)) { for (Method getter : ReflectionUtils.getGetters(dirty.getClass())) { Object object = ReflectionUtils.get(dirty, getter); if (!dirty.equals(object)) { if (object instanceof AbstractPersistentCollection) { ReflectionUtils.setIfPossible(dirty, getter, doHibernateClean(object, processed)); } else { processed.put(object, doClean(object, processed)); } } } } return dirty; }
Source:
<code>public void setTypeFontTitle(TrueTypeFont typeFontTitle) { <START> this.typeFontTitle = typeFontTitle; <END> }</code><technical_language>sure, I setters protected, if in tests</technical_language>

Target:
protected void setTypeFontTitle(TrueTypeFont typeFontTitle) { this.typeFontTitle = typeFontTitle; }
Source:
<code>public ServicePlacement withMaxReplicas(int maxReplicas) throws DockerClientException { if (maxReplicas >= 0) { this.maxReplicas = maxReplicas; } else { <START> throw new DockerClientException("The Value for MaxReplicas must be greater or equal to 0"); <END> } return this; }</code><technical_language>please IllegalArgumentException</technical_language>

Target:
public ServicePlacement withMaxReplicas(int maxReplicas) { if (maxReplicas < 0) { throw new IllegalArgumentException("The Value for MaxReplicas must be greater or equal to 0"); } this.maxReplicas = maxReplicas; return this; }
Source:
<code>public Object removeProperty(final String key) { messageChanged(); <START> Object oldValue = checkProperties().removeProperty(SimpleString.toSimpleString(key, getPropertyKeysPool())); <END> if (oldValue != null) { messageChanged(); } return oldValue; }</code><technical_language>delegate public Object removeProperty(final SimpleString key) {</technical_language>

Target:
public Object removeProperty(final String key) { return removeProperty(key(key)); }
Source:
<code>public void test() { connect(); waitResponse(); JQuery listbox = jq(".z-listbox"); JQuery jqBar = jq(".z-listhead-bar"); <START> assertEquals(listbox.eq(0).find(".z-listcell-content").eq(0).outerWidth() + jqBar.eq(0).outerWidth(), <END> listbox.eq(0).width()); jq("$box1").scrollTop(100); waitResponse(); assertEquals(listbox.eq(0).find(".z-listcell-content").eq(0).outerWidth() + jqBar.eq(0).outerWidth(), listbox.eq(0).width()); assertEquals(listbox.eq(1).find(".z-listcell-content").eq(0).outerWidth(), listbox.eq(1).width()); }</code><technical_language>find(".z-listcell-content:eq(0)")</technical_language>

Target:
public void test() { connect(); waitResponse(); JQuery listbox1 = jq("$box"); JQuery listbox2 = jq("$box2"); JQuery jqBar = jq(".z-listhead-bar"); assertEquals(listbox1.find(".z-listcell-content:eq(0)").outerWidth() + jqBar.eq(0).outerWidth(), listbox1.width()); listbox1.scrollTop(100); waitResponse(); assertEquals(listbox1.find(".z-listcell-content:eq(0)").outerWidth() + jqBar.eq(0).outerWidth(), listbox1.width()); assertEquals(listbox2.find(".z-listcell-content:eq(0)").outerWidth(), listbox2.width()); }
Source:
<code>public void addInterceptor(int index, ChannelInterceptor interceptor) { <START> super.addInterceptor(index, interceptor); <END> if (interceptor instanceof ExecutorChannelInterceptor) { if (index < this.executorInterceptors.size()) { this.executorInterceptors.add(index, (ExecutorChannelInterceptor) interceptor); } else { this.executorInterceptors.add((ExecutorChannelInterceptor) interceptor); } this.executorInterceptorsSize++; } }</code><technical_language>This is a peculiar - index represent position in super interceptors executor interceptors? support 0 index here</technical_language>

Target:
public void addInterceptor(int index, ChannelInterceptor interceptor) { super.addInterceptor(index, interceptor); if (interceptor instanceof ExecutorChannelInterceptor) { this.executorInterceptorsSize++; } }
Source:
<code>public boolean isQuestionFullyAnsweredByTeam(FeedbackQuestionAttributes question, String teamName) throws EntityDoesNotExistException { List<StudentAttributes> studentsInTeam = studentsLogic.getStudentsForTeam(question.courseId, teamName); int numberOfResponsesNeeded = question.numberOfEntitiesToGiveFeedbackTo; if (numberOfResponsesNeeded == Const.MAX_POSSIBLE_RECIPIENTS) { numberOfResponsesNeeded = getRecipientsForQuestion(question, teamName).size(); } for (StudentAttributes student : studentsInTeam) { List<FeedbackResponseAttributes> responses = frLogic.getFeedbackResponsesFromGiverForQuestion(question.getId(), student.email); for (FeedbackResponseAttributes response : responses) { if (response.giver.equals(student.email)) { numberOfResponsesNeeded -= 1; } } } <START> return numberOfResponsesNeeded <= 0; <END> }</code><technical_language>noticed meaning of numberOfResponsesNeeded in this method is in method (ie. in isQuestionFullyAnsweredByUser). want consider changing this method meaning of this variable is consistent of previous one</technical_language>

Target:
public boolean isQuestionFullyAnsweredByTeam(FeedbackQuestionAttributes question, String teamName) throws EntityDoesNotExistException { List<StudentAttributes> studentsInTeam = studentsLogic.getStudentsForTeam(question.courseId, teamName); int numberOfPendingResponses = question.numberOfEntitiesToGiveFeedbackTo; if (numberOfPendingResponses == Const.MAX_POSSIBLE_RECIPIENTS) { numberOfPendingResponses = getRecipientsForQuestion(question, teamName).size(); } for (StudentAttributes student : studentsInTeam) { List<FeedbackResponseAttributes> responses = frLogic.getFeedbackResponsesFromGiverForQuestion(question.getId(), student.email); for (FeedbackResponseAttributes response : responses) { if (response.giver.equals(student.email)) { numberOfPendingResponses -= 1; } } } return numberOfPendingResponses <= 0; }
Source:
<code>public ListenableFuture<?> process() { checkState(initialized.get(), "Driver is not initialized"); checkLockNotHeld("Can not process while holding the driver lock"); <START> SettableFuture<?> future = driverBlockedFuture.get(); <END> if (!future.isDone()) { return future; } Optional<ListenableFuture<?>> result = tryWithLock(100, TimeUnit.MILLISECONDS, () -> { ListenableFuture<?> sourceBlockedFuture = processInternal(); updateDriverBlockedFuture(sourceBlockedFuture); return driverBlockedFuture.get(); }); return result.orElse(NOT_BLOCKED); }</code><technical_language>nit: variable in processFor(Duration) is called blockedFuture</technical_language>

Target:
public ListenableFuture<?> process() { checkState(initialized.get(), "Driver is not initialized"); checkLockNotHeld("Can not process while holding the driver lock"); SettableFuture<?> blockedFuture = driverBlockedFuture.get(); if (!blockedFuture.isDone()) { return blockedFuture; } Optional<ListenableFuture<?>> result = tryWithLock(100, TimeUnit.MILLISECONDS, () -> { ListenableFuture<?> future = processInternal(); return updateDriverBlockedFuture(future); }); return result.orElse(NOT_BLOCKED); }
Source:
<code><START> public OperationFuture<LoadBalancer> update(LoadBalancer loadBalancer, LoadBalancerConfig config) { <END> loadBalancerClient.update( fetchDataCenterId(loadBalancer.getDataCenter()), findByRef(loadBalancer).getId(), new LoadBalancerRequest() .name(config.getName()) .description(config.getDescription()) .status(config.getStatus()) ); return new OperationFuture<>( loadBalancer, new NoWaitingJobFuture() ); }</code><technical_language>please add support for updating balancers filter list</technical_language>

Target:
public OperationFuture<LoadBalancer> update(LoadBalancer loadBalancer, LoadBalancerConfig config) { LoadBalancerMetadata loadBalancerMetadata = findByRef(loadBalancer); loadBalancerClient.update( loadBalancerMetadata.getDataCenterId(), loadBalancerMetadata.getId(), new LoadBalancerRequest() .name(config.getName()) .description(config.getDescription()) .status(config.getStatus()) ); return new OperationFuture<>( loadBalancer, new NoWaitingJobFuture() ); }
Source:
<code>private ConnectionOptions getConnectionOptions() { configuration = configuration == null ? Configuration.getGlobalConfiguration().clone() : configuration; if (credentials == null) { final String connectionString = configuration.get(AZURE_EVENT_HUBS_CONNECTION_STRING); if (CoreUtils.isNullOrEmpty(connectionString)) { throw logger.logExceptionAsError(new IllegalArgumentException("Credentials have not been set. " + "They can be set using: connectionString(String), connectionString(String, String), " + "credentials(String, String, TokenCredential), or setting the environment variable '" + AZURE_EVENT_HUBS_CONNECTION_STRING + "' with a connection string")); } connectionString(connectionString); } if (proxyOptions == null) { proxyOptions = getDefaultProxyConfiguration(configuration); } if (proxyOptions != null && proxyOptions.isProxyAddressConfigured() && transport != AmqpTransportType.AMQP_WEB_SOCKETS) { throw logger.logExceptionAsError(new IllegalArgumentException( "Cannot use a proxy when TransportType is not AMQP Web Sockets.")); } final CbsAuthorizationType authorizationType = credentials instanceof EventHubSharedKeyCredential ? CbsAuthorizationType.SHARED_ACCESS_SIGNATURE : CbsAuthorizationType.JSON_WEB_TOKEN; return new ConnectionOptions(fullyQualifiedNamespace, credentials, authorizationType, transport, retryOptions, <START> proxyOptions, scheduler, ""); <END> }</code><technical_language>is this hardcoded empty string</technical_language>

Target:
private ConnectionOptions getConnectionOptions() { configuration = configuration == null ? Configuration.getGlobalConfiguration().clone() : configuration; if (credentials == null) { final String connectionString = configuration.get(AZURE_EVENT_HUBS_CONNECTION_STRING); if (CoreUtils.isNullOrEmpty(connectionString)) { throw logger.logExceptionAsError(new IllegalArgumentException("Credentials have not been set. " + "They can be set using: connectionString(String), connectionString(String, String), " + "credentials(String, String, TokenCredential), or setting the environment variable '" + AZURE_EVENT_HUBS_CONNECTION_STRING + "' with a connection string")); } connectionString(connectionString); } if (proxyOptions == null) { proxyOptions = getDefaultProxyConfiguration(configuration); } if (proxyOptions != null && proxyOptions.isProxyAddressConfigured() && transport != AmqpTransportType.AMQP_WEB_SOCKETS) { throw logger.logExceptionAsError(new IllegalArgumentException( "Cannot use a proxy when TransportType is not AMQP Web Sockets.")); } final CbsAuthorizationType authorizationType = credentials instanceof EventHubSharedKeyCredential ? CbsAuthorizationType.SHARED_ACCESS_SIGNATURE : CbsAuthorizationType.JSON_WEB_TOKEN; return new ConnectionOptions(fullyQualifiedNamespace, credentials, authorizationType, transport, retryOptions, proxyOptions, scheduler, null); }
Source:
<code>public JSONObject getSnapshot() { JSONObject snapshot = new JSONObject(); snapshot.put(IMPLEMENTATION, HelixClusterManager.class.getName()); snapshot.put(CLUSTER_NAME, clusterName); snapshot.put(TIMESTAMP_MS, SystemTime.getInstance().milliseconds()); JSONArray datacentersJsonArray = new JSONArray(); dcIdToDcName.forEach((dcId, dcName) -> { JSONObject data = new JSONObject(); data.put(DATACENTER_NAME, dcName); data.put(DATACENTER_ID, dcId); JSONArray datanodesInDc = new JSONArray(); dcToNodes.get(dcName).forEach(mockDataNodeId -> datanodesInDc.put(mockDataNodeId.getSnapshot())); data.put(DATACENTER_NODES, datanodesInDc); <START> datacentersJsonArray.put(data); <END> }); snapshot.put(DATACENTERS, datacentersJsonArray); JSONArray partitionsJsonArray = new JSONArray(); getAllPartitionIds(null).forEach(partitionId -> partitionsJsonArray.put(partitionId.getSnapshot())); snapshot.put(PARTITIONS, partitionsJsonArray); return snapshot; }</code><technical_language>rename mockDataNodeId DataNodeId AmbryDataNode</technical_language>

Target:
public JSONObject getSnapshot() { JSONObject snapshot = new JSONObject(); snapshot.put(IMPLEMENTATION, HelixClusterManager.class.getName()); snapshot.put(CLUSTER_NAME, clusterName); snapshot.put(TIMESTAMP_MS, SystemTime.getInstance().milliseconds()); JSONArray datacentersJsonArray = new JSONArray(); dcIdToDcName.forEach((dcId, dcName) -> { JSONObject data = new JSONObject(); data.put(DATACENTER_NAME, dcName); data.put(DATACENTER_ID, dcId); JSONArray datanodesInDc = new JSONArray(); dcToNodes.get(dcName).forEach(node -> datanodesInDc.put(node.getSnapshot())); data.put(DATACENTER_NODES, datanodesInDc); datacentersJsonArray.put(data); }); snapshot.put(DATACENTERS, datacentersJsonArray); JSONArray partitionsJsonArray = new JSONArray(); getAllPartitionIds(null).forEach(partitionId -> partitionsJsonArray.put(partitionId.getSnapshot())); snapshot.put(PARTITIONS, partitionsJsonArray); return snapshot; }
Source:
<code>public void getType() { OptionMap options = OptionMap.builder().getMap(); assertSame(Connector.Type.AJP, new UndertowConnector(new AjpListenerService(PathAddress.pathAddress("ajp-listner", "dummy"), "", options, OptionMap.EMPTY)).getType()); <START> assertSame(Connector.Type.HTTP, new UndertowConnector(new HttpListenerService(PathAddress.pathAddress("http-listner", "dummy"), "" , options, OptionMap.EMPTY, false, false, false)).getType()); <END> assertSame(Connector.Type.HTTPS, new UndertowConnector(new HttpsListenerService(PathAddress.pathAddress("https-listner", "dummy"), "", options, null, OptionMap.EMPTY, false)).getType()); }</code><technical_language>Use: Constants.HTTP_LISTENER</technical_language>

Target:
public void getType() { OptionMap options = OptionMap.builder().getMap(); assertSame(Connector.Type.AJP, new UndertowConnector(new AjpListenerService(PathAddress.pathAddress(Constants.AJP_LISTENER, "dummy"), "", options, OptionMap.EMPTY)).getType()); assertSame(Connector.Type.HTTP, new UndertowConnector(new HttpListenerService(PathAddress.pathAddress(Constants.HTTP_LISTENER, "dummy"), "" , options, OptionMap.EMPTY, false, false, false)).getType()); assertSame(Connector.Type.HTTPS, new UndertowConnector(new HttpsListenerService(PathAddress.pathAddress(Constants.HTTPS_LISTENER, "dummy"), "", options, null, OptionMap.EMPTY, false)).getType()); }
Source:
<code>protected RedirectResult createSpecificRedirectResult() { RedirectResult result = createRedirectResult(Const.ActionURIs.INSTRUCTOR_EDIT_INSTRUCTOR_FEEDBACK_PAGE); result.responseParams.put(Const.ParamsNames.COURSE_ID, moderatedInstructor.courseId); result.responseParams.put(Const.ParamsNames.FEEDBACK_SESSION_NAME, feedbackSessionName); <START> result.responseParams.put(Const.ParamsNames.FEEDBACK_SESSION_MODERATED_STUDENT, moderatedInstructor.email); <END> return result; }</code><technical_language>Creating a new constant FEEDBACK_SESSION_MODERATED_INSTRUCTOR more appropriate</technical_language>

Target:
protected RedirectResult createSpecificRedirectResult() { RedirectResult result = createRedirectResult(Const.ActionURIs.INSTRUCTOR_EDIT_INSTRUCTOR_FEEDBACK_PAGE); result.responseParams.put(Const.ParamsNames.COURSE_ID, moderatedInstructor.courseId); result.responseParams.put(Const.ParamsNames.FEEDBACK_SESSION_NAME, feedbackSessionName); result.responseParams.put(Const.ParamsNames.FEEDBACK_SESSION_MODERATED_PERSON, moderatedInstructor.email); return result; }
Source:
<code>private RoomCount getRoomCount() { Map<Integer, String> temp = new HashMap<>(); temp.put(3, "%44"); temp.put(2, "%45"); temp.put(4, "%46"); temp.put(1, "%47"); temp.put(6, "%48"); temp.put(7, "%49"); temp.put(10, "%50"); temp.put(9, "%51"); temp.put(16, "%53"); temp.put(12, "%54"); temp.put(11, "%58"); temp.put(14, "%61"); temp.put(13, "%62"); <START> temp.put(15, "%63"); END> int roomId = roomInstance.getRoom().getRoomId(); if (!temp.containsKey(roomId)) { return null; } Keeper player =worldState.getGameState().getPlayer(roomInstance.getOwnerId()); int total = player.getRoomControl().getTypeCount(roomInstance.getRoom()); return new RoomCount(temp.get(roomId), total); }</code><technical_language>good, if need do this, hash static instead of creating a new object</technical_language>

Target:
private RoomCount getRoomCount() { int roomId = roomInstance.getRoom().getRoomId(); if (!temp.containsKey(roomId)) { return null; } Keeper player = worldState.getGameState().getPlayer(roomInstance.getOwnerId()); int total = player.getRoomControl().getTypeCount(roomInstance.getRoom()); return new RoomCount(temp.get(roomId), total); }
Source:
<code>public PredicateFinalStep visit(FullTextRangeExpr fullTextRangeExpr) { PropertyValueExpr propertyValueExpr = (PropertyValueExpr) fullTextRangeExpr.getChild(); String absoluteFieldPath = propertyValueExpr.getPropertyPath().asStringPath(); Object lower = fullTextRangeExpr.getLower(); Object upper = fullTextRangeExpr.getUpper(); boolean includeLower = fullTextRangeExpr.isIncludeLower(); boolean includeUpper = fullTextRangeExpr.isIncludeUpper(); <START> if (lower == null && upper == null) { <END> return predicateFactory.exists().field(absoluteFieldPath); } RangePredicateFieldMoreStep<?, ?> range = predicateFactory.range().field(absoluteFieldPath); if (lower != null && upper != null) { return range.between( lower, includeLower ? RangeBoundInclusion.INCLUDED : RangeBoundInclusion.EXCLUDED, upper, includeUpper ? RangeBoundInclusion.INCLUDED : RangeBoundInclusion.EXCLUDED); } if (lower != null && includeLower) { return range.atLeast(lower); } if (lower != null) { return range.greaterThan(lower); } if (includeUpper) { return range.atMost(upper); } return range.lessThan(upper); }</code><technical_language>need test this: pass null bounds between, behave properly</technical_language>

Target:
public PredicateFinalStep visit(FullTextRangeExpr fullTextRangeExpr) { PropertyValueExpr propertyValueExpr = (PropertyValueExpr) fullTextRangeExpr.getChild(); String absoluteFieldPath = propertyValueExpr.getPropertyPath().asStringPath(); Object lower = fullTextRangeExpr.getLower(); Object upper = fullTextRangeExpr.getUpper(); boolean includeLower = fullTextRangeExpr.isIncludeLower(); boolean includeUpper = fullTextRangeExpr.isIncludeUpper(); if (lower == null && upper == null) { return predicateFactory.exists().field(absoluteFieldPath); } RangePredicateFieldMoreStep<?, ?> range = predicateFactory.range().field(absoluteFieldPath); return range.between( lower, includeLower ? RangeBoundInclusion.INCLUDED : RangeBoundInclusion.EXCLUDED, upper, includeUpper ? RangeBoundInclusion.INCLUDED : RangeBoundInclusion.EXCLUDED); }
Source:
<code>public ContainsSearchQuerySpec( <START> @JsonProperty("value") String value, <END> @JsonProperty("caseSensitive") boolean caseSensitive ) { this.value = value; this.caseSensitive = caseSensitive; this.target = value == null || caseSensitive ? value : value.toLowerCase(); }</code><technical_language>Is == null a valid case here</technical_language>

Target:
public ContainsSearchQuerySpec( @JsonProperty("value") String value, @JsonProperty("caseSensitive") boolean caseSensitive ) { this.value = value; this.caseSensitive = caseSensitive; }
Source:
<code>protected AbstractLocalSearchResultProvider initializeResultProvider(PQuery query, QueryEvaluationHint hints) throws QueryProcessingException { return new <START> LocalSearchResultProvider(this, <END> context, query, planProvider, hints); }</code><technical_language>is EMF specific RP is default? this method (and class) abstract a specific result provider implementation selected</technical_language>

Target:
protected abstract AbstractLocalSearchResultProvider initializeResultProvider(PQuery query, QueryEvaluationHint hints) throws QueryProcessingException; @Override public void dispose() { eAttributesByTypeForEClass.clear(); resultProviderCache.clear(); generalCache.purge(); }
Source:
<code>public void validateNotAllowedMunitRunnerDependenciesWithCompileScope() throws Exception { Dependency dependencyMock = mock(Dependency.class); when(dependencyMock.getGroupId()).thenReturn("com.mulesoft.munit"); when(dependencyMock.getArtifactId()).thenReturn("munit-runner"); when(dependencyMock.getVersion()).thenReturn("0.0.0"); when(dependencyMock.getScope()).thenReturn("compile"); when(dependencyMock.getType()).thenReturn("jar"); when(dependencyMock.getClassifier()).thenReturn("mule-plugin"); when(projectMock.getDependencies()).thenReturn(singletonList(dependencyMock)); when(projectMock.getPackaging()).thenReturn(MULE_APPLICATION); doCallRealMethod().when(mojoMock).buildArtifactCoordinates(any()); doCallRealMethod().when(mojoMock).validateNotAllowedDependencies(); <START> expectedException.expect(ValidationException.class); <END> mojoMock.validateNotAllowedDependencies(); }</code><technical_language>I add assertion message too</technical_language>

Target:
public void validateNotAllowedMunitRunnerDependenciesWithCompileScope() throws Exception { Dependency dependencyMock = mock(Dependency.class); final String version = "0.0.0"; when(dependencyMock.getGroupId()).thenReturn(MUNIT_GROUP_ID); when(dependencyMock.getArtifactId()).thenReturn(MUNIT_RUNNER_ARTIFACT_ID); when(dependencyMock.getVersion()).thenReturn(version); when(dependencyMock.getScope()).thenReturn("compile"); when(dependencyMock.getType()).thenReturn("jar"); when(dependencyMock.getClassifier()).thenReturn("mule-plugin"); when(projectMock.getDependencies()).thenReturn(singletonList(dependencyMock)); when(projectMock.getPackaging()).thenReturn(MULE_APPLICATION); doCallRealMethod().when(mojoMock).buildArtifactCoordinates(any()); doCallRealMethod().when(mojoMock).validateNotAllowedDependencies(); expectedException.expect(ValidationException.class); expectedException.expectMessage(format("%s:%s:%s", MUNIT_GROUP_ID, MUNIT_RUNNER_ARTIFACT_ID, version)); expectedException.expectMessage("should have scope \'test\', found \'compile\'"); mojoMock.validateNotAllowedDependencies(); }
Source:
<code>public static void main(String...args) { Cli<BrooklynCommand> parser = buildCli(); try { log.debug("Parsing command line arguments: {}",args); BrooklynCommand command = parser.parse(args); log.debug("Executing command: {}", command); command.call(); } catch (ParseException pe) { System.err.println("Parse error: " + pe.getMessage()); <START> System.err.println(getUsageInfo(parser)); END> System.exit(PARSE_ERROR); } catch (Exception e) { log.error("Execution error: {}\n{}" + e.getMessage(),e.getStackTrace()); System.err.println("Execution error: " + e.getMessage()); e.printStackTrace(); System.exit(EXECUTION_ERROR); } }</code><technical_language>logger for this</technical_language>

Target:
public static void main(String...args) { Client client = new Client(); try { client.run(args); } catch (ParseException pe) { LOG.error("Error parsing command "+ Arrays.toString(args), pe); System.err.println("Parse error: " + pe.getMessage()); System.err.println(getUsageInfo(parser)); System.exit(PARSE_ERROR); } catch (Exception e) { LOG.error("Error executing command "+ Arrays.toString(args), e); System.err.println("Execution error: " + e.getMessage()); System.exit(EXECUTION_ERROR); } }
Source:
<code>public void testConnectorGracefullyShutdown() throws Exception { String testCluster = "testConnectorGracefullyShutdown"; String testConnectorType = "testConnectorType"; AtomicBoolean eventProcessed = new AtomicBoolean(false); Coordinator instance1 = createCoordinator(_zkConnectionString, testCluster, new Properties(), new DummyTransportProviderAdminFactory(), (event) -> { try { Thread.sleep(5000); eventProcessed.set(true); } catch (Exception ex) { <START> <END> } }); TestHookConnector connector1 = new TestHookConnector("connector1", testConnectorType); instance1.addConnector(testConnectorType, connector1, new BroadcastStrategy(Optional.empty()), false, new SourceBasedDeduper(), null); instance1.start(); instance1.onAssignmentChange(); instance1.stop(); Assert.assertTrue(eventProcessed.get()); }</code><technical_language>nit: remove empty line</technical_language>

Target:
public void testConnectorGracefullyShutdown() throws Exception { String testCluster = "testConnectorGracefullyShutdown"; String testConnectorType = "testConnectorType"; final CountDownLatch latch = new CountDownLatch(1); Coordinator instance = createCoordinator(_zkConnectionString, testCluster, new Properties(), new DummyTransportProviderAdminFactory(), (event) -> { try { Thread.sleep(1000); latch.countDown(); } catch (Exception ex) { } }); TestHookConnector connector = new TestHookConnector("connector1", testConnectorType); instance.addConnector(testConnectorType, connector, new BroadcastStrategy(Optional.empty()), false, new SourceBasedDeduper(), null); instance.start(); instance.onAssignmentChange(); instance.stop(); Assert.assertTrue(latch.getCount() < 1); }
Source:
<code>public static void writeSimpleXMLTag(PrintWriter pw1, int indent, String name, boolean... values) { <START> StringBuilder csv = new StringBuilder(); <END> for (int i = 0; i < values.length; i++) { csv.append(values[i]); if (i < values.length - 1) { csv.append(","); } } pw1.println(indentStr(indent) + "<" + name + ">" + csv + "</" + name + ">"); }</code><technical_language>StringJoiner for (boolean : values) joiner.add(String.valueOf(value)); (Shorthand phone)</technical_language>

Target:
public static void writeSimpleXMLTag(PrintWriter pw1, int indent, String name, boolean... values) { StringJoiner stringJoiner = new StringJoiner(",", "", ""); for (boolean value : values) { stringJoiner.add(Boolean.toString(value)); } pw1.println(indentStr(indent) + "<" + name + ">" + stringJoiner + "</" + name + ">"); }
Source:
<code>public boolean run(CommandSender sender, Player sender_p, Command cmd, String commandLabel, String[] args, boolean senderIsConsole) { boolean clear = false; if (args.length >= 1) { if (args[0].equalsIgnoreCase("clear")) { TFM_Util.adminAction(sender.getName(), "Clearing all invisible players", true); clear = true; } else { return false; } } List<String> players = new ArrayList<String>(); int clears = 0; for (Player player : server.getOnlinePlayers()) { if (player.hasPotionEffect(PotionEffectType.INVISIBILITY)) { players.add(player.getName()); if (clear && !TFM_AdminList.isSuperAdmin(player)) { player.removePotionEffect(PotionEffectType.INVISIBILITY); clears++; } } } if (players.isEmpty()) { playerMsg("There are no invisible players"); return true; } if (clear) { <START> playerMsg("Cleared invisibility effect from " + clears + " players""); <END> } else { playerMsg("Invisible players (" + players.size() + "): " + StringUtils.join(players, ", ")); } return true; }</code><technical_language>added 2 "'s end</technical_language>

Target:
public boolean run(CommandSender sender, Player sender_p, Command cmd, String commandLabel, String[] args, boolean senderIsConsole) { boolean clear = false; if (args.length >= 1) { if (args[0].equalsIgnoreCase("clear")) { TFM_Util.adminAction(sender.getName(), "Clearing all invisible players", true); clear = true; } else { return false; } } List<String> players = new ArrayList<String>(); int clears = 0; for (Player player : server.getOnlinePlayers()) { if (player.hasPotionEffect(PotionEffectType.INVISIBILITY)) { players.add(player.getName()); if (clear && !TFM_AdminList.isSuperAdmin(player)) { player.removePotionEffect(PotionEffectType.INVISIBILITY); clears++; } } } if (players.isEmpty()) { playerMsg("There are no invisible players"); return true; } if (clear) { playerMsg("Cleared invisibility effect from " + clears + " players"); } else { playerMsg("Invisible players (" + players.size() + "): " + StringUtils.join(players, ", ")); } return true; }
Source:
<code>public void removeListener() { if (!stereotypeList.isEmpty()) { for (Stereotype stereotype : stereotypeList) { Node compartment = helper.getStereotypeCompartment(hostView, stereotype); <START> if (compartment != null && stereotype != null) { <END> getDiagramEventBroker().removeNotificationListener(compartment, this); EList<Property> properties = stereotype.allAttributes(); for (Property property : properties) { getDiagramEventBroker().removeNotificationListener(helper.getStereotypeProperty(hostView, stereotype, property), this); } } } } }</code><technical_language>null constant for operations</technical_language>

Target:
public void removeListener() { if (!stereotypeList.isEmpty()) { for (Stereotype stereotype : stereotypeList) { Node compartment = helper.getStereotypeCompartment(hostView, stereotype); if (null != compartment && null != stereotype) { getDiagramEventBroker().removeNotificationListener(compartment, this); EList<Property> properties = stereotype.allAttributes(); for (Property property : properties) { getDiagramEventBroker().removeNotificationListener(helper.getStereotypeProperty(hostView, stereotype, property), this); } } } } }
Source:
<code>public Subject getSubject(String username, String password, String ip) { AuthenticationTokenFactory tokenFactory = createBasicTokenFactory(); AuthenticationToken token = tokenFactory.fromUsernamePassword(username, password, ip); SecurityManager securityManager = getSecurityManager(); if (securityManager != null) { try { <START> ((BaseAuthenticationToken) token).setAllowGuest(true); <END> return securityManager.getSubject(token); } catch (SecurityServiceException | RuntimeException e) { LOGGER.info("Unable to request subject for user.", username, e); } } return null; }</code><technical_language>Is for this token instance is assignable BaseAuthenticationToken this point? class checked first</technical_language>

Target:
public Subject getSubject(String username, String password, String ip) { AuthenticationTokenFactory tokenFactory = createBasicTokenFactory(); AuthenticationToken token = tokenFactory.fromUsernamePassword(username, password, ip); SecurityManager securityManager = getSecurityManager(); if (securityManager != null) { try { if (token instanceof BaseAuthenticationToken) { ((BaseAuthenticationToken) token).setAllowGuest(true); } return securityManager.getSubject(token); } catch (SecurityServiceException | RuntimeException e) { LOGGER.info("Unable to request subject for user.", username, e); } } return null; }
Source:
<code>private String hash(final byte[] input) { try { if (_algorithm == Algorithm.CRC_32) { final CRC32 crc = new CRC32(); crc.update(input); return ""+crc.getValue(); } else { final MessageDigest messageDigest = MessageDigest.getInstance(_algorithm.toString()); messageDigest.update(input); final byte[] hash = messageDigest.digest(); <START> return String.format("%032X", new BigInteger(1, hash)); <END> } } catch (NoSuchAlgorithmException e) { throw new RuntimeException("Algorithm used for hashing was not recognized. " + e.getMessage()); } }</code><technical_language>A standard converter DataTypeConverter.printHexBinary() a possibility</technical_language>

Target:
private String hash(final byte[] input) { try { final MessageDigest messageDigest = MessageDigest.getInstance(_algorithm.toString()); messageDigest.update(input); final byte[] hash = messageDigest.digest(); return DatatypeConverter.printHexBinary(hash); } catch (final NoSuchAlgorithmException e) { throw new RuntimeException("Algorithm used for hashing was not recognized. " + e.getMessage()); } }
Source:
<code>public static int getTimePeriodDays(final TimePeriodType timePeriodType) { <START> if (timePeriodType == TimePeriodType.OVER_TIME_1W) { <END> return 7; } else if (timePeriodType == TimePeriodType.OVER_TIME_2W) { return 14; } else if (timePeriodType == TimePeriodType.OVER_TIME_1M) { return 30; } else if (timePeriodType == TimePeriodType.OVER_TIME_3M) { return 90; } else { return 365; } }</code><technical_language>a map<TimePeriodType, Int></technical_language>

Target:
public static int getTimePeriodDays(final TimePeriodType timePeriodType) { if (PERIOD_TYPE_DAYS.containsKey(timePeriodType)) { return PERIOD_TYPE_DAYS.get(timePeriodType); } return 365; }
Source:
<code>public void waitMarkersQuantityBetween( MarkerLocator markerLocator, int lowerBound, int upperBound, int timeout) { seleniumWebDriverHelper.waitSuccessCondition( driver -> { final int markersQuantity = getMarkersQuantity(markerLocator); final boolean isQuantityInLowerBound = lowerBound <= markersQuantity; final boolean isQuantityInUpperBound = upperBound >= markersQuantity; <START> return isQuantityInLowerBound && isQuantityInUpperBound; <END> }); }</code><technical_language>over-complicated, IMHO. is lack of information bounds' inclusiveness</technical_language>

Target:
public void waitMarkersQuantityBetween( MarkerLocator markerLocator, int lowerBound, int upperBound, int timeout) { seleniumWebDriverHelper.waitSuccessCondition( driver -> { final int markersQuantity = getMarkersQuantity(markerLocator); return lowerBound <= markersQuantity && upperBound >= markersQuantity; }); }
Source:
<code><START> private Address createAddress(String hostname) throws IOException, URISyntaxException { <END> URI uri = new URI("dummy://" + hostname); String host = uri.getHost(); int port = uri.getPort(); return new Address(host, port); }</code><technical_language>AddressUtil.getAddressHolder instead? this method support ipv6</technical_language>

Target:
private Address createAddress(String hostname) throws IOException { AddressUtil.AddressHolder addressHolder = AddressUtil.getAddressHolder(hostname); String scopedHostName = AddressHelper.getScopedHostName(addressHolder); return new Address(scopedHostName, addressHolder.getPort()); }
Source:
<code><START> public boolean deleteMetadataRecord(String name) { <END> return false; }</code><technical_language>Need implement</technical_language>

Target:
public boolean deleteMetadataRecord(String name) { boolean result = false; Iterator<DataStore> iter = delegateHandler.getAllDelegatesIterator(); while (iter.hasNext()) { DataStore ds = iter.next(); if (ds instanceof SharedDataStore) { result = result || ((SharedDataStore) ds).deleteMetadataRecord(name); } } return result; }
Source:
<code>public static ISynchronizeService getSyncService(String syncServiceId) { ISynchronizeServiceDescriptor desc = SynchronizeServiceRegistry.getSynchronizeServiceDescriptor(syncServiceId); if(desc == null) <START> return null; <END> return desc.getService(); }</code><technical_language>Braces required coding convention</technical_language>

Target:
public static ISynchronizeService getSyncService(String syncServiceId) { ISynchronizeServiceDescriptor desc = SynchronizeServiceRegistry.getSynchronizeServiceDescriptor(syncServiceId); if(desc == null) { return null; } return desc.getService(); }
Source:
<code>private void grantAccessToRequests(AuthenticatedUser au, List<DataFile> files) { boolean actionPerformed = false; DataverseRole fileDownloaderRole = roleService.findBuiltinRoleByAlias(DataverseRole.FILE_DOWNLOADER); for (DataFile file : files) { if (assignRole(au, file, fileDownloaderRole)) { file.getFileAccessRequesters().remove(au); <START> List<FileAccessRequest> fileAccessRequests = fileAccessRequestService.findAllByAuthenticatedUserIdAndRequestState(au.getId(), FileAccessRequest.RequestState.CREATED); <END> for(FileAccessRequest far : fileAccessRequests){ far.setStateGranted(); fileAccessRequestService.save(far); } file.setFileAccessRequests(fileAccessRequests); datafileService.save(file); actionPerformed = true; } } if (actionPerformed) { JsfHelper.addSuccessMessage(BundleUtil.getStringFromBundle("permission.fileAccessGranted", Arrays.asList(au.getDisplayInfo().getTitle()))); userNotificationService.sendNotification(au, new Timestamp(new Date().getTime()), UserNotification.Type.GRANTFILEACCESS, dataset.getId()); initMaps(); } }</code><technical_language>access requests for this user? if created requests for other datasets</technical_language>

Target:
private void grantAccessToRequests(AuthenticatedUser au, List<DataFile> files) { boolean actionPerformed = false; DataverseRole fileDownloaderRole = roleService.findBuiltinRoleByAlias(DataverseRole.FILE_DOWNLOADER); for (DataFile file : files) { if (assignRole(au, file, fileDownloaderRole)) { file.getFileAccessRequesters().remove(au); List<FileAccessRequest> fileAccessRequests = fileAccessRequestService.findAll(au.getId(), file.getId(), FileAccessRequest.RequestState.CREATED); for(FileAccessRequest far : fileAccessRequests){ far.setStateGranted(); fileAccessRequestService.save(far); } file.setFileAccessRequests(fileAccessRequests); datafileService.save(file); actionPerformed = true; } } if (actionPerformed) { JsfHelper.addSuccessMessage(BundleUtil.getStringFromBundle("permission.fileAccessGranted", Arrays.asList(au.getDisplayInfo().getTitle()))); userNotificationService.sendNotification(au, new Timestamp(new Date().getTime()), UserNotification.Type.GRANTFILEACCESS, dataset.getId()); initMaps(); } }
Source:
<code>protected void onResume() { super.onResume(); Log.d(TAG, "onResumed called."); mWebView.onResume(); mWebView.resumeTimers(); SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(mContext); Log.d(TAG, "display_options_units: " + prefs.getString("display_options_units", "0")); currentUnits = prefs.getString("display_options_units", "0").equals("0") ? 1 : Constants.MG_DL_TO_MMOL_L; <START> boolean isLogarithmic = prefs.getString("display_verticle_axis", "0").equals("0") ? true : false; <END> int sgv = (Integer) mTextSGV.getTag(R.string.display_sgv); int direction = (Integer) mTextSGV.getTag(R.string.display_trend); if (sgv != -1) { mTextSGV.setText(getSGVStringByUnit(sgv, TrendArrow.values()[direction])); } mWebView.loadUrl("javascript:updateUnits(" + Boolean.toString(currentUnits == Constants.MG_DL_TO_MMOL_L) +"," + Boolean.toString(isLogarithmic) + ","+ prefs.getString("display_low_range", "80") + "," + prefs.getString("display_high_range", "180") + ")"); mHandler.post(updateTimeAgo); if (statusBarIcons != null) { statusBarIcons.checkForRootOptionChanged(); } }</code><technical_language>verticle -> vertical</technical_language>

Target:
protected void onResume() { super.onResume(); Log.d(TAG, "onResumed called."); mWebView.onResume(); mWebView.resumeTimers(); SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(mContext); final NightscoutPreferences preferences = new AndroidPreferences(prefs); Log.d(TAG, "display_options_units: " + preferences.isDisplayOptionsMgdl()); currentUnits = preferences.isDisplayOptionsMgdl() ? 1 : Constants.MG_DL_TO_MMOL_L; int sgv = (Integer) mTextSGV.getTag(R.string.display_sgv); int direction = (Integer) mTextSGV.getTag(R.string.display_trend); if (sgv != -1) { mTextSGV.setText(getSGVStringByUnit(sgv, TrendArrow.values()[direction])); } mWebView.loadUrl("javascript:updateUnits(" + Boolean.toString(!preferences.isDisplayOptionsMgdl()) +"," + Boolean.toString(preferences.isLogarithmic()) + ","+ preferences.displayLowRange() + "," + preferences.displayHighRange() + ")"); mHandler.post(updateTimeAgo); if (statusBarIcons != null) { statusBarIcons.checkForRootOptionChanged(); } }
Source:
<code>public void processLeftData(final MistDataEvent input) { applyStatefulFunction.update((IN)input.getValue()); <START> this.applyStatefulFunctionState = applyStatefulFunction.getCurrentState(); <END> final OUT output = applyStatefulFunction.produceResult(); LOG.log(Level.FINE, "{0} updates the state to {1} with input {2}, and generates {3}", new Object[]{this.getClass().getName(), applyStatefulFunction.getCurrentState(), input, output}); input.setValue(output); outputEmitter.emitData(input); }</code><technical_language>do store state event processing</technical_language>

Target:
public void processLeftData(final MistDataEvent input) { applyStatefulFunction.update((IN)input.getValue()); final OUT output = applyStatefulFunction.produceResult(); LOG.log(Level.FINE, "{0} updates the state to {1} with input {2}, and generates {3}", new Object[]{this.getClass().getName(), applyStatefulFunction.getCurrentState(), input, output}); input.setValue(output); outputEmitter.emitData(input); }
Source:
<code>private void doFetchPrincipalRecord(ExtMap input, ExtMap output) throws SQLException, IOException { int flags = input.get(Authz.InvokeKeys.QUERY_FLAGS, Integer.class, 0); Collection<ExtMap> principals = authorization.getResults( Formatter.format( "{} = {}", Schema.SEARCH_KEYS.get(Authz.PrincipalRecord.NAME), Formatter.escapeString( input.containsKey(Authz.InvokeKeys.PRINCIPAL) ? input.get(Authz.InvokeKeys.PRINCIPAL, String.class) : input.get(Authn.InvokeKeys.AUTH_RECORD, ExtMap.class) .get(Authn.AuthRecord.PRINCIPAL, String.class) ) ), new ExtMap().mput( Global.SearchContext.IS_PRINCIPAL, true ).mput( Global.SearchContext.WITH_GROUPS, (flags & Authz.QueryFlags.RESOLVE_GROUPS) != 0 ).mput( Global.SearchContext.RECURSIVE, (flags & Authz.QueryFlags.RESOLVE_GROUPS_RECURSIVE) != 0 ).mput( Global.SearchContext.PAGE_SIZE, 1 ).mput( Global.SearchContext.ALL_ATTRIBUTES, false ) ); output.put(Authz.InvokeKeys.PRINCIPAL_RECORD, principals.size() > 0 ? principals.iterator().next() : null ); ExtMap principalRecord = output.get(Authz.InvokeKeys.PRINCIPAL_RECORD); if (principalRecord != null && (flags & Authz.QueryFlags.RESOLVE_GROUPS_RECURSIVE) != 0) { <START> Set<String> searchedGroups = new HashSet<>(); <END> resolveNestedGroups(principalRecord.<List>get(Authz.PrincipalRecord.GROUPS), searchedGroups); } output.put(Base.InvokeKeys.RESULT, Base.InvokeResult.SUCCESS); output.put(Authz.InvokeKeys.STATUS, Authz.Status.SUCCESS); }</code><technical_language>please inline: resolveNestedGroups(principalRecord.<List>get(Authz.PrincipalRecord.GROUPS), new HashSet<>());</technical_language>

Target:
private void doFetchPrincipalRecord(ExtMap input, ExtMap output) throws SQLException, IOException { int flags = input.get(Authz.InvokeKeys.QUERY_FLAGS, Integer.class, 0); Collection<ExtMap> principals = authorization.getResults( Formatter.format( "{} = {}", Schema.SEARCH_KEYS.get(Authz.PrincipalRecord.NAME), Formatter.escapeString( input.containsKey(Authz.InvokeKeys.PRINCIPAL) ? input.get(Authz.InvokeKeys.PRINCIPAL, String.class) : input.get(Authn.InvokeKeys.AUTH_RECORD, ExtMap.class) .get(Authn.AuthRecord.PRINCIPAL, String.class) ) ), new ExtMap().mput( Global.SearchContext.IS_PRINCIPAL, true ).mput( Global.SearchContext.WITH_GROUPS, (flags & Authz.QueryFlags.RESOLVE_GROUPS) != 0 ).mput( Global.SearchContext.RECURSIVE, (flags & Authz.QueryFlags.RESOLVE_GROUPS_RECURSIVE) != 0 ).mput( Global.SearchContext.PAGE_SIZE, 1 ).mput( Global.SearchContext.ALL_ATTRIBUTES, false ) ); output.put(Authz.InvokeKeys.PRINCIPAL_RECORD, principals.size() > 0 ? principals.iterator().next() : null ); ExtMap principalRecord = output.get(Authz.InvokeKeys.PRINCIPAL_RECORD); if (principalRecord != null && (flags & Authz.QueryFlags.RESOLVE_GROUPS_RECURSIVE) != 0) { resolveNestedGroups( principalRecord.<List<ExtMap>>get(Authz.PrincipalRecord.GROUPS), new HashSet<String>() ); } output.put(Base.InvokeKeys.RESULT, Base.InvokeResult.SUCCESS); output.put(Authz.InvokeKeys.STATUS, Authz.Status.SUCCESS); }
Source:
<code><START> public byte getFieldPosition() { <END> return -1; }</code><technical_language>PDOMCPPFieldTemplates store field position PDOMCPPFields</technical_language>

Target:
public byte getFieldPosition() { return getByte(record + FIELD_POSITION_OFFSET); }
Source:
<code><START> private void unZipCcz(String filePath) { <END> if (mTargetPath != null) { new File(mTargetPath).delete(); } mTargetPath = CommCareApplication.instance().getAndroidFsTemp() + PropertyUtils.genUUID(); UnzipTask unzipTask = new sUnzipTask(); unzipTask.connect(mActivity); unzipTask.executeParallel(new String[]{filePath, mTargetPath}); mActivity.enableLoadingIndicator(); setCczSelectionVisibility(false); }</code><technical_language>surprised this is part of this class. this shared normal CCZ install code? (No need change if a reason shouldn't)</technical_language>

Target:
private void unZipCcz(String filePath) { mTargetPath = CczUtils.getCczTargetPath(); ZipUtils.UnzipFile(mActivity, filePath, mTargetPath); mActivity.enableLoadingIndicator(); setCczSelectionVisibility(false); }
Source:
<code>public String getName() { return this.name; <START> } <END></code><technical_language>this. in getters unnecessary too</technical_language>

Target:
public String getName() { return name; }
Source:
<code>void progress(String message, String color) { if (useColor) { progress(color + message + RESET); } else <START> progress(message); <END> }</code><technical_language>curly else branch? :)</technical_language>

Target:
void progress(String message, String color) { if (useColor) { progress(color + message + RESET); } else { progress(message); } }
Source:
<code>public void testLoadLocalReplaysInBackground() throws Exception { <START> var replays = Arrays.asList( <END> ReplayInfoBeanBuilder.create().get(), ReplayInfoBeanBuilder.create().get(), ReplayInfoBeanBuilder.create().get() ); CountDownLatch loadedLatch = new CountDownLatch(1); ((TableView) instance.getRoot()).getItems().addListener((InvalidationListener) observable -> loadedLatch.countDown()); instance.loadLocalReplaysInBackground(); instance.onLocalReplaysChanged(new LocalReplaysChangedEvent(replays, new ArrayList<Replay>())); assertTrue(loadedLatch.await(5000, TimeUnit.MILLISECONDS)); assertThat(((TableView) instance.getRoot()).getItems().size(), is(3)); verifyZeroInteractions(notificationService); }</code><technical_language>var in this codebase</technical_language>

Target:
public void testLoadLocalReplaysInBackground() throws Exception { List<Replay> replays = Arrays.asList( ReplayInfoBeanBuilder.create().get(), ReplayInfoBeanBuilder.create().get(), ReplayInfoBeanBuilder.create().get() ); CountDownLatch loadedLatch = new CountDownLatch(1); instance.replayTableView.getItems().addListener((InvalidationListener) observable -> loadedLatch.countDown()); instance.loadLocalReplaysInBackground(); instance.onLocalReplaysChanged(new LocalReplaysChangedEvent(this, replays, new ArrayList<Replay>())); assertTrue(loadedLatch.await(5000, TimeUnit.MILLISECONDS)); assertThat(instance.replayTableView.getItems().size(), is(3)); verifyZeroInteractions(notificationService); }
Source:
<code>public void getParticipantByAccountIdThrowsException() { AccountId accountId = AccountId.forEmail(STUDY.getIdentifier(), "email@email.com"); participantService.getParticipant(STUDY, accountId, true); <START> verify(accountDao).getAccount(accountId); <END> }</code><technical_language>Minor: This verify called, participantService.getParticipant() throws</technical_language>

Target:
public void getParticipantByAccountIdThrowsException() { AccountId accountId = AccountId.forEmail(STUDY.getIdentifier(), "email@email.com"); participantService.getParticipant(STUDY, accountId, true); }