auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void testLimitedCteWithoutLimitInMainQueryButWithCollectionFetch() { Function<Integer, List<Person>> fetchPersonBatch = batch -> cbf.create(em, Person.class) <START> .setProperty(ConfigurationProperties.INLINE_CTES, Boolean.FALSE.toString()) .with(PersonCTE.class) <END> .from(Person.class) .bind("id").select("id") .bind("name").select("NULL") .bind("age").select("NULL") .bind("idx").select("NULL") .bind("owner").select("NULL") .orderByAsc("name") .setFirstResult(batch) .setMaxResults(1) .end() .from(Person.class) .fetch("ownedDocuments") .where("id").in().from(PersonCTE.class).select("id").end() .getResultList(); List<Person> personBatch1 = fetchPersonBatch.apply(0); List<Person> personBatch2 = fetchPersonBatch.apply(1); assertEquals(1, new HashSet<>(personBatch1).size()); assertEquals(2, personBatch1.get(0).getOwnedDocuments().size()); assertEquals(1, new HashSet<>(personBatch2).size()); assertEquals(2, personBatch2.get(0).getOwnedDocuments().size()); }</code><technical_language>disable inlining this well: suggestion .with(PersonCTE.class, false)</technical_language>

Target:
public void testLimitedCteWithoutLimitInMainQueryButWithCollectionFetch() { Function<Integer, List<Person>> fetchPersonBatch = batch -> cbf.create(em, Person.class) .with(PersonCTE.class, false) .from(Person.class) .bind("id").select("id") .bind("name").select("NULL") .bind("age").select("NULL") .bind("idx").select("NULL") .bind("owner").select("NULL") .orderByAsc("name") .setFirstResult(batch) .setMaxResults(1) .end() .from(Person.class) .fetch("ownedDocuments") .where("id").in().from(PersonCTE.class).select("id").end() .getResultList(); List<Person> personBatch1 = fetchPersonBatch.apply(0); List<Person> personBatch2 = fetchPersonBatch.apply(1); assertEquals(1, new HashSet<>(personBatch1).size()); assertEquals(2, personBatch1.get(0).getOwnedDocuments().size()); assertEquals(1, new HashSet<>(personBatch2).size()); assertEquals(2, personBatch2.get(0).getOwnedDocuments().size()); }
Source:
<code>public QueryFactoryBuilder use(final BeanAdapter beanAdapter) { checkNotNull(beanAdapter); final TypeToken adapterForType = TypeToken.of(beanAdapter.getClass()) .getSupertype(BeanAdapter.class) .resolveType(BeanAdapter.class.getTypeParameters()[0]); <START> beanAdapters.putIfAbsent(adapterForType.getRawType(), beanAdapter); <END> return this; }</code><technical_language>do want raw type? work in cases, for generics (if raw type), I missing smthing</technical_language>

Target:
public QueryFactoryBuilder use(final BeanAdapter beanAdapter) { checkNotNull(beanAdapter); final TypeToken adapterForType = TypeToken.of(beanAdapter.getClass()) .getSupertype(BeanAdapter.class) .resolveType(BeanAdapter.class.getTypeParameters()[0]); beanAdapters.putIfAbsent(adapterForType.getType(), beanAdapter); return this; }
Source:
<code>public void testExtents() throws Exception { <START> String NOT_USED = null; <END> DateFormatTransform transform = new DateFormatTransform("not used", NOT_USED, NOT_USED, NOT_USED); GregorianCalendar cal = new GregorianCalendar(); cal.clear(); cal.setTimeZone(TimeZone.getTimeZone("GMT")); int minYear = -292269052; Date parsed = transform.parseDate("" + minYear); cal.setTime(parsed); assertEquals(minYear - 1, - cal.get(Calendar.YEAR)); assertEquals(GregorianCalendar.BC,cal.get(Calendar.ERA)); cal.setTimeInMillis(Long.MAX_VALUE); int maxYear = cal.get(Calendar.YEAR); parsed = transform.parseDate("" + maxYear); cal.setTime(parsed); assertEquals(maxYear, cal.get(Calendar.YEAR)); assertEquals(GregorianCalendar.AD, cal.get(Calendar.ERA)); }</code><technical_language>This NOT_USED constant (which a constant) a bit silly, thinks clear, more. pattern consistently test - null is used. more sense null in cases</technical_language>

Target:
public void testExtents() throws Exception { DateFormatTransform transform = new DateFormatTransform("not used", null); GregorianCalendar cal = new GregorianCalendar(); cal.clear(); cal.setTimeZone(TimeZone.getTimeZone("GMT")); int minYear = -292269052; Date parsed = transform.parseDate("" + minYear); cal.setTime(parsed); assertEquals(minYear - 1, - cal.get(Calendar.YEAR)); assertEquals(GregorianCalendar.BC,cal.get(Calendar.ERA)); cal.setTimeInMillis(Long.MAX_VALUE); int maxYear = cal.get(Calendar.YEAR); parsed = transform.parseDate("" + maxYear); cal.setTime(parsed); assertEquals(maxYear, cal.get(Calendar.YEAR)); assertEquals(GregorianCalendar.AD, cal.get(Calendar.ERA)); }
Source:
<code>public void run() { startTime = System.currentTimeMillis(); try { tajoClient = TajoHAClientUtil.getTajoClient(tajoConf, tajoClient); if (!tajoClient.getCurrentDatabase().equals(database)) tajoClient.selectDatabase(database); response = tajoClient.executeQuery(query); if (response == null) { LOG.error("Internal Error: SubmissionResponse is NULL"); error = new Exception("Internal Error: SubmissionResponse is NULL"); } else if (response.getResultCode() == ClientProtos.ResultCode.OK) { if (response.getIsForwarded()) { queryId = new QueryId(response.getQueryId()); getQueryResult(queryId); } else { if (!response.hasTableDesc() && !response.hasResultSet()) { } else { getSimpleQueryResult(response); } progress.set(100); } } else if (response.getResultCode() == ClientProtos.ResultCode.ERROR) { if (response.hasErrorMessage()) { StringBuffer errorMessage = new StringBuffer(response.getErrorMessage()); String modifiedMessage; if (errorMessage.length() > 200) { modifiedMessage = errorMessage.substring(0, 200); } else { modifiedMessage = errorMessage.toString(); } <START> error = new Exception(modifiedMessage); <END> } } } catch (Exception e) { LOG.error(e.getMessage(), e); error = e; } finally { running.set(false); finishTime = System.currentTimeMillis(); if (queryId != null) { tajoClient.closeQuery(queryId); } } }</code><technical_language>replace line feed of modifiedMessage html br tag? error message good tajo web sites</technical_language>

Target:
public void run() { startTime = System.currentTimeMillis(); try { tajoClient = TajoHAClientUtil.getTajoClient(tajoConf, tajoClient); if (!tajoClient.getCurrentDatabase().equals(database)) tajoClient.selectDatabase(database); response = tajoClient.executeQuery(query); if (response == null) { LOG.error("Internal Error: SubmissionResponse is NULL"); error = new Exception("Internal Error: SubmissionResponse is NULL"); } else if (response.getResultCode() == ClientProtos.ResultCode.OK) { if (response.getIsForwarded()) { queryId = new QueryId(response.getQueryId()); getQueryResult(queryId); } else { if (!response.hasTableDesc() && !response.hasResultSet()) { } else { getSimpleQueryResult(response); } progress.set(100); } } else if (response.getResultCode() == ClientProtos.ResultCode.ERROR) { if (response.hasErrorMessage()) { StringBuffer errorMessage = new StringBuffer(response.getErrorMessage()); String modifiedMessage; if (errorMessage.length() > 200) { modifiedMessage = errorMessage.substring(0, 200); } else { modifiedMessage = errorMessage.toString(); } String lineSeparator = System.getProperty("line.separator"); modifiedMessage = modifiedMessage.replaceAll(lineSeparator, "<br/>"); error = new Exception(modifiedMessage); } } } catch (Exception e) { LOG.error(e.getMessage(), e); error = e; } finally { running.set(false); finishTime = System.currentTimeMillis(); if (queryId != null) { tajoClient.closeQuery(queryId); } } }
Source:
<code>private String getModule(String shipName){ <START> Set<ResourceUrn> configUrnList = Assets.getAssetHelper().list(Json.class, "[a-zA-Z]*:playerSpawnConfig"); <END> for (ResourceUrn configUrn : configUrnList) {Json json = Assets.getJson(configUrn.toString()); JSONObject rootNode = json.getJsonValue(); if (rootNode.keySet().contains(shipName) && rootNode.get(shipName) instanceof JSONObject) { String moduleName = configUrn.toString().split(":")[0]; return moduleName; } } return "engine"; }</code><technical_language>shipName) {</technical_language>

Target:
private String getModule(String shipName) { Set<ResourceUrn> configUrnList = Assets.getAssetHelper().list(Json.class, "[a-zA-Z]*:playerSpawnConfig"); for (ResourceUrn configUrn : configUrnList) {Json json = Assets.getJson(configUrn.toString()); JSONObject rootNode = json.getJsonValue(); if (rootNode.keySet().contains(shipName) && rootNode.get(shipName) instanceof JSONObject) { return configUrn.toString().split(":")[0]; } } return "engine"; }
Source:
<code>protected HttpWebRequest buildEwsHttpWebRequest() throws Exception { try { HttpWebRequest request = getService().prepareHttpWebRequest(); getService().traceHttpRequestHeaders(TraceFlags.EwsRequestHttpHeaders, request); <START> boolean needSignature = getService().getCredentials() != null && getService().getCredentials().isNeedSignature(); <END> ByteArrayOutputStream requestStream = (ByteArrayOutputStream) request.getOutputStream(); EwsServiceXmlWriter writer = new EwsServiceXmlWriter(getService(), requestStream); writer.setRequireWSSecurityUtilityNamespace(needSignature); writeToXml(writer); if (needSignature) { getService().getCredentials().sign(requestStream); } if (getService().isTraceEnabledFor(TraceFlags.EwsRequest)) { getService().traceXml(TraceFlags.EwsRequest, requestStream); } return request; } catch (IOException e) { throw new ServiceRequestException(String.format(Strings.ServiceRequestFailed, e.getMessage()), e); } }</code><technical_language>Lets move setting of boolean is used</technical_language>

Target:
protected HttpWebRequest buildEwsHttpWebRequest() throws Exception { try { HttpWebRequest request = service.prepareHttpWebRequest(); service.traceHttpRequestHeaders(TraceFlags.EwsRequestHttpHeaders, request); ByteArrayOutputStream requestStream = (ByteArrayOutputStream) request.getOutputStream(); EwsServiceXmlWriter writer = new EwsServiceXmlWriter(service, requestStream); boolean needSignature = service.getCredentials() != null && service.getCredentials().isNeedSignature(); writer.setRequireWSSecurityUtilityNamespace(needSignature); writeToXml(writer); if (needSignature) { service.getCredentials().sign(requestStream); } if (service.isTraceEnabledFor(TraceFlags.EwsRequest)) { service.traceXml(TraceFlags.EwsRequest, requestStream); } return request; } catch (IOException e) { throw new ServiceRequestException(String.format(Strings.ServiceRequestFailed, e.getMessage()), e); } }
Source:
<code>private static AppiumDriver getDriverSafe(WebDriver driver) { if (driver instanceof EventFiringWebDriver) { driver = ((EventFiringWebDriver) driver).getWrappedDriver(); if (driver instanceof AppiumDriver) { return (AppiumDriver) driver; } } <START> if (driver instanceof Proxy) { <END> InvocationHandler innerProxy = Proxy.getInvocationHandler(driver); Field locatorField = null; try { locatorField = innerProxy.getClass().getDeclaredField("arg$2"); } catch (NoSuchFieldException e) { e.printStackTrace(); } locatorField.setAccessible(true); WebDriver appiumDriver = null; try { appiumDriver = (WebDriver) locatorField.get(innerProxy); } catch (IllegalAccessException e) { e.printStackTrace(); } if (appiumDriver instanceof AppiumDriver) { return (AppiumDriver) driver; } } throw new ClassCastException("Appium Driver can not be casted from the actual driver."); }</code><technical_language>explain please do need this rows</technical_language>

Target:
private static AppiumDriver getDriverSafe(WebDriver driver) { if (driver instanceof EventFiringWebDriver) { driver = ((EventFiringWebDriver) driver).getWrappedDriver(); if (driver instanceof AppiumDriver) { return (AppiumDriver) driver; } } if (driver instanceof Proxy) { InvocationHandler innerProxy = Proxy.getInvocationHandler(driver); Field locatorField = null; try { locatorField = innerProxy.getClass().getDeclaredField("arg$2"); } catch (NoSuchFieldException e) { LOGGER.error(e.getMessage()); } if (locatorField!=null) { locatorField.setAccessible(true); WebDriver appiumDriver = null; try { appiumDriver = (WebDriver) locatorField.get(innerProxy); } catch (IllegalAccessException e) { LOGGER.error(e.getMessage()); } if (appiumDriver instanceof AppiumDriver) { return (AppiumDriver) appiumDriver; } } } throw new ClassCastException("Appium Driver can not be casted from the actual driver."); }
Source:
<code>public void shouldResizeTerminal() { openMC("/"); try { for (String partOfContent : CHECK_MC_OPENING) { terminal.waitTextInFirstTerminal(partOfContent); } terminal.waitNoTextInFirstTerminal(".dockerenv"); } catch (TimeoutException ex) { fail("Known issue <LINK_0>", ex); } consoles.clickOnMaximizePanelIcon(); loader.waitOnClosed(); try { for (String partOfContent : CHECK_MC_OPENING) { terminal.waitTextInFirstTerminal(partOfContent); } terminal.waitTextInFirstTerminal(".dockerenv"); } catch (TimeoutException ex) { <START> fail("Known issue <LINK_0>"); <END> } consoles.clickOnMaximizePanelIcon(); loader.waitOnClosed(); try { for (String partOfContent : CHECK_MC_OPENING) { terminal.waitTextInFirstTerminal(partOfContent); } terminal.waitNoTextInFirstTerminal(".dockerenv"); } catch (TimeoutException ex) { fail("Known issue <LINK_0>", ex); } }</code><technical_language>Please, express if is permanent random in error message: permanent failure <LINK_1></technical_language>

Target:
public void shouldResizeTerminal() { openMC("/"); try { for (String partOfContent : CHECK_MC_OPENING) { terminal.waitTextInFirstTerminal(partOfContent); } terminal.waitNoTextInFirstTerminal(".dockerenv"); } catch (TimeoutException ex) { fail("Known random failure <LINK_0>", ex); } consoles.clickOnMaximizePanelIcon(); loader.waitOnClosed(); try { for (String partOfContent : CHECK_MC_OPENING) { terminal.waitTextInFirstTerminal(partOfContent); } terminal.waitTextInFirstTerminal(".dockerenv"); } catch (TimeoutException ex) { fail("Known random failure <LINK_0>", ex); } consoles.clickOnMaximizePanelIcon(); loader.waitOnClosed(); try { for (String partOfContent : CHECK_MC_OPENING) { terminal.waitTextInFirstTerminal(partOfContent); } terminal.waitNoTextInFirstTerminal(".dockerenv"); } catch (TimeoutException ex) { fail("Known random failure <LINK_0>", ex); } }
Source:
<code>public synchronized void reset(boolean cleanListeners) { acceptedChannels.forEach(IOUtil::closeResource); mappedConnections.values().forEach(conn -> close(conn, "EndpointManager is stopping")); <START> connections.forEach(conn -> close(conn, "EndpointManager is stopping")); <END> acceptedChannels.clear(); connectionsInProgress.clear(); mappedConnections.clear(); monitors.clear(); connections.clear(); if (cleanListeners) { connectionListeners.clear(); } }</code><technical_language>minor: EndpointManager -> ConnectionManager</technical_language>

Target:
public synchronized void reset(boolean cleanListeners) { acceptedChannels.forEach(IOUtil::closeResource); mappedConnections.values().forEach(conn -> close(conn, "TcpServerConnectionManager is stopping")); connections.forEach(conn -> close(conn, "TcpServerConnectionManager is stopping")); acceptedChannels.clear(); connectionsInProgress.clear(); mappedConnections.clear(); monitors.clear(); connections.clear(); if (cleanListeners) { connectionListeners.clear(); } }
Source:
<code>public static String map(org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeType glusterVolumeType, String template) { switch (glusterVolumeType) { <START> case DISTRIBUTE: <END> return GlusterVolumeType.DISTRIBUTE.name(); case REPLICATE: return GlusterVolumeType.REPLICATE.name(); case DISTRIBUTED_REPLICATE: return GlusterVolumeType.DISTRIBUTED_REPLICATE.name(); case STRIPE: return GlusterVolumeType.STRIPE.name(); case DISTRIBUTED_STRIPE: return GlusterVolumeType.DISTRIBUTED_STRIPE.name(); default: return null; } }</code><technical_language>If .value() instead of .name(), .toLowerCase() (same is true for places .name())</technical_language>

Target:
public static String map(org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeType glusterVolumeType, String template) { switch (glusterVolumeType) { case DISTRIBUTE: return GlusterVolumeType.DISTRIBUTE.value(); case REPLICATE: return GlusterVolumeType.REPLICATE.value(); case DISTRIBUTED_REPLICATE: return GlusterVolumeType.DISTRIBUTED_REPLICATE.value(); case STRIPE: return GlusterVolumeType.STRIPE.value(); case DISTRIBUTED_STRIPE: return GlusterVolumeType.DISTRIBUTED_STRIPE.value(); default: return null; } }
Source:
<code>@Override public void run() throws InterruptedException { Row row = null; while ((row = source.receive()) != null) { for (Object value: row.getValues()) { int i = 1; if (value instanceof List) { List list = (List) value; for (Object o : list) { if (rel.withOrdinality) { sink.send(Row.of(o, i++)); } else { sink.send(Row.of(o)); } } } else if (value instanceof Map) { Map map = (Map) value; for (Object key : map.keySet()) { if (rel.withOrdinality) { sink.send(Row.of(key, map.get(key), i++)); } else { sink.send(Row.of(key, map.get(key))); } } } else { <START> throw new UnsupportedOperationException("Invalid type for unnest."); <END> } } } }</code><technical_language>include type of in error message easier debug</technical_language>

Target:
@Override public void run() throws InterruptedException { Row row = null; while ((row = source.receive()) != null) { for (Object value: row.getValues()) { if (value == null) { throw new NullPointerException("NULL value for unnest."); } int i = 1; if (value instanceof List) { List list = (List) value; for (Object o : list) { if (rel.withOrdinality) { sink.send(Row.of(o, i++)); } else { sink.send(Row.of(o)); } } } else if (value instanceof Map) { Map map = (Map) value; for (Object key : map.keySet()) { if (rel.withOrdinality) { sink.send(Row.of(key, map.get(key), i++)); } else { sink.send(Row.of(key, map.get(key))); } } } else { throw new UnsupportedOperationException( String.format(Locale.ROOT, "Invalid type: %s for unnest.", value.getClass().getCanonicalName())); } } } }
Source:
<code>private void onTextBoxBase(final TextBoxBase tb) { DeferredCommand.add(new Command() { public void execute() { String orig = strings.get(tb); <START> orig = orig == null ? "" : orig; <END> if (! orig.equals(tb.getText())) { widget.setEnabled(true); } } }); }</code><technical_language>This is easier read: if (orig == null) orig = "";</technical_language>

Target:
private void onTextBoxBase(final TextBoxBase tb) { DeferredCommand.add(new Command() { @Override public void execute() { String orig = strings.get(tb); if (orig == null) { orig = ""; } if (! orig.equals(tb.getText())) { widget.setEnabled(true); } } }); }
Source:
<code>String readString() { byte mark = readByte(); switch(mark) { case 0: return ""; case 1: int size = readByte(); String str = new String(bytes, 0, pos, size); pos += size; return str; case 2: return readUTF(); <START> case 3: <END> default: throw new RuntimeException("Unknown marker(String). mark=" + mark); } }</code><technical_language>Case 3 is redundant</technical_language>

Target:
String readString() { byte mark = readByte(); switch(mark) { case 0: return ""; case 1: int size = readByte(); String str = new String(bytes, 0, pos, size); pos += size; return str; case 2: return readUTF(); default: throw new RuntimeException("Unknown marker(String). mark=" + mark); } }
Source:
<code>public void successfulBoot() throws ConfigurationPersistenceException { final ConfigurationFile configurationFile = environment.getHostConfigurationFile(); ConfigurationFile.InteractionPolicy policy = configurationFile.getInteractionPolicy(); <START> <END> hostPersister.successfulBoot(); if (domainPersister != null) { domainPersister.successfulBoot(); } }</code><technical_language>vars unused</technical_language>

Target:
public void successfulBoot() throws ConfigurationPersistenceException { hostPersister.successfulBoot(); if (domainPersister != null) { domainPersister.successfulBoot(); } }
Source:
<code>private void saveFeedFile(String directory, String fileName) throws IOException { <START> URL fileUrl = new URL(String.format("%s%s/%s.tbz", feedPath, directory, fileName)); <END> File itunesFeedFile = new File(String.format( "%s%s/%s", localFilesPath, itunesDirectory, fileName )); FileUtils.copyURLToFile( fileUrl, itunesFeedFile ); String currentDate = new SimpleDateFormat("yyyy-MM-dd").format(new Date()); s3client.put(String.format("%s_%s", fileName, currentDate), itunesFeedFile); }</code><technical_language>If I understand correctly this downloads latest file time, i.e. give historical files. latest time. If right this is fine</technical_language>

Target:
private void saveFeedFile(String directory, String fileName) throws IOException { URL fileUrl = new URL(String.format("%s%s/%s.tbz", feedPath, directory, fileName)); File itunesFeedFile = new File(String.format( "%stmp_%s/%s", localFilesPath, itunesDirectory, fileName )); FileUtils.copyURLToFile( fileUrl, itunesFeedFile ); String currentDate = new SimpleDateFormat("yyyy-MM-dd").format(new Date()); s3client.put(String.format("%s_%s", fileName, currentDate), itunesFeedFile); }
Source:
<code>public void testGetHeaders() throws Exception { Api api = new Api("test.wikipedia.org"); String inputText = "Test String"; String inputTitle = "Test Title"; ApiResult result = api.action("parse") .param("title", inputTitle) .param("text", inputText) .param("prop", "wikitext") .get(); JSONObject jsonObject = result.asObject(); Map<String, List<String>> m = result.getHeaders(); <START> assertNotNull(m); <END> }</code><technical_language>test length of map zero? fuzzy check for a header? (served-by, maybe? something?)</technical_language>

Target:
public void testGetHeaders() throws Exception { Api api = new Api("test.wikipedia.org"); String inputText = "Test String"; String inputTitle = "Test Title"; ApiResult result = api.action("parse") .param("title", inputTitle) .param("text", inputText) .param("prop", "wikitext") .get(); JSONObject jsonObject = result.asObject(); Map<String, List<String>> m = result.getHeaders(); assertNotNull(m); assertFalse(m.isEmpty()); assertTrue(m.containsKey("Content-Type")); }
Source:
<code>public void tearDown() throws Exception { super.clearDB(); try { final Class<?> entityClass = getEntityClass(); final Class<?> historyClass = getHistoryClass(); final Class<?> trashClass = getTrashClass(); TransactionTemplate transactionTemplate = new TransactionTemplate(getDataTransactionManager()); transactionTemplate.execute(new TransactionCallbackWithoutResult() { @Override protected void doInTransactionWithoutResult(TransactionStatus status) { getDataPersistenceManager().deletePersistentAll(getAll(entityClass, false)); getDataPersistenceManager().deletePersistentAll(getAll(historyClass, false)); getDataPersistenceManager().deletePersistentAll(getAll(trashClass, false)); } }); <START> } catch (ClassNotFoundException e) { <END> throw new IllegalStateException(e); } }</code><technical_language>point in this catch</technical_language>

Target:
public void tearDown() throws Exception { super.clearDB(); final Class<?> entityClass = getEntityClass(); final Class<?> historyClass = getHistoryClass(); final Class<?> trashClass = getTrashClass(); TransactionTemplate transactionTemplate = new TransactionTemplate(getDataTransactionManager()); transactionTemplate.execute(new TransactionCallbackWithoutResult() { @Override protected void doInTransactionWithoutResult(TransactionStatus status) { getDataPersistenceManager().deletePersistentAll(getAll(entityClass, false)); getDataPersistenceManager().deletePersistentAll(getAll(historyClass, false)); getDataPersistenceManager().deletePersistentAll(getAll(trashClass, false)); } }); }
Source:
<code>protected void executeCommand() { String slaveHost = parameter.getSlaveNodeIp(); <START> String slaveRootPassword = parameter.getSlavePassword(); <END> String slaveSShFingerPrint = GlusterUtil.getInstance().getHostSSHFingerPrint(slaveHost); VDSReturnValue sessionCreateReturnValue = null; VDSReturnValue passwordlessSSHCreateReturnValue = runVdsCommand(VDSCommandType.CreatePasswordLessSSHSession, new GlusterSshSessionParameters(slaveHost, slaveSShFingerPrint, parameter.getUserName(), parameter.getSlavePassword())); if (passwordlessSSHCreateReturnValue.getSucceeded()) { sessionCreateReturnValue = runVdsCommand(VDSCommandType.GlusterVolumeGeoRepSessionCreate, new GlusterVolumeGeoRepVDSParamaters(upServer.getId(), masterVolume.getName(), slaveHost, slaveRootPassword, parameter.getSlaveVolumeName(), parameter.isForce())); if (!getSucceeded()) { handleVdsError(AuditLogType.GLUSTER_VOLUME_GEO_REP_CREATE_FAILED, sessionCreateReturnValue.getVdsError().getMessage()); return; } setSucceeded(sessionCreateReturnValue.getSucceeded()); } else { handleVdsError(AuditLogType.GLUSTER_VOLUME_PASSWORD_LESS_SSH_FAILED, passwordlessSSHCreateReturnValue.getVdsError().getMessage()); setSucceeded(false); } getReturnValue().setActionReturnValue(sessionCreateReturnValue); }</code><technical_language>call this 'slaveUserPassword'</technical_language>

Target:
protected void executeCommand() { String slaveHost = parameter.getSlaveNodeIp(); String slaveUserPassword = parameter.getSlavePassword(); String slaveSShFingerPrint = GlusterUtil.getInstance().getHostSSHFingerPrint(slaveHost); VDSReturnValue sessionCreateReturnValue = null; VDSReturnValue passwordlessSSHCreateReturnValue = runVdsCommand(VDSCommandType.CreatePasswordLessSSHSession, new GlusterSshSessionParameters(slaveHost, slaveSShFingerPrint, parameter.getUserName(), parameter.getSlavePassword())); if (passwordlessSSHCreateReturnValue.getSucceeded()) { sessionCreateReturnValue = runVdsCommand(VDSCommandType.GlusterVolumeGeoRepSessionCreate, new GlusterVolumeGeoRepVDSParamaters(upServer.getId(), masterVolume.getName(), slaveHost, slaveUserPassword, parameter.getSlaveVolumeName(), parameter.isForce())); if (!getSucceeded()) { handleVdsError(AuditLogType.GLUSTER_VOLUME_GEO_REP_CREATE_FAILED, sessionCreateReturnValue.getVdsError().getMessage()); return; } setSucceeded(sessionCreateReturnValue.getSucceeded()); } else { handleVdsError(AuditLogType.GLUSTER_VOLUME_PASSWORD_LESS_SSH_FAILED, passwordlessSSHCreateReturnValue.getVdsError().getMessage()); setSucceeded(false); } getReturnValue().setActionReturnValue(sessionCreateReturnValue); }
Source:
<code>public void setSortInfos(List<SortInfo> sortInfo) { if (sortInfoChanged(this.sortInfos, sortInfo)) { this.sortInfos = sortInfo; <START> } <END> }</code><technical_language>of impacts other related PaginableAdapter</technical_language>

Target:
public void setSortInfos(List<SortInfo> sortInfo) { if (sortInfoChanged(this.sortInfos, sortInfo)) { this.sortInfos = sortInfo; refresh(); } }
Source:
<code>public IResource copy(final String newName, final boolean copySuppFiles) { final IPath newPath = getParent().getResource().getFullPath().addTrailingSeparator().append(newName); if (copySuppFiles) { String newElementPath = new Path(getElementPath()).removeLastSegments(1).append(newName).toString(); copySupplementaryFolder(newElementPath); } try { getResource().copy(newPath, IResource.FORCE | IResource.SHALLOW, null); IResource trace = ((IFolder) getParent().getResource()).findMember(newName); <START> if( <END> trace == null ) { return null; } if (trace.exists()) { if( trace instanceof IFolder) { IFolder folderTrace = (IFolder) trace; for (IResource member : folderTrace.members()) { if (TmfTrace.class.getCanonicalName().equals(member.getPersistentProperty(TmfCommonConstants.TRACETYPE))) { member.delete(true, null); } else if (TmfExperiment.class.getCanonicalName().equals(member.getPersistentProperty(TmfCommonConstants.TRACETYPE))) { member.delete(true, null); } } } } return trace; } catch (CoreException e) { } return null; }</code><technical_language>if (</technical_language>

Target:
public IResource copy(final String newName, final boolean copySuppFiles) { final IPath newPath = getParent().getResource().getFullPath().addTrailingSeparator().append(newName); if (copySuppFiles) { String newElementPath = new Path(getElementPath()).removeLastSegments(1).append(newName).toString(); copySupplementaryFolder(newElementPath); } try { getResource().copy(newPath, IResource.FORCE | IResource.SHALLOW, null); IResource trace = ((IFolder) getParent().getResource()).findMember(newName); if (trace instanceof IFolder) { IFolder folderTrace = (IFolder) trace; for (IResource member : folderTrace.members()) { if (TmfTrace.class.getCanonicalName().equals(member.getPersistentProperty(TmfCommonConstants.TRACETYPE))) { member.delete(true, null); } else if (TmfExperiment.class.getCanonicalName().equals(member.getPersistentProperty(TmfCommonConstants.TRACETYPE))) { member.delete(true, null); } } } return trace; } catch (CoreException e) { } return null; }
Source:
<code>private void notifyCompletionToListeners(List<BackupUpdateListener> listeners, boolean backedupWrapperConfig) { String message = backedupWrapperConfig ? "Backup was generated successfully." <START> : "Backup was generated successfully. WrapperConfig backup was skipped, as the Wrapper Config Dir path is unknown."; <END> listeners.forEach(listener -> listener.completed(message)); }</code><technical_language>about: Backup generated successfully. backup of wrapper configuration skipped 'wrapper_config_dir' path is unknown</technical_language>

Target:
private void notifyCompletionToListeners(List<BackupUpdateListener> listeners, boolean backedupWrapperConfig) { String message = backedupWrapperConfig ? "Backup was generated successfully." : "Backup was generated successfully. Backup of wrapper configuration was skipped as the wrapper configuration directory path is unknown."; listeners.forEach(listener -> listener.completed(message)); }
Source:
<code>public boolean isDataAvailable(ScheduledTime t, Properties props) { String rawPathString = props.getProperty(PATH_KEY); Util.requireNonNull(rawPathString); String cookedPathString = tokenReplacer.replaceTimeTokens( rawPathString, t); try { Configuration conf = new Configuration(); FileSystem fs = FileSystem.get(URI.create(cookedPathString), conf); Path path = new Path(cookedPathString); boolean result = fs.exists(path); return result; } catch (IOException e) { return false; <START> } <END> }</code><technical_language>trigger code simply exception escape. code calling triggers robust exceptions anyway, a single exception a trigger halt main loop. Simply add throws Exception Trigger#isDataAvailable. Likewise, exception logging done next higher layer</technical_language>

Target:
public boolean isDataAvailable(ScheduledTime t, Properties props) throws Exception { String rawPathString = props.getProperty(PATH_KEY); Util.requireNonNull(rawPathString); String cookedPathString = tokenReplacer.replaceTimeTokens( rawPathString, t); Configuration conf = new Configuration(); FileSystem fs = FileSystem.get(URI.create(cookedPathString), conf); Path path = new Path(cookedPathString); boolean result = fs.exists(path); return result; }
Source:
<code><START> public List<Storage> listStorages() { <END> final List<Storage> storages; try { storages = storageDbRepository.listStorages(); } catch (RepositoryProblemException e) { LOG.error("DB error occurred when listing storages", e); throw new InternalNakadiException(e.getMessage()); } return storages; }</code><technical_language>declare throws please</technical_language>

Target:
public List<Storage> listStorages() throws InternalNakadiException { final List<Storage> storages; try { storages = storageDbRepository.listStorages(); } catch (RepositoryProblemException e) { LOG.error("DB error occurred when listing storages", e); throw new InternalNakadiException(e.getMessage()); } return storages; }
Source:
<code>private JPanel createJSonPathExtractorTasksPanel() { <START> JPanel xpathActionPanel = new JPanel(); <END> xpathActionPanel.setLayout(new BoxLayout(xpathActionPanel, BoxLayout.X_AXIS)); Border margin = new EmptyBorder(5, 5, 0, 5); xpathActionPanel.setBorder(margin); jsonPathExpressionField = new JLabeledTextField(JMeterUtils.getResString("jsonpath_tester_field")); xpathActionPanel.add(jsonPathExpressionField, BorderLayout.WEST); JButton xpathTester = new JButton(JMeterUtils.getResString("jsonpath_tester_button_test")); xpathTester.setActionCommand(JSONPATH_TESTER_COMMAND); xpathTester.addActionListener(this); xpathActionPanel.add(xpathTester, BorderLayout.EAST); jsonPathResultField = new JTextArea(); jsonPathResultField.setEditable(false); jsonPathResultField.setLineWrap(true); jsonPathResultField.setWrapStyleWord(true); JPanel xpathTasksPanel = new JPanel(new BorderLayout(0, 5)); xpathTasksPanel.add(xpathActionPanel, BorderLayout.NORTH); xpathTasksPanel.add(GuiUtils.makeScrollPane(jsonPathResultField), BorderLayout.CENTER); return xpathTasksPanel; }</code><technical_language>is this panel called xpathActionPanel? Copy'n'paste xpath</technical_language>

Target:
private JPanel createJSonPathExtractorTasksPanel() { JPanel jsonPathActionPanel = new JPanel(); jsonPathActionPanel.setLayout(new BoxLayout(jsonPathActionPanel, BoxLayout.X_AXIS)); Border margin = new EmptyBorder(5, 5, 0, 5); jsonPathActionPanel.setBorder(margin); jsonPathExpressionField = new JLabeledTextField(JMeterUtils.getResString("jsonpath_tester_field")); jsonPathActionPanel.add(jsonPathExpressionField, BorderLayout.WEST); JButton xpathTester = new JButton(JMeterUtils.getResString("jsonpath_tester_button_test")); xpathTester.setActionCommand(JSONPATH_TESTER_COMMAND); xpathTester.addActionListener(this); jsonPathActionPanel.add(xpathTester, BorderLayout.EAST); jsonPathResultField = new JTextArea(); jsonPathResultField.setEditable(false); jsonPathResultField.setLineWrap(true); jsonPathResultField.setWrapStyleWord(true); JPanel xpathTasksPanel = new JPanel(new BorderLayout(0, 5)); xpathTasksPanel.add(jsonPathActionPanel, BorderLayout.NORTH); xpathTasksPanel.add(GuiUtils.makeScrollPane(jsonPathResultField), BorderLayout.CENTER); return xpathTasksPanel; }
Source:
<code>private static void initialIndex() { index.add(key("key1"), def1.getName(), "node1 - value1"); index.add(key("key1"), def2.getName(), 1); index.add(key("key1"), def3.getName(), new String[]{"a", "b", "c"}); index.add(key("key2"), def1.getName(), "node2 - value2"); index.add(key("key2"), def2.getName(), 2); index.add(key("key2"), def3.getName(), new String[]{"d", "e", "f"}); index.add(key("key3"), def1.getName(), "node3 - value3"); index.add(key("key3"), def2.getName(), 3); index.add(key("key3"), def3.getName(), new String[]{"h", "i", "g"}); index.add(key("key4"), def1.getName(), "node4 - value4"); index.add(key("key4"), def2.getName(), 4); index.add(key("key4"), def3.getName(), new String[]{"j", "k", "l"}); index.add(key("key5"), def1.getName(), "node5 - value5"); index.add(key("key5"), def2.getName(), 5); index.add(key("key5"), def3.getName(), new String[]{"m", "n", "o"}); index.add(key("key6"), def1.getName(), "the quick Brown fox jumps over to the dog in at the gate"); index.add(key("key6"), def2.getName(), 55); index.add(key("key6"), def3.getName(), new String[]{"m", "n", "o"}); index.add(key("key7"), def5.getName(), "asd-sdf-dfg"); try { Thread.currentThread().sleep(1000); } catch (Exception e) { <START> } <END> }</code><technical_language>again, interruption</technical_language>

Target:
private static void initialIndex() { index.add(key("key1"), def1.getName(), "node1 - value1"); index.add(key("key1"), def2.getName(), 1); index.add(key("key1"), def3.getName(), new String[]{"a", "b", "c"}); index.add(key("key2"), def1.getName(), "node2 - value2"); index.add(key("key2"), def2.getName(), 2); index.add(key("key2"), def3.getName(), new String[]{"d", "e", "f"}); index.add(key("key3"), def1.getName(), "node3 - value3"); index.add(key("key3"), def2.getName(), 3); index.add(key("key3"), def3.getName(), new String[]{"h", "i", "g"}); index.add(key("key4"), def1.getName(), "node4 - value4"); index.add(key("key4"), def2.getName(), 4); index.add(key("key4"), def3.getName(), new String[]{"j", "k", "l"}); index.add(key("key5"), def1.getName(), "node5 - value5"); index.add(key("key5"), def2.getName(), 5); index.add(key("key5"), def3.getName(), new String[]{"m", "n", "o"}); index.add(key("key6"), def1.getName(), "the quick Brown fox jumps over to the dog in at the gate"); index.add(key("key6"), def2.getName(), 55); index.add(key("key6"), def3.getName(), new String[]{"m", "n", "o"}); index.add(key("key7"), def5.getName(), "asd-sdf-dfg"); index.commit(); }
Source:
<code>public SshClient create(HostAndPort socket, LoginCredentials credentials) { <START> SshClient client = new SshjSshClient(backoffLimitedRetryHandler, socket, credentials, timeout, injector.getInstance(Connector.class)); <END> injector.injectMembers(client); return client; }</code><technical_language>explicit call injector (which "terrible", I add), create a method in module @Provides connector creating a new instance of AgentProvider</technical_language>

Target:
public SshClient create(HostAndPort socket, LoginCredentials credentials) { SshClient client = new SshjSshClient(backoffLimitedRetryHandler, socket, credentials, timeout, getAgentConnector()); injector.injectMembers(client); return client; }
Source:
<code>public void buildDependencyGraph(AbstractProject owner,DependencyGraph graph) { for (Object o : this) { if (o instanceof DependencyDeclarer) { DependencyDeclarer dd = (DependencyDeclarer) o; try { dd.buildDependencyGraph(owner,graph); } catch (RuntimeException e) { String projectName = owner == null ? "unknown" : owner.getFullDisplayName(); <START> LOGGER.log(Level.SEVERE, "Failed to build dependency graph for " + projectName,e); <END> } } } }</code><technical_language>For log messages, getFullName. simply LOGGER.log(Level.SEVERE, "Failed build dependency graph for " + owner, e); information (and more) anyway</technical_language>

Target:
public void buildDependencyGraph(AbstractProject owner,DependencyGraph graph) { for (Object o : this) { if (o instanceof DependencyDeclarer) { DependencyDeclarer dd = (DependencyDeclarer) o; try { dd.buildDependencyGraph(owner,graph); } catch (RuntimeException e) { LOGGER.log(Level.SEVERE, "Failed to build dependency graph for " + owner,e); } } } }
Source:
<code>public void testGetByIndex() { IndexMapper indexMapper = new IndexMapperByIndex(talend6Schema); DiOutgoingSchemaEnforcer enforcer = new DiOutgoingSchemaEnforcer(talend6Schema, indexMapper); enforcer.setWrapped(record); assertThat(enforcer.get(0), equalTo((Object) 1)); assertThat(enforcer.get(1), equalTo((Object) "User")); assertThat(enforcer.get(2), equalTo((Object) 100)); assertThat(enforcer.get(3), equalTo((Object) true)); assertThat(enforcer.get(4), equalTo((Object) new Date(1467170137872L))); <START> assertThat(enforcer.get(5), equalTo((Object) new Date(1000L))); <END> assertThat(enforcer.get(6), equalTo((Object) new Date(1000L))); assertThat(enforcer.get(7), equalTo((Object) new Date(1467170137872L))); }</code><technical_language>expected result is a thousand days 1970-01-01 for column 5</technical_language>

Target:
public void testGetByIndex() { IndexMapper indexMapper = new IndexMapperByIndex(talend6Schema); DiOutgoingSchemaEnforcer enforcer = new DiOutgoingSchemaEnforcer(talend6Schema, indexMapper); enforcer.setWrapped(record); assertThat(enforcer.get(0), equalTo((Object) 1)); assertThat(enforcer.get(1), equalTo((Object) "User")); assertThat(enforcer.get(2), equalTo((Object) 100)); assertThat(enforcer.get(3), equalTo((Object) true)); assertThat(enforcer.get(4), equalTo((Object) new Date(1467170137872L))); assertThat(enforcer.get(5), equalTo((Object) DATE_COMPARE)); assertThat(enforcer.get(6), equalTo((Object) 1000)); assertThat(enforcer.get(7), equalTo((Object) new Date(1467170137872L))); }
Source:
<code>public final <T> T build(Class<T> serviceClass, String userAgent) { ObjectMapper objectMapper = getObjectMapper(); ObjectMapper cborObjectMapper = getCborObjectMapper(); return Feign.builder() .contract(createContract()) .encoder( new InputStreamDelegateEncoder( new TextDelegateEncoder( new CborDelegateEncoder( cborObjectMapper, new JacksonEncoder(objectMapper))))) .decoder(createDecoder(objectMapper, cborObjectMapper)) .errorDecoder(FeignSerializableErrorErrorDecoder.INSTANCE) .client(createOkHttpClient(config.uris())) .options(createRequestOptions()) .logger(new Slf4jLogger(JaxRsClient.class)) <START> .logLevel(Logger.Level.BASIC) <END> .requestInterceptor(UserAgentInterceptor.of(userAgent)) .target(serviceClass, primaryUri); }</code><technical_language>feign's EmptyTarget instead</technical_language>

Target:
public final <T> T build(Class<T> serviceClass, String userAgent) { ObjectMapper objectMapper = getObjectMapper(); ObjectMapper cborObjectMapper = getCborObjectMapper(); return Feign.builder() .contract(createContract()) .encoder( new InputStreamDelegateEncoder( new TextDelegateEncoder( new CborDelegateEncoder( cborObjectMapper, new JacksonEncoder(objectMapper))))) .decoder(createDecoder(objectMapper, cborObjectMapper)) .errorDecoder(FeignSerializableErrorErrorDecoder.INSTANCE) .client(createOkHttpClient(userAgent, config.uris())) .options(createRequestOptions()) .logLevel(Logger.Level.NONE) .target(serviceClass, primaryUri); }
Source:
<code>public static boolean conflictsWithExistingFilenames(String label, String directoryLabel, List<FileMetadata> fileMetadatas, DataFile dataFile) { List<String> filePathsAndNames = new ArrayList<>(); <START> for (FileMetadata fileMetadata : fileMetadatas) { <END> String path = ""; if (fileMetadata.getDirectoryLabel() != null) { path = fileMetadata.getDirectoryLabel() + "/"; } filePathsAndNames.add(path + fileMetadata.getLabel()); } if (label != null || directoryLabel != null) { String path = ""; if (directoryLabel != null) { path = directoryLabel + "/"; } if (label == null) { label = dataFile.getFileMetadata().getLabel(); } String incomingPathPlusFileName = path + label; logger.fine(filePathsAndNames.toString()); logger.fine("incomingPathName: " + incomingPathPlusFileName); if (filePathsAndNames.contains(incomingPathPlusFileName)) { return true; } } return false; }</code><technical_language>combine this findDuplicateFilenames UI api method? passing in filemetadata list dataset version is param for findDuplicateFilenames</technical_language>

Target:
public static boolean conflictsWithExistingFilenames(String label, String directoryLabel, List<FileMetadata> fileMetadatas, DataFile dataFile) { List<String> filePathsAndNames = getPathsAndFileNames(fileMetadatas); if (label != null || directoryLabel != null) { String path = ""; if (directoryLabel != null) { path = directoryLabel + "/"; } if (label == null) { label = dataFile.getFileMetadata().getLabel(); } String incomingPathPlusFileName = path + label; logger.fine(filePathsAndNames.toString()); logger.fine("incomingPathName: " + incomingPathPlusFileName); if (filePathsAndNames.contains(incomingPathPlusFileName)) { return true; } } return false; }
Source:
<code>public static String createUniqueName(WsdlTestCase testCase, String testStepName) { if (testCase.getTestStepByName(testStepName) == null) { return testStepName; } String orgName = testStepName; int cnt = 1; while (testCase.getTestStepByName(testStepName) != null) { <START> testStepName = orgName + " " + String.valueOf(cnt); <END> cnt++; } return testStepName; }</code><technical_language>if ask for test steps named "Smurf", get "Smurf", "Smurf 1" "Smurf 2", I suppose. count start 2</technical_language>

Target:
public static String createUniqueName(WsdlTestCase testCase, String testStepName) { if (testCase.getTestStepByName(testStepName) == null) { return testStepName; } String originalName = testStepName; int count = 2; while (testCase.getTestStepByName(testStepName) != null) { testStepName = originalName + " " + String.valueOf(count); count++; } return testStepName; }
Source:
<code>public final Object visitEvictCommand(InvocationContext ctx, EvictCommand command) throws Throwable { if (!passivation) { return invokeNextInterceptor(ctx, command); } final Object key = command.getKey(); try { <START> cdl.lock(key, true); <END> return invokeNextInterceptor(ctx, command); } finally { cdl.unlock(key); } }</code><technical_language>Do want this throw a TimeoutException? thinking is if acquire lock return running next interceptor a noop method defines</technical_language>

Target:
public final Object visitEvictCommand(InvocationContext ctx, EvictCommand command) throws Throwable { if (!passivation) { return invokeNextInterceptor(ctx, command); } final Object key = command.getKey(); if (!cdl.lock(key, true)) { return null; } try { return invokeNextInterceptor(ctx, command); } finally { cdl.unlock(key); } }
Source:
<code>public static <T> UnicastProcessor<T> create(int capacityHint, Runnable onCancelled, boolean delayError) { <START> return new UnicastProcessor<T>(capacityHint, onCancelled,delayError); <END> }</code><technical_language>nit: newline onCancelled,delayError</technical_language>

Target:
public static <T> UnicastProcessor<T> create(int capacityHint, Runnable onCancelled, boolean delayError) { ObjectHelper.requireNonNull(onCancelled, "onTerminate"); return new UnicastProcessor<T>(capacityHint, onCancelled, delayError); }
Source:
<code>public ListAllODocumentsWidget(String id, IModel<OClass> model, IModel<ODocument> widgetDocumentModel) { super(id, model, widgetDocumentModel); IModel<DisplayMode> modeModel = DisplayMode.VIEW.asModel(); String sql = "select from " + getModelObject().getName(); ODocumentProvider provider = new ODocumentProvider(sql); provider.setFilterState(new ODocumentDataFilter(getModel(), sql, oClassIntrospector)); FilterForm<IODataFilter<ODocument, String>> filterForm = new FilterForm<>("form", provider); oClassIntrospector.defineDefaultSorting(provider, getModelObject()); OrienteerDataTable<ODocument, String> table = new OrienteerDataTable<ODocument, String>("table", oClassIntrospector.getColumnsFor(getModelObject(), true, modeModel), provider, 20); <START> table.setTableFilterForm(filterForm); <END> table.addCommand(new CreateODocumentCommand(table, getModel())); table.addCommand(new EditODocumentsCommand(table, modeModel, getModel())); table.addCommand(new SaveODocumentsCommand(table, modeModel)); table.addCommand(new CopyODocumentCommand(table, getModel())); table.addCommand(new DeleteODocumentCommand(table, getModel())); table.addCommand(new ExportCommand<ODocument>(table, new PropertyModel<String>(model, "name"))); filterForm.add(table); add(filterForm); }</code><technical_language>Mentioned above: this functionality recommended resided in OQueryDataProvider</technical_language>

Target:
public ListAllODocumentsWidget(String id, IModel<OClass> model, IModel<ODocument> widgetDocumentModel) { super(id, model, widgetDocumentModel); IModel<DisplayMode> modeModel = DisplayMode.VIEW.asModel(); String className = getModelObject().getName(); String sql = "select from " + className; IQueryBuilder<ODocument> builder = new ODefaultQueryBuilder<>(className); OQueryDataProvider<ODocument> provider = new OQueryDataProvider<>(sql); provider.setFilterState(new DefaultDataFilter<>(getModel(), builder)); FilterForm<IODataFilter<ODocument, String>> filterForm = new FilterForm<>("form", provider); oClassIntrospector.defineDefaultSorting(provider, getModelObject()); OrienteerDataTable<ODocument, String> table = new OrienteerDataTable<>("table", oClassIntrospector.getColumnsFor(getModelObject(), true, modeModel), provider, 20); table.addFilterForm(filterForm); table.addCommand(new CreateODocumentCommand(table, getModel())); table.addCommand(new EditODocumentsCommand(table, modeModel, getModel())); table.addCommand(new SaveODocumentsCommand(table, modeModel)); table.addCommand(new CopyODocumentCommand(table, getModel())); table.addCommand(new DeleteODocumentCommand(table, getModel())); table.addCommand(new ExportCommand<>(table, new PropertyModel<String>(model, "name"))); filterForm.add(table); add(filterForm); }
Source:
<code>public static void add(Tech tech) { <START> if (Assert.isNonEmpty(tech)) { <END> if (tech.getParent() == null) { topLevelTech.add(tech); } allTech.add(tech); } }</code><technical_language>a null check, done in statement</technical_language>

Target:
public static void add(Tech tech) { if (tech != null) { if (tech.getParent() == null) { topLevelTech.add(tech); } allTech.add(tech); } }