auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void testSetAclRecursive() throws Exception { final ZooKeeper zk = createClient(); final byte[] EMPTY = new byte[0]; zk.setData("/", EMPTY, -1); zk.create("/a", EMPTY, Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT); zk.create("/a/b", EMPTY, Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT); zk.create("/a/b/c", EMPTY, Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT); zk.create("/a/d", EMPTY, Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT); ZooKeeperMain zkMain = new ZooKeeperMain(zk); String setAclCommand = "setAcl -R /a world:anyone:r"; zkMain.cl.parseCommand(setAclCommand); Assert.assertFalse(zkMain.processZKCmd(zkMain.cl)); <START> Assert.assertEquals(zk.getACL("/a", new Stat()), Ids.READ_ACL_UNSAFE); <END> Assert.assertEquals(zk.getACL("/a/b", new Stat()), Ids.READ_ACL_UNSAFE); Assert.assertEquals(zk.getACL("/a/b/c", new Stat()), Ids.READ_ACL_UNSAFE); Assert.assertEquals(zk.getACL("/a/d", new Stat()), Ids.READ_ACL_UNSAFE); }</code><technical_language>Parameter order other around, right? Expected first, actual second. A short description useful</technical_language>

Target:
public void testSetAclRecursive() throws Exception { final ZooKeeper zk = createClient(); final byte[] EMPTY = new byte[0]; zk.setData("/", EMPTY, -1); zk.create("/a", EMPTY, Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT); zk.create("/a/b", EMPTY, Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT); zk.create("/a/b/c", EMPTY, Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT); zk.create("/a/d", EMPTY, Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT); zk.create("/e", EMPTY, Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT); ZooKeeperMain zkMain = new ZooKeeperMain(zk); String setAclCommand = "setAcl -R /a world:anyone:r"; zkMain.cl.parseCommand(setAclCommand); Assert.assertFalse(zkMain.processZKCmd(zkMain.cl)); Assert.assertEquals(Ids.READ_ACL_UNSAFE, zk.getACL("/a", new Stat())); Assert.assertEquals(Ids.READ_ACL_UNSAFE, zk.getACL("/a/b", new Stat())); Assert.assertEquals(Ids.READ_ACL_UNSAFE, zk.getACL("/a/b/c", new Stat())); Assert.assertEquals(Ids.READ_ACL_UNSAFE, zk.getACL("/a/d", new Stat())); Assert.assertEquals(Ids.OPEN_ACL_UNSAFE, zk.getACL("/e", new Stat())); }
Source:
<code>public TimeZoneType getTimeZoneType() { VmOsType vmOsType = (VmOsType) getModel().getOSType().getSelectedItem(); <START> return vmOsType == null ? null : TimeZoneType.getTimeZoneByOs(vmOsType); <END> }</code><technical_language>This is correct fix, return of getTimeZoneType() is lookup values in TimeZoneModel null, trade NPE for another. Please alter TimeZoneType.getTimeZoneByOs return GENERIC_TIMEZONE if ostype is null</technical_language>

Target:
public TimeZoneType getTimeZoneType() { VmOsType vmOsType = (VmOsType) getModel().getOSType().getSelectedItem(); return vmOsType == null ? TimeZoneType.GENERAL_TIMEZONE : TimeZoneType.getTimeZoneByOs(vmOsType); }
Source:
<code>public static DataContainer readDataFromRegion(DataInputStream stream) throws IOException { if (stream == null) { return null; } NBTTagCompound data = CompressedStreamTools.read(stream); <START> if (!data.hasKey("Level", NbtDataUtil.TAG_COMPOUND)) { <END> return null; } NBTTagCompound level = data.getCompoundTag("Level"); if (!level.hasKey("Sections", NbtDataUtil.TAG_LIST)) { return null; } return NbtTranslator.getInstance().translateFrom(level); }</code><technical_language>Add some constants in NbtDataUtil please. I want literal string values in implementation leads potential upgrade issues on</technical_language>

Target:
public static DataContainer readDataFromRegion(DataInputStream stream) throws IOException { if (stream == null) { return null; } NBTTagCompound data = CompressedStreamTools.read(stream); if (!data.hasKey(NbtDataUtil.CHUNK_DATA_LEVEL, NbtDataUtil.TAG_COMPOUND)) { return null; } NBTTagCompound level = data.getCompoundTag(NbtDataUtil.CHUNK_DATA_LEVEL); if (!level.hasKey(NbtDataUtil.CHUNK_DATA_SECTIONS, NbtDataUtil.TAG_LIST)) { return null; } return NbtTranslator.getInstance().translateFrom(level); }
Source:
<code>public void edit() { <START> final T qos = (T) getSelectedItem(); <END> if (getWindow() != null) { return; } final EditQosModel<T, P> qosModel = getEditQosModel(qos); setWindow(qosModel); qosModel.getDataCenters().setItems(Arrays.asList(getEntity())); qosModel.getDataCenters().setSelectedItem(getEntity()); }</code><technical_language>final</technical_language>

Target:
public void edit() { T qos = (T) getSelectedItem(); if (getWindow() != null) { return; } final EditQosModel<T, P> qosModel = getEditQosModel(qos); setWindow(qosModel); qosModel.getDataCenters().setItems(Arrays.asList(getEntity()), getEntity()); }
Source:
<code>private static String getDirIfLlvmFound(String candidatePath, String subPath) { String llvmPath = candidatePath; if (llvmPath.endsWith(Separators.getFileSeparator()) && llvmPath.length() > 1) { llvmPath = llvmPath.substring(0, candidatePath.length() - 1); } if (null != subPath && !subPath.isEmpty()) { llvmPath = llvmPath + Separators.getFileSeparator() + subPath; } <START> if (llvmPath == null) <END> return null; return getBinDirIfLlvm_ar(llvmPath); }</code><technical_language>llvmPath null now, no</technical_language>

Target:
private static String getDirIfLlvmFound(String candidatePath, String subPath) { String llvmPath = candidatePath; if (llvmPath.endsWith(Separators.getFileSeparator()) && llvmPath.length() > 1) { llvmPath = llvmPath.substring(0, candidatePath.length() - 1); } if (null != subPath && !subPath.isEmpty()) { llvmPath = llvmPath + Separators.getFileSeparator() + subPath; } return getBinDirIfLlvm_ar(llvmPath); }
Source:
<code>private static PoolingOptions getPoolingOptions(int numHosts){ final PoolingOptions poolingOptions = new PoolingOptions(); poolingOptions <START> .setCoreConnectionsPerHost(HostDistance.LOCAL, 15) <END> .setMaxConnectionsPerHost(HostDistance.LOCAL, ioconfig.getMaxConnPerHost(numHosts)) .setCoreConnectionsPerHost(HostDistance.REMOTE, 2) .setMaxConnectionsPerHost(HostDistance.REMOTE, 4) .setHeartbeatIntervalSeconds(60); return poolingOptions; }</code><technical_language>put defaults Configuration allow configured, if need be</technical_language>

Target:
private static PoolingOptions getPoolingOptions(int numHosts){ final PoolingOptions poolingOptions = new PoolingOptions(); poolingOptions .setCoreConnectionsPerHost(HostDistance.LOCAL, ioconfig.getInitialConn()) .setMaxConnectionsPerHost(HostDistance.LOCAL, ioconfig.getMaxConnPerHost(numHosts)); return poolingOptions; }
Source:
<code>public void run() { InvocationStatus invocationStatus = null; try { invocationStatus = beforeInvoke(); switch (invocationStatus) { case CONTINUE: response = handler.invokePerform(command); break; case CACHE_NOT_FOUND: response = CacheNotFoundResponse.INSTANCE; break; case DEFERRED: <START> return; <END> } afterInvoke(); } catch (InterruptedException e) { response = handler.interruptedException(command); onException(e); } catch (OutdatedTopologyException oe) { response = handler.outdatedTopology(oe); onException(oe); } catch (IllegalLifecycleStateException e) { response = CacheNotFoundResponse.INSTANCE; onException(e); } catch (Exception e) { response = handler.exceptionHandlingCommand(command, e); onException(e); } catch (Throwable throwable) { response = handler.exceptionHandlingCommand(command, throwable); onException(throwable); } finally { if (invocationStatus != InvocationStatus.DEFERRED) { reply.reply(response); onFinally(); } } }</code><technical_language>remote command execution this method if delivery order is DeliverOrder.PER_SENDER. in case, rely JGroups enforce delivery order, JGroups instead relies processing command synchronously. continue invocation another thread if command is asynchronous write/prepare</technical_language>

Target:
public void run() { if (sync) { runSync(); } else { runAsync(); } }
Source:
<code>private static Statement rhsAssignZeroValue(VariableDeclarationExpr vdExpr) { if (vdExpr.getVars().size() != 1) { return null; } Type type = vdExpr.getType(); if (type instanceof PrimitiveType) { switch (((PrimitiveType) type).getType()) { case Boolean: return rhsAssignWithValue(vdExpr, "false"); case Char: return rhsAssignWithValue(vdExpr, ""); default: return rhsAssignWithValue(vdExpr, "0"); } <START> } <END> return rhsAssignWithValue(vdExpr, null); }</code><technical_language>For wrapped primitives Integer, try zero well. means this routine return a list of length 0, 1, 2</technical_language>

Target:
private static List<Statement> rhsAssignZeroValue(VariableDeclarationExpr vdExpr) { List<Statement> resultList = new ArrayList<Statement>(); if (vdExpr.getVars().size() != 1) { return resultList; } Type type = vdExpr.getType(); if (type instanceof PrimitiveType) { resultList.add(rhsAssignWithValue(vdExpr, type, null)); } else { resultList.add(rhsAssignWithValue(vdExpr, type, null)); ReferenceType rType = (ReferenceType) type; if (rType.getType() instanceof ClassOrInterfaceType) { ClassOrInterfaceType classType = (ClassOrInterfaceType) rType.getType(); if (classType.isBoxedType()) { resultList.add(rhsAssignWithValue(vdExpr, classType.toUnboxedType(), null)); } } } return resultList; }
Source:
<code>protected void analyze(InputFile file, SensorContext context) { try { TypeScriptAnalysisRequest request = new TypeScriptAnalysisRequest(file, rules, tsConfigs(context)); AnalysisResponse response = eslintBridgeServer.analyzeTypeScript(request); saveIssues(file, context, response.issues); saveHighlights(file, context, response.highlights); <START> saveMetrics(file, context, response.metrics); <END> } catch (IOException e) { LOG.error("Failed to get response while analyzing " + file, e); } }</code><technical_language>move saving issues, NOSONAR work (btw test this is a good idea)</technical_language>

Target:
protected void analyze(InputFile file, SensorContext context) { try { AnalysisRequest request = new AnalysisRequest(file, rules, tsConfigs(context)); AnalysisResponse response = eslintBridgeServer.analyzeTypeScript(request); saveMetrics(file, context, response.metrics); saveIssues(file, context, response.issues); saveHighlights(file, context, response.highlights); saveCpd(file, context, response.cpdTokens); } catch (IOException e) { LOG.error("Failed to get response while analyzing " + file, e); } }
Source:
<code>public static Collection<Object> getConvertersToRegister() { List<Object> converters = new ArrayList<Object>(); converters.add(RowToNumberConverterFactory.INSTANCE); converters.add(RowToBooleanConverter.INSTANCE); converters.add(RowToDateConverter.INSTANCE); converters.add(RowToInetAddressConverter.INSTANCE); converters.add(RowToStringConverter.INSTANCE); converters.add(RowToUuidConverter.INSTANCE); <START> converters.add(new RowToListConverter()); <END> converters.add(new RowToMapConverter()); return converters; }</code><technical_language>a Singleton RowToListConverter is stateless</technical_language>

Target:
public static Collection<Object> getConvertersToRegister() { List<Object> converters = new ArrayList<Object>(); converters.add(RowToNumberConverterFactory.INSTANCE); converters.add(RowToBooleanConverter.INSTANCE); converters.add(RowToDateConverter.INSTANCE); converters.add(RowToInetAddressConverter.INSTANCE); converters.add(RowToStringConverter.INSTANCE); converters.add(RowToUuidConverter.INSTANCE); converters.add(RowToListConverter.INSTANCE); converters.add(RowToMapConverter.INSTANCE); return converters; }
Source:
<code>public void update() throws BankException, LoginException, BankChoiceException, IOException { super.update(); if (username == null || password == null || username.length() == 0 || password.length() == 0) { throw new LoginException(res.getText(R.string.invalid_username_password).toString()); } urlopen = login(); <START> if (!"<LINK_0>".equalsIgnoreCase( <END> urlopen.getCurrentURI())) { response = urlopen.open("<LINK_0>"); } Matcher matcher = reBalance.matcher(response); if (matcher.find()) { BigDecimal b = Helpers.parseBalance(matcher.group(1)); accounts.add(new Account("Saldo", b, "1")); balance = balance.add(Helpers.parseBalance(matcher.group(1))); } if (accounts.isEmpty()) { throw new BankException(res.getText(R.string.no_accounts_found).toString()); } super.updateComplete(); }</code><technical_language>Do mind setting url a constant</technical_language>

Target:
public void update() throws BankException, LoginException, BankChoiceException, IOException { super.update(); if (username == null || password == null || username.length() == 0 || password.length() == 0) { throw new LoginException(res.getText(R.string.invalid_username_password).toString()); } urlopen = login(); if (!urlopen.getCurrentURI().equalsIgnoreCase(URL_OVERVIEW)) { response = urlopen.open(URL_OVERVIEW); } Matcher matcher = reBalance.matcher(response); if (matcher.find()) { BigDecimal b = Helpers.parseBalance(matcher.group(1)); accounts.add(new Account("Saldo", b, "1")); balance = balance.add(Helpers.parseBalance(matcher.group(1))); } if (accounts.isEmpty()) { throw new BankException(res.getText(R.string.no_accounts_found).toString()); } super.updateComplete(); }
Source:
<code>private void runTestWithRenderDelay(final Duration renderDelay) throws Exception { final Config config = CHROME_RENDERER_CONFIG; final MockRenderedReportBuilder builder = Mockito.mock(MockRenderedReportBuilder.class); _wireMock.givenThat( get(urlEqualTo("/")) .willReturn(aResponse() .withHeader("Content-Type", "text/html") .withBody(Utils.mockGrafanaReportPanelPage(renderDelay)) ) ); final HtmlReportFormat format = new HtmlReportFormat.Builder().build(); final HtmlGrafanaScreenshotRenderer renderer = new HtmlGrafanaScreenshotRenderer(config, new ScheduledThreadPoolExecutor(1)); final GrafanaReportPanelReportSource source = new GrafanaReportPanelReportSource.Builder() .setWebPageReportSource( TestBeanFactory.createWebPageReportSourceBuilder() .setUri(URI.create("http://localhost:" + _wireMock.port())) .build()) .build(); final CompletionStage<MockRenderedReportBuilder> stage = renderer.render( source, format, new TimeRange(Instant.EPOCH, Instant.EPOCH), builder, <START> Duration.ofSeconds(15) <END> ); stage.toCompletableFuture().get(20, TimeUnit.SECONDS); final ArgumentCaptor<byte[]> bytes = ArgumentCaptor.forClass(byte[].class); Mockito.verify(builder).setBytes(bytes.capture()); final String response = Strings.stringFromBytes(bytes.getValue(), StandardCharsets.UTF_8); assertEquals(response, "content we care about"); }</code><technical_language>A of this value, extract out a constant in BaseChromeIT Config</technical_language>

Target:
private void runTestWithRenderDelay(final Duration renderDelay) throws Exception { final Config config = CHROME_RENDERER_CONFIG; final MockRenderedReportBuilder builder = Mockito.mock(MockRenderedReportBuilder.class); _wireMock.givenThat( get(urlEqualTo("/")) .willReturn(aResponse() .withHeader("Content-Type", "text/html") .withBody(Utils.mockGrafanaReportPanelPage(renderDelay)) ) ); final HtmlReportFormat format = new HtmlReportFormat.Builder().build(); final HtmlGrafanaScreenshotRenderer renderer = new HtmlGrafanaScreenshotRenderer(config, new ScheduledThreadPoolExecutor(1)); final GrafanaReportPanelReportSource source = new GrafanaReportPanelReportSource.Builder() .setWebPageReportSource( TestBeanFactory.createWebPageReportSourceBuilder() .setUri(URI.create("http://localhost:" + _wireMock.port())) .build()) .build(); final CompletionStage<MockRenderedReportBuilder> stage = renderer.render( source, format, DEFAULT_TIME_RANGE, builder, DEFAULT_TIMEOUT ); stage.toCompletableFuture().get(); final ArgumentCaptor<byte[]> bytes = ArgumentCaptor.forClass(byte[].class); Mockito.verify(builder).setBytes(bytes.capture()); final String response = Strings.stringFromBytes(bytes.getValue(), StandardCharsets.UTF_8); assertEquals(response, "content we care about"); }
Source:
<code>int instanceCacheResizeCount() { Object instanceCache = ReflectionUtil .getValue(this, "instanceCache"); return (int) ReflectionUtil <START> .getValue(instanceCache, "resizeCount"); <END> }</code><technical_language>I resizeCount is actual capacity, keys.length (and call method instanceCacheCapacity) instead care memory usage here</technical_language>

Target:
int instanceCacheResizeCount() { Object instanceCache = ReflectionUtil .getValue(this, "instanceCache"); final Object[] keys = (Object[]) ReflectionUtil .getValue(instanceCache, "keys"); return keys.length; }
Source:
<code>public String getText(Object element) { if (element instanceof Report<?>) { return ((Report<?>) element).getTaskName(); } else if (element instanceof ReportSession) { long id = ((ReportSession) element).getId(); <START> if (id == 0) { <END> return "Import"; } return df.format(new Date(id)); } return "Unhandled type"; }</code><technical_language>a constant for unknown/undetermined id instead of a magic number</technical_language>

Target:
public String getText(Object element) { if (element instanceof Report<?>) { return ((Report<?>) element).getTaskName(); } else if (element instanceof ReportSession) { long id = ((ReportSession) element).getId(); if (id == ReportReader.UNKNOWN_SESSION) { return "Import"; } return df.format(new Date(id)); } return "Unhandled type"; }
Source:
<code>private BuddyDto getBuddy(Buddy buddyEntity) { <START> if (canIncludePrivateData(buddyEntity)) <END> { return BuddyDto.createInstance(buddyEntity); } return BuddyDto.createInstance(buddyEntity); }</code><technical_language>This if is longer useful</technical_language>

Target:
private BuddyDto getBuddy(Buddy buddyEntity) { return BuddyDto.createInstance(buddyEntity); }
Source:
<code>public static void logCredInformation(Credentials credentials2) { LOG.info("credentials:" + credentials2); for (int i =0 ; i < credentials2.getAllSecretKeys().size(); i++) { <START> LOG.info("getAllSecretKeys:" + i + ":" + credentials2.getAllSecretKeys().get(i)); <END> } Iterator it = credentials2.getAllTokens().iterator(); while (it.hasNext()) { LOG.info("getAllTokens:" + it.next()); } }</code><technical_language>log this for debug log? details secretkeys do share though</technical_language>

Target:
public static void logCredInformation(Credentials credentials2) { if (LOG.isDebugEnabled()) { LOG.debug("credentials:" + credentials2); for (int i = 0; i < credentials2.getAllSecretKeys().size(); i++) { LOG.debug("getAllSecretKeys:" + i + ":" + credentials2.getAllSecretKeys().get(i)); } Iterator it = credentials2.getAllTokens().iterator(); while (it.hasNext()) { LOG.debug("getAllTokens:" + it.next()); } } }
Source:
<code>public void initialize() { this.view.init(this); newFileUploader.acceptContext(new Callback<Boolean, Void>() { @Override public void onFailure(Void reason) { <START> <END> } @Override public void onSuccess(Boolean result) { view.enableImportButton(); } }); }</code><technical_language>"import button" disabled if wrong!</technical_language>

Target:
public void initialize() { this.view.init(this); this.enableButtons(canUpdateProject()); newFileUploader.acceptContext(new Callback<Boolean, Void>() { @Override public void onFailure(Void reason) { view.enableImportButton(false); } @Override public void onSuccess(Boolean result) { view.enableImportButton(result); } }); }
Source:
<code>public Object execute(ExecutionEvent event) throws ExecutionException { List<RepositoryTreeNode> nodes = getSelectedNodes(); Ref ref1 = getRef(nodes.get(0)); Ref ref2 = getRef(nodes.get(1)); if (ref1 != null && ref2 != null) { Repository repo = (nodes.get(0).getRepository()); try { RevCommit commit1 = repo.parseCommit(ref1.getObjectId()); RevCommit commit2 = repo.parseCommit(ref2.getObjectId()); if (commit1.getCommitTime() <= commit2.getCommitTime()) { compare(event, repo, commit1.getName(), commit2.getName()); } else { compare(event, repo, commit2.getName(), commit1.getName()); <START> } <END> } catch (IOException e) { throw new ExecutionException(e.getMessage(), e); } } return null; }</code><technical_language>This inverted. Comparing HEAD (at this commit) v5.6.1 tag shows this file removed</technical_language>

Target:
public Object execute(ExecutionEvent event) throws ExecutionException { List<RepositoryTreeNode> nodes = getSelectedNodes(); Ref ref1 = getRef(nodes.get(0)); Ref ref2 = getRef(nodes.get(1)); if (ref1 != null && ref2 != null) { Repository repo = (nodes.get(0).getRepository()); IWorkbenchPage workbenchPage = HandlerUtil .getActiveWorkbenchWindowChecked(event).getActivePage(); try { RevCommit a = repo.parseCommit(ref1.getObjectId()); RevCommit b = repo.parseCommit(ref2.getObjectId()); if (a.getCommitTime() <= b.getCommitTime()) { compare(workbenchPage, repo, b.getName(), a.getName()); } else { compare(workbenchPage, repo, a.getName(), b.getName()); } } catch (IOException e) { throw new ExecutionException(e.getLocalizedMessage(), e); } } return null; }
Source:
<code>public void shouldConfigureInsertOptions() { Instant now = LocalDateTime.now().toInstant(ZoneOffset.UTC); InsertOptions insertOptions = InsertOptions.builder() .ttl(10) .timestamp(now) .withIfNotExists() .build(); assertThat(insertOptions.getTtl()).isEqualTo(Duration.ofSeconds(10)); <START> assertThat(insertOptions.getTimestamp() == now.toEpochMilli() * 1000); <END> assertThat(insertOptions.isIfNotExists()).isTrue(); }</code><technical_language>assertThat(insertOptions.getTimestamp()).isEqualTo(now.toEpochMilli() * 1000);</technical_language>

Target:
public void shouldConfigureInsertOptions() { Instant now = LocalDateTime.now().toInstant(ZoneOffset.UTC); InsertOptions insertOptions = InsertOptions.builder() .ttl(10) .timestamp(now) .withIfNotExists() .build(); assertThat(insertOptions.getTtl()).isEqualTo(Duration.ofSeconds(10)); assertThat(insertOptions.getTimestamp()).isEqualTo(now.toEpochMilli() * 1000); assertThat(insertOptions.isIfNotExists()).isTrue(); }
Source:
<code>public void reIndex() { driver.findElement(by.xpath(" <START> driver.findElement(by.xpath(" END> }</code><technical_language><LINK_0></technical_language>

Target:
public void reIndex() { final List<WebElement> scanRepoNow = driver.findElements(by.xpath(" if (scanRepoNow.size() > 0) { scanRepoNow.get(0).click(); } else { find(by.xpath(" find(by.xpath(" } }
Source:
<code>private void execute(ApacheHttpRequest request) throws Exception { <START> byte[] bytes = StringUtils.getBytesUtf8("abc"); <END> request.setStreamingContent(new ByteArrayStreamingContent(bytes)); request.setContentType("text/html"); request.setContentLength(bytes.length); request.execute(); }</code><technical_language>scope of this PR, StringUtils a bad idea. This line is trivial implement extra dependency</technical_language>

Target:
private void execute(ApacheHttpRequest request) throws IOException { byte[] bytes = "abc".getBytes(StandardCharsets.UTF_8); request.setStreamingContent(new ByteArrayStreamingContent(bytes)); request.setContentType("text/html"); request.setContentLength(bytes.length); request.execute(); }
Source:
<code>public void createControl(Composite parent, FormToolkit toolkit) { <START> super.createControl(parent, toolkit, (isMultiSelect && !isMultiSingleLineSelect ? SWT.WRAP : SWT.NONE)); <END> if (!isReadOnly() && isMultiSelect) { getText().setToolTipText("Separate multiple values with a comma"); } }</code><technical_language>Instead of type decide wrap, layout hint, i.e. wrap iff rowspan is multiple</technical_language>

Target:
public void createControl(Composite parent, FormToolkit toolkit) { super.createControl(parent, toolkit, (getLayoutHint().rowSpan == RowSpan.MULTIPLE ? SWT.WRAP : SWT.NONE)); if (!isReadOnly() && isMultiSelect) { getText().setToolTipText("Separate multiple values with a comma"); } }
Source:
<code>private void buildApiConfigTest() throws UserStoreException { <START> PrivilegedCarbonContext.getThreadLocalCarbonContext().setTenantDomain("test"); <END> ServletContext servletContext = new MockServletContext(); APIResourceConfiguration apiDef = new APIResourceConfiguration(); List<APIResource> resources = new ArrayList<>(); apiDef.setResources(resources); APIConfig apiConfig = buildApiConfig(servletContext, apiDef); Assert.assertNotNull(apiConfig, "API configuration is null."); }</code><technical_language>testing in tenant flow. In case, normal is start tenant flow set tenant domain. end tenant flow in finally block other wise if is exceptions, other testcases expecting super tenant get affected</technical_language>

Target:
private void buildApiConfigTest() throws UserStoreException, RegistryException { try { startTenantFlowAsTestTenant(); ServletContext servletContext = new MockServletContext(); APIResourceConfiguration apiDef = new APIResourceConfiguration(); List<APIResource> resources = new ArrayList<>(); apiDef.setResources(resources); APIConfig apiConfig = buildApiConfig(servletContext, apiDef); Assert.assertNotNull(apiConfig, "API configuration is null."); } finally { PrivilegedCarbonContext.endTenantFlow(); } }
Source:
<code>public Emailer(Props props) { super(props); this.azkabanName = props.getString("azkaban.name", "azkaban"); this.mailHost = props.getString("mail.host", "localhost"); this.mailUser = props.getString("mail.user", ""); this.mailPassword = props.getString("mail.password", ""); this.mailSender = props.getString("mail.sender", ""); this.tls = props.getString("mail.tls", "false"); <START> this.usesAuth = props.getBoolean("mail.useAuth", true); <END> int mailTimeout = props.getInt("mail.timeout.millis", 10000); EmailMessage.setTimeout(mailTimeout); int connectionTimeout = props.getInt("mail.connection.timeout.millis", 10000); EmailMessage.setConnectionTimeout(connectionTimeout); this.clientHostname = props.getString("jetty.hostname", "localhost"); if (props.getBoolean("jetty.use.ssl", true)) { this.scheme = HTTPS; this.clientPortNumber = props.getString("jetty.ssl.port"); } else { this.scheme = HTTP; this.clientPortNumber = props.getString("jetty.port"); } testMode = props.getBoolean("test.mode", false); }</code><technical_language>Email extends AbstractMailer. Is a need for retrieving "mail.useAuth" property again? Emailer class call a method AbstractMailer find out authentication is not</technical_language>

Target:
public Emailer(Props props) { super(props); this.azkabanName = props.getString("azkaban.name", "azkaban"); this.mailHost = props.getString("mail.host", "localhost"); this.mailUser = props.getString("mail.user", ""); this.mailPassword = props.getString("mail.password", ""); this.mailSender = props.getString("mail.sender", ""); this.tls = props.getString("mail.tls", "false"); int mailTimeout = props.getInt("mail.timeout.millis", 10000); EmailMessage.setTimeout(mailTimeout); int connectionTimeout = props.getInt("mail.connection.timeout.millis", 10000); EmailMessage.setConnectionTimeout(connectionTimeout); this.clientHostname = props.getString("jetty.hostname", "localhost"); if (props.getBoolean("jetty.use.ssl", true)) { this.scheme = HTTPS; this.clientPortNumber = props.getString("jetty.ssl.port"); } else { this.scheme = HTTP; this.clientPortNumber = props.getString("jetty.port"); } testMode = props.getBoolean("test.mode", false); }
Source:
<code>public void setData(HistogramBucket[] buckets, long[] lostEvents, long startTime, long duration) { if (buckets.length != fNbBuckets) { throw new IllegalArgumentException(); } <START> fNbEvents = 0; <END> for (int i = 0; i < buckets.length; i++) { fBuckets[i] = buckets[i]; fNbEvents += buckets[i].getNbEvents(); } if (lostEvents != null) { for (int i = 0; i < lostEvents.length; i++) { fLostEventsBuckets[i] = lostEvents[i]; } } fFirstBucketTime = startTime; fFirstEventTime = startTime; fBucketDuration = duration; fLastBucket = buckets.length - 1; fEndTime = fFirstBucketTime + fLastBucket * fBucketDuration; fireModelUpdateNotification(); }</code><technical_language>fill in message</technical_language>

Target:
public void setData(HistogramBucket[] buckets, long[] lostEvents, long startTime, long duration) { if (buckets.length != fNbBuckets) { throw new IllegalArgumentException("Wrong number of buckets, excepted " + fNbBuckets + " was " + buckets.length); } fNbEvents = 0; for (int i = 0; i < buckets.length; i++) { fBuckets[i] = buckets[i]; fNbEvents += buckets[i].getNbEvents(); } if (lostEvents != null) { Arrays.setAll(fLostEventsBuckets, i -> lostEvents[i]); } fFirstBucketTime = startTime; fFirstEventTime = startTime; fBucketDuration = duration; fLastBucket = buckets.length - 1; fEndTime = fFirstBucketTime + fLastBucket * fBucketDuration; fireModelUpdateNotification(); }
Source:
<code>public static String execute(String str, Repository db) throws Exception { <START> String[] args = str.split(" "); <END> String[] argv = new String[args.length - 1]; System.arraycopy(args, 1, argv, 0, args.length - 1); CLIGitCommand bean = new CLIGitCommand(); final CmdLineParser clp = new CmdLineParser(bean); clp.parseArgument(argv); final TextBuiltin cmd = bean.getSubcommand(); if (cmd.requiresRepository()) cmd.init(db, null); else cmd.init(null, null); ByteArrayOutputStream baos = new ByteArrayOutputStream(); cmd.out = new PrintWriter(new BufferedWriter(new OutputStreamWriter( baos))); try { cmd.execute(bean.getArguments().toArray( new String[bean.getArguments().size()])); } finally { if (cmd.out != null) cmd.out.flush(); } return baos.toString(); }</code><technical_language>If want a function parse sh style line, quoting, logic for in Gerrit Code Review. Apache License 2.0 I/Google willing relicense EDL for in JGit depends JGit's QuotedPath code handle sh quoting rules anyway. :-)</technical_language>

Target:
public static String[] execute(String str, Repository db) throws Exception { String[] args = str.split(" "); String[] argv = new String[args.length - 1]; System.arraycopy(args, 1, argv, 0, args.length - 1); CLIGitCommand bean = new CLIGitCommand(); final CmdLineParser clp = new CmdLineParser(bean); clp.parseArgument(argv); final TextBuiltin cmd = bean.getSubcommand(); if (cmd.requiresRepository()) cmd.init(db, null); else cmd.init(null, null); ByteArrayOutputStream baos = new ByteArrayOutputStream(); cmd.out = new PrintWriter(new BufferedWriter(new OutputStreamWriter( baos))); try { cmd.execute(bean.getArguments().toArray( new String[bean.getArguments().size()])); } finally { if (cmd.out != null) cmd.out.flush(); } return IO.readLines(baos.toString()); }
Source:
<code>public void onNext(final ContextStop contextStop) { LOG.log(Level.INFO, "Wait {0} milliseconds at maximum for the PS service to be closed", TIMEOUT_MS); try { parameterWorker.close(TIMEOUT_MS); LOG.info("Succeed to close PS worker cleanly"); } catch (InterruptedException | TimeoutException | ExecutionException e) { <START> LOG.info("Fail to close PS worker cleanly"); <END> } psNetworkSetup.unregisterConnectionFactory(); }</code><technical_language>LOG.log() passing e show stack trace? Moreover, setting log level WARNING users distinguish logs</technical_language>

Target:
public void onNext(final ContextStop contextStop) { LOG.log(Level.FINE, "Wait {0} milliseconds at maximum for the PS service to be closed", TIMEOUT_MS); try { parameterWorker.close(TIMEOUT_MS); LOG.fine("Succeed to close PS worker cleanly"); } catch (InterruptedException | TimeoutException | ExecutionException e) { LOG.log(Level.INFO, "Fail to close PS worker cleanly", e); } psNetworkSetup.unregisterConnectionFactory(); }
Source:
<code>ObjectRemoteQueryEngine(AdvancedCache<?, ?> cache, boolean isIndexed, Class<? extends Matcher> matcherImplClass) { <START> super(cache, isIndexed, matcherImplClass); <END> }</code><technical_language>withEncoding(IdentityEncoder.class) removed? Note this implies</technical_language>

Target:
ObjectRemoteQueryEngine(AdvancedCache<?, ?> cache, boolean isIndexed, Class<? extends Matcher> matcherImplClass) { super(cache.getAdvancedCache().withEncoding(IdentityEncoder.class), isIndexed, matcherImplClass); }
Source:
<code>public void registerSqlTypeToSqlTypeNameOverrides(Map<Integer, String> overrides) { <START> overrides.put(4, "int4"); <END> overrides.put(Types.VARCHAR, "VARCHAR"); overrides.put(Types.BOOLEAN, "BOOL"); overrides.put(Types.BLOB, "BYTEA"); }</code><technical_language>Please Types.INTEGER instead of 4</technical_language>

Target:
public void registerSqlTypeToSqlTypeNameOverrides(Map<Integer, String> overrides) { overrides.put(Types.VARCHAR, "VARCHAR"); overrides.put(Types.BOOLEAN, "BOOL"); overrides.put(Types.BLOB, "BYTEA"); }
Source:
<code>private WorkObject ingestFileObjectAsWork(ContentContainerObject parent, Resource parentResc, Resource childResc) throws DepositException { if (skipResumed(childResc)) { return null; } PID childPid = PIDs.get(childResc.getURI()); PID workPid = repository.mintContentPid(); Model workModel = ModelFactory.createDefaultModel(); String label = getPropertyValue(childResc, CdrDeposit.label); if (label == null) { label = getPropertyValue(childResc, CdrDeposit.stagingLocation); if (label == null) { throw new DepositException("No staging location provided for file object (" + childResc.getURI() + ")"); } label = new File(label).getName(); } Resource workResc = workModel.createResource(workPid.getRepositoryPath()); workResc.addProperty(DC.title, label); WorkObject newWork = null; FedoraTransaction tx = repository.startTransaction(); try { newWork = repository.createWorkObject(workPid, workModel); addDescription(newWork); FileObject fileObj = addFileToWork(newWork, childResc); <START> addIngestionEventForContainer(newWork, parentResc); <END> newWork.setPrimaryObject(childPid); parent.addMember(newWork); addClicks(1); addPremisEvents(fileObj); addPremisEvents(newWork); log.info("Created work for file object for deposit {}", new Object[] {workPid, childPid, getDepositPID()}); } catch(Exception e) { tx.cancel(e); } finally { tx.close(); } return newWork; }</code><technical_language>for readability truth in reporting, move this parent.addMember</technical_language>

Target:
private void ingestFileObjectAsWork(ContentContainerObject parent, Resource parentResc, Resource childResc) throws DepositException { if (skipResumed(childResc)) { return; } PID childPid = PIDs.get(childResc.getURI()); PID workPid = repository.mintContentPid(); Model workModel = ModelFactory.createDefaultModel(); String label = getPropertyValue(childResc, CdrDeposit.label); if (label == null) { label = getPropertyValue(childResc, CdrDeposit.stagingLocation); if (label == null) { throw new DepositException("No staging location provided for file object (" + childResc.getURI() + ")"); } label = new File(label).getName(); } Resource workResc = workModel.createResource(workPid.getRepositoryPath()); workResc.addProperty(DC.title, label); WorkObject newWork = null; FedoraTransaction tx = repository.startTransaction(); try { newWork = repository.createWorkObject(workPid, workModel); addDescription(newWork); parent.addMember(newWork); FileObject fileObj = addFileToWork(newWork, childResc); addIngestionEventForContainer(newWork, parentResc); newWork.setPrimaryObject(childPid); addClicks(1); addPremisEvents(fileObj); addPremisEvents(newWork); log.info("Created work for file object for deposit {}", new Object[] {workPid, childPid, getDepositPID()}); } catch(Exception e) { tx.cancel(e); } finally { tx.close(); } }
Source:
<code>public static boolean compareSnmpV3UsersMap(Map<String, SnmpV3User> existingSnmpV3UserMap, Map<String, SnmpV3User> updatedSnmpV3Usermap) { if ((existingSnmpV3UserMap.isEmpty() && updatedSnmpV3Usermap.isEmpty()) <START> || (!existingSnmpV3UserMap.isEmpty() && updatedSnmpV3Usermap.isEmpty())) { <END> return false; } else if (existingSnmpV3UserMap.isEmpty() && !updatedSnmpV3Usermap.isEmpty()) { return true; } for (String securityName : existingSnmpV3UserMap.keySet()) { if ( compareSnmpV3UsersAttributes(existingSnmpV3UserMap.get(securityName).getAuthPassPhrase(), updatedSnmpV3Usermap.get(securityName).getAuthPassPhrase()) || compareSnmpV3UsersAttributes(existingSnmpV3UserMap.get(securityName).getAuthProtocol(), updatedSnmpV3Usermap.get(securityName).getAuthProtocol()) || compareSnmpV3UsersAttributes(existingSnmpV3UserMap.get(securityName).getEngineId(), updatedSnmpV3Usermap.get(securityName).getEngineId()) || compareSnmpV3UsersAttributes(existingSnmpV3UserMap.get(securityName).getPrivPassPhrase(), updatedSnmpV3Usermap.get(securityName).getPrivPassPhrase()) || compareSnmpV3UsersAttributes(existingSnmpV3UserMap.get(securityName).getPrivProtocol(), updatedSnmpV3Usermap.get(securityName).getPrivProtocol()) ) { return true; } } return false; }</code><technical_language>This statement sense. reduces updatedSnmpV3Usermap.isEmpty(). Is intended check</technical_language>

Target:
public static boolean compareSnmpV3UsersMap(Map<String, SnmpV3User> existingSnmpV3UserMap, Map<String, SnmpV3User> updatedSnmpV3Usermap) { if (updatedSnmpV3Usermap.isEmpty()) { return false; } else if (existingSnmpV3UserMap.isEmpty()) { return true; } for (String securityName : existingSnmpV3UserMap.keySet()) { if(existingSnmpV3UserMap.get(securityName).equals(updatedSnmpV3Usermap.get(securityName))) return true; } return false; }
Source:
<code>protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { final Map<String, HealthCheck.Result> results; String name = getHealthCheckName(req); if (name != null) { <START> results = Collections.singletonMap(name, registry.runHealthCheck(name)); <END> } else { results = runHealthChecks(); } resp.setContentType(CONTENT_TYPE); resp.setHeader("Cache-Control", "must-revalidate,no-cache,no-store"); if (results.isEmpty()) { resp.setStatus(HttpServletResponse.SC_NOT_IMPLEMENTED); } else { if (isAllHealthy(results)) { resp.setStatus(HttpServletResponse.SC_OK); } else { resp.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); } } final OutputStream output = resp.getOutputStream(); try { getWriter(req).writeValue(output, results); } finally { output.close(); } }</code><technical_language>method throws NoSuchElementException check is found. create method check if check exists call method. If check is existing return empty map responses (all/one) consistent</technical_language>

Target:
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { Map<String, HealthCheck.Result> results; String name = getHealthCheckName(req); if (name != null) { try { results = Collections.singletonMap(name, registry.runHealthCheck(name)); } catch (NoSuchElementException e) { results = Collections.emptyMap(); } } else { results = runHealthChecks(); } resp.setContentType(CONTENT_TYPE); resp.setHeader("Cache-Control", "must-revalidate,no-cache,no-store"); if (results.isEmpty()) { resp.setStatus(HttpServletResponse.SC_NOT_IMPLEMENTED); } else { if (isAllHealthy(results)) { resp.setStatus(HttpServletResponse.SC_OK); } else { resp.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); } } final OutputStream output = resp.getOutputStream(); try { getWriter(req).writeValue(output, results); } finally { output.close(); } }
Source:
<code>private static Request addSocketHeaders(final Request req, final Socket socket) { Request mreq = req; <START> mreq = new RqWithHeader( <END> mreq, "X-Takes-LocalAddress", socket.getLocalAddress().toString() ); mreq = new RqWithHeader( mreq, "X-Takes-LocalPort", Integer.toString(socket.getLocalPort()) ); mreq = new RqWithHeader( mreq, "X-Takes-RemoteAddress", socket.getInetAddress().toString() ); mreq = new RqWithHeader( mreq, "X-Takes-RemotePort", Integer.toString(socket.getPort()) ); return mreq; }</code><technical_language>@ikhvostenkov I this design. adding a method withAdditionalHeader RqWithHeader simply returns new RqWithHeader(this, "Header-Name", "Header-Value"). get a request multiple headers a fluent interface this: java return new RqWithHeader(mreq, "Header-1", "Value-1") .withAdditionalHeader("Header-2", "value-2") .withAdditionalHeader("Header-3", "value-3") ///and on..</technical_language>

Target:
private static Request addSocketHeaders(final Request req, final Socket socket) { return new RqWithHeaders( req, String.format("X-Takes-LocalAddress: %s", socket.getLocalAddress()), String.format("X-Takes-LocalPort: %d", socket.getLocalPort()), String.format("X-Takes-RemoteAddress: %s", socket.getInetAddress()), String.format("X-Takes-RemotePort: %d", socket.getPort()) ); }
Source:
<code>public void getRadiologyReports_shouldReturnAListOfRadiologyReportsBeingWithinTheDateRange() throws Exception { SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); RadiologyReportSearchCriteria radiologyReportSearchCriteria = new RadiologyReportSearchCriteria.Builder().setFromDate(format.parse("2016-05-28")) .setToDate(format.parse("2016-07-01")) .build(); List<RadiologyReport> radiologyReports = radiologyReportService.getRadiologyReports(radiologyReportSearchCriteria); <START> assertThat(radiologyReports.size(), is(3)); <END> }</code><technical_language>@Schwasrz94 please assert reportDate is in date range want be. is actual tested. size 3 doesnt necessarily are. this counts for tests</technical_language>

Target:
public void getRadiologyReports_shouldReturnAListOfRadiologyReportsBeingWithinTheDateRange() throws Exception { final DateFormat format = new SimpleDateFormat("yyyy-MM-dd"); RadiologyReportSearchCriteria radiologyReportSearchCriteria = new RadiologyReportSearchCriteria.Builder().setFromDate(format.parse("2016-05-28")) .setToDate(format.parse("2016-07-01")) .build(); List<RadiologyReport> radiologyReports = radiologyReportService.getRadiologyReports(radiologyReportSearchCriteria); assertThat(radiologyReports.size(), is(3)); }
Source:
<code>public static Object[][] interstitialOasis() { return new Object[][]{ { new Page("project43", "SyntheticTests/Slots/InvisibleHighImpact/Interstitial"), <START> "#INVISIBLE_HIGH_IMPACT_2 .provider-container iframe", <END> new Dimension(728, 90) }, }; }</code><technical_language>I selector mobile desktop. Please use: .invisible-high-impact-wrapper.interstitial .provider-container iframe</technical_language>

Target:
public static Object[][] interstitialOasis() { return new Object[][]{ { new Page("project43", "SyntheticTests/Slots/InvisibleHighImpact/Interstitial"), new Dimension(728, 90) }, }; }
Source:
<code>protected void executeCommand() { ManagedBlockStorage managedBlockStorage = cinderStorageDao.get(getParameters().getStorageDomainId()); try { List<String> extraParams = new ArrayList<>(); extraParams.add(getParameters().getDiskId().toString()); extraParams.add(JsonHelper.mapToJson(getParameters().getConnectorInfo(), false)); <START> Map<String, Object> driverOptions = new HashMap<>(managedBlockStorage.getDriverOptions()); if (managedBlockStorage.getDriverSensitiveOptions() != null) { driverOptions.putAll(managedBlockStorage.getDriverSensitiveOptions()); } <END> CinderlibCommandParameters params = new CinderlibCommandParameters(JsonHelper.mapToJson(driverOptions, false), extraParams); CinderlibReturnValue returnValue = cinderlibExecutor.runCommand(CinderlibExecutor.CinderlibCommand.CONNECT_VOLUME, params); getReturnValue().setActionReturnValue(JsonHelper.jsonToMap(returnValue.getOutput())); } catch (Exception e) { log.error("Failed executing volume creation", e); return; } setSucceeded(true); }</code><technical_language>try block</technical_language>

Target:
protected void executeCommand() { ManagedBlockStorage managedBlockStorage = cinderStorageDao.get(getParameters().getStorageDomainId()); Map<String, Object> driverOptions = new HashMap<>(managedBlockStorage.getDriverOptions()); if (managedBlockStorage.getDriverSensitiveOptions() != null) { driverOptions.putAll(managedBlockStorage.getDriverSensitiveOptions()); } try { List<String> extraParams = new ArrayList<>(); extraParams.add(getParameters().getDiskId().toString()); extraParams.add(JsonHelper.mapToJson(getParameters().getConnectorInfo(), false)); CinderlibCommandParameters params = new CinderlibCommandParameters(JsonHelper.mapToJson(driverOptions, false), extraParams); CinderlibReturnValue returnValue = cinderlibExecutor.runCommand(CinderlibExecutor.CinderlibCommand.CONNECT_VOLUME, params); getReturnValue().setActionReturnValue(JsonHelper.jsonToMap(returnValue.getOutput())); } catch (Exception e) { log.error("Failed executing volume creation", e); return; } setSucceeded(true); }
Source:
<code>public void testProtectBranch() throws GitLabApiException { Project project = gitLabApi.getProjectApi().getProject(TEST_NAMESPACE, TEST_PROJECT_NAME); assertNotNull(project); ProtectedBranch branch = gitLabApi.getProtectedBranchesApi().protectBranch(project.getId(), TEST_BRANCH_NAME); List<ProtectedBranch> branches = gitLabApi.getProtectedBranchesApi().getProtectedBranches(project.getId()); assertNotNull(branches); assertTrue(branches.stream() <START> .anyMatch((protectedBranch) -> branch.getName().equals(TEST_BRANCH_NAME))); <END> }</code><technical_language>Correct if I wrong, I this remain unchanged. I wrote this test protect unprotected branch, get a list of protected branches, verify unprotected branch is part of this list. changing name, assertion return true branch is effectively treated a final variable (line 155) TEST_BRANCH_NAME time (line 159) executes. If not, (line 155) failed exception thrown</technical_language>

Target:
public void testProtectBranch() throws GitLabApiException { Project project = gitLabApi.getProjectApi().getProject(TEST_NAMESPACE, TEST_PROJECT_NAME); assertNotNull(project); ProtectedBranch branch = gitLabApi.getProtectedBranchesApi().protectBranch(project.getId(), TEST_BRANCH_NAME); assertNotNull(branch); assertEquals(TEST_BRANCH_NAME, branch.getName()); List<ProtectedBranch> branches = gitLabApi.getProtectedBranchesApi().getProtectedBranches(project.getId()); assertNotNull(branches); assertTrue(branches.stream() .anyMatch((protectedBranch) -> protectedBranch.getName().equals(TEST_BRANCH_NAME))); }
Source:
<code>private String getErrorMessage( List<MissingTrans> missingTrans ) { StringBuilder entries = new StringBuilder(); for ( MissingTrans entry : missingTrans ) { if ( missingTrans.indexOf( entry ) == missingTrans.size() - 1 ) { <START> entries.append( "- " + entry.getStepName() + " - " + entry.getMissingPluginId() + "\n\n" ); <END> } else { entries.append( "- " + entry.getStepName() + " - " + entry.getMissingPluginId() + "\n" ); } } return BaseMessages.getString( PKG, "MissingTransDialog.MissingTransSteps", entries.toString() ); }</code><technical_language>refactor</technical_language>

Target:
private String getErrorMessage( List<MissingTrans> missingTrans ) { StringBuilder entries = new StringBuilder(); for ( MissingTrans entry : missingTrans ) { entries.append( "- " + entry.getStepName() + " - " + entry.getMissingPluginId() + "\n" ); if ( missingTrans.indexOf( entry ) == missingTrans.size() - 1 ) { entries.append( '\n' ); } } return BaseMessages.getString( PKG, "MissingTransDialog.MissingTransSteps", entries.toString() ); }