auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void testRoundRobinLocationSelectorStrategy() throws Exception { List<StorageLocation> storageLocations = new ArrayList<>(); final File localStorageFolder1 = tmpFolder.newFolder("local_storage_folder_1"); final File localStorageFolder2 = tmpFolder.newFolder("local_storage_folder_2"); final File localStorageFolder3 = tmpFolder.newFolder("local_storage_folder_3"); storageLocations.add(new StorageLocation(localStorageFolder1, 10000000000L, null)); storageLocations.add(new StorageLocation(localStorageFolder2, 10000000000L, null)); storageLocations.add(new StorageLocation(localStorageFolder3, 10000000000L, null)); StorageLocationSelectorStrategy roundRobinStrategy = new RoundRobinStorageLocationSelectorStrategy(storageLocations); Iterator<StorageLocation> locations = roundRobinStrategy.getLocations(); StorageLocation loc1 = locations.next(); Assert.assertTrue("The next element of the iterator should point to path local_storage_folder_1", loc1.getPath().equals(localStorageFolder1)); StorageLocation loc2 = locations.next(); Assert.assertTrue("The next element of the iterator should point to path local_storage_folder_2", loc2.getPath().equals(localStorageFolder2)); StorageLocation loc3 = locations.next(); Assert.assertTrue("The next element of the iterator should point to path local_storage_folder_3", loc3.getPath().equals(localStorageFolder3)); StorageLocation loc4 = locations.next(); <START> Assert.assertTrue("The next element of the iterator should point to path local_storage_folder_1", <END> loc4.getPath().equals(localStorageFolder1)); }</code><technical_language>here. assertTrue() assertEquals()</technical_language>

Target:
public void testRoundRobinLocationSelectorStrategy() throws Exception { List<StorageLocation> storageLocations = new ArrayList<>(); final File localStorageFolder1 = tmpFolder.newFolder("local_storage_folder_1"); final File localStorageFolder2 = tmpFolder.newFolder("local_storage_folder_2"); final File localStorageFolder3 = tmpFolder.newFolder("local_storage_folder_3"); storageLocations.add(new StorageLocation(localStorageFolder1, 10000000000L, null)); storageLocations.add(new StorageLocation(localStorageFolder2, 10000000000L, null)); storageLocations.add(new StorageLocation(localStorageFolder3, 10000000000L, null)); StorageLocationSelectorStrategy roundRobinStrategy = new RoundRobinStorageLocationSelectorStrategy(storageLocations); iterateLocs(localStorageFolder1, localStorageFolder2, localStorageFolder3, roundRobinStrategy); iterateLocs(localStorageFolder1, localStorageFolder2, localStorageFolder3, roundRobinStrategy); iterateLocs(localStorageFolder1, localStorageFolder2, localStorageFolder3, roundRobinStrategy); iterateLocs(localStorageFolder1, localStorageFolder2, localStorageFolder3, roundRobinStrategy); iterateLocs(localStorageFolder1, localStorageFolder2, localStorageFolder3, roundRobinStrategy); }
Source:
<code>static Map<String, String> getHeaders(RequestOptions options) { Map<String, String> headers = new HashMap<String, String>(); String apiVersion = options.getStripeVersion(); headers.put("Accept-Charset", CHARSET); headers.put("User-Agent", String.format("Stripe/v1 JavaBindings/%s", Stripe.VERSION)); headers.put("Authorization", String.format("Bearer %s", options.getApiKey())); String[] propertyNames = { "os.name", "os.version", "os.arch", "java.version", "java.vendor", "java.vm.version", "java.vm.vendor" }; Map<String, String> propertyMap = new HashMap<String, String>(); for (String propertyName : propertyNames) { propertyMap.put(propertyName, System.getProperty(propertyName)); } propertyMap.put("bindings.version", Stripe.VERSION); propertyMap.put("lang", "Java"); propertyMap.put("publisher", "Stripe"); headers.put("X-Stripe-Client-User-Agent", GSON.toJson(propertyMap)); if (apiVersion != null) { headers.put("Stripe-Version", apiVersion); } <START> if (options.getIdempotentRequest()!= null) { <END> headers.put("Idempotent-Request", options.getIdempotentRequest()); } return headers; }</code><technical_language>Missing space )</technical_language>

Target:
static Map<String, String> getHeaders(RequestOptions options) { Map<String, String> headers = new HashMap<String, String>(); String apiVersion = options.getStripeVersion(); headers.put("Accept-Charset", CHARSET); headers.put("User-Agent", String.format("Stripe/v1 JavaBindings/%s", Stripe.VERSION)); headers.put("Authorization", String.format("Bearer %s", options.getApiKey())); String[] propertyNames = { "os.name", "os.version", "os.arch", "java.version", "java.vendor", "java.vm.version", "java.vm.vendor" }; Map<String, String> propertyMap = new HashMap<String, String>(); for (String propertyName : propertyNames) { propertyMap.put(propertyName, System.getProperty(propertyName)); } propertyMap.put("bindings.version", Stripe.VERSION); propertyMap.put("lang", "Java"); propertyMap.put("publisher", "Stripe"); headers.put("X-Stripe-Client-User-Agent", GSON.toJson(propertyMap)); if (apiVersion != null) { headers.put("Stripe-Version", apiVersion); } if (options.getIdempotencyKey() != null) { headers.put("Idempotency-Key", options.getIdempotencyKey()); } return headers; }
Source:
<code>public boolean preNext(MethodInvocation curElement) { if (curElement.arguments().size() == 2) { Expression target = (Expression) curElement.arguments().get(1); String targetName = target.toString(); compiler.activateLifeline(targetName); return true; } Expression sender = (Expression) curElement.arguments().get(0); String senderName = sender.toString(); Expression target = (Expression) curElement.arguments().get(2); String targetName = target.toString(); Expression signal = (Expression) curElement.arguments().get(1); String signalExpr = signal.resolveTypeBinding().getQualifiedName(); compiler.println(senderName + "->" + targetName + " : " + signalExpr); <START> compiler.activateLifeline(targetName); <END> return true; }</code><technical_language>I activate sender too, active send a signal</technical_language>

Target:
public boolean preNext(MethodInvocation curElement) { if (curElement.arguments().size() == 2) { return true; } Expression sender = (Expression) curElement.arguments().get(0); String senderName = sender.toString(); Expression target = (Expression) curElement.arguments().get(2); String targetName = target.toString(); Expression signal = (Expression) curElement.arguments().get(1); String signalExpr = signal.resolveTypeBinding().getQualifiedName(); compiler.println(senderName + "->" + targetName + " : " + signalExpr); return true; }
Source:
<code>public void endLatency(Object latencyId, String service, String stormIdName, String stormIdValue, Throwable er) { if(startTimestampPerId.containsKey(latencyId)) { long elapsed = NANOSECONDS.toMillis(System.nanoTime() - startTimestampPerId.get(latencyId)); if(stormIdName != null && stormIdValue != null) { eventSender.send(new LatencyEvent(elapsed) .service(service) <START> .error(er) <END> .attribute(stormIdName, stormIdValue)); } else { eventSender.send(new LatencyEvent(elapsed).service(service).error(er)); } startTimestampPerId.remove(latencyId); if (logger.isDebugEnabled()) { logger.debug("Monitored latency for key {}", elapsed, latencyId); } } else { eventSender.send(new ExceptionEvent("Latency monitor doesn't recognize key.").service(service)); if (er == null) { logger.warn("Latency monitor doesn't recognize key {}.", latencyId); } else { eventSender.send(new ExceptionEvent(er).service(service)); logger.warn("Latency monitor doesn't recognize key {}. Swallowed exception {}", latencyId, er); } } }</code><technical_language>put .attribute if</technical_language>

Target:
public void endLatency(Object latencyId, String service, String stormIdName, String stormIdValue, Throwable er) { if(startTimestampPerId.containsKey(latencyId)) { long elapsed = NANOSECONDS.toMillis(System.nanoTime() - startTimestampPerId.get(latencyId)); LatencyEvent event = new LatencyEvent(elapsed).service(service).error(er); if(stormIdName != null && stormIdValue != null) { event.attribute(stormIdName, stormIdValue); } eventSender.send(event); startTimestampPerId.remove(latencyId); if (logger.isDebugEnabled()) { logger.debug("Monitored latency for key {}", elapsed, latencyId); } } else { eventSender.send(new ExceptionEvent("Latency monitor doesn't recognize key.").service(service)); if (er == null) { logger.warn("Latency monitor doesn't recognize key {}.", latencyId); } else { eventSender.send(new ExceptionEvent(er).service(service)); logger.warn("Latency monitor doesn't recognize key {}. Swallowed exception {}", latencyId, er); } } }
Source:
<code>public void visitNode(AstNode node) { <START> if (node.is(PythonGrammar.ATTRIBUTE_REF, PythonGrammar.ATOM)) { <END> checkQuestionableHashingAlgorithm(node); } else if (node.is(PythonGrammar.EXPRESSION_STMT)) { checkOverwriteDjangoHashers(node); } else if (node.is(PythonGrammar.CLASSDEF)) { checkCreatingCustomHasher(node); } else if (node.is(PythonGrammar.CALL_EXPR)) { super.visitNode(node); } }</code><technical_language>chained if-else-ifI prefer a switch: java switch(node.getType()) { case PythonGrammar.CALL_EXPR: checkQuestionableHashingAlgorithm(node); break; case /*...*/ : // ... break; default: // do - reacting registered nodes }</technical_language>

Target:
public void visitNode(AstNode node) { PythonGrammar nodeType = (PythonGrammar) node.getType(); switch (nodeType) { case ATTRIBUTE_REF: case ATOM: checkQuestionableHashingAlgorithm(node); break; case EXPRESSION_STMT: checkOverwriteDjangoHashers(node); break; case CLASSDEF: checkCreatingCustomHasher(node); break; case CALL_EXPR: super.visitNode(node); default: } }
Source:
<code>public Object visit(ASTAdditiveExpression node, Object data) { Context context = (Context) data; node.childrenAccept(this, context); BinaryOperation current = null; List<String> symbols = node.getOperators(); <START> LinkedList<ExpressionStatement> statements = new LinkedList<>(); <END> for (int i = 0; i < symbols.size() + 1; i++) { statements.addFirst((ExpressionStatement) context.objectStack.pop()); } int i = 2; for (String symbol : symbols) { if (current == null) { current = new BinaryOperation(operationFrom(symbol), statements.get(0), statements.get(1)); } else { current = new BinaryOperation(operationFrom(symbol), current, statements.get(i)); i = i + 1; } } context.objectStack.push(current); node.setIrElement(current); return data; }</code><technical_language>Code duplication multiplicative expression :)</technical_language>

Target:
public Object visit(ASTAdditiveExpression node, Object data) { Context context = (Context) data; node.childrenAccept(this, context); List<OperatorType> operators = node.getOperators() .stream() .map(this::operationFrom) .collect(Collectors.toList()); List<ExpressionStatement> statements = operatorStatements(context, operators.size()); ExpressionStatement operation = assembleBinaryOperation(statements, operators); context.objectStack.push(operation); node.setIrElement(operation); return data; }
Source:
<code>public Map act(Redirector redirector, SourceResolver resolver, Map objectModel, String source, Parameters parameters) throws Exception { org.dspace.core.Context context = ContextUtil.obtainContext(objectModel); <START> context.abort(); <END> return EMPTY_MAP; }</code><technical_language>This simply call ContextUtil.abortContext(objectModel). Otherwise, if Context is aborted closed, create a new Context obtainContext() immediately abort it. <LINK_0></technical_language>

Target:
public Map act(Redirector redirector, SourceResolver resolver, Map objectModel, String source, Parameters parameters) throws Exception { ContextUtil.abortContext(ObjectModelHelper.getRequest(objectModel)); return EMPTY_MAP; }
Source:
<code>public void dispose() { <START> super.dispose(); <END> for (IAction action : this.actions) { action.removePropertyChangeListener(listener); } }</code><technical_language>is reason for calling super first? I thought calling super.dispose a common practice (unless some of other code in this dispose method requires some fields disposed a call before)</technical_language>

Target:
public void dispose() { for (IAction action : this.actions) { action.removePropertyChangeListener(listener); } super.dispose(); }
Source:
<code>public void fixedZkHosts() { Properties props = new Properties(); props.put(curatorHostKey, "hostA"); <START> props.put(exhibitorHostsKey, "[]"); <END> Injector injector = newInjector(props); injector.getInstance(CuratorFramework.class); EnsembleProvider ensembleProvider = injector.getInstance(EnsembleProvider.class); Assert.assertTrue( "EnsembleProvider should be FixedEnsembleProvider", ensembleProvider instanceof FixedEnsembleProvider ); Assert.assertEquals( "The connectionString should be 'hostA'", "hostA", ensembleProvider.getConnectionString() ); }</code><technical_language>this necessary, do need explicitly set exhibitor hosts empty array, default itself</technical_language>

Target:
public void fixedZkHosts() { Properties props = new Properties(); props.put(curatorHostKey, "hostA"); Injector injector = newInjector(props); injector.getInstance(CuratorFramework.class); EnsembleProvider ensembleProvider = injector.getInstance(EnsembleProvider.class); Assert.assertTrue( "EnsembleProvider should be FixedEnsembleProvider", ensembleProvider instanceof FixedEnsembleProvider ); Assert.assertEquals( "The connectionString should be 'hostA'", "hostA", ensembleProvider.getConnectionString() ); }
Source:
<code>public ClusterManager() { try { zeplServerHost = RemoteInterpreterUtils.findAvailableHostAddress(); String clusterAddr = zconf.getClusterAddress(); if (!StringUtils.isEmpty(clusterAddr)) { String cluster[] = clusterAddr.split(","); for (int i = 0; i < cluster.length; i++) { String[] parts = cluster[i].split(":"); String clusterHost = parts[0]; int clusterPort = Integer.valueOf(parts[1]); if (zeplServerHost.equalsIgnoreCase(clusterHost)) { raftServerPort = clusterPort; } Node node = Node.builder().withId(cluster[i]) .withAddress(Address.from(clusterHost, clusterPort)).build(); clusterNodes.add(node); raftAddressMap.put(MemberId.from(cluster[i]), Address.from(clusterHost, clusterPort)); clusterMemberIds.add(MemberId.from(cluster[i])); } } } catch (UnknownHostException e) { <START> e.printStackTrace(); <END> } catch (SocketException e) { e.printStackTrace(); return; } }</code><technical_language>LOGGER.error instead of e.printStackTrace</technical_language>

Target:
public ClusterManager() { try { zeplServerHost = RemoteInterpreterUtils.findAvailableHostAddress(); String clusterAddr = zconf.getClusterAddress(); if (!StringUtils.isEmpty(clusterAddr)) { String cluster[] = clusterAddr.split(","); for (int i = 0; i < cluster.length; i++) { String[] parts = cluster[i].split(":"); String clusterHost = parts[0]; int clusterPort = Integer.valueOf(parts[1]); if (zeplServerHost.equalsIgnoreCase(clusterHost)) { raftServerPort = clusterPort; } Node node = Node.builder().withId(cluster[i]) .withAddress(Address.from(clusterHost, clusterPort)).build(); clusterNodes.add(node); raftAddressMap.put(MemberId.from(cluster[i]), Address.from(clusterHost, clusterPort)); clusterMemberIds.add(MemberId.from(cluster[i])); } } } catch (UnknownHostException e) { LOGGER.error(e.getMessage()); } catch (SocketException e) { LOGGER.error(e.getMessage()); } }
Source:
<code>public void shouldProvisionServiceAndIngressWhenNotFound() { Mockito.when( externalServiceExposureStrategy.getExternalPath(Mockito.anyString(), Mockito.any())) .thenReturn("some-server-path"); final int PORT = 8080; final String SERVER_PORT_NAME = "server-" + PORT; CommandImpl command = new CommandImpl("a", "a", "a", new PreviewUrlImpl(PORT, null), Collections.emptyMap()); KubernetesEnvironment env = KubernetesEnvironment.builder() .setCommands(singletonList(new CommandImpl(command))) .build(); <START> assertTrue(env.getIngresses().isEmpty()); <END> assertTrue(env.getServices().isEmpty()); previewUrlExposer.expose(env); assertEquals(env.getIngresses().size(), 1); assertEquals(env.getServices().size(), 1); Service provisionedService = env.getServices().values().iterator().next(); ServicePort provisionedServicePort = provisionedService.getSpec().getPorts().get(0); assertEquals(provisionedServicePort.getName(), SERVER_PORT_NAME); assertEquals(provisionedServicePort.getPort().intValue(), PORT); Ingress provisionedIngress = env.getIngresses().values().iterator().next(); IngressBackend provisionedIngressBackend = provisionedIngress.getSpec().getRules().get(0).getHttp().getPaths().get(0).getBackend(); assertEquals(provisionedIngressBackend.getServicePort().getStrVal(), SERVER_PORT_NAME); assertEquals( provisionedIngressBackend.getServiceName(), provisionedService.getMetadata().getName()); }</code><technical_language>given/when/then is applied here. I set empty explicitly checking invoking testing method</technical_language>

Target:
public void shouldProvisionServiceAndIngressWhenNotFound() throws InternalInfrastructureException { Mockito.when( externalServiceExposureStrategy.getExternalPath(Mockito.anyString(), Mockito.any())) .thenReturn("some-server-path"); final int PORT = 8080; final String SERVER_PORT_NAME = "server-" + PORT; CommandImpl command = new CommandImpl("a", "a", "a", new PreviewUrlImpl(PORT, null), Collections.emptyMap()); KubernetesEnvironment env = KubernetesEnvironment.builder() .setCommands(singletonList(new CommandImpl(command))) .setIngresses(new HashMap<>()) .setServices(new HashMap<>()) .build(); previewUrlExposer.expose(env); assertEquals(env.getIngresses().size(), 1); assertEquals(env.getServices().size(), 1); Service provisionedService = env.getServices().values().iterator().next(); ServicePort provisionedServicePort = provisionedService.getSpec().getPorts().get(0); assertEquals(provisionedServicePort.getName(), SERVER_PORT_NAME); assertEquals(provisionedServicePort.getPort().intValue(), PORT); Ingress provisionedIngress = env.getIngresses().values().iterator().next(); IngressBackend provisionedIngressBackend = provisionedIngress.getSpec().getRules().get(0).getHttp().getPaths().get(0).getBackend(); assertEquals(provisionedIngressBackend.getServicePort().getStrVal(), SERVER_PORT_NAME); assertEquals( provisionedIngressBackend.getServiceName(), provisionedService.getMetadata().getName()); }
Source:
<code><START> protected IValidation[] getClonedNameValidators(Object object) { <END> VM vm = ((ImportVmData) object).getVm(); final int length = AsyncDataProvider.IsWindowsOsType(vm.getOs()) ? UnitVmModel.WINDOWS_VM_NAME_MAX_LIMIT : UnitVmModel.NON_WINDOWS_VM_NAME_MAX_LIMIT; return new IValidation[] { new NotEmptyValidation(), new LengthValidation(length), new I18NNameValidation() { @Override protected String composeMessage() { return ConstantsManager.getInstance() .getMessages() .nameMustConataionOnlyAlphanumericChars(length); }; }, new UniqueNameValidator(assignedVmNames) }; }</code><technical_language>getClonedNameValidators() getClonedAppendedNameValidators() similar - try extracting identical code</technical_language>

Target:
protected IValidation[] getClonedNameValidators(Object object) { final int maxClonedNameLength = getMaxClonedNameLength(object); return new IValidation[] { new NotEmptyValidation(), new LengthValidation(maxClonedNameLength), new I18NNameValidation() { @Override protected String composeMessage() { return ConstantsManager.getInstance() .getMessages() .nameMustConataionOnlyAlphanumericChars(maxClonedNameLength); }; }, new UniqueClonedNameValidator(assignedVmNames) }; }
Source:
<code>protected int getArtifactKeyCount(IQueryResult<IInstallableUnit> ius) { int count = 0; for (IInstallableUnit <START> iInstallableUnit : <END> ius) count += iInstallableUnit.getArtifacts().size(); return count; }</code><technical_language>rename iu</technical_language>

Target:
protected int getArtifactKeyCount(IQueryResult<IInstallableUnit> ius) { int count = 0; for (IInstallableUnit iu : ius) count += iu.getArtifacts().size(); return count; }
Source:
<code>public IRoute chooseRoute(List<IRoute> routes) { final IRoute[] selectedRoute = new IRoute[1]; Display.getDefault().syncExec(() -> { <START> ensureHasShell(); <END> SelectRouteDialog routeDialog = new SelectRouteDialog(routes, shell); if (Dialog.OK == routeDialog.open()) { selectedRoute[0] = routeDialog.getSelectedRoute(); rememberChoice = routeDialog.isRememberChoice(); } }); return selectedRoute[0]; }</code><technical_language>point in a shell field in this class ? call this PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell() a shell is needed, instead</technical_language>

Target:
public IRoute chooseRoute(List<IRoute> routes) { final IRoute[] selectedRoute = new IRoute[1]; Display.getDefault().syncExec(() -> { SelectRouteDialog routeDialog = new SelectRouteDialog(routes, PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell()); if (Dialog.OK == routeDialog.open()) { selectedRoute[0] = routeDialog.getSelectedRoute(); rememberChoice = routeDialog.isRememberChoice(); } }); return selectedRoute[0]; }
Source:
<code>private void ensureSize() { while (true) { long addressToRemove; Lock entryWriteLock; lruLock.lock(); try { if (currentSize > maxSize) { int hashCode = UNSAFE.getInt(firstAddress + 24); entryWriteLock = locks.getLockFromHashCode(hashCode).writeLock(); if (!entryWriteLock.tryLock()) { addressToRemove = 0; } else { addressToRemove = UNSAFE.getLong(firstAddress); } } else { break; } } finally { lruLock.unlock(); } if (addressToRemove == 0) { entryWriteLock.lock(); try { lruLock.lock(); try { if (currentSize > maxSize) { int hashCode = UNSAFE.getInt(firstAddress + 24); Lock innerLock = locks.getLockFromHashCode(hashCode).writeLock(); if (innerLock == entryWriteLock) { addressToRemove = UNSAFE.getLong(firstAddress); } else { <START> addressToRemove = 0; <END> } } else { break; } } finally { lruLock.unlock(); } } finally { if (addressToRemove == 0) { entryWriteLock.unlock(); } } } if (addressToRemove != 0) { if (trace) { log.tracef("Removing entry: %d due to eviction due to size %d being larger than maximum of %d", addressToRemove, currentSize, maxSize); } try { InternalCacheEntry<WrappedBytes, WrappedBytes> ice = offHeapEntryFactory.fromMemory(addressToRemove); performRemove(addressToRemove, offHeapEntryFactory.getKey(addressToRemove)); evictionManager.onEntryEviction(Collections.singletonMap(ice.getKey(), ice)); } finally { entryWriteLock.unlock(); } } } }</code><technical_language>Again, if (currentSize <= maxSize) break; me</technical_language>

Target:
private void ensureSize() { while (true) { long addressToRemove; Lock entryWriteLock; lruLock.lock(); try { if (currentSize <= maxSize) { break; } int hashCode = UNSAFE.getInt(firstAddress + 24); entryWriteLock = locks.getLockFromHashCode(hashCode).writeLock(); if (!entryWriteLock.tryLock()) { addressToRemove = 0; } else { addressToRemove = UNSAFE.getLong(firstAddress); } } finally { lruLock.unlock(); } if (addressToRemove == 0) { entryWriteLock.lock(); try { lruLock.lock(); try { if (currentSize <= maxSize) { break; } int hashCode = UNSAFE.getInt(firstAddress + 24); Lock innerLock = locks.getLockFromHashCode(hashCode).writeLock(); if (innerLock == entryWriteLock) { addressToRemove = UNSAFE.getLong(firstAddress); } else { addressToRemove = 0; } } finally { lruLock.unlock(); } } finally { if (addressToRemove == 0) { entryWriteLock.unlock(); } } } if (addressToRemove != 0) { if (trace) { log.tracef("Removing entry: %d due to eviction due to size %d being larger than maximum of %d", addressToRemove, currentSize, maxSize); } try { InternalCacheEntry<WrappedBytes, WrappedBytes> ice = offHeapEntryFactory.fromMemory(addressToRemove); performRemove(addressToRemove, offHeapEntryFactory.getKey(addressToRemove)); evictionManager.onEntryEviction(Collections.singletonMap(ice.getKey(), ice)); } finally { entryWriteLock.unlock(); } } } }
Source:
<code>public VeluxProduct(BCgetProducts.BCproduct productDescr) { this.name = new ProductName(productDescr.getName()); this.bridgeProductIndex = new ProductBridgeIndex(productDescr.getId()); String productTypeId = productDescr.getCategory().replaceAll("\\s", "_").toUpperCase(); try { this.typeId = ProductTypeId.valueOf(productTypeId); } catch (IllegalArgumentException iae) { <START> logger.error( <END> "PLEASE REPORT THIS TO MAINTAINER: VeluxProduct({},{}) has found an unregistered ProductTypeId.", productTypeId, productDescr.getTypeId()); } if (this.getTypeId().getTypeId() != productDescr.getTypeId()) { logger.error( "PLEASE REPORT THIS TO MAINTAINER: VeluxProduct({},{}) has found two different typeIds which differ ({} vs. {}.", productTypeId, productDescr.getTypeId(), this.getTypeId().getTypeId(), productDescr.getTypeId()); } }</code><technical_language>This a WARN, ERROR. Also, drop CAPS text</technical_language>

Target:
public VeluxProduct(BCgetProducts.BCproduct productDescr) { this.name = new ProductName(productDescr.getName()); this.bridgeProductIndex = new ProductBridgeIndex(productDescr.getId()); String productTypeId = productDescr.getCategory().replaceAll("\\s", "_").toUpperCase(); try { this.typeId = ProductTypeId.valueOf(productTypeId); } catch (IllegalArgumentException iae) { logger.warn( "Please report this to maintainer: VeluxProduct({},{}) has found an unregistered ProductTypeId.", productTypeId, productDescr.getTypeId()); } if (this.getTypeId().getTypeId() != productDescr.getTypeId()) { logger.warn( "Please report this to maintainer: VeluxProduct({},{}) has found two different typeIds which differ ({} vs. {}.", productTypeId, productDescr.getTypeId(), this.getTypeId().getTypeId(), productDescr.getTypeId()); } }
Source:
<code>protected ModelAndView handleRequestInternal(HttpServletRequest request, HttpServletResponse response) throws Exception { int rows = DEFAULT_ROWS; <START> if (System.getProperty(THRESHOLD_ALARM_COUNT_PROPERTY) != null) { <END> try { rows = Integer.valueOf(System.getProperty(THRESHOLD_ALARM_COUNT_PROPERTY)); } catch (NumberFormatException e) { } } String ueiFilter = System.getProperty(UEI_FILTER_PROPERTY, UEI_DEFAULT_FILTER); Filter[] filters = new Filter[1]; filters[0] = new PartialUEIFilter(ueiFilter); m_alarmCriteria = new AlarmCriteria(filters, SortStyle.ID, AcknowledgeType.UNACKNOWLEDGED, rows, 0); ArrayList<OnmsAlarm> thresholdAlarmList = new ArrayList<OnmsAlarm>(Arrays.asList(m_webAlarmRepository.getMatchingAlarms(AlarmUtil.getOnmsCriteria(m_alarmCriteria)))); int moreCount = thresholdAlarmList.size() - rows; ModelAndView modelAndView = new ModelAndView(getSuccessView()); if (rows == 0 || thresholdAlarmList.size() < rows) { modelAndView.addObject("thresholdAlarmList", thresholdAlarmList); } else { modelAndView.addObject("thresholdAlarmList", thresholdAlarmList.subList(0, rows)); } modelAndView.addObject("moreCount", moreCount); modelAndView.addObject("ueiFilter",ueiFilter); return modelAndView; }</code><technical_language>This block replaced with: int rows = Integer.getInteger(THRESHOLD_ALARM_COUNT_PROPERTY, DEFAULT_ROWS);</technical_language>

Target:
protected ModelAndView handleRequestInternal(HttpServletRequest request, HttpServletResponse response) throws Exception { int rows = Integer.getInteger(THRESHOLD_ALARM_COUNT_PROPERTY, DEFAULT_ROWS); String ueiFilter = System.getProperty(UEI_FILTER_PROPERTY, UEI_DEFAULT_FILTER); Filter[] filters = new Filter[1]; filters[0] = new PartialUEIFilter(ueiFilter); m_alarmCriteria = new AlarmCriteria(filters, SortStyle.ID, AcknowledgeType.UNACKNOWLEDGED, rows + 1, 0); ArrayList<OnmsAlarm> thresholdAlarmList = new ArrayList<OnmsAlarm>(Arrays.asList(m_webAlarmRepository.getMatchingAlarms(AlarmUtil.getOnmsCriteria(m_alarmCriteria)))); int moreCount = thresholdAlarmList.size() - rows; ModelAndView modelAndView = new ModelAndView(getSuccessView()); if (rows == 0 || thresholdAlarmList.size() < rows) { modelAndView.addObject("thresholdAlarmList", thresholdAlarmList); } else { modelAndView.addObject("thresholdAlarmList", thresholdAlarmList.subList(0, rows)); } modelAndView.addObject("moreCount", moreCount); modelAndView.addObject("ueiFilter",ueiFilter); return modelAndView; }
Source:
<code>@Config(reportSdk = GINGERBREAD) @Test public void allowExpiredSetsCacheControl() <START> throws Exception { <END> server.enqueue(new MockResponse()); loader.load(URL, false); RecordedRequest request1 = server.takeRequest(); assertThat(request1.getHeader("Cache-Control")).isNull(); server.enqueue(new MockResponse()); loader.load(URL, true); RecordedRequest request2 = server.takeRequest(); assertThat(request2.getHeader("Cache-Control")).isEqualTo("only-if-cached"); }</code><technical_language>Revert. Add // prevent this</technical_language>

Target:
@Test public void allowExpiredSetsCacheControl() throws Exception { server.enqueue(new MockResponse()); loader.load(URL, false); RecordedRequest request1 = server.takeRequest(); assertThat(request1.getHeader("Cache-Control")).isNull(); server.enqueue(new MockResponse()); loader.load(URL, true); RecordedRequest request2 = server.takeRequest(); assertThat(request2.getHeader("Cache-Control")).isEqualTo("only-if-cached"); }
Source:
<code>public void ParserCorrectlyConvertsLocationToPrettyJSON() throws Exception { Parser parser = new Parser(null); <START> String expected = "{\n" + <END> " \"_type\" : \"location\",\n" + " \"batt\" : 30,\n" + " \"acc\" : 10,\n" + " \"vac\" : 0,\n" + " \"lat\" : 50.1,\n" + " \"lon\" : 60.2,\n" + " \"alt\" : 20.0,\n" + " \"tst\" : 123456789,\n" + " \"conn\" : \"TestConn\"\n" + "}"; assertEquals(expected, parser.toJsonPlainPretty(messageLocation)); }</code><technical_language>a bit hard read of escaping, triple quotes stored disk/loaded a JSON parser</technical_language>

Target:
public void ParserCorrectlyConvertsLocationToPrettyJSON() throws Exception { Parser parser = new Parser(null); String expected = getResourceFileAsString("prettyLocation.json"); assertEquals(expected, parser.toJsonPlainPretty(messageLocation)); }
Source:
<code>public void clearData() { try { setData(NULL_CERT); } catch (CertificateException e) { <START> e.printStackTrace(); <END> } }</code><technical_language>logged</technical_language>

Target:
public void clearData() { try { setData(NULL_CERT); } catch (CertificateException e) { log.warn("Could not clear certificate data: " + e.getMessage(), e); } }
Source:
<code>private void reportFailure(Failure failure) { String trace = failure.getTrace(); if (trace.length() > MAX_TRACE_SIZE) { <START> trace = failure.getTrimmedTrace(); <END> if (trace.length() > MAX_TRACE_SIZE) { Log.w( TAG, String.format("Stack trace too long, trimmed to first %s characters.", MAX_TRACE_SIZE)); trace = trace.substring(0, MAX_TRACE_SIZE) + "\n"; } } testResult.putString(REPORT_KEY_STACK, trace); testResult.putString( Instrumentation.REPORT_KEY_STREAMRESULT, String.format( "\nError in %s:\n%s", failure.getDescription().getDisplayName(), failure.getTrace())); }</code><technical_language>getTrimmedTrace is in JUnit 4.13. Androidx.test junit 4.12</technical_language>

Target:
private void reportFailure(Failure failure) { String trace = failure.getTrace(); if (trace.length() > MAX_TRACE_SIZE) { Log.w( TAG, String.format("Stack trace too long, trimmed to first %s characters.", MAX_TRACE_SIZE)); trace = trace.substring(0, MAX_TRACE_SIZE) + "\n"; } testResult.putString(REPORT_KEY_STACK, trace); testResult.putString( Instrumentation.REPORT_KEY_STREAMRESULT, String.format( "\nError in %s:\n%s", failure.getDescription().getDisplayName(), failure.getTrace())); }
Source:
<code>private boolean isInvalidCommandTypeError(Throwable throwable) { String message = ""; if (throwable.getMessage() != null) { message = throwable.getMessage(); <START> } else if (throwable.getCause() != null) { <END> message = throwable.getCause().getMessage(); } return message.contains("Invalid command type"); }</code><technical_language>I mentioned, a potential _NullPointerException_ gap. _else if_ expression expanded to: else if (throwable.getCause() != null && throwable.getCause().getMessage() != null)</technical_language>

Target:
private boolean isInvalidCommandTypeError(Throwable throwable) { String message = ""; if (throwable.getMessage() != null) { message = throwable.getMessage(); } else if (throwable.getCause() != null && throwable.getCause().getMessage() != null) { message = throwable.getCause().getMessage(); } return message.contains("Invalid command type"); }
Source:
<code>public static File extractTestMappingsZip(File testMappingsZip) { File testMappingsDir = null; try { testMappingsDir = ZipUtil2.extractZipToTemp(testMappingsZip, TEST_MAPPINGS_ZIP); } catch (IOException e) { RuntimeException runtimeException = new RuntimeException( String.format( "IO <START> error (%s) <END> when extracting test mappings zip (%s)", e.getMessage(), testMappingsZip.getAbsolutePath()), e); throw runtimeException; } return testMappingsDir; }</code><technical_language>exception</technical_language>

Target:
public static File extractTestMappingsZip(File testMappingsZip) { File testMappingsDir = null; try { testMappingsDir = ZipUtil2.extractZipToTemp(testMappingsZip, TEST_MAPPINGS_ZIP); } catch (IOException e) { throw new RuntimeException( String.format( "IO exception (%s) when extracting test mappings zip (%s)", e.getMessage(), testMappingsZip.getAbsolutePath()), e); } return testMappingsDir; }
Source:
<code>public String getTaskServerLogsByTag(String jobId, String taskTag) throws UnknownJobException, NotConnectedException, PermissionException { JobId id = JobIdImpl.makeJobId(jobId); <START> frontendState.checkJobOwner("getTaskServerLogs", id, <END> "You do not have permission to get the task logs of this job"); Set<TaskId> tasksIds = new HashSet<>(); for (TaskState taskState : frontendState.getJobState(id).getTaskByTag(taskTag)) { tasksIds.add(taskState.getId()); } return ServerJobAndTaskLogs.getJobLog(id, tasksIds); }</code><technical_language>parameter getTaskServerLogsByTag</technical_language>

Target:
public String getTaskServerLogsByTag(String jobId, String taskTag) throws UnknownJobException, NotConnectedException, PermissionException { JobId id = JobIdImpl.makeJobId(jobId); frontendState.checkJobOwner("getTaskServerLogsByTag", id, "You do not have permission to get the task logs of this job"); List<TaskState> lTaskState = frontendState.getJobState(id).getTasksByTag(taskTag); Set<TaskId> tasksIds = new HashSet<>(lTaskState.size()); for (TaskState taskState : lTaskState) { tasksIds.add(taskState.getId()); } return ServerJobAndTaskLogs.getJobLog(id, tasksIds); }
Source:
<code>private Optional<OnmsNode> getNode(String nodeCriteria) { if (nodeCriteria == null || nodeCriteria.trim().isEmpty()) { return Optional.empty(); } try { return Optional.ofNullable(nodeDao.get(nodeCriteria)); } catch (Exception e) { <START> LOG.error("error while trying to match node from {}", nodeCriteria); <END> } return Optional.empty(); }</code><technical_language>suggestion LOG.error("Error while load node for criteria: {}. node returned.", nodeCriteria, e);</technical_language>

Target:
private Optional<OnmsNode> getNode(String nodeCriteria) { if (nodeCriteria == null || nodeCriteria.trim().isEmpty()) { return Optional.empty(); } try { return Optional.ofNullable(nodeDao.get(nodeCriteria)); } catch (Exception e) { LOG.error("Error while trying to load node for criteria: {}. No node will be returned.", nodeCriteria, e); } return Optional.empty(); }
Source:
<code>public String getEntityTypeAsString() { <START> return DEFAULT_DISPLAY_NAME; <END> }</code><technical_language>I DEFAULT_DISPLAY_NAME exists in attribute</technical_language>

Target:
public String getEntityTypeAsString() { return ATTRIBUTE_NAME; }
Source:
<code>public static boolean contentEqualsIgnoreEOL(final Reader input1, final Reader input2) throws IOException { if (input1 == input2) { return true; } final BufferedReader br1 = toBufferedReader(input1); final BufferedReader br2 = toBufferedReader(input2); String line1 = br1.readLine(); String line2 = br2.readLine(); while (line1 != null && line1.equals(line2)) { line1 = br1.readLine(); line2 = br2.readLine(); } <START> return line1 == null && line2 == null; <END> }</code><technical_language>line1.equals(line2) bit</technical_language>

Target:
public static boolean contentEqualsIgnoreEOL(final Reader input1, final Reader input2) throws IOException { if (input1 == input2) { return true; } final BufferedReader br1 = toBufferedReader(input1); final BufferedReader br2 = toBufferedReader(input2); String line1 = br1.readLine(); String line2 = br2.readLine(); while (line1 != null && line1.equals(line2)) { line1 = br1.readLine(); line2 = br2.readLine(); } return Objects.equals(line1, line2); }
Source:
<code>protected EntitySpec<?> getMemberSpec() { EntitySpec<?> result = super.getMemberSpec(); if (result != null) return result; <START> return EntitySpec.create(RiakNode.class); <END> }</code><technical_language>Java return Optional.fromNullable(super.getMemberSpec()).or(EntitySpec.create(RiakNode.class));</technical_language>

Target:
protected EntitySpec<?> getMemberSpec() { return getConfig(MEMBER_SPEC, EntitySpec.create(RiakNode.class)); }
Source:
<code><START> public String getContainerName() { <END> return URLParser.parse(this.azureBlobStorage.getUrl(), logger).getContainerName(); }</code><technical_language>marking methods final prevent overridden in a subclass</technical_language>

Target:
public final String getContainerName() { return URLParser.parse(this.azureBlobStorage.getUrl(), logger).getContainerName(); }
Source:
<code>public void injectMocks() { <START> Assert.assertNotNull(target.bar); <END> }</code><technical_language>assert target.getBar(). please add another assertion assertEquals(target.foo, foo)</technical_language>

Target:
public void injectMocks() { Assert.assertEquals(foo, target.getFoo()); Assert.assertNotNull(target.getBar()); }
Source:
<code>private State createState(Class<? extends Item> itemType, String transformedResponse) { try { if (itemType.isAssignableFrom(SwitchItem.class)) { int value = Math.round(Float.parseFloat(transformedResponse)); <START> if (value > 0) <END> return OnOffType.ON; else return OnOffType.OFF; } else if (itemType.isAssignableFrom(DimmerItem.class)) { return new PercentType(Math.round(Float .parseFloat(transformedResponse))); } else if (itemType.isAssignableFrom(ContactItem.class)) { int value = Math.round(Float.parseFloat(transformedResponse)); if (value > 0) return OpenClosedType.OPEN; else return OpenClosedType.CLOSED; } else if (itemType.isAssignableFrom(NumberItem.class)) { return DecimalType.valueOf(transformedResponse); } else { return StringType.valueOf(transformedResponse); } } catch (Exception e) { logger.debug("Couldn't create state of type '{}' for value '{}'", itemType, transformedResponse); return StringType.valueOf(transformedResponse); } }</code><technical_language>"if" blocks enclosed in braces ( { } )</technical_language>

Target:
private State createState(Class<? extends Item> itemType, String transformedResponse) { try { if (itemType.isAssignableFrom(SwitchItem.class)) { int value = Math.round(Float.parseFloat(transformedResponse)); if (value > 0) { return OnOffType.ON; } else { return OnOffType.OFF; } } else if (itemType.isAssignableFrom(DimmerItem.class)) { return new PercentType(Math.round(Float.parseFloat(transformedResponse))); } else if (itemType.isAssignableFrom(ContactItem.class)) { int value = Math.round(Float.parseFloat(transformedResponse)); if (value > 0) { return OpenClosedType.OPEN; } else { return OpenClosedType.CLOSED; } } else if (itemType.isAssignableFrom(NumberItem.class)) { return DecimalType.valueOf(transformedResponse); } else { return StringType.valueOf(transformedResponse); } } catch (Exception e) { logger.debug("Couldn't create state of type '{}' for value '{}'", itemType, transformedResponse); return StringType.valueOf(transformedResponse); } }
Source:
<code>public Fragment getItem(int pos) { CourseComponent unit = getUnit(pos); CourseUnitFragment unitFragment; if (unit instanceof VideoBlockModel) { unitFragment = CourseUnitVideoFragment.newInstance((VideoBlockModel) unit); } else if (!unit.isMultiDevice()) { unitFragment = CourseUnitMobileNotSupportedFragment.newInstance(unit); } else if (unit.getType() != BlockType.VIDEO && unit.getType() != BlockType.HTML && unit.getType() != BlockType.OTHERS && unit.getType() != BlockType.DISCUSSION && unit.getType() != BlockType.PROBLEM) { unitFragment = CourseUnitEmptyFragment.newInstance(unit); } else if (unit instanceof HtmlBlockModel) { if (!NetworkUtil.isConnected(CourseUnitNavigationActivity.this)) { <START> unitFragment = CourseUnitNotAvailableFragment.newInstance(unit); <END> } else { unitFragment = CourseUnitWebviewFragment.newInstance((HtmlBlockModel) unit); } } else { unitFragment = CourseUnitMobileNotSupportedFragment.newInstance(unit); } unitFragment.setHasComponentCallback(CourseUnitNavigationActivity.this); return unitFragment; }</code><technical_language>Instead of creating displaying a separate fragment in case of non-connectivity, error message displayed CourseUnitWebviewFragment itself. This is more needed performing automatic reloading connectivity restoration, is task of fragment is out of scope here. In order receive connectivity events Fragment, implement NetworkObserver register for events Activity, done CourseListTabFragment, subscribe events (which is pattern use; NetworkObserver ultimately removed)</technical_language>

Target:
public Fragment getItem(int pos) { CourseComponent unit = getUnit(pos); CourseUnitFragment unitFragment; if (unit instanceof VideoBlockModel) { unitFragment = CourseUnitVideoFragment.newInstance((VideoBlockModel) unit); } else if (!unit.isMultiDevice()) { unitFragment = CourseUnitMobileNotSupportedFragment.newInstance(unit); } else if (unit.getType() != BlockType.VIDEO && unit.getType() != BlockType.HTML && unit.getType() != BlockType.OTHERS && unit.getType() != BlockType.DISCUSSION && unit.getType() != BlockType.PROBLEM) { unitFragment = CourseUnitEmptyFragment.newInstance(unit); } else if (unit instanceof HtmlBlockModel) { unitFragment = CourseUnitWebviewFragment.newInstance((HtmlBlockModel) unit); } else { unitFragment = CourseUnitMobileNotSupportedFragment.newInstance(unit); } unitFragment.setHasComponentCallback(CourseUnitNavigationActivity.this); return unitFragment; }
Source:
<code>Map<String, String> processJsonInputs(List<CompilerInput> inputsToProcess) { RewriteJsonToModule rewriteJson = new RewriteJsonToModule(this); for (CompilerInput input : inputsToProcess) { if (!input.getSourceFile().getOriginalPath().endsWith(".json")) { continue; } input.setCompiler(this); try { input.getSourceFile().setCode("(" + input.getSourceFile().getCode() + ")"); <START> } catch (Exception e) { <END> continue; } Node root = input.getAstRoot(this); if (root == null) { continue; } rewriteJson.process(null, root); } return rewriteJson.getPackageJsonMainEntries(); }</code><technical_language>exceptions do expect exactly? is OK ignore them</technical_language>

Target:
Map<String, String> processJsonInputs(List<CompilerInput> inputsToProcess) { RewriteJsonToModule rewriteJson = new RewriteJsonToModule(this); for (CompilerInput input : inputsToProcess) { if (!input.getSourceFile().getOriginalPath().endsWith(".json")) { continue; } input.setCompiler(this); try { input.getSourceFile().setCode("(" + input.getSourceFile().getCode() + ")"); } catch (IOException e) { this.getErrorManager().report(CheckLevel.ERROR, JSError.make(AbstractCompiler.READ_ERROR, input.getSourceFile().getOriginalPath())); continue; } Node root = input.getAstRoot(this); rewriteJson.process(null, root); } return rewriteJson.getPackageJsonMainEntries(); }
Source:
<code>public List<FeatureDetails> getAllFeatures() { <START> List<FeatureDetails> features = new ArrayList<FeatureDetails>(); <END> try { for (Feature feature : featuresService.listFeatures()) { if (isPermittedToViewFeature(feature.getName())) { features.add(getFeatureView(feature)); } } } catch (Exception ex) { LOGGER.warn("Could not obtain all features.", ex); } return features; }</code><technical_language>add type in <>. Static analysis complain</technical_language>

Target:
public List<FeatureDetails> getAllFeatures() { List<FeatureDetails> features = new ArrayList<>(); try { for (Feature feature : featuresService.listFeatures()) { if (isPermittedToViewFeature(feature.getName())) { features.add(getFeatureView(feature)); } } } catch (Exception ex) { LOGGER.warn("Could not obtain all features.", ex); } return features; }
Source:
<code>public static List<Entity> generateBAForNova(AtBScenario scenario, List<Entity> starUnits, String factionCode, int skill, int quality, Campaign campaign) { List<Entity> transportedUnits = new ArrayList<>(); if(!Faction.getFaction(factionCode).isClan() && (starUnits.size() != 5)) { return transportedUnits; } int roll = Compute.d6(2); int novaTarget = 8; if (factionCode.equals("CHH") || factionCode.equals("CSL")) { novaTarget = 6; } else if (factionCode.equals("CBS")) { novaTarget = 13; } if(roll < novaTarget) { return transportedUnits; } Entity actualTransport = null; <START> for(Entity transport : starUnits) { <END> if(transport instanceof Mech && transport.isOmni()) { if((actualTransport == null) || (actualTransport.getWalkMP() < transport.getWalkMP())) { actualTransport = transport; } } } if(actualTransport == null) { return transportedUnits; } UnitGeneratorParameters params = new UnitGeneratorParameters(); params.setFaction(factionCode); params.setQuality(quality); params.setYear(campaign.getGameYear()); params.addMissionRole(MissionRole.MECHANIZED_BA); params.setWeightClass(UNIT_WEIGHT_UNSPECIFIED); Entity transportedUnit = generateTransportedBAUnit(params, IUnitGenerator.NO_WEIGHT_LIMIT, skill, campaign); transportedUnit.setDeployRound(actualTransport.getDeployRound()); scenario.addTransportRelationship(actualTransport.getExternalIdAsString(), transportedUnit.getExternalIdAsString()); transportedUnits.add(transportedUnit); return transportedUnits; }</code><technical_language>picking slowest assuming heaviest</technical_language>

Target:
public static List<Entity> generateBAForNova(AtBScenario scenario, List<Entity> starUnits, String factionCode, int skill, int quality, Campaign campaign) { List<Entity> transportedUnits = new ArrayList<>(); if(!Faction.getFaction(factionCode).isClan() && (starUnits.size() != 5)) { return transportedUnits; } int roll = Compute.d6(2); int novaTarget = 8; if (factionCode.equals("CHH") || factionCode.equals("CSL")) { novaTarget = 6; } else if (factionCode.equals("CBS")) { novaTarget = 13; } if(roll < novaTarget) { return transportedUnits; } Entity actualTransport = null; for(Entity transport : starUnits) { if(transport instanceof Mech && transport.isOmni()) { if((actualTransport == null) || (actualTransport.getWalkMP() < transport.getWalkMP())) { actualTransport = transport; } } } if(actualTransport == null) { return transportedUnits; } UnitGeneratorParameters params = new UnitGeneratorParameters(); params.setFaction(factionCode); params.setQuality(quality); params.setYear(campaign.getGameYear()); params.addMissionRole(MissionRole.MECHANIZED_BA); params.setWeightClass(UNIT_WEIGHT_UNSPECIFIED); Entity transportedUnit = generateTransportedBAUnit(params, IUnitGenerator.NO_WEIGHT_LIMIT, skill, campaign); if(transportedUnit == null) { return transportedUnits; } transportedUnit.setDeployRound(actualTransport.getDeployRound()); scenario.addTransportRelationship(actualTransport.getExternalIdAsString(), transportedUnit.getExternalIdAsString()); transportedUnits.add(transportedUnit); return transportedUnits; }