auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public FeedbackSubmissionEditQuestion(FeedbackQuestionAttributes questionAttributes, int qnIndx, boolean isModeratedQuestion) { courseId = questionAttributes.courseId; questionNumber = questionAttributes.questionNumber; this.qnIndx = qnIndx; questionId = questionAttributes.getId(); questionText = questionAttributes.getQuestionDetails().getQuestionText(); visibilityMessages = questionAttributes.getVisibilityMessage(); questionType = questionAttributes.questionType; numberOfEntitiesToGiveFeedbackTo = questionAttributes.numberOfEntitiesToGiveFeedbackTo; this.isModeratedQuestion = isModeratedQuestion; isRecipientNameHidden = questionAttributes.isRecipientNameHidden(); isGiverTeam = questionAttributes.giverType.equals(FeedbackParticipantType.TEAMS); isRecipientTeam = questionAttributes.recipientType.isTeam(); isRecipientOwnTeamMembers = questionAttributes.recipientType.isOwnTeamMembers(); <START> isRecipientOtherTeams = questionAttributes.recipientType.isOtherTeams(); <END> isRecipientOtherStudentsInTheCourse = questionAttributes.recipientType.isOtherStudentsInTheCourse(); }</code><technical_language>I isTeam is sufficient in this case</technical_language>

Target:
public FeedbackSubmissionEditQuestion(FeedbackQuestionAttributes questionAttributes, int qnIndx, boolean isModeratedQuestion) { courseId = questionAttributes.courseId; questionNumber = questionAttributes.questionNumber; this.qnIndx = qnIndx; questionId = questionAttributes.getId(); questionText = questionAttributes.getQuestionDetails().getQuestionText(); Text description = questionAttributes.getQuestionDescription(); questionDescription = description == null ? null : description.getValue(); visibilityMessages = questionAttributes.getVisibilityMessage(); questionType = questionAttributes.questionType; numberOfEntitiesToGiveFeedbackTo = questionAttributes.numberOfEntitiesToGiveFeedbackTo; this.isModeratedQuestion = isModeratedQuestion; isRecipientNameHidden = questionAttributes.isRecipientNameHidden(); isGiverTeam = questionAttributes.giverType.equals(FeedbackParticipantType.TEAMS); isRecipientTeam = questionAttributes.recipientType.isTeam(); setMessageToDisplayIfNoRecipientAvailable(questionAttributes); }
Source:
<code>public void setStudy(Study study) { checkNotNull(study); String redisKey = RedisKey.STUDY.getRedisKey(study.getIdentifier()); <START> setObject(redisKey, study); <END> }</code><technical_language>this set expiration</technical_language>

Target:
public void setStudy(Study study) { checkNotNull(study); String redisKey = RedisKey.STUDY.getRedisKey(study.getIdentifier()); setObject(redisKey, study, BridgeConstants.BRIDGE_SESSION_EXPIRE_IN_SECONDS); }
Source:
<code>private DateTime addInterval(DateTime from) { String interval = getInterval(); switch (interval.toLowerCase()) { case "second": return from.plusSeconds(1); case "minute": return from.plusMinutes(1); case "hour": return from.plusHours(1); case "day": return from.plusDays(1); case "week": return from.plusDays(1); case "month": return from.plusMonths(1); case "quarter": return from.plusMonths(3); case "year": return from.plusYears(1); } <START> if (interval.endsWith("y")) { <END> return from.plusYears(getNumberFromInterval(interval)); } else if (interval.endsWith("M")) { return from.plusMonths(getNumberFromInterval(interval)); } else if (interval.endsWith("d")) { return from.plusDays(getNumberFromInterval(interval)); } else if (interval.endsWith("h")) { return from.plusHours(getNumberFromInterval(interval)); } else if (interval.endsWith("m")) { return from.plusMinutes(getNumberFromInterval(interval)); } else if (interval.endsWith("s")) { return from.plusSeconds(getNumberFromInterval(interval)); } return from.plusMillis(Integer.valueOf(interval)); }</code><technical_language>pattern matching this nicer return error messages prevent NumberFormatException mistakes "days" fall switch works</technical_language>

Target:
private DateTime addInterval(DateTime from) { String interval = getInterval(); switch (interval.toLowerCase()) { case "second": return from.plusSeconds(1); case "minute": return from.plusMinutes(1); case "hour": return from.plusHours(1); case "day": return from.plusDays(1); case "week": return from.plusWeeks(1); case "month": return from.plusMonths(1); case "quarter": return from.plusMonths(3); case "year": return from.plusYears(1); } if (interval.endsWith("y")) { return from.plusYears(getNumberFromInterval(interval)); } else if (interval.endsWith("M")) { return from.plusMonths(getNumberFromInterval(interval)); } else if (interval.endsWith("d")) { return from.plusDays(getNumberFromInterval(interval)); } else if (interval.endsWith("h")) { return from.plusHours(getNumberFromInterval(interval)); } else if (interval.endsWith("m")) { return from.plusMinutes(getNumberFromInterval(interval)); } else if (interval.endsWith("s")) { return from.plusSeconds(getNumberFromInterval(interval)); } return from.plusMillis(Integer.valueOf(interval)); }
Source:
<code>public int getNumOfOptionsInRankOptions(int qnIndex) { if ("RANK_OPTIONS".equals(getQuestionType(qnIndex))) { WebElement rankOptionsTable = browser.driver.findElement(By.id("rankOptionTable-" + qnIndex)); List<WebElement> optionInputFields = rankOptionsTable .findElements( <START> By.cssSelector("input[id^='rankOption-']")); <END> return optionInputFields.size(); } String recipient = getRecipientTypeForQuestion(qnIndex); switch (recipient) { case "STUDENTS": return Integer.parseInt(browser.driver.findElement(By.id("num-students")).getAttribute("value").toString()); case "INSTRUCTORS": return Integer.parseInt(browser.driver.findElement(By.id("num-instructors")).getAttribute("value").toString()); case "TEAMS": return Integer.parseInt(browser.driver.findElement(By.id("num-teams")).getAttribute("value").toString()); case "OWN_TEAM_MEMBERS": return Integer.MAX_VALUE; case "OWN_TEAM_MEMBERS_INCLUDING_SELF": return Integer.MAX_VALUE; default: return 1; } }</code><technical_language>fault, out = next line. java List<WebElement> optionInputFields = rankOptionsTable..</technical_language>

Target:
public int getNumOfOptionsInRankOptions(int qnIndex) { if (isRankOptionsQuestion(qnIndex)) { WebElement rankOptionsTable = browser.driver.findElement(By.id("rankOptionTable-" + qnIndex)); List<WebElement> optionInputFields = rankOptionsTable.findElements(By.cssSelector("input[id^='rankOption-']")); return optionInputFields.size(); } String recipient = getRecipientTypeForQuestion(qnIndex); switch (recipient) { case "STUDENTS": case "INSTRUCTORS": case "TEAMS": return Integer.parseInt(browser.driver.findElement(By.id("num-" + recipient.toLowerCase())) .getAttribute("value").toString()); case "OWN_TEAM_MEMBERS": case "OWN_TEAM_MEMBERS_INCLUDING_SELF": return Integer.MAX_VALUE; default: return 1; } }
Source:
<code><START> public Class getKeyDecoder() { <END> return keyDecoder; }</code><technical_language>Class<?> avoid compiler noise</technical_language>

Target:
public Class<?> getKeyDecoder() { return keyDecoder; }
Source:
<code>private Set<ProjectedTimeDimension> resolveTimeDimensions() { Set<ProjectedTimeDimension> timeDims = new LinkedHashSet<>(); entityProjection.getAttributes().stream().forEach((attribute -> { <START> TimeDimensionColumn timeDim = schema.getTimeDimension(attribute.getName()); <END> if (timeDim == null) { return; } Argument timeGrainArgument = attribute.getArguments().stream() .filter(attr -> attr.getName().equals("grain")) .findAny() .orElse(null); String requestedGrainName = timeGrainArgument.getValue().toString(); TimeGrainDefinition requestedGrainDefinition; if (timeGrainArgument == null) { requestedGrainDefinition = timeDim.getSupportedGrains()[0]; } else { TimeGrain requestedGrain = TimeGrain.valueOf(requestedGrainName); requestedGrainDefinition = Arrays.stream(timeDim.getSupportedGrains()) .filter(supportedGrainDef -> supportedGrainDef.grain().equals(requestedGrain)) .findAny() .orElseThrow(() -> new InvalidOperationException( String.format("Requested grain %s, not supported on %s", requestedGrainName, attribute.getName()))); } timeDims.add(timeDim.toProjectedDimension(requestedGrainDefinition)); })); return timeDims; }</code><technical_language>this lambda a separate method? match filter expression resolveNonTimeDimensions? java timeDims = getAttributes().stream() .map(columnName -> schema.getDimension(columnName)) .filter(Objects::nonNull) .filter(column -> column instanceof TimeDimensionColumn) .map(this::resolveTimeGrain) .collect()</technical_language>

Target:
private Set<TimeDimensionProjection> resolveTimeDimensions() { Set<TimeDimensionProjection> timeDims = new LinkedHashSet<>(); entityProjection.getAttributes().stream().forEach((attribute -> { TimeDimensionColumn timeDim = schema.getTimeDimension(attribute.getName()); if (timeDim == null) { return; } Argument timeGrainArgument = attribute.getArguments().stream() .filter(attr -> attr.getName().equals("grain")) .findAny() .orElse(null); TimeGrainDefinition requestedGrainDefinition; if (timeGrainArgument == null) { requestedGrainDefinition = timeDim.getSupportedGrains().iterator().next(); } else { String requestedGrainName = timeGrainArgument.getValue().toString(); TimeGrain requestedGrain; try { requestedGrain = TimeGrain.valueOf(requestedGrainName); } catch (IllegalArgumentException e) { throw new InvalidOperationException(String.format("Invalid grain %s", requestedGrainName)); } requestedGrainDefinition = timeDim.getSupportedGrains().stream() .filter(supportedGrainDef -> supportedGrainDef.grain().equals(requestedGrain)) .findAny() .orElseThrow(() -> new InvalidOperationException( String.format("Requested grain %s, not supported on %s", requestedGrainName, attribute.getName()))); } timeDims.add(timeDim.toProjectedDimension(requestedGrainDefinition)); })); return timeDims; }
Source:
<code>public void successfulTaskTest() { this.applicationContext = SpringApplication.run( TaskConfiguration.class, new String[] { "spring.cloud.task.closecontext.enable=false", "spring.cloud.task.name=" + TASK_NAME, <START> "spring.main.web-environment=false" }); <END> String output = this.outputCapture.toString(); assertTrue("Test results do not show create task message: " + output, output.contains(CREATE_TASK_MESSAGE)); assertTrue("Test results do not show success message: " + output, output.contains(UPDATE_TASK_MESSAGE)); assertTrue("Test results have incorrect exit code: " + output, output.contains(SUCCESS_EXIT_CODE_MESSAGE)); }</code><technical_language>do longer -- syntax</technical_language>

Target:
public void successfulTaskTest() { this.applicationContext = SpringApplication.run( TaskConfiguration.class, new String[] { "--spring.cloud.task.closecontext.enable=false", "--spring.cloud.task.name=" + TASK_NAME, "--spring.main.web-environment=false" }); String output = this.outputCapture.toString(); assertTrue("Test results do not show create task message: " + output, output.contains(CREATE_TASK_MESSAGE)); assertTrue("Test results do not show success message: " + output, output.contains(UPDATE_TASK_MESSAGE)); assertTrue("Test results have incorrect exit code: " + output, output.contains(SUCCESS_EXIT_CODE_MESSAGE)); }
Source:
<code>private TopologyContext mkTopologyContext(StormTopology topology) throws IOException { Map<String, Object> conf = workerData.getConf(); TopologyContext topologyContext = new TopologyContext( topology, workerData.getTopologyConf(), workerData.getTaskToComponent(), workerData.getComponentToSortedTasks(), workerData.getComponentToStreamToFields(), workerData.getBlobToLastKnownVersion(), workerData.getTopologyId(), ConfigUtils.supervisorStormResourcesPath( ConfigUtils.supervisorStormDistRoot(conf, workerData.getTopologyId())), ConfigUtils.workerPidsRoot(conf, workerData.getWorkerId()), taskId, workerData.getPort(), workerData.getLocalTaskIds(), workerData.getDefaultSharedResources(), workerData.getUserSharedResources(), executor.getSharedExecutorData(), executor.getIntervalToTaskToMetricToRegistry(), executor.getOpenOrPrepareWasCalled(), workerData.getMetricRegistry()); <START> executor.setMetricRegistry(workerData.getMetricRegistry()); <END> return topologyContext; }</code><technical_language>put this line of code this function? related</technical_language>

Target:
private TopologyContext mkTopologyContext(StormTopology topology) throws IOException { Map<String, Object> conf = workerData.getConf(); return new TopologyContext( topology, workerData.getTopologyConf(), workerData.getTaskToComponent(), workerData.getComponentToSortedTasks(), workerData.getComponentToStreamToFields(), workerData.getBlobToLastKnownVersion(), workerData.getTopologyId(), ConfigUtils.supervisorStormResourcesPath( ConfigUtils.supervisorStormDistRoot(conf, workerData.getTopologyId())), ConfigUtils.workerPidsRoot(conf, workerData.getWorkerId()), taskId, workerData.getPort(), workerData.getLocalTaskIds(), workerData.getDefaultSharedResources(), workerData.getUserSharedResources(), executor.getSharedExecutorData(), executor.getIntervalToTaskToMetricToRegistry(), executor.getOpenOrPrepareWasCalled(), workerData.getMetricRegistry()); }
Source:
<code>public void writeLocalDB(final Path localDBFile, final LocalDB localDB) throws Exception { if (localDB == null || localDBFile == null || localDBFile.toFile().isDirectory()) throw new Exception("Invalid Arguments: localDbFile: " + localDBFile + ", localDB: " + localDB); if (!localDBFile.getParent().toFile().exists()) localDBFile.getParent().toFile().mkdirs(); <START> try (FileWriter writer = new FileWriter(localDBFile.toFile())) { <END> writer.write(localDB.toString()); } }</code><technical_language>I worthwhile this update atomic, especially this file updated frequently</technical_language>

Target:
public void writeLocalDB(final Path localDBFile, final LocalDB localDB) throws Exception { if (localDB == null || localDBFile == null || localDBFile.toFile().isDirectory()) throw new Exception("Invalid Arguments: localDbFile: " + localDBFile + ", localDB: " + localDB); if (!localDBFile.getParent().toFile().exists()) localDBFile.getParent().toFile().mkdirs(); File tmpFile = File.createTempFile(localDBFile.toFile().getName(), ".tmp", localDBFile.getParent().toFile()); try (FileWriter writer = new FileWriter(tmpFile)) { writer.write(localDB.toString()); if (!tmpFile.renameTo(localDBFile.toFile())) logger.error("Failed to persist local db: {}", localDB); } finally { if (tmpFile != null) Files.deleteIfExists(tmpFile.toPath()); } }
Source:
<code>RevCommit next() throws MissingObjectException, IncorrectObjectTypeException, IOException { for (;;) { <START> final RevCommit c = pending.next(); <END> if (c == null) return null; c.parseHeaders(walk); DepthWalk.Commit dc = (DepthWalk.Commit)c; int newDepth = dc.getDepth() + 1; for (final RevCommit p : c.parents) { DepthWalk.Commit dp = (DepthWalk.Commit)p; if (dp.getDepth() > newDepth) { dp.setDepth(newDepth); if (newDepth <= depth) pending.add(p); } } boolean produce = true; switch (compareMode) { case EQUAL: produce = (dc.getDepth() == depth); break; case LESS_THAN_EQUAL: produce = (dc.getDepth() <= depth); break; } if (produce) return c; else continue; } }</code><technical_language>I downcast right away: final DepthWalk.Commit c = (DepthWalk.Commit)pending.next();</technical_language>

Target:
RevCommit next() throws MissingObjectException, IncorrectObjectTypeException, IOException { for (;;) { final DepthWalk.Commit c = (DepthWalk.Commit)pending.next(); if (c == null) return null; if ((c.flags & RevWalk.PARSED) == 0) c.parseHeaders(walk); int newDepth = c.depth + 1; for (final RevCommit p : c.parents) { DepthWalk.Commit dp = (DepthWalk.Commit)p; if (dp.depth == -1) { dp.depth = newDepth; if (newDepth <= depth) pending.add(p); } if(c.has(UNSHALLOW) || c.has(REINTERESTING)) p.add(REINTERESTING); } boolean produce = c.depth <= depth; if (c.has(REINTERESTING)) c.flags &= ~RevWalk.UNINTERESTING; if ((c.flags & RevWalk.UNINTERESTING) != 0 && !c.has(UNSHALLOW)) produce = false; if (produce) return c; } }
Source:
<code>public void cleanup() { <START> if (printMatrices) { <END> for (final Map.Entry<Integer, Vector> entry : lMatrix.entrySet()) { System.out.printf("L(%d, *):", entry.getKey()); for (final VectorEntry valueEntry : entry.getValue()) { System.out.print(" " + valueEntry.value()); } System.out.println(); } pullRMatrix(); for (final Map.Entry<Integer, Vector> entry : rMatrix.entrySet()) { System.out.printf("R(*, %d):", entry.getKey()); for (final VectorEntry valueEntry : entry.getValue()) { System.out.print(" " + valueEntry.value()); } System.out.println(); } } }</code><technical_language>if (!printMatrices) return;</technical_language>

Target:
public void cleanup() { if (!printMatrices) { return; } final StringBuilder lsb = new StringBuilder(); for (final Map.Entry<Integer, Vector> entry : lMatrix.entrySet()) { lsb.append(String.format("L(%d, *):", entry.getKey())); for (final VectorEntry valueEntry : entry.getValue()) { lsb.append(' '); lsb.append(valueEntry.value()); } lsb.append('\n'); } LOG.log(Level.INFO, lsb.toString()); pullRMatrix(); final StringBuilder rsb = new StringBuilder(); for (final Map.Entry<Integer, Vector> entry : rMatrix.entrySet()) { rsb.append(String.format("R(*, %d):", entry.getKey())); for (final VectorEntry valueEntry : entry.getValue()) { rsb.append(' '); rsb.append(valueEntry.value()); } rsb.append('\n'); } LOG.log(Level.INFO, rsb.toString()); }
Source:
<code>public boolean await(String bulkId, long timeout, TimeUnit unit) throws InterruptedException { long deadline = System.currentTimeMillis() + unit.toMillis(timeout); KeyValueStore kvStore = getKvStore(); do { if (COMPLETED.toString().equals(kvStore.getString(bulkId + STATE))) { return true; } <START> Thread.sleep(1000); <END> } while (deadline > System.currentTimeMillis()); return false; }</code><technical_language>a smaller sleep more reactive</technical_language>

Target:
public boolean await(String bulkId, long timeout, TimeUnit unit) throws InterruptedException { long deadline = System.currentTimeMillis() + unit.toMillis(timeout); KeyValueStore kvStore = getKvStore(); do { if (COMPLETED.toString().equals(kvStore.getString(bulkId + STATE))) { return true; } Thread.sleep(200); } while (deadline > System.currentTimeMillis()); return false; }
Source:
<code><START> protected void fillMacAddressIfMissing(VmNic iface) { <END> if (StringUtils.isEmpty(iface.getMacAddress()) && getMacPool().getAvailableMacsCount() > 0) { iface.setMacAddress(getMacPool().allocateNewMac()); } }</code><technical_language>is shared? be? if not, need private</technical_language>

Target:
private void fillMacAddressIfMissing(VmNic iface) { if (StringUtils.isEmpty(iface.getMacAddress()) && getMacPool().getAvailableMacsCount() > 0) { iface.setMacAddress(getMacPool().allocateNewMac()); } }
Source:
<code><START> protected HashMap<Guid, <END> DiskImage> getDestinationTemplateDiskMap(VM vm, Guid storageDomainId, boolean isTemplateGeneralStorageDomainSet) { HashMap<Guid, DiskImage> destinationTemplateDiskMap = null; if (vm.isSetDisks() && vm.getDisks().isSetDisks()) { destinationTemplateDiskMap = new HashMap<Guid, DiskImage>(); Map<Guid, org.ovirt.engine.core.common.businessentities.Disk> vmSourceDisks = queryVMDiskList(vm); for (Disk disk : vm.getDisks().getDisks()) { if (!disk.isSetId()) { continue; } Guid currDiskID = asGuid(disk.getId()); org.ovirt.engine.core.common.businessentities.Disk sourceDisk = vmSourceDisks.get(currDiskID); if (sourceDisk == null || !isDiskImage(sourceDisk)) { continue; } DiskImage destinationDisk = (DiskImage) DiskMapper.map(disk, sourceDisk); if (isTemplateGeneralStorageDomainSet) { destinationDisk.setStorageIds(new ArrayList<>(Arrays.asList(storageDomainId))); } destinationTemplateDiskMap.put(destinationDisk.getId(), destinationDisk); } } return destinationTemplateDiskMap; }</code><technical_language>Please formatter</technical_language>

Target:
protected HashMap<Guid, DiskImage> getDestinationTemplateDiskMap(VM vm, Guid storageDomainId, boolean isTemplateGeneralStorageDomainSet) { HashMap<Guid, DiskImage> destinationTemplateDiskMap = null; if (vm.isSetDisks() && vm.getDisks().isSetDisks()) { destinationTemplateDiskMap = new HashMap<Guid, DiskImage>(); Map<Guid, org.ovirt.engine.core.common.businessentities.Disk> vmSourceDisks = queryVmDisksMap(vm); for (Disk disk : vm.getDisks().getDisks()) { if (!disk.isSetId()) { continue; } Guid currDiskID = asGuid(disk.getId()); org.ovirt.engine.core.common.businessentities.Disk sourceDisk = vmSourceDisks.get(currDiskID); if (sourceDisk == null || !isDiskImage(sourceDisk)) { continue; } DiskImage destinationDisk = (DiskImage) DiskMapper.map(disk, sourceDisk); if (isTemplateGeneralStorageDomainSet) { destinationDisk.setStorageIds(new ArrayList<>(Arrays.asList(storageDomainId))); } if (!disk.isSetDiskProfile()) { destinationDisk.setDiskProfileId(null); } if (!disk.isSetQuota()) { destinationDisk.setQuotaId(null); } destinationTemplateDiskMap.put(destinationDisk.getId(), destinationDisk); } } return destinationTemplateDiskMap; }
Source:
<code>public void test_attach_to_activated_cluster_requiring_restart() throws Exception { String destination = "localhost:" + getNodePort(); startNode(1, 1); activateCluster(); assertThat(configToolInvocation("set", "-s", destination, "-c", "stripe.1.node.1.tc-properties.foo=bar"), containsOutput("IMPORTANT: A restart of the cluster is required to apply the changes")); startNode(1, 2); assertThat( configToolInvocation("attach", "-d", destination, "-s", "localhost:" + getNodePort(1, 2)), containsOutput("Impossible to do any topology change. Cluster at address: " + destination + " is waiting to be restarted to apply some pending changes. " + "You can run the command with -f option to force the comment but at the risk of breaking this cluster configuration consistency. " + <START> "The newly added node will be restarted, but not the existing ones.")); <END> assertThat(configToolInvocation("attach", "-f", "-d", destination, "-s", "localhost:" + getNodePort(1, 2)), is(successful())); waitUntil(out.getLog(1, 2), containsLog("Moved to State[ PASSIVE-STANDBY ]")); assertThat(getUpcomingCluster("localhost", getNodePort(1, 1)).getNodeCount(), is(equalTo(2))); assertThat(getRuntimeCluster("localhost", getNodePort(1, 1)).getNodeCount(), is(equalTo(2))); assertThat(getUpcomingCluster("localhost", getNodePort(1, 2)).getNodeCount(), is(equalTo(2))); assertThat(getRuntimeCluster("localhost", getNodePort(1, 2)).getNodeCount(), is(equalTo(2))); }</code><technical_language>remove code ;-) force ;-)</technical_language>

Target:
public void test_attach_to_activated_cluster_requiring_restart() throws Exception { String destination = "localhost:" + getNodePort(); startNode(1, 1); activateCluster(); assertThat(configToolInvocation("set", "-s", destination, "-c", "stripe.1.node.1.tc-properties.foo=bar"), containsOutput("IMPORTANT: A restart of the cluster is required to apply the changes")); startNode(1, 2); assertThat(configToolInvocation("attach", "-f", "-d", destination, "-s", "localhost:" + getNodePort(1, 2)), is(successful())); waitUntil(out.getLog(1, 2), containsLog("Moved to State[ PASSIVE-STANDBY ]")); assertThat(getUpcomingCluster("localhost", getNodePort(1, 1)).getNodeCount(), is(equalTo(2))); assertThat(getRuntimeCluster("localhost", getNodePort(1, 1)).getNodeCount(), is(equalTo(2))); assertThat(getUpcomingCluster("localhost", getNodePort(1, 2)).getNodeCount(), is(equalTo(2))); assertThat(getRuntimeCluster("localhost", getNodePort(1, 2)).getNodeCount(), is(equalTo(2))); withTopologyService(1, 1, topologyService -> assertTrue(topologyService.isActivated())); withTopologyService(1, 2, topologyService -> assertTrue(topologyService.isActivated())); }
Source:
<code>public void authenticationManagerSupportMultipleLdapContextWithDefaultRolePrefix() { loadConfig(MultiLdapAuthenticationProvidersConfig.class); Authentication authenticate = getAuthenticationManager().authenticate(new UsernamePasswordAuthenticationToken("bob", "bobspassword")); <START> assertThat(getAuthorities(authenticate)).contains(new SimpleGrantedAuthority("ROLE_DEVELOPERS")); <END> }</code><technical_language>move accessing authorities reflection instead mockMvc. For example of do this commit 70db508</technical_language>

Target:
public void authenticationManagerSupportMultipleLdapContextWithDefaultRolePrefix() throws Exception { this.spring.register(MultiLdapAuthenticationProvidersConfig.class).autowire(); this.mockMvc.perform(formLogin().user("bob").password("bobspassword")) .andExpect(authenticated().withUsername("bob").withAuthorities(singleton(new SimpleGrantedAuthority("ROLE_DEVELOPERS")))); }
Source:
<code><START> public long getCumulativeCpuTime() { <END> if (jiffyLengthMs < 0) { return UNAVAILABLE; } readTotalProcessJiffies(); return processTotalJiffies.longValue() * jiffyLengthMs; }</code><technical_language>cpuacct.usage</technical_language>

Target:
public long getCumulativeCpuTime() { if (jiffyLengthMs < 0) { return UNAVAILABLE; } try { return readTotalProcessJiffies().longValue() * jiffyLengthMs; } catch (YarnException e) { return UNAVAILABLE; } }
Source:
<code>private void testGetNotModifiedBlob(SecurityServiceCallback callback, BlobInfo blobInfo) throws Exception { callback.reset(); MockRestResponseChannel restResponseChannel = new MockRestResponseChannel(); JSONObject headers = new JSONObject(); <START> SimpleDateFormat dateFormat = new SimpleDateFormat(RestUtils.HTTP_DATE_FORMAT, Locale.US); <END> Date date = new Date(System.currentTimeMillis()); String dateStr = dateFormat.format(date); headers.put(RestUtils.Headers.IF_MODIFIED_SINCE, dateStr); RestRequest restRequest = createRestRequest(RestMethod.GET, "/abc", headers); securityService.processResponse(restRequest, restResponseChannel, blobInfo, callback).get(); Assert.assertTrue("Call back should have been invoked", callback.callbackInvoked.get()); Assert.assertNull("Exception should not have been thrown", callback.exception); Assert.assertEquals("No body is expected in the response", 0, restResponseChannel.getResponseBody().length); verifyHeadersForGetBlobNotModified(restResponseChannel); }</code><technical_language>Locale.English. Timezone GMT</technical_language>

Target:
private void testGetNotModifiedBlob(SecurityServiceCallback callback, BlobInfo blobInfo) throws Exception { callback.reset(); MockRestResponseChannel restResponseChannel = new MockRestResponseChannel(); JSONObject headers = new JSONObject(); SimpleDateFormat dateFormat = new SimpleDateFormat(RestUtils.HTTP_DATE_FORMAT, Locale.ENGLISH); dateFormat.setTimeZone(TimeZone.getTimeZone("GMT")); Date date = new Date(System.currentTimeMillis()); String dateStr = dateFormat.format(date); headers.put(RestUtils.Headers.IF_MODIFIED_SINCE, dateStr); RestRequest restRequest = createRestRequest(RestMethod.GET, "/abc", headers); securityService.processResponse(restRequest, restResponseChannel, blobInfo, callback).get(); Assert.assertTrue("Call back should have been invoked", callback.callbackInvoked.get()); Assert.assertNull("Exception should not have been thrown", callback.exception); Assert.assertEquals("No body is expected in the response", 0, restResponseChannel.getResponseBody().length); verifyHeadersForGetBlobNotModified(restResponseChannel); }
Source:
<code>private AuthenticationResult acquireTokenSilentFlow(final AuthenticationRequest authenticationRequest) throws AuthenticationException { final boolean requestEligibleForBroker = mBrokerProxy.verifyBrokerForSilentRequest(authenticationRequest); if ((authenticationRequest.getForceRefresh() || authenticationRequest.isClaimsChallengePresent()) && requestEligibleForBroker) { return tryAcquireTokenSilentWithBroker(authenticationRequest); } final AuthenticationResult authResult = tryAcquireTokenSilentLocally(authenticationRequest); if (isAccessTokenReturned(authResult)) { return authResult; } if (authenticationRequest.getSamlAssertion() != null) { final AuthenticationResult authResultFromSaml = tryAcquireTokenSilentWithAssertion(authenticationRequest); if (isAccessTokenReturned(authResultFromSaml)) { return authResultFromSaml; } <START> } <END> if (requestEligibleForBroker) { return tryAcquireTokenSilentWithBroker(authenticationRequest); } else { return authResult; } }</code><technical_language>This behavior fall-thru try broker 100% clear me... want confirm.... If caller supplied a SAML assertion in request, access token returned falling-thru in hopes broker RT/FRT/PRT for this user already? confirm decision proceed attempt request in broker is intentional</technical_language>

Target:
private AuthenticationResult acquireTokenSilentFlow(final AuthenticationRequest authenticationRequest) throws AuthenticationException { final boolean requestEligibleForBroker = mBrokerProxy.verifyBrokerForSilentRequest(authenticationRequest); final String methodName = ":acquireTokenSilentFlow"; if ((authenticationRequest.getForceRefresh() || authenticationRequest.isClaimsChallengePresent()) && requestEligibleForBroker) { return tryAcquireTokenSilentWithBroker(authenticationRequest); } final AuthenticationResult authResult = tryAcquireTokenSilentLocally(authenticationRequest); if (isAccessTokenReturned(authResult)) { return authResult; } if (authenticationRequest.getSamlAssertion() != null && authenticationRequest.getAssertionType() != null) { final AuthenticationResult authResultFromSaml = tryAcquireTokenSilentWithAssertion(authenticationRequest); if (isAccessTokenReturned(authResultFromSaml)) { Logger.v(TAG + methodName, "Access token has been acquired using the saml assertion."); return authResultFromSaml; } else { Logger.w(TAG + methodName, "Failed to acquire tokens using saml assertion."); } } if (requestEligibleForBroker) { return tryAcquireTokenSilentWithBroker(authenticationRequest); } else { return authResult; } }
Source:
<code>private int getMaxLag() { return prefStore.get(MAX_LAG_KEY) == null ? MAX_LAG_DEFAULT : <START> Integer.parseInt((String) prefStore.get(MAX_LAG_KEY)); <END> }</code><technical_language>if parseInt fails? fall default</technical_language>

Target:
private int getMaxLag() { try { return Integer.parseInt((String) prefStore.get(MAX_LAG_KEY)); } catch (NumberFormatException e) { return MAX_LAG_DEFAULT; } }
Source:
<code>public static void before() throws Exception { String serverDir = System.getProperty("server1.dist"); <START> JavaArchive deployedCacheStore = ShrinkWrap.create(JavaArchive.class); <END> deployedCacheStore.addPackage(MyCustomCacheStore.class.getPackage()); deployedCacheStore.addAsManifestResource(new Asset() { @Override public InputStream openStream() { String serviceImplementation = MyCustomCacheStore.class.getName(); return new ByteArrayInputStream(serviceImplementation.getBytes(StandardCharsets.UTF_8)); } }, "services/" + ExternalStore.class.getName()); deployedCacheStore.as(ZipExporter.class).exportTo( new File(serverDir, "/standalone/deployments/custom-store.jar"), true); }</code><technical_language>Thank you, ShrinkWrap ftw</technical_language>

Target:
public static void before() throws Exception { String serverDir = System.getProperty("server1.dist"); JavaArchive deployedCacheStore = ShrinkWrap.create(JavaArchive.class); deployedCacheStore.addPackage(MyCustomCacheStore.class.getPackage()); deployedCacheStore.addAsServiceProvider(ExternalStore.class, MyCustomCacheStore.class); deployedCacheStore.as(ZipExporter.class).exportTo( new File(serverDir, "/standalone/deployments/custom-store.jar"), true); }
Source:
<code><START> public String toString() { <END> return "CommunicationSummaryStatistics [id=" + id + ", minimumDuration=" + minimumDuration + ", averageDuration=" + averageDuration + ", maximumDuration=" + maximumDuration + ", count=" + count + ", severity=" + severity + ", uri=" + uri + ", operation=" + operation + ", outbound=" + outbound + "]"; }</code><technical_language>Minor - add service name toString,hashCode equals</technical_language>

Target:
public String toString() { return "CommunicationSummaryStatistics [id=" + id + ", minimumDuration=" + minimumDuration + ", averageDuration=" + averageDuration + ", maximumDuration=" + maximumDuration + ", count=" + count + ", severity=" + severity + ", uri=" + uri + ", operation=" + operation + " , serviceName=" + serviceName + ", outbound=" + outbound + "]"; }
Source:
<code>boolean isPut() { <START> return !(isTTLUpdate() || isDelete() || isUndelete()); <END> }</code><technical_language>this simplified flags == FLAGS_DEFAULT_VALUE</technical_language>

Target:
boolean isPut() { return flags == FLAGS_DEFAULT_VALUE; }
Source:
<code>public void init() throws DBException { Properties props = getProperties(); String servers = props.getProperty("voltdb.servers", "localhost"); String user = props.getProperty("voltdb.user", ""); String password = props.getProperty("voltdb.password", ""); String strLimit = props.getProperty("voltdb.ratelimit"); String useScanAllParam = props.getProperty("voltdb.scanall", "no"); if (useScanAllParam.equalsIgnoreCase("YES")) { useScanAll = true; } int ratelimit = strLimit != null ? Integer.parseInt(strLimit) : Integer.MAX_VALUE; try { mclient = ConnectionHelper.createConnection(Thread.currentThread().getId(), servers, user, password, ratelimit); createYCSBDBIfNeeded(); } catch (Exception e) { <START> e.printStackTrace(); <END> throw new DBException(e.getMessage()); } mworkingData = new byte[1024 * 1024]; mwriteBuf = ByteBuffer.wrap(mworkingData); }</code><technical_language>Please log a logging framework instead of printStackTrace</technical_language>

Target:
public void init() throws DBException { Properties props = getProperties(); String servers = props.getProperty("voltdb.servers", "localhost"); String user = props.getProperty("voltdb.user", ""); String password = props.getProperty("voltdb.password", ""); String strLimit = props.getProperty("voltdb.ratelimit"); String useScanAllParam = props.getProperty("voltdb.scanall", "no"); if (useScanAllParam.equalsIgnoreCase("YES")) { useScanAll = true; } int ratelimit = strLimit != null ? Integer.parseInt(strLimit) : Integer.MAX_VALUE; try { mclient = ConnectionHelper.createConnection(servers, user, password, ratelimit); ysb = StaticHolder.INSTANCE; ysb.loadClassesAndDDLIfNeeded(mclient); } catch (Exception e) { logger.error("Error while creating connection: ", e); throw new DBException(e.getMessage()); } mworkingData = new byte[1024 * 1024]; mwriteBuf = ByteBuffer.wrap(mworkingData); }
Source:
<code>public HashMap<Integer, BaseSensorValues> getApartmentSensorValues(String sessionToken) { try { String response = transport.execute(SimpleRequestBuilder.buildNewRequest(InterfaceKeys.JSON) .addRequestClass(ClassKeys.APARTMENT).addFunction(FunctionKeys.GET_SENSOR_VALUES) .addParameter(ParameterKeys.TOKEN, sessionToken).buildRequestString()); JsonObject responseObj = JSONResponseHandler.toJsonObject(response); if (JSONResponseHandler.checkResponse(responseObj)) { JsonObject obj = JSONResponseHandler.getResultJsonObject(responseObj); if (obj.get(JSONApiResponseKeysEnum.ZONES.getKey()).isJsonArray()) { JsonArray jArray = obj.get(JSONApiResponseKeysEnum.ZONES.getKey()).getAsJsonArray(); WeatherSensorData weather = new WeatherSensorData(obj); if (jArray.size() != 0) { HashMap<Integer, BaseSensorValues> map = new HashMap<Integer, BaseSensorValues>( jArray.size() + 1); Iterator<JsonElement> iter = jArray.iterator(); while (iter.hasNext()) { SensorValues sensorValues = new SensorValues(iter.next().getAsJsonObject()); if (sensorValues != null) { map.put(sensorValues.getZoneID(), sensorValues); } } <START> map.put(0, weather); <END> return map; } } } } catch (Exception e) { logger.debug("An exception occurred", e); } return null; }</code><technical_language>0</technical_language>

Target:
public HashMap<Integer, BaseSensorValues> getApartmentSensorValues(String sessionToken) { String response = transport.execute(SimpleRequestBuilder.buildNewJsonRequest(ClassKeys.APARTMENT) .addFunction(FunctionKeys.GET_SENSOR_VALUES).addParameter(ParameterKeys.TOKEN, sessionToken) .buildRequestString()); JsonObject responseObj = JSONResponseHandler.toJsonObject(response); if (JSONResponseHandler.checkResponse(responseObj)) { JsonObject obj = JSONResponseHandler.getResultJsonObject(responseObj); if (obj.get(JSONApiResponseKeysEnum.ZONES.getKey()).isJsonArray()) { JsonArray jArray = obj.get(JSONApiResponseKeysEnum.ZONES.getKey()).getAsJsonArray(); WeatherSensorData weather = new WeatherSensorData(obj); if (jArray.size() != 0) { HashMap<Integer, BaseSensorValues> map = new HashMap<Integer, BaseSensorValues>(jArray.size() + 1); Iterator<JsonElement> iter = jArray.iterator(); while (iter.hasNext()) { SensorValues sensorValues = new SensorValues(iter.next().getAsJsonObject()); if (sensorValues != null) { map.put(sensorValues.getZoneID(), sensorValues); } } map.put(GeneralLibConstance.BROADCAST_ZONE_GROUP_ID, weather); return map; } } } return null; }
Source:
<code><START> protected static void deleteTenantRegistryData(int tenantId, Connection conn) throws SQLException { <END> try { conn.setAutoCommit(false); executeDeleteQuery(conn, DELETE_CLUSTER_LOCK, tenantId); executeDeleteQuery(conn, DELETE_LOG, tenantId); executeDeleteQuery(conn, DELETE_ASSOCIATION, tenantId); executeDeleteQuery(conn, DELETE_SNAPSHOT, tenantId); executeDeleteQuery(conn, DELETE_RESOURCE_COMMENT, tenantId); executeDeleteQuery(conn, DELETE_COMMENT, tenantId); executeDeleteQuery(conn, DELETE_RESOURCE_RATING, tenantId); executeDeleteQuery(conn, DELETE_RATING, tenantId); executeDeleteQuery(conn, DELETE_RESOURCE_TAG, tenantId); executeDeleteQuery(conn, DELETE_TAG, tenantId); executeDeleteQuery(conn, DELETE_RESOURCE_PROPERTY, tenantId); executeDeleteQuery(conn, DELETE_PROPERTY, tenantId); executeDeleteQuery(conn, DELETE_RESOURCE_HISTORY, tenantId); executeDeleteQuery(conn, DELETE_CONTENT_HISTORY, tenantId); executeDeleteQuery(conn, DELETE_RESOURCE, tenantId); executeDeleteQuery(conn, DELETE_CONTENT, tenantId); executeDeleteQuery(conn, DELETE_PATH, tenantId); executeDeleteQueryWithLikeOperator(conn, DELETE_ADMIN_REGISTRY_RESORUCE, tenantId); executeDeleteQueryWithLikeOperator(conn, DELETE_ADMIN_REGISTRY_PATH, tenantId); conn.commit(); } catch (SQLException e) { conn.rollback(); String errorMsg = "An error occurred while deleting registry data for tenant: " + tenantId; throw new SQLException(errorMsg, e); } finally { conn.close(); } }</code><technical_language>public method protected. If custom components this method, break</technical_language>

Target:
public static void deleteTenantRegistryData(int tenantId, Connection conn) throws SQLException { try { conn.setAutoCommit(false); executeDeleteQuery(conn, DELETE_CLUSTER_LOCK, tenantId); executeDeleteQuery(conn, DELETE_LOG, tenantId); executeDeleteQuery(conn, DELETE_ASSOCIATION, tenantId); executeDeleteQuery(conn, DELETE_SNAPSHOT, tenantId); executeDeleteQuery(conn, DELETE_RESOURCE_COMMENT, tenantId); executeDeleteQuery(conn, DELETE_COMMENT, tenantId); executeDeleteQuery(conn, DELETE_RESOURCE_RATING, tenantId); executeDeleteQuery(conn, DELETE_RATING, tenantId); executeDeleteQuery(conn, DELETE_RESOURCE_TAG, tenantId); executeDeleteQuery(conn, DELETE_TAG, tenantId); executeDeleteQuery(conn, DELETE_RESOURCE_PROPERTY, tenantId); executeDeleteQuery(conn, DELETE_PROPERTY, tenantId); executeDeleteQuery(conn, DELETE_RESOURCE_HISTORY, tenantId); executeDeleteQuery(conn, DELETE_CONTENT_HISTORY, tenantId); executeDeleteQuery(conn, DELETE_RESOURCE, tenantId); executeDeleteQuery(conn, DELETE_CONTENT, tenantId); executeDeleteQuery(conn, DELETE_PATH, tenantId); executeDeleteQueryWithLikeOperator(conn, DELETE_ADMIN_REGISTRY_RESORUCE, tenantId); executeDeleteQueryWithLikeOperator(conn, DELETE_ADMIN_REGISTRY_PATH, tenantId); conn.commit(); if (log.isDebugEnabled()) { log.debug("Registry table entries deleted for tenant :" + tenantId); } } catch (SQLException e) { conn.rollback(); String errorMsg = "An error occurred while deleting registry data for tenant: " + tenantId; throw new SQLException(errorMsg, e); } finally { conn.close(); } }
Source:
<code>private void checkActuallyModifiedFixed(String id) { if (!ConfServer.localPollingEnabled || !MassiveCoreMConf.get().warnOnLocalAlter) return; E entity = this.getFixed(id); boolean modified = this.examineHasLocalAlterFixed(id, entity); if (modified) return; List<String> messages = new MassiveList<>(); messages.add(Txt.parse("<pink>%s", this.getDebugName())); messages.add(Txt.parse("<aqua>%s", entity.getId())); String change = Txt.implode(messages, Txt.parse("<silver> | ")); String message = Txt.parse("<b>[No Modification] %s", change); this.getPlugin().log(message); <START> this.getPlugin().log(MUtil.getStackTraceString(entity.getStackTraceChanged(), true);); <END> }</code><technical_language>more semicolon required this row</technical_language>

Target:
private void checkActuallyModifiedFixed(String id) { if (!MStore.isLocalPollingDebugEnabled()) return; E entity = this.getFixed(id); boolean modified = this.examineHasLocalAlterFixed(id, entity); if (modified) return; List<String> messages = new MassiveList<>(); messages.add(Txt.parse("<pink>%s", this.getDebugName())); messages.add(Txt.parse("<aqua>%s", entity.getId())); String change = Txt.implode(messages, Txt.parse("<silver> | ")); String message = Txt.parse("<b>[No Modification] %s", change); this.getPlugin().log(message); if (entity.getLastStackTraceChanged() != null) this.getPlugin().log(MUtil.getStackTraceString(entity.getLastStackTraceChanged(), true)); }
Source:
<code>public static @NonNull List<IDataProviderDescriptor> getXmlDataProviderDescriptors(@NonNull ITmfTrace trace, EnumSet<OutputType> types) { List<IDataProviderDescriptor> descriptors = new ArrayList<>(); Map<String, IAnalysisModuleHelper> modules = TmfAnalysisManager.getAnalysisModules(trace.getClass()); for (OutputType viewType : types) { for (XmlOutputElement element : Iterables.filter(XmlUtils.getXmlOutputElements().values(), element -> element.getXmlElem().equals(viewType.getXmlElem()))) { DataProviderDescriptor.Builder builder = new DataProviderDescriptor.Builder(); <START> builder.setId(element.getId()).setName(element.getLabel()).setDescription(element.getLabel()); <END> if (viewType == OutputType.XY) { builder.setProviderType(ProviderType.TREE_TIME_XY); } else if (viewType == OutputType.TIME_GRAPH) { builder.setProviderType(ProviderType.TIME_GRAPH); } boolean applies = false; for (String id : element.getAnalyses()) { for (IAnalysisModuleHelper helper : modules.values()) { if (helper.getId().equals(id)) { applies = true; break; } } } if (applies) { descriptors.add(builder.build()); } } } return descriptors; }</code><technical_language>String label = element.getLabel(); builder.setId(Objects.requireNonNull(element.getId())).setName(label).setDescription(label);</technical_language>

Target:
private static @NonNull List<IDataProviderDescriptor> getXmlDataProviderDescriptors(@NonNull ITmfTrace trace, EnumSet<OutputType> types) { List<IDataProviderDescriptor> descriptors = new ArrayList<>(); Map<String, IAnalysisModuleHelper> modules = TmfAnalysisManager.getAnalysisModules(trace.getClass()); for (OutputType viewType : types) { for (XmlOutputElement element : Iterables.filter(XmlUtils.getXmlOutputElements().values(), element -> element.getXmlElem().equals(viewType.getXmlElem()))) { DataProviderDescriptor.Builder builder = new DataProviderDescriptor.Builder(); String label = String.valueOf(element.getLabel()); String elemId = element.getId(); if (elemId == null) { continue; } builder.setId(elemId).setName(label).setDescription(label); if (viewType == OutputType.XY) { builder.setProviderType(ProviderType.TREE_TIME_XY); } else if (viewType == OutputType.TIME_GRAPH) { builder.setProviderType(ProviderType.TIME_GRAPH); } for (String id : element.getAnalyses()) { if (modules.containsKey(id)) { descriptors.add(builder.build()); break; } } } } return descriptors; }
Source:
<code>public void handleIncomingProjectNegotiation( final AbstractIncomingProjectNegotiation negotiation) { Map<String, IProject> projectMapping = new HashMap<>(); for (ProjectNegotiationData data : negotiation.getProjectNegotiationData()) { String projectName = data.getProjectName(); IProject project = workspace.getProject(projectName); if (!project.exists()) { try { project.adaptTo(ServerProjectImpl.class).create(); } catch (IOException e) { projectMapping.clear(); negotiation.localCancel( "Error creating project folder", NegotiationTools.CancelOption.NOTIFY_PEER); <START> break; <END> } } projectMapping.put(data.getProjectID(), project); } projectExecutor.execute( new Runnable() { @Override public void run() { ProjectNegotiation.Status status; if (ServerConfig.isInteractive()) { status = negotiation.run(projectMapping, new ConsoleProgressIndicator(System.out)); } else { status = negotiation.run(projectMapping, new NullProgressMonitor()); } if (status != ProjectNegotiation.Status.OK) handleErrorStatus(status, negotiation.getErrorMessage(), negotiation.getPeer()); } }); }</code><technical_language>Is a break right statement in this case? Do want add project mapping continue starting session negotiation, project creation failed (and canceled negotiation)</technical_language>

Target:
public void handleIncomingProjectNegotiation( final AbstractIncomingProjectNegotiation negotiation) { Map<String, IProject> projectMapping = new HashMap<>(); for (ProjectNegotiationData data : negotiation.getProjectNegotiationData()) { String projectName = data.getProjectName(); IProject project = workspace.getProject(projectName); if (!project.exists()) { try { project.adaptTo(ServerProjectImpl.class).create(); } catch (IOException e) { negotiation.localCancel( "Error creating project folder", NegotiationTools.CancelOption.NOTIFY_PEER); return; } } projectMapping.put(data.getProjectID(), project); } projectExecutor.execute( new Runnable() { @Override public void run() { ProjectNegotiation.Status status; if (ServerConfig.isInteractive()) { status = negotiation.run(projectMapping, new ConsoleProgressIndicator(System.out)); } else { status = negotiation.run(projectMapping, new NullProgressMonitor()); } if (status != ProjectNegotiation.Status.OK) handleErrorStatus(status, negotiation.getErrorMessage(), negotiation.getPeer()); } }); }
Source:
<code>public List<PermissionSubject> getPermissionCheckSubjects() { List<PermissionSubject> list = new ArrayList<PermissionSubject>(); Guid storagePoolId = getVdsGroup() == null || getVdsGroup().getstorage_pool_id() == null ? null : getVdsGroup().getstorage_pool_id().getValue(); list.add(new PermissionSubject(storagePoolId, VdcObjectType.StoragePool, getActionType().getActionGroup())); QuotaHelper.addQuotaPermissionSubject(list, getStoragePool(), getQuotaId()); return list; <START> } <END></code><technical_language>I need call super loose permissions need check default</technical_language>

Target:
public List<PermissionSubject> getPermissionCheckSubjects() { List<PermissionSubject> list = new ArrayList<PermissionSubject>(); Guid storagePoolId = getVdsGroup() == null || getVdsGroup().getstorage_pool_id() == null ? null : getVdsGroup().getstorage_pool_id().getValue(); list.add(new PermissionSubject(storagePoolId, VdcObjectType.StoragePool, getActionType().getActionGroup())); list = QuotaHelper.addQuotaPermissionSubject(list, getStoragePool(), getQuotaId()); return list; }