auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public Action getAction(AbstractBuild<?,?> build, TaskListener listener) throws IOException, InterruptedException, DontTriggerException{ EnvVars env = getEnvironment(build, listener); String resolvedPropertiesFile = env.expand(propertiesFile); String[] allFiles = Util.tokenize(resolvedPropertiesFile, ","); List<ParameterValue> values = new ArrayList<ParameterValue>(); for(String file:allFiles) { FilePath f = build.getWorkspace().child(file); if (!f.exists()) { listener.getLogger().println("[parameterizedtrigger] Properties file " + file + " did not exist."); if(getFailTriggerOnMissing() == true) { listener.getLogger().println("Not triggering due to missing file"); throw new DontTriggerException(); } continue; } String s = f.readToString(); s = env.expand(s); Properties p = new Properties(); <START> p.load(new InputStreamReader(new StringInputStream(s), Charset.defaultCharset())); <END> for (Map.Entry<Object, Object> entry : p.entrySet()) { values.add(new StringParameterValue(entry.getKey().toString(), entry.getValue().toString())); } } return values.size() == 0 ? null :new ParametersAction(values); }</code><technical_language>Charset.defaultCharset, explicitly implicitly, is a bad idea</technical_language>

Target:
public Action getAction(AbstractBuild<?,?> build, TaskListener listener) throws IOException, InterruptedException, DontTriggerException{ EnvVars env = getEnvironment(build, listener); String resolvedPropertiesFile = env.expand(propertiesFile); String[] allFiles = Util.tokenize(resolvedPropertiesFile, ","); List<ParameterValue> values = new ArrayList<ParameterValue>(); for(String file:allFiles) { FilePath f = build.getWorkspace().child(file); if (!f.exists()) { listener.getLogger().println("[parameterizedtrigger] Properties file " + file + " did not exist."); if(getFailTriggerOnMissing() == true) { listener.getLogger().println("Not triggering due to missing file"); throw new DontTriggerException(); } continue; } String s = f.readToString(); s = env.expand(s); Properties p = new Properties(); p.load(new InputStreamReader(new StringInputStream(s), Charsets.UTF_8)); for (Map.Entry<Object, Object> entry : p.entrySet()) { values.add(new StringParameterValue(entry.getKey().toString(), entry.getValue().toString())); } } return values.size() == 0 ? null :new ParametersAction(values); }
Source:
<code>protected Map<String, Pair<String, String>> getExclusiveLocks() { Map<String, Pair<String, String>> locks = new HashMap<String, Pair<String, String>>(); domains = getStorageDomainsByConnId(getConnection().getid()); if (!domains.isEmpty()) { for (StorageDomain domain : domains) { locks.put(domain.getId().toString(), LockMessagesMatchUtil.makeLockingPair(LockingGroup.STORAGE, VdcBllMessages.ACTION_TYPE_FAILED_OBJECT_LOCKED)); } } if (getConnection().getstorage_type().isFileDomain()) { locks.put(getConnection().getconnection(), LockMessagesMatchUtil.makeLockingPair(LockingGroup.STORAGE_CONNECTION, VdcBllMessages.ACTION_TYPE_FAILED_OBJECT_LOCKED)); } else { <START> locks.put(getConnection().getconnection() + ";" + getConnection().getiqn() + ";" + getConnection().getport() + ";" + getConnection().getuser_name(), <END> LockMessagesMatchUtil.makeLockingPair(LockingGroup.STORAGE_CONNECTION, VdcBllMessages.ACTION_TYPE_FAILED_OBJECT_LOCKED)); } locks.put(getConnection().getid(), LockMessagesMatchUtil.makeLockingPair(LockingGroup.STORAGE_CONNECTION, VdcBllMessages.ACTION_TYPE_FAILED_OBJECT_LOCKED)); return locks; }</code><technical_language>consider extracting ";" a constant</technical_language>

Target:
protected Map<String, Pair<String, String>> getExclusiveLocks() { Map<String, Pair<String, String>> locks = new HashMap<String, Pair<String, String>>(); domains = getStorageDomainsByConnId(getConnection().getid()); if (!domains.isEmpty()) { for (StorageDomain domain : domains) { locks.put(domain.getId().toString(), LockMessagesMatchUtil.makeLockingPair(LockingGroup.STORAGE, VdcBllMessages.ACTION_TYPE_FAILED_OBJECT_LOCKED)); } } if (getConnection().getstorage_type().isFileDomain()) { locks.put(getConnection().getconnection(), LockMessagesMatchUtil.makeLockingPair(LockingGroup.STORAGE_CONNECTION, VdcBllMessages.ACTION_TYPE_FAILED_OBJECT_LOCKED)); } else { locks.put(getConnection().getconnection() + ";" + getConnection().getiqn() + ";" + getConnection().getport() + ";" + getConnection().getuser_name(), LockMessagesMatchUtil.makeLockingPair(LockingGroup.STORAGE_CONNECTION, VdcBllMessages.ACTION_TYPE_FAILED_OBJECT_LOCKED)); if(getLuns()!=null) { for(LUNs lun : getLuns()) { Guid diskId = lun.getDiskId(); Guid storageDomainId = lun.getStorageDomainId(); if(diskId != null) { locks.put(diskId.toString(),LockMessagesMatchUtil.makeLockingPair(LockingGroup.DISK, VdcBllMessages.ACTION_TYPE_FAILED_OBJECT_LOCKED)); } if(storageDomainId != null) { locks.put(storageDomainId.toString(),LockMessagesMatchUtil.makeLockingPair(LockingGroup.STORAGE, VdcBllMessages.ACTION_TYPE_FAILED_OBJECT_LOCKED)); } } } } locks.put(getConnection().getid(), LockMessagesMatchUtil.makeLockingPair(LockingGroup.STORAGE_CONNECTION, VdcBllMessages.ACTION_TYPE_FAILED_OBJECT_LOCKED)); return locks; }
Source:
<code>public void close() { try { <START> if (!mClosed) { <END> stopLocalOnlyHotspot(); } mCloseGuard.close(); } catch (Exception e) { Log.e(TAG, "Failed to stop Local Only Hotspot."); } finally { mClosed = true; } }</code><technical_language>mClose guarded mLock</technical_language>

Target:
public void close() { try { synchronized (mLock) { if (!mClosed) { mClosed = true; stopLocalOnlyHotspot(); mCloseGuard.close(); } } } catch (Exception e) { Log.e(TAG, "Failed to stop Local Only Hotspot."); } }
Source:
<code><START> private void assertCSPAlertAttributes(Alert alert, String key, int expectedRisk) { <END> assertThat(alert.getRisk(), is(expectedRisk)); assertThat(alert.getName(), is(getLocalisedString(key + "name"))); assertThat(alert.getDescription(), is(getLocalisedString(key + "desc"))); assertThat(alert.getReference(), is(getLocalisedString(key + "refs"))); assertThat(alert.getSolution(), is(getLocalisedString("soln"))); assertThat(alert.getConfidence(), is(Alert.CONFIDENCE_MEDIUM)); assertThat(alert.getCweId(), is(16)); assertThat(alert.getWascId(), is(15)); assertThat(alert.getUri(), is(URI)); }</code><technical_language>static (and ones)</technical_language>

Target:
private static void assertCSPAlertAttributes(Alert alert, String key, int expectedRisk) { assertThat(alert.getRisk(), is(expectedRisk)); assertThat(alert.getName(), is(getLocalisedString(key + "name"))); assertThat(alert.getDescription(), is(getLocalisedString(key + "desc"))); assertThat(alert.getReference(), is(getLocalisedString(key + "refs"))); assertThat(alert.getSolution(), is(getLocalisedString("soln"))); assertThat(alert.getConfidence(), is(Alert.CONFIDENCE_MEDIUM)); assertThat(alert.getCweId(), is(16)); assertThat(alert.getWascId(), is(15)); assertThat(alert.getUri(), is(URI)); }
Source:
<code>public static ReviewStatus getReviewStatus(com.google.gerrit.reviewdb.Change.Status gerritStatus) { <START> switch (gerritStatus) { <END> case NEW: return ReviewStatus.NEW; case MERGED: return ReviewStatus.MERGED; case SUBMITTED: return ReviewStatus.SUBMITTED; case ABANDONED: return ReviewStatus.ABANDONED; default: if (gerritStatus != null) { GerritCorePlugin.logError("Internal Error: unexpected change status: " + gerritStatus, new Exception()); } return ReviewStatus.DRAFT; } }</code><technical_language>I get this exception a switch a null: java.lang.NullPointerException org.eclipse.mylyn.internal.gerrit.core.remote.GerritReviewRemoteFactory.getReviewStatus(GerritReviewRemoteFactory.java:338) org.eclipse.mylyn.internal.gerrit.core.client.data.GerritQueryResult.<init>(GerritQueryResult.java:51) org.eclipse.mylyn.internal.gerrit.core.GerritTaskDataHandler.updateTaskData(GerritTaskDataHandler.java:225) org.eclipse.mylyn.internal.gerrit.core.GerritTaskDataHandler.getTaskData(GerritTaskDataHandler.java:114) org.eclipse.mylyn.internal.gerrit.core.GerritConnector.getTaskData(GerritConnector.java:160) org.eclipse.mylyn.internal.tasks.core.sync.SynchronizeTasksJob.synchronizeTask(SynchronizeTasksJob.java:245)</technical_language>

Target:
public static ReviewStatus getReviewStatus(com.google.gerrit.reviewdb.Change.Status gerritStatus) { if (gerritStatus == null) { return ReviewStatus.DRAFT; } switch (gerritStatus) { case NEW: return ReviewStatus.NEW; case MERGED: return ReviewStatus.MERGED; case SUBMITTED: return ReviewStatus.SUBMITTED; case ABANDONED: return ReviewStatus.ABANDONED; default: GerritCorePlugin.logError("Internal Error: unexpected change status: " + gerritStatus, new Exception()); return null; } }
Source:
<code>private void readCSV(File csv, String formHash, String pathHash) { CSVReader reader; ItemsetDbAdapter ida = new ItemsetDbAdapter(); ida.open(); boolean withinTransaction = false; try { reader = new CSVReader(new FileReader(csv)); String[] nextLine; String[] columnHeaders = null; int lineNumber = 0; while ((nextLine = reader.readNext()) != null) { lineNumber++; if (lineNumber == 1) { columnHeaders = nextLine; ida.createTable(formHash, pathHash, columnHeaders, csv.getAbsolutePath()); continue; } if (lineNumber == 2) { withinTransaction = true; ida.beginTransaction(); } ida.addRow(pathHash, columnHeaders, nextLine); } } catch (IOException | SQLiteException e) { <START> warrningMsg = "Exception thrown while reading csv file"; <END> Timber.e(e, warrningMsg); } finally { if (withinTransaction) { ida.commit(); } ida.close(); } }</code><technical_language>this is get shown user, move strings.xml translate it? Also, Android Studio highlights this is angry it. hates Strings</technical_language>

Target:
private void readCSV(File csv, String formHash, String pathHash) { CSVReader reader; ItemsetDbAdapter ida = new ItemsetDbAdapter(); ida.open(); boolean withinTransaction = false; try { reader = new CSVReader(new FileReader(csv)); String[] nextLine; String[] columnHeaders = null; int lineNumber = 0; while ((nextLine = reader.readNext()) != null) { lineNumber++; if (lineNumber == 1) { columnHeaders = nextLine; ida.createTable(formHash, pathHash, columnHeaders, csv.getAbsolutePath()); continue; } if (lineNumber == 2) { withinTransaction = true; ida.beginTransaction(); } ida.addRow(pathHash, columnHeaders, nextLine); } } catch (IOException | SQLException e) { warningMsg = e.getMessage(); } finally { if (withinTransaction) { ida.commit(); } ida.close(); } }
Source:
<code>public void testGetJobTasksIdsByTagPaginated() throws Throwable { int nbTasks = 50; <START> String jobIdStr = "1"; <END> JobState job = newMockedJob(jobIdStr, nbTasks); when(mockOfScheduler.getJobState(jobIdStr)).thenReturn(job); List<String> res = restInterface.getJobTasksIdsPaginated(sessionId, jobIdStr, 0, nbTasks); assertEquals("Number of tasks is incorrect", nbTasks, res.size()); for (int i = 0; i < nbTasks; i++) { assertEquals("Task readable name is incorrect", generateReadableName(jobIdStr, i, nbTasks), res.get(i)); } }</code><technical_language>next lines put in a new method factorize code in lot of test methods</technical_language>

Target:
public void testGetJobTasksIdsByTagPaginated() throws Throwable { int nbTasks = 50; String jobIdStr = "1"; JobState job = newMockedJob(jobIdStr, nbTasks); when(mockOfScheduler.getJobState(jobIdStr)).thenReturn(job); TaskIdsPage page = restInterface.getTasksNamesPaginated(sessionId, jobIdStr, 0, nbTasks); assertTasks(nbTasks, jobIdStr, page); }
Source:
<code>public void testDirect() { DynamicCacheDescriptor desc1 = new DynamicCacheDescriptor(null, new CacheConfiguration().setName("1111"), CacheType.DATA_STRUCTURES, null, true, null, true, false, null, new QuerySchema(), null); DynamicCacheDescriptor desc2 = new DynamicCacheDescriptor(null, new CacheConfiguration().setName("2222"), CacheType.INTERNAL, null, true, null, true, false, null, new QuerySchema(), null); <START> assertTrue(ClusterCachesInfo.CacheComparators.DIRECT.compare(desc1, desc2) < 0); <END> assertTrue(ClusterCachesInfo.CacheComparators.DIRECT.compare(desc2, desc1) > 0); }</code><technical_language>compare method fixed this change is redundant</technical_language>

Target:
public void testDirect() { DynamicCacheDescriptor desc1 = new DynamicCacheDescriptor(null, new CacheConfiguration().setName("1111"), CacheType.DATA_STRUCTURES, null, true, null, true, false, null, new QuerySchema(), null); DynamicCacheDescriptor desc2 = new DynamicCacheDescriptor(null, new CacheConfiguration().setName("2222"), CacheType.INTERNAL, null, true, null, true, false, null, new QuerySchema(), null); assertEquals(-1, ClusterCachesInfo.CacheComparators.DIRECT.compare(desc1, desc2)); assertEquals(1, ClusterCachesInfo.CacheComparators.DIRECT.compare(desc2, desc1)); }
Source:
<code>public void checkPipelineCreationAuthorizationAnd403(Request request, Response response) { if (!securityService.isSecurityEnabled() || securityService.isUserAdmin(currentUsername())) { return; } JsonElement group = new JsonParser().parse(request.body()).getAsJsonObject().get("group"); if (group == null) { throw new UnprocessableEntityException("Pipeline group must be specified for creating a pipeline."); } else { String groupName = group.getAsString(); if (StringUtils.isNotBlank(groupName) && <START> (!goConfigService.groups().hasGroup(groupName) || !securityService.isUserAdminOfGroup(currentUsername(), groupName))) { <END> throw renderForbiddenResponse(); } } }</code><technical_language>indent? extract a variable</technical_language>

Target:
public void checkPipelineCreationAuthorizationAnd403(Request request, Response response) { if (!securityService.isSecurityEnabled() || securityService.isUserAdmin(currentUsername())) { return; } JsonElement group = new JsonParser().parse(request.body()).getAsJsonObject().get("group"); if (group == null) { throw new UnprocessableEntityException("Pipeline group must be specified for creating a pipeline."); } else { String groupName = group.getAsString(); boolean groupDoesNotExists = !goConfigService.groups().hasGroup(groupName); boolean userNotAdminOfTheGrp = !securityService.isUserAdminOfGroup(currentUsername(), groupName); if (isNotBlank(groupName) && (groupDoesNotExists || userNotAdminOfTheGrp)) { throw renderForbiddenResponse(); } } }
Source:
<code><START> protected TableRef createTableRef(String alias, String schemaName, String tableName,List<ColumnDef> dyn_columns) throws SQLException { <END> long timeStamp = Math.abs(client.updateCache(schemaName, tableName)); PSchema theSchema = null; try { theSchema = connection.getPMetaData().getSchema(schemaName); } catch (SchemaNotFoundException e) { throw new TableNotFoundException(schemaName, tableName); } PTable theTable = theSchema.getTable(tableName); if(dyn_columns!=null){ int ordinalPosition = theTable.getColumns().size(); List<PColumn> dyn_column_list = new ArrayList<PColumn>(); dyn_column_list.addAll(theTable.getColumns()); for(ColumnDef cdef:dyn_columns){ PColumn pc = this.newColumn(ordinalPosition, cdef, new HashSet(theTable.getPKColumns())); if(pc!=null){ dyn_column_list.add(pc); } ordinalPosition++; } theTable = new PTableImpl(theTable.getName(), theTable.getType(), theTable.getTimeStamp(),theTable.getSequenceNumber(), theTable.getPKName(), dyn_column_list); } TableRef tableRef = new TableRef(alias, theTable, theSchema, timeStamp); return tableRef; }</code><technical_language>Instead of List<ColumnDef> List<PColumn> create PColumn list in SelectFromClauseVisitor.createTableRef, a MetaDataClient call metaDataClient.newColumn public</technical_language>

Target:
protected TableRef createTableRef(String alias, String schemaName, String tableName,List<ColumnDef> dyn_columns) throws SQLException { long timeStamp = Math.abs(client.updateCache(schemaName, tableName)); PSchema theSchema = null; try { theSchema = connection.getPMetaData().getSchema(schemaName); } catch (SchemaNotFoundException e) { throw new TableNotFoundException(schemaName, tableName); } PTable theTable = theSchema.getTable(tableName); if(dyn_columns!=null && !dyn_columns.isEmpty()) { int ordinalPosition = theTable.getColumns().size(); List<PColumn> dyn_column_list = new ArrayList<PColumn>(); dyn_column_list.addAll(theTable.getColumns()); for(ColumnDef cdef:dyn_columns){ dyn_column_list.add(client.newColumn(ordinalPosition, cdef, new HashSet(theTable.getPKColumns()))); ordinalPosition++; } theTable = new PTableImpl(theTable.getName(), theTable.getType(), theTable.getTimeStamp(),theTable.getSequenceNumber(), theTable.getPKName(), dyn_column_list); } TableRef tableRef = new TableRef(alias, theTable, theSchema, timeStamp); return tableRef; }
Source:
<code>public void stateProcessingSeriesStopsOnShutdown() throws InterruptedException { WorkflowInstance instance = executingInstanceBuilder().setType("looping-test").setState("start").build(); when(workflowInstances.getWorkflowInstance(instance.id, INCLUDES, null)).thenReturn(instance); ExecutorService executorService = newSingleThreadExecutor(); executorService.submit(executor); sleep(500); executorService.shutdown(); shutdownRequest.set(true); executorService.awaitTermination(10, SECONDS); <START> assertThat(loopingWf.counter, Matchers.lessThan(20)); <END> }</code><technical_language>static import</technical_language>

Target:
public void stateProcessingSeriesStopsOnShutdown() throws InterruptedException { WorkflowInstance instance = executingInstanceBuilder().setType("looping-test").setState("start").build(); when(workflowInstances.getWorkflowInstance(instance.id, INCLUDES, null)).thenReturn(instance); ExecutorService executorService = newSingleThreadExecutor(); executorService.submit(executor); sleep(500); executorService.shutdown(); shutdownRequest.set(true); boolean wasTerminated = executorService.awaitTermination(5, SECONDS); executorService.shutdownNow(); assertTrue(wasTerminated); }
Source:
<code>public void testProxy() throws Exception { ResteasyClient client = getClient(); ResteasyWebTarget target = client.target(generateBaseUrl()); IGZIP proxy = target.proxy(IGZIP.class); ResteasyProviderFactory providerFactory = ResteasyProviderFactory.getInstance(); providerFactory.registerProvider(AcceptEncodingGZIPInterceptor.class); providerFactory.registerProvider(GZIPDecodingInterceptor.class); <START> providerFactory.registerProvider(GZIPEncodingInterceptor.class); <END> Assert.assertEquals("HELLO WORLD", proxy.getText()); Assert.assertEquals("HELLO WORLD", proxy.getGzipText()); try { String error = proxy.getGzipErrorText(); Assert.fail("unreachable"); } catch (WebApplicationException failure) { Assert.assertEquals(500, failure.getResponse().getStatus()); String txt = (String) failure.getResponse().readEntity(String.class); Assert.assertEquals("Hello", txt); } finally { client.close(); } }</code><technical_language>I lines needed getClient() method</technical_language>

Target:
public void testProxy() throws Exception { ResteasyClient client = getClient(); ResteasyWebTarget target = client.target(generateBaseUrl()); IGZIP proxy = target.proxy(IGZIP.class); Assert.assertEquals("HELLO WORLD", proxy.getText()); Assert.assertEquals("HELLO WORLD", proxy.getGzipText()); try { String error = proxy.getGzipErrorText(); Assert.fail("unreachable"); } catch (WebApplicationException failure) { Assert.assertEquals(500, failure.getResponse().getStatus()); String txt = (String) failure.getResponse().readEntity(String.class); Assert.assertEquals("Hello", txt); } finally { client.close(); } }
Source:
<code>protected static double getCellHeight(final int rowIndex, final List<Double> allRowHeights, final GridCell<?> cell) { <START> return IntStream.range(rowIndex, rowIndex + cell.getMergedCellCount()) <END> .mapToDouble(allRowHeights::get) .sum(); }</code><technical_language>@manstis please replace for-loop (or parallel stream) for performance</technical_language>

Target:
protected static double getCellHeight(final int rowIndex, final List<Double> allRowHeights, final GridCell<?> cell) { double height = 0.0; for (int iRowIndex = rowIndex; iRowIndex < rowIndex + cell.getMergedCellCount(); iRowIndex++) { height = height + allRowHeights.get(iRowIndex); } return height; }
Source:
<code>public String editBank(@ModelAttribute BankDto bankDto) { String loginName = LoginUserInfo.getLoginName(); BankModel bankModel = new BankModel(bankDto); bankModel.setUpdatedBy(loginName); bankModel.setUpdatedTime(new Date()); consoleBankService.updateBank(bankModel); String redirectUrl = "redirect:/finance-manage/bank-list"; if (bankDto.getIsBank() != null && (!bankDto.getIsBank())) { redirectUrl += "?isBank=false"; } <START> return redirectUrl; <END> }</code><technical_language>return String.format("redirect:/finance-manage/bank-list?isBank=%s", bankModel.getIsBank())</technical_language>

Target:
public String editBank(@ModelAttribute BankDto bankDto) { String loginName = LoginUserInfo.getLoginName(); BankModel bankModel = new BankModel(bankDto); bankModel.setUpdatedBy(loginName); bankModel.setUpdatedTime(new Date()); consoleBankService.updateBank(bankModel); String redirectUrl = "redirect:/finance-manage/bank-list?isBank=" + bankDto.getIsBank(); return redirectUrl; }
Source:
<code>Map<String, Object> asMap() { List<VmInitNetwork> vmInitNetworks = vmInit.getNetworks(); List<Map<String, Object>> links = null; List<Map<String, Object>> networks = null; <START> if (vmInitNetworks != null) { <END> links = new LinkedList<>(); networks = new LinkedList<>(); for (VmInitNetwork vmInitNetwork: vmInitNetworks) { boolean addLink = false; Map<String, Object> networkIPv4 = mapIPv4(vmInitNetwork); if (networkIPv4 != null) { networks.add(networkIPv4); addLink = true; } Map<String, Object> networkIPv6 = mapIPv6(vmInitNetwork); if (networkIPv6 != null) { networks.add(networkIPv6); addLink = true; } if (addLink) { links.add(mapVifLink(vmInitNetwork)); } } } List<Map<String, Object>> services = mapServices(); Map<String, Object> networkData = new HashMap<>(); if (links != null && !links.isEmpty()) { networkData.put("links", links); } if (networks != null && !networks.isEmpty()) { networkData.put("networks", networks); } if (services != null && !services.isEmpty()) { networkData.put("services", services); } return networkData; }</code><technical_language>a suggestion - 'early return' pattern simplify code, i.e., if (vmInitNetworks == null) \n return null; , simplify code</technical_language>

Target:
Map<String, Object> asMap() { List<VmInitNetwork> vmInitNetworks = vmInit.getNetworks(); List<Map<String, Object>> links = null; List<Map<String, Object>> networks = null; if (vmInitNetworks != null) { links = new LinkedList<>(); networks = new LinkedList<>(); for (VmInitNetwork vmInitNetwork: vmInitNetworks) { if (vmInitNetwork.getStartOnBoot() == null || !vmInitNetwork.getStartOnBoot()) { throw new IllegalArgumentException("'Start on boot' must be true"); } boolean addLink = false; Map<String, Object> networkIPv4 = mapIPv4(vmInitNetwork); if (networkIPv4 != null) { networks.add(networkIPv4); addLink = true; } Map<String, Object> networkIPv6 = mapIPv6(vmInitNetwork); if (networkIPv6 != null) { networks.add(networkIPv6); addLink = true; } if (addLink) { links.add(mapVifLink(vmInitNetwork)); } } } List<Map<String, Object>> services = mapServices(); Map<String, Object> networkData = new HashMap<>(); if (links != null && !links.isEmpty()) { networkData.put("links", links); } if (networks != null && !networks.isEmpty()) { networkData.put("networks", networks); } if (services != null && !services.isEmpty()) { networkData.put("services", services); } return networkData; }
Source:
<code>public void configure(Object... parameters) { if (parameters != null && parameters.length >= 9) { checkJBSName(); int index = 0; this.javaPath = parameters[index++].toString(); if (this.javaPath == null || this.javaPath.equals("")) { this.javaPath = "java"; } this.sshOptions = parameters[index++].toString(); this.schedulingPath = parameters[index++].toString(); this.javaOptions = parameters[index++].toString(); checkJavaOptions(); try { this.maxNodes = Integer.parseInt(parameters[index++].toString()); } catch (Exception e) { this.maxNodes = 1; } try { this.nodeTimeOut = Integer.parseInt(parameters[index++].toString()); } catch (Exception e) { this.nodeTimeOut = 1000 * 60 * 5; } this.serverName = parameters[index++].toString(); if (parameters[index] == null) { throw new IllegalArgumentException("Credentials must be specified"); } try { persistedInfraVariables.put(CREDENTIALS_KEY, Credentials.getCredentialsBase64((byte[]) parameters[index++])); } catch (KeyException e) { <START> logger.debug("Could not retrieve base64 credentials", e); <END> } if (parameters[index] != null) { this.submitJobOpt = parameters[index++].toString().replaceAll("\"", "\\\""); } } else { throw new IllegalArgumentException("Invalid parameters for IM creation"); } }</code><technical_language>if credentials provided incorrect, trigger error</technical_language>

Target:
public void configure(Object... parameters) { if (parameters != null && parameters.length >= 9) { checkJBSName(); int index = 0; this.javaPath = parameters[index++].toString(); if (this.javaPath == null || this.javaPath.equals("")) { this.javaPath = "java"; } this.sshOptions = parameters[index++].toString(); this.schedulingPath = parameters[index++].toString(); this.javaOptions = parameters[index++].toString(); checkJavaOptions(); try { this.maxNodes = Integer.parseInt(parameters[index++].toString()); } catch (Exception e) { this.maxNodes = 1; } try { this.nodeTimeOut = Integer.parseInt(parameters[index++].toString()); } catch (Exception e) { this.nodeTimeOut = 1000 * 60 * 5; } this.serverName = parameters[index++].toString(); try { Object possibleCredentials = parameters[index++]; if (possibleCredentials != null) { persistedInfraVariables.put(CREDENTIALS_KEY, Credentials.getCredentialsBase64((byte[]) possibleCredentials)); } } catch (KeyException e) { throw new IllegalArgumentException("Could not retrieve base64 credentials", e); } if (parameters[index] != null) { this.submitJobOpt = parameters[index++].toString().replaceAll("\"", "\\\""); } } else { throw new IllegalArgumentException("Invalid parameters for IM creation"); } }
Source:
<code>public void testImportVMFromConfigurationWhenStorageDomainIsInactive() { initCommand(getOvfEntityData()); StorageDomain storageDomain = createStorageDomain(); storageDomain.setStatus(StorageDomainStatus.Inactive); final StorageDomainDAO dao = mock(StorageDomainDAO.class); <START> when(validator.validateUnregisteredEntity(any(IVdcQueryable.class), any(OvfEntityData.class), any(List.class))).thenReturn(new ValidationResult(VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_DOMAIN_STATUS_ILLEGAL2)); <END> when(dao.getForStoragePool(storageDomainId, storagePoolId)).thenReturn(storageDomain); CanDoActionTestUtils.runAndAssertCanDoActionFailure(cmd, VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_DOMAIN_STATUS_ILLEGAL2); }</code><technical_language>s/any(List.class)/anyList()</technical_language>

Target:
public void testImportVMFromConfigurationWhenStorageDomainIsInactive() { initCommand(getOvfEntityData()); StorageDomain storageDomain = createStorageDomain(); storageDomain.setStatus(StorageDomainStatus.Inactive); final StorageDomainDAO dao = mock(StorageDomainDAO.class); when(validator.validateUnregisteredEntity(any(IVdcQueryable.class), any(OvfEntityData.class), anyList())).thenReturn(new ValidationResult(VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_DOMAIN_STATUS_ILLEGAL2)); when(dao.getForStoragePool(storageDomainId, storagePoolId)).thenReturn(storageDomain); CanDoActionTestUtils.runAndAssertCanDoActionFailure(cmd, VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_DOMAIN_STATUS_ILLEGAL2); }
Source:
<code>private Metacard generateMetacard(InputStream message) throws IOException { try { if (message != null) { if (!transformer.isPresent()) { throw new IllegalArgumentException( "Transformation Failed for transformer: " + transformerId); <START> } <END> return transformer.get().transform(message); } else { throw new IllegalArgumentException("Data file is null."); } } catch (CatalogTransformerException e) { throw new IllegalArgumentException( "Transformation Failed for transformer: " + transformerId, e); } }</code><technical_language>do: if (message != null && transformer.isPresent()) { return transformer.get().transform(message); } instead of throwing exception twice</technical_language>

Target:
private Metacard generateMetacard(InputStream message) throws IOException { try { if (message == null) { throw new IllegalArgumentException("Data file is null."); } if (!transformer.isPresent()) { throw new IllegalArgumentException( "Transformation Failed for transformer: " + transformerId); } return transformer.get().transform(message); } catch (CatalogTransformerException e) { throw new IllegalArgumentException( "Transformation Failed for transformer: " + transformerId, e); } }
Source:
<code>public void onePairVsDoublePair() { String pairOf8 = "2S 8H 6S 8D JH"; <START> String doublePair = "4S 5H 4C 8C 5H"; <END> assertEquals(Arrays.asList(doublePair), new Poker(Arrays.asList(pairOf8, doublePair)).getBestHands()); }</code><technical_language>I this 5C 5H</technical_language>

Target:
public void onePairVsDoublePair() { String pairOf8 = "2S 8H 6S 8D JH"; String doublePair = "4S 5H 4C 8C 5C"; assertEquals(Collections.singletonList(doublePair), new Poker(Arrays.asList(pairOf8, doublePair)).getBestHands()); }
Source:
<code>protected ScrollPane doCreateVisual() { final VBox vBox = new VBox(); vBox.boundsInParentProperty().addListener(boundsListener); final ScrollPane scrollPane = new ScrollPane(vBox); scrollPane.getStylesheets().clear(); <START> scrollPane.getStylesheets().add(URI.createPlatformPluginURI("resources/scrollPane.css", false).toPlatformString(false)); END> return scrollPane; }</code><technical_language>This stylesheet is in places; a constant useful. is required for internal (implementation) purposes only, this explicit (e.g. resources/internal/scrollPane.css)</technical_language>

Target:
protected ScrollPane doCreateVisual() { final VBox vBox = new VBox(); vBox.boundsInParentProperty().addListener(boundsListener); final ScrollPane scrollPane = new ScrollPane(vBox); scrollPane.getStylesheets().clear(); scrollPane.getStylesheets().add(URI.createPlatformPluginURI(VisualPartUtil.VIEWPORT_SCROLL_PANE_STYLE, false).toPlatformString(false)); return scrollPane; }
Source:
<code>private void initObserver() { courseDateViewModel.getBannerInfo().observe(this, this::initInfoBanner); <START> <END> courseDateViewModel.getShowLoader().observe(this, flag -> preloadingListener.setLoadingState(flag ? PreLoadingListener.State.MAIN_UNIT_LOADING : PreLoadingListener.State.MAIN_UNIT_LOADED)); courseDateViewModel.getResetCourseDates().observe(this, resetCourseDates -> { if (resetCourseDates != null) { showShiftDateSnackBar(true); canFetchBannerInfo = false; authWebView.loadUrl(true, unit.getBlockUrl()); } }); courseDateViewModel.getErrorMessage().observe(this, errorMessage -> { if (errorMessage != null) { if (errorMessage.getThrowable() instanceof AuthException || errorMessage.getThrowable() instanceof HttpStatusException && ((HttpStatusException) errorMessage.getThrowable()).getStatusCode() == HttpStatus.UNAUTHORIZED) { environment.getRouter().forceLogout(getContextOrThrow(), environment.getAnalyticsRegistry(), environment.getNotificationDelegate()); } else { switch (errorMessage.getErrorCode()) { case ErrorMessage.BANNER_INFO_CODE: initInfoBanner(null); break; case ErrorMessage.COURSE_RESET_DATES_CODE: showShiftDateSnackBar(false); break; } } } }); }</code><technical_language>show showShiftDateSnackBar other screens too, Story description - Success toast message learner shifts date home Dates page</technical_language>

Target:
private void initObserver() { courseDateViewModel = new ViewModelProvider(this, new ViewModelFactory()).get(CourseDateViewModel.class); courseDateViewModel.getBannerInfo().observe(this, this::initInfoBanner); courseDateViewModel.getShowLoader().observe(this, flag -> preloadingListener.setLoadingState(flag ? PreLoadingListener.State.MAIN_UNIT_LOADING : PreLoadingListener.State.MAIN_UNIT_LOADED)); courseDateViewModel.getResetCourseDates().observe(this, resetCourseDates -> { if (resetCourseDates != null) { showShiftDateSnackBar(true); authWebView.loadUrl(true, unit.getBlockUrl()); } }); courseDateViewModel.getErrorMessage().observe(this, errorMessage -> { if (errorMessage != null) { if (errorMessage.getThrowable() instanceof AuthException || errorMessage.getThrowable() instanceof HttpStatusException && ((HttpStatusException) errorMessage.getThrowable()).getStatusCode() == HttpStatus.UNAUTHORIZED) { environment.getRouter().forceLogout(getContextOrThrow(), environment.getAnalyticsRegistry(), environment.getNotificationDelegate()); } else { switch (errorMessage.getErrorCode()) { case ErrorMessage.BANNER_INFO_CODE: initInfoBanner(null); break; case ErrorMessage.COURSE_RESET_DATES_CODE: showShiftDateSnackBar(false); break; } } } }); }
Source:
<code>public void setAsDisplay() { final Network network = (Network) Cloner.clone(getSelectedItem()); network.getCluster().setDisplay(true); final AttachNetworkToVdsGroupParameter attachNetworkToVdcGroupParameter = new AttachNetworkToVdsGroupParameter(getEntity(), network); <START> Frontend.getInstance().runAction(VdcActionType.AttachNetworkToVdsGroup, attachNetworkToVdcGroupParameter); <END> }</code><technical_language>I right command run in this context is UpdateNetworkOnCluster, if network is attached cluster display role. do think</technical_language>

Target:
public void setAsDisplay() { final Network network = (Network) Cloner.clone(getSelectedItem()); network.getCluster().setDisplay(true); final NetworkClusterParameters networkClusterParameters = new NetworkClusterParameters(network.getCluster()); Frontend.getInstance().runAction(VdcActionType.UpdateNetworkOnCluster, networkClusterParameters); }
Source:
<code>public boolean isProcessed() { <START> if (getOperatorsToDeploy().size() == 0 && getOperatorsToUndeploy().size() == 0) { <END> return true; } return false; }</code><technical_language>return operatorsToDeploy.isEmpty() && operatorsToUndeploy.isEmpty();</technical_language>

Target:
public boolean isProcessed() { return (getOperatorsToDeploy().isEmpty() && getOperatorsToUndeploy().isEmpty()); }
Source:
<code>private File getBackupFile(int age) { List<Long> fileTimes = new ArrayList<Long>(); File folder = new File(file.getParent() + File.separator + BACKUP_EXTENSION); File[] files = folder.listFiles(); if (files != null) { <START> int count = files.length; <END> for (int i = 0; i < count; i++) { if (files[i].isFile()) { String[] parts = files[i].getName().split(SEPARATOR); if (parts.length != 2 || !parts[1].equals(file.getName())) { continue; } long time = Long.parseLong(parts[0]); fileTimes.add(time); } } } Collections.sort(fileTimes); if (fileTimes.size() < age) { return null; } return new File(file.getParent() + File.separator + BACKUP_EXTENSION, fileTimes.get(fileTimes.size() - age) + SEPARATOR + file.getName()); }</code><technical_language>this duplicated (none trivial) code (see line 303 - 312). this refactored a helper method</technical_language>

Target:
private File getBackupFile(int age) { List<Long> fileTimes = calculateFileTimes(); if (fileTimes.size() < age) { return null; } return new File(file.getParent() + File.separator + BACKUP_EXTENSION, fileTimes.get(fileTimes.size() - age) + SEPARATOR + file.getName()); }
Source:
<code>public void stop() { traces.forEach((name, state) -> { final Deque<String> queue = state.get(); <START> final String previous = checkValue(name, queue.pollLast()); <END> @Nullable final String current = queue.peekLast(); runIf(listeners::onStop, name, previous); runIf(stackedListeners::onStop, name, previous); runIf(listeners::onStart, name, current); }); }</code><technical_language>If nullable</technical_language>

Target:
public void stop() { traces.forEach((name, state) -> { final Deque<String> queue = state.get(); @Nullable final String previous = checkValue(name, queue.pollLast()); @Nullable final String current = queue.peekLast(); runIf(listeners::onStop, name, previous); runIf(stackedListeners::onStop, name, previous); runIf(listeners::onStart, name, current); }); }
Source:
<code>public ScenarioSimulationModel() { simulation = new Simulation(); SimulationDescriptor simulationDescriptor = simulation.getSimulationDescriptor(); <START> simulationDescriptor.addFactMapping(FactIdentifier.DESCRIPTION.getName(), FactIdentifier.DESCRIPTION, ExpressionIdentifier.DESCRIPTION); <END> Scenario scenario = simulation.addScenario(); Random random = new Random(); scenario.setDescription(FactIdentifier.DESCRIPTION.getName() + random.nextInt()); IntStream.range(1, 3).forEach(id -> { ExpressionIdentifier givenExpression = ExpressionIdentifier.create(String.valueOf(random.nextLong()), FactMappingType.GIVEN); FactIdentifier givenFact = FactIdentifier.create(FactMappingType.GIVEN + "FACT-" + id, String.class.getCanonicalName()); simulationDescriptor.addFactMapping(FactMappingType.GIVEN + "-" + id, givenFact, givenExpression); scenario.addMappingValue(givenFact, givenExpression, FactMappingType.GIVEN + "-" + id + random.nextInt()); }); IntStream.range(1, 3).forEach(id -> { ExpressionIdentifier expectedExpression = ExpressionIdentifier.create(String.valueOf(random.nextLong()), FactMappingType.EXPECTED); FactIdentifier expectFact = FactIdentifier.create(FactMappingType.EXPECTED + "FACT-" + id, String.class.getCanonicalName()); simulationDescriptor.addFactMapping(FactMappingType.EXPECTED + "-" + id, expectFact, expectedExpression); scenario.addMappingValue(expectFact, expectedExpression, FactMappingType.EXPECTED + "-" + id + random.nextInt()); }); }</code><technical_language>I alias localized please add text ScenarioSimulationEditorConstants i18n. This changed <LINK_0> (maybe in another PR if requires much)</technical_language>

Target:
public ScenarioSimulationModel() { simulation = new Simulation(); SimulationDescriptor simulationDescriptor = simulation.getSimulationDescriptor(); simulationDescriptor.addFactMapping(FactIdentifier.DESCRIPTION.getName(), FactIdentifier.DESCRIPTION, ExpressionIdentifier.DESCRIPTION); Scenario scenario = simulation.addScenario(); int row = simulation.getUnmodifiableScenarios().indexOf(scenario); scenario.setDescription(FactMappingValue.getPlaceHolder(0, 0)); IntStream.range(1, 3).forEach(id -> { ExpressionIdentifier givenExpression = ExpressionIdentifier.create(row + "|" + id, FactMappingType.GIVEN); FactIdentifier givenFact = FactIdentifier.create(FactMappingType.GIVEN + "FACT-" + id, String.class.getCanonicalName()); simulationDescriptor.addFactMapping(FactMapping.getPlaceHolder(FactMappingType.GIVEN, id), givenFact, givenExpression); scenario.addMappingValue(givenFact, givenExpression, FactMappingValue.getPlaceHolder(row, id)); }); IntStream.range(1, 3).forEach(id -> { id += 2; ExpressionIdentifier expectedExpression = ExpressionIdentifier.create(row + "|" + id, FactMappingType.EXPECTED); FactIdentifier expectFact = FactIdentifier.create(FactMappingType.EXPECTED + "FACT-" + id, String.class.getCanonicalName()); simulationDescriptor.addFactMapping(FactMapping.getPlaceHolder(FactMappingType.EXPECTED, id), expectFact, expectedExpression); scenario.addMappingValue(expectFact, expectedExpression, FactMappingValue.getPlaceHolder(row, id)); }); }
Source:
<code>public boolean removeNode(N node) { checkNotNull(node, "node"); if (!nodes().contains(node)) { return false; } for (N nodeToRemove : Graphs.reachableNodes(delegate, node)) { delegate.removeNode(nodeToRemove); depths.remove(nodeToRemove); } <START> root.filter(value -> value.equals(node)).ifPresent(value -> setRoot(Optional.empty())); <END> height = Optional.empty(); return true; }</code><technical_language>This is a reminder please do revert this specific change, I agree harder read this way. :)</technical_language>

Target:
public boolean removeNode(N node) { checkNotNull(node, "node"); if (!nodes().contains(node)) { return false; } for (N nodeToRemove : Graphs.reachableNodes(delegate, node)) { delegate.removeNode(nodeToRemove); depths.remove(nodeToRemove); } if (root.isPresent() && root.get().equals(node)) { setRoot(Optional.empty()); } height = Optional.empty(); return true; }
Source:
<code>static Map<String, String> mergeKeyValueMetadata(InitContext context, Schema readerSchema) { Map<String, Set<String>> unmergedKeyValueMetadata = context.getKeyValueMetadata(); Map<String, String> mergedKeyValueMetadata = new HashMap<String, String>(); Iterator<Map.Entry<String, Set<String>>> entryIterator = unmergedKeyValueMetadata.entrySet().iterator(); while (entryIterator.hasNext()) { Map.Entry<String, Set<String>> entry = entryIterator.next(); String key = entry.getKey(); if (key.equals(AVRO_SCHEMA_METADATA_KEY)) { Set<String> writerSchemaStrings = entry.getValue(); Set<Schema> writerSchemas = new HashSet<Schema>(); for (String s : writerSchemaStrings) { Schema.Parser parser = new Schema.Parser(); Schema writerSchema = parser.parse(s); writerSchemas.add(writerSchema); } <START> if (!areSchemasCompatible(readerSchema, writerSchemas)) <END> throw new RuntimeException("could not merge metadata: key " + AVRO_SCHEMA_METADATA_KEY + " contains incompatible schemas"); mergedKeyValueMetadata.put(AVRO_SCHEMA_METADATA_KEY, readerSchema.toString()); } else if (entry.getValue().size() > 1) { throw new RuntimeException("could not merge metadata: key " + key + " has conflicting values"); } else { String value = entry.getValue().iterator().next(); mergedKeyValueMetadata.put(key, value); } } return mergedKeyValueMetadata; }</code><technical_language>Nit: please add braces for a one-line body</technical_language>

Target:
static Map<String, String> mergeKeyValueMetadata(InitContext context, Schema readerSchema) { Map<String, Set<String>> unmergedKeyValueMetadata = context.getKeyValueMetadata(); Map<String, String> mergedKeyValueMetadata = new HashMap<String, String>(); Iterator<Map.Entry<String, Set<String>>> entryIterator = unmergedKeyValueMetadata.entrySet().iterator(); while (entryIterator.hasNext()) { Map.Entry<String, Set<String>> entry = entryIterator.next(); String key = entry.getKey(); if (key.equals(AVRO_SCHEMA_METADATA_KEY)) { Set<String> writerSchemaStrings = entry.getValue(); Set<Schema> writerSchemas = new HashSet<Schema>(); for (String s : writerSchemaStrings) { Schema.Parser parser = new Schema.Parser(); Schema writerSchema = parser.parse(s); writerSchemas.add(writerSchema); } if (!areSchemasCompatible(readerSchema, writerSchemas)) { throw new RuntimeException("could not merge metadata: key " + AVRO_SCHEMA_METADATA_KEY + " contains incompatible schemas"); } mergedKeyValueMetadata.put(AVRO_SCHEMA_METADATA_KEY, readerSchema.toString()); } else if (entry.getValue().size() > 1) { throw new RuntimeException("could not merge metadata: key " + key + " has conflicting values"); } else { String value = entry.getValue().iterator().next(); mergedKeyValueMetadata.put(key, value); } } return mergedKeyValueMetadata; }
Source:
<code>private void handleNullTypeArguments( AnnotatedTypeFactory typeFactory, ExecutableElement methodElem, AnnotatedExecutableType methodType, List<AnnotatedTypeMirror> argTypes, AnnotatedTypeMirror assignedTo, Set<TypeVariable> targets, Map<TypeVariable, AnnotatedTypeMirror> inferredArgs) { if (!hasNullType(inferredArgs)) { return; } final Map<TypeVariable, AnnotatedTypeMirror> inferredArgsWithoutNull = infer(typeFactory, argTypes, assignedTo, methodElem, methodType, targets, false); for (AnnotatedTypeVariable atv : methodType.getTypeVariables()) { TypeVariable typeVar = atv.getUnderlyingType(); AnnotatedTypeMirror result = inferredArgs.get(typeVar); if (result == null) { AnnotatedTypeMirror withoutNullResult = inferredArgsWithoutNull.get(typeVar); if (withoutNullResult != null) { inferredArgs.put(typeVar, withoutNullResult); } } else if (result.getKind() == TypeKind.NULL) { AnnotatedTypeMirror withoutNullResult = inferredArgsWithoutNull.get(typeVar); if (withoutNullResult == null) { if (objectWithAnnosFromNull == null) { Elements elements = typeFactory.getProcessingEnv().getElementUtils(); TypeMirror objectTM = elements.getTypeElement("java.lang.Object").asType(); objectWithAnnosFromNull = AnnotatedTypeMirror.createType(objectTM, typeFactory, false); <START> objectWithAnnosFromNull.addAnnotations(result.getAnnotations()); <END> } withoutNullResult = objectWithAnnosFromNull; } AnnotatedTypeMirror lub = AnnotatedTypes.leastUpperBound(typeFactory, withoutNullResult, result); inferredArgs.put(typeVar, lub); } } }</code><technical_language>confused is right annotations result. loop type parameters, multiple of null, determines of objectWithAnnosFromNull. add explanation? ask type factory type of null is, instead</technical_language>

Target:
private void handleNullTypeArguments( AnnotatedTypeFactory typeFactory, ExecutableElement methodElem, AnnotatedExecutableType methodType, List<AnnotatedTypeMirror> argTypes, AnnotatedTypeMirror assignedTo, Set<TypeVariable> targets, Map<TypeVariable, AnnotatedTypeMirror> inferredArgs) { if (!hasNullType(inferredArgs)) { return; } final Map<TypeVariable, AnnotatedTypeMirror> inferredArgsWithoutNull = infer(typeFactory, argTypes, assignedTo, methodElem, methodType, targets, false); for (AnnotatedTypeVariable atv : methodType.getTypeVariables()) { TypeVariable typeVar = atv.getUnderlyingType(); AnnotatedTypeMirror result = inferredArgs.get(typeVar); if (result == null) { AnnotatedTypeMirror withoutNullResult = inferredArgsWithoutNull.get(typeVar); if (withoutNullResult != null) { inferredArgs.put(typeVar, withoutNullResult); } } else if (result.getKind() == TypeKind.NULL) { AnnotatedTypeMirror withoutNullResult = inferredArgsWithoutNull.get(typeVar); if (withoutNullResult == null) { withoutNullResult = atv.getUpperBound().deepCopy(); } AnnotatedTypeMirror lub = AnnotatedTypes.leastUpperBound(typeFactory, withoutNullResult, result); inferredArgs.put(typeVar, lub); } } }
Source:
<code>public void enableWireframe() { boolean refreshTaskList = false; EnableFaceCulling faceCullingStateChange = new EnableFaceCulling(); <START> if (getDesiredStateChanges().contains(faceCullingStateChange)) { <END> removeDesiredStateChange(faceCullingStateChange); refreshTaskList = true; } if (!getDesiredStateChanges().contains(wireframeStateChange)) { addDesiredStateChange(wireframeStateChange); refreshTaskList = true; } if (refreshTaskList) { worldRenderer.requestTaskListRefresh(); } }</code><technical_language>EnableFaceCulling is added a desired state in constructor rely fact enable wireframe there. So, need IF statement check for presence. notice in this case IF statement evaluate false, creating a new EnableFaceCulling state change time</technical_language>

Target:
public void enableWireframe() { if (!getDesiredStateChanges().contains(wireframeStateChange)) { removeDesiredStateChange(faceCullingStateChange); addDesiredStateChange(wireframeStateChange); worldRenderer.requestTaskListRefresh(); } }
Source:
<code>public final void remove(int n) throws IOException { try { queueFile.remove(n); if (listener != null) { <START> for (int i = 0; i < n; i++) <END> listener.onRemove(this); } } catch (IOException e) { throw new FileException("Failed to remove.", e, file); } }</code><technical_language>braces for body</technical_language>

Target:
public final void remove(int n) throws IOException { try { queueFile.remove(n); if (listener != null) { for (int i = 0; i < n; i++) { listener.onRemove(this); } } } catch (IOException e) { throw new FileException("Failed to remove.", e, file); } }