auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>protected Set<Value.Immutable<?>> api$getVanillaValues() { <START> Set<Value.Immutable<?>> values = super.api$getVanillaValues(); <END> values.add(this.color().asImmutable()); values.add(this.radius().asImmutable()); values.add(this.particleEffect().asImmutable()); values.add(this.duration().asImmutable()); values.add(this.waitTime().asImmutable()); values.add(this.radiusOnUse().asImmutable()); values.add(this.radiusPerTick().asImmutable()); values.add(this.durationOnUse().asImmutable()); values.add(this.applicationDelay().asImmutable()); values.add(this.effects().asImmutable()); values.add(this.age().asImmutable()); return values; }</code><technical_language>finalize variables please :)</technical_language>

Target:
protected Set<Value.Immutable<?>> api$getVanillaValues() { final Set<Value.Immutable<?>> values = super.api$getVanillaValues(); values.add(this.color().asImmutable()); values.add(this.radius().asImmutable()); values.add(this.particleEffect().asImmutable()); values.add(this.duration().asImmutable()); values.add(this.waitTime().asImmutable()); values.add(this.radiusOnUse().asImmutable()); values.add(this.radiusPerTick().asImmutable()); values.add(this.durationOnUse().asImmutable()); values.add(this.applicationDelay().asImmutable()); values.add(this.effects().asImmutable()); values.add(this.age().asImmutable()); return values; }
Source:
<code>public Map<String, ServerImpl> getServers() { <START> ServerEvaluationStrategy strategy = provider.getStrategy(info, serversConf, internalHost); <END> Map<String, List<PortBinding>> ports; if (info.getNetworkSettings() != null && info.getNetworkSettings().getPorts() != null) { ports = info.getNetworkSettings().getPorts(); } else { return Collections.emptyMap(); } Map<String, ServerImpl> servers = new LinkedHashMap<>(); for (String portProtocol : ports.keySet()) { servers.put(portProtocol, strategy.getServer(portProtocol)); } return servers; }</code><technical_language>I I imaged this code in a wrong way. I good. do if: 1. Strategies injected in MapBinder 2. Some strategy provider is bound provider of Server**s**EvaluationStrategy 3. In constructor Server**s**EvaluationStrategy is injected 4. In constructor strategy is assigned a field. 5. In getServers call strategy.getServers(info, internalHost) returns Map<String, ServerImpl> filled ports addresses. @l0rd @amisevsk WDYT</technical_language>

Target:
public Map<String, ServerImpl> getServers() { ServerEvaluationStrategy strategy = provider.get(); return strategy.getServers(info, internalHost, serversConf); }
Source:
<code><START> public void add(DiffObjectCount toAdd) { <END> treesCount += toAdd.getTreesCount(); featuresCount += toAdd.getFeaturesCount(); }</code><technical_language>This class ideally immutable. I convenience in add\* methods while computing sizes, package private in order reduce class' public interface immutable part</technical_language>

Target:
void add(DiffObjectCount toAdd) { treesCount += toAdd.getTreesCount(); featuresCount += toAdd.getFeaturesCount(); }
Source:
<code>private int calcCameraRotation(int screenOrientationDegrees) { if (mCameraInfo.facing == Camera.CameraInfo.CAMERA_FACING_FRONT) { <START> return (mCameraInfo.orientation + screenOrientationDegrees) % 360; <END> } final int landscapeFlip = isLandscape(screenOrientationDegrees) ? 180 : 0; return (mCameraInfo.orientation + screenOrientationDegrees + landscapeFlip) % 360; }</code><technical_language>front facing camera need landspaceFlip</technical_language>

Target:
private int calcCameraRotation(int screenOrientationDegrees) { if (mCameraInfo.facing == Camera.CameraInfo.CAMERA_FACING_BACK) { return (mCameraInfo.orientation + screenOrientationDegrees) % 360; } final int landscapeFlip = isLandscape(screenOrientationDegrees) ? 180 : 0; return (mCameraInfo.orientation + screenOrientationDegrees + landscapeFlip) % 360; }
Source:
<code>Context findFailoverNode(final VirtualHost.HostEntry entry, final String domain, final String session, final String jvmRoute, final boolean forceStickySession) { <START> if (modCluster.isDeterministicFailover()) { <END> String sessionId = session.substring(0, session.indexOf('.')); int index = Math.abs(sessionId.hashCode()) % entry.getNodes().size(); List<String> ordered = new ArrayList<>(entry.getNodes()); Collections.sort(ordered); String electedJvmRoute = ordered.get(index); UndertowLogger.ROOT_LOGGER.debugf("Using deterministic failover target: %s", electedJvmRoute); return entry.getContextForNode(electedJvmRoute); } String failOverDomain = null; if (domain == null) { final Node node = nodes.get(jvmRoute); if (node != null) { failOverDomain = node.getNodeConfig().getDomain(); } if (failOverDomain == null) { failOverDomain = failoverDomains.get(jvmRoute); } } else { failOverDomain = domain; } final Collection<Context> contexts = entry.getContexts(); if (failOverDomain != null) { final Context context = electNode(contexts, true, failOverDomain); if (context != null) { return context; } } if (forceStickySession) { return null; } else { return electNode(contexts, false, null); } }</code><technical_language>Is this guaranteed get a live node? pick nodes in error state</technical_language>

Target:
Context findFailoverNode(final VirtualHost.HostEntry entry, final String domain, final String session, final String jvmRoute, final boolean forceStickySession) { if (modCluster.isDeterministicFailover()) { List<String> candidates = new ArrayList<>(entry.getNodes().size()); for (String route : entry.getNodes()) { Node node = nodes.get(route); if (node != null && !node.isInErrorState()) { candidates.add(route); } } String sessionId = session.substring(0, session.indexOf('.')); int index = Math.abs(sessionId.hashCode()) % candidates.size(); Collections.sort(candidates); String electedRoute = candidates.get(index); UndertowLogger.ROOT_LOGGER.debugf("Using deterministic failover target: %s", electedRoute); return entry.getContextForNode(electedRoute); } String failOverDomain = null; if (domain == null) { final Node node = nodes.get(jvmRoute); if (node != null) { failOverDomain = node.getNodeConfig().getDomain(); } if (failOverDomain == null) { failOverDomain = failoverDomains.get(jvmRoute); } } else { failOverDomain = domain; } final Collection<Context> contexts = entry.getContexts(); if (failOverDomain != null) { final Context context = electNode(contexts, true, failOverDomain); if (context != null) { return context; } } if (forceStickySession) { return null; } else { return electNode(contexts, false, null); } }
Source:
<code>public PcapNgBlock(SeekableByteChannel fileChannel, ByteOrder byteOrder) throws IOException, <START> BadPcapFileException { <END> ByteBuffer pcapPacketHeader; pcapPacketHeader = ByteBuffer.allocate(PcapFileValues.PCAPNG_BLOCK_HEADER_SIZE); pcapPacketHeader.order(byteOrder); fileChannel.read(pcapPacketHeader); pcapPacketHeader.flip(); int blockType = pcapPacketHeader.getInt(); fBlockType = blockType; int blockLength = pcapPacketHeader.getInt(); fBlockLength = blockLength; fBody = ByteBuffer.allocate(blockLength - PcapFileValues.PCAPNG_BLOCK_HEADER_SIZE); fBody.order(byteOrder); fileChannel.read(fBody); fBody.flip(); fBody.position(0); }</code><technical_language>This exception is longer thrown this method</technical_language>

Target:
public PcapNgBlock(SeekableByteChannel fileChannel, ByteOrder byteOrder) throws IOException { ByteBuffer pcapPacketHeader; pcapPacketHeader = ByteBuffer.allocate(PcapFileValues.PCAPNG_BLOCK_HEADER_SIZE); pcapPacketHeader.order(byteOrder); fileChannel.read(pcapPacketHeader); pcapPacketHeader.flip(); fBlockType = pcapPacketHeader.getInt(); fBlockLength = pcapPacketHeader.getInt(); fBody = ByteBuffer.allocate(fBlockLength - PcapFileValues.PCAPNG_BLOCK_HEADER_SIZE - 4); fBody.order(byteOrder); fileChannel.read(fBody); fileChannel.position(fileChannel.position() + 4); fBody.flip(); }
Source:
<code>public final boolean process( Set<? extends TypeElement> annotations, RoundEnvironment roundEnv ) { for (TypeElement annotation : annotations) { AnnotatedElements annotatedElements = getAnnotatedElements(roundEnv, annotation); <START> if (!(annotatedElements.getAnnotatedClasses().isEmpty() && <END> annotatedElements.getAnnotatedMethods().isEmpty()) ) { File outputDir = getOutputDirectory(); outputDir.mkdirs(); makeFile(new File(outputDir, ModernizerAnnotationUtils.IGNORE_CLASSES_FILE_NAME), annotatedElements.getAnnotatedClasses()); makeFile(new File(outputDir, ModernizerAnnotationUtils.IGNORE_METHODS_FILE_NAME), annotatedElements.getAnnotatedMethods()); } } return true; }</code><technical_language>While this means thing, read !isEmpty || !isEmpty</technical_language>

Target:
public final boolean process( Set<? extends TypeElement> annotations, RoundEnvironment roundEnv ) { for (TypeElement annotation : annotations) { AnnotatedElements annotatedElements = getAnnotatedElements(roundEnv, annotation); if (!annotatedElements.getAnnotatedClasses().isEmpty() || !annotatedElements.getAnnotatedMethods().isEmpty() ) { File outputDir = getOutputDirectory(); outputDir.mkdirs(); writeLines(new File(outputDir, ModernizerAnnotationUtils.IGNORE_CLASSES_FILE_NAME), annotatedElements.getAnnotatedClasses()); writeLines(new File(outputDir, ModernizerAnnotationUtils.IGNORE_METHODS_FILE_NAME), annotatedElements.getAnnotatedMethods()); } } return true; }
Source:
<code>public Account executeAccount(IProgressMonitor monitor) throws GerritException { <START> if (restQueryAPIEnabled) { <END> try { GerritAccount gerritAccount = executeAccountsRest(monitor, "self"); Account account = new Account(new Account.Id(gerritAccount.getAccountId())); account.setFullName(gerritAccount.getName()); account.setPreferredEmail(gerritAccount.getEmail()); return account; } catch (GerritException e) { restQueryAPIEnabled = false; } } return executeAccountGwt(monitor); }</code><technical_language>this rest QueryAPIEnabled state dispatch selection REST GWT, indirection a Version/Capabilities class enum calling class for actual account execution</technical_language>

Target:
public Account executeAccount(IProgressMonitor monitor) throws GerritException { final Version version = getVersion(monitor); return execute(monitor, new Operation<Account>() { @Override public void execute(IProgressMonitor monitor) throws GerritException { getAccountService(version).myAccount(this); } }); }
Source:
<code>private boolean isBeforeParameters(CContentAssistInvocationContext context) { int relativeOffset = context.getInvocationOffset() - context.getParseOffset(); if (relativeOffset == 0) return true; int startOffset = context.getParseOffset(); try { String completePrefix = context.getDocument().get(startOffset, context.getInvocationOffset() - startOffset); if <START> (completePrefix.trim().endsWith("(")) <END> return true; } catch (BadLocationException e) { return false; } return false; }</code><technical_language>find position of non-whitespace character check if character is opening parenthesis</technical_language>

Target:
private boolean isBeforeParameters(CContentAssistInvocationContext context) { int relativeOffset = context.getInvocationOffset() - context.getParseOffset(); if (relativeOffset == 0) return true; int startOffset = context.getParseOffset(); try { String completePrefix = context.getDocument().get(startOffset, context.getInvocationOffset() - startOffset); int lastChar = getLastNonWhitespaceChar(completePrefix); if (lastChar != -1 && completePrefix.charAt(lastChar) == '(') return true; } catch (BadLocationException e) { return false; } return false; }
Source:
<code>public ZkJobCoordinator(Config config, MetricsRegistry metricsRegistry) { this.config = config; ZkConfig zkConfig = new ZkConfig(config); ZkKeyBuilder keyBuilder = new ZkKeyBuilder(new ApplicationConfig(config).getGlobalAppId()); ZkClient zkClient = ZkCoordinationServiceFactory .createZkClient(zkConfig.getZkConnect(), zkConfig.getZkSessionTimeoutMs(), zkConfig.getZkConnectionTimeoutMs()); this.metrics = new ZkJobCoordinatorMetrics(metricsRegistry); this.zkUtils = new ZkUtils(keyBuilder, zkClient, zkConfig.getZkConnectionTimeoutMs(), metrics); this.processorId = createProcessorId(config); LeaderElector leaderElector = new ZkLeaderElector(processorId, zkUtils); leaderElector.setLeaderElectorListener(new LeaderElectorListenerImpl()); this.zkController = new ZkControllerImpl(processorId, zkUtils, this, leaderElector); this.barrier = new ZkBarrierForVersionUpgrade(keyBuilder.getJobModelVersionBarrierPrefix(), zkUtils, new ZkBarrierListenerImpl()); this.debounceTimeMs = new JobConfig(config).getDebounceTimeMs(); this.reporters = MetricsReporterLoader.getMetricsReporters(new MetricsConfig(config), processorId); <START> zkClient.subscribeStateChanges(new ZkSessionStateChangedListener()); <END> }</code><technical_language>@sborya ZkCoordinationServiceFactory.createZkClient is shared LocalApplicationRunner ZkJobCoordinator for leader election other coordination. this change, filtering out of order/old event arrivals zookeeper in ZkJobCoordinator. do for LocalApplicationRunner right place for zkClient.subscribeStateChanges(new ZkSessionStateChangedListener()); subscription is factory method ZkCoordinationServiceFactory.createZkClient</technical_language>

Target:
public ZkJobCoordinator(Config config, MetricsRegistry metricsRegistry) { this.config = config; ZkConfig zkConfig = new ZkConfig(config); ZkKeyBuilder keyBuilder = new ZkKeyBuilder(new ApplicationConfig(config).getGlobalAppId()); ZkClient zkClient = ZkCoordinationServiceFactory .createZkClient(zkConfig.getZkConnect(), zkConfig.getZkSessionTimeoutMs(), zkConfig.getZkConnectionTimeoutMs()); zkClient.subscribeStateChanges(new ZkSessionStateChangedListener()); this.metrics = new ZkJobCoordinatorMetrics(metricsRegistry); this.zkUtils = new ZkUtils( keyBuilder, zkClient, zkConfig.getZkConnectionTimeoutMs(), metricsRegistry); this.processorId = createProcessorId(config); LeaderElector leaderElector = new ZkLeaderElector(processorId, zkUtils); leaderElector.setLeaderElectorListener(new LeaderElectorListenerImpl()); this.zkController = new ZkControllerImpl(processorId, zkUtils, this, leaderElector); this.barrier = new ZkBarrierForVersionUpgrade(keyBuilder.getJobModelVersionBarrierPrefix(), zkUtils, new ZkBarrierListenerImpl()); this.debounceTimeMs = new JobConfig(config).getDebounceTimeMs(); this.reporters = MetricsReporterLoader.getMetricsReporters(new MetricsConfig(config), processorId); }
Source:
<code>public PinotQueryGeneratorContext visitFilter(FilterNode node, PinotQueryGeneratorContext context) <START> { <END> context = node.getSource().accept(this, context); requireNonNull(context, "context is null"); LinkedHashMap<VariableReferenceExpression, Selection> selections = context.getSelections(); String filter = node.getPredicate().accept(pinotFilterExpressionConverter, (var) -> selections.get(var)).getDefinition(); return context.withFilter(filter).withOutputColumns(node.getOutputVariables()); }</code><technical_language>public</technical_language>

Target:
public PinotQueryGeneratorContext visitFilter(FilterNode node, PinotQueryGeneratorContext context) { context = node.getSource().accept(this, context); requireNonNull(context, "context is null"); LinkedHashMap<VariableReferenceExpression, Selection> selections = context.getSelections(); String filter = node.getPredicate().accept(pinotFilterExpressionConverter, selections::get).getDefinition(); return context.withFilter(filter).withOutputColumns(node.getOutputVariables()); }
Source:
<code>public boolean isInsecureSkipTLSVerify() { <START> if(cluster.containsKey("insecure-skip-tls-verify")) { <END> return (Boolean) cluster.get("insecure-skip-tls-verify"); } return false; }</code><technical_language>extract identifiers constants for reuse</technical_language>

Target:
public boolean isInsecureSkipTLSVerify() { if(cluster.containsKey(INSECURE_SKIP_TLS_VERIFY)) { return (Boolean) cluster.get(INSECURE_SKIP_TLS_VERIFY); } return false; }
Source:
<code>private void setStatusIfNotTheSame(InstanceMetaData instanceMetaData, InstanceStatus newStatus) { <START> if (updateStatus) { <END> instanceMetaData.setInstanceStatus(newStatus); LOGGER.info(":::Auto sync::: The instance status updated from to {}", instanceMetaData.getInstanceStatus(), newStatus); } else { LOGGER.info(":::Auto sync::: The instance status would be had to update from to {}", instanceMetaData.getInstanceStatus(), newStatus); } }</code><technical_language>this check removed: instanceMetaData.getInstanceStatus() != newStatus is purpose? I log change in this case</technical_language>

Target:
private void setStatusIfNotTheSame(InstanceMetaData instanceMetaData, InstanceStatus newStatus) { if (instanceMetaData.getInstanceStatus() != newStatus) { if (updateStatus) { instanceMetaData.setInstanceStatus(newStatus); LOGGER.info(":::Auto sync::: The instance status updated from to {}", instanceMetaData.getInstanceStatus(), newStatus); } else { LOGGER.info(":::Auto sync::: The instance status would be had to update from to {}", instanceMetaData.getInstanceStatus(), newStatus); } } }
Source:
<code>public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof Flight)) { return false; } Flight flight = (Flight) o; if (dofM != flight.dofM) { return false; } if (dofW != flight.dofW) { return false; } if (flightNum != flight.flightNum) { return false; } if (originId != flight.originId) { return false; } if (destId != flight.destId) { return false; } if (Double.compare(flight.scheduleDepTime, scheduleDepTime) != 0) { return false; } if (distance != flight.distance) { return false; } <START> if (!carrier.equals(flight.carrier)) { <END> return false; } if (!tailNum.equals(flight.tailNum)) { return false; } if (!origin.equals(flight.origin)) { return false; } if (!dest.equals(flight.dest)) { return false; } if (!deptime.equals(flight.deptime)) { return false; } if (!depDelayMins.equals(flight.depDelayMins)) { return false; } if (!scheduledArrTime.equals(flight.scheduledArrTime)) { return false; } if (!arrTime.equals(flight.arrTime)) { return false; } if (!arrDelay.equals(flight.arrDelay)) { return false; } if (!elapsedTime.equals(flight.elapsedTime)) { return false; } return delayed != null ? delayed.equals(flight.delayed) : flight.delayed == null; }</code><technical_language>this throw exception if carrier is null. java.util.Objects.equals() handle nulls for you. For consistent style other classes, do like: return dofM == flight.dofM && dofW == flight.dofW && Objects.equals(carrier, flight.carrier) && ..</technical_language>

Target:
public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof Flight)) { return false; } Flight flight = (Flight) o; return dofM == flight.dofM && dofW == flight.dofW && Objects.equals(carrier, flight.carrier) && Objects.equals(tailNum, flight.tailNum) && flightNum == flight.flightNum && originId == flight.originId && Objects.equals(origin, flight.origin) && destId == flight.destId && Objects.equals(dest, flight.dest) && scheduleDepTime == flight.scheduleDepTime && Objects.equals(deptime, flight.deptime) && Objects.equals(depDelayMins, flight.depDelayMins) && Objects.equals(scheduledArrTime, flight.scheduledArrTime) && Objects.equals(arrTime, flight.arrTime) && Objects.equals(arrDelay, flight.arrDelay) && Objects.equals(elapsedTime, flight.elapsedTime) && distance == flight.distance && Objects.equals(delayed, flight.delayed); }
Source:
<code>public void setScoreFilter(int score) { <START> enforceNetworkStackPermission(); <END> sendMessage(obtainMessage(CMD_SET_SCORE, score, 0)); }</code><technical_language>IIUC check done in service side, in NetworkFactory is in client process. need do in NetworkFactory is declare permission needed for system apis</technical_language>

Target:
public void setScoreFilter(int score) { sendMessage(obtainMessage(CMD_SET_SCORE, score, 0)); }
Source:
<code>public void theReplaceKeysRequestIsReceived() throws Throwable { <START> PROPERTIES_MAP.put(DEVICE_IDENTIFICATION_G_LABEL, this.deviceId.getDeviceIdG()); <END> PROPERTIES_MAP.put(ORGANISATION_IDENTIFICATION_LABEL, this.organisationId.getOrganisationId()); this.RequestRunner(PROPERTIES_MAP, TEST_CASE_NAME_REQUEST, TEST_CASE_XML, TEST_SUITE_XML); }</code><technical_language>ReplaceKeys tested E-meter DEVICE_IDENTIFICATION_G_LABEL -> DEVICE_IDENTIFICATION_E_LABEL getDeviceIdG -> getDeviceIdE</technical_language>

Target:
public void theReplaceKeysRequestIsReceived() throws Throwable { PROPERTIES_MAP.put(DEVICE_IDENTIFICATION_E_LABEL, this.deviceId.getDeviceIdE()); PROPERTIES_MAP.put(ORGANISATION_IDENTIFICATION_LABEL, this.organisationId.getOrganisationId()); this.RequestRunner(PROPERTIES_MAP, TEST_CASE_NAME_REQUEST, TEST_CASE_XML, TEST_SUITE_XML); }
Source:
<code>public IPropertyWrapper getProperty(String name) { buildPropertyMap(); <START> return null; <END> }</code><technical_language>Ahem</technical_language>

Target:
public IPropertyWrapper getProperty(String name) { buildPropertyMap(); return properties.get(name); }
Source:
<code>public void controller(@RequestParam("patientId") Patient patient, @RequestParam(value = "tab", defaultValue = "visits") String selectedTab, PageModel model, @InjectBeans PatientDomainWrapper patientDomainWrapper, @SpringBean("orderService") OrderService orderService, @SpringBean("adtService") AdtService adtService, @SpringBean("appFrameworkService") AppFrameworkService appFrameworkService, UiSessionContext sessionContext) { patientDomainWrapper.setPatient(patient); model.addAttribute("patient", patientDomainWrapper); model.addAttribute("orders", orderService.getOrdersByPatient(patient)); model.addAttribute("availableTasks", new ArrayList()); model.addAttribute("activeVisitTasks", new ArrayList()); model.addAttribute("addressHierarchyLevels", getAddressHierarchyLevels()); model.addAttribute("selectedTab", selectedTab); Location sessionLocation = sessionContext.getSessionLocation(); if (sessionLocation == null) sessionLocation = LocationUtility.getDefaultLocation(); <START> Location visitLocation = sessionLocation; END> VisitDomainWrapper activeVisit = adtService.getActiveVisit((Patient) patient, visitLocation); model.addAttribute("activeVisit", activeVisit); List<Extension> encounterTemplateExtensions = appFrameworkService .getExtensionsForCurrentUser(ENCOUNTER_TEMPLATE_EXTENSION); model.addAttribute("encounterTemplateExtensions", encounterTemplateExtensions); }</code><technical_language>undo time this</technical_language>

Target:
public void controller(@RequestParam("patientId") Patient patient, @RequestParam(value = "tab", defaultValue = "visits") String selectedTab, PageModel model, @InjectBeans PatientDomainWrapper patientDomainWrapper, @SpringBean("orderService") OrderService orderService, @SpringBean("adtService") AdtService adtService, @SpringBean("appFrameworkService") AppFrameworkService appFrameworkService, UiSessionContext sessionContext) { patientDomainWrapper.setPatient(patient); model.addAttribute("patient", patientDomainWrapper); model.addAttribute("orders", orderService.getOrdersByPatient(patient)); model.addAttribute("addressHierarchyLevels", getAddressHierarchyLevels()); model.addAttribute("selectedTab", selectedTab); Location visitLocation = adtService.getLocationThatSupportsVisits(sessionContext.getSessionLocation()); VisitDomainWrapper activeVisit = adtService.getActiveVisit((Patient) patient, visitLocation); model.addAttribute("activeVisit", activeVisit); List<Extension> encounterTemplateExtensions = appFrameworkService .getExtensionsForCurrentUser(ENCOUNTER_TEMPLATE_EXTENSION); model.addAttribute("encounterTemplateExtensions", encounterTemplateExtensions); model.addAttribute("overallActions", appFrameworkService.getExtensionsForCurrentUser("patientDashboard.overallActions")); model.addAttribute("visitActions", appFrameworkService.getExtensionsForCurrentUser("patientDashboard.visitActions")); }
Source:
<code>public boolean test(R record) { <START> return record.key() == null; <END> }</code><technical_language>I want check instead of key here? suggestion return record.value() == null;</technical_language>

Target:
public boolean test(R record) { return record.value() == null; }
Source:
<code>public Set<String> getEnabledServiceNames() { return properties.entrySet().stream().filter(keyValuePair -> Boolean.valueOf((String) keyValuePair.getValue())) <START> .map(keyValuePair -> ((String) keyValuePair.getKey()).substring(((String) keyValuePair.getKey()).lastIndexOf(".") + 1).toUpperCase(Locale.getDefault())).collect(toSet()); <END> }</code><technical_language>I a character '.' instead, big deal</technical_language>

Target:
public Set<String> getEnabledServiceNames() { return properties.entrySet().stream().filter(keyValuePair -> Boolean.valueOf((String) keyValuePair.getValue())) .map(keyValuePair -> ((String) keyValuePair.getKey()).substring(((String) keyValuePair.getKey()).lastIndexOf('.') + 1).toUpperCase(Locale.getDefault())).collect(toSet()); }
Source:
<code>private void setDelta(int bucket, int value) { int slot = bucketToSlot(bucket); byte clearMask = (byte) (BUCKET_MASK << shiftForBucket(bucket)); <START> deltas[slot] &= (byte) ~clearMask; <END> byte setMask = (byte) (value << shiftForBucket(bucket)); deltas[slot] |= setMask; }</code><technical_language>This cast is unnecessary. deltas is a byte array, irrelevant negated mask is promoted int. I this is a case of overly aggressive inspection</technical_language>

Target:
private void setDelta(int bucket, int value) { int slot = bucketToSlot(bucket); byte clearMask = (byte) (BUCKET_MASK << shiftForBucket(bucket)); deltas[slot] &= ~clearMask; byte setMask = (byte) (value << shiftForBucket(bucket)); deltas[slot] |= setMask; }
Source:
<code>private void runOnceForTable(TableToSweep tableToSweep) { Stopwatch watch = Stopwatch.createStarted(); TableReference tableRef = tableToSweep.getTableRef(); byte[] startRow = tableToSweep.getStartRow(); SweepBatchConfig batchConfig = getAdjustedBatchConfig(); try { SweepResults results = sweepRunner.run( tableRef, batchConfig, startRow); long elapsedMillis = watch.elapsed(TimeUnit.MILLISECONDS); log.info("Swept unique cells from starting at {}" + " and performed deletions in ms" + " up to timestamp {}.", <START> SafeArg.of("", results.getCellTsPairsExamined()), <END> UnsafeArg.of("table name", tableRef), SafeArg.of("row hex", startRowToHex(startRow)), SafeArg.of("", results.getStaleValuesDeleted()), SafeArg.of("", elapsedMillis), SafeArg.of("", results.getSweptTimestamp())); sweepPerfLogger.logSweepResults( SweepPerformanceResults.builder() .sweepResults(results) .tableName(tableRef.getQualifiedName()) .elapsedMillis(elapsedMillis) .build()); saveSweepResults(tableToSweep, results); } catch (RuntimeException e) { log.warn("Failed to sweep with batch config starting from row {}", UnsafeArg.of("table name", tableRef), SafeArg.of("", batchConfig), SafeArg.of("hex", startRowToHex(startRow))); throw e; } }</code><technical_language>This unsafe</technical_language>

Target:
private void runOnceForTable(TableToSweep tableToSweep) { Stopwatch watch = Stopwatch.createStarted(); TableReference tableRef = tableToSweep.getTableRef(); byte[] startRow = tableToSweep.getStartRow(); SweepBatchConfig batchConfig = getAdjustedBatchConfig(); try { SweepResults results = sweepRunner.run( tableRef, batchConfig, startRow); long elapsedMillis = watch.elapsed(TimeUnit.MILLISECONDS); log.info("Swept unique cells from starting at {}" + " and performed deletions in ms" + " up to timestamp {}.", SafeArg.of("cellsExamined", results.getCellTsPairsExamined()), UnsafeArg.of("table name", tableRef), UnsafeArg.of("start row hex", startRowToHex(startRow)), SafeArg.of("staleValuesDeleted", results.getStaleValuesDeleted()), SafeArg.of("elapsedMillis", elapsedMillis), SafeArg.of("sweptTimestamp", results.getSweptTimestamp())); sweepPerfLogger.logSweepResults( SweepPerformanceResults.builder() .sweepResults(results) .tableName(tableRef.getQualifiedName()) .elapsedMillis(elapsedMillis) .build()); saveSweepResults(tableToSweep, results); } catch (RuntimeException e) { log.debug("Failed to sweep with batch config starting from row {}", UnsafeArg.of("table name", tableRef), SafeArg.of("cell batch size", batchConfig), UnsafeArg.of("start row hex", startRowToHex(startRow))); throw e; } }
Source:
<code>public void registerExternalIdentifier() throws Exception { TestUtils.mockEditAccount(mockAccountDao, mockAccount); service.registerExternalIdentifier(TEST_STUDY, "BBB", externalId); verify(mockDao).registerExternalId(externalId); <START> verify(mockAccount).setExternalId(externalId.getIdentifier()); <END> }</code><technical_language>this test set data group</technical_language>

Target:
public void registerExternalIdentifier() throws Exception { TestUtils.mockEditAccount(mockAccountDao, mockAccount); Set<String> dataGroups = Sets.newHashSet(); when(mockAccount.getDataGroups()).thenReturn(dataGroups); service.registerExternalIdentifier(TEST_STUDY, "BBB", externalId); verify(mockDao).registerExternalId(externalId); verify(mockAccount).setExternalId(externalId.getIdentifier()); assertEquals(Sets.newHashSet("football_player"), dataGroups); }
Source:
<code><START> public boolean onKeyEvent(NUIKeyEvent event) { <END> if (event.isDown()) { int keyId = event.getKey().getId(); if (keyId == Keyboard.KeyId.UP) { if (TabbingManager.focusedWidget instanceof UIDropdown) { if (((UIDropdown) TabbingManager.focusedWidget).isOpened()) { TabbingManager.setWidgetIsOpen(true); ((UIDropdown) TabbingManager.focusedWidget).changeHighlighted(false); } else { TabbingManager.setWidgetIsOpen(false); } } if (parent != null && !TabbingManager.isWidgetOpen()) { parent.scroll(true); } return true; } else if (keyId == Keyboard.KeyId.DOWN) { if (TabbingManager.focusedWidget instanceof UIDropdown) { if (((UIDropdown) TabbingManager.focusedWidget).isOpened()) { TabbingManager.setWidgetIsOpen(true); ((UIDropdown) TabbingManager.focusedWidget).changeHighlighted(true); } else { TabbingManager.setWidgetIsOpen(false); } } if (parent != null && !TabbingManager.isWidgetOpen()) { parent.scroll(false); } return true; } } return super.onKeyEvent(event); }</code><technical_language>This handled individual widgets themselves. Else this method need growing more more widgets need implement</technical_language>

Target:
public boolean onKeyEvent(NUIKeyEvent event) { if (event.isDown()) { int keyId = event.getKey().getId(); if (keyId == Keyboard.KeyId.UP) { if (parent != null && !TabbingManager.isWidgetOpen()) { parent.scroll(true); } return true; } else if (keyId == Keyboard.KeyId.DOWN) { if (parent != null && !TabbingManager.isWidgetOpen()) { parent.scroll(false); } return true; } } return super.onKeyEvent(event); }
Source:
<code>public void start() { if (State.NOT_STARTED.equals(this.state)) { logger.debug("Transcriber is now transcribing"); this.state = State.TRANSCRIBING; this.executorService = Executors.newSingleThreadExecutor(); List<String> names = new ArrayList<>(participants.size()); participants.values().forEach((p) -> { String name; <START> if ((name = p.getName()) == null) <END> { name = p.getId(); } names.add(name); }); this.transcript.started(roomName, names); } else { logger.warn("Trying to start Transcriber while it is" + "already started"); } }</code><technical_language>need do this anymore p.getName() return null</technical_language>

Target:
public void start() { if (State.NOT_STARTED.equals(this.state)) { logger.debug("Transcriber is now transcribing"); this.state = State.TRANSCRIBING; this.executorService = Executors.newSingleThreadExecutor(); List<String> names = new ArrayList<>(participants.size()); participants.values().forEach((p) -> names.add(p.getName())); this.transcript.started(roomName, names); } else { logger.warn("Trying to start Transcriber while it is" + "already started"); } }
Source:
<code>public void edit(final IscsiStorageModel object) { driver.edit(object); initLists(object); object.getPropertyChangedEvent().addListener((ev, sender, args) -> { String propName = args.propertyName; if (propName.equals("IsValid")) { onIsValidPropertyChange(object); } else if (propName.equals("IsGroupedByTarget")) { updateListByGrouping(object); } }); iscsiTargetToLunView.edit(object); iscsiLunToTargetView.edit(object); targetsToLunTab.addClickHandler(event -> { iscsiLunToTargetView.disableItemsUpdate(); object.setIsGroupedByTarget(true); }); lunToTargetsTab.addClickHandler(event -> { iscsiTargetToLunView.disableItemsUpdate(); object.setIsGroupedByTarget(false); }); dialogTabPanel.switchTab(object.getIsGroupedByTarget() ? targetsToLunTab : lunToTargetsTab); updateListByGrouping(object); if (!object.getContainer().isNewStorage()) { switch (object.getContainer().getStorage().getStatus()) { case Maintenance: mainLabel.setText(constants.storageIscsiRemoveLUNsLabel()); subLabel.setText(constants.storageIscsiAvailableActionsOnMaintenanceLabel()); break; case Active: mainLabel.setText(constants.storageIscsiActionsLabel()); subLabel.setText(constants.storageIscsiAvailableActionsForActiveDomainsLabel()); break; } } <START> dialogTabPanel.setBarStyle(object.getContainer().isNewStorage() ? <END> (!multiSelection ? style.barNewDisk() : style.barShort()) : style.barLong()); }</code><technical_language>bit complicated :) like: if (object.getContainer().isNewStorage()) { dialogTabPanel.setBarStyle(multiSelection ? style.barShort() : style.barNewDisk()); } else { dialogTabPanel.setBarStyle(style.barLong()); }</technical_language>

Target:
public void edit(final IscsiStorageModel object) { driver.edit(object); initLists(object); object.getPropertyChangedEvent().addListener((ev, sender, args) -> { String propName = args.propertyName; if (propName.equals("IsValid")) { onIsValidPropertyChange(object); } else if (propName.equals("IsGroupedByTarget")) { updateListByGrouping(object); } }); iscsiTargetToLunView.edit(object); iscsiLunToTargetView.edit(object); targetsToLunTab.addClickHandler(event -> { iscsiLunToTargetView.disableItemsUpdate(); object.setIsGroupedByTarget(true); }); lunToTargetsTab.addClickHandler(event -> { iscsiTargetToLunView.disableItemsUpdate(); object.setIsGroupedByTarget(false); }); dialogTabPanel.switchTab(object.getIsGroupedByTarget() ? targetsToLunTab : lunToTargetsTab); updateListByGrouping(object); if (!object.getContainer().isNewStorage()) { switch (object.getContainer().getStorage().getStatus()) { case Maintenance: mainLabel.setText(constants.storageIscsiRemoveLUNsLabel()); subLabel.setText(constants.storageIscsiAvailableActionsOnMaintenanceLabel()); break; case Active: mainLabel.setText(constants.storageIscsiActionsLabel()); subLabel.setText(constants.storageIscsiAvailableActionsForActiveDomainsLabel()); break; } } if (object.getContainer().isNewStorage()) { dialogTabPanel.setBarStyle(multiSelection ? style.barShort() : style.barNewDisk()); } else { dialogTabPanel.setBarStyle(style.barLong()); } }
Source:
<code>public LanguageServerRegistryImpl(Set<LanguageServerLauncher> languageServerLaunchers, Set<LanguageDescription> languages, Provider<ProjectManager> projectManagerProvider, ServerInitializer initializer) { this.languages.addAll(languages); this.launchers.putAll(languageServerLaunchers.stream() <START> .collect(Collectors.toMap(LanguageServerLauncher::getLanguageId, launcher -> launcher))); <END> this.projectManagerProvider = projectManagerProvider; this.initializer = initializer; this.projectToServer = new ConcurrentHashMap<>(); this.initializer.addObserver(this); }</code><technical_language>if languages launchers initialized there, do need initialize fields addAll/putAll instead of new this.languages = new ArrayList<>(languages); List list = new ArrayList<>() (when declaring field) list.addAll(myElements) (in constructor)</technical_language>

Target:
public LanguageServerRegistryImpl(Set<LanguageServerLauncher> languageServerLaunchers, Set<LanguageDescription> languages, Provider<ProjectManager> projectManagerProvider, ServerInitializer initializer) { this.languages= new ArrayList<>(languages); this.launchers.putAll(languageServerLaunchers.stream() .collect(Collectors.toMap(LanguageServerLauncher::getLanguageId, launcher -> launcher))); this.projectManagerProvider = projectManagerProvider; this.initializer = initializer; this.initializer.addObserver(this); }
Source:
<code>public String toString() { int blockSizeLimit = 100; return MoreObjects.toStringHelper(this).add("id", mId).add("workerAddress", mWorkerAddress) .add("capacityBytes", mCapacityBytes).add("usedBytes", mUsedBytes) .add("lastUpdatedTimeMs", mLastUpdatedTimeMs) .add("blocks", <START> (mBlocks.size() < blockSizeLimit) ? mBlocks : <END> mBlocks.stream().limit(blockSizeLimit).collect(Collectors.toList())) .add("lostStorage", mLostStorage).toString(); }</code><technical_language>need this condition limit</technical_language>

Target:
public String toString() { int blockSizeLimit = 100; Collection<Long> blocks = mBlocks; if (!LOG.isDebugEnabled()) { blocks = (mBlocks.size() < blockSizeLimit) ? mBlocks : mBlocks.stream().limit(blockSizeLimit).collect(Collectors.toList()); } return MoreObjects.toStringHelper(this).add("id", mId).add("workerAddress", mWorkerAddress) .add("capacityBytes", mCapacityBytes).add("usedBytes", mUsedBytes) .add("lastUpdatedTimeMs", mLastUpdatedTimeMs) .add("blockCount", mBlocks.size()) .add("blocks", blocks) .add("lostStorage", mLostStorage).toString(); }
Source:
<code>private DTCellValue52 value() { if (editingCol() instanceof LimitedEntryActionSetFieldCol52) { return factory().makeNewValue(editingPattern(), (LimitedEntryActionSetFieldCol52) editingCol()); } else if (editingCol() instanceof LimitedEntryConditionCol52) { return factory().makeNewValue(editingPattern(), (LimitedEntryConditionCol52) editingCol()); } else if (editingCol() instanceof LimitedEntryActionInsertFactCol52) { return factory().makeNewValue(editingCol()); } <START> return null; <END> }</code><technical_language>of Optional is nicer</technical_language>

Target:
private DTCellValue52 value() { if (editingCol() instanceof LimitedEntryActionSetFieldCol52) { return factory().makeNewValue(editingPattern(), (LimitedEntryActionSetFieldCol52) editingCol()); } else if (editingCol() instanceof LimitedEntryConditionCol52) { return factory().makeNewValue(editingPattern(), (LimitedEntryConditionCol52) editingCol()); } else if (editingCol() instanceof LimitedEntryActionInsertFactCol52) { return factory().makeNewValue(editingCol()); } throw new UnsupportedOperationException("The column type is not supported by the 'LimitedWidget'"); }
Source:
<code>public void pass_the_null_tolerance_check() { final NullToleranceTest nullToleranceTest = NullToleranceTest.newBuilder() .setClass(Stringifiers.class) <START> .addDefaultValue(CommandId.newBuilder()) <END> .build(); final boolean passed = nullToleranceTest.check(); assertTrue(passed); }</code><technical_language>This default correct. I see, a for ID class? If so, please some proper ID class a default</technical_language>

Target:
public void pass_the_null_tolerance_check() { final NullToleranceTest nullToleranceTest = NullToleranceTest.newBuilder() .setClass(Stringifiers.class) .build(); final boolean passed = nullToleranceTest.check(); assertTrue(passed); }
Source:
<code>private boolean isExpired(String candidateId, long now) { <START> SessionData sessionData = sessionDataMap.get(candidateId); <END> return sessionData != null && sessionData.getExpiry() < now; }</code><technical_language>lock map too</technical_language>

Target:
private boolean isExpired(String candidateId, long now) { SessionData sessionData; synchronized (sessionDataMap) { sessionData = sessionDataMap.get(candidateId); } return sessionData != null && sessionData.getExpiry() < now; }
Source:
<code>public void connect(MessageContext messageContext) throws ConnectException { Registry registry = messageContext.getConfiguration().getRegistry(); <START> String accessTokenRegistryPath = (String) messageContext.getProperty(PROPERTY_PREFIX + <END> "accessTokenRegistryPath"); handleRefresh(messageContext, registry, accessTokenRegistryPath); }</code><technical_language>this null messageContext.getProperty</technical_language>

Target:
public void connect(MessageContext messageContext) throws ConnectException { Registry registry = messageContext.getConfiguration().getRegistry(); String accessTokenRegistryPath = (String) messageContext.getProperty(PROPERTY_PREFIX + "accessTokenRegistryPath"); if (StringUtils.isEmpty(accessTokenRegistryPath)) { throw new ConnectException("Access token registry path not provided for access token storage and reuse."); } handleRefresh(messageContext, registry, accessTokenRegistryPath); }
Source:
<code>public ValidationResult defaultPoolFlagIsNotSet() { if (newMacPool.isDefaultPool()) { <START> return new ValidationResult(VdcBllMessages.ACTION_TYPE_FAILED_CHANGING_DEFAULT_MAC_POOL_IS_NOT_SUPPORTED); <END> } else { return ValidationResult.VALID; } }</code><technical_language>If mistaken changing default pool calling this check creating a new one, this is right error message for occasion</technical_language>

Target:
public ValidationResult defaultPoolFlagIsNotSet() { return ValidationResult.failWith(VdcBllMessages.ACTION_TYPE_FAILED_SETTING_DEFAULT_MAC_POOL_IS_NOT_SUPPORTED). when(macPool.isDefaultPool()); }
Source:
<code><START> public ConcurrentHashMap<Class<?>, ModelUsageData> getSubModels() { <END> return subModels; }</code><technical_language>Try avoid concrete classes in method signatures. ConcurrentMap sounds a fit allows more flexibility. Do want expose this collection clients of this class? a copy a idea? implemented, obtain a reference this internal map modify it. this is desired result</technical_language>

Target:
public ConcurrentMap<Class<?>, ModelUsageData> getSubModels() { return subModels; }
Source:
<code>private boolean areQuestionNumbersConsistent() { Set<Integer> questionNumbersInSession = new HashSet<>(); for (FeedbackQuestionAttributes question : this.questions.values()) { if (questionNumbersInSession.contains(question.questionNumber)) { return false; } <START> questionNumbersInSession.add(question.questionNumber); <END> } for (int i = 1; i <= this.questions.values().size(); i++) { if (!questionNumbersInSession.contains(i)) { return false; } } return true; }</code><technical_language>This returns false if set contains element. behaviour in if condition I guess</technical_language>

Target:
private boolean areQuestionNumbersConsistent() { Set<Integer> questionNumbersInSession = new HashSet<>(); for (FeedbackQuestionAttributes question : this.questions.values()) { if (!questionNumbersInSession.add(question.questionNumber)) { return false; } } for (int i = 1; i <= this.questions.values().size(); i++) { if (!questionNumbersInSession.contains(i)) { return false; } } return true; }
Source:
<code>long getLastHealthReportTime() { long diskCheckTime = dirsHandler.getLastDisksCheckTime(); <START> long lastReportTime = (nodeHealthScriptRunner == null) <END> ? diskCheckTime : Math.max(nodeHealthScriptRunner.getLastReportedTime(), diskCheckTime); lastReportTime = Math.max(lastReportTime, nodeHealthExceptionReportTime); return lastReportTime; }</code><technical_language>This code, hideous. Wanna clean up, too? :)</technical_language>

Target:
long getLastHealthReportTime() { return Collections.max(Arrays.asList( dirsHandler.getLastDisksCheckTime(), nodeHealthScriptRunner == null ? 0 : nodeHealthScriptRunner.getLastReportedTime(), nodeHealthExceptionReportTime)); }
Source:
<code>protected void executeQueryCommand() { Guid domainId = getParameters().getStorageDomainId(); List<DiskImage> disksOfDomain = new ArrayList(); List<VM> vms = getAllVMsForStorageDomain(domainId); VdcQueryReturnValue queryReturnValue = getAllDisksByStorageDomain(domainId); if (queryReturnValue.getSucceeded()) { disksOfDomain = (List<DiskImage>) queryReturnValue.getReturnValue(); <START> } <END> Map<String, VM> vmNameToVMMap = new HashMap(); for (VM vm : vms) { vmNameToVMMap.put(vm.getName(), vm); } for (DiskImage disk : disksOfDomain) { List<String> vmNames = disk.getVmNames(); if (vmNames == null) { continue; } for (String vmName : vmNames) { VM vm = vmNameToVMMap.get(vmName); if (vm != null) { vm.getDiskMap().put(disk.getId(), disk); vm.getDiskList().add(disk); } } } Collections.sort(vms, Collections.reverseOrder(new VmsComparerByDiskSize())); getQueryReturnValue().setReturnValue(vms); }</code><technical_language>error handling if query failed</technical_language>

Target:
protected void executeQueryCommand() { Guid domainId = getParameters().getStorageDomainId(); List<DiskImage> disksOfDomain = null; List<VM> vms = getAllVMsForStorageDomain(domainId); VdcQueryReturnValue queryReturnValue = getAllDisksByStorageDomain(domainId); if (queryReturnValue.getSucceeded()) { disksOfDomain = (List<DiskImage>) queryReturnValue.getReturnValue(); Map<String, VM> vmNameToVMMap = new HashMap(); for (VM vm : vms) { vmNameToVMMap.put(vm.getName(), vm); } for (DiskImage disk : disksOfDomain) { List<String> vmNames = disk.getVmNames(); if (vmNames == null) { continue; } for (String vmName : vmNames) { VM vm = vmNameToVMMap.get(vmName); if (vm != null) { vm.getDiskMap().put(disk.getId(), disk); vm.getDiskList().add(disk); } } } Collections.sort(vms, Collections.reverseOrder(new VmsComparerByDiskSize())); getQueryReturnValue().setReturnValue(vms); } else { log.error("Failed to retrieve disks by storage domain id " + domainId + " due to exception " + queryReturnValue.getExceptionString()); getQueryReturnValue().setSucceeded(false); getQueryReturnValue().setExceptionString(queryReturnValue.getExceptionString()); } }
Source:
<code>public void copy_to_ClipBoard(Context context,String address){ <START> com.fsck.k9.helper.ClipboardManager clipboardManager = com.fsck.k9.helper.ClipboardManager.getInstance(context); <END> clipboardManager.setText(address,address); }</code><technical_language>Import class fully-qualifying</technical_language>

Target:
public void copy_to_ClipBoard(Context context,String address){ ClipboardManager clipboardManager = ClipboardManager.getInstance(context); clipboardManager.setText(address,address); }
Source:
<code>public InitialSetupTask(@NotNull final Registry registry) { super(registry); <START> this.timerId = registry.createId("genie.jobs.tasks.initialSetupTask.timer"); <END> }</code><technical_language>getter here</technical_language>

Target:
public InitialSetupTask(@NotNull final Registry registry) { super(registry); this.timerId = getRegistry().createId("genie.jobs.tasks.initialSetupTask.timer"); }
Source:
<code>private RuleUpdate createRuleUpdate(DbSession dbSession, RuleKey key, OrganizationDto organization) { RuleDto rule = dbClient.ruleDao().selectByKey(dbSession, organization, key) .transform(Optional::of).or(Optional::empty) <START> .orElseThrow(() -> new NotFoundException(format("This rule does not exists: %s", key))); <END> RuleUpdate ruleUpdate = ofNullable(rule.getTemplateId()) .map(x -> RuleUpdate.createForCustomRule(key)) .orElseGet(() -> RuleUpdate.createForPluginRule(key)); ruleUpdate.setOrganization(organization); return ruleUpdate; }</code><technical_language>typo: "does exist" "s"</technical_language>

Target:
private RuleUpdate createRuleUpdate(DbSession dbSession, RuleKey key, OrganizationDto organization) { RuleDto rule = dbClient.ruleDao().selectByKey(dbSession, organization, key) .orElseThrow(() -> new NotFoundException(format("This rule does not exist: %s", key))); RuleUpdate ruleUpdate = ofNullable(rule.getTemplateId()) .map(x -> RuleUpdate.createForCustomRule(key)) .orElseGet(() -> RuleUpdate.createForPluginRule(key)); ruleUpdate.setOrganization(organization); return ruleUpdate; }
Source:
<code>public List<ChplJob> getAllJobs() throws SchedulerException { List<ChplJob> jobs = new ArrayList<ChplJob>(); Scheduler scheduler = getScheduler(); for (String group : scheduler.getJobGroupNames()) { for (JobKey jobKey : scheduler.getJobKeys(groupEquals(group))) { JobDetail jobDetail = scheduler.getJobDetail(jobKey); jobs.add(new ChplJob(jobDetail)); } } <START> Iterator<ChplJob> iterator = jobs.iterator(); <END> while (iterator.hasNext()) { if (!permissions.hasAccess( Permissions.SCHEDULER, SchedulerDomainPermissions.GET_ALL, iterator.next())) { iterator.remove(); } } return jobs; }</code><technical_language>I thought a problem PostFilter for surveillance stuff figured out. I remembering wrong is this a problem</technical_language>

Target:
public List<ChplJob> getAllJobs() throws SchedulerException { List<ChplJob> jobs = new ArrayList<ChplJob>(); Scheduler scheduler = getScheduler(); for (String group : scheduler.getJobGroupNames()) { for (JobKey jobKey : scheduler.getJobKeys(groupEquals(group))) { JobDetail jobDetail = scheduler.getJobDetail(jobKey); jobs.add(new ChplJob(jobDetail)); } } return jobs; }