auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>RexNode simplifyAnd2(List<RexNode> terms, List<RexNode> notTerms) { for (RexNode term : terms) { if (term.isAlwaysFalse()) { return rexBuilder.makeLiteral(false); } } for (RexNode term : notTerms) { if (term.isAlwaysTrue()) { return rexBuilder.makeLiteral(false); } } if (terms.isEmpty() && notTerms.isEmpty()) { return rexBuilder.makeLiteral(true); } <START> if (unknownAsFalse) { <END> for (RexNode notDisjunction : notTerms) { final List<RexNode> terms2 = RelOptUtil.conjunctions(notDisjunction); if (terms.containsAll(terms2)) { return rexBuilder.makeLiteral(false); } } } for (RexNode notDisjunction : notTerms) { terms.add( simplify_( rexBuilder.makeCall(SqlStdOperatorTable.NOT, notDisjunction))); } return RexUtil.composeConjunction(rexBuilder, terms, false); }</code><technical_language>This method called unknownAsFalse is false, right? is confusing this method checks of this boolean, in if unknownAsFalse is false. more clear change boolean calling simplifyAnd, fix issue</technical_language>

Target:
RexNode simplifyAnd2(List<RexNode> terms, List<RexNode> notTerms) { for (RexNode term : terms) { if (term.isAlwaysFalse()) { return rexBuilder.makeLiteral(false); } } for (RexNode term : notTerms) { if (term.isAlwaysTrue()) { return rexBuilder.makeLiteral(false); } } if (terms.isEmpty() && notTerms.isEmpty()) { return rexBuilder.makeLiteral(true); } for (RexNode notDisjunction : notTerms) { terms.add( simplify_( rexBuilder.makeCall(SqlStdOperatorTable.NOT, notDisjunction))); } return RexUtil.composeConjunction(rexBuilder, terms, false); }
Source:
<code>public <T extends LwM2mResponse> T send(Registration destination, DownlinkRequest<T> request) throws InterruptedException { if (destination.usesQueueMode()) { if (presenceService.isClientSleeping(destination)) { LOG.info("The destination client is sleeping, request couldn't been sent."); return null; } else { <START> presenceService.startClientAwakeTimer(destination); <END> } } return requestSender.send(destination, request, DEFAULT_TIMEOUT); }</code><technical_language>this is more complicated this is : Request -> <- Response In CoAP, is request acknowledgement separated of response worst imagine scenario blockwise transfer means 1 LWM2M request means CoAP requests. ([How timeout is handled](<LINK_0> give idea of complexity) In spec, client response in MAX_TRANSMIT_WAIT. wait MAX_TRANSMIT_WAIT request sleep a request a response time longer</technical_language>

Target:
public <T extends LwM2mResponse> T send(Registration destination, DownlinkRequest<T> request) throws InterruptedException { if (destination.usesQueueMode()) { if (!presenceService.isClientAwake(destination)) { LOG.info("The destination client is sleeping, request couldn't been sent."); return null; } } return requestSender.send(destination, request, DEFAULT_TIMEOUT); }
Source:
<code><START> public Optional<Boolean> onActivated(EntityPlayer player, EnumHand hand, ItemStack heldItem, RayTraceResult hit) <END> { return Optional.absent(); }</code><technical_language>false == missing ==</technical_language>

Target:
public EnumActionResult onActivated(EntityPlayer player, EnumHand hand, ItemStack heldItem, RayTraceResult hit) { return EnumActionResult.PASS; }
Source:
<code>public int rank() { if ((columns == 0) || (rows == 0)) return 0; <START> Matrix m = this; <END> int i; int x, y; x = 0; y = 0; int endi = (columns > rows)? rows : columns; for(i = 0; i < endi; i++) { if (m.get(i, i)== 0) { boolean c = false; for (int k = i; k < rows; k++){ for (int l = i; l < columns; l++){ if (m.get(k, l) != 0){ y = k; x = l; c = true; break; } } if (c) break; } if (!c) break; if (i != y) m.swapRows(i, y); if (i != x) m.swapColumns(i, x); } for (x = i; x < columns; x++) { m.set(i, x, m.get(i, x) / m.get(i, i) ); } for (y = i + 1; y < rows; y++) { for (x = i; x < columns; x++) m.set(y, x, m.get(y, x) - m.get(i, x) * m.get(y, i)); } for (x = i + 1; x < columns; x++) { for (y = i; y < rows; y++) m.set(y, x, m.get(y, x) - m.get(y, i) * m.get(i, x)); } } int cnt = 0; for (i = 0; i < endi; i++) if (m.get(i, i) == 0) break; else cnt++; return cnt; }</code><technical_language>I guess direct call <code>get()/set()</code> instead of this field</technical_language>

Target:
public int rank() { if ((columns == 0) || (rows == 0)) { return 0; } int x = 0; int y = 0; int endi = (columns > rows)? rows : columns; for(int i = 0; i < endi; i++) { if (Math.abs(unsafe_get(i, i)) <= Matrices.EPS) { boolean c = false; for (int k = i; k < rows; k++){ for (int l = i; l < columns; l++){ if (Math.abs(unsafe_get(k, l)) > Matrices.EPS){ y = k; x = l; c = true; break; } } if (c) { break; } } if (!c) { break; } if (i != y) { swapRows(i, y); } if (i != x) { swapColumns(i, x); } } for (x = i; x < columns; x++) { unsafe_set(i, x, unsafe_get(i, x) / unsafe_get(i, i)); } for (y = i + 1; y < rows; y++) { for (x = i; x < columns; x++) unsafe_set(y, x, unsafe_get(y, x) - unsafe_get(i, x) * unsafe_get(y, i)); } for (x = i + 1; x < columns; x++) { for (y = i; y < rows; y++) unsafe_set(y, x, unsafe_get(y, x) - unsafe_get(y, i) * unsafe_get(i, x)); } } int result = 0; for (int i = 0; i < endi; i++) if (Math.abs(unsafe_get(i, i)) <= Matrices.EPS) { break; } else { result++; } return result; }
Source:
<code>public ITmfTimestamp normalize(final long offset, final int scale) { long value = fValue; int precision = fPrecision; <START> if (fScale == scale && offset == 0) { <END> return new TmfTimestamp(this); } if (this.equals(BIG_BANG) || this.equals(BIG_CRUNCH)) { return this; } if (fScale != scale) { final int scaleDiff = Math.abs(fScale - scale); if (scaleDiff >= scalingFactors.length) { throw new ArithmeticException("Scaling exception"); } final long scalingFactor = scalingFactors[scaleDiff]; if (scale < fScale) { value *= scalingFactor; precision *= scalingFactor; } else { value /= scalingFactor; precision /= scalingFactor; } } if (offset < 0) { value = (value < Long.MIN_VALUE - offset) ? Long.MIN_VALUE : value + offset; } else { value = (value > Long.MAX_VALUE - offset) ? Long.MAX_VALUE : value + offset; } return new TmfTimestamp(value, scale, precision); }</code><technical_language>immutable return 'this' here</technical_language>

Target:
public ITmfTimestamp normalize(final long offset, final int scale) { long value = fValue; int precision = fPrecision; if (fScale == scale && offset == 0) { return this; } if (this.equals(BIG_BANG) || this.equals(BIG_CRUNCH)) { return this; } if (fScale != scale) { final int scaleDiff = Math.abs(fScale - scale); if (scaleDiff >= scalingFactors.length) { throw new ArithmeticException("Scaling exception"); } final long scalingFactor = scalingFactors[scaleDiff]; if (scale < fScale) { value *= scalingFactor; precision *= scalingFactor; } else { value /= scalingFactor; precision /= scalingFactor; } } if (offset < 0) { value = (value < Long.MIN_VALUE - offset) ? Long.MIN_VALUE : value + offset; } else { value = (value > Long.MAX_VALUE - offset) ? Long.MAX_VALUE : value + offset; } return new TmfTimestamp(value, scale, precision); }
Source:
<code><START> public String getDefaultValidationMessage() {; <END> return AgeValidator.DEFAULT_VALIDATION_MESSAGE; }</code><technical_language>This ; here</technical_language>

Target:
public String getDefaultValidationMessage() { return AgeValidator.DEFAULT_VALIDATION_MESSAGE; }
Source:
<code>public Color getColor() { switch (type) { case INTEGER: return new Color(52, 152, 255); case STRING: return new Color(204, 88, 56); case SYMBOL: <START> return new Color(46, 204, 50); <END> default: return new Color(0, 0, 0); } }</code><technical_language>This change unrelated - PR</technical_language>

Target:
public Color getColor() { switch (type) { case INTEGER: return new Color(52, 152, 255); case STRING: return new Color(204, 88, 56); case SYMBOL: return new Color(46, 204, 113); default: return new Color(0, 0, 0); } }
Source:
<code>public VFSResourceLoader(final String rootName, final VirtualFile root, final boolean usePhysicalCodeSource) throws IOException { final SecurityManager sm = System.getSecurityManager(); final boolean checking = WildFlySecurityManager.isChecking(); if (checking) { sm.checkPermission(new VirtualFilePermission(root.getPathName(), "read")); } this.root = root; this.rootName = rootName; try { manifest = checking ? doPrivileged(new PrivilegedExceptionAction<Manifest>() { public Manifest run() throws IOException { return VFSUtils.getManifest(root); } }) : VFSUtils.getManifest(root); } catch (PrivilegedActionException pe) { try { throw pe.getException(); } catch (IOException | RuntimeException e) { throw e; } catch (Exception e) { throw new UndeclaredThrowableException(e); } } <START> multiRelease = manifest != null && manifest.getMainAttributes().containsKey("Multi-Release"); <END> rootUrl = usePhysicalCodeSource ? VFSUtils.getRootURL(root) : root.asFileURL(); }</code><technical_language>Keys in Attributes Map ar Strings Attirbutes#Names, this containsKey(new Attributes.Name("Multi-Release"))</technical_language>

Target:
public VFSResourceLoader(final String rootName, final VirtualFile root, final boolean usePhysicalCodeSource) throws IOException { final SecurityManager sm = System.getSecurityManager(); final boolean checking = WildFlySecurityManager.isChecking(); if (checking) { sm.checkPermission(new VirtualFilePermission(root.getPathName(), "read")); } this.root = root; this.rootName = rootName; try { manifest = checking ? doPrivileged(new PrivilegedExceptionAction<Manifest>() { public Manifest run() throws IOException { return VFSUtils.getManifest(root); } }) : VFSUtils.getManifest(root); } catch (PrivilegedActionException pe) { try { throw pe.getException(); } catch (IOException | RuntimeException e) { throw e; } catch (Exception e) { throw new UndeclaredThrowableException(e); } } multiRelease = manifest != null && manifest.getMainAttributes().containsKey(MULTI_RELEASE_NAME); rootUrl = usePhysicalCodeSource ? VFSUtils.getRootURL(root) : root.asFileURL(); }
Source:
<code>public IdentityProvider getIdPByName(String idPName) throws IdentityProviderManagementException { <START> if (StringUtils.isEmpty(idPName)) { <END> throw new IllegalArgumentException("Provided IdP name is empty"); } String tenantDomain = CarbonContext.getThreadLocalCarbonContext().getTenantDomain(); return IdentityProviderManager.getInstance().getIdPByName(idPName, tenantDomain, true); }</code><technical_language>check isBlank()</technical_language>

Target:
public IdentityProvider getIdPByName(String idPName) throws IdentityProviderManagementException { if (StringUtils.isBlank(idPName)) { throw new IllegalArgumentException("Provided IdP name is empty"); } String tenantDomain = CarbonContext.getThreadLocalCarbonContext().getTenantDomain(); return IdentityProviderManager.getInstance().getIdPByName(idPName, tenantDomain, true); }
Source:
<code>public void setPendingRequestEntity() { <START> while (lastStatus == TestEnvironmentStatus.RUNNING && !runningStatusSent) { <END> try { TimeUnit.MILLISECONDS.sleep(100); } catch (InterruptedException e) { LOGGER.error("Error occurred while sleeping", e); } } this.requestEntity = buildPendingRequestEntity(); setLastStatus(TestEnvironmentStatus.PENDING); }</code><technical_language>check of "standBy" this loop turn infinite</technical_language>

Target:
public void setPendingRequestEntity() { ENDING status until RUNNING status is sent in cases when load scenario lasts less while (standBy && lastStatus == TestEnvironmentStatus.RUNNING && !runningStatusSent) { try { TimeUnit.MILLISECONDS.sleep(100); } catch (InterruptedException e) { LOGGER.error("Error occurred while sleeping", e); standBy = false; } } this.requestEntity = buildPendingRequestEntity(); setLastStatus(TestEnvironmentStatus.PENDING); }
Source:
<code>Request build() throws UnsupportedEncodingException { String apiUrl = this.apiUrl; StringBuilder url = new StringBuilder(apiUrl); if (apiUrl.endsWith("/")) { url.deleteCharAt(url.length() - 1); } url.append(buildRelativeUrl()); if (methodInfo.hasQueryParams) { boolean first = true; String requestQuery = methodInfo.requestQuery; if (requestQuery != null) { url.append(requestQuery); first = false; } String[] requestQueryName = methodInfo.requestQueryName; for (int i = 0; i < requestQueryName.length; i++) { String query = requestQueryName[i]; if (query != null) { String value = URLEncoder.encode(String.valueOf(args[i]), "UTF-8"); url.append(first ? '?' : '&').append(query).append('=').append(value); first = false; } } } List<retrofit.http.client.Header> headers = new ArrayList<retrofit.http.client.Header>(); if (this.headers != null) { headers.addAll(this.headers); } if (methodInfo.headers != null) { headers.addAll(methodInfo.headers); } List<String> lcHeadersToRemove = new ArrayList<String>(); if (methodInfo.requestParamHeader != null) { for (int i = 0; i < methodInfo.requestParamHeader.length; i++) { String name = methodInfo.requestParamHeader[i]; <START> if (name == null) continue; <END> Object arg = args[i]; if (arg != null) { headers.add(new retrofit.http.client.Header(name, arg.toString())); } else { lcHeadersToRemove.add(name.toLowerCase()); } } } for (Iterator<retrofit.http.client.Header> header = headers.iterator(); header.hasNext();) { if (lcHeadersToRemove.contains(header.next().getName().toLowerCase())) header.remove(); } return new Request(methodInfo.requestMethod, url.toString(), headers, buildBody()); }</code><technical_language>Is this possible</technical_language>

Target:
Request build() throws UnsupportedEncodingException { String apiUrl = this.apiUrl; StringBuilder url = new StringBuilder(apiUrl); if (apiUrl.endsWith("/")) { url.deleteCharAt(url.length() - 1); } url.append(buildRelativeUrl()); if (methodInfo.hasQueryParams) { boolean first = true; String requestQuery = methodInfo.requestQuery; if (requestQuery != null) { url.append(requestQuery); first = false; } String[] requestQueryName = methodInfo.requestQueryName; for (int i = 0; i < requestQueryName.length; i++) { String query = requestQueryName[i]; if (query != null) { String value = URLEncoder.encode(String.valueOf(args[i]), "UTF-8"); url.append(first ? '?' : '&').append(query).append('=').append(value); first = false; } } } List<retrofit.http.client.Header> headers = new ArrayList<retrofit.http.client.Header>(); if (this.headers != null) { headers.addAll(this.headers); } List<Header> methodHeaders = methodInfo.headers; if (methodHeaders != null) { headers.addAll(methodHeaders); } String[] requestParamHeader = methodInfo.requestParamHeader; if (requestParamHeader != null) { for (int i = 0; i < requestParamHeader.length; i++) { String name = requestParamHeader[i]; if (name == null) continue; Object arg = args[i]; if (arg != null) { headers.add(new retrofit.http.client.Header(name, String.valueOf(arg))); } } } return new Request(methodInfo.requestMethod, url.toString(), headers, buildBody()); }
Source:
<code>default Set<ContainerModel> group(Set<TaskModel> tasks, List<Integer> containersIds) { <START> return null; <END> }</code><technical_language>If implemented class this default group method, work returned null override some implementation</technical_language>

Target:
default Set<ContainerModel> group(Set<TaskModel> tasks, List<Integer> containersIds) { return group(tasks); }
Source:
<code>public String login(ModelMap model) throws QuadrigaStorageException { <START> logger.info("Inside Login: GET request"); <END> List<IProject> projectList = retrieveProjectManager.getProjectListByAccessibility(EProjectAccessibility.PUBLIC); Collections.sort(projectList, new Comparator<IProject>() { @Override public int compare(IProject o1, IProject o2) { return o1.getUpdatedDate().compareTo(o2.getUpdatedDate()); } }); int size = projectList.size() > 4 ? 4 : projectList.size(); model.addAttribute("latestProjects", projectList.subList(0, size)); return "login"; }</code><technical_language>useless information</technical_language>

Target:
public String login(ModelMap model) throws QuadrigaStorageException { List<IProject> projectList = retrieveProjectManager.getProjectListByAccessibility(EProjectAccessibility.PUBLIC); Collections.sort(projectList, new Comparator<IProject>() { @Override public int compare(IProject o1, IProject o2) { return o1.getUpdatedDate().compareTo(o2.getUpdatedDate()); } }); int size = projectList.size() > 4 ? 4 : projectList.size(); model.addAttribute("latestProjects", projectList.subList(0, size)); return "login"; }
Source:
<code>public void fillWithInvalidAddress() throws Throwable { SyncUtil.runToLocation("MemoryTestApp.cc:zeroBlocks"); SyncUtil.step(StepType.STEP_RETURN); long offset = 0; int count = 1; <START> byte[] pattern = ByteBuffer.allocate(count * fWordSize).put(valueToBytes(count)).array(); <END> fBaseAddress = new Addr64("0"); String expectedStr1 = "Cannot access memory at address"; String expectedStr2 = "Could not write memory"; expectedException.expect(ExecutionException.class); expectedException.expectMessage(CoreMatchers.anyOf( CoreMatchers.containsString(expectedStr1), CoreMatchers.containsString(expectedStr2))); try { SyncUtil.fillMemory(fMemoryDmc, fBaseAddress, offset, fWordSize, count, pattern); } finally { assertEquals("MemoryChangedEvent problem: expected 0 events", 0, getEventCount()); } }</code><technical_language>I missing something, overly complicated. Also, "count" value? byte[] pattern = valueToBytes(1);</technical_language>

Target:
public void fillWithInvalidAddress() throws Throwable { SyncUtil.runToLocation("MemoryTestApp.cc:zeroBlocks"); SyncUtil.step(StepType.STEP_RETURN); long offset = 0; int count = 1; byte[] pattern = valueToBytes(1); fBaseAddress = new Addr64("0"); String expectedStr1 = "Cannot access memory at address"; String expectedStr2 = "Could not write memory"; expectedException.expect(ExecutionException.class); expectedException.expectMessage(CoreMatchers.anyOf( CoreMatchers.containsString(expectedStr1), CoreMatchers.containsString(expectedStr2))); try { SyncUtil.fillMemory(fMemoryDmc, fBaseAddress, offset, fWordSize, count, pattern); } finally { assertEquals("MemoryChangedEvent problem: expected 0 events", 0, getEventCount()); } }
Source:
<code>private void replyToComment() { if (mNote == null) { return; } <START> <END> AnalyticsTracker.track(AnalyticsTracker.Stat.NOTIFICATION_QUICK_ACTIONS_REPLIED_TO); if (!TextUtils.isEmpty(mReplyText)) { SiteModel site = mSiteStore.getSiteBySiteId(mNote.getSiteId()); if (site == null) { AppLog.e(T.NOTIFS, "Impossible to reply a comment on a site that is not in the App. SiteId: " + mNote.getSiteId()); requestFailed(ARG_ACTION_APPROVE); return; } CommentModel comment = mNote.buildComment(); CommentModel reply = new CommentModel(); reply.setContent(mReplyText); RemoteCreateCommentPayload payload = new RemoteCreateCommentPayload(site, comment, reply); mDispatcher.dispatch(CommentActionBuilder.newCreateNewCommentAction(payload)); } else { dismissNotification(mPushId); hideStatusBar(); startReplyToCommentActivity(); } }</code><technical_language>this deletion, QuickActionProcessor.requestFailedWithMessage() is unused deleted</technical_language>

Target:
private void replyToComment() { if (mNote == null) { requestFailed(ARG_ACTION_APPROVE); return; } AnalyticsTracker.track(AnalyticsTracker.Stat.NOTIFICATION_QUICK_ACTIONS_REPLIED_TO); if (!TextUtils.isEmpty(mReplyText)) { SiteModel site = mSiteStore.getSiteBySiteId(mNote.getSiteId()); if (site == null) { AppLog.e(T.NOTIFS, "Impossible to reply to a comment on a site that is not in the App. SiteId: " + mNote.getSiteId()); requestFailed(ARG_ACTION_APPROVE); return; } CommentModel comment = mNote.buildComment(); CommentModel reply = new CommentModel(); reply.setContent(mReplyText); RemoteCreateCommentPayload payload = new RemoteCreateCommentPayload(site, comment, reply); mDispatcher.dispatch(CommentActionBuilder.newCreateNewCommentAction(payload)); } else { dismissNotification(mPushId); hideStatusBar(); startReplyToCommentActivity(); } }
Source:
<code>public EMFCompareBuilderConfigurator(IEclipsePreferences enginePreferences, IMatchEngine.Factory.Registry matchEngineFactoryRegistry) { <START> Assert.isNotNull(enginePreferences); <END> this.enginePreferences = enginePreferences; this.matchEngineFactoryRegistry = matchEngineFactoryRegistry; }</code><technical_language>Preconditions.checkNotNull(). Please change for a consistency matter</technical_language>

Target:
public EMFCompareBuilderConfigurator(IEclipsePreferences enginePreferences, IMatchEngine.Factory.Registry matchEngineFactoryRegistry) { Preconditions.checkNotNull(enginePreferences); this.enginePreferences = enginePreferences; this.matchEngineFactoryRegistry = matchEngineFactoryRegistry; }
Source:
<code>public void setupMocks() { dataStore = mock(DataStore.class); asyncQuery = mock(AsyncQuery.class); asyncQueryResult = mock(AsyncQueryResult.class); filter = mock(FilterExpression.class); tx = mock(DataStoreTransaction.class); Map<String, Class<? extends Check>> checkMappings = new HashMap<>(); EntityDictionary dictionary = new EntityDictionary(checkMappings); <START> dictionary.bindEntity(getType(AsyncQuery.class)); <END> dictionary.bindEntity(getType(AsyncQueryResult.class)); ElideSettings elideSettings = new ElideSettingsBuilder(dataStore) .withEntityDictionary(dictionary) .withJoinFilterDialect(new RSQLFilterDialect(dictionary)) .withSubqueryFilterDialect(new RSQLFilterDialect(dictionary)) .withISO8601Dates("yyyy-MM-dd'T'HH:mm'Z'", TimeZone.getTimeZone("UTC")) .build(); elide = new Elide(elideSettings); when(dataStore.beginTransaction()).thenReturn(tx); asyncAPIDAO = new DefaultAsyncAPIDAO(elide.getElideSettings(), dataStore); }</code><technical_language>EntityDictionary supports bindEntity methods a class (and convert a ClassType). need call getType here</technical_language>

Target:
public void setupMocks() { dataStore = mock(DataStore.class); asyncQuery = mock(AsyncQuery.class); asyncQueryResult = mock(AsyncQueryResult.class); filter = mock(FilterExpression.class); tx = mock(DataStoreTransaction.class); Map<String, Class<? extends Check>> checkMappings = new HashMap<>(); EntityDictionary dictionary = new EntityDictionary(checkMappings); dictionary.bindEntity(AsyncQuery.class); dictionary.bindEntity(AsyncQueryResult.class); ElideSettings elideSettings = new ElideSettingsBuilder(dataStore) .withEntityDictionary(dictionary) .withJoinFilterDialect(new RSQLFilterDialect(dictionary)) .withSubqueryFilterDialect(new RSQLFilterDialect(dictionary)) .withISO8601Dates("yyyy-MM-dd'T'HH:mm'Z'", TimeZone.getTimeZone("UTC")) .build(); elide = new Elide(elideSettings); when(dataStore.beginTransaction()).thenReturn(tx); asyncAPIDAO = new DefaultAsyncAPIDAO(elide.getElideSettings(), dataStore); }
Source:
<code>public void start() { boolean newlyDownloaded = false; if (!metricFile.exists()) { info(REPO_NAME + " does not exist, downloading..."); download(getLatestVersion()); newlyDownloaded = true; } try { moduleClassLoader = URLClassLoader.newInstance(new URL[] { metricFile.toURI().toURL() }, plugin.getClass().getClassLoader()); Class<?> cl = moduleClassLoader.loadClass("dev.walshy.sfmetrics.MetricsModule"); metricVersion = cl.getPackage().getImplementationVersion(); if (!newlyDownloaded <START> && plugin.getConfig().getBoolean("metrics.auto-update") <END> && checkForUpdate(metricVersion) ) { info("Cleaning up and re-loading Metrics."); cleanUp(); start(); return; } Method start = cl.getDeclaredMethod("start"); String s = cl.getPackage().getImplementationVersion(); Slimefun.runSync(() -> { try { start.invoke(null); info("Metrics v" + s + " started."); } catch (Exception e) { plugin.getLogger().log(Level.WARNING, "Failed to start metrics.", e); } }); } catch (Exception e) { plugin.getLogger().log(Level.WARNING, "Failed to load the metrics module. Maybe the jar is corrupt?", e); } }</code><technical_language>a method for this, :LUL: hasAutoUpdates()</technical_language>

Target:
public void start() { if (!metricFile.exists()) { plugin.getLogger().info(REPO_NAME + " does not exist, downloading..."); if (!download(getLatestVersion())) { plugin.getLogger().warning("Failed to start metrics as the file could not be downloaded."); return; } } try { moduleClassLoader = URLClassLoader.newInstance(new URL[] { metricFile.toURI().toURL() }, plugin.getClass().getClassLoader()); Class<?> cl = moduleClassLoader.loadClass("dev.walshy.sfmetrics.MetricsModule"); metricVersion = cl.getPackage().getImplementationVersion(); if (!newlyDownloaded && hasAutoUpdates() && checkForUpdate(metricVersion) ) { plugin.getLogger().info("Cleaning up and re-loading Metrics."); cleanUp(); start(); return; } Method start = cl.getDeclaredMethod("start"); String version = cl.getPackage().getImplementationVersion(); Slimefun.runSync(() -> { try { start.invoke(null); plugin.getLogger().info("Metrics build #" + version + " started."); } catch (Exception e) { plugin.getLogger().log(Level.WARNING, "Failed to start metrics.", e); } }); } catch (Exception e) { plugin.getLogger().log(Level.WARNING, "Failed to load the metrics module. Maybe the jar is corrupt?", e); } }
Source:
<code>protected Set<LockDescriptor> getLocksForWrites() { Set<LockDescriptor> result = Sets.newHashSet(); Iterable<TableReference> allTables = IterableUtils.append( writesByTable.keySet(), TransactionConstants.TRANSACTION_TABLE); for (TableReference tableRef : allTables) { if (tableRef.equals(TransactionConstants.TRANSACTION_TABLE)) { result.add( AtlasRowLockDescriptor.of( TransactionConstants.TRANSACTION_TABLE.getQualifiedName(), TransactionConstants.getValueForTimestamp(getStartTimestamp()))); continue; } ConflictHandler conflictHandler = getConflictHandlerForTable(tableRef); if (conflictHandler == ConflictHandler.RETRY_ON_WRITE_WRITE_CELL <START> || conflictHandler == ConflictHandler.SERIALIZABLE_CELL) { <END> for (Cell cell : getLocalWrites(tableRef).keySet()) { result.add( AtlasCellLockDescriptor.of( tableRef.getQualifiedName(), cell.getRowName(), cell.getColumnName())); } } else if (conflictHandler != ConflictHandler.IGNORE_ALL) { Cell lastCell = null; for (Cell cell : getLocalWrites(tableRef).keySet()) { if (lastCell == null || !Arrays.equals(lastCell.getRowName(), cell.getRowName())) { result.add( AtlasRowLockDescriptor.of(tableRef.getQualifiedName(), cell.getRowName())); } lastCell = cell; } } } return result; }</code><technical_language>This is heart of change, is correct. nit: helpers mustCheckWriteWriteConflicts() useCellLevelLocking()</technical_language>

Target:
protected Set<LockDescriptor> getLocksForWrites() { Set<LockDescriptor> result = Sets.newHashSet(); Iterable<TableReference> allTables = IterableUtils.append( writesByTable.keySet(), TransactionConstants.TRANSACTION_TABLE); for (TableReference tableRef : allTables) { if (tableRef.equals(TransactionConstants.TRANSACTION_TABLE)) { result.add( AtlasRowLockDescriptor.of( TransactionConstants.TRANSACTION_TABLE.getQualifiedName(), TransactionConstants.getValueForTimestamp(getStartTimestamp()))); continue; } ConflictHandler conflictHandler = getConflictHandlerForTable(tableRef); if (conflictHandler.lockCellsForConflicts()) { for (Cell cell : getLocalWrites(tableRef).keySet()) { result.add( AtlasCellLockDescriptor.of( tableRef.getQualifiedName(), cell.getRowName(), cell.getColumnName())); } } if (conflictHandler.lockRowsForConflicts()) { Cell lastCell = null; for (Cell cell : getLocalWrites(tableRef).keySet()) { if (lastCell == null || !Arrays.equals(lastCell.getRowName(), cell.getRowName())) { result.add( AtlasRowLockDescriptor.of(tableRef.getQualifiedName(), cell.getRowName())); } lastCell = cell; } } } return result; }
Source:
<code>protected void closeEhcache(final String alias, final Ehcache<?, ?> ehcache) { boolean diskTransient = isDiskTransient(ehcache); if (diskTransient) { try { destroyPersistenceSpace(alias); } catch (CachePersistenceException e) { <START> this.getLogger().debug("Unable to clear persistence space for cache {}", alias, e); <END> } } }</code><technical_language>this.getLogger()? I if this a warning instead of a debug</technical_language>

Target:
protected void closeEhcache(final String alias, final Ehcache<?, ?> ehcache) { boolean diskTransient = isDiskTransient(ehcache); if (diskTransient) { try { destroyPersistenceSpace(alias); } catch (CachePersistenceException e) { this.getLogger().warn("Unable to clear persistence space for cache {}", alias, e); } } }
Source:
<code><START> public byte[] getServerCookie() { <END> return serverCookie; }</code><technical_language>Please java.util.Optional, i.e. public java.util.Optional<byte[]> getServerCookie()</technical_language>

Target:
public Optional<byte[]> getServerCookie() { return serverCookie; }
Source:
<code>public final String getCountryCode(final String ip) { try { InetAddress ipAddress = InetAddress.getByName(ip); <START> CityResponse response = databaseReader.city(ipAddress); <END> Country country = response.getCountry(); return country.getIsoCode(); } catch (UnknownHostException hEx) { return UNKNOWN_CODE; } catch (IOException iEx) { return UNKNOWN_CODE; } catch (GeoIp2Exception gEx) { return UNKNOWN_CODE; } }</code><technical_language>useful able GeoIP2-Country.mmdb database here. I assume database user needs countryCode more efficient, right? If so, want conditionally call databaseReader.country(ipAddress) instead based database used. Thoughts</technical_language>

Target:
public final String getCountryCode(final String ip) { try { InetAddress ipAddress = InetAddress.getByName(ip); CountryResponse response = databaseReader.country(ipAddress); Country country = response.getCountry(); return country.getIsoCode(); } catch (UnknownHostException hEx) { Log.warn(hEx); return UNKNOWN_COUNTRY_CODE; } catch (IOException iEx) { Log.warn(iEx); return UNKNOWN_COUNTRY_CODE; } catch (GeoIp2Exception gEx) { Log.warn(gEx); return UNKNOWN_COUNTRY_CODE; } }
Source:
<code><START> public AbstractSegmentStoreDensityViewer getDensityViewer() { <END> return fDensityViewer; }</code><technical_language>public @Nullable</technical_language>

Target:
public @Nullable AbstractSegmentStoreDensityViewer getDensityViewer() { return fDensityViewer; }
Source:
<code><START> public void apply(final List<StringBuilder> values, final AdvancingSource source, final String capturedText) { <END> if (source.isForceUniqueNameGeneration()) { for (StringBuilder container : values) { this.replaceExpressionWithValue(container, "(" + (source.getCurrentMaxSequence() + 1) + ")"); } return; } if (source.isBulk()) { for (StringBuilder container : values) { if (source.getPlantsSelected() != null && source.getPlantsSelected() > 1) { Integer newValue = source.getPlantsSelected(); this.replaceExpressionWithValue(container, newValue != null ? newValue.toString() : ""); } else { this.replaceExpressionWithValue(container, ""); } } } else { List<StringBuilder> newNames = new ArrayList<StringBuilder>(); int startCount = 1; if (source.getCurrentMaxSequence() > -1) { startCount = source.getCurrentMaxSequence() + 1; } for (StringBuilder value : values) { if (source.getPlantsSelected() != null && source.getPlantsSelected() > 0) { for (int i = startCount; i < startCount + source.getPlantsSelected(); i++) { StringBuilder newName = new StringBuilder(value); this.replaceExpressionWithValue(newName, String.valueOf(i)); newNames.add(newName); } } else { this.replaceExpressionWithValue(value, ""); newNames.add(value); } } values.clear(); values.addAll(newNames); } }</code><technical_language>Fix Sonar violations in this class</technical_language>

Target:
public void apply(final List<StringBuilder> values, final AdvancingSource source, final String capturedText) { if (source.isForceUniqueNameGeneration()) { for (final StringBuilder container : values) { this.replaceExpressionWithValue(container, "(" + (source.getCurrentMaxSequence() + 1) + ")"); } return; } if (source.isBulk()) { for (final StringBuilder container : values) { if (source.getPlantsSelected() != null && source.getPlantsSelected() > 1) { final Integer newValue = source.getPlantsSelected(); this.replaceExpressionWithValue(container, newValue != null ? newValue.toString() : ""); } else { this.replaceExpressionWithValue(container, ""); } } } else { final List<StringBuilder> newNames = new ArrayList<>(); int startCount = 1; if (source.getCurrentMaxSequence() > -1) { startCount = source.getCurrentMaxSequence() + 1; } for (final StringBuilder value : values) { if (source.getPlantsSelected() != null && source.getPlantsSelected() > 0) { for (int i = startCount; i < startCount + source.getPlantsSelected(); i++) { final StringBuilder newName = new StringBuilder(value); this.replaceExpressionWithValue(newName, String.valueOf(i)); newNames.add(newName); } } else { this.replaceExpressionWithValue(value, ""); newNames.add(value); } } values.clear(); values.addAll(newNames); } }
Source:
<code>public Maybe<Location> extract(ItunesEpfPricingSource source) { String countryCode = iso3Code(source.getCountry()); Integer storefrontId = source.getCountryCodes().get(countryCode); Integer extractedStorefrontId = source.getRow().get(EpfPricing.STOREFRONT_ID); <START> if (extractedStorefrontId.equals(storefrontId)) { <END> BigDecimal sdPrice = source.getRow().get(EpfPricing.SD_PRICE); if (sdPrice == null) { return Maybe.nothing(); } Location location = new Location(); location.setTransportType(TransportType.APPLICATION); location.setTransportSubType(TransportSubType.ITUNES); location.setEmbedId(source.getRow().get(EpfPricing.VIDEO_ID).toString()); Policy policy = new Policy(); policy.addAvailableCountry(source.getCountry()); policy.setRevenueContract(RevenueContract.PAY_TO_BUY); Currency currency = Currency.getInstance(new Locale("en", source.getCountry().code())); policy.setPrice(new Price(currency, sdPrice.movePointRight(currency.getDefaultFractionDigits()).intValue())); location.setPolicy(policy); return Maybe.just(location); } else { return Maybe.nothing(); } }</code><technical_language>Change this a guard. Removes unnecessary indentation. ie: if (!extractedStorefrontId.equals(storefrontId)) { return Maybe.nothing(); } BigDecimal... consider Objects.equal() this is external data source possibly bad data. If so, harm in null-safe, Objects.equal is</technical_language>

Target:
public Maybe<Location> extract(ItunesEpfPricingSource source) { String countryCode = iso3Code(source.getCountry()); Integer storefrontId = source.getCountryCodes().get(countryCode); Integer extractedStorefrontId = source.getRow().get(EpfPricing.STOREFRONT_ID); if (!Objects.equal(extractedStorefrontId, storefrontId)) { return Maybe.nothing(); } BigDecimal sdPrice = source.getRow().get(EpfPricing.SD_PRICE); if (sdPrice == null) { return Maybe.nothing(); } Location location = new Location(); location.setTransportType(TransportType.APPLICATION); location.setTransportSubType(TransportSubType.ITUNES); location.setEmbedId(source.getRow().get(EpfPricing.VIDEO_ID).toString()); Policy policy = new Policy(); policy.addAvailableCountry(source.getCountry()); policy.setRevenueContract(RevenueContract.PAY_TO_BUY); Currency currency = Currency.getInstance(new Locale("en", source.getCountry().code())); policy.setPrice(new Price(currency, sdPrice.movePointRight(currency.getDefaultFractionDigits()).intValue())); location.setPolicy(policy); return Maybe.just(location); }
Source:
<code>private FeedbackResultsResponseTable createResponseTable(FeedbackQuestionAttributes question, List<FeedbackResponseAttributes> responsesBundleForRecipient, String recipientNameParam) { List<FeedbackResultsResponse> responses = new ArrayList<>(); FeedbackQuestionDetails questionDetails = question.getQuestionDetails(); String recipientName = recipientNameParam; for (FeedbackResponseAttributes response : responsesBundleForRecipient) { String giverName = bundle.getGiverNameForResponse(response); String displayedGiverName; boolean isUserGiver = student.email.equals(response.giver); boolean isUserPartOfGiverTeam = student.team.equals(giverName); if (question.giverType == FeedbackParticipantType.TEAMS && isUserPartOfGiverTeam) { displayedGiverName = "Your Team (" + giverName + ")"; } else if (isUserGiver) { displayedGiverName = "You"; } else { displayedGiverName = removeAnonymousHash(giverName); } boolean isUserRecipient = student.email.equals(response.recipient); if (isUserGiver && !isUserRecipient) { recipientName = bundle.getNameForEmail(response.recipient); } else { <START> recipientName = removeAnonymousHash(recipientName); <END> } String answer = response.getResponseDetails().getAnswerHtmlStudentView(questionDetails); List<FeedbackResponseCommentRow> comments = createStudentFeedbackResultsResponseComments( response.getId()); responses.add(new FeedbackResultsResponse(displayedGiverName, answer, comments)); } return new FeedbackResultsResponseTable(recipientName, responses); }</code><technical_language>This moved line 171</technical_language>

Target:
private FeedbackResultsResponseTable createResponseTable(FeedbackQuestionAttributes question, List<FeedbackResponseAttributes> responsesBundleForRecipient, String recipientNameParam) { List<FeedbackResultsResponse> responses = new ArrayList<>(); FeedbackQuestionDetails questionDetails = question.getQuestionDetails(); String recipientName = removeAnonymousHash(recipientNameParam); for (FeedbackResponseAttributes response : responsesBundleForRecipient) { String giverName = bundle.getGiverNameForResponse(response); String displayedGiverName; boolean isUserGiver = student.email.equals(response.giver); boolean isUserPartOfGiverTeam = student.team.equals(giverName); if (question.giverType == FeedbackParticipantType.TEAMS && isUserPartOfGiverTeam) { displayedGiverName = "Your Team (" + giverName + ")"; } else if (isUserGiver) { displayedGiverName = "You"; } else { displayedGiverName = removeAnonymousHash(giverName); } boolean isUserRecipient = student.email.equals(response.recipient); if (isUserGiver && !isUserRecipient) { recipientName = bundle.getNameForEmail(response.recipient); } String answer = response.getResponseDetails().getAnswerHtmlStudentView(questionDetails); List<FeedbackResponseCommentRow> comments = createStudentFeedbackResultsResponseComments( response.getId()); responses.add(new FeedbackResultsResponse(displayedGiverName, answer, comments)); } return new FeedbackResultsResponseTable(recipientName, responses); }
Source:
<code>protected Optional<Page> computeNext() { int batchSize; while (true) { if (selectedPositions.isEmpty()) { updateRetainedSize(); verify(!previousYieldFinish); return endOfData(); } if (previousYieldFinish) { verify(previousBatchSize > 0); batchSize = previousBatchSize; <START> previousYieldFinish = false; <END> } else { batchSize = Math.min(selectedPositions.size(), projectBatchSize); } ProcessBatchResult result = processBatch(batchSize); if (result.isYieldFinish()) { previousYieldFinish = true; previousBatchSize = batchSize; return Optional.empty(); } if (result.isPageTooLarge()) { verify(batchSize > 1); projectBatchSize = projectBatchSize / 2; continue; } verify(result.isSuccess()); Page page = result.getPage(); long pageSize = page.getSizeInBytes(); if (page.getPositionCount() > 1 && pageSize > MAX_PAGE_SIZE_IN_BYTES) { projectBatchSize = projectBatchSize / 2; } if (pageSize < MIN_PAGE_SIZE_IN_BYTES && projectBatchSize < MAX_BATCH_SIZE) { projectBatchSize = projectBatchSize * 2; } selectedPositions = selectedPositions.subRange(batchSize, selectedPositions.size()); for (int i = 0; i < previouslyComputedResults.length; i++) { if (previouslyComputedResults[i] != null && previouslyComputedResults[i].getPositionCount() > batchSize) { previouslyComputedResults[i] = previouslyComputedResults[i].getRegion(batchSize, previouslyComputedResults[i].getPositionCount() - batchSize); } else { previouslyComputedResults[i] = null; } } updateRetainedSize(); return Optional.of(page); } }</code><technical_language>lastComputeYielded</technical_language>

Target:
protected Optional<Page> computeNext() { int batchSize; while (true) { if (selectedPositions.isEmpty()) { updateRetainedSize(); verify(!lastComputeYielded); return endOfData(); } if (lastComputeYielded) { verify(lastComputeBatchSize > 0); batchSize = lastComputeBatchSize; lastComputeYielded = false; lastComputeBatchSize = 0; } else { batchSize = Math.min(selectedPositions.size(), projectBatchSize); } ProcessBatchResult result = processBatch(batchSize); if (result.isYieldFinish()) { lastComputeYielded = true; lastComputeBatchSize = batchSize; return Optional.empty(); } if (result.isPageTooLarge()) { verify(batchSize > 1); projectBatchSize = projectBatchSize / 2; continue; } verify(result.isSuccess()); Page page = result.getPage(); long pageSize = page.getSizeInBytes(); if (page.getPositionCount() > 1 && pageSize > MAX_PAGE_SIZE_IN_BYTES) { projectBatchSize = projectBatchSize / 2; } if (pageSize < MIN_PAGE_SIZE_IN_BYTES && projectBatchSize < MAX_BATCH_SIZE) { projectBatchSize = projectBatchSize * 2; } selectedPositions = selectedPositions.subRange(batchSize, selectedPositions.size()); for (int i = 0; i < previouslyComputedResults.length; i++) { if (previouslyComputedResults[i] != null && previouslyComputedResults[i].getPositionCount() > batchSize) { previouslyComputedResults[i] = previouslyComputedResults[i].getRegion(batchSize, previouslyComputedResults[i].getPositionCount() - batchSize); } else { previouslyComputedResults[i] = null; } } updateRetainedSize(); return Optional.of(page); } }
Source:
<code>public static boolean isDynamicTabbar() { <START> return isJuno4Platform() || isKeplerPlatform(); <END> }</code><technical_language>this condition inverted? Juno Kepler versions for *not* support dynamic tabbar</technical_language>

Target:
public static boolean isDynamicTabbar() { return !(isJuno4Platform() || isKeplerPlatform()); }
Source:
<code>private static Throwable getConfigFailureException(ITestContext context) { Throwable t = null; for (IInvokedMethod method : context.getSuite().getAllInvokedMethods()) { ITestNGMethod m = method.getTestMethod(); if (m.isBeforeSuiteConfiguration() && (!method.getTestResult().isSuccess())) { return method.getTestResult().getThrowable(); } } <START> return t; <END> }</code><technical_language>t is more used. return null</technical_language>

Target:
private static Throwable getConfigFailureException(ITestContext context) { for (IInvokedMethod method : context.getSuite().getAllInvokedMethods()) { ITestNGMethod m = method.getTestMethod(); if (m.isBeforeSuiteConfiguration() && (!method.getTestResult().isSuccess())) { return method.getTestResult().getThrowable(); } } return null; }
Source:
<code>public void backupDatabase(GatewayConfig primaryGateway, Set<String> target, Set<Node> allNodes, SaltConfig saltConfig, ExitCriteriaModel exitModel) throws CloudbreakOrchestratorFailedException { try (SaltConnector sc = createSaltConnector(primaryGateway)) { <START> for (Entry<String, SaltPillarProperties> propertiesEntry : saltConfig.getServicePillarConfig().entrySet()) { OrchestratorBootstrap pillarSave = new PillarSave(sc, Sets.newHashSet(primaryGateway.getPrivateAddress()), propertiesEntry.getValue()); Callable<Boolean> saltPillarRunner = saltRunner.runner(pillarSave, exitCriteria, exitModel); saltPillarRunner.call(); } <END> StateRunner stateRunner = new StateRunner(target, allNodes, DATABASE_BACKUP); OrchestratorBootstrap saltJobIdTracker = new SaltJobIdTracker(sc, stateRunner); Callable<Boolean> saltJobRunBootstrapRunner = saltRunner.runner(saltJobIdTracker, exitCriteria, exitModel, maxRetry, false); saltJobRunBootstrapRunner.call(); } catch (Exception e) { LOGGER.info("Error occurred during database backup", e); throw new CloudbreakOrchestratorFailedException(e); } }</code><technical_language>this part is in restoreDatabase, refactor a separate method</technical_language>

Target:
public void backupDatabase(GatewayConfig primaryGateway, Set<String> target, Set<Node> allNodes, SaltConfig saltConfig, ExitCriteriaModel exitModel) throws CloudbreakOrchestratorFailedException { callBackupRestore(primaryGateway, target, allNodes, saltConfig, exitModel, DATABASE_BACKUP); }
Source:
<code><START> public void testOutputForPageWithRunLengthAndReplication() <END> { PartitionedOutputOperator partitionedOutputOperator = createPartitionedOutputOperator(true); for (int i = 0; i < NUM_OF_ITERATIONS; i++) { partitionedOutputOperator.addInput(createPageWithRunLengthAndNullBlock()); } partitionedOutputOperator.finish(); OperatorContext operatorContext = partitionedOutputOperator.getOperatorContext(); long outputSize = operatorContext.getOutputDataSize().getTotalCount(); long outputPositionCount = operatorContext.getOutputPositions().getTotalCount(); assertEquals(outputSize, 461_260_800); assertEquals(outputPositionCount, 51_200_000); assertTrue(outputSize > createPageWithRunLength().getSizeInBytes() * NUM_OF_ITERATIONS); }</code><technical_language>this method static</technical_language>

Target:
public void testOutputForPageWithRunLengthAndReplication() { PartitionedOutputOperator partitionedOutputOperator = createPartitionedOutputOperator(true); for (int i = 0; i < PAGE_COUNT; i++) { partitionedOutputOperator.addInput(new Page(POSITIONS_PER_PAGE, NULL_BLOCK, TESTING_RLE_BLOCK)); } partitionedOutputOperator.finish(); OperatorContext operatorContext = partitionedOutputOperator.getOperatorContext(); assertEquals(operatorContext.getOutputDataSize().getTotalCount(), PAGE_COUNT * PARTITION_COUNT * TESTING_PAGE_WITH_NULL_BLOCK.getSizeInBytes()); assertEquals(operatorContext.getOutputPositions().getTotalCount(), PAGE_COUNT * PARTITION_COUNT * TESTING_PAGE_WITH_NULL_BLOCK.getPositionCount()); }
Source:
<code>private void writeClosedAccountsToCsvFile(List<LaborClosedAccount> laborClosedAccountsDataList) { String fullyQualifiedOutputFileName = generateFullyQualifiedOutputFileName(); LOG.info("writeClosedAccountsToCsvFile: fullyQualifiedOutputFile = " + fullyQualifiedOutputFileName); File outputFile = new File(fullyQualifiedOutputFileName); FileWriter outputFileWriter; try { outputFileWriter = new FileWriter(outputFile); for (LaborClosedAccount closedAccount : laborClosedAccountsDataList) { outputFileWriter.write(closedAccount.toCsvString()); outputFileWriter.write(KFSConstants.NEWLINE); } outputFileWriter.close(); } catch (IOException io) { <START> LOG.error("writeClosedAccountsToCsvFile: Caught IOException = " + io.getMessage()); <END> io.getStackTrace(); } }</code><technical_language>instead of logging message, I suggest logging full exception object. Also, if file written, job error? written, I exception is logged, problem percolated up</technical_language>

Target:
private void writeClosedAccountsToCsvFile(List<LaborClosedAccount> laborClosedAccountsDataList) throws IOException { String fullyQualifiedOutputFileName = generateFullyQualifiedOutputFileName(); LOG.info("writeClosedAccountsToCsvFile: fullyQualifiedOutputFile = " + fullyQualifiedOutputFileName); File outputFile = new File(fullyQualifiedOutputFileName); FileWriter outputFileWriter; try { outputFileWriter = new FileWriter(outputFile); for (LaborClosedAccount closedAccount : laborClosedAccountsDataList) { outputFileWriter.write(closedAccount.toCsvString()); outputFileWriter.write(KFSConstants.NEWLINE); } outputFileWriter.close(); } catch (IOException io) { LOG.error("writeClosedAccountsToCsvFile: Caught IOException => ", io); throw io; } }