auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public JSONObject printPoolBarcodes(HttpSession session, JSONObject json) { return ControllerHelperServiceUtils.printBarcodes(securityManager, printManager, json, new BarcodePrintAssister<Pool>() { @Override public Pool fetch(long id) throws IOException { return requestManager.getPoolById(id); } @Override public void store(Pool item, User user) throws IOException { <START> item.setLastModifier(user); <END> requestManager.savePool(item); } @Override public String groupName() { return "pools"; } @Override public String idName() { return "poolId"; } @Override public Iterable<Pool> fetchAll(long projectId) throws IOException { return Collections.emptyList(); } }); }</code><technical_language>responsibility of service/requestman layer Hibernatization</technical_language>

Target:
public JSONObject printPoolBarcodes(HttpSession session, JSONObject json) { return ControllerHelperServiceUtils.printBarcodes(printerService, json, new BarcodePrintAssister<Pool>() { @Override public Pool fetch(long id) throws IOException { return requestManager.getPoolById(id); } @Override public void store(Pool item) throws IOException { requestManager.savePool(item); } @Override public String getGroupName() { return "pools"; } @Override public String getIdName() { return "poolId"; } @Override public Iterable<Pool> fetchAll(long projectId) throws IOException { return Collections.emptyList(); } }); }
Source:
<code>public static void rename(final File src, final File dst) throws IOException { int attempts = FS.DETECTED.retryFailedLockFileCommit() ? 10 : 1; while (--attempts >= 0) { if (src.renameTo(dst)) return; try { if (dst.isDirectory()) delete(dst, EMPTY_DIRECTORIES_ONLY | RECURSIVE); else <START> delete(dst, 0); <END> if (src.renameTo(dst)) return; } catch (IOException e) { } try { Thread.sleep(100); } catch (InterruptedException e) { throw new IOException(MessageFormat.format( JGitText.get().renameFileFailed, src.getAbsolutePath(), dst.getAbsolutePath())); } } throw new IOException(MessageFormat.format( JGitText.get().renameFileFailed, src.getAbsolutePath(), dst.getAbsolutePath())); }</code><technical_language>Sure, right. This saves a stat call. Done</technical_language>

Target:
public static void rename(final File src, final File dst) throws IOException { int attempts = FS.DETECTED.retryFailedLockFileCommit() ? 10 : 1; while (--attempts >= 0) { if (src.renameTo(dst)) return; try { if (!dst.delete()) delete(dst, EMPTY_DIRECTORIES_ONLY | RECURSIVE); if (src.renameTo(dst)) return; } catch (IOException e) { } try { Thread.sleep(100); } catch (InterruptedException e) { throw new IOException(MessageFormat.format( JGitText.get().renameFileFailed, src.getAbsolutePath(), dst.getAbsolutePath())); } } throw new IOException(MessageFormat.format( JGitText.get().renameFileFailed, src.getAbsolutePath(), dst.getAbsolutePath())); }
Source:
<code><START> public boolean hasTitleArt() { <END> return hasTitleArt; }</code><technical_language>Boolean</technical_language>

Target:
public Boolean hasTitleArt() { return hasTitleArt; }
Source:
<code>public void syncCloudIdentites(Stack stack, UmsUsersState umsUsersState, BiConsumer<String, String> warnings) { if (CloudPlatform.AZURE.equalsIgnoreCase(stack.getCloudPlatform())) { <START> syncAzureObjectIds(stack, umsUsersState, warnings); <END> } }</code><technical_language>log this nice</technical_language>

Target:
public void syncCloudIdentites(Stack stack, UmsUsersState umsUsersState, BiConsumer<String, String> warnings) { LOGGER.info("Syncing cloud identities for stack = {}", stack); if (CloudPlatform.AZURE.equalsIgnoreCase(stack.getCloudPlatform())) { LOGGER.info("Syncing Azure Object IDs for stack = {}", stack); syncAzureObjectIds(stack, umsUsersState, warnings); } }
Source:
<code>public void testDeleteMaxMutationSize() throws SQLException { String tableName = generateUniqueName(); int NUMBER_OF_ROWS = 20; String ddl = "CREATE TABLE " + tableName + " (V BIGINT PRIMARY KEY, K BIGINT)"; PhoenixConnection conn = (PhoenixConnection) DriverManager.getConnection(getUrl()); conn.createStatement().execute(ddl); for(int i = 0; i < NUMBER_OF_ROWS; i++) { conn.createStatement().execute( "UPSERT INTO " + tableName + " VALUES (" + i + ", "+ i + ")"); conn.commit(); } Properties props = new Properties(); props.setProperty(QueryServices.MAX_MUTATION_SIZE_ATTRIB, String.valueOf(NUMBER_OF_ROWS / 2)); PhoenixConnection connection = (PhoenixConnection) DriverManager.getConnection(getUrl(), props); connection.setAutoCommit(false); try { for(int i = 0; i < NUMBER_OF_ROWS; i++) { connection.createStatement().execute( "DELETE FROM " + tableName + " WHERE K = " + i ); } } catch (SQLException e) { assertTrue(e.getMessage().contains( SQLExceptionCode.MAX_MUTATION_SIZE_EXCEEDED.getMessage())); } props = new Properties(); props.setProperty(QueryServices.MAX_MUTATION_SIZE_BYTES_ATTRIB, "10"); connection = (PhoenixConnection) DriverManager.getConnection(getUrl(), props); connection.setAutoCommit(false); try { <START> for(int i = 0; i < NUMBER_OF_ROWS; i++) { <END> connection.createStatement().execute( "DELETE FROM " + tableName + " WHERE K = " + i ); } } catch (SQLException e) { assertTrue(e.getMessage().contains( SQLExceptionCode.MAX_MUTATION_SIZE_BYTES_EXCEEDED.getMessage())); } }</code><technical_language>Instead of running delete in a for loop, a single statement "DELETE tableName", this throw exception</technical_language>

Target:
public void testDeleteMaxMutationSize() throws SQLException { String tableName = generateUniqueName(); int NUMBER_OF_ROWS = 20; String ddl = "CREATE TABLE " + tableName + " (V BIGINT PRIMARY KEY, K BIGINT)"; PhoenixConnection conn = (PhoenixConnection) DriverManager.getConnection(getUrl()); conn.createStatement().execute(ddl); for(int i = 0; i < NUMBER_OF_ROWS; i++) { conn.createStatement().execute( "UPSERT INTO " + tableName + " VALUES (" + i + ", "+ i + ")"); conn.commit(); } Properties props = new Properties(); props.setProperty(QueryServices.MAX_MUTATION_SIZE_ATTRIB, String.valueOf(NUMBER_OF_ROWS / 2)); PhoenixConnection connection = (PhoenixConnection) DriverManager.getConnection(getUrl(), props); connection.setAutoCommit(false); try { for(int i = 0; i < NUMBER_OF_ROWS; i++) { connection.createStatement().execute( "DELETE FROM " + tableName + " WHERE K = " + i ); } } catch (SQLException e) { assertTrue(e.getMessage().contains( SQLExceptionCode.MAX_MUTATION_SIZE_EXCEEDED.getMessage())); } props.setProperty(QueryServices.MAX_MUTATION_SIZE_BYTES_ATTRIB, "10"); props.setProperty(QueryServices.MAX_MUTATION_SIZE_ATTRIB, "10000"); connection = (PhoenixConnection) DriverManager.getConnection(getUrl(), props); connection.setAutoCommit(false); try { connection.createStatement().execute("DELETE FROM " + tableName ); } catch (SQLException e) { assertTrue(e.getMessage().contains( SQLExceptionCode.MAX_MUTATION_SIZE_BYTES_EXCEEDED.getMessage())); } }
Source:
<code>void moreHitPointsThanHits() { final List<Unit> targetUnits = List.of(givenAnyUnit(), givenAnyUnit()); targetUnits.forEach( unit -> { final UnitAttachment unitAttachment = (UnitAttachment) unit.getType().getAttachment(UNIT_ATTACHMENT_NAME); when(unitAttachment.getHitPoints()).thenReturn(2); }); final FiringGroup firingGroup = new FiringGroup("", "", List.of(), targetUnits); final FireRoundState fireRoundState = new FireRoundState(); fireRoundState.setDice(givenDiceRollWithHits(3)); final SelectCasualties selectCasualties = new SelectCasualties( battleState, BattleState.Side.OFFENSE, firingGroup, fireRoundState, (arg1, arg2) -> new CasualtyDetails()); final SelectMainBattleCasualties.Select selectFunction = mock(SelectMainBattleCasualties.Select.class); final CasualtyDetails expected = new CasualtyDetails(); when(selectFunction.apply(any(), any(), anyCollection(), anyInt())).thenReturn(expected); final CasualtyDetails details = new SelectMainBattleCasualties(selectFunction).apply(delegateBridge, selectCasualties); assertThat(details, is(expected)); verify(selectFunction) .apply( eq(delegateBridge), eq(selectCasualties), (Collection<Unit>) argThat(containsInAnyOrder(targetUnits.toArray())), <START> eq(3)); <END> }</code><technical_language>side-note, a pretty heavy lift in this test verifying implementation calls. If code test instead return a result object, caller invoke select function, more testable, functional, easier understand reading prod code (fewer side effects)</technical_language>

Target:
void moreHitPointsThanHits() { final List<Unit> targetUnits = List.of(givenAnyUnit(), givenAnyUnit()); targetUnits.forEach( unit -> { final UnitAttachment unitAttachment = (UnitAttachment) unit.getType().getAttachment(UNIT_ATTACHMENT_NAME); when(unitAttachment.getHitPoints()).thenReturn(2); }); final FiringGroup firingGroup = FiringGroup.groupBySuicideOnHit(UNITS, List.of(firingUnit), targetUnits).get(0); final FireRoundState fireRoundState = new FireRoundState(); fireRoundState.setDice(givenDiceRollWithHits(3)); final SelectCasualties selectCasualties = new SelectCasualties( battleState, BattleState.Side.OFFENSE, firingGroup, fireRoundState, (arg1, arg2) -> new CasualtyDetails()); final SelectMainBattleCasualties.Select selectFunction = mock(SelectMainBattleCasualties.Select.class); final CasualtyDetails expected = new CasualtyDetails(); when(selectFunction.apply(any(), any(), anyCollection(), anyInt())).thenReturn(expected); final CasualtyDetails details = new SelectMainBattleCasualties(selectFunction).apply(delegateBridge, selectCasualties); assertThat(details, is(expected)); verify(selectFunction) .apply( eq(delegateBridge), eq(selectCasualties), (Collection<Unit>) argThat(containsInAnyOrder(targetUnits.toArray())), eq(3)); }
Source:
<code><START> public synchronized static void storeOnImageRegistry(String key, ImageDescriptor descriptor) { <END> getImageRegistry().put(key, descriptor); }</code><technical_language>private</technical_language>

Target:
private synchronized static void storeOnImageRegistry(String key, ImageDescriptor descriptor) { getImageRegistry().put(key, descriptor); }
Source:
<code><START> public UserConfigLoader(HiveConf conf) { <END> this.hiveConf = conf; }</code><technical_language>this protected abstract class</technical_language>

Target:
protected UserConfigLoader(HiveConf conf) { this.hiveConf = conf; }
Source:
<code>public void updateDataSourceName(CorrelationDataSource eamDataSource, String newName) throws EamDbException { Connection conn = connect(); PreparedStatement preparedStatement = null; String sql = "UPDATE data_sources SET name = ? WHERE id = ?"; try { preparedStatement = conn.prepareStatement(sql); preparedStatement.setString(1, newName); preparedStatement.setInt(2, eamDataSource.getID()); preparedStatement.executeUpdate(); <START> CorrelationDataSource updatedDataSource = new CorrelationDataSource( <END> eamDataSource.getCaseID(), eamDataSource.getID(), eamDataSource.getDeviceID(), newName, eamDataSource.getDataSourceObjectID()); dataSourceCacheByDsObjectId.put(getDataSourceByDSObjectIdCacheKey(updatedDataSource.getCaseID(), updatedDataSource.getDataSourceObjectID()), updatedDataSource); dataSourceCacheById.put(getDataSourceByIdCacheKey(updatedDataSource.getCaseID(), updatedDataSource.getID()), updatedDataSource); } catch (SQLException ex) { throw new EamDbException("Error updating name of data source with ID " + eamDataSource.getDataSourceObjectID() + " to " + newName, ex); } finally { EamDbUtil.closeStatement(preparedStatement); EamDbUtil.closeConnection(conn); } }</code><technical_language>Merged changes caused longer a constructor arguments</technical_language>

Target:
public void updateDataSourceName(CorrelationDataSource eamDataSource, String newName) throws EamDbException { Connection conn = connect(); PreparedStatement preparedStatement = null; String sql = "UPDATE data_sources SET name = ? WHERE id = ?"; try { preparedStatement = conn.prepareStatement(sql); preparedStatement.setString(1, newName); preparedStatement.setInt(2, eamDataSource.getID()); preparedStatement.executeUpdate(); CorrelationDataSource updatedDataSource = new CorrelationDataSource( eamDataSource.getCaseID(), eamDataSource.getID(), eamDataSource.getDeviceID(), newName, eamDataSource.getDataSourceObjectID(), eamDataSource.getMd5(), eamDataSource.getSha1(), eamDataSource.getSha256()); dataSourceCacheByDsObjectId.put(getDataSourceByDSObjectIdCacheKey(updatedDataSource.getCaseID(), updatedDataSource.getDataSourceObjectID()), updatedDataSource); dataSourceCacheById.put(getDataSourceByIdCacheKey(updatedDataSource.getCaseID(), updatedDataSource.getID()), updatedDataSource); } catch (SQLException ex) { throw new EamDbException("Error updating name of data source with ID " + eamDataSource.getDataSourceObjectID() + " to " + newName, ex); } finally { EamDbUtil.closeStatement(preparedStatement); EamDbUtil.closeConnection(conn); } }
Source:
<code>public void listProjectUsersWithSpecificPermissions_ShouldReturnUsers() { List<User> foundUsers = sut.listProjectUsersWithPermissions(testProject, ANNOTATOR); <START> assertThat(foundUsers).hasSize(2); <END> assertThat(foundUsers).contains(beate, kevin); }</code><technical_language>instead of checking for size containment containsExactly</technical_language>

Target:
public void listProjectUsersWithSpecificPermissions_ShouldReturnUsers() { List<User> foundUsers = sut.listProjectUsersWithPermissions(testProject, ANNOTATOR); assertThat(foundUsers).containsExactly(beate, kevin); }
Source:
<code>public void huge64bitFile() { File hugeFile = new File(tmpDir, "huge64bitFileTest.txt"); try { RandomAccessFile largeFile = new RandomAccessFile(hugeFile, "rw"); largeFile.setLength(4* 1024 * 1024 * 1024 + 2); } catch (IOException e) { <START> fail("unable to prepare source directory for zipping", e); <END> } File zipFile = null; ZipArchiver archiver = null; try { zipFile = File.createTempFile("test", ".zip"); archiver = new ZipArchiver(Files.newOutputStream(zipFile.toPath())); archiver.visit(hugeFile, "huge64bitFileTest.txt"); } catch (Exception e) { fail("exception driving ZipArchiver", e); } finally { if (archiver != null) { try { archiver.close(); } catch (IOException e) { } } } String zipEntryName = null; ZipFile zipFileVerify = null; try { zipFileVerify = new ZipFile(zipFile); zipEntryName = ((ZipEntry) zipFileVerify.entries().nextElement()).getName(); } catch (Exception e) { fail("failure enumerating zip entries", e); } finally { if (zipFileVerify != null) { try { zipFileVerify.close(); } catch (IOException e) { } } } assertEquals("huge64bitFileTest.txt", zipEntryName); }</code><technical_language>IIUC need 4GB of free disk space for this test pass. sense consider test skipped, if possible, if fail create file? Similar OS dependent tests</technical_language>

Target:
public void huge64bitFile() { File hugeFile = new File(tmpDir, "huge64bitFileTest.txt"); try { RandomAccessFile largeFile = new RandomAccessFile(hugeFile, "rw"); largeFile.setLength(4 * 1024 * 1024 * 1024 + 2); } catch (IOException e) { LOGGER.log(Level.SEVERE, "Couldn't set up huge file for huge64bitFile test", e); return; } File zipFile = null; ZipArchiver archiver = null; try { zipFile = File.createTempFile("test", ".zip"); archiver = new ZipArchiver(Files.newOutputStream(zipFile.toPath())); archiver.visit(hugeFile, "huge64bitFileTest.txt"); } catch (Exception e) { fail("exception driving ZipArchiver", e); } finally { if (archiver != null) { try { archiver.close(); } catch (IOException e) { } } } String zipEntryName = null; ZipFile zipFileVerify = null; try { zipFileVerify = new ZipFile(zipFile); zipEntryName = ((ZipEntry) zipFileVerify.entries().nextElement()).getName(); } catch (Exception e) { fail("failure enumerating zip entries", e); } finally { if (zipFileVerify != null) { try { zipFileVerify.close(); } catch (IOException e) { } } } assertEquals("huge64bitFileTest.txt", zipEntryName); }
Source:
<code>private void connect() throws XAException { if (delegate != null) { return; } try { xaConnection = xaConnectionFactory.createXAConnection(); xaSession = xaConnection.createXASession(); delegate = xaSession.getXAResource(); } catch (JMSException e) { LOGGER.warn("Failed to create connection", e); <START> throw new XAException(XAException.XAER_PROTO); <END> } }</code><technical_language>RMFAIL</technical_language>

Target:
private boolean connect() { if (delegate != null) { return true; } try { xaConnection = createXAConnection(); xaSession = xaConnection.createXASession(); delegate = xaSession.getXAResource(); } catch (JMSException e) { LOGGER.warn("Failed to create connection", e); return false; } return true; }
Source:
<code>private Object writeCollectionValue(Object value, ElasticsearchPersistentProperty property, TypeInformation<?> typeHint) { Streamable collectionSource = value instanceof Iterable ? Streamable.of((Iterable) value) : Streamable.of(ObjectUtils.toObjectArray(value)); List<Object> target = new LinkedList<>(); if (!typeHint.getActualType().getType().equals(Object.class) && conversions.isSimpleType(typeHint.getActualType().getType())) { collectionSource.map(this::getWriteSimpleValue).forEach(target::add); } else { Streamable.of((Iterable) value).map(it -> { if (it == null) { return null; } if (conversions.isSimpleType(it.getClass())) { <START> return getWriteSimpleValue(it); <END> } return getWriteComplexValue(property, ClassTypeInformation.from(it.getClass()), it); }).forEach(target::add); } return target; }</code><technical_language>want retain null values in lists</technical_language>

Target:
private Object writeCollectionValue(Object value, ElasticsearchPersistentProperty property, TypeInformation<?> typeHint) { Streamable<?> collectionSource = value instanceof Iterable ? Streamable.of((Iterable<?>) value) : Streamable.of(ObjectUtils.toObjectArray(value)); List<Object> target = new ArrayList<>(); if (!typeHint.getActualType().getType().equals(Object.class) && isSimpleType(typeHint.getActualType().getType())) { collectionSource.map(this::getWriteSimpleValue).forEach(target::add); } else { collectionSource.map(it -> { if (it == null) { return null; } if (isSimpleType(it)) { return getWriteSimpleValue(it); } return getWriteComplexValue(property, ClassTypeInformation.from(it.getClass()), it); }).forEach(target::add); } return target; }
Source:
<code>private void attemptResourceInitialization(CommCarePlatform platform, boolean isUpgrade, Resource r, Vector<Resource> missingResources) throws ResourceInitializationException { try { r.getInstaller().initialize(platform, isUpgrade); } catch (FileNotFoundException e) { missingResources.add(r); } catch (IOException | InvalidStructureException | InvalidReferenceException | XmlPullParserException | UnfullfilledRequirementsException e) { throw new ResourceInitializationException(r, e); } <START> if (r.getStatus() == Resource.RESOURCE_STATUS_UNINITIALIZED) { <END> missingResources.add(r); } }</code><technical_language>Hm, this worries a bit, do a positive verification for resources in a bad state (IE: Resource.RESOURCE_STATUS_CORRUPTED similar)? I of 'recovery' process 'safe' for resources in acceptable state, wary of ambiguity uninitialized 'broken'</technical_language>

Target:
private void attemptResourceInitialization(CommCarePlatform platform, boolean isUpgrade, Resource r, Vector<Resource> missingResources) throws ResourceInitializationException { try { r.getInstaller().initialize(platform, isUpgrade); } catch (FileNotFoundException e) { missingResources.add(r); } catch (IOException | InvalidStructureException | InvalidReferenceException | XmlPullParserException | UnfullfilledRequirementsException e) { throw new ResourceInitializationException(r, e); } if (r.getStatus() == Resource.RESOURCE_STATUS_UNINITIALIZED) { Logger.log(LogTypes.SOFT_ASSERT, "Failed to initialize resource with descriptor " + r.getDescriptor() + " and id " + r.getResourceId()); } }
Source:
<code>public synchronized void unregister(URI key) { <START> if (locks.containsKey(key)) { <END> LockProvider provider = locks.get(key); if (provider != null) { provider.decreateCount(); if (provider.getRegisterCount() < 1) { locks.remove(key); } } } }</code><technical_language>Unnecessary next lines perform a get test for null result</technical_language>

Target:
public synchronized void unregister(URI key) { LockProvider provider = locks.get(key); if (provider != null) { provider.decreateCount(); if (provider.getRegisterCount() < 1) { locks.remove(key); } } }
Source:
<code>private void processLoads(final IDMContext context, final DataRequestMonitor<ILoadInfo> rm, final ProcStatCoreLoads loads) { if (context instanceof ICoreDMContext) { String coreId = ((ICoreDMContext) context).getId(); <START> int load = (int)loads.get("cpu"+coreId).floatValue(); END> rm.done(new GDBLoadInfo(Integer.toString(load))); } else if (context instanceof ICPUDMContext) { getCores(context, new ImmediateDataRequestMonitor<ICoreDMContext[]>() { @Override protected void handleCompleted() { ICoreDMContext[] coreContexts = getData(); if (!isSuccess() || coreContexts == null || coreContexts.length < 1) { rm.done(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, "Can't get load info for CPU", null)); return; } int i = 0; float load = 0.0f; for (ICoreDMContext coreCtx : coreContexts) { String coreId = coreCtx.getId(); load += loads.get("cpu"+coreId); i++; } load /= i; String wm = null; rm.done(new GDBLoadInfo(Integer.toString((int)load), wm)); } } ); } else { rm.done(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, "Wrong context type", null)); } }</code><technical_language>This internal API is obscure. Accessing ProcStatCoreLoads string indices a clear go. ProcStatCoreLoads a richer clearer use? a method Float getLoad(String cpuId) String getLoad(String cpuId)</technical_language>

Target:
private void processLoads(final IDMContext context, final DataRequestMonitor<ILoadInfo> rm, final ProcStatCoreLoads loads) { if (loads == null) { rm.done(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, INTERNAL_ERROR,"Can't get load info", null)); return; } if (context instanceof ICoreDMContext) { String coreId = ((ICoreDMContext) context).getId(); float load = loads.getLoad(coreId); String wm = null; rm.done(new GDBLoadInfo(Integer.toString((int)load),wm)); } else if (context instanceof ICPUDMContext) { getCores(context, new ImmediateDataRequestMonitor<ICoreDMContext[]>() { @Override protected void handleCompleted() { ICoreDMContext[] coreContexts = getData(); if (!isSuccess() || coreContexts == null || coreContexts.length < 1) { rm.done(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, INTERNAL_ERROR,"Can't get load info for CPU", null)); return; } int i = 0; float load = 0.0f; for (ICoreDMContext coreCtx : coreContexts) { String coreId = coreCtx.getId(); load += loads.getLoad(coreId); i++; } load /= i; String wm = null; rm.done(new GDBLoadInfo(Integer.toString((int)load), wm)); } } ); } }
Source:
<code>public File export(final String cropName, final String programUUID) { try { final File temporaryFolder = Files.createTempDir(); final String fileNameFullPath = temporaryFolder.getAbsolutePath() + File.separator + GermplasmExcelTemplateExportServiceImpl.FILE_NAME; return this.generateTemplateFile(fileNameFullPath, cropName, programUUID); } catch (final IOException e) { final BindingResult errors = new MapBindingResult(new HashMap<String, String>(), Integer.class.getName()); <START> errors.reject("cannot.exportAsXLS.germplasm.template", ""); <END> throw new ResourceNotFoundException(errors.getAllErrors().get(0)); } }</code><technical_language>exportAsXLS separate</technical_language>

Target:
public File export(final String cropName, final String programUUID) { try { final File temporaryFolder = Files.createTempDir(); final String fileNameFullPath = temporaryFolder.getAbsolutePath() + File.separator + GermplasmExcelTemplateExportServiceImpl.FILE_NAME; return this.generateTemplateFile(fileNameFullPath, cropName, programUUID); } catch (final IOException e) { final BindingResult errors = new MapBindingResult(new HashMap<String, String>(), Integer.class.getName()); errors.reject("cannot.export.as.xls.germplasm.template", ""); throw new ResourceNotFoundException(errors.getAllErrors().get(0)); } }
Source:
<code>private RevisionInfo resolveRevisionToDisplay(ChangeInfo info) { if (revision == null) { revision = info.current_revision(); } else <START> if (!info.revisions().containsKey(revision)) { JsArray<RevisionInfo> list = info.revisions().values(); for (int i = 0; i < list.length(); i++) { RevisionInfo r = list.get(i); if (revision.equals(String.valueOf(r._number()))) { revision = r.name(); break; } } } <END> RevisionInfo rev = revision != null ? info.revision(revision) : null; if (rev != null) { return rev; } JsArray<RevisionInfo> revisions = info.revisions().values(); if (revisions.length() > 0) { RevisionInfo.sortRevisionInfoByNumber(revisions); rev = revisions.get(revisions.length() - 1); revision = rev.name(); return rev; } else { new ErrorDialog( Resources.M.changeWithNoRevisions(info.legacy_id().get())).center(); throw new IllegalStateException("no revision, cannot proceed"); } }</code><technical_language>Duplicated below. this in a shared method</technical_language>

Target:
private RevisionInfo resolveRevisionToDisplay(ChangeInfo info) { RevisionInfo rev = resolveRevisionOrPatchSetId(info, revision, info.current_revision()); if (rev != null) { revision = rev.name(); return rev; } JsArray<RevisionInfo> revisions = info.revisions().values(); if (revisions.length() > 0) { RevisionInfo.sortRevisionInfoByNumber(revisions); rev = revisions.get(revisions.length() - 1); revision = rev.name(); return rev; } else { new ErrorDialog( Resources.M.changeWithNoRevisions(info.legacy_id().get())).center(); throw new IllegalStateException("no revision, cannot proceed"); } }
Source:
<code>public void expandParent(int parentIndex) { int parentWrapperIndex = getParentWrapperIndex(parentIndex); Object helperItem = getHelperItem(parentWrapperIndex); ParentWrapper parentWrapper = null; if (helperItem instanceof ParentWrapper) { parentWrapper = (ParentWrapper) helperItem; } <START> if (parentWrapper == null) { <END> return; } expandViews(parentWrapperIndex); }</code><technical_language>this bit of if's cleaned some, this (can't if parentwrapper is needed in this case)? java if (helperItem instanceof ParentWrapper) { expandViews(parentWrapperIndex); }</technical_language>

Target:
public void expandParent(int parentIndex) { int parentWrapperIndex = getParentWrapperIndex(parentIndex); Object helperItem = getHelperItem(parentWrapperIndex); ParentWrapper parentWrapper; if (helperItem instanceof ParentWrapper) { parentWrapper = (ParentWrapper) helperItem; } else { return; } expandViews(parentWrapper, parentWrapperIndex); }
Source:
<code>public boolean setRenderer(Renderer newRenderer){ <START> boolean rendererChanged = false; <END> if (newRenderer!=null){ if (renderer==null || !newRenderer.equals(renderer.getSchema())){ renderer = Engine.factory.getEngineObject(newRenderer); this.setWidth(renderer.getWidth()); this.setHeight(renderer.getHeight()); rendererChanged=true; } } else { if (renderer!=null){ rendererChanged=true; } renderer=null; this.setWidth(0); this.setHeight(0); } return rendererChanged; }</code><technical_language>important return if renderer changed? log some messages. this method return void, avoid equals in line 120</technical_language>

Target:
public boolean setRenderer(Renderer newRenderer) { boolean rendererChanged = false; if (newRenderer != null) { renderer = Engine.factory.getEngineObject(newRenderer); this.setWidth(renderer.getWidth()); this.setHeight(renderer.getHeight()); rendererChanged = true; } else { if (renderer != null) { rendererChanged = true; } renderer = null; this.setWidth(0); this.setHeight(0); } return rendererChanged; }
Source:
<code>public void fullTextWithSpecialChars() throws Exception { TestRepository<InMemoryRepository> repo = createProject("repo"); RevCommit commit1 = repo.parseBody(repo.commit().message("foo_bar_foo").create()); Change change1 = newChange(repo, commit1, null, null, null).insert(); RevCommit commit2 = repo.parseBody(repo.commit().message("one.two.three").create()); Change change2 = newChange(repo, commit2, null, null, null).insert(); assertTrue(query("message:foo_ba").isEmpty()); assertResultEquals(change1, queryOne("message:bar")); <START> assertResultEquals(change1, queryOne("message:foo_bar")); <END> assertResultEquals(change2, queryOne("message:two")); assertResultEquals(change2, queryOne("message:one.two")); }</code><technical_language>I "foo bar" return result, no? for "one two" below</technical_language>

Target:
public void fullTextWithSpecialChars() throws Exception { TestRepository<InMemoryRepository> repo = createProject("repo"); RevCommit commit1 = repo.parseBody(repo.commit().message("foo_bar_foo").create()); Change change1 = newChange(repo, commit1, null, null, null).insert(); RevCommit commit2 = repo.parseBody(repo.commit().message("one.two.three").create()); Change change2 = newChange(repo, commit2, null, null, null).insert(); assertTrue(query("message:foo_ba").isEmpty()); assertResultEquals(change1, queryOne("message:bar")); assertResultEquals(change1, queryOne("message:foo_bar")); assertResultEquals(change1, queryOne("message:foo bar")); assertResultEquals(change2, queryOne("message:two")); assertResultEquals(change2, queryOne("message:one.two")); assertResultEquals(change2, queryOne("message:one two")); }
Source:
<code>private Endpoint toEndpoint(String name, ServerConfigImpl config) { String stringPort = config.getPort().split("/")[0]; Map<String, String> attributes = new HashMap<>(config.getAttributes()); putIfNotNull(attributes, "protocol", config.getProtocol()); putIfNotNull(attributes, "path", config.getPath()); String isInternal = config.getAttributes().remove(ServerConfig.INTERNAL_SERVER_ATTRIBUTE); if ("true".equals(isInternal)) { <START> attributes.put("public", "false"); <END> } return new Endpoint() .withName(name) .withPort(Integer.parseInt(stringPort)) .withAttributes(attributes); }</code><technical_language>Consider constant instead of literal public</technical_language>

Target:
private Endpoint toEndpoint(String name, ServerConfigImpl config) { String stringPort = config.getPort().split("/")[0]; Map<String, String> attributes = new HashMap<>(config.getAttributes()); putIfNotNull(attributes, "protocol", config.getProtocol()); putIfNotNull(attributes, "path", config.getPath()); String isInternal = config.getAttributes().remove(ServerConfig.INTERNAL_SERVER_ATTRIBUTE); if ("true".equals(isInternal)) { attributes.put(PUBLIC_ENDPOINT_ATTRIBUTE, "false"); } return new Endpoint() .withName(name) .withPort(Integer.parseInt(stringPort)) .withAttributes(attributes); }
Source:
<code>public ValidationResult validate(RuntimeContainer container) { <START> ValidationResultMutable vr = new ValidationResultMutable(); <END> try { connection = connect(); vr.setStatus(ValidationResult.Result.OK); } catch (Exception ex) { fillValidationResult(vr, ex); } return vr; }</code><technical_language>immutable ValidationResult</technical_language>

Target:
public ValidationResult validate(RuntimeContainer container) { try { connection = connect(); return ValidationResult.OK; } catch (Exception ex) { return createValidationResult(ex); } }
Source:
<code>public void tripletsWhoseSumIs1001() { List<PythagoreanTriplet> actual = PythagoreanTriplet .makeTripletsList() .withFactorsLessThanOrEqualTo(1001) .thatSumTo(1001) .build(); <START> List<PythagoreanTriplet> expected = Arrays.asList(); <END> assertEquals(expected.size(), actual.size()); for (int i = 0; i < expected.size(); ++i) { assertEquals(expected.get(i), actual.get(i)); } }</code><technical_language>Collections.emptyList</technical_language>

Target:
public void tripletsWhoseSumIs1001() { List<PythagoreanTriplet> actual = PythagoreanTriplet .makeTripletsList() .withFactorsLessThanOrEqualTo(1001) .thatSumTo(1001) .build(); List<PythagoreanTriplet> expected = Collections.emptyList(); assertEquals(expected, actual); }
Source:
<code>public CommandContext withoutCompensationContext() { <START> return withCompensationContext(new DefaultCompensationContext()); <END> }</code><technical_language>return withCompensationContext(new *NoOpCompensationContext*()) return withCompensationContext(NoOpCompensationContext.getInstance())</technical_language>

Target:
public CommandContext withoutCompensationContext() { return withCompensationContext(null); }
Source:
<code>private static String getSignature(PsiElement element) { if (element instanceof GoFunctionDeclaration) { return "func " + ((GoFunctionDeclaration)element).getIdentifier().getText() + ((GoFunctionDeclaration)element).getSignature().getText() + <START> "<br/><br/>"; <END> } if (element instanceof GoMethodDeclaration) { return "func " + ((GoMethodDeclaration)element).getReceiver().getText() + " " + ((GoMethodDeclaration)element).getIdentifier().getText() + ((GoMethodDeclaration)element).getSignature().getText() + "<br/><br/>"; } return ""; }</code><technical_language><br/></technical_language>

Target:
private static String getSignature(PsiElement element) { if (!(element instanceof GoSignatureOwner)) { return ""; } PsiElement identifier = null; if (element instanceof GoNamedSignatureOwner) { identifier = ((GoNamedSignatureOwner)element).getIdentifier(); } GoSignature signature = ((GoSignatureOwner)element).getSignature(); if (identifier == null && signature == null) { return ""; } String result = " <b>func " + (identifier != null ? identifier.getText() : "") + "("; if (signature != null) { result += getParametersAsString(signature.getParameters()); } result += ")"; if (signature != null && signature.getResult() != null) { GoResult signatureResult = signature.getResult(); if (signatureResult.getParameters() != null){ String signatureParameters = getParametersAsString(signatureResult.getParameters()); if (signatureParameters.length() > 0) { result += " (" + signatureParameters + ")"; } } else if (signatureResult.getType() != null) { GoType signatureResultType = signatureResult.getType(); if (signatureResultType instanceof GoTypeList) { result += " (" + signatureResult.getType().getText() + ")"; } else { result += " " + signatureResult.getType().getText(); } } } return result + "</b><br/>"; }
Source:
<code><START> public void testDeserialization() throws Exception { <END> for (Short version : versions) { composedBlobIdAndDeserialize(version); } }</code><technical_language>I understand need of this test. next tests serialization deserialization if I wrong. this tests more next</technical_language>

Target:
public void testDeserialization() throws Exception { composedBlobIdAndDeserialize(version); }
Source:
<code>public void emitModifiers(ImmutableSet<Modifier> modifiers) { <START> for (Modifier modifier : modifiers) { <END> emitAndIndent(Ascii.toLowerCase(modifier.name())); emitAndIndent(" "); } }</code><technical_language>java for (Modifier modifier : EnumSet.copyOf(modifiers)) order for free</technical_language>

Target:
public void emitModifiers(ImmutableSet<Modifier> modifiers) { if (!modifiers.isEmpty()) { for (Modifier modifier : EnumSet.copyOf(modifiers)) { emitAndIndent(Ascii.toLowerCase(modifier.name())); emitAndIndent(" "); } } }
Source:
<code>void shouldUpdateChargeToUserCancel_IfEpdqStatusIs6WithRelevantChargeStatus() { final String payload = notificationPayloadForTransaction(payId, EPDQ_AUTHORISED_CANCELLED); charge = Charge.from(ChargeEntityFixture.aValidChargeEntity() .withStatus(USER_CANCEL_SUBMITTED) .build()); setUpGatewayAccountToReturnGatewayAccountEntity(Optional.of(gatewayAccountEntity)); setUpChargeServiceToReturnCharge(Optional.of(charge)); <START> final boolean result = notificationService.handleNotificationFor(payload, FORWARDED_IP_ADDRESSES); assertTrue(result); <END> verify(mockChargeNotificationProcessor).invoke(payId, charge, USER_CANCELLATION_FLOW.getSuccessTerminalState(), null); }</code><technical_language>inlined</technical_language>

Target:
void shouldUpdateChargeToUserCancel_IfEpdqStatusIs6WithRelevantChargeStatus() { final String payload = notificationPayloadForTransaction(payId, EPDQ_AUTHORISED_CANCELLED); charge = Charge.from(ChargeEntityFixture.aValidChargeEntity() .withStatus(USER_CANCEL_SUBMITTED) .build()); setUpGatewayAccountToReturnGatewayAccountEntity(Optional.of(gatewayAccountEntity)); setUpChargeServiceToReturnCharge(Optional.of(charge)); assertTrue(notificationService.handleNotificationFor(payload, FORWARDED_IP_ADDRESSES)); verify(mockChargeNotificationProcessor).invoke(payId, charge, USER_CANCELLATION_FLOW.getSuccessTerminalState(), null); }
Source:
<code>public void close() throws IOException { retryOnRateLimit(() -> { client.shutdown(); <START> return true; END> }); }</code><technical_language>Returning null a bit better? I guess handled T=Void in this case</technical_language>

Target:
public void close() throws IOException { retryOnRateLimit(() -> { client.shutdown(); return null; }); }
Source:
<code>public void callsSupplierAgainAfterTimeElapses() { try (TimestampTracker tracker = new TimestampTracker(mockClock)) { <START> when(mockClock.getTick()).thenReturn(0L, CACHE_RETRIGGER_NANOS / 2, CACHE_RETRIGGER_NANOS); <END> AtomicLong timestampValue = new AtomicLong(0L); tracker.registerTimestampForTracking(FAKE_METRIC, timestampValue::incrementAndGet); assertThat(getGauge(FAKE_METRIC).getValue()).isEqualTo(1L); assertThat(getGauge(FAKE_METRIC).getValue()).isEqualTo(1L); assertThat(getGauge(FAKE_METRIC).getValue()).isEqualTo(2L); } }</code><technical_language>For a stronger test, CACHE_RETRIGGER_NANOS - 2. For a clearer test, set CACHE_INTERVAL_NANOS = TimestampTracker.CACHE_INTERVAL.toNanos(), CACHE_INTERVAL_NANOS - 1 CACHE_INTERVAL_NANOS + 1</technical_language>

Target:
public void callsSupplierAgainAfterTimeElapses() { try (TimestampTrackerImpl tracker = createTrackerWithClock(mockClock)) { when(mockClock.getTick()).thenReturn(0L, CACHE_INTERVAL_NANOS - 1, CACHE_INTERVAL_NANOS + 1); AtomicLong timestampValue = new AtomicLong(0L); tracker.registerTimestampForTracking(FAKE_METRIC, timestampValue::incrementAndGet); assertThat(getGauge(FAKE_METRIC).getValue()).isEqualTo(1L); assertThat(getGauge(FAKE_METRIC).getValue()).isEqualTo(1L); assertThat(getGauge(FAKE_METRIC).getValue()).isEqualTo(2L); } }
Source:
<code>public void printWesHelpFooter() { out("Global Optional Parameters:"); <START> out(" --wes-url <WES URI> WES URI where the WES command should run, e.g. 'http://localhost:8080/ga4gh/wes/v1'"); <END> out(" --wes-auth <auth> Authorization credentials for the WES endpoint, e.g. 'Bearer 12345'"); out(""); out("NOTE: WES SUPPORT IS IN BETA AT THIS TIME. RESULTS MAY BE UNPREDICTABLE."); }</code><technical_language>I word "command" in "where WES command run". If anything, sort of running (client) command local box. URL of WES server, e.g., ..... Also, I URL, consistent --wes-url; right a mixture of url URI</technical_language>

Target:
public void printWesHelpFooter() { out("Global Optional Parameters:"); out(" --wes-url <WES URL> URL where the WES request should be sent, e.g. 'http://localhost:8080/ga4gh/wes/v1'"); out(" --wes-auth <auth> Authorization credentials for the WES endpoint, e.g. 'Bearer 12345'"); out(""); out("NOTE: WES SUPPORT IS IN BETA AT THIS TIME. RESULTS MAY BE UNPREDICTABLE."); }
Source:
<code>private String buildQuery(SpecificationController initialSpecification, List<LogicalNodeController> queryNodes) { QBuilder qBuilder = new QBuilder(); Optional<Condition> condition = initialSpecification.appendTo(qBuilder); String lastYearQuery = ""; if (onlyShowLastYearCheckBox.isVisible() && onlyShowLastYearCheckBox.isSelected()) { lastYearQuery = generateOnlyLastYearQuery(); } if (!condition.isPresent()) { return lastYearQuery; } for (LogicalNodeController queryNode : queryNodes) { Optional<Condition> currentCondition = queryNode.appendTo(condition.get()); if (!currentCondition.isPresent()) { break; } condition = currentCondition; } <START> if (lastYearQuery.isEmpty()) { return (String) condition.get().query(new RSQLVisitor()); } <END> return String.format("%s;%s", condition.get().query(new RSQLVisitor()), lastYearQuery); }</code><technical_language>suggestion if(isLastYearChecked){ InstantProperty endTime = qBuilder.instant("endTime"); Condition conditionForLastYear = endTime.after(Instant.now().minus(1, ChronoUnit.YEARS), false); qBuilder.and(condition.get(), conditionForLastYear); }</technical_language>

Target:
private String buildQuery(SpecificationController initialSpecification, List<LogicalNodeController> queryNodes) { QBuilder qBuilder = new QBuilder<>(); boolean isLastYearChecked = onlyShowLastYearCheckBox.isVisible() && onlyShowLastYearCheckBox.isSelected(); Optional<Condition> condition = initialSpecification.appendTo(qBuilder); if (!condition.isPresent()) { return isLastYearChecked ? (String) qBuilder.instant("endTime").after(OffsetDateTime.now().minusYears(1).toInstant(), false).query(new RSQLVisitor()) : ""; } for (LogicalNodeController queryNode : queryNodes) { Optional<Condition> currentCondition = queryNode.appendTo(condition.get()); if (!currentCondition.isPresent()) { break; } condition = currentCondition; } Condition toQuery = isLastYearChecked ? condition.get().and().instant("endTime").after(OffsetDateTime.now().minusYears(1).toInstant(), false) : condition.get(); return (String) toQuery.query(new RSQLVisitor()); }
Source:
<code>private static String reportMessage(List<InterfaceTreeAndStringPairReport> interfacesToBeReported) { String functionalInterfaces = interfacesToBeReported.stream().map(x -> x.reportString).collect(Collectors.joining(", ")); <START> String manyInterfaces = (interfacesToBeReported.size() > 1 ? "s" : "") + " '"; <END> return String.format("Refactor this code to use the more specialised Functional Interface%s%s'", manyInterfaces, functionalInterfaces); }</code><technical_language>I put part in collector well</technical_language>

Target:
private static String reportMessage(List<InterfaceTreeAndStringPairReport> interfacesToBeReported) { String functionalInterfaces = interfacesToBeReported.stream().map(x -> x.reportString) .collect(Collectors.joining("', '", (interfacesToBeReported.size() > 1 ? "s '" : " '"), "'")); return String.format("Refactor this code to use the more specialised Functional Interface%s", functionalInterfaces); }
Source:
<code>private PlanNodeStatsEstimate filterForFalseExpression() { PlanNodeStatsEstimate.Builder falseStatsBuilder = PlanNodeStatsEstimate.builder(); input.getSymbolsWithKnownStatistics().forEach( <START> symbol -> <END> falseStatsBuilder.addSymbolStatistics(symbol, buildFrom(input.getSymbolStatistics(symbol)) .setLowValue(NaN) .setHighValue(NaN) .setDistinctValuesCount(0.0) .setNullsFraction(NaN).build())); return falseStatsBuilder.setOutputRowCount(0.0).build(); }</code><technical_language>maybe: symbol -> builder().setStatisticsRange(empty()).build()</technical_language>

Target:
private PlanNodeStatsEstimate filterForFalseExpression() { PlanNodeStatsEstimate.Builder falseStatsBuilder = PlanNodeStatsEstimate.builder(); input.getSymbolsWithKnownStatistics().forEach(symbol -> falseStatsBuilder.addSymbolStatistics(symbol, ZERO_STATS)); return falseStatsBuilder .setOutputRowCount(0.0) .build(); }
Source:
<code>public Element build(final CallbackProperties properties) throws SAMLAssertionBuilderException { LOG.debug("SamlCallbackHandler.createHOKSAMLAssertion20()"); Element signedAssertion = null; try { final X509Certificate certificate = certificateManager.getDefaultCertificate(); final PublicKey publicKey = certificateManager.getDefaultPublicKey(); final PrivateKey privateKey = certificateManager.getDefaultPrivateKey(); <START> Assertion assertion; <END> assertion = OpenSAML2ComponentBuilder.getInstance().createAssertion(); final String aID = createAssertionId(); LOG.debug("Assertion ID: {}", aID); assertion.setID(aID); final DateTime issueInstant = new DateTime(); assertion.setIssueInstant(issueInstant); assertion.setIssuer(createIssuer(properties, certificate)); assertion.setSubject(createSubject(properties, certificate, publicKey)); assertion.setConditions(createConditions(properties)); assertion.getStatements().addAll( createAttributeStatements(properties, createEvidenceSubject(properties, certificate, publicKey))); signedAssertion = sign(assertion, certificate, privateKey, publicKey); } catch (final SAMLComponentBuilderException | CertificateManagerException ex) { LOG.error("Unable to create HOK Assertion: {}", ex.getLocalizedMessage()); throw new SAMLAssertionBuilderException(ex.getLocalizedMessage(), ex); } LOG.debug("SamlCallbackHandler.createHOKSAMLAssertion20() -- End"); return signedAssertion; }</code><technical_language>group this Assertion assertion = OpenSAML2ComponentBuilder.getInstance().createAssertion();</technical_language>

Target:
public Element build(final CallbackProperties properties) throws SAMLAssertionBuilderException { LOG.debug("SamlCallbackHandler.createHOKSAMLAssertion20()"); Element signedAssertion = null; try { final X509Certificate certificate = certificateManager.getDefaultCertificate(); final PublicKey publicKey = certificateManager.getDefaultPublicKey(); final PrivateKey privateKey = certificateManager.getDefaultPrivateKey(); Assertion assertion = OpenSAML2ComponentBuilder.getInstance().createAssertion(); final String aID = createAssertionId(); LOG.debug("Assertion ID: {}", aID); assertion.setID(aID); final DateTime issueInstant = new DateTime(); assertion.setIssueInstant(issueInstant); assertion.setIssuer(createIssuer(properties, certificate)); assertion.setSubject(createSubject(properties, certificate, publicKey)); assertion.setConditions(createConditions(properties)); assertion.getStatements().addAll( createAttributeStatements(properties, createEvidenceSubject(properties, certificate, publicKey))); signedAssertion = sign(assertion, certificate, privateKey, publicKey); } catch (final SAMLComponentBuilderException | CertificateManagerException ex) { LOG.error("Unable to create HOK Assertion: {}", ex.getLocalizedMessage()); throw new SAMLAssertionBuilderException(ex.getLocalizedMessage(), ex); } LOG.debug("SamlCallbackHandler.createHOKSAMLAssertion20() -- End"); return signedAssertion; }
Source:
<code>public static String toActivityString(int activity) { <START> switch (activity) { <END> case DetectedActivity.STILL: return "STILL"; case DetectedActivity.WALKING: return "WALKING"; case DetectedActivity.RUNNING: return "RUNNING"; case DetectedActivity.IN_VEHICLE: return "IN_VEHICLE"; case DetectedActivity.ON_FOOT: return "ON_FOOT"; default: return "UNKNOWN"; } }</code><technical_language>more I this, capture DetectedActivity.getType() integer well. Right now, if Google adds more detected activity types a Google Play Services update show "UNKNOWN" in database update OBA Android. If capture integer DetectedActivity.getType() automatically capture new activity types added. string easier read. set string UNKNOWN for UNKNOWN = 4 integer value, - if get unknown integer value, leave field null post-process add a string description later</technical_language>

Target:
public static String toActivityString(int activity) { switch (activity) { case DetectedActivity.STILL: return "STILL"; case DetectedActivity.WALKING: return "WALKING"; case DetectedActivity.RUNNING: return "RUNNING"; case DetectedActivity.IN_VEHICLE: return "IN_VEHICLE"; case DetectedActivity.ON_FOOT: return "ON_FOOT"; case DetectedActivity.ON_BICYCLE: return "ON_BICYCLE"; default: return "UNKNOWN = " + activity; } }
Source:
<code>public void createPartControl(Composite parent) { super.createPartControl(parent); <START> viewer = super.getViewer(); <END> createFilterAction(); initToolBar(); }</code><technical_language>I is necessary</technical_language>

Target:
public void createPartControl(Composite parent) { super.createPartControl(parent); createFilterAction(); initToolBar(); }
Source:
<code>public void missingUrl() { <START> String message = "Patch Set 1:\r\nBuild Started <LINK_0>*se.org/mylyn/job/gerrit-mylyn-reviews/"; <END> BuildResult result = _parser.getBuildResult(message); Assert.assertNull(result); }</code><technical_language>a build number end</technical_language>

Target:
public void missingUrl() { String message = "Patch Set 1:\r\nBuild Started"; BuildResult result = parser.getBuildResult(message); Assert.assertNull(result); }