auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void testFetchStdoutWithTimeout() throws TimeoutException { WaitingConsumer consumer = new WaitingConsumer(); container.followOutput(consumer, STDOUT); assertThrows("a TimeoutException should be thrown", TimeoutException.class, () -> { consumer.waitUntil(frame -> frame.getType() == STDOUT && frame.getUtf8String().contains("qqq"), <START> 4, TimeUnit.SECONDS); <END> return true; }); }</code><technical_language>is necessary 4 seconds</technical_language>

Target:
public void testFetchStdoutWithTimeout() { WaitingConsumer consumer = new WaitingConsumer(); container.followOutput(consumer, STDOUT); assertThrows("a TimeoutException should be thrown", TimeoutException.class, () -> { consumer.waitUntil(frame -> frame.getType() == STDOUT && frame.getUtf8String().contains("qqq"), 1, TimeUnit.SECONDS); return true; }); }
Source:
<code>public void createControl(Composite parent, FormToolkit toolkit) { <START> super.createControl(parent, toolkit, (getLayoutHint().rowSpan == RowSpan.MULTIPLE ? SWT.WRAP : SWT.NONE)); <END> if (!isReadOnly() && isMultiSelect) { getText().setToolTipText("Separate multiple values with a comma"); } }</code><technical_language>Need check hint is null</technical_language>

Target:
public void createControl(Composite parent, FormToolkit toolkit) { super.createControl(parent, toolkit, (getLayoutHint() != null && getLayoutHint().rowSpan == RowSpan.MULTIPLE ? SWT.WRAP : SWT.NONE)); if (!isReadOnly() && isMultiSelect) { getText().setToolTipText("Separate multiple values with a comma"); } }
Source:
<code>private ProjectTypes getProjectTypes(FolderEntry module, ProjectConfig moduleConfig) throws ProjectTypeConstraintException, ServerException { Project project = new Project(module, projectManager); ProjectTypes types = null; try { types = new ProjectTypes(project, moduleConfig.getType(), moduleConfig.getMixins(), projectManager); types.addTransient(); } catch (NotFoundException e) { <START> e.printStackTrace(); <END> } return types; }</code><technical_language>is a bad practice print stack trace instead of logging processing exception</technical_language>

Target:
private ProjectTypes getProjectTypes(FolderEntry module, ProjectConfig moduleConfig) throws ProjectTypeConstraintException, ServerException, NotFoundException { Project project = new Project(module, projectManager); ProjectTypes types = new ProjectTypes(project, moduleConfig.getType(), moduleConfig.getMixins(), projectManager); types.addTransient(); return types; }
Source:
<code>public void testGettingDescriptorType() throws IOException { ApiClient webClient = BaseIT.getWebClient(BaseIT.ADMIN_USERNAME, testingPostgres); HostedApi api = new HostedApi(webClient); DockstoreTool hostedTool = api .createHostedTool("awesomeTool", Registry.QUAY_IO.getDockerPath().toLowerCase(), CWL.getLowerShortName(), "coolNamespace", null); <START> List<SourceFile> sourceFiles = generateSourceFiles(CWL.getLowerShortName()); <END> hostedTool = api.editHostedTool(hostedTool.getId(), sourceFiles); assertEquals("CWL", hostedTool.getDescriptorType().get(0)); sourceFiles = generateSourceFiles(WDL.getLowerShortName()); hostedTool = api.editHostedTool(hostedTool.getId(), sourceFiles); assertTrue(hostedTool.getDescriptorType().size() == 2); assertTrue(hostedTool.getDescriptorType().get(0) != hostedTool.getDescriptorType().get(1)); }</code><technical_language>getLowerShortName() is removed people abusing</technical_language>

Target:
public void testGettingDescriptorType() throws IOException { ApiClient webClient = BaseIT.getWebClient(BaseIT.ADMIN_USERNAME, testingPostgres); HostedApi api = new HostedApi(webClient); DockstoreTool hostedTool = api .createHostedTool("awesomeTool", Registry.QUAY_IO.getDockerPath().toLowerCase(), CWL.toString(), "coolNamespace", null); List<SourceFile> sourceFiles = generateSourceFiles(CWL); hostedTool = api.editHostedTool(hostedTool.getId(), sourceFiles); assertEquals(CWL.toString(), hostedTool.getDescriptorType().get(0)); sourceFiles = generateSourceFiles(WDL); hostedTool = api.editHostedTool(hostedTool.getId(), sourceFiles); assertTrue(hostedTool.getDescriptorType().size() == 2); assertTrue(hostedTool.getDescriptorType().get(0) != hostedTool.getDescriptorType().get(1)); }
Source:
<code>public void oneInvalidJsonFile() throws IOException { File invalidJson = new File("store/test/dummy-dummy.json"); assert invalidJson.createNewFile(); <START> RepoIO testIO = TestController.createTestingRepoIO(Optional.of(new JSONStoreStub())); <END> assertEquals(0, testIO.getStoredRepos().size()); }</code><technical_language>this Optional.empty() instead? Is is JSON Store method called</technical_language>

Target:
public void oneInvalidJsonFile() throws IOException { File invalidJson = new File("store/test/dummy-dummy.json"); assert invalidJson.createNewFile(); RepoIO testIO = TestController.createTestingRepoIO(Optional.empty()); assertEquals(0, testIO.getStoredRepos().size()); }
Source:
<code>public SparqlToPipelineTransformVisitor(MongoCollection<Document> inputCollection) { <START> this.inputCollection = inputCollection; <END> }</code><technical_language>Is this allowed null</technical_language>

Target:
public SparqlToPipelineTransformVisitor(MongoCollection<Document> inputCollection) { this.inputCollection = Preconditions.checkNotNull(inputCollection); }
Source:
<code>public int onStartCommand(Intent intent, int flags, int startId) { if (ACTION_SYNC_FOLDER.equals(intent.getAction())) { if (!intent.hasExtra(EXTRA_ACCOUNT) || !intent.hasExtra(EXTRA_REMOTE_PATH)) { Log_OC.e(TAG, "Not enough information provided in intent"); return START_NOT_STICKY; } Account account = intent.getParcelableExtra(EXTRA_ACCOUNT); String remotePath = intent.getStringExtra(EXTRA_REMOTE_PATH); <START> OCFile file = new OCFile(remotePath); <END> Pair<Account, OCFile> itemSyncKey = new Pair<Account , OCFile>(account, file); Pair<Target, RemoteOperation> itemToQueue = newOperation(intent); if (itemToQueue != null) { mSyncFolderHandler.add(account, file, (SynchronizeFolderOperation)itemToQueue.second); Message msg = mSyncFolderHandler.obtainMessage(); msg.arg1 = startId; msg.obj = itemSyncKey; mSyncFolderHandler.sendMessage(msg); } } else if (ACTION_CANCEL_SYNC_FOLDER.equals(intent.getAction())) { if (!intent.hasExtra(EXTRA_ACCOUNT) || !intent.hasExtra(EXTRA_REMOTE_PATH)) { Log_OC.e(TAG, "Not enough information provided in intent"); return START_NOT_STICKY; } Account account = intent.getParcelableExtra(EXTRA_ACCOUNT); String remotePath = intent.getStringExtra(EXTRA_REMOTE_PATH); OCFile file = new OCFile(remotePath); mSyncFolderHandler.cancel(account,file); } else { Message msg = mOperationsHandler.obtainMessage(); msg.arg1 = startId; mOperationsHandler.sendMessage(msg); } return START_NOT_STICKY; }</code><technical_language>Do create OCFile here; pass remotePath part of key. If track is happenning file in end buildRemoteName, get file.getRemotePath(). So, sense creating OCFile passing around</technical_language>

Target:
public int onStartCommand(Intent intent, int flags, int startId) { if (ACTION_SYNC_FOLDER.equals(intent.getAction())) { if (!intent.hasExtra(EXTRA_ACCOUNT) || !intent.hasExtra(EXTRA_REMOTE_PATH)) { Log_OC.e(TAG, "Not enough information provided in intent"); return START_NOT_STICKY; } Account account = intent.getParcelableExtra(EXTRA_ACCOUNT); String remotePath = intent.getStringExtra(EXTRA_REMOTE_PATH); Pair<Account, String> itemSyncKey = new Pair<Account , String>(account, remotePath); Pair<Target, RemoteOperation> itemToQueue = newOperation(intent); if (itemToQueue != null) { mSyncFolderHandler.add(account, remotePath, (SynchronizeFolderOperation)itemToQueue.second); Message msg = mSyncFolderHandler.obtainMessage(); msg.arg1 = startId; msg.obj = itemSyncKey; mSyncFolderHandler.sendMessage(msg); } } else if (ACTION_CANCEL_SYNC_FOLDER.equals(intent.getAction())) { if (!intent.hasExtra(EXTRA_ACCOUNT) || !intent.hasExtra(EXTRA_REMOTE_PATH)) { Log_OC.e(TAG, "Not enough information provided in intent"); return START_NOT_STICKY; } Account account = intent.getParcelableExtra(EXTRA_ACCOUNT); String remotePath = intent.getStringExtra(EXTRA_REMOTE_PATH); mSyncFolderHandler.cancel(account,remotePath); } else { Message msg = mOperationsHandler.obtainMessage(); msg.arg1 = startId; mOperationsHandler.sendMessage(msg); } return START_NOT_STICKY; }
Source:
<code><START> public File getDataDirectory() <END> { return dataDirectory; }</code><technical_language>this config. URI dataDirectory source of truth determine FS: 1. In FileSystemModule, dataDirectory.getScheme() decide FS module install. Local file configured "file:///raptor" (<LINK_0> 2. Get of dataDirectory convert Path baseLocation. everywhere. Ideally avoid File possible</technical_language>

Target:
public URI getDataDirectory() { return dataDirectory; }
Source:
<code>PostMethod getPostMethod(String zenossToken) { String hostname = proxyConfig.getHostname(); int port = proxyConfig.getPort(); <START> String url = "http://" + hostname + ":" + port + VALIDATE_URL; <END> log.debug("Attempting to validate token against ", zenossToken, url); PostMethod method = new PostMethod(url); method.setQueryString(new NameValuePair[]{new NameValuePair("id", zenossToken)}); return method; }</code><technical_language>Please this URL a constant</technical_language>

Target:
HttpPost getPostMethod(String zenossToken) { String url = getValidateUrl(); log.debug("Attempting to validate token against ", zenossToken, url); HttpParams params = new BasicHttpParams(); params.setParameter("id", zenossToken); HttpPost method = new HttpPost(url); method.setParams(params); return method; }
Source:
<code>public void verifyAdsenseUnitWidth(int expectedInContent, int expectedOthers) { int width; List<WebElement> listWebElements = driver.findElements(MonetizationModuleAdsenseListBy); for (WebElement elem : listWebElements) { String slotName = elem.getAttribute(attributeNameSlot); <START> width = elem.findElement(By.cssSelector(".adsbygoogle")).getSize().width; <END> if (slotName.equals("in_content")) { Assertion.assertEquals(width, expectedInContent); } else { Assertion.assertEquals(width, expectedOthers); } PageObjectLogging.log("verifyAdsenseUnitWidth", "Verify the width of the adsense unit for " + slotName + " (width=" + width + ")", true); } }</code><technical_language>put selector selector string a class (const) variable</technical_language>

Target:
public void verifyAdsenseUnitWidth(int expectedInContent, int expectedOthers) { int width; List<WebElement> listWebElements = driver.findElements(MonetizationModuleAdsenseListBy); for (WebElement elem : listWebElements) { String slotName = elem.getAttribute(ATTRIBUTE_NAME_SLOT); width = elem.findElement(adsenseIns).getSize().width; if (slotName.equals(SLOT_IN_CONTENT)) { Assertion.assertEquals(width, expectedInContent); } else { Assertion.assertEquals(width, expectedOthers); } PageObjectLogging.log("verifyAdsenseUnitWidth", "Verify the width of the adsense unit for " + slotName + " (width=" + width + ")", true); } }
Source:
<code>public void objectOrder(DistinctQueryType queryType) { String resource1 = String.format("{ " + "\"id\": \"12345\", " + "\"mypk\": \"abcde\"" + "} "); String resource2 = String.format("{ " + "\"mypk\": \"abcde\"," + "\"id\": \"12345\"" + "} "); DistinctMap distinctMap = DistinctMap.create(queryType, null); Utils.ValueHolder<String> outHash = new Utils.ValueHolder<>(); boolean add = distinctMap.add(resource1, outHash); assertThat(add).as("Value should be added first time").isTrue(); boolean add2 = distinctMap.add(resource2, outHash); <START> assertThat(add2).as("Order of objects in map should be treated same").isTrue(); <END> }</code><technical_language>This false right? ordering change hash</technical_language>

Target:
public void objectOrder(DistinctQueryType queryType) { String resource1 = String.format("{ " + "\"id\": \"12345\"," + "\"mypk\": \"abcde\"" + "} "); String resource2 = String.format("{ " + "\"mypk\": \"abcde\"," + "\"id\": \"12345\"" + "} "); Document resource = new Document(resource1); DistinctMap distinctMap = DistinctMap.create(queryType, null); Utils.ValueHolder<String> outHash = new Utils.ValueHolder<>(); boolean add = distinctMap.add(resource, outHash); assertThat(add).as("Value should be added first time").isTrue(); resource = new Document(resource2); boolean add2 = distinctMap.add(resource, outHash); assertThat(add2).as("Order of objects in map should be treated same").isFalse(); }
Source:
<code>public boolean isInstalled(IProgressMonitor progress) throws Exception { boolean isInstalled = false; List<GAV> installedGavs = TaCoKitUtil.getInstalledComponents(progress); if (installedGavs != null && !installedGavs.isEmpty()) { TaCoKitUtil.checkMonitor(progress); List<GAV> newComponents = getCar().getComponents(); if (newComponents != null) { List<GAV> installedComponents = new ArrayList<>(); for (GAV newComponent : newComponents) { TaCoKitUtil.checkMonitor(progress); boolean alreadyInstalled = false; for (GAV installedGav : installedGavs) { TaCoKitUtil.checkMonitor(progress); if (alreadyInstalled) { break; } try { if (StringUtils.equals(installedGav.getGroupId() + ":" + installedGav.getArtifactId(), newComponent.getGroupId() + ":" + newComponent.getArtifactId())) { String installedVersionString = installedGav.getVersion().split("-")[0]; String newVersionString = newComponent.getVersion().split("-")[0]; String[] installedVersion = installedVersionString.split("\\."); String[] newVersion = newVersionString.split("\\."); alreadyInstalled = true; for (int i = 0; i < newVersion.length; ++i) { if (installedVersion.length - 1 < i) { alreadyInstalled = false; break; } int iVersion = Integer.valueOf(installedVersion[i]); int nVersion = Integer.valueOf(newVersion[i]); <START> if (iVersion < nVersion) { <END> alreadyInstalled = false; break; } } } } catch (Exception e) { alreadyInstalled = true; ExceptionHandler.process(e); } } if (alreadyInstalled) { installedComponents.add(newComponent); } } if (installedComponents.size() < newComponents.size()) { isInstalled = false; } else { isInstalled = true; } } } return isInstalled; }</code><technical_language>works. "Foo" is a valid version doesnt support reverting a version. want override existing version current car in CarMain</technical_language>

Target:
public boolean isInstalled(IProgressMonitor progress) throws Exception { boolean isInstalled = false; List<GAV> installedComponents = TaCoKitUtil.getInstalledComponents(progress); if (installedComponents != null && !installedComponents.isEmpty()) { TaCoKitUtil.checkMonitor(progress); List<GAV> newComponents = getCar().getComponents(); if (newComponents != null) { Map<GAV, GAV> alreadyInstalledComponentMap = filterAlreadyInstalledComponent(installedComponents, newComponents, progress); if (alreadyInstalledComponentMap.size() < newComponents.size()) { isInstalled = false; } else { if (CommonsPlugin.isHeadless()) { } else { } isInstalled = true; } } } return isInstalled; }
Source:
<code>public static void removePref(Context context, String prefKey){ SharedPreferences prefs = getPrefs(context); if (!prefs.contains(prefKey)){ return; } SharedPreferences.Editor editor = prefs.edit(); editor.remove(prefKey); <START> editor.commit(); <END> }</code><technical_language>apply() instead of commit(), save preference of UI thread</technical_language>

Target:
public static void removePref(Context context, String prefKey){ SharedPreferences prefs = getPrefs(context); if (!prefs.contains(prefKey)){ return; } SharedPreferences.Editor editor = prefs.edit(); editor.remove(prefKey); editor.apply(); }
Source:
<code>static void assertDerivedFrom(RevCommit derived, RevCommit original) { assertThat(derived, not(equalTo(original))); <START> assertEquals(derived.getFullMessage(), original.getFullMessage()); <END> }</code><technical_language>Switch arguments, expected for assertEquals</technical_language>

Target:
static void assertDerivedFrom(RevCommit derived, RevCommit original) { assertThat(derived, not(equalTo(original))); assertEquals(original.getFullMessage(), derived.getFullMessage()); }
Source:
<code>public void testNoDuplicatesCanBeInserted() throws Exception { <START> String dbCollectionGenesName = variantJobsArgs.getPipelineOptions().getString("db.collections.features.name"); <END> JobExecution jobExecution = jobLauncherTestUtils.launchStep(InitDBConfiguration.CREATE_DATABASE_INDEXES); assertEquals(ExitStatus.COMPLETED, jobExecution.getExitStatus()); assertEquals(BatchStatus.COMPLETED, jobExecution.getStatus()); MongoClient mongoClient = new MongoClient(); DBCollection genesCollection = mongoClient.getDB(dbName).getCollection(dbCollectionGenesName); genesCollection.insert(new BasicDBObject("_id", "example_id")); genesCollection.insert(new BasicDBObject("_id", "example_id")); }</code><technical_language>VariantJobsArgs.getDbCollectionsFeaturesName()</technical_language>

Target:
public void testNoDuplicatesCanBeInserted() throws Exception { String dbCollectionGenesName = variantJobsArgs.getDbCollectionsFeaturesName(); JobExecution jobExecution = jobLauncherTestUtils.launchStep(InitDBConfiguration.CREATE_DATABASE_INDEXES); assertEquals(ExitStatus.COMPLETED, jobExecution.getExitStatus()); assertEquals(BatchStatus.COMPLETED, jobExecution.getStatus()); MongoClient mongoClient = new MongoClient(); DBCollection genesCollection = mongoClient.getDB(dbName).getCollection(dbCollectionGenesName); genesCollection.insert(new BasicDBObject("_id", "example_id")); genesCollection.insert(new BasicDBObject("_id", "example_id")); }
Source:
<code>public boolean getFileFromServer(String path, Bundle params, OutputStream fos) { byte[] bf = new byte[1024]; int current = 0; try { if (params != null) { StringBuilder sb = new StringBuilder(); boolean first = true; for (String key : params.keySet()) { if (first){ first = false; } else { sb.append("&"); } sb.append(URLEncoder.encode(key) + "=" + URLEncoder.encode(params.getString(key))); } path = path + "?" + sb.toString(); } URL url = new URL(path); HttpURLConnection connect = (HttpURLConnection)url.openConnection(); connect.setDoInput(true); connect.setConnectTimeout(5 * 1000); connect.setReadTimeout(30 * 1000); int code = connect.getResponseCode(); if (code == HttpURLConnection.HTTP_OK) { InputStream is = connect.getInputStream(); BufferedInputStream bis = new BufferedInputStream(is); while((current = bis.read(bf)) != -1){ fos.write(bf, 0, current); } bis.close(); fos.close(); connect.disconnect(); } return true; } catch (MalformedURLException e) { <START> e.printStackTrace(); <END> return false; } catch (IOException e) { e.printStackTrace(); return false; } }</code><technical_language>log instead of print stack track</technical_language>

Target:
public static boolean getFileFromServer(String path, Bundle params, OutputStream fos) { byte[] bf = new byte[FILE_BUFFER_SIZE]; int current = 0; InputStream is = null; HttpURLConnection connect = null; BufferedInputStream bis = null; try { if (params != null) { StringBuilder sb = new StringBuilder(); boolean first = true; for (String key : params.keySet()) { if (first){ first = false; } else { sb.append("&"); } sb.append(URLEncoder.encode(key) + "=" + URLEncoder.encode(params.getString(key))); } path = path + "?" + sb.toString(); } URL url = new URL(path); connect = (HttpURLConnection)url.openConnection(); connect.setDoInput(true); connect.setConnectTimeout(CONNECTION_TIME_OUT); connect.setReadTimeout(SOCKET_TIME_OUT); int code = connect.getResponseCode(); if (code == HttpURLConnection.HTTP_OK) { is = connect.getInputStream(); bis = new BufferedInputStream(is); while((current = bis.read(bf)) != FILE_END){ fos.write(bf, 0, current); } } return true; } catch (MalformedURLException e) { LogUtils.logD(e.getMessage()); return false; } catch (IOException e) { LogUtils.logD(e.getMessage()); return false; } catch (Exception e) { LogUtils.logD(e.getMessage()); return false; } finally { try{ if (is != null) { is.close(); } if (fos != null) { fos.close(); } if (connect != null) { connect.disconnect(); } if (bis != null) { bis.close(); } } catch (Exception e){ LogUtils.logD(e.getMessage()); } } }
Source:
<code>public void testRebalanceResultOutputMemberCount() { server3 = cluster.startServerVM(3, "localhost", locator.getPort()); server3.invoke(() -> { Cache cache = ClusterStartupRule.getCache(); RegionFactory<Integer, Integer> dataRegionFactory = cache.createRegionFactory(RegionShortcut.PARTITION); Region region = dataRegionFactory.create("region-1"); for (int i = 0; i < 100; i++) { region.put("key" + (i + 400), "value" + (i + 400)); } }); locator.waitUntilRegionIsReadyOnExactlyThisManyServers("/region-1", 3); Map<String, List<String>> listMembersResult = gfsh.executeAndAssertThat("list members") .hasTableSection().getActual().getContent(); assertThat(listMembersResult.get("Name").size()).isEqualTo(4); server3.forceDisconnect(); Map<String, List<String>> rebalanceResult = gfsh.executeAndAssertThat("rebalance") .statusIsSuccess().hasTableSection().getActual().getContent(); server3.waitTilFullyReconnected(); listMembersResult = gfsh.executeAndAssertThat("list members") .hasTableSection().getActual().getContent(); assertThat(listMembersResult.get("Name").size()).isEqualTo(4); assertThat(rebalanceResult.get("Rebalanced Stats").get(9)) <START> .isEqualTo("Total number of members in system on which rebalance is executed"); <END> assertThat(rebalanceResult.get("Value").get(9)).isEqualTo("2"); }</code><technical_language>This string ideally replaced a reference REBALANCE__MSG__MEMBER_COUNT constant</technical_language>

Target:
public void testRebalanceResultOutputMemberCount() { server3 = cluster.startServerVM(3, "localhost", locator.getPort()); server3.invoke(() -> { Cache cache = ClusterStartupRule.getCache(); RegionFactory<Integer, Integer> dataRegionFactory = cache.createRegionFactory(RegionShortcut.PARTITION); Region region = dataRegionFactory.create("region-1"); for (int i = 0; i < 100; i++) { region.put("key" + (i + 400), "value" + (i + 400)); } }); locator.waitUntilRegionIsReadyOnExactlyThisManyServers("/region-1", 3); Map<String, List<String>> listMembersResult = gfsh.executeAndAssertThat("list members") .hasTableSection().getActual().getContent(); assertThat(listMembersResult.get("Name").size()).isEqualTo(4); server3.forceDisconnect(); Map<String, List<String>> rebalanceResult = gfsh.executeAndAssertThat("rebalance") .statusIsSuccess().hasTableSection().getActual().getContent(); server3.waitTilFullyReconnected(); listMembersResult = gfsh.executeAndAssertThat("list members") .hasTableSection().getActual().getContent(); assertThat(listMembersResult.get("Name").size()).isEqualTo(4); assertThat(rebalanceResult.get("Rebalanced Stats").get(9)) .isEqualTo(CliStrings.REBALANCE__MSG__MEMBER_COUNT); assertThat(rebalanceResult.get("Value").get(9)).isEqualTo("2"); }
Source:
<code>private List<Member> removeIndirectMembers(PerunSession sess, Group group, List<Member> members, int sourceGroupId) throws InternalErrorException, WrongAttributeValueException, WrongReferenceAttributeValueException, NotGroupMemberException { List<Member> membersToRemove = new ArrayList<>(members); lockGroupMembership(group, membersToRemove); for (Member member: membersToRemove) { member.setSourceGroupId(sourceGroupId); groupsManagerImpl.removeMember(sess, group, member); <START> addMemberToGroupsFromTriggerAttribute(sess, group, member); <END> } List<Member> newMembers = this.getGroupMembers(sess, group); membersToRemove.removeAll(newMembers); for(Member removedIndirectMember: membersToRemove) { notifyMemberRemovalFromGroup(sess, group, removedIndirectMember); getPerunBl().getAttributesManagerBl().removeAllAttributes(sess, removedIndirectMember, group); getPerunBl().getAuditer().log(sess, new IndirectMemberRemovedFromGroup(removedIndirectMember, group)); } return membersToRemove; }</code><technical_language>I if this is right place. removing of membership is connection of member group</technical_language>

Target:
private List<Member> removeIndirectMembers(PerunSession sess, Group group, List<Member> members, int sourceGroupId) throws InternalErrorException, WrongAttributeValueException, WrongReferenceAttributeValueException, NotGroupMemberException { List<Member> membersToRemove = new ArrayList<>(members); lockGroupMembership(group, membersToRemove); for (Member member: membersToRemove) { member.setSourceGroupId(sourceGroupId); groupsManagerImpl.removeMember(sess, group, member); } List<Member> newMembers = this.getGroupMembers(sess, group); membersToRemove.removeAll(newMembers); for(Member removedIndirectMember: membersToRemove) { addMemberToGroupsFromTriggerAttribute(sess, group, removedIndirectMember); notifyMemberRemovalFromGroup(sess, group, removedIndirectMember); getPerunBl().getAttributesManagerBl().removeAllAttributes(sess, removedIndirectMember, group); getPerunBl().getAuditer().log(sess, new IndirectMemberRemovedFromGroup(removedIndirectMember, group)); } return membersToRemove; }
Source:
<code>protected void purgeAttachments(SQLDatabase db) { Set<String> currentKeys = new HashSet<String>(); Cursor c = null; try { db.delete("attachments", "sequence IN " + "(SELECT sequence from revs WHERE json IS null)", null); c = db.rawQuery(SQL_ATTACHMENTS_SELECT_ALL_KEYS, null); while (c.moveToNext()) { byte[] key = c.getBlob(0); currentKeys.add(keyToString(key)); } <START> c.close(); <END> } catch (SQLException e) { logger.log(Level.SEVERE, "SQL exception in purgeAttachments when updating attachments table", e); return; } finally { DatabaseUtils.closeCursorQuietly(c); } try { File attachments = new File(attachmentsDir); c = db.rawQuery(SQL_ATTACHMENTS_SELECT_KEYS_FILENAMES, null); while (c.moveToNext()) { String keyForFile = c.getString(0); if (!currentKeys.contains(keyForFile)) { File f = new File(attachments, c.getString(1)); try { boolean deleted = f.delete(); if (deleted) { db.delete(ATTACHMENTS_KEY_FILENAME, "key = ?", new String[]{keyForFile}); } else { logger.warning("Could not delete file from BLOB store: " + f.getAbsolutePath()); } } catch (SecurityException e) { String msg = String.format("SecurityException deleting %s from blob store", f.getAbsolutePath()); logger.log(Level.WARNING, msg, e); } } } c.close(); } catch (SQLException e) { logger.log(Level.SEVERE, "SQL exception in purgeAttachments when removing redundant attachments", e); } finally { DatabaseUtils.closeCursorQuietly(c); } }</code><technical_language>need call close() close in finally block</technical_language>

Target:
protected void purgeAttachments(SQLDatabase db) { Set<String> currentKeys = new HashSet<String>(); Cursor c = null; try { db.delete("attachments", "sequence IN " + "(SELECT sequence from revs WHERE json IS null)", null); c = db.rawQuery(SQL_ATTACHMENTS_SELECT_ALL_KEYS, null); while (c.moveToNext()) { byte[] key = c.getBlob(0); currentKeys.add(keyToString(key)); } } catch (SQLException e) { logger.log(Level.SEVERE, "SQL exception in purgeAttachments when updating attachments table", e); return; } finally { DatabaseUtils.closeCursorQuietly(c); } try { File attachments = new File(attachmentsDir); c = db.rawQuery(SQL_ATTACHMENTS_SELECT_KEYS_FILENAMES, null); while (c.moveToNext()) { String keyForFile = c.getString(0); if (!currentKeys.contains(keyForFile)) { File f = new File(attachments, c.getString(1)); try { boolean deleted = f.delete(); if (deleted) { db.delete(ATTACHMENTS_KEY_FILENAME, "key = ?", new String[]{keyForFile}); } else { logger.warning("Could not delete file from BLOB store: " + f.getAbsolutePath()); } } catch (SecurityException e) { String msg = String.format("SecurityException deleting %s from blob store", f.getAbsolutePath()); logger.log(Level.WARNING, msg, e); } } } } catch (SQLException e) { logger.log(Level.SEVERE, "SQL exception in purgeAttachments when removing redundant attachments", e); } finally { DatabaseUtils.closeCursorQuietly(c); } }
Source:
<code><START> public RequestOptions toRequestOptions() { <END> final RequestOptions requestOptions = new RequestOptions(); requestOptions.setIfMatchETag(getIfMatchETag()); requestOptions.setIfNoneMatchETag(getIfNoneMatchETag()); return requestOptions; }</code><technical_language>suggestion RequestOptions toRequestOptions() { RequestOptions is internal type, expose this a public API</technical_language>

Target:
RequestOptions toRequestOptions() { final RequestOptions requestOptions = new RequestOptions(); requestOptions.setIfMatchETag(getIfMatchETag()); requestOptions.setIfNoneMatchETag(getIfNoneMatchETag()); return requestOptions; }
Source:
<code>public static void setUp() { port = AvailablePortHelper.getRandomAvailableTCPPort(); server = new GeodeRedisServer("localhost", port); server.start(); <START> jedis = new Jedis("localhost", port, 10000000); <END> }</code><technical_language>10000000 is a timeout I think? I in PubSubIntegrationTest 10000000 assigned a constant of REDIS_CLIENT_TIMEOUT a clearer diving constructor (thought Intellij tells parameter is worried it)</technical_language>

Target:
public static void setUp() { int port = AvailablePortHelper.getRandomAvailableTCPPort(); int TIMEOUT = 10000000; server = new GeodeRedisServer("localhost", port); server.start(); jedis = new Jedis("localhost", port, TIMEOUT); }
Source:
<code>private void throwContractViolationExceptionIfContractIsInvalid(final boolean wrapInTransaction, final Map<String, Serializable> inputs, final TenantServiceAccessor tenantAccessor, final SFlowNodeInstance flowNodeInstance) throws SBonitaException, ContractViolationException { final GetContractOfUserTaskInstance contractOfUserTaskInstance = new GetContractOfUserTaskInstance(tenantAccessor.getProcessDefinitionService(), (SUserTaskInstance) flowNodeInstance); executeTransactionContent(tenantAccessor, contractOfUserTaskInstance, wrapInTransaction); final SContractDefinition contractDefinition = contractOfUserTaskInstance.getResult(); <START> final ContractValidator validator = new ContractValidatorFactory().createContractValidator(tenantAccessor.getTechnicalLoggerService(), <END> tenantAccessor.getExpressionService()); validator.validate(flowNodeInstance.getProcessDefinitionId(), contractDefinition, inputs); }</code><technical_language>method moved throwContractViolationExceptionIfProcessContractIsInvalid</technical_language>

Target:
private void throwContractViolationExceptionIfContractIsInvalid(final boolean wrapInTransaction, final Map<String, Serializable> inputs, final TenantServiceAccessor tenantAccessor, final SFlowNodeInstance flowNodeInstance) throws SBonitaException, SContractViolationException { final GetContractOfUserTaskInstance contractOfUserTaskInstance = new GetContractOfUserTaskInstance(tenantAccessor.getProcessDefinitionService(), (SUserTaskInstance) flowNodeInstance); executeTransactionContent(tenantAccessor, contractOfUserTaskInstance, wrapInTransaction); final SContractDefinition contractDefinition = contractOfUserTaskInstance.getResult(); final ContractValidator validator = new ContractValidatorFactory().createContractValidator(tenantAccessor.getTechnicalLoggerService(), tenantAccessor.getExpressionService()); validator.validate(flowNodeInstance.getProcessDefinitionId(), contractDefinition, inputs); }
Source:
<code><START> private Pair<Double, Double> calculateConcordance(final File outputVcf, final File truthVcf ) { <END> final Set<String> outputKeys = StreamSupport.stream(new FeatureDataSource<VariantContext>(outputVcf).spliterator(), false) .map(vc -> keyForVariant(vc)).collect(Collectors.toSet()); final Set<String> truthKeys = StreamSupport.stream(new FeatureDataSource<VariantContext>(truthVcf).spliterator(), false) .map(vc -> keyForVariant(vc)).collect(Collectors.toSet()); final long truePositives = outputKeys.stream().filter(truthKeys::contains).count(); final long falsePositives = outputKeys.size() - truePositives; final double sensitivity = (double) truePositives / truthKeys.size(); final double fdr = (double) falsePositives / outputKeys.size(); return new ImmutablePair<>(sensitivity, fdr); }</code><technical_language>check variant context in output vcf is filtered. output vcf in testDreamTumorNormal filtered site (20:38245275, alt_allele_in_normal) counted a false positive. This applies calculateConcordance in HaplotypeCallerIntegrationTest also</technical_language>

Target:
private Pair<Double, Double> calculateConcordance(final File outputVcf, final File truthVcf ) { final Set<String> outputKeys = StreamSupport.stream(new FeatureDataSource<VariantContext>(outputVcf).spliterator(), false) .filter(vc -> vc.getFilters().isEmpty()) .map(vc -> keyForVariant(vc)).collect(Collectors.toSet()); final Set<String> truthKeys = StreamSupport.stream(new FeatureDataSource<VariantContext>(truthVcf).spliterator(), false) .filter(vc -> vc.getFilters().isEmpty()) .map(vc -> keyForVariant(vc)).collect(Collectors.toSet()); final long truePositives = outputKeys.stream().filter(truthKeys::contains).count(); final long falsePositives = outputKeys.size() - truePositives; final double sensitivity = (double) truePositives / truthKeys.size(); final double fdr = (double) falsePositives / outputKeys.size(); return new ImmutablePair<>(sensitivity, fdr); }
Source:
<code>void addTaskGroupToActivelyReadingTaskGroup( int taskGroupId, ImmutableMap<Integer, Long> partitionOffsets, Optional<DateTime> minMsgTime, Optional<DateTime> maxMsgTime, Set<String> tasks ) { TaskGroup group = new TaskGroup( taskGroupId, partitionOffsets, minMsgTime, maxMsgTime ); group.tasks.putAll(tasks.stream().collect(Collectors.toMap(x -> x, x -> new TaskData()))); <START> taskGroups.putIfAbsent(taskGroupId, group); <END> }</code><technical_language>this throw error</technical_language>

Target:
void addTaskGroupToActivelyReadingTaskGroup( int taskGroupId, ImmutableMap<Integer, Long> partitionOffsets, Optional<DateTime> minMsgTime, Optional<DateTime> maxMsgTime, Set<String> tasks ) { TaskGroup group = new TaskGroup( taskGroupId, partitionOffsets, minMsgTime, maxMsgTime ); group.tasks.putAll(tasks.stream().collect(Collectors.toMap(x -> x, x -> new TaskData()))); if (taskGroups.putIfAbsent(taskGroupId, group) != null) { throw new ISE( "trying to add taskGroup with ID [%s] to actively reading task groups, but group already exists.", taskGroupId ); } }
Source:
<code>public void render(Context context, GlusterGeoRepSessionConfiguration value, SafeHtmlBuilder sb) { List<String> allowedValues = value.getAllowedValues(); boolean isValuesConstrained <START> = <END> allowedValues == null || allowedValues.isEmpty() || allowedValues.size() == 1 && allowedValues.get(0).isEmpty(); SafeHtmlBuilder sbDelegate = new SafeHtmlBuilder(); if (isValuesConstrained) { textInputCell.render(context, value.getDefaultValue(), sbDelegate); } else { setOptions(allowedValues); delegate.render(context, value.getDefaultValue(), sbDelegate); } sb.append(sbDelegate.toSafeHtml()); }</code><technical_language>conditions is in onBrowserEvent()</technical_language>

Target:
public void render(Context context, GlusterGeoRepSessionConfiguration value, SafeHtmlBuilder sb) { List<String> allowedValues = value.getAllowedValues(); boolean isValuesConstrained = isValueConstrained(allowedValues); SafeHtmlBuilder sbDelegate = new SafeHtmlBuilder(); if (isValuesConstrained) { setOptions(allowedValues); delegate.render(context, value.getDefaultValue(), sbDelegate); } else { textInputCell.render(context, value.getDefaultValue(), sbDelegate); } sb.append(sbDelegate.toSafeHtml()); }
Source:
<code>public void sendCommand(int deviceID, int messageGroupId, int messageId, int toggleTime, Command command) { String cmd = prepareCommand(deviceID, messageGroupId, messageId, toggleTime, command); if (cmd != "") { <START> logger.debug("send to serial port:" + cmd); <END> serialDevice.writeString(cmd + "\r"); } }</code><technical_language>Please parametrized logging of slf4j instead of string concatenation</technical_language>

Target:
public void sendCommand(int deviceID, int messageGroupId, int messageId, int toggleTime, Command command) { String cmd = prepareCommand(deviceID, messageGroupId, messageId, toggleTime, command); if (cmd != "") { logger.debug("send to serial port: {}", cmd); serialDevice.writeString(cmd + "\r"); } }
Source:
<code>public List<WebcamDevice> getDevices() { File[] vfiles = VFFILTER.getVideoFiles(); List<WebcamDevice> devices = new ArrayList<WebcamDevice>(); OutputStream os = null; InputStream is1 = null; InputStream is2 = null; Process process = null; String line = null; BufferedReader br1 = null; BufferedReader br2 = null; for (File vfile : vfiles) { String[] cmd = new String[] { "ffmpeg", "-f", "video4linux2", "-hide_banner", "", "-list_formats", "all", "-i", vfile.getAbsolutePath() }; if (LOG.isDebugEnabled()) { StringBuilder sb = new StringBuilder(); for (String c : cmd) { sb.append(c).append(' '); } LOG.debug("Executing command: {}", sb.toString()); } try { process = RT.exec(cmd); } catch (IOException e) { throw new RuntimeException(e); } os = process.getOutputStream(); is1 = process.getInputStream(); is2 = process.getErrorStream(); try { os.close(); } catch (IOException e) { throw new RuntimeException(e); } br1 = new BufferedReader(new InputStreamReader(is1)); br2 = new BufferedReader(new InputStreamReader(is2)); boolean read = false; try { while ((line = br2.readLine()) != null) { if (line.startsWith(STARTER)) { LOG.debug("Command stderr line: {}", line); devices.add(new FFmpegCliDevice(vfile, line)); read = true; break; } } <START> if (!read) { <END> while ((line = br1.readLine()) != null) { if (line.startsWith(STARTER)) { LOG.debug("Command stdout line: {}", line); devices.add(new FFmpegCliDevice(vfile, line)); break; } } } } catch (IOException e) { throw new RuntimeException(e); } finally { try { is1.close(); is2.close(); } catch (IOException e) { throw new RuntimeException(e); } } } return devices; }</code><technical_language>I redirect stderr stdout is need read streams change code ProcessBuilder instead of Runtime. builder.redirectErrorStream(true);</technical_language>

Target:
public List<WebcamDevice> getDevices() { List<WebcamDevice> devices; if (Platform.isWindows()) { devices = getWindowsDevices(); } else { devices = getUnixDevices(); } return devices; }
Source:
<code>public <T extends Template> Collection<T> getTemplates(Locale locale) { Collection<RuleTemplate> values = providedObjectsHolder.values(); if (values.isEmpty()) { return Collections.<T>emptyList(); } <START> Collection<RuleTemplate> toReturn = new LinkedList<RuleTemplate>(); <END> toReturn.addAll(values); return (Collection<T>) toReturn; }</code><technical_language>do Collection<RuleTemplate> toReturn = new LinkedList<RuleTemplate>(values);</technical_language>

Target:
public <T extends Template> Collection<T> getTemplates(Locale locale) { Collection<RuleTemplate> values = providedObjectsHolder.values(); if (values.isEmpty()) { return Collections.<T>emptyList(); } return (Collection<T>) new LinkedList<RuleTemplate>(values); }
Source:
<code>public static final Locale getPreferredLocale(HttpSession sess, ServletRequest request) { final String s = Library.getProperty(Attributes.PREFERRED_LOCALE); Locale l = (s != null) ? Locales.getLocale(s) : request.getLocale(); if (sess != null) { Object v = sess.getAttribute(Attributes.PREFERRED_LOCALE); if (v == null) v = sess.getAttribute(PX_PREFERRED_LOCALE); if (v != null) { if (v instanceof Locale) return (Locale) v; logLocaleError(v); } v = sess.getServletContext().getAttribute(Attributes.PREFERRED_LOCALE); if (v == null) v = sess.getServletContext().getAttribute(PX_PREFERRED_LOCALE); if (v != null) { if (v instanceof Locale) return (Locale) v; logLocaleError(v); } <START> <END> if (s != null) { return l; } } return l != null ? fixZhLocale(l) : Locale.getDefault(); }</code><technical_language>Clear tab</technical_language>

Target:
public static final Locale getPreferredLocale(HttpSession sess, ServletRequest request) { final String s = Library.getProperty(Attributes.PREFERRED_LOCALE); final Locale l = (s != null) ? Locales.getLocale(s) : request.getLocale(); if (sess != null) { Object v = sess.getAttribute(Attributes.PREFERRED_LOCALE); if (v == null) v = sess.getAttribute(PX_PREFERRED_LOCALE); if (v != null) { if (v instanceof Locale) return (Locale) v; logLocaleError(v); } v = sess.getServletContext().getAttribute(Attributes.PREFERRED_LOCALE); if (v == null) v = sess.getServletContext().getAttribute(PX_PREFERRED_LOCALE); if (v != null) { if (v instanceof Locale) return (Locale) v; logLocaleError(v); } if (s != null) { return l; } } return l != null ? fixZhLocale(l) : Locale.getDefault(); }
Source:
<code>public long getNumberOfValues() { <START> return numberOfValues; <END> }</code><technical_language>hasNumberOfValues ? numberOfValues : 0 add verify(hasNumberOfValues)</technical_language>

Target:
public long getNumberOfValues() { return hasNumberOfValues ? numberOfValues : 0; }
Source:
<code>public void testSafeRefresh() throws Exception { final int numberOfRefreshes = 100; final int requestsPerIteration = 100; final HeroicCoreInstance a = instances.get(0); final ClusterManager clusterManager = a.inject(ClusterComponent::clusterManager); final ClusterRefreshThread t = setupRefreshThread(clusterManager, numberOfRefreshes); final DataStreamCollector collector = new DataStreamCollector(); while (!t.shutdown.get()) { final List<Callable<AsyncFuture<Void>>> operations = new ArrayList<>(); for (int i = 0; i < requestsPerIteration; i++) { operations.add(() -> { final List<AsyncFuture<Void>> pongs = new ArrayList<>(); for (final ClusterShard shard : clusterManager.useDefaultGroup()) { for (int p = 0; p < 10; p++) { final List<UUID> excludeIds = Lists.newArrayList(); while (true) { Optional<ClusterManager.NodeResult<AsyncFuture<Void>>> ret = clusterManager.withNodeInShardButNotWithId(shard.getShard(), excludeIds, ClusterNode.Group::ping); if (!ret.isPresent()) { <START> break; <END> } ClusterManager.NodeResult<AsyncFuture<Void>> result = ret.get(); pongs.add(result.getReturnValue()); excludeIds.add(result.getNodeId()); } } } return async.collectAndDiscard(pongs); }); } async.eventuallyCollect(operations, collector, 20).get(); } t.join(); assertNull("no errors during refreshes", t.refreshError.get()); assertTrue("number of refreshes are non-zero", t.refreshes.get() > 0); assertTrue("number of resolved requests are non-zero", collector.resolved.get() > 0); assertEquals("expect no cancelled requests", 0, collector.cancelled.get()); assertEquals("expect no failed requests", 0, collector.failed.get()); assertTrue(collector.ended); }</code><technical_language>throw exception</technical_language>

Target:
public void testSafeRefresh() throws Exception { final int numberOfRefreshes = 100; final int requestsPerIteration = 100; final HeroicCoreInstance a = instances.get(0); final ClusterManager clusterManager = a.inject(ClusterComponent::clusterManager); final ClusterRefreshThread t = setupRefreshThread(clusterManager, numberOfRefreshes); final DataStreamCollector collector = new DataStreamCollector(); while (!t.shutdown.get()) { final List<Callable<AsyncFuture<Void>>> operations = new ArrayList<>(); for (int i = 0; i < requestsPerIteration; i++) { operations.add(() -> { final List<AsyncFuture<Void>> pongs = new ArrayList<>(); for (final ClusterShard shard : clusterManager.useDefaultGroup()) { for (int p = 0; p < 10; p++) { pongs.addAll(pingAllNodesInShard(clusterManager, shard)); } } return async.collectAndDiscard(pongs); }); } async.eventuallyCollect(operations, collector, 20).get(); } t.join(); assertNull("no errors during refreshes", t.refreshError.get()); assertTrue("number of refreshes are non-zero", t.refreshes.get() > 0); assertTrue("number of resolved requests are non-zero", collector.resolved.get() > 0); assertEquals("expect no cancelled requests", 0, collector.cancelled.get()); assertEquals("expect no failed requests", 0, collector.failed.get()); assertTrue(collector.ended); }
Source:
<code>public TConstruct() { instance = this; FMLJavaModLoadingContext.get().getModEventBus().addListener(this::preInit); FMLJavaModLoadingContext.get().getModEventBus().addListener(this::init); FMLJavaModLoadingContext.get().getModEventBus().addListener(this::postInit); FMLJavaModLoadingContext.get().getModEventBus().addListener(this::gatherData); pulseManager = new PulseManager(Config.pulseConfig); pulseManager.registerPulse(new TinkerCommons()); pulseManager.registerPulse(new TinkerFluids()); pulseManager.registerPulse(new TinkerWorld()); pulseManager.registerPulse(new TinkerGadgets()); pulseManager.enablePulses(); DistExecutor.runWhenOn(Dist.CLIENT, () -> TinkerBook::initBook); <START> if(ModLoadingContext.get().getActiveContainer() instanceof FMLModContainer) { IEventBus eventBus = ((FMLModContainer) ModLoadingContext.get().getActiveContainer()).getEventBus(); eventBus.register(CommonBlocks.class); eventBus.register(WorldBlocks.class); eventBus.register(GadgetBlocks.class); eventBus.register(DecorativeBlocks.class); eventBus.register(CommonItems.class); eventBus.register(WorldItems.class); eventBus.register(GadgetItems.class); eventBus.register(ToolItems.class); eventBus.register(FoodItems.class); } <END> }</code><technical_language>event bus subscriber annotation instead of this if wanted. Ensures registered soon possible</technical_language>

Target:
public TConstruct() { instance = this; FMLJavaModLoadingContext.get().getModEventBus().addListener(this::preInit); FMLJavaModLoadingContext.get().getModEventBus().addListener(this::init); FMLJavaModLoadingContext.get().getModEventBus().addListener(this::postInit); FMLJavaModLoadingContext.get().getModEventBus().addListener(this::gatherData); pulseManager = new PulseManager(Config.pulseConfig); pulseManager.registerPulse(new TinkerCommons()); pulseManager.registerPulse(new TinkerFluids()); pulseManager.registerPulse(new TinkerWorld()); pulseManager.registerPulse(new TinkerGadgets()); pulseManager.enablePulses(); DistExecutor.runWhenOn(Dist.CLIENT, () -> TinkerBook::initBook); }
Source:
<code>public AddRemoveRowWidget() { <START> this(20); <END> }</code><technical_language>Integer.MAX_VALUE change type Integer interpret null limit</technical_language>

Target:
public AddRemoveRowWidget() { this(Integer.MAX_VALUE); }
Source:
<code>private Map<String, Set<String>> getDataObjectsMap(List<DataObjectFormModel> dataObjects) { return dataObjects.stream().collect(Collectors.toMap( DataObjectFormModel::getClassName, <START> d -> d.getProperties().stream().map(ModelProperty::getName).collect(Collectors.toSet())) <END> ); }</code><technical_language>if this sub-stream extracted well-named static method, code perfectly readable self-explanatory</technical_language>

Target:
private Map<String, Set<String>> getDataObjectsMap(List<DataObjectFormModel> dataObjects) { return dataObjects.stream().collect(Collectors.toMap( DataObjectFormModel::getClassName, getModelPropertyNameSet() )); }
Source:
<code>public IBlockState getNewState() { <START> if (this.isCanceled()) return this.getWorld().getBlockState(this.getPos()); <END> return newState; }</code><technical_language>this usage fine</technical_language>

Target:
public IBlockState getNewState() { return newState; }
Source:
<code>public void deserialize(String value) { if (allKeyValueMap == null) { saveEntity = value; return; } <START> if (value != null) { <END> keyValueMap_used = new HashMap<String, String>(); if (!value.isEmpty()) { String[] lines = value.split(PROPERTIES_DELIMETER); String[] splitLine; for (String line : lines) { if (line.isEmpty()) { continue; } splitLine = line.split(KEY_VALUE_DELIMETER, 2); String key = splitLine[0]; if (allKeyValueMap.containsKey(key)) { keyValueMap_used.put(key, splitLine[1]); } } } } init(allKeyValueMap.keySet(), keyValueMap_used.keySet()); }</code><technical_language>behavior for null for empty string; need reset map if is null? In case, drop this check add if (i.e. != null && !value.isEmpty())</technical_language>

Target:
public void deserialize(String value) { if (allKeyValueMap == null) { saveEntity = value; return; } keyValueMap_used = new HashMap<String, String>(); if (value != null && !value.isEmpty()) { String[] lines = value.split(PROPERTIES_DELIMETER); String[] splitLine; for (String line : lines) { if (line.isEmpty()) { continue; } splitLine = line.split(KEY_VALUE_DELIMETER, 2); String key = splitLine[0]; if (allKeyValueMap.containsKey(key)) { keyValueMap_used.put(key, splitLine[1]); } } } init(allKeyValueMap.keySet(), keyValueMap_used.keySet()); }