auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private void displayProtocol_SelectedItemChanged(Object sender, EventArgs args) { EntityModel entityModel = (EntityModel) getDisplayProtocol().getSelectedItem(); if (entityModel == null) { return; } DisplayType type = (DisplayType) entityModel.getEntity(); if (type == DisplayType.vnc) { getUsbPolicy().setSelectedItem(org.ovirt.engine.core.common.businessentities.UsbPolicy.DISABLED); getIsSmartcardEnabled().setEntity(false); } <START> getBehavior().enableSinglePCI(type == DisplayType.qxl); <END> getUsbPolicy().setIsChangable(type == DisplayType.qxl); getIsSmartcardEnabled().setIsChangable(type == DisplayType.qxl); getVncKeyboardLayout().setIsAvailable(type == DisplayType.vnc); updateNumOfMonitors(); }</code><technical_language>consider flow: - user selects a cluster enableSinglePCI is disabled. - user selects QXL driver this "displayProtocol_SelectedItemChanged" called - result: enableSinglePCI enabled cluster support need do is some method "updateSinglePciEnabled()" called places: - displayProtocol_SelectedItemChanged - dataCenterWithClusterSelectedItemChanged - oSType_SelectedItemChanged this method handle conditions</technical_language>

Target:
private void displayProtocol_SelectedItemChanged(Object sender, EventArgs args) { if (getDisplayType() == null) { return; } DisplayType type = getDisplayType(); if (type == DisplayType.vnc) { getUsbPolicy().setSelectedItem(org.ovirt.engine.core.common.businessentities.UsbPolicy.DISABLED); getIsSmartcardEnabled().setEntity(false); } handleQxlClusterLevel(); getUsbPolicy().setIsChangable(type == DisplayType.qxl); getIsSmartcardEnabled().setIsChangable(type == DisplayType.qxl); getVncKeyboardLayout().setIsAvailable(type == DisplayType.vnc); updateNumOfMonitors(); }
Source:
<code>private void testGrantedTablePermission(AccumuloClient test_user_client, TablePermission perm, String tableName) throws AccumuloException, AccumuloSecurityException, TableNotFoundException { log.debug("Confirming that the presence of the permission properly permits the user", perm); switch (perm) { case READ: try (Scanner scanner = test_user_client.createScanner(tableName, Authorizations.EMPTY)) { Iterator<Entry<Key,Value>> iter = scanner.iterator(); while (iter.hasNext()) iter.next(); } break; case WRITE: try (BatchWriter bw = test_user_client.createBatchWriter(tableName)) { Mutation m = new Mutation(new Text("row")); m.put(new Text("a"), new Text("b"), new Value("c".getBytes())); bw.addMutation(m); } break; case BULK_IMPORT: break; case ALTER_TABLE: Map<String,Set<Text>> groups = new HashMap<>(); groups.put("tgroup", new HashSet<>(Arrays.asList(new Text("t1"), new Text("t2")))); <START> testArbitraryProperty(test_user_client, tableName, true); <END> break; case DROP_TABLE: test_user_client.tableOperations().delete(tableName); break; case GRANT: test_user_client.securityOperations().grantTablePermission(getAdminPrincipal(), tableName, TablePermission.GRANT); break; case GET_SUMMARIES: List<Summary> summaries = test_user_client.tableOperations().summaries(tableName) .retrieve(); assertTrue(summaries.isEmpty()); break; default: throw new IllegalArgumentException("Unrecognized table Permission: " + perm); } }</code><technical_language>Unrelated change, is done groups</technical_language>

Target:
private void testGrantedTablePermission(AccumuloClient test_user_client, TablePermission perm, String tableName) throws AccumuloException, AccumuloSecurityException, TableNotFoundException { log.debug("Confirming that the presence of the permission properly permits the user", perm); switch (perm) { case READ: try (Scanner scanner = test_user_client.createScanner(tableName, Authorizations.EMPTY)) { Iterator<Entry<Key,Value>> iter = scanner.iterator(); while (iter.hasNext()) iter.next(); } break; case WRITE: try (BatchWriter bw = test_user_client.createBatchWriter(tableName)) { Mutation m = new Mutation(new Text("row")); m.put(new Text("a"), new Text("b"), new Value("c".getBytes())); bw.addMutation(m); } break; case BULK_IMPORT: break; case ALTER_TABLE: testArbitraryProperty(test_user_client, tableName, true); break; case DROP_TABLE: test_user_client.tableOperations().delete(tableName); break; case GRANT: test_user_client.securityOperations().grantTablePermission(getAdminPrincipal(), tableName, TablePermission.GRANT); break; case GET_SUMMARIES: List<Summary> summaries = test_user_client.tableOperations().summaries(tableName) .retrieve(); assertTrue(summaries.isEmpty()); break; default: throw new IllegalArgumentException("Unrecognized table Permission: " + perm); } }
Source:
<code>public void new_target() { assertThat(JavaScriptLegacyGrammar.MEMBER_EXPRESSION) .matches("new . target") .notMatches("new . Target") <START> .notMatches("a = target") <END> .notMatches("var target"); }</code><technical_language>@ivandalbosco of of this test</technical_language>

Target:
public void new_target() { assertThat(JavaScriptLegacyGrammar.MEMBER_EXPRESSION) .matches("new . target") .notMatches("new . Target"); }
Source:
<code>public void copyFromLocalFile(File srcFile, URI dstUri) throws Exception { LOGGER.info("Copy from local to {}", srcFile.getAbsolutePath(), dstUri); URI base = getBase(dstUri); String prefix = sanitizePath(base.relativize(dstUri).getPath()); PutObjectRequest.Builder putReqBuilder = PutObjectRequest.builder().bucket(dstUri.getHost()).key(prefix); PutObjectRequest putObjectRequest; if (!disableAcl) { <START> putObjectRequest = putReqBuilder.acl(ObjectCannedACL.BUCKET_OWNER_FULL_CONTROL).build(); <END> } else { putObjectRequest = putReqBuilder.build(); } _s3Client.putObject(putObjectRequest, srcFile.toPath()); }</code><technical_language>set builder build request later</technical_language>

Target:
public void copyFromLocalFile(File srcFile, URI dstUri) throws Exception { LOGGER.info("Copy from local to {}", srcFile.getAbsolutePath(), dstUri); URI base = getBase(dstUri); String prefix = sanitizePath(base.relativize(dstUri).getPath()); PutObjectRequest.Builder putReqBuilder = PutObjectRequest.builder().bucket(dstUri.getHost()).key(prefix); if (!disableAcl) { putReqBuilder.acl(ObjectCannedACL.BUCKET_OWNER_FULL_CONTROL); } PutObjectRequest putObjectRequest = putReqBuilder.build(); _s3Client.putObject(putObjectRequest, srcFile.toPath()); }
Source:
<code>public synchronized Video stopRecording() { if (!running) { throw new IllegalStateException("It seems you are not recording anything yet. Please call startRecording()"); } running = false; try { thread.join(); } catch (InterruptedException ignored) { <START> throw new RuntimeException("Unable to stop video recording."); <END> } timer = null; Video video = new WebcamVideo(); video.setResource(recordedVideo); video.setResourceType(VideoType.valueOf(configuration.getVideoType())); video.setWidth(screenBounds.width / 2); video.setHeight(screenBounds.height / 2); return video; }</code><technical_language>log this throw exception</technical_language>

Target:
public synchronized Video stopRecording() { if (!running) { throw new IllegalStateException("It seems you are not recording anything yet. Please call startRecording()"); } running = false; try { thread.join(); } catch (InterruptedException ignored) { throw new RuntimeException("Unable to stop video recording."); } timer = null; Video video = new WebcamVideo(); video.setResource(recordedVideo); video.setResourceType(VideoType.valueOf(configuration.getVideoType())); video.setWidth(screenBounds.width); video.setHeight(screenBounds.height); return video; }
Source:
<code>public static void addOrUpdateTaskInDB(SPMAsyncTask asyncTask) { try { if (asyncTask.getParameters().getDbAsyncTask() != null) { if (DbFacade.getInstance().getAsyncTaskDAO().get(asyncTask.getTaskID()) == null) { <START> log.infoFormat("BaseAsyncTask::AddOrUpdateTaskInDB: Adding task {0} to DataBase", <END> asyncTask.getTaskID()); saveAsyncTaskInDB(asyncTask); } else { updateAsyncTaskInDB(asyncTask); } } } catch (RuntimeException e) { log.error(String.format( "BaseAsyncTask::AddOrUpdateTaskInDB: Adding/Updating task %1$s to DataBase threw an exception.", asyncTask.getTaskID()), e); } }</code><technical_language>Please remove BaseAsyncTask::AddOrUpdateTaskInDB:</technical_language>

Target:
public static void addOrUpdateTaskInDB(SPMAsyncTask asyncTask) { try { if (asyncTask.getParameters().getDbAsyncTask() != null) { if (DbFacade.getInstance().getAsyncTaskDAO().get(asyncTask.getTaskID()) == null) { log.infoFormat("Adding task {0} to DataBase", asyncTask.getTaskID()); saveAsyncTaskInDB(asyncTask); } else { updateAsyncTaskInDB(asyncTask); } } } catch (RuntimeException e) { log.error(String.format( "Adding/Updating task %1$s to DataBase threw an exception.", asyncTask.getTaskID()), e); } }
Source:
<code>private void setSystemErrorCode(int state, String description) { String itemName; itemName = getItemName(DSCAlarmItemType.PANEL_SYSTEM_ERROR, 0, 0); <START> if (itemName != "") { <END> updateItem(itemName, state, description); } }</code><technical_language>I add this line, comparing a String operator work accidentally. change (and other occurrences) if (!("".equals(itemName)) if (StringUtils.isNotEmpty(itemName))</technical_language>

Target:
private void setSystemErrorCode(int state, String description) { String itemName; itemName = getItemName(DSCAlarmItemType.PANEL_SYSTEM_ERROR, 0, 0); if (StringUtils.isNotEmpty(itemName)) { updateItem(itemName, state, description); } }
Source:
<code>public void canStartupAndShutdown() throws Exception { activeMQ = app.createAndManageChild(EntitySpec.create(ActiveMQBroker.class)); activeMQ.start(ImmutableList.of(testLocation)); <START> EntityTestUtils.assertAttributeEqualsEventually(ImmutableMap.of("timeout", 60*1000), activeMQ, Startable.SERVICE_UP, true); <END> log.info("JMX URL is "+activeMQ.getAttribute(UsesJmx.JMX_URL)); activeMQ.stop(); assertFalse(activeMQ.getAttribute(Startable.SERVICE_UP)); }</code><technical_language>I long time outs integration tests longer expect running powered CI machines (especially bandwidth download install program). annoying running locally I in place</technical_language>

Target:
public void canStartupAndShutdown() throws Exception { activeMQ = app.createAndManageChild(EntitySpec.create(ActiveMQBroker.class)); activeMQ.start(ImmutableList.of(testLocation)); EntityTestUtils.assertAttributeEqualsEventually(ImmutableMap.of("timeout", 10*60*1000), activeMQ, Startable.SERVICE_UP, true); log.info("JMX URL is "+activeMQ.getAttribute(UsesJmx.JMX_URL)); activeMQ.stop(); assertFalse(activeMQ.getAttribute(Startable.SERVICE_UP)); }
Source:
<code>public void onMouseInput(MouseEvent event) { EntityPlayer player = Minecraft.getMinecraft().player; if (player == null) { return; } if (KeyBindings.placeItem.isPressed()) { handlePlaceItemKey(); } else if (KeyBindings.toolConfig.isPressed()) { Minecraft.getMinecraft().displayGuiScreen(new GuiToolConfig(player)); } else if (KeyBindings.toolProfileChange.isPressed() && player != null && HandHelper.getMainFirst(player) != null) { DraconicEvolution.network.sendToServer(new PacketSimpleBoolean(PacketSimpleBoolean.ID_TOOL_PROFILE_CHANGE, false)); ItemStack stack = HandHelper.getMainFirst(player); } int change = event.getDwheel(); if (change == 0 || !player.isSneaking()) return; ItemStack item = player.inventory.getStackInSlot(player.inventory.currentItem); if (item.getItem() == DEFeatures.dislocatorAdvanced) { <START> if (event.isCancelable()) <END> event.setCanceled(true); DraconicEvolution.network.sendToServer(new PacketDislocator(PacketDislocator.SCROLL, change < 0 ? -1 : 1, false)); } }</code><technical_language>This is redundant, event is if cancelable subscribing it</technical_language>

Target:
public void onMouseInput(MouseEvent event) { EntityPlayer player = Minecraft.getMinecraft().player; if (player == null) { return; } if (KeyBindings.placeItem.isPressed()) { handlePlaceItemKey(); } else if (KeyBindings.toolConfig.isPressed()) { Minecraft.getMinecraft().displayGuiScreen(new GuiToolConfig(player)); } else if (KeyBindings.toolProfileChange.isPressed() && player != null && HandHelper.getMainFirst(player) != null) { DraconicEvolution.network.sendToServer(new PacketSimpleBoolean(PacketSimpleBoolean.ID_TOOL_PROFILE_CHANGE, false)); ItemStack stack = HandHelper.getMainFirst(player); } int change = event.getDwheel(); if (change == 0 || !player.isSneaking()) return; ItemStack item = player.inventory.getStackInSlot(player.inventory.currentItem); if (item.getItem() == DEFeatures.dislocatorAdvanced) { event.setCanceled(true); DraconicEvolution.network.sendToServer(new PacketDislocator(PacketDislocator.SCROLL, change < 0 ? -1 : 1, false)); } }
Source:
<code>public void testChronologize(){ <START> Map<Long, Set<TObject>> map = Maps.newLinkedHashMap(); <END> Set<TObject> set = Sets.newLinkedHashSet(); long recordId = TestData.getLong(); PrimaryKey primaryKey = PrimaryKey.wrap(recordId); PrimaryRecord record = PrimaryRecord.createPrimaryRecord(primaryKey); for (long i = 30; i <= 50; i++) { TObject tObject = Convert.javaToThrift("foo" + i); record.append(getRevision(primaryKey, Text.wrapCached("name"), Value.wrap(tObject))); } long start = Time.now(); for (long i = 51; i <= 70; i++) { set = Sets.newLinkedHashSet(set); TObject tObject = Convert.javaToThrift("foo" + i); record.append(getRevision(primaryKey, Text.wrapCached("name"), Value.wrap(tObject))); set.add(tObject); map.put(i, set); } long end = Time.now(); for (long i = 71; i <= 90; i++) { TObject tObject = Convert.javaToThrift("foo" + i); record.append(getRevision(primaryKey, Text.wrapCached("name"), Value.wrap(tObject))); } Map<Long, Set<TObject>> newMap = record.chronologize(Text.wrapCached("name"), start, end); long key = 51; for(Entry<Long, Set<TObject>> e : newMap.entrySet()){ Set<TObject> result = e.getValue(); Assert.assertEquals(map.get(key), result); key++; } }</code><technical_language>randomize inputs. Instead of "foo"+i TestData.getValue()</technical_language>

Target:
public void testChronologize() { Map<Long, Set<Value>> map = Maps.newLinkedHashMap(); Set<Value> set = Sets.newLinkedHashSet(); Set<Value> allValues = Sets.newLinkedHashSet(); long recordId = TestData.getLong(); PrimaryKey primaryKey = PrimaryKey.wrap(recordId); PrimaryRecord record = PrimaryRecord.createPrimaryRecord(primaryKey); for (long i = 30; i <= 35; i++) { Value value = null; while (value == null || !allValues.add(value)) { value = TestData.getValue(); } record.append(getRevision(primaryKey, Text.wrapCached("name"), value)); set.add(value); } long start = Time.now(); for (long i = 36; i <= 45; i++) { set = Sets.newLinkedHashSet(set); Value value = null; while (value == null || !allValues.add(value)) { value = TestData.getValue(); } record.append(getRevision(primaryKey, Text.wrapCached("name"), value)); set.add(value); map.put(i, set); } long end = Time.now(); for (long i = 51; i <= 60; i++) { Value value = null; while (value == null || !allValues.add(value)) { value = TestData.getValue(); } record.append(getRevision(primaryKey, Text.wrapCached("name"), value)); } Map<PrimaryKey, Set<Value>> newMap = record.chronologize( Text.wrapCached("name"), start, end); long key = 36; for (Entry<PrimaryKey, Set<Value>> e : newMap.entrySet()) { Set<Value> result = e.getValue(); Assert.assertEquals(map.get(key), result); key++; } }
Source:
<code>public boolean isEnabled() { <START> ISearchResultPage page = getCurrentPage(); <END> return page != null && WHITELISTED_IDS.contains(page.getID()); }</code><technical_language>check getViewers() is empty, instead of page non-null</technical_language>

Target:
public boolean isEnabled() { List<StructuredViewer> viewers = getViewers(); ISearchResultPage page = getCurrentPage(); return viewers.size() > 0 && page != null && WHITELISTED_IDS.contains(page.getID()); }
Source:
<code>public @Nullable Collection<MachineImageVolume> getVolumes() { <START> return volumes; <END> }</code><technical_language>Please nullable Collection a return type, nonnull Iterable instead</technical_language>

Target:
public @Nullable Iterable<MachineImageVolume> getVolumes() { return volumes; }
Source:
<code>public void populateToolBar(IToolBarManager toolBarManager) { createActions(); <START> toolBarManager.add(m_pinToDbgSessionAction); <END> updateActions(); }</code><technical_language>suggest keeping/removing debug actions is separate pin/clone support, do (or outcome settle on) a separate change</technical_language>

Target:
public void populateToolBar(IToolBarManager toolBarManager) { createActions(); toolBarManager.add(m_resumeAction); toolBarManager.add(m_suspendAction); toolBarManager.add(m_terminateAction); toolBarManager.add(m_separatorAction); toolBarManager.add(m_stepReturnAction); toolBarManager.add(m_stepOverAction); toolBarManager.add(m_stepIntoAction); toolBarManager.add(m_dropToFrameAction); toolBarManager.add(m_pinToDbgSessionAction); updateActions(); }
Source:
<code>public void userApprovals(final Set<Change.Id> cids, final Account.Id aid, final AsyncCallback<ApprovalSummarySet> callback) { run(callback, new Action<ApprovalSummarySet>() { public ApprovalSummarySet run(ReviewDb db) throws OrmException { final Map<Change.Id, ApprovalSummary> approvals = new HashMap<Change.Id, ApprovalSummary>(); final List<AccountInfo> accounts = new ArrayList<AccountInfo>(); <START> accounts.add(new AccountInfo(db.accounts().get(aid))); <END> for (final Change.Id id : cids) { try { final ChangeControl cc = changeControlFactory.validateFor(id); final Change change = cc.getChange(); final PatchSet.Id ps_id = change.currentPatchSetId(); final List<PatchSetApproval> psas = new ArrayList<PatchSetApproval>(); final FunctionState fs = functionStateFactory.create(change, ps_id, psas); for (final PatchSetApproval ca : db.patchSetApprovals() .byPatchSetUser(ps_id, aid)) { fs.normalize(approvalTypes.getApprovalType(ca.getCategoryId()), ca); psas.add(ca); } approvals.put(id, new ApprovalSummary(accounts, psas)); } catch (NoSuchChangeException nsce) { } } return new ApprovalSummarySet(approvals); } }); }</code><technical_language>in right me, I prefer if a single AccountInfoCache AccountInfoCacheFactory RPC, pull user data out of Ehcache round-tripping database server, pulling data for multiple accounts in strongestApprovals RPC automatically user once</technical_language>

Target:
public void userApprovals(final Set<Change.Id> cids, final Account.Id aid, final AsyncCallback<ApprovalSummarySet> callback) { run(callback, new Action<ApprovalSummarySet>() { public ApprovalSummarySet run(ReviewDb db) throws OrmException { final Map<Change.Id, ApprovalSummary> approvals = new HashMap<Change.Id, ApprovalSummary>(); final AccountInfoCacheFactory aicFactory = accountInfoCacheFactory.create(); aicFactory.want(aid); for (final Change.Id id : cids) { try { final ChangeControl cc = changeControlFactory.validateFor(id); final Change change = cc.getChange(); final PatchSet.Id ps_id = change.currentPatchSetId(); final Map<ApprovalCategory.Id, PatchSetApproval> psas = new HashMap<ApprovalCategory.Id, PatchSetApproval>(); final FunctionState fs = functionStateFactory.create(change, ps_id, psas.values()); for (final PatchSetApproval ca : db.patchSetApprovals() .byPatchSetUser(ps_id, aid)) { fs.normalize(approvalTypes.getApprovalType(ca.getCategoryId()), ca); psas.put(ca.getCategoryId(), ca); } approvals.put(id, new ApprovalSummary(psas.values())); } catch (NoSuchChangeException nsce) { } } return new ApprovalSummarySet(aicFactory.create(), approvals); } }); }
Source:
<code>public void close() { <START> this.elementStreamReader.close(); <END> }</code><technical_language>remove this</technical_language>

Target:
public void close() { try (Closer closer = Closer.create()) { closer.register(() -> elementStreamReader.close()); } catch (IOException e) { throw new UncheckedIOException(e); } }
Source:
<code>void processMetrics() { try { if (_usedMemory.get(_port) != null) { long nextMetricProcessTime = this.lastMetricProcessTime + 60L * 1000L; long currentTimeMsec = System.currentTimeMillis(); if (currentTimeMsec < nextMetricProcessTime) { return; } String hostname = Utils.hostname(); <START> String metricName = "UsedMemory"; <END> long timestamp = System.currentTimeMillis(); double value = _usedMemory.get(_port).memory; String componentId = "System"; String executorId = "-1"; String streamId = "None"; WorkerMetricFields workerMetric = new WorkerMetricFields(metricName, timestamp, value, componentId, executorId, streamId); WorkerMetricList metricList = new WorkerMetricList(); metricList.add_to_metrics(workerMetric); WorkerMetrics metrics = new WorkerMetrics(_topologyId, _port, hostname, metricList); try (NimbusClient client = NimbusClient.getConfiguredClient(_conf)) { client.getClient().processWorkerMetrics(metrics); } this.lastMetricProcessTime = currentTimeMsec; } } catch (Exception e) { LOG.error("Failed to process metrics", e); this.lastMetricProcessTime = System.currentTimeMillis(); } }</code><technical_language>minor: constants for strings here, reused while retrieving information</technical_language>

Target:
void processMetrics() { try { if (_usedMemory.get(_port) != null) { long nextMetricProcessTime = this.lastMetricProcessTime + 60L * 1000L; long currentTimeMsec = System.currentTimeMillis(); if (currentTimeMsec < nextMetricProcessTime) { return; } String hostname = Utils.hostname(); long timestamp = System.currentTimeMillis(); double value = _usedMemory.get(_port).memory; WorkerMetricPoint workerMetric = new WorkerMetricPoint(MEMORY_USED_METRIC, timestamp, value, SYSTEM_COMPONENT_ID, INVALID_EXECUTOR_ID, INVALID_STREAM_ID); WorkerMetricList metricList = new WorkerMetricList(); metricList.add_to_metrics(workerMetric); WorkerMetrics metrics = new WorkerMetrics(_topologyId, _port, hostname, metricList); try (NimbusClient client = NimbusClient.getConfiguredClient(_conf)) { client.getClient().processWorkerMetrics(metrics); } this.lastMetricProcessTime = currentTimeMsec; } } catch (Exception e) { LOG.error("Failed to process metrics", e); this.lastMetricProcessTime = System.currentTimeMillis(); } }
Source:
<code>protected boolean isLunsAlreadyInUse(Set<String> lunIds) { List<LUNs> lunsFromDb = lunDao.getAll(); StringBuilder lunsUsedBySDs = new StringBuilder(); StringBuilder lunsUsedByDisks = new StringBuilder(); lunsFromDb.stream().filter(lun -> lunIds.contains(lun.getLUNId())).forEach(lun -> { if (lun.getStorageDomainId() != null) { <START> addFormattedLunId(lunsUsedBySDs, <END> lun, LUNs::getStorageDomainName); } if (lun.getDiskId() != null) { addFormattedLunId(lunsUsedByDisks, lun, LUNs::getDiskAlias); } }); if (lunsUsedBySDs.length() != 0) { addValidationMessage(EngineMessage.ACTION_TYPE_FAILED_LUNS_ALREADY_PART_OF_STORAGE_DOMAINS); addValidationMessageVariable("lunIds", lunsUsedBySDs.toString()); } if (lunsUsedByDisks.length() != 0) { addValidationMessage(EngineMessage.ACTION_TYPE_FAILED_LUNS_ALREADY_USED_BY_DISKS); addValidationMessageVariable("lunIds", lunsUsedByDisks.toString()); } return lunsUsedBySDs.length() != 0 || lunsUsedByDisks.length() != 0; }</code><technical_language>send LUNs object a method? send LUNs ID a string (sd name disk alias)</technical_language>

Target:
protected boolean isLunsAlreadyInUse(Set<String> lunIds) { List<LUNs> lunsFromDb = lunDao.getAll(); StringBuilder lunsUsedBySDs = new StringBuilder(); StringBuilder lunsUsedByDisks = new StringBuilder(); lunsFromDb.stream().filter(lun -> lunIds.contains(lun.getLUNId())).forEach(lun -> { if (lun.getStorageDomainId() != null) { addFormattedLunId(lunsUsedBySDs, lun.getLUNId(), lun.getStorageDomainName()); } if (lun.getDiskId() != null) { addFormattedLunId(lunsUsedByDisks, lun.getLUNId(), lun.getDiskAlias()); } }); if (lunsUsedBySDs.length() != 0) { addValidationMessage(EngineMessage.ACTION_TYPE_FAILED_LUNS_ALREADY_PART_OF_STORAGE_DOMAINS); addValidationMessageVariable("lunIds", lunsUsedBySDs.toString()); } if (lunsUsedByDisks.length() != 0) { addValidationMessage(EngineMessage.ACTION_TYPE_FAILED_LUNS_ALREADY_USED_BY_DISKS); addValidationMessageVariable("lunIds", lunsUsedByDisks.toString()); } return lunsUsedBySDs.length() != 0 || lunsUsedByDisks.length() != 0; }
Source:
<code>protected Attendance resolveSectionFk(Attendance a, SchoolDay schoolDay, PsAttendance psAttendance) { if (null != schoolDay) { Cycle cycleDay = schoolCycles.get(schoolDay.getCycleId()); <START> if (null != periods.get(psAttendance.periodid)) { <END> Long periodNumber = periods.get(psAttendance.periodid).period_number; String letter = cycleDay.getLetter(); Set<Section> sections = studentClasses.get(Long.valueOf(student.getSourceSystemId())); if (null != sections) { for (Section section : sections) { Map<String, ArrayList<Long>> expression = section.getExpression(); if (null != expression) { if (null != expression.get(letter)) { for (Long sectionPeriod : expression.get(letter)) { if (sectionPeriod.equals(periodNumber) && schoolDay.getDate().isAfter(section.getStartDate()) && schoolDay.getDate().isBefore(section.getEndDate())) { a.setSectionId(section.getId()); } } } } } } } } return a; }</code><technical_language>IF I control structures for expected control flow save exceptions for handling exceptional cases. is some debate runtime implications of Exception handling of awesome stack overflow guys a million points laying smack it: <LINK_0></technical_language>

Target:
protected Attendance resolveSectionFk(Attendance a, SchoolDay schoolDay, PsAttendance psAttendance) { if (null != schoolDay) { PsCycle cycleDay = schoolCycles.get(schoolDay.getCycleId()); if (null != periods.get(psAttendance.periodid)) { Long periodNumber = periods.get(psAttendance.periodid).period_number; String letter = cycleDay.letter; Set<Section> sections = studentClasses.get(student.getId()); if (null != sections) { for (Section section : sections) { Map<String, ArrayList<Long>> expression = section.getExpression(); if (null != expression) { if (null != expression.get(letter)) { for (Long sectionPeriod : expression.get(letter)) { if (sectionPeriod.equals(periodNumber) && (schoolDay.getDate().isAfter(section.getStartDate()) || schoolDay.getDate().equals(section.getStartDate())) && (schoolDay.getDate().isBefore(section.getEndDate()) || schoolDay.getDate().equals(section.getEndDate())) ){ a.setSection(section); } } } } } } } } return a; }
Source:
<code>public void deleteBox(Box box) throws IOException { authorizationManager.throwIfNotWritable(box); if (boxStore != null) { if (!boxStore.remove(box)) { throw new IOException("Unable to delete box."); } } else { <START> throw new IOException("No boxStore available. Check that it has been declared in the Spring config."); <END> } }</code><technical_language>please remove checks for boxStore != null ? lack of this cruft is of favourite parts of services</technical_language>

Target:
public void deleteBox(Box box) throws IOException { authorizationManager.throwIfNotWritable(box); if (!boxStore.remove(box)) { throw new IOException("Unable to delete box."); } }
Source:
<code>public void start() throws LifecycleException { super.start(); <START> if (jestClient == null) { <END> log.info("Create a jest elastic search client for connection url [{}]", connectionUrl); JestClientFactory factory = new JestClientFactory(); factory.setHttpClientConfig( new HttpClientConfig.Builder(connectionUrl) .multiThreaded(true) .build()); jestClient = factory.getObject(); } else { log.info("Note: using injected jestClient instead of creating a new one: [{}]", jestClient); } createMapping(jestClient, indexName, TYPE_NAME); }</code><technical_language>creation of JestClient in constructor. ensure this object is in a valid state. I know, creation logic in constructors of OutputWriters, a cleanup is way..</technical_language>

Target:
public void start() throws LifecycleException { super.start(); try { createMappingIfNeeded(jestClient, indexName, ELASTIC_TYPE_NAME); } catch (Exception e) { throw new LifecycleException("Failed to create elastic mapping.", e); } }
Source:
<code>public void handle(Context withinContext) throws Exception { LOG.info("Processing#{} CREATE_TABLE message : {}", fromEventId(), eventMessageAsJSON); org.apache.hadoop.hive.metastore.api.Table tobj = eventMessage.getTableObj(); if (tobj == null) { LOG.debug("Event#{} was a CREATE_TABLE_EVENT with no table listed", fromEventId()); return; } Table qlMdTable = new Table(tobj); if (!Utils.shouldReplicate(withinContext.replicationSpec, qlMdTable, true, withinContext.getTablesForBootstrap(), withinContext.oldReplScope, withinContext.hiveConf)) { return; } if (qlMdTable.isView()) { withinContext.replicationSpec.setIsMetadataOnly(true); } <START> if (withinContext.hiveConf.getBoolVar(HiveConf.ConfVars.REPL_DUMP_METADATA_ONLY) || <END> (qlMdTable.getTableType().equals(TableType.EXTERNAL_TABLE) && withinContext.hiveConf.getBoolVar( HiveConf.ConfVars.REPL_DUMP_METADATA_ONLY_FOR_EXTERNAL_TABLE))) { qlMdTable.setStatsStateLikeNewTable(); } Path metaDataPath = new Path(withinContext.eventRoot, EximUtil.METADATA_NAME); EximUtil.createExportDump( metaDataPath.getFileSystem(withinContext.hiveConf), metaDataPath, qlMdTable, null, withinContext.replicationSpec, withinContext.hiveConf); Path dataPath = new Path(withinContext.eventRoot, "data"); Iterable<String> files = eventMessage.getFiles(); if (files != null) { try (BufferedWriter fileListWriter = writer(withinContext, dataPath)) { for (String file : files) { fileListWriter.write(file + "\n"); } } } withinContext.createDmd(this).write(); }</code><technical_language>This configs source ..target side ..this set</technical_language>

Target:
public void handle(Context withinContext) throws Exception { LOG.info("Processing#{} CREATE_TABLE message : {}", fromEventId(), eventMessageAsJSON); org.apache.hadoop.hive.metastore.api.Table tobj = eventMessage.getTableObj(); if (tobj == null) { LOG.debug("Event#{} was a CREATE_TABLE_EVENT with no table listed", fromEventId()); return; } Table qlMdTable = new Table(tobj); if (!Utils.shouldReplicate(withinContext.replicationSpec, qlMdTable, true, withinContext.getTablesForBootstrap(), withinContext.oldReplScope, withinContext.hiveConf)) { return; } if (qlMdTable.isView()) { withinContext.replicationSpec.setIsMetadataOnly(true); } if (Utils.shouldDumpMetaDataOnly(qlMdTable, withinContext.hiveConf)) { qlMdTable.setStatsStateLikeNewTable(); } Path metaDataPath = new Path(withinContext.eventRoot, EximUtil.METADATA_NAME); EximUtil.createExportDump( metaDataPath.getFileSystem(withinContext.hiveConf), metaDataPath, qlMdTable, null, withinContext.replicationSpec, withinContext.hiveConf); Path dataPath = new Path(withinContext.eventRoot, "data"); Iterable<String> files = eventMessage.getFiles(); if (files != null) { try (BufferedWriter fileListWriter = writer(withinContext, dataPath)) { for (String file : files) { fileListWriter.write(file + "\n"); } } } withinContext.createDmd(this).write(); }
Source:
<code>private ReadPacket read(int numOfBytes) { byte[] response = new byte[numOfBytes]; int len; try { response = mSerialDevice.read(numOfBytes, IO_TIMEOUT); len = response.length; <START> log.debug("Read " + len + " byte(s) complete."); <END> Thread.sleep(100); String bytes = ""; int readAmount = len; for (int i = 0; i < readAmount; i++) bytes += String.format("%02x", response[i]) + " "; log.debug("Read data: " + bytes); } catch (IOException e) { log.error("Unable to read from serial device.", e); } catch (InterruptedException e) { e.printStackTrace(); } return new ReadPacket(response); }</code><technical_language>slf4j-style formatting</technical_language>

Target:
private ReadPacket read(int numOfBytes) { byte[] response = new byte[numOfBytes]; int len; try { response = mSerialDevice.read(numOfBytes, IO_TIMEOUT); len = response.length; log.debug("Read byte(s) complete.", len); Thread.sleep(100); String bytes = ""; int readAmount = len; for (int i = 0; i < readAmount; i++) bytes += String.format("%02x", response[i]) + " "; log.debug("Read data: {}", bytes); } catch (IOException e) { log.error("Unable to read from serial device. {}", e); } catch (InterruptedException e) { e.printStackTrace(); } return new ReadPacket(response); }
Source:
<code>public ListenableFuture<Void> uploadBlobAsync( Digest digest, Chunker chunker, boolean forceUpload) { synchronized (lock) { checkState(!isShutdown, "Must not call uploadBlobs after shutdown."); if (!forceUpload && uploadedBlobs.contains(digest)) { return Futures.immediateFuture(null); } ListenableFuture<Void> inProgress = uploadsInProgress.get(digest); if (inProgress != null) { return inProgress; } ListenableFuture<Void> uploadResult = Futures.transform( startAsyncUpload(digest, chunker), (v) -> { synchronized (lock) { uploadedBlobs.add(digest); } return null; }, MoreExecutors.directExecutor()); uploadResult = Futures.catchingAsync( uploadResult, StatusRuntimeException.class, (sre) -> Futures.immediateFailedFuture( new IOException( String.format( <START> "Error while uploading artifact with digest '%s/%s'", <END> digest.getHash(), digest.getSizeBytes()), sre)), MoreExecutors.directExecutor()); uploadsInProgress.put(digest, uploadResult); uploadResult.addListener( () -> { synchronized (lock) { uploadsInProgress.remove(digest); } }, MoreExecutors.directExecutor()); return uploadResult; } }</code><technical_language>improvement, if gave a filename</technical_language>

Target:
public ListenableFuture<Void> uploadBlobAsync( Digest digest, Chunker chunker, boolean forceUpload) { synchronized (lock) { checkState(!isShutdown, "Must not call uploadBlobs after shutdown."); if (!forceUpload && uploadedBlobs.contains(HashCode.fromString(digest.getHash()))) { return Futures.immediateFuture(null); } ListenableFuture<Void> inProgress = uploadsInProgress.get(digest); if (inProgress != null) { return inProgress; } ListenableFuture<Void> uploadResult = Futures.transform( startAsyncUpload(digest, chunker), (v) -> { synchronized (lock) { uploadedBlobs.add(HashCode.fromString(digest.getHash())); } return null; }, MoreExecutors.directExecutor()); uploadResult = Futures.catchingAsync( uploadResult, StatusRuntimeException.class, (sre) -> Futures.immediateFailedFuture( new IOException( String.format( "Error while uploading artifact with digest '%s/%s'", digest.getHash(), digest.getSizeBytes()), sre)), MoreExecutors.directExecutor()); uploadsInProgress.put(digest, uploadResult); uploadResult.addListener( () -> { synchronized (lock) { uploadsInProgress.remove(digest); } }, MoreExecutors.directExecutor()); return uploadResult; } }
Source:
<code>private void runAutodefineForOneProvider(Guid providerId, int index) { Network externalNetwork = createExternalNetwork(getNetworkName(index), providerId, EXTERNAL_DESCRIPTION); AddNetworkStoragePoolParameters storagePoolParameters = new AddNetworkStoragePoolParameters(getNetwork().getStoragePoolId(), externalNetwork); <START> storagePoolParameters.setNetworkClusterList(createNetworkClusters(listOfClustersByProvider.get(providerId))); <END> runInternalAction(ActionType.AddNetworkOnProvider, storagePoolParameters); }</code><technical_language>Is this motivation for Ib56d800f9cf88b4d30fdb0717a11668cd6d1977e ? code simpler redundant if networkHelper.attachNetworkToClusters(network.getId(), listOfClustersByProvider.get(providerId))); is here</technical_language>

Target:
private void runAutodefineForOneProvider(Guid providerId, int index) { Network externalNetwork = createExternalNetwork(getNetworkName(index), providerId); AddNetworkStoragePoolParameters storagePoolParameters = new AddNetworkStoragePoolParameters(getNetwork().getStoragePoolId(), externalNetwork); storagePoolParameters.setVnicProfileRequired(false); ActionReturnValue returnValue = runInternalAction(ActionType.AddNetworkOnProvider, storagePoolParameters); if (returnValue.getSucceeded()) { Guid networkId = returnValue.getActionReturnValue(); networkHelper.attachNetworkToClusters(networkId, listOfClustersByProvider.get(providerId)); externalNetwork.setId(networkId); addVnicProfile(externalNetwork); } }
Source:
<code>private void connectToEureka() { updateInitialServerList(); if (eurekaClientProvider != null) { EurekaClient eurekaClient = eurekaClientProvider.get(); if (eurekaClient != null) { <START> eurekaClient.registerEventListener(updateListener); <END> } } }</code><technical_language>want add a registerEventListener(listener, executor) eurekaClient API executor in addition listener</technical_language>

Target:
private void connectToEureka() throws IllegalStateException { updateInitialServerList(); if (eurekaClientProvider != null) { EurekaClient eurekaClient = eurekaClientProvider.get(); if (eurekaClient == null) { throw new IllegalStateException("Cannot connect to eureka as the client provided is null"); } else { eurekaClient.registerEventListener(updateListener); } } }
Source:
<code>private void parseNamespaces() { if (tag.getAttributes() != null) { String prefix; for (Attribute attribute : tag.getAttributes()) { <START> if (attribute.getName().toLowerCase(Locale.ROOT).startsWith("xmlns")) { <END> int colon = attribute.getName().indexOf(':', 5); prefix = colon <= 0 ? "" : attribute.getName().substring(colon); namespaces.put(prefix, attribute.getValue()); } } } }</code><technical_language>pull attribute.getName() out a local variable is a bunch of times</technical_language>

Target:
private void parseNamespaces() { if (tag.getAttributes() != null) { String prefix, attributeName; for (Attribute attribute : tag.getAttributes()) { attributeName = attribute.getName() == null ? "" : attribute.getName(); if (attributeName.toLowerCase(Locale.ROOT).startsWith("xmlns")) { int colon = attributeName.indexOf(':', 5); prefix = colon <= 0 ? "" : attributeName.substring(colon); namespaces.put(prefix, attribute.getValue()); } } } }
Source:
<code>WindowAggProjection(StreamInput in) throws IOException { windowDefinition = new WindowDefinition(in); standaloneWithInputs = Symbols.listFromStream(in); int functionsCount = in.readVInt(); windowFunctionContexts = new ArrayList<>(); for (int i = 0; i < functionsCount; i++) { WindowFunction function = (WindowFunction) Symbols.fromStream(in); Symbol filter; if (in.getVersion().onOrAfter(Version.V_4_1_0)) { filter = Symbols.fromStream(in); } else { filter = Literal.BOOLEAN_TRUE; } List<Symbol> inputs = Symbols.listFromStream(in); windowFunctionContexts.add( new WindowFunctionContext(function, inputs, filter)); } <START> windowFunctions = windowFunctionContexts.stream() <END> .map(WindowFunctionContext::function) .collect(Collectors.toSet()); outputs = new ArrayList<>(windowFunctions); }</code><technical_language>build windowFunctions while loop avoid .stream().map().collectors() overhead</technical_language>

Target:
WindowAggProjection(StreamInput in) throws IOException { windowDefinition = new WindowDefinition(in); standaloneWithInputs = Symbols.listFromStream(in); int functionsCount = in.readVInt(); windowFunctionContexts = new ArrayList<>(functionsCount); windowFunctions = new HashSet<>(functionsCount); boolean onOrAfter4_1_0 = in.getVersion().onOrAfter(Version.V_4_1_0); for (int i = 0; i < functionsCount; i++) { WindowFunction function = (WindowFunction) Symbols.fromStream(in); Symbol filter; if (onOrAfter4_1_0) { filter = Symbols.fromStream(in); } else { filter = Literal.BOOLEAN_TRUE; } List<Symbol> inputs = Symbols.listFromStream(in); windowFunctionContexts.add( new WindowFunctionContext(function, inputs, filter)); windowFunctions.add(function); } outputs = new ArrayList<>(windowFunctions); }
Source:
<code>private AccountGroup createGroup(ReviewDb db, String groupName, AccountGroup.UUID adminGroupUUID, String description) throws OrmException { AccountGroup.Id groupId = new AccountGroup.Id(db.nextAccountGroupId()); AccountGroup.NameKey nameKey = new AccountGroup.NameKey(groupName); AccountGroup.UUID uuid = GroupUUID.make(groupName, serverUser); AccountGroup group = new AccountGroup(nameKey, groupId, uuid); <START> group.setOwnerGroupUUID(adminGroupUUID); <END> group.setDescription(description); AccountGroupName gn = new AccountGroupName(group); db.accountGroupNames().insert(Collections.singleton(gn)); db.accountGroups().insert(Collections.singleton(group)); return group; }</code><technical_language>add group.setType(AccountGroup.Type.SYSTEM)</technical_language>

Target:
private AccountGroup createGroup(ReviewDb db, String groupName, AccountGroup.UUID adminGroupUUID, String description) throws OrmException { AccountGroup.Id groupId = new AccountGroup.Id(db.nextAccountGroupId()); AccountGroup.NameKey nameKey = new AccountGroup.NameKey(groupName); AccountGroup.UUID uuid = GroupUUID.make(groupName, serverUser); AccountGroup group = new AccountGroup(nameKey, groupId, uuid); group.setOwnerGroupUUID(adminGroupUUID); group.setDescription(description); group.setType(AccountGroup.Type.SYSTEM); AccountGroupName gn = new AccountGroupName(group); db.accountGroupNames().insert(Collections.singleton(gn)); db.accountGroups().insert(Collections.singleton(group)); return group; }
Source:
<code>protected double scoreForNonmatchingNonnullFormat(String planFormat, Object planData, RegisteredType type, RegisteredTypeLoadingContext context) { <START> return 0; END> }</code><technical_language>Copy CampTypePlanTransformer's implementation? java @Override protected double scoreForNonmatchingNonnullFormat(String planFormat, Object planData, RegisteredType type, RegisteredTypeLoadingContext context) { if (FORMATS.contains(planFormat.toLowerCase())) return 0.9; return 0; }</technical_language>

Target:
protected double scoreForNonmatchingNonnullFormat(String planFormat, Object planData, RegisteredType type, RegisteredTypeLoadingContext context) { return planFormat.equals(FORMAT) ? 0.9 : 0; }
Source:
<code>public ValidationResult validateDuplicates(MacPoolPerCluster macPoolPerCluster) { return ValidationResult.failWith(EngineMessage.ACTION_TYPE_FAILED_MAC_POOL_CONTAINS_DUPLICATES) <START> .when(!macPool.isAllowDuplicateMacAddresses() && macPoolPerCluster.containsDuplicates(macPool.getId())); <END> }</code><technical_language>Please check previous "allowDuplicates" changed. Due compatibility a mac pool allow duplicates duplicates</technical_language>

Target:
public ValidationResult validateDuplicates(MacPoolPerCluster macPoolPerCluster) { return ValidationResult.failWith(EngineMessage.ACTION_TYPE_FAILED_MAC_POOL_CONTAINS_DUPLICATES) .when(!macPool.isAllowDuplicateMacAddresses() && macPoolPerCluster.isDuplicateMacAddressesAllowed(macPool.getId()) && macPoolPerCluster.containsDuplicates(macPool.getId())); }
Source:
<code>public HTableInterface getTable(byte[] tableName) throws SQLException { try { <START> return HBaseFactoryProvider.getHTableFactory().getTable(tableName, connection, getExecutor()); <END> } catch (org.apache.hadoop.hbase.TableNotFoundException e) { byte[][] schemaAndTableName = new byte[2][]; SchemaUtil.getVarChars(tableName, schemaAndTableName); throw new TableNotFoundException(Bytes.toString(schemaAndTableName[0]), Bytes.toString(schemaAndTableName[1])); } catch (IOException e) { throw new SQLException(e); } }</code><technical_language>Revert this change please - part of experiment get RpcScheduler set client-side</technical_language>

Target:
public HTableInterface getTable(byte[] tableName) throws SQLException { try { return HBaseFactoryProvider.getHTableFactory().getTable(tableName, connection, null); } catch (org.apache.hadoop.hbase.TableNotFoundException e) { byte[][] schemaAndTableName = new byte[2][]; SchemaUtil.getVarChars(tableName, schemaAndTableName); throw new TableNotFoundException(Bytes.toString(schemaAndTableName[0]), Bytes.toString(schemaAndTableName[1])); } catch (IOException e) { throw new SQLException(e); } }
Source:
<code>public ExprEval apply(List<Expr> args, Expr.ObjectBinding bindings) { if (args.size() == 1) { ExprEval value1 = args.get(0).eval(bindings); if (value1.type() != ExprType.LONG && value1.type() != ExprType.DOUBLE) { throw new IAE("first argument should be integer or double type but got %s type", value1.type()); } return eval(value1); } else if (args.size() == 2) { ExprEval value1 = args.get(0).eval(bindings); ExprEval value2 = args.get(1).eval(bindings); if (value1.type() != ExprType.LONG && value1.type() != ExprType.DOUBLE) { throw new IAE("first argument should be integer or double type but got %s type", value1.type()); } if (value2.type() != ExprType.LONG) { throw new IAE("second argument should be integer type but got %s type", value2.type()); } return eval(value1, value2.asInt()); } else { <START> throw new IAE("Function[%s] needs 1 or 2 arguments", name()); <END> } }</code><technical_language>check size beginning of apply method, refactor processing logic of ExprEval value1 eliminate duplicate code blocks</technical_language>

Target:
public ExprEval apply(List<Expr> args, Expr.ObjectBinding bindings) { if (args.size() != 1 && args.size() != 2) { throw new IAE("Function[%s] needs 1 or 2 arguments", name()); } ExprEval value1 = args.get(0).eval(bindings); if (value1.type() != ExprType.LONG && value1.type() != ExprType.DOUBLE) { throw new IAE("The first argument to the function[%s] should be integer or double type but get the %s type", name(), value1.type()); } if (args.size() == 1) { return eval(value1); } else { ExprEval value2 = args.get(1).eval(bindings); if (value2.type() != ExprType.LONG) { throw new IAE("The second argument to the function[%s] should be integer type but get the %s type", name(), value2.type()); } return eval(value1, value2.asInt()); } }
Source:
<code>public PppAuthSecrets(String secretsFilename) { this.secretsFilename = secretsFilename; this.providers = new ArrayList<String>(); this.clients = new ArrayList<String>(); this.servers = new ArrayList<String>(); this.secrets = new ArrayList<String>(); this.ipAddresses = new ArrayList<String>(); BufferedReader br = null; try { File secretsFile = new File(this.secretsFilename); if (secretsFile.exists()) { String currentLine = null; StringTokenizer st = null; br = new BufferedReader(new FileReader(this.secretsFilename)); while ((currentLine = br.readLine()) != null) { currentLine = currentLine.trim(); if (currentLine.indexOf('#') > 0) { st = new StringTokenizer(currentLine); this.clients.add(st.nextToken()); this.servers.add(st.nextToken()); this.secrets.add(st.nextToken()); this.ipAddresses.add(st.nextToken()); this.providers.add(st.nextToken().substring(1)); } } for (int i = 0; i < this.providers.size(); ++i) { s_logger.debug(this.clients.get(i) + "\t"); s_logger.debug(this.servers.get(i) + "\t"); s_logger.debug(this.secrets.get(i) + "\t"); s_logger.debug(this.ipAddresses.get(i) + "\t"); s_logger.debug(this.providers.get(i) + "\n"); } } else { <START> s_logger.info("File does not exist - creating " + this.secretsFilename); <END> writeToFile(); } } catch (Exception e) { s_logger.error("Could not initialize", e); } finally { if (br != null) { try { br.close(); } catch (IOException ex) { s_logger.error("I/O Exception while closing BufferedReader!"); } } } }</code><technical_language>Please change as: logger.info("File exist - creating {}", this.secretsFilename);</technical_language>

Target:
public PppAuthSecrets(String secretsFilename) { this.secretsFilename = secretsFilename; this.providers = new ArrayList<String>(); this.clients = new ArrayList<String>(); this.servers = new ArrayList<String>(); this.secrets = new ArrayList<String>(); this.ipAddresses = new ArrayList<String>(); BufferedReader br = null; try { File secretsFile = new File(this.secretsFilename); if (secretsFile.exists()) { String currentLine = null; StringTokenizer st = null; br = new BufferedReader(new FileReader(this.secretsFilename)); while ((currentLine = br.readLine()) != null) { currentLine = currentLine.trim(); if (currentLine.indexOf('#') > 0) { st = new StringTokenizer(currentLine); this.clients.add(st.nextToken()); this.servers.add(st.nextToken()); this.secrets.add(st.nextToken()); this.ipAddresses.add(st.nextToken()); this.providers.add(st.nextToken().substring(1)); } } for (int i = 0; i < this.providers.size(); ++i) { s_logger.debug(this.clients.get(i)); s_logger.debug(this.servers.get(i)); s_logger.debug(this.secrets.get(i)); s_logger.debug(this.ipAddresses.get(i)); s_logger.debug(this.providers.get(i)); } } else { s_logger.info("File does not exist - creating {}", this.secretsFilename); writeToFile(); } } catch (Exception e) { s_logger.error("Could not initialize", e); } finally { if (br != null) { try { br.close(); } catch (IOException ex) { s_logger.error("I/O Exception while closing BufferedReader!"); } } } }