auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code><START> public long getResultSize() { <END> try { return searchQuery.executeCount(); } catch (QueryExecutionRequestException | ArithmeticException e) { throw new IllegalStateException( e ); } catch (TypeMismatchException e) { throw new IllegalArgumentException( e ); } catch (HibernateException he) { throw getExceptionConverter().convert( he ); } }</code><technical_language>move this method next doHibernateSearchList? This class is a bit hard read due methods, extra care related methods together... Sorry, I do :/</technical_language>

Target:
public long getResultSize() { try { return searchQuery.executeCount(); } catch (QueryExecutionRequestException e) { throw new IllegalStateException( e ); } catch (TypeMismatchException e) { throw new IllegalArgumentException( e ); } catch (HibernateException he) { throw getExceptionConverter().convert( he ); } }
Source:
<code>private void showSoftKeyboard() { InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); <START> imm.toggleSoftInput(InputMethodManager.SHOW_FORCED,InputMethodManager.HIDE_IMPLICIT_ONLY); <END> }</code><technical_language>I need commit if [SHOW_IMPLICIT](<LINK_0> instead of SHOW_FORCED. this flag soft keyboard auto-hides in case of activity change</technical_language>

Target:
private void showSoftKeyboard() { InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); imm.toggleSoftInput(InputMethodManager.SHOW_IMPLICIT,InputMethodManager.HIDE_IMPLICIT_ONLY); }
Source:
<code>private Map<String, String> removeSuffixEditFromKeys(Map<String, String> map) { <START> Map<String, String> result = new HashMap<>(); <END> for (Map.Entry<String, String> entry : map.entrySet()) { if (entry.getKey().endsWith(EDIT_FORM_ITEM_SUFFIX)) { result.put(entry.getKey().substring(0, entry.getKey().length() - EDIT_FORM_ITEM_SUFFIX.length()), entry.getValue()); } else { result.put(entry.getKey(), entry.getValue()); } } return result; }</code><technical_language>Replace Map<String, String> result = new HashMap<>(map.size());</technical_language>

Target:
private Map<String, String> removeSuffixEditFromKeys(Map<String, String> map) { Map<String, String> result = new HashMap<>(map.size()); for (Map.Entry<String, String> entry : map.entrySet()) { if (entry.getKey().endsWith(EDIT_FORM_ITEM_SUFFIX)) { result.put(entry.getKey().substring(0, entry.getKey().length() - EDIT_FORM_ITEM_SUFFIX.length()), entry.getValue()); } else { result.put(entry.getKey(), entry.getValue()); } } return result; }
Source:
<code>private String getLogInfoForTableRowAsHtml(){ StringBuilder str = new StringBuilder(); str.append("<tr class=\"log\">"); str.append("<td>" + this.receiver + "</td>"); str.append("<td>" + this.subject + "</td>"); str.append("<td>" + this.getTimeForDisplay() + "</td>"); str.append("</tr>"); str.append("<tr id=\"small\">"); str.append("<td colspan=\"3\">"); str.append("<ul class=\"list-group\">"); str.append("<li class=\"list-group-item list-group-item-info\">"); str.append("<input type=\"text\" value=\"" + this.getContent() + "\" class=\"form-control\""); <START> str.append(" readonly"); <END> str.append("</li>"); str.append("</ul> "); str.append("</td>"); str.append("</tr>"); str.append("<tr id=\"big\" style=\"display:none;\">"); str.append("<td colspan=\"3\">"); str.append("<div class=\"well\">"); str.append("<ul class=\"list-group\">"); str.append("<li class=\"list-group-item list-group-item-success\"><small>"); str.append(this.content + "</small>"); str.append("</li>"); str.append("</ul>"); str.append("</div>"); str.append("</td>"); str.append("</tr>"); return str.toString(); }</code><technical_language>I accidentally removed closing > well</technical_language>

Target:
private String getLogInfoForTableRowAsHtml(){ StringBuilder str = new StringBuilder(); str.append("<tr class=\"log\">"); str.append("<td>" + this.receiver + "</td>"); str.append("<td>" + this.subject + "</td>"); str.append("<td>" + this.getTimeForDisplay() + "</td>"); str.append("</tr>"); str.append("<tr id=\"small\">"); str.append("<td colspan=\"3\">"); str.append("<ul class=\"list-group\">"); str.append("<li class=\"list-group-item list-group-item-info\">"); str.append("<input type=\"text\" value=\"" + this.getContent() + "\" class=\"form-control\""); str.append(" readonly>"); str.append("</li>"); str.append("</ul> "); str.append("</td>"); str.append("</tr>"); str.append("<tr id=\"big\" style=\"display:none;\">"); str.append("<td colspan=\"3\">"); str.append("<div class=\"well\">"); str.append("<ul class=\"list-group\">"); str.append("<li class=\"list-group-item list-group-item-success\"><small>"); str.append(this.content + "</small>"); str.append("</li>"); str.append("</ul>"); str.append("</div>"); str.append("</td>"); str.append("</tr>"); return str.toString(); }
Source:
<code>public DoubleUiColumn( final List<HeaderMetaData> headerMetaData, final double width, final boolean isResizable, final boolean isVisible, final GuidedDecisionTablePresenter.Access access, final TextBoxDoubleSingletonDOMElementFactory factory ) { super( headerMetaData, new CellRenderer<Double, NumericDoubleTextBox, TextBoxDOMElement<Double, NumericDoubleTextBox>>( factory ) { @Override protected void doRenderCellContent( final Text t, final Double value, final GridBodyCellRenderContext context ) { <START> t.setText( value.toString() ); <END> } }, width, isResizable, isVisible, access, factory ); }</code><technical_language>Double.toString() a bit lower, line 63, ..Factory.convert(..) - unify</technical_language>

Target:
public DoubleUiColumn( final List<HeaderMetaData> headerMetaData, final double width, final boolean isResizable, final boolean isVisible, final GuidedDecisionTablePresenter.Access access, final TextBoxDoubleSingletonDOMElementFactory factory ) { super( headerMetaData, new CellRenderer<Double, NumericDoubleTextBox, TextBoxDOMElement<Double, NumericDoubleTextBox>>( factory ) { @Override protected void doRenderCellContent( final Text t, final Double value, final GridBodyCellRenderContext context ) { t.setText( ( (TextBoxDoubleSingletonDOMElementFactory) factory ).convert( value ) ); } }, width, isResizable, isVisible, access, factory ); }
Source:
<code>public Response waitForResponse(long timeout) throws InterruptedException { long before = System.currentTimeMillis(); long expired = timeout > 0 ? (before + timeout) : 0; synchronized (this) { while (this.response == null && !isCanceled() && !isTimedOut() && !isRejected()) { wait(timeout); long now = System.currentTimeMillis(); if (timeout > 0) { <START> timeout = expired - now; <END> if (0 >= timeout) { break; } } } Response r = this.response; this.response = null; return r; } }</code><technical_language>wrong original condition? IMHO assign a timeout parameter ..</technical_language>

Target:
public Response waitForResponse(long timeout) throws InterruptedException { long before = TimeUnit.NANOSECONDS.toMillis(System.nanoTime()); long expired = timeout > 0 ? (before + timeout) : 0; long leftTimeout = timeout; synchronized (this) { while (this.response == null && !isCanceled() && !isTimedOut() && !isRejected()) { wait(leftTimeout); long now = TimeUnit.NANOSECONDS.toMillis(System.nanoTime()); if (timeout > 0) { leftTimeout = expired - now; if (0 >= leftTimeout) { break; } } } System.currentTimeMillis(); Response r = this.response; this.response = null; return r; } }
Source:
<code>public String getMediaUrl(HostInfo hostInfo) { String pathforUrl = fileName.replaceAll(" ", "%20").replaceAll("'","%27"); <START> String credentials = hostInfo.getPassword().isEmpty() ? "" : <END> String.format("%s:%s@", hostInfo.getUsername(), hostInfo.getPassword()); String videoUrl = String.format("http://%s%s:%d/vfs/%s", credentials, hostInfo.getAddress(), hostInfo.getHttpPort(), pathforUrl); return videoUrl; }</code><technical_language>Generates a NPE password is set</technical_language>

Target:
public String getMediaUrl(HostInfo hostInfo) { String pathforUrl = fileName.replaceAll(" ", "%20").replaceAll("'","%27"); String credentials = (hostInfo.getPassword() == null || hostInfo.getPassword().isEmpty()) ? "" : String.format("%s:%s@", hostInfo.getUsername(), hostInfo.getPassword()); String videoUrl = String.format("http://%s%s:%d/vfs/%s", credentials, hostInfo.getAddress(), hostInfo.getHttpPort(), pathforUrl); return videoUrl; }
Source:
<code><START> private static GroupType buildProjectedGroupType( <END> GroupType originalType, List<Type> types) { return new GroupType(originalType.getRepetition(), originalType.getName(), types); }</code><technical_language>(minor suggestion) I this func projectLeafTypes combined more clear: private static GroupType buildProjectedGroupType(GroupType originalType, List<String> groupPaths, String currentPath) { .... } return null if of group fields get included</technical_language>

Target:
private static GroupType buildProjectedGroupType( GroupType originalType, List<Type> types) { if (types == null || types.isEmpty()) { return null; } return new GroupType(originalType.getRepetition(), originalType.getName(), types); }
Source:
<code>private void cleanup() { logger.info("Shutting down Terasology..."); shuttingDown = true; <START> changeStatus(StandardGameStatus.SHUTTING_DOWN); <END> Iterator<EngineSubsystem> iter = subsystems.descendingIterator(); while (iter.hasNext()) { EngineSubsystem subsystem = iter.next(); subsystem.shutdown(config); } config.save(); if (currentState != null) { currentState.dispose(); currentState = null; } }</code><technical_language>this line is redundant identical line end of mainLoop()</technical_language>

Target:
private void cleanup() { logger.info("Shutting down Terasology..."); changeStatus(StandardGameStatus.SHUTTING_DOWN); Iterator<EngineSubsystem> shutdownIter = subsystems.descendingIterator(); while (shutdownIter.hasNext()) { EngineSubsystem subsystem = shutdownIter.next(); subsystem.shutdown(config); } config.save(); if (currentState != null) { currentState.dispose(); currentState = null; } Iterator<EngineSubsystem> disposeIter = subsystems.descendingIterator(); while (disposeIter.hasNext()) { EngineSubsystem subsystem = disposeIter.next(); try { subsystem.dispose(); } catch (RuntimeException t) { logger.error("Unable to dispose subsystem {}", subsystem, t); } } }
Source:
<code>ConsumerSustainedConnection() { this.topicName = SustainedConnectionWorker.this.spec.topicName(); this.consumer = null; <START> this.consumerGroup = UUID.randomUUID().toString(); <END> this.activePartition = null; this.rand = new Random(); this.refreshRate = SustainedConnectionWorker.this.spec.refreshRateMs(); this.props = new Properties(); this.props.put(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, SustainedConnectionWorker.this.spec.bootstrapServers()); this.props.put(ConsumerConfig.GROUP_ID_CONFIG, this.consumerGroup); this.props.put(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, "latest"); this.props.put(ConsumerConfig.MAX_POLL_RECORDS_CONFIG, 1); this.props.put(ConsumerConfig.FETCH_MAX_BYTES_CONFIG, 1024); WorkerUtils.addConfigsToProperties( this.props, SustainedConnectionWorker.this.spec.commonClientConf(), SustainedConnectionWorker.this.spec.consumerConf()); }</code><technical_language>subscribe() functionality, need configure a consumer group. a null group default (<LINK_0></technical_language>

Target:
ConsumerSustainedConnection() { this.topicName = SustainedConnectionWorker.this.spec.topicName(); this.consumer = null; this.activePartition = null; this.rand = new Random(); this.refreshRate = SustainedConnectionWorker.this.spec.refreshRateMs(); this.props = new Properties(); this.props.put(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, SustainedConnectionWorker.this.spec.bootstrapServers()); this.props.put(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, "latest"); this.props.put(ConsumerConfig.MAX_POLL_RECORDS_CONFIG, 1); this.props.put(ConsumerConfig.FETCH_MAX_BYTES_CONFIG, 1024); WorkerUtils.addConfigsToProperties( this.props, SustainedConnectionWorker.this.spec.commonClientConf(), SustainedConnectionWorker.this.spec.consumerConf()); }
Source:
<code>public AuthenticationResult acquireTokenSilentSync(String resource, String clientId, <START> String userId) throws InterruptedException, ExecutionException { <END> Future<AuthenticationResult> futureResult = acquireTokenSilent(resource, clientId, userId, null); return futureResult.get(); }</code><technical_language>if this is a sync method expose exceptions related Future Tasks. catching exceptions throwing exception instead</technical_language>

Target:
public AuthenticationResult acquireTokenSilentSync(String resource, String clientId, String userId) { Future<AuthenticationResult> futureResult = acquireTokenSilent(resource, clientId, userId, null); try { return futureResult.get(); } catch (InterruptedException e) { convertExceptionForSync(e); } catch (ExecutionException e) { convertExceptionForSync(e); } return null; }
Source:
<code><START> public Long getEarliestSequenceNumber(StreamPartition<Integer> partition) <END> { seekToEarliest(Collections.singleton(partition)); return consumer.position(new TopicPartition(partition.getStream(), partition.getPartitionId())); }</code><technical_language>getLatestSequenceNumber - save current position restore</technical_language>

Target:
public Long getEarliestSequenceNumber(StreamPartition<Integer> partition) { Long currPos = consumer.position(new TopicPartition(partition.getStream(), partition.getPartitionId())); seekToEarliest(Collections.singleton(partition)); Long nextPos = consumer.position(new TopicPartition(partition.getStream(), partition.getPartitionId())); seek(partition, currPos); return nextPos; }
Source:
<code>public void setUp() throws Exception { omMetadataManager = initializeNewOmMetadataManager(); File tempDir = temporaryFolder.newFolder(); AbstractSqlDatabaseTest.DataSourceConfigurationProvider configurationProvider = new AbstractSqlDatabaseTest.DataSourceConfigurationProvider(tempDir); JooqPersistenceModule jooqPersistenceModule = new JooqPersistenceModule(configurationProvider); <START> injector = Guice.createInjector(jooqPersistenceModule, <END> new AbstractModule() { @Override protected void configure() { try { bind(DataSourceConfiguration.class) .toProvider(configurationProvider); bind(OzoneConfiguration.class).toInstance( getTestOzoneConfiguration()); reconOMMetadataManager = getTestMetadataManager(omMetadataManager); bind(ReconOMMetadataManager.class) .toInstance(reconOMMetadataManager); ozoneManagerServiceProvider = new OzoneManagerServiceProviderImpl( getTestOzoneConfiguration()); bind(OzoneManagerServiceProvider.class) .toInstance(ozoneManagerServiceProvider); bind(DBStore.class).toProvider(ReconContainerDBProvider.class). in(Singleton.class); bind(ContainerDBServiceProvider.class).to( ContainerDBServiceProviderImpl.class).in(Singleton.class); } catch (IOException e) { Assert.fail(); } } }); if (!setUpIsDone) { DSL.using(new DefaultConfiguration().set( injector.getInstance(DataSource.class))); containerDbServiceProvider = injector.getInstance( ContainerDBServiceProvider.class); StatsSchemaDefinition schemaDefinition = getInjector().getInstance( StatsSchemaDefinition.class); schemaDefinition.initializeSchema(); setUpIsDone = true; } containerDbServiceProvider = injector.getInstance( ContainerDBServiceProvider.class); }</code><technical_language>this code duplicated? add interface default impl is support in Java 8? a static helper somewhere</technical_language>

Target:
public void setUp() throws Exception { if (!setUpIsDone) { initializeInjector(); DSL.using(new DefaultConfiguration().set( injector.getInstance(DataSource.class))); containerDbServiceProvider = injector.getInstance( ContainerDBServiceProvider.class); StatsSchemaDefinition schemaDefinition = getInjector().getInstance( StatsSchemaDefinition.class); schemaDefinition.initializeSchema(); setUpIsDone = true; } containerDbServiceProvider = injector.getInstance( ContainerDBServiceProvider.class); }
Source:
<code>public void discoverNetworks() { <START> ArrayList<Provider<?>> <END> items = new ArrayList<Provider<?>>(); items.add(provider); getProviders().setItems(items); getProviders().setSelectedItem(provider); }</code><technical_language>Please change left side Collection</technical_language>

Target:
public void discoverNetworks() { Collection<Provider<?>> items = new ArrayList<Provider<?>>(); items.add(provider); getProviders().setItems(items); getProviders().setSelectedItem(provider); }
Source:
<code>protected ServerSocket createServerSocket(int pPort, int backlog, InetAddress addr) throws IOException { SSLServerSocketFactory serverSocketFactory = null; try { final SSLContext context = SSLContext.getInstance("TLS"); context.init(ServerKeyStoreManager.getInstance().getKeyManagerFactory().getKeyManagers(), null, null); serverSocketFactory = context.getServerSocketFactory(); } catch (final NoSuchAlgorithmException exception) { shutdown(serverSocketFactory, exception); } catch (final KeyManagementException exception) { shutdown(serverSocketFactory, exception); } catch (final ServerKeyStoreException exception) { shutdown(serverSocketFactory, exception); } <START> return disableSSLv3AndReturn(serverSocketFactory.createServerSocket(pPort, backlog, addr)); <END> }</code><technical_language>catch case if secure protocol is left. This force server a secure protocol. care client wants more</technical_language>

Target:
protected ServerSocket createServerSocket(int pPort, int backlog, InetAddress addr) throws IOException { SSLServerSocketFactory serverSocketFactory = null; try { final SSLContext context = SSLContext.getInstance("TLS"); context.init(ServerKeyStoreManager.getInstance().getKeyManagerFactory().getKeyManagers(), null, null); serverSocketFactory = context.getServerSocketFactory(); } catch (final NoSuchAlgorithmException exception) { shutdown(serverSocketFactory, exception); } catch (final KeyManagementException exception) { shutdown(serverSocketFactory, exception); } catch (final ServerKeyStoreException exception) { shutdown(serverSocketFactory, exception); } try { return disableSSLv3AndReturn(serverSocketFactory.createServerSocket(pPort, backlog, addr)); } catch (final FatalSocketException ex) { shutdown(serverSocketFactory, ex); throw new IOException(ex.getMessage()); } }
Source:
<code>public void init() throws CarbonToolsIntegrationTestException, IOException, XPathExpressionException { <START> context = <END> new AutomationContext("CARBON", "carbon002", ContextXpathConstants.SUPER_TENANT, ContextXpathConstants.ADMIN); authenticatorClient = new LoginLogoutUtil(context); carbonHome = CarbonCommandToolsUtil.getCarbonHome(context); log.info("replacing the master-datasources.xml file"); File sourceFile = new File(TestConfigurationProvider.getResourceLocation() + File.separator + "artifacts" + File.separator + "CARBON" + File.separator + "carbontools" + File.separator + "master-datasources.xml"); File targetFile = new File(carbonHome + File.separator + "repository" + File.separator + "conf" + File.separator + "datasources" + File.separator + "master-datasources.xml"); copyFile(sourceFile,targetFile); }</code><technical_language>rename automationContext</technical_language>

Target:
public void init() throws CarbonToolsIntegrationTestException, XPathExpressionException, MalformedURLException, AxisFault { context = new AutomationContext("CARBON", "carbon002", ContextXpathConstants.SUPER_TENANT, ContextXpathConstants.ADMIN); authenticatorClient = new LoginLogoutUtil(context); carbonHome = CarbonCommandToolsUtil.getCarbonHome(context); log.info("replacing the master-datasources.xml file"); File sourceFile = new File(TestConfigurationProvider.getResourceLocation() + File.separator + "artifacts" + File.separator + "CARBON" + File.separator + "carbontools" + File.separator + "master-datasources.xml"); File targetFile = new File(carbonHome + File.separator + "repository" + File.separator + "conf" + File.separator + "datasources" + File.separator + "master-datasources.xml"); super.copyFolder(sourceFile, targetFile); }
Source:
<code><START> public static EventSourceType getEventSourceType(Bundle bundle) { <END> if(bundle == null) { return null; } if(bundle.containsKey(CAMPAIGN.getEventSourceKeyPrefix()+CAMPAIGN.getEventSourceIdAttributeKey())) { return CAMPAIGN; } else { return JOURNEY; } }</code><technical_language>audit of methods -- need public? private default (pakage-local) access</technical_language>

Target:
static EventSourceType getEventSourceType(Bundle bundle) { if (bundle == null) { return UNKNOWN; } String campaignKey = CAMPAIGN.getEventSourceKeyPrefix() + CAMPAIGN.getEventSourceIdAttributeKey(); if (bundle.containsKey(campaignKey)) { return CAMPAIGN; } else if (bundle.containsKey(PINPOINT_ATTRIBUTE_KEY) && bundle.getString(PINPOINT_ATTRIBUTE_KEY).matches(".*\"journey_id\".*")) { return JOURNEY; } else { return UNKNOWN; } }
Source:
<code>public void testUserMessageSerdeException() { IntermediateMessageSerde imserde = new IntermediateMessageSerde(new ObjectSerde()); <START> IntermediateMessageSerde imserde2 = new IntermediateMessageSerde(new JsonSerdeV2<>()); <END> String msg = "this is a test message"; TestUserMessage userMessage = new TestUserMessage(msg, 0, System.currentTimeMillis()); byte[] bytes = imserde.toBytes(userMessage); imserde2.fromBytes(bytes); }</code><technical_language>Instead of depending JsonSerdeV2 for this test, consider creating a mock Serde do need. In general, mocks is helpful rely a specific implementation of is subject change in future. For example, if JsonSerdeV2 changed stop throwing exception for kinds of data, if changed throw a kind of exception SamzaException</technical_language>

Target:
public void testUserMessageSerdeException() { Serde<?> mockUserMessageSerde = mock(Serde.class); when(mockUserMessageSerde.fromBytes(anyObject())).then(new Answer<Object>() { @Override public Object answer(InvocationOnMock invocation) throws Throwable { byte[] bytes = invocation.getArgumentAt(0, byte[].class); if (Arrays.equals(bytes, new byte[]{1, 2})) { throw new IllegalArgumentException("User message serde failed to deserialize this message."); } else { Assert.fail(); return null; } } }); IntermediateMessageSerde imserde = new IntermediateMessageSerde(mockUserMessageSerde); byte[] bytes = new byte[]{0, 1, 2}; imserde.fromBytes(bytes); }
Source:
<code>public String getAnswerString() { <START> if (answer == -1) { <END> return "Invalid response"; } return Integer.toString(answer); }</code><technical_language>Extract -1 a constant, private static final int CONST_INVALID_RESPONSE = -1;</technical_language>

Target:
public String getAnswerString() { return Integer.toString(answer); }
Source:
<code>public void should_load_profile_in_sonar_lint_context() { ProfileDefinition sonarWay = new JavaSonarWayProfile(ruleFinder(true)); ValidationMessages validation = ValidationMessages.create(); RulesProfile profile = sonarWay.createProfile(validation); assertThat(profile.getActiveRules()).onProperty("repositoryKey").containsOnly(CheckList.REPOSITORY_KEY); <START> assertThat(profile.getActiveRulesByRepository("common-abap")).isEmpty(); <END> assertThat(profile.getActiveRulesByRepository(CheckList.REPOSITORY_KEY).size()).isGreaterThanOrEqualTo(269); assertThat(profile.getName()).isEqualTo("Sonar way"); assertThat(validation.hasErrors()).isFalse(); assertThat(profile.getActiveRulesByRepository(CheckList.REPOSITORY_KEY).get(0).getSeverity()).isSameAs(RulePriority.MINOR); }</code><technical_language>common-java</technical_language>

Target:
public void should_load_profile_in_sonar_lint_context() { ProfileDefinition sonarWay = new JavaSonarWayProfile(ruleFinder(true)); ValidationMessages validation = ValidationMessages.create(); RulesProfile profile = sonarWay.createProfile(validation); assertThat(profile.getActiveRules()).onProperty("repositoryKey").containsOnly(CheckList.REPOSITORY_KEY); assertThat(profile.getActiveRulesByRepository("common-java")).isEmpty(); assertThat(profile.getActiveRulesByRepository(CheckList.REPOSITORY_KEY).size()).isGreaterThanOrEqualTo(269); assertThat(profile.getName()).isEqualTo("Sonar way"); assertThat(validation.hasErrors()).isFalse(); assertThat(profile.getActiveRulesByRepository(CheckList.REPOSITORY_KEY).get(0).getSeverity()).isSameAs(RulePriority.MINOR); }
Source:
<code>public void addAll(Collection<? extends RMEvent> toAdd) { for (RMEvent rmEvent : toAdd) { events.add(rmEvent); <START> } <END> latestCounter.set(Math.max(latestCounter.get(), findLargestCounter(events.getSortedItems()))); }</code><technical_language>replace toAdd.forEach(rmEvent -> events.add(rmEvent));</technical_language>

Target:
public void addAll(Collection<? extends RMEvent> toAdd) { toAdd.forEach(rmEvent -> events.add(rmEvent)); latestCounter.set(Math.max(latestCounter.get(), findLargestCounter(events.getSortedItems()))); }
Source:
<code>public void testENG11935() throws Exception { Client client = getClient(); client.callProcedure("ENG11935.insert", "0", "abc", 1486148453, "def", "ghi", "jkl", "mno0", 35094, 30847, 27285, 36335, 59247, 50750, "0"); client.callProcedure("ENG11935.insert", "0", "abc", 1486148453, "def", "ghi", "jkl", "mno1", 35094, 30847, 27285, 36335, 59247, 50750, "1"); <START> client.callProcedure("@AdHoc", "DELETE FROM ENG11935 WHERE VAR1=0 AND PRIMKEY=1;"); <END> }</code><technical_language>good ensure view contents correct here</technical_language>

Target:
public void testENG11935() throws Exception { if (isHSQL()) { return; } Client client = getClient(); client.callProcedure("ENG11935.insert", "0", "abc", 1486148453, "def", "ghi", "jkl", "mno0", 35094, 30847, 27285, 36335, 59247, 50750, "0"); client.callProcedure("ENG11935.insert", "0", "abc", 1486148453, "def", "ghi", "jkl", "mno1", 35094, 30847, 27285, 36335, 59247, 50750, "1"); TimestampType timestamp = new TimestampType("1970-01-18 04:50:00.000000"); VoltTable vt = client.callProcedure("@AdHoc", "SELECT * FROM V_ENG11935;").getResults()[0]; Object[][] expectedAnswer = new Object[][] { {"0", "abc", "def", "ghi", "jkl", timestamp, 1486200, 2, "mno1", new BigDecimal("1403760.000000000000"), new BigDecimal("1233880.000000000000"), 1091400, 1453400, 64662175800L, 73760050000L} }; assertContentOfTable(expectedAnswer, vt); client.callProcedure("@AdHoc", "DELETE FROM ENG11935 WHERE VAR1 = '0' AND PRIMKEY = '1';"); vt = client.callProcedure("@AdHoc", "SELECT * FROM V_ENG11935;").getResults()[0]; expectedAnswer = new Object[][] { {"0", "abc", "def", "ghi", "jkl", timestamp, 1486200, 1, "mno0", new BigDecimal("701880.000000000000"), new BigDecimal("616940.000000000000"), 545700, 726700, 32331087900L, 36880025000L} }; assertContentOfTable(expectedAnswer, vt); }
Source:
<code>public String visitCall(CallExpression node, Void context) { if (standardFunctionResolution.isArithmeticFunction(node.getFunctionHandle()) || standardFunctionResolution.isComparisonFunction(node.getFunctionHandle())) { String operation = functionManager.getFunctionMetadata(node.getFunctionHandle()).getOperatorType().get().getOperator(); return String.join(" " + operation + " ", formatRowExpressions(node.getArguments()).stream().map(e -> "(" + e + ")").collect(toList())); } <START> else { <END> return node.getDisplayName() + "(" + String.join(", ", formatRowExpressions(node.getArguments())) + ")"; } }</code><technical_language>else is redundant</technical_language>

Target:
public String visitCall(CallExpression node, Void context) { if (standardFunctionResolution.isArithmeticFunction(node.getFunctionHandle()) || standardFunctionResolution.isComparisonFunction(node.getFunctionHandle())) { String operation = functionMetadataManager.getFunctionMetadata(node.getFunctionHandle()).getOperatorType().get().getOperator(); return String.join(" " + operation + " ", formatRowExpressions(node.getArguments()).stream().map(e -> "(" + e + ")").collect(toImmutableList())); } else if (standardFunctionResolution.isCastFunction(node.getFunctionHandle())) { return String.format("CAST(%s AS %s)", formatRowExpression(node.getArguments().get(0)), node.getType().getDisplayName()); } else if (standardFunctionResolution.isNegateFunction(node.getFunctionHandle())) { return "-(" + formatRowExpression(node.getArguments().get(0)) + ")"; } else if (standardFunctionResolution.isSubscriptFunction(node.getFunctionHandle())) { return formatRowExpression(node.getArguments().get(0)) + "[" + formatRowExpression(node.getArguments().get(1)) + "]"; } else if (standardFunctionResolution.isBetweenFunction(node.getFunctionHandle())) { List<String> formattedExpresions = formatRowExpressions(node.getArguments()); return String.format("%s BETWEEN (%s) AND (%s)", formattedExpresions.get(0), formattedExpresions.get(1), formattedExpresions.get(2)); } return node.getDisplayName() + "(" + String.join(", ", formatRowExpressions(node.getArguments())) + ")"; }
Source:
<code>public Span getSpan(String tenantId, String id) { GetResponse response = client.getClient() .prepareGet(client.getIndex(tenantId), SPAN_TYPE, id) .setRouting(id) .execute() .actionGet(); Span span = null; if (!response.isSourceEmpty()) { try { span = deserialize(response.getSourceAsString(), Span.class); } catch (IOException ex) { <START> msgLog.errorFailedToParse(ex); <END> } } msgLog.tracef("Get span with id[%s] is: %s", id, span); return span; }</code><technical_language>Is this want? If get exception, returning null for a query a record exists, parsed</technical_language>

Target:
public Span getSpan(String tenantId, String id) { GetResponse response = null; try { response = client.getClient() .prepareGet(client.getIndex(tenantId), SPAN_TYPE, id) .setRouting(id) .execute() .actionGet(); } catch (IndexMissingException ex) { log.errorf("Missing span index %s", tenantId); return null; } Span span = null; if (!response.isSourceEmpty()) { try { span = deserialize(response.getSourceAsString(), Span.class); } catch (IOException ex) { log.errorFailedToParse(ex); throw new IllegalStateException("Failed to deserialize span", ex); } } log.tracef("Get span with id[%s] is: %s", id, span); return span; }
Source:
<code>private void getRunId(){ Boolean isAppModeBatch = new ApplicationConfig(appDesc.getConfig()).getAppMode() == ApplicationConfig.ApplicationMode.BATCH; if(coordinationUtils == null || !isAppModeBatch) { return; } runIdLock = coordinationUtils.getReadWriteLock(RUNID_LOCK_ID); if(runIdLock == null) { <START> LOG.warn("Processor failed to create the lock for run.id generation", uid); <END> return; } runIdAccess = coordinationUtils.getDataAccess(new LocalDistributedDataStateListener()); if(runIdAccess == null) { LOG.warn("Processor failed to create data access utils for run.id generation", uid); return; } try { DistributedReadWriteLock.AccessType lockAccess = runIdLock.lock(LOCK_TIMEOUT, LOCK_TIMEOUT_UNIT); if(lockAccess == DistributedReadWriteLock.AccessType.WRITE) { LOG.info("write lock acquired for run.id generation by Processor " + uid); runId = String.valueOf(System.currentTimeMillis()) + "-" + UUID.randomUUID().toString().substring(0, 8); LOG.info("The run id for this run is {}", runId); runIdAccess.writeData(RUNID_PATH,runId, new LocalDistributedDataWatcher()); runIdLock.unlock(); return; } else if(lockAccess == DistributedReadWriteLock.AccessType.READ) { LOG.info("read lock acquired for run.id by Processor " + uid); runId = (String) runIdAccess.readData(RUNID_PATH, new LocalDistributedDataWatcher()); runIdLock.unlock(); return; } else { String msg = String.format("Processor failed to get the lock for run.id", uid); throw new SamzaException(msg); } } catch (TimeoutException e) { String msg = String.format("Processor failed to get the lock for run.id generation", uid); throw new SamzaException(msg, e); } }</code><technical_language>find more specific info UID, uid is helpful</technical_language>

Target:
public Optional<String> getRunId() { return this.runId; }
Source:
<code>protected void createCacheManagers() throws Throwable { ConfigurationBuilder defaultClusteredCacheConfig = getDefaultClusteredCacheConfig(CacheMode.DIST_SYNC, false); defaultClusteredCacheConfig.encoding().key().mediaType(MediaType.APPLICATION_PROTOSTREAM_TYPE); defaultClusteredCacheConfig.encoding().value().mediaType(MediaType.APPLICATION_PROTOSTREAM_TYPE); ConfigurationBuilder cfgBuilder = hotRodCacheConfiguration(defaultClusteredCacheConfig); createHotRodServers(NUM_NODES, cfgBuilder); waitForClusterToForm(); RemoteCache<String, String> metadataCache = client(0).getCache(ProtobufMetadataManagerConstants.PROTOBUF_METADATA_CACHE_NAME); metadataCache.put("sample_bank_account/bank.proto", Util.getResourceAsString("/sample_bank_account/bank.proto", getClass().getClassLoader())); assertFalse(metadataCache.containsKey(ProtobufMetadataManagerConstants.ERRORS_KEY_SUFFIX)); for (int i = 0; i < NUM_NODES; i++) { server(i).addCacheEventFilterFactory("custom-filter-factory", new CustomCacheEventFilterFactory()); ProtobufMetadataManagerImpl metadataManager = ProtobufMetadataManagerImpl.getProtobufMetadataManager(server(i).getCacheManager()); <START> MarshallerRegistration.getMarshallers().forEach(metadataManager::registerMarshaller); <END> } MarshallerRegistration.registerMarshallers(ProtoStreamMarshaller.getSerializationContext(client(0))); remoteCache = client(0).getCache(); }</code><technical_language>I prefer ProtobufMetadataManagerImpl.getProtobufMetadataManager(EmbeddedCacheManager cacheManager) public. alternative is MarshallerRegistration.registerMarshallers(ProtobufMetadataManagerImpl.getSerializationContextInternal(server(i).getCacheManager())); require adding MarshallerRegistration.getMarshallers() anymore. in trouble MarshallerRegistration.registerMarshallers registers proto files</technical_language>

Target:
protected void createCacheManagers() throws Throwable { ConfigurationBuilder defaultClusteredCacheConfig = getDefaultClusteredCacheConfig(CacheMode.DIST_SYNC, false); defaultClusteredCacheConfig.encoding().key().mediaType(MediaType.APPLICATION_PROTOSTREAM_TYPE); defaultClusteredCacheConfig.encoding().value().mediaType(MediaType.APPLICATION_PROTOSTREAM_TYPE); ConfigurationBuilder cfgBuilder = hotRodCacheConfiguration(defaultClusteredCacheConfig); createHotRodServers(NUM_NODES, cfgBuilder); waitForClusterToForm(); for (int i = 0; i < NUM_NODES; i++) { server(i).addCacheEventFilterFactory("custom-filter-factory", new CustomCacheEventFilterFactory()); MarshallerRegistration.registerMarshallers(ProtobufMetadataManagerImpl.getSerializationContextInternal(server(i).getCacheManager())); assertFalse(client(i).getCache(PROTOBUF_METADATA_CACHE_NAME).containsKey(ERRORS_KEY_SUFFIX)); } MarshallerRegistration.registerMarshallers(ProtoStreamMarshaller.getSerializationContext(client(0))); remoteCache = client(0).getCache(); }
Source:
<code>Call<RbGallery> request(@NonNull Service service, @NonNull String title, @NonNull Callback cb, @NonNull String...types) { Call<RbGallery> call = service.fetch(title); call.enqueue(new retrofit2.Callback<RbGallery>() { @Override public void onResponse(@NonNull Call<RbGallery> call, @NonNull Response<RbGallery> response) { if (response.body() != null && response.body().success()) { cb.success(call, types.length == 0 ? response.body().getAllItems() : response.body().getItems(types)); } <START> else if (response.body().hasError()) { cb.failure(call, new Throwable(response.body().getErrorMessage())); } else <END> { cb.failure(call, new IOException("An unknown error occurred.")); } } @Override public void onFailure(@NonNull Call<RbGallery> call, @NonNull Throwable t) { cb.failure(call, t); } }); return call; }</code><technical_language>This is handled automatically</technical_language>

Target:
Call<RbGallery> request(@NonNull Service service, @NonNull String title, @NonNull Callback cb, @NonNull String...types) { Call<RbGallery> call = service.fetch(title); call.enqueue(new retrofit2.Callback<RbGallery>() { @Override public void onResponse(@NonNull Call<RbGallery> call, @NonNull Response<RbGallery> response) { if (response.body() != null && response.body().getAllItems() != null) { cb.success(call, types.length == 0 ? response.body().getAllItems() : response.body().getItems(types)); } else { cb.failure(call, new IOException("An unknown error occurred.")); } } @Override public void onFailure(@NonNull Call<RbGallery> call, @NonNull Throwable t) { cb.failure(call, t); } }); return call; }
Source:
<code>public ResponseEntity<ListWorkflowInstanceResponse> fetchWorkflowInstance( @ApiParam("Internal id for workflow instance") @PathVariable("id") int id, @RequestParam("include") @ApiParam(value = INCLUDE_PARAM_DESC, allowableValues = INCLUDE_PARAM_VALUES, allowMultiple = true) String include, @RequestParam("maxActions") @ApiParam("Maximum number of actions returned for each workflow instance") Long maxActions) { try { return ResponseEntity.ok().body(super.fetchWorkflowInstance(id, include, maxActions, this.workflowInstances, this.listWorkflowConverter)); <START> } catch (EmptyResultDataAccessException e) { <END> return ResponseEntity.notFound().build(); } }</code><technical_language>suppress warning (unused parameter e)</technical_language>

Target:
public ResponseEntity<ListWorkflowInstanceResponse> fetchWorkflowInstance( @ApiParam("Internal id for workflow instance") @PathVariable("id") int id, @RequestParam("include") @ApiParam(value = INCLUDE_PARAM_DESC, allowableValues = INCLUDE_PARAM_VALUES, allowMultiple = true) String include, @RequestParam("maxActions") @ApiParam("Maximum number of actions returned for each workflow instance") Long maxActions) { try { return ResponseEntity.ok().body(super.fetchWorkflowInstance(id, include, maxActions, this.workflowInstances, this.listWorkflowConverter)); } catch (@SuppressWarnings("unused") EmptyResultDataAccessException e) { return ResponseEntity.notFound().build(); } }
Source:
<code><START> static RuntimeException andLog(UnsupportedOperationException exception) { <END> StackTraceElement[] stackTrace = exception.getStackTrace(); StringBuilder buffer = new StringBuilder(255); buffer.append(stackTrace[1].getClassName()); buffer.append('.'); buffer.append(stackTrace[1].getMethodName()); buffer.append("()"); if (stackTrace[1].getLineNumber() > -1) { buffer.append(" line "); buffer.append(stackTrace[1].getLineNumber()); } buffer.append(" unexpectedly called unimplemented "); buffer.append(stackTrace[0].getMethodName()); buffer.append("()"); if (exception.getMessage() != null) { buffer.append(": "); buffer.append(exception.getMessage()); } logger.error(buffer.toString()); return exception; }</code><technical_language>return "UnsupportedOperationException</technical_language>

Target:
static UnsupportedOperationException andLog(UnsupportedOperationException exception) { StackTraceElement[] stackTrace = exception.getStackTrace(); StringBuilder buffer = new StringBuilder(255); buffer.append(stackTrace[1].getClassName()); buffer.append('.'); buffer.append(stackTrace[1].getMethodName()); buffer.append("()"); if (stackTrace[1].getLineNumber() > -1) { buffer.append(" line "); buffer.append(stackTrace[1].getLineNumber()); } buffer.append(" unexpectedly called unimplemented "); buffer.append(stackTrace[0].getMethodName()); buffer.append("()"); if (exception.getMessage() != null) { buffer.append(": "); buffer.append(exception.getMessage()); } logger.error(buffer.toString()); return exception; }
Source:
<code>KafkaConsumerProxy(Consumer<K, V> kafkaConsumer, String systemName, String clientId, KafkaSystemConsumer.KafkaConsumerMessageSink messageSink, KafkaSystemConsumerMetrics samzaConsumerMetrics, String metricName) { this.kafkaConsumer = kafkaConsumer; this.systemName = systemName; this.sink = messageSink; this.kafkaConsumerMetrics = samzaConsumerMetrics; this.metricName = metricName; this.clientId = clientId; this.kafkaConsumerMetrics.registerClientProxy(metricName); consumerPollThread = new Thread(createProxyThreadRunnable()); consumerPollThread.setDaemon(true); consumerPollThread.setName( "Samza KafkaConsumerProxy Poll " + consumerPollThread.getName() + " - " + systemName); <START> LOG.info("Creating KafkaConsumerProxy with sn={}, clientId={}, metricsName={}", systemName, clientId, metricName); <END> }</code><technical_language>"systemName="</technical_language>

Target:
KafkaConsumerProxy(Consumer<K, V> kafkaConsumer, String systemName, String clientId, KafkaSystemConsumer.KafkaConsumerMessageSink messageSink, KafkaSystemConsumerMetrics samzaConsumerMetrics, String metricName) { this.kafkaConsumer = kafkaConsumer; this.systemName = systemName; this.sink = messageSink; this.kafkaConsumerMetrics = samzaConsumerMetrics; this.metricName = metricName; this.clientId = clientId; this.kafkaConsumerMetrics.registerClientProxy(metricName); consumerPollThread = new Thread(createProxyThreadRunnable()); consumerPollThread.setDaemon(true); consumerPollThread.setName( "Samza KafkaConsumerProxy Poll " + consumerPollThread.getName() + " - " + systemName); LOG.info("Creating KafkaConsumerProxy with systeName={}, clientId={}, metricsName={}", systemName, clientId, metricName); }
Source:
<code>public Archive startArchive(String sessionId, ArchiveProperties properties) throws OpenTokException { if (sessionId == null || sessionId == "") { throw new InvalidArgumentException("Session not valid"); } Boolean hasResolution = properties != null && properties.resolution() != null && !properties.resolution().isEmpty(); if(properties != null && properties.outputMode().equals(Archive.OutputMode.INDIVIDUAL) && hasResolution) { <START> throw new InvalidArgumentException("Resolution must not be specified in individual output mode."); <END> } String archive = this.client.startArchive(sessionId, properties); try { return archiveReader.readValue(archive); } catch (Exception e) { throw new RequestException("Exception mapping json: " + e.getMessage()); } }</code><technical_language>please change text to: resolution for individual output mode</technical_language>

Target:
public Archive startArchive(String sessionId, ArchiveProperties properties) throws OpenTokException { if (sessionId == null || sessionId == "") { throw new InvalidArgumentException("Session not valid"); } Boolean hasResolution = properties != null && properties.resolution() != null && !properties.resolution().isEmpty(); if(properties != null && properties.outputMode().equals(Archive.OutputMode.INDIVIDUAL) && hasResolution) { throw new InvalidArgumentException("The resolution cannot be specified for individual output mode."); } String archive = this.client.startArchive(sessionId, properties); try { return archiveReader.readValue(archive); } catch (Exception e) { throw new RequestException("Exception mapping json: " + e.getMessage()); } }
Source:
<code>protected void runAutonomous() throws InterruptedException, AutonomousModeOverException { drive(toteDistance.get()); <START> QuasarHelios.autoLoader.set(true); <END> drive(autoZoneDistance.get()); drive(-returnDistance.get()); }</code><technical_language>While I this done, do want a wait finishes loading</technical_language>

Target:
protected void runAutonomous() throws InterruptedException, AutonomousModeOverException { collectTote(); turn(90); drive(autoZoneDistance.get()); drive(-returnDistance.get()); }
Source:
<code>public ExternalDocumentation getExternalDocs(ObjectNode node, String location, ParseResult result) { ExternalDocumentation externalDocs = null; if (node != null) { externalDocs = new ExternalDocumentation(); Set<String> keys = getKeys(node); <START> String value = getString("description", node, false, location, result); <END> externalDocs.description(value); value = getString("url", node, true, location, result); externalDocs.url(value); externalDocs.setExtensions(new LinkedHashMap<>()); for (String key : keys) { if (key.startsWith("x-")) { externalDocs.getExtensions().put(key, Json.mapper().convertValue(node.get(key), Object.class)); } else if (!EXTERNAL_DOCS_KEYS.contains(key)) { result.extra(location + ".externalDocs", key, node.get(key)); } } } return externalDocs; }</code><technical_language>do a StringUtils.isNotBlank(...) check setting</technical_language>

Target:
public ExternalDocumentation getExternalDocs(ObjectNode node, String location, ParseResult result) { ExternalDocumentation externalDocs = null; if (node != null) { externalDocs = new ExternalDocumentation(); String value = getString("description", node, false, location, result); if(StringUtils.isNotBlank(value)) { externalDocs.description(value); } value = getString("url", node, true, location, result); if(StringUtils.isNotBlank(value)) { externalDocs.url(value); } Map <String,Object> extensions = getExtensions(node,location,result); if(extensions != null && extensions.size() > 0) { externalDocs.setExtensions(extensions); } } return externalDocs; }
Source:
<code>private static SBIIndex readIndex(final InputStream in) { <START> BinaryCodec binaryCodec = new BinaryCodec(in); <END> Header header = readHeader(binaryCodec); long numOffsetsLong = binaryCodec.readLong(); if (numOffsetsLong > Integer.MAX_VALUE) { throw new RuntimeException(String.format("Cannot read SBI with more than %s offsets.", Integer.MAX_VALUE)); } int numOffsets = (int) numOffsetsLong; long[] virtualOffsets = new long[numOffsets]; long prev = -1; for (int i = 0; i < numOffsets; i++) { long cur = binaryCodec.readLong(); if (prev > cur) { throw new RuntimeException(String.format( "Invalid SBI; offsets not in order: %#x > %#x", prev, cur)); } virtualOffsets[i] = cur; prev = cur; } return new SBIIndex(header, virtualOffsets); }</code><technical_language>final</technical_language>

Target:
private static SBIIndex readIndex(final InputStream in) { final BinaryCodec binaryCodec = new BinaryCodec(in); final Header header = readHeader(binaryCodec); final long numOffsetsLong = binaryCodec.readLong(); if (numOffsetsLong > Integer.MAX_VALUE) { throw new RuntimeException(String.format("Cannot read SBI with more than %s offsets.", Integer.MAX_VALUE)); } final int numOffsets = (int) numOffsetsLong; final long[] virtualOffsets = new long[numOffsets]; long prev = -1; for (int i = 0; i < numOffsets; i++) { final long cur = binaryCodec.readLong(); if (prev > cur) { throw new RuntimeException(String.format( "Invalid SBI; offsets not in order: %#x > %#x", prev, cur)); } virtualOffsets[i] = cur; prev = cur; } return new SBIIndex(header, virtualOffsets); }
Source:
<code>public int read(int offset, int[] positions, int positionCount) throws IOException { checkState(!valuesInUse, "BlockLease hasn't been closed yet"); if (!rowGroupOpen) { openRowGroup(); } allNulls = false; if (outputRequired && nullsAllowed && presentStream != null) { nulls = ensureCapacity(nulls, positionCount); } if (!nullsAllowed || !nonNullsAllowed) { outputPositions = ensureCapacity(outputPositions, positionCount); <START> } <END> else { outputPositions = positions; outputPositionsReadOnly = true; } if (presentStream == null) { readNoNulls(offset, positions, positionCount); } else if (keyCount == 0) { readAllNulls(offset, positions, positionCount); } else { readWithNulls(offset, positions, positionCount); } localMemoryContext.setBytes(getRetainedSizeInBytes()); return outputPositionCount; }</code><technical_language>This is saying: If output data, enough capacity. If aren't, filtering reading values. Is right? a confused business logic</technical_language>

Target:
public int read(int offset, int[] positions, int positionCount) throws IOException { checkState(!valuesInUse, "BlockLease hasn't been closed yet"); if (!rowGroupOpen) { openRowGroup(); } allNulls = false; if (outputRequired && nullsAllowed && presentStream != null) { nulls = ensureCapacity(nulls, positionCount); } if (!nullsAllowed || !nonNullsAllowed) { outputPositions = ensureCapacity(outputPositions, positionCount); } else { outputPositions = positions; outputPositionsReadOnly = true; } if (presentStream != null && keyCount == 0) { readAllNulls(positions, positionCount); } else { readNotAllNulls(offset, positions, positionCount); } localMemoryContext.setBytes(getRetainedSizeInBytes()); return outputPositionCount; }
Source:
<code>public void testLoadingEmptyMetacards() { cmd = new SearchFormsManageCommand() { @Override protected List<Metacard> retrieveSystemMetacards() { return Collections.emptyList(); } <START> }; <END> cmd.massDeletion = true; cmd.executeWithSubject(); assertThat(this.getOutput(), containsString("No system forms exist.")); }</code><technical_language>unfortunate assertions based output</technical_language>

Target:
public void testLoadingEmptyMetacards() { when(endpointUtil.getMetacardListByTag(SYSTEM_TEMPLATE)).thenReturn(Collections.emptyList()); cmd.massDeletion = true; cmd.executeWithSubject(); assertThat(this.getOutput(), containsString("No system forms exist.")); }