auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void onRemove() { if (getProgress() != null) { return; } ArrayList<VdcActionParametersBase> list = new ArrayList<VdcActionParametersBase>(); for (DiskProfile profile : getProfiles()) { VdcActionParametersBase parameters = getRemoveDiskProfileParams(profile); list.add(parameters); } startProgress(null); Frontend.getInstance().runMultipleAction(VdcActionType.RemoveDiskProfile, list, new IFrontendMultipleActionAsyncCallback() { @Override public void executed(FrontendMultipleActionAsyncResult result) { stopProgress(); cancel(); } }, null); }

Target:
private void onRemove() { if (getProgress() != null) { return; } ArrayList<VdcActionParametersBase> vdcActionParametersBaseList = new ArrayList<VdcActionParametersBase>(); for (DiskProfile profile : getProfiles()) { VdcActionParametersBase parameters = getRemoveDiskProfileParams(profile); vdcActionParametersBaseList.add(parameters); } startProgress(null); Frontend.getInstance().runMultipleAction(VdcActionType.RemoveDiskProfile, vdcActionParametersBaseList, new IFrontendMultipleActionAsyncCallback() { @Override public void executed(FrontendMultipleActionAsyncResult result) { stopProgress(); cancel(); } }, null); }
Source:
public void ignoreCache(String cacheName) { Set<String> currentValue = stateCache.get(IGNORED_CACHES_KEY); Set<String> newValue = currentValue == null ? new HashSet<>() : currentValue; if (newValue.add(cacheName)) stateCache.put(IGNORED_CACHES_KEY, newValue); }

Target:
public CompletionStage<Void> ignoreCache(String cacheName) { return stateCache.put(IGNORED_CACHES_KEY, cacheName); }
Source:
private int getNumberOfExtractMethods() { List<Method> extractMethods = Arrays.asList(ReflectionUtils.getAllDeclaredMethods(JudgmentDataExtractor.class)).stream().filter(m->m.getName().startsWith("extract")).collect(Collectors.toList()); return extractMethods.size(); }

Target:
private long getNumberOfExtractMethods() { return Arrays.asList(ReflectionUtils.getAllDeclaredMethods(JudgmentDataExtractor.class)).stream().filter(m->m.getName().startsWith("extract")).count(); }
Source:
private void doAddNewStrategy() { final MergeStrategySection.SubmitType submitType; if (submitTypeBox.getSelectedIndex() >= 0) { submitType = MergeStrategySection.SubmitType.valueOf(submitTypeBox .getValue(submitTypeBox.getSelectedIndex())); } else { return; } final String refPattern = refPatternTxt.getText().trim(); if (!refPattern.isEmpty()) { final MergeStrategySection mergeStrategySection = new MergeStrategySection(refPattern); mergeStrategySection.setSubmitType(submitType); if (!mergeStrategies.addNew(mergeStrategySection)) { Window.alert(Util.C.errorPatternHasStrategy()); } refPatternTxt.setText(""); submitTypeBox.setSelectedIndex(0); } }

Target:
private void doAddNewStrategy() { final MergeStrategySection.SubmitType submitType; if (submitTypeBox.getSelectedIndex() >= 0) { submitType = MergeStrategySection.SubmitType.valueOf(submitTypeBox .getValue(submitTypeBox.getSelectedIndex())); } else { return; } final String refPattern = refPatternTxt.getText().trim(); if (!refPattern.isEmpty()) { final MergeStrategySection mergeStrategySection = new MergeStrategySection(refPattern); mergeStrategySection.setSubmitType(submitType); mergeStrategySection.setUseContentMerge(useContentMerge.getValue()); if (!mergeStrategies.addNew(mergeStrategySection)) { new ErrorDialog(Util.C.errorPatternHasStrategy()); } else { refPatternTxt.setText(""); submitTypeBox.setSelectedIndex(0); useContentMerge.setValue(false); useContentMerge.setEnabled(false); } } }
Source:
public void addMember(PDOMNode member, int visibility) throws CoreException { if (nextMemberPosition == MAX_MEMBER_COUNT) { PDOMCPPMemberBlock nextBlock = getNextBlock(); if (nextBlock == null) { nextBlock = new PDOMCPPMemberBlock(linkage); setNextBlock(nextBlock); } nextBlock.addMember(member, visibility); } else { long memberLocationOffset = getMemberRecord(nextMemberPosition); long rec = member != null ? member.getRecord() : 0; getDB().putRecPtr(memberLocationOffset, rec); setAccessibility(nextMemberPosition, visibility); nextMemberPosition++; } }

Target:
public void addMember(PDOMNode member, int visibility) throws CoreException { if (getNextPosition() == MAX_MEMBER_COUNT) { PDOMCPPMemberBlock nextBlock = getNextBlock(); if (nextBlock == null) { nextBlock = new PDOMCPPMemberBlock(linkage); setNextBlock(nextBlock); } nextBlock.addMember(member, visibility); } else { long memberLocationOffset = getMemberOffset(getNextPosition()); long rec = member.getRecord(); getDB().putRecPtr(memberLocationOffset, rec); setVisibility(getNextPosition(), visibility); nextMemberPosition++; } }
Source:
public HadoopPigJob(String jobid, Props sysProps, Props jobProps, Logger log) throws IOException { super(jobid, sysProps, jobProps, log); HADOOP_SECURE_PIG_WRAPPER = HadoopSecurePigWrapper.class.getName(); getJobProps().put("azkaban.job.id", jobid); shouldProxy = getSysProps().getBoolean("azkaban.should.proxy", false); getJobProps().put("azkaban.should.proxy", Boolean.toString(shouldProxy)); obtainTokens = getSysProps().getBoolean("obtain.binary.token", false); userPigJar = getJobProps().getBoolean("use.user.pig.jar", false); boolean obtainHcatToken = getJobProps().getBoolean(HadoopSecurityManager.OBTAIN_HCAT_TOKEN, false); getSysProps().put(HadoopSecurityManager.OBTAIN_HCAT_TOKEN, Boolean.toString(obtainHcatToken)); if (shouldProxy) { getLog().info("Initiating hadoop security manager."); try { hadoopSecurityManager = loadHadoopSecurityManager(getSysProps(), log); } catch (RuntimeException e) { throw new RuntimeException("Failed to get hadoop security manager!" + e); } } }

Target:
public HadoopPigJob(String jobid, Props sysProps, Props jobProps, Logger log) throws IOException { super(jobid, sysProps, jobProps, log); HADOOP_SECURE_PIG_WRAPPER = HadoopSecurePigWrapper.class.getName(); getJobProps().put("azkaban.job.id", jobid); shouldProxy = getSysProps().getBoolean("azkaban.should.proxy", false); getJobProps().put("azkaban.should.proxy", Boolean.toString(shouldProxy)); obtainTokens = getSysProps().getBoolean("obtain.binary.token", false); userPigJar = getJobProps().getBoolean("use.user.pig.jar", false); boolean obtainHcatToken = getSysProps().getBoolean(HadoopSecurityManager.OBTAIN_HCAT_TOKEN, false); obtainHcatToken = getJobProps().getBoolean(HadoopSecurityManager.OBTAIN_HCAT_TOKEN, obtainHcatToken); getSysProps().put(HadoopSecurityManager.OBTAIN_HCAT_TOKEN, Boolean.toString(obtainHcatToken)); if (shouldProxy) { getLog().info("Initiating hadoop security manager."); try { hadoopSecurityManager = loadHadoopSecurityManager(getSysProps(), log); } catch (RuntimeException e) { throw new RuntimeException("Failed to get hadoop security manager!" + e); } } }
Source:
private void assertAssignTaskProblemFactChangeWasProduced(AssignTaskProblemFactChange change, TaskAssigningSolution solution) { User internalUser = solution.getUserList().stream() .filter(user -> Objects.equals(user.getId(), change.getUser().getId())) .findFirst().orElse(null); assertNotNull(internalUser); Task internalTask = solution.getTaskList().stream() .filter(task -> Objects.equals(task.getId(), change.getTask().getId())) .findFirst().orElse(null); assertNotNull(internalTask); assertEquals(internalUser, internalTask.getUser()); assertTrue(internalTask.isPinned()); TaskOrUser previousTaskOrUser = internalTask.getPreviousTaskOrUser(); while (previousTaskOrUser != null) { if (previousTaskOrUser instanceof Task) { Task previousTask = (Task) previousTaskOrUser; assertTrue(previousTask.isPinned()); assertEquals(internalUser, previousTask.getUser()); previousTaskOrUser = previousTask.getPreviousTaskOrUser(); } else { assertEquals(internalUser, previousTaskOrUser); previousTaskOrUser = null; } } Task nextTask = internalTask.getNextTask(); while (nextTask != null) { assertEquals(internalUser, nextTask.getUser()); nextTask = nextTask.getNextTask(); } }

Target:
private void assertAssignTaskProblemFactChangeWasProduced(AssignTaskProblemFactChange change, TaskAssigningSolution solution) throws Exception { User internalUser = solution.getUserList().stream() .filter(user -> Objects.equals(user.getId(), change.getUser().getId())) .findFirst().orElseThrow(() -> new Exception("User: " + change.getUser() + " was not found in solution.")); Task internalTask = solution.getTaskList().stream() .filter(task -> Objects.equals(task.getId(), change.getTask().getId())) .findFirst().orElseThrow(() -> new Exception("Task: " + change + " was not found in solution.")); assertEquals(internalUser, internalTask.getUser()); assertTrue(internalTask.isPinned()); TaskOrUser previousTaskOrUser = internalTask.getPreviousTaskOrUser(); while (previousTaskOrUser != null) { if (previousTaskOrUser instanceof Task) { Task previousTask = (Task) previousTaskOrUser; assertTrue(previousTask.isPinned()); assertEquals(internalUser, previousTask.getUser()); previousTaskOrUser = previousTask.getPreviousTaskOrUser(); } else { assertEquals(internalUser, previousTaskOrUser); previousTaskOrUser = null; } } Task nextTask = internalTask.getNextTask(); while (nextTask != null) { assertEquals(internalUser, nextTask.getUser()); nextTask = nextTask.getNextTask(); } }
Source:
public int hashCode() { int result = getDimension().hashCode(); result = 31 * result + getUpper().hashCode(); result = 31 * result + getLower().hashCode(); result = 31 * result + (isLowerStrict() ? 1 : 0); result = 31 * result + (isUpperStrict() ? 1 : 0); result = 31 * result + (isAlphaNumeric() ? 1 : 0); return result; }

Target:
public int hashCode() { int result = getDimension().hashCode(); result = 31 * result + (getUpper() != null ? getUpper().hashCode() : 0); result = 31 * result + (getLower() != null ? getLower().hashCode() : 0); result = 31 * result + (isLowerStrict() ? 1 : 0); result = 31 * result + (isUpperStrict() ? 1 : 0); result = 31 * result + (isAlphaNumeric() ? 1 : 0); return result; }
Source:
protected int offset( long index ) { return toIntExact( rebase( index ) % entriesPerPage ) * entrySize; }

Target:
protected int offset( long index ) { return toIntExact( rebase( index ) % entriesPerPage * entrySize ); }
Source:
private void checkClusterApiSupported(ProtocolContext protocolCtx) throws ClientFeatureNotSupportedByServerException { if (!protocolCtx.isFeatureSupported(ProtocolVersionFeature.CLUSTER_API) && !protocolCtx.isFeatureSupported(ProtocolBitmaskFeature.CLUSTER_ADDITIONAL_STATES)) throw new ClientFeatureNotSupportedByServerException(ProtocolBitmaskFeature.CLUSTER_ADDITIONAL_STATES); }

Target:
private void checkClusterApiSupported(ProtocolContext protocolCtx) throws ClientFeatureNotSupportedByServerException { if (!protocolCtx.isFeatureSupported(ProtocolVersionFeature.CLUSTER_API) && !protocolCtx.isFeatureSupported(ProtocolBitmaskFeature.CLUSTER_STATES)) throw new ClientFeatureNotSupportedByServerException(ProtocolBitmaskFeature.CLUSTER_STATES); }
Source:
private void readStreamMessageIfNeeded() { final long lastNotConnectedLogThrottleSeconds = 5; if (isConnected()) { if (isInQueuesAvailable() || helper == null) { startReading(); } else { gatewayMetrics.updateInQueueFullCount(); stopReading(); } } else { long now = System.currentTimeMillis(); if (now - lastNotConnectedLogTime > lastNotConnectedLogThrottleSeconds * 5000) { LOG.info(String.format("Stop reading due to not yet connected to Stream Manager. This " + "message is throttled to emit no more than once every %d seconds.", lastNotConnectedLogThrottleSeconds)); lastNotConnectedLogTime = now; } } }

Target:
private void readStreamMessageIfNeeded() { final long lastNotConnectedLogThrottleSeconds = 5; if (isConnected()) { if (isInQueuesAvailable() || helper == null) { startReading(); } else { gatewayMetrics.updateInQueueFullCount(); stopReading(); } } else { long now = System.currentTimeMillis(); if (now - lastNotConnectedLogTime > lastNotConnectedLogThrottleSeconds * 1000) { LOG.info(String.format("Stop reading due to not yet connected to Stream Manager. This " + "message is throttled to emit no more than once every %d seconds.", lastNotConnectedLogThrottleSeconds)); lastNotConnectedLogTime = now; } } }
Source:
private VdcActionType(int value) { this(value, (ActionGroup) null); }

Target:
private VdcActionType(int value) { this(value, null, true, QuotaDependency.BOTH); }
Source:
public RequestTemplate create(Object[] argv) { RequestTemplate mutable = new RequestTemplate(metadata.template()); if (metadata.urlIndex() != null) { int urlIndex = metadata.urlIndex(); checkArgument(argv[urlIndex] != null, "URI parameter %s was null", urlIndex); mutable.insert(0, String.valueOf(argv[urlIndex])); } Map<String, Object> varBuilder = new LinkedHashMap<String, Object>(); for (Entry<Integer, Collection<String>> entry : metadata.indexToName().entrySet()) { int i = entry.getKey(); Object value = argv[entry.getKey()]; if (value != null) { if (indexToExpander.containsKey(i)) { value = expandElements(indexToExpander.get(i), value); } for (String name : entry.getValue()) { varBuilder.put(name, value); } } } RequestTemplate template = resolve(argv, mutable, varBuilder); if (metadata.queryMapIndex() != null) { boolean encoded = metadata.queryMapEncoded(); Object value = argv[metadata.queryMapIndex()]; Map<String, Object> queryMap = toQueryMap(value); template = addQueryMapQueryParameters(queryMap, template); } if (metadata.headerMapIndex() != null) { template = addHeaderMapHeaders((Map<String, Object>) argv[metadata.headerMapIndex()], template); } return template; }

Target:
public RequestTemplate create(Object[] argv) { RequestTemplate mutable = new RequestTemplate(metadata.template()); if (metadata.urlIndex() != null) { int urlIndex = metadata.urlIndex(); checkArgument(argv[urlIndex] != null, "URI parameter %s was null", urlIndex); mutable.insert(0, String.valueOf(argv[urlIndex])); } Map<String, Object> varBuilder = new LinkedHashMap<String, Object>(); for (Entry<Integer, Collection<String>> entry : metadata.indexToName().entrySet()) { int i = entry.getKey(); Object value = argv[entry.getKey()]; if (value != null) { if (indexToExpander.containsKey(i)) { value = expandElements(indexToExpander.get(i), value); } for (String name : entry.getValue()) { varBuilder.put(name, value); } } } RequestTemplate template = resolve(argv, mutable, varBuilder); if (metadata.queryMapIndex() != null) { Object value = argv[metadata.queryMapIndex()]; Map<String, Object> queryMap = toQueryMap(value); template = addQueryMapQueryParameters(queryMap, template); } if (metadata.headerMapIndex() != null) { template = addHeaderMapHeaders((Map<String, Object>) argv[metadata.headerMapIndex()], template); } return template; }
Source:
public static Map<String, String> getVariableMapByPrefix( Collection<Variable> variables, String prefix) { Map<String, String> shortlistMap = new HashMap<String, String>(); if (prefix != null) { for (Variable var : getVariablesByRegex(variables, "^" + prefix + ".+")) { shortlistMap .put(var.getTitle().replaceFirst(prefix, ""), var.getName()); } } return shortlistMap; }

Target:
public static Map<String, String> getVariableMapByPrefix( Collection<Variable> variables, String prefix) { Map<String, String> shortlistMap = new HashMap<String, String>(); if (variables!=null && prefix != null) { for (Variable var : getVariablesByRegex(variables, Reportal.REPORTAL_CONFIG_PREFIX_REGEX)) { shortlistMap .put(var.getTitle().replaceFirst(prefix, ""), var.getName()); } } return shortlistMap; }
Source:
public void insertIntoInstanceSet(final Object keyClass, final EObject value) { Set<EObject> set = instanceMap.get(keyClass); if (set == null) { set = new HashSet<EObject>(); instanceMap.put(keyClass, set); } if (!set.add(value)) { String msg = String.format("Notification received to index %s as a %s, but feature is already indexed. This indicates some errors in underlying model representation.", value, keyClass); logNotificationHandlingError(msg); } isDirty = true; navigationHelper.notifyInstanceListeners(keyClass, value, true); }

Target:
public void insertIntoInstanceSet(final Object keyClass, final EObject value) { Set<EObject> set = instanceMap.get(keyClass); if (set == null) { set = new HashSet<EObject>(); instanceMap.put(keyClass, set); } if (!set.add(value)) { String msg = String.format("Notification received to index %s as a %s, but it already exists in the index. This indicates some errors in underlying model representation.", value, keyClass); logNotificationHandlingError(msg); } isDirty = true; navigationHelper.notifyInstanceListeners(keyClass, value, true); }
Source:
public void testUrlCaching() throws Exception { if (!isHostReachable("www.random.org", 5000)) return; for (int i = 0; i < 100; i++) { Row row = new Row(2); row.setCell(0, new Cell(i < 5 ? "apple":"orange", null)); project.rows.add(row); } EngineDependentOperation op = new ColumnAdditionByFetchingURLsOperation(engine_config, "fruits", "\"<LINK_0>\"+value", OnError.StoreError, "rand", 1, 500, true); ProcessManager pm = project.getProcessManager(); Process process = op.createProcess(project, options); process.startPerforming(pm); Assert.assertTrue(process.isRunning()); try { Thread.sleep(5000); } catch (InterruptedException e) { Assert.fail("Test interrupted"); } String ref_val = (String)project.rows.get(0).getCellValue(1).toString(); if (ref_val.contains("HTTP error 403")) return; Assert.assertTrue(ref_val != "apple"); for (int i = 1; i < 4; i++) { System.out.println("value:" + project.rows.get(i).getCellValue(1)); Assert.assertEquals(project.rows.get(i).getCellValue(1).toString(), ref_val); } Assert.assertFalse(process.isRunning()); }

Target:
public void testUrlCaching() throws Exception { if (!isHostReachable("www.random.org", 5000)) return; for (int i = 0; i < 100; i++) { Row row = new Row(2); row.setCell(0, new Cell(i < 5 ? "apple":"orange", null)); project.rows.add(row); } EngineDependentOperation op = new ColumnAdditionByFetchingURLsOperation(engine_config, "fruits", "\"<LINK_0>\"+value", OnError.StoreError, "rand", 1, 500, true); ProcessManager pm = project.getProcessManager(); Process process = op.createProcess(project, options); process.startPerforming(pm); Assert.assertTrue(process.isRunning()); try { Thread.sleep(5000); } catch (InterruptedException e) { Assert.fail("Test interrupted"); } String ref_val = (String)project.rows.get(0).getCellValue(1).toString(); if (ref_val.startsWith("HTTP error")) return; Assert.assertTrue(ref_val != "apple"); for (int i = 1; i < 4; i++) { System.out.println("value:" + project.rows.get(i).getCellValue(1)); Assert.assertEquals(project.rows.get(i).getCellValue(1).toString(), ref_val); } Assert.assertFalse(process.isRunning()); }
Source:
public void testConnectionSuspendedHandling() throws Exception { String leaderAddress = "localhost"; LeaderElectionService leaderElectionService = ZooKeeperUtils.createLeaderElectionService(zooKeeperClient, config); TestingContender contender = new TestingContender(leaderAddress, leaderElectionService); leaderElectionService.start(contender); QueueLeaderElectionListener queueLeaderElectionListener = new QueueLeaderElectionListener(2, Duration.ofSeconds(1)); ZooKeeperLeaderRetrievalService testInstance = ZooKeeperUtils.createLeaderRetrievalService(zooKeeperClient, config); testInstance.start(queueLeaderElectionListener); CompletableFuture<String> firstAddress = queueLeaderElectionListener.next(); assertThat("The first result is expected to be the initially set leader address.", firstAddress.get(), is(leaderAddress)); stopTestServer(); CompletableFuture<String> secondAddress = queueLeaderElectionListener.next(); assertThat("The next result must not be missing.", secondAddress, not(is(nullValue()))); assertThat("The next result is expected to be null.", secondAddress.get(), is(nullValue())); }

Target:
public void testConnectionSuspendedHandling() throws Exception { String leaderAddress = "localhost"; LeaderElectionService leaderElectionService = ZooKeeperUtils.createLeaderElectionService(zooKeeperClient, config); TestingContender contender = new TestingContender(leaderAddress, leaderElectionService); leaderElectionService.start(contender); QueueLeaderElectionListener queueLeaderElectionListener = new QueueLeaderElectionListener(2); ZooKeeperLeaderRetrievalService testInstance = ZooKeeperUtils.createLeaderRetrievalService(zooKeeperClient, config); testInstance.start(queueLeaderElectionListener); CompletableFuture<String> firstAddress = queueLeaderElectionListener.next(); assertThat("The first result is expected to be the initially set leader address.", firstAddress.get(), is(leaderAddress)); stopTestServer(); CompletableFuture<String> secondAddress = queueLeaderElectionListener.next(); assertThat("The next result must not be missing.", secondAddress, is(notNullValue())); assertThat("The next result is expected to be null.", secondAddress.get(), is(nullValue())); }
Source:
public ParallelDownloadManager(DownloadConfig config, Downloader downloader) { this.config = config; this.unactionedQueue = new LinkedList<>(); this.inProgressQueue = new LinkedList<>(); this.downloader = downloader; pool = Executors.newFixedThreadPool(config.getPoolSize()); }

Target:
public ParallelDownloadManager(DownloadConfig config, Downloader downloader) { this.config = config; this.unactionedQueue = new LinkedList<>(); this.inProgressQueue = new LinkedList<>(); this.downloader = downloader; this.pool = Executors.newFixedThreadPool(config.getPoolSize()); }
Source:
private Geometry collectionClip(GeometryCollection geom) throws Exception { ArrayList<Geometry> result = new ArrayList<Geometry>(); for (int t = 0; t < geom.getNumGeometries(); t++) { Geometry g = geom.getGeometryN(0); Geometry clipped = _run(g); if ((clipped != null) && (!clipped.isEmpty())) result.add(clipped); } if (result.size() == 0) return null; return new GeometryCollection((Geometry[]) result.toArray(new Geometry[result.size()]), geom.getFactory()); }

Target:
private Geometry collectionClip(GeometryCollection geom) throws Exception { ArrayList<Geometry> result = new ArrayList<Geometry>(); for (int t = 0; t < geom.getNumGeometries(); t++) { Geometry g = geom.getGeometryN(0); Geometry clipped = _run(g); if ((clipped != null) && (!clipped.isEmpty())) { result.add(clipped); } } if (result.size() == 0) { return null; } return new GeometryCollection((Geometry[]) result.toArray(new Geometry[result.size()]), geom.getFactory()); }
Source:
public static Integer get(final String key) { if (key == null) { return R.drawable.acc_none; } return map.containsKey(key.toUpperCase(Locale.getDefault())) ? map.get(key.toUpperCase()) : R.drawable.acc_none; }

Target:
public static Integer get(final String key) { return map.containsKey(key.toUpperCase(Locale.getDefault())) ? map.get(key.toUpperCase()) : R.drawable.acc_none; }
Source:
protected List<CompletableFuture<List<ICompletionProposal>>> buildCompletionFuturesOrJobs(int invocationOffset) { Set<IContentAssistProcessor> processors = null; try { processors= fContentAssistant.getContentAssistProcessors(getTokenContentType(invocationOffset)); } catch (BadLocationException e) { } if (processors == null) { return Collections.emptyList(); } List<CompletableFuture<List<ICompletionProposal>>> futures = new ArrayList<>(processors.size()); for (IContentAssistProcessor processor : processors) { futures.add(CompletableFuture.supplyAsync(() -> { AtomicReference<List<ICompletionProposal>> result= new AtomicReference<>(); SafeRunner.run(new ISafeRunnable() { @Override public void run() throws Exception { ICompletionProposal[] proposals= processor.computeCompletionProposals(fViewer, invocationOffset); if (proposals == null) { result.set(Collections.emptyList()); } result.set(Arrays.asList(proposals)); } }); List<ICompletionProposal> proposals= result.get(); if (proposals == null) { return Collections.emptyList(); } return proposals; })); } return futures; }

Target:
protected List<CompletableFuture<List<ICompletionProposal>>> buildCompletionFuturesOrJobs(int invocationOffset) { Set<IContentAssistProcessor> processors = null; try { processors= fContentAssistant.getContentAssistProcessors(getTokenContentType(invocationOffset)); } catch (BadLocationException e) { } if (processors == null) { return Collections.emptyList(); } List<CompletableFuture<List<ICompletionProposal>>> futures = new ArrayList<>(processors.size()); for (IContentAssistProcessor processor : processors) { futures.add(CompletableFuture.supplyAsync(() -> { AtomicReference<List<ICompletionProposal>> result= new AtomicReference<>(); SafeRunner.run(new ISafeRunnable() { @Override public void run() throws Exception { ICompletionProposal[] proposals= processor.computeCompletionProposals(fViewer, invocationOffset); if (proposals == null) { result.set(Collections.emptyList()); } else { result.set(Arrays.asList(proposals)); } } }); List<ICompletionProposal> proposals= result.get(); if (proposals == null) { return Collections.emptyList(); } return proposals; })); } return futures; }
Source:
private void startConsumer() { try { mqChannel.basicConsume(queueName, false, consumerName, new DefaultConsumer(mqChannel) { @Override public void handleDelivery(String consumerTag, Envelope envelope, AMQP.BasicProperties properties, byte[] body) throws IOException { long deliveryTag = envelope.getDeliveryTag(); String message = new String(body); dispatch(message); log.debug("{} dispatched", message); mqChannel.basicAck(deliveryTag, false); log.debug("{} deleted", message); } @Override public void handleConsumeOk(String consumerTag) { log.info("Consumer registered: {}", consumerTag); initialized = true; } @Override public void handleCancel(String consumerTag) { log.debug("Consumer has been cancelled unexpectedly: " + consumerTag); } @Override public void handleCancelOk(String consumerTag) { log.info("Consumer has been cancelled successfully: " + consumerTag); } @Override public void handleShutdownSignal(String consumerTag, ShutdownSignalException sig) { log.debug("Either the channel or the underlying connection has been shut down" + " for consumer because {}", consumerTag, sig.getReason().toString()); initialized = false; } }); } catch (Exception e) { log.debug("Consumer failed to subscribe: " + e.getMessage(), e); initialized = false; } }

Target:
private void startConsumer() { try { mqChannel.basicConsume(queueName, false, consumerName, new DefaultConsumer(mqChannel) { @Override public void handleDelivery(String consumerTag, Envelope envelope, AMQP.BasicProperties properties, byte[] body) throws IOException { long deliveryTag = envelope.getDeliveryTag(); String message = new String(body); dispatch(message); log.debug("{} dispatched", message); mqChannel.basicAck(deliveryTag, false); log.debug("{} deleted", message); } @Override public void handleConsumeOk(String consumerTag) { log.info("Consumer registered: {}", consumerTag); initialized = true; } @Override public void handleCancel(String consumerTag) { log.warn("Consumer has been cancelled unexpectedly: " + consumerTag); } @Override public void handleCancelOk(String consumerTag) { log.info("Consumer has been cancelled successfully: " + consumerTag); } @Override public void handleShutdownSignal(String consumerTag, ShutdownSignalException sig) { log.warn("Either the channel or the underlying connection has been shut down" + " for consumer because {}", consumerTag, sig.getReason().toString()); initialized = false; } }); } catch (Exception e) { log.error("Consumer failed to subscribe: " + e.getMessage(), e); initialized = false; } }
Source:
public static void playSoundAtLocationExcept(Location location, Sound sound, float volume, float pitch, GlowPlayer... exclude) { if (location == null || sound == null) return; GlowWorld world = (GlowWorld) location.getWorld(); double radiusSquared = Math.pow(volume * 16, 2); world.getRawPlayers().stream().filter(player -> player.getLocation().distanceSquared(location) <= radiusSquared).filter(player -> !Arrays.asList(exclude).contains(player)).forEach(player -> player.playSound(location, sound, volume, pitch)); }

Target:
public static void playSoundAtLocationExcept(Location location, Sound sound, float volume, float pitch, GlowPlayer... exclude) { if (location == null || sound == null) return; GlowWorld world = (GlowWorld) location.getWorld(); double radiusSquared = volume * volume * 256; world.getRawPlayers().parallelStream().filter(player -> player.getLocation().distanceSquared(location) <= radiusSquared).filter(player -> !Arrays.asList(exclude).contains(player)).forEach(player -> player.playSound(location, sound, volume, pitch)); }
Source:
private static void verifyThreadsNumberParameter(CommandLine cmdLine, List<String> result, String cliParameterName, String mustBeGreaterThanZeroMessage, String invalidNumberMessage) { if (cmdLine.hasOption(cliParameterName)) { final String checkerThreadsNumberStr = cmdLine.getOptionValue(cliParameterName); try { final int checkerThreadsNumber = Integer.parseInt(checkerThreadsNumberStr); if (checkerThreadsNumber < 1) { result.add(mustBeGreaterThanZeroMessage); } } catch (NumberFormatException ignored) { result.add(invalidNumberMessage); } } }

Target:
private static void verifyThreadsNumberParameter(CommandLine cmdLine, List<String> result, String cliParameterName, String mustBeGreaterThanZeroMessage, String invalidNumberMessage) { if (cmdLine.hasOption(cliParameterName)) { final String checkerThreadsNumberStr = cmdLine.getOptionValue(cliParameterName); if (CommonUtils.isInt(checkerThreadsNumberStr)) { final int checkerThreadsNumber = Integer.parseInt(checkerThreadsNumberStr); if (checkerThreadsNumber < 1) { result.add(mustBeGreaterThanZeroMessage); } } else { result.add(invalidNumberMessage); } } }
Source:
public void update(TableDescriptor td, boolean cacheOnly) throws IOException { if (fsreadonly) { throw new UnsupportedOperationException("Cannot add a table descriptor - in read only mode"); } if (!cacheOnly) { updateTableDesciptor(td); } if (usecache) { this.cache.put(td.getTableName(), td); } }

Target:
public void update(TableDescriptor td, boolean cacheOnly) throws IOException { if (fsreadonly) { throw new UnsupportedOperationException("Cannot add a table descriptor - in read only mode"); } if (!cacheOnly) { updateTableDescriptor(td); } if (usecache) { this.cache.put(td.getTableName(), td); } }
Source:
public String[] getConflictingIds(TaskEditorInput input) { List<String> conflictingIds = ImmutableList.of(ITasksUiConstants.ID_PAGE_PLANNING); @SuppressWarnings("restriction") String artifactFlag = input.getTask().getAttribute(ITasksCoreConstants.ATTRIBUTE_ARTIFACT); if (Boolean.parseBoolean(artifactFlag)) { final String CONTEXT_PAGE = "org.eclipse.mylyn.context.ui"; conflictingIds.add(CONTEXT_PAGE); } return conflictingIds.toArray(new String[conflictingIds.size()]); }

Target:
public String[] getConflictingIds(TaskEditorInput input) { @SuppressWarnings("restriction") String isArtifact = input.getTask() .getAttribute(org.eclipse.mylyn.internal.tasks.core.ITasksCoreConstants.ATTRIBUTE_ARTIFACT); if (Boolean.parseBoolean(isArtifact)) { return new String[] { ITasksUiConstants.ID_PAGE_PLANNING, "org.eclipse.mylyn.context.ui" }; } return new String[] { ITasksUiConstants.ID_PAGE_PLANNING }; }
Source:
public void copyObject(String bucketName, String objectName, String destBucketName, CopyConditions copyConditions) throws InvalidKeyException, InvalidBucketNameException, NoSuchAlgorithmException, InsufficientDataException, NoResponseException, ErrorResponseException, InternalException, IOException, XmlPullParserException, InvalidArgumentException { String destObjectName = objectName; String sourceObjectPath = S3Escaper.encode(Paths.get(bucketName, objectName).toString()); copyObjectResult(destBucketName, destObjectName, sourceObjectPath, copyConditions); }

Target:
public void copyObject(String bucketName, String objectName, String destBucketName, CopyConditions copyConditions) throws InvalidKeyException, InvalidBucketNameException, NoSuchAlgorithmException, InsufficientDataException, NoResponseException, ErrorResponseException, InternalException, IOException, XmlPullParserException, InvalidArgumentException { copyObject(bucketName, objectName, destBucketName, null, copyConditions); }
Source:
public void get(String url) { String host = null; try { host = new URL(url).getHost(); } catch (MalformedURLException e) { e.printStackTrace(); } if (host != null && ("localhost" .equals(host) || "127.0.0.1" .equals(host))) { if (isSetBrowserStackLocal && !isSetBrowserStackLocalManaged) { log.info( "To test against localhost and other locations behind your firewall, you need to run a BrowserStackLocal binary. " + "You can ignore this if you have already started it, otherwise see browserstack.com/local-testing"); } } super.get(url); }

Target:
public void get(String url) { String host = null; try { host = new URL(url).getHost(); } catch (MalformedURLException e) { log.warning( "The url " + url + " has been detected as a malformed URL. The message of the exception: " + e .getMessage()); } if (host != null && (host.equals("localhost") || host.equals("127.0.0.1"))) { if (isSetBrowserStackLocal && !isSetBrowserStackLocalManaged) { log.info( "To test against localhost and other locations behind your firewall, you need to run a BrowserStackLocal binary. " + "You can ignore this if you have already started it, otherwise see browserstack.com/local-testing"); } } super.get(url); }
Source:
public void verifyRead() { String feedURL2 = SimpleHttpServer.getInstance().start("foo2", HttpStatus.SC_OK, ATOM_FEED_DATA_2); when(feedRecordDataService.findByURL(feedURL)).thenReturn(new FeedRecord(feedURL, ATOM_FEED_DATA)); when(feedRecordDataService.findByURL(feedURL2)).thenReturn(new FeedRecord(feedURL2, ATOM_FEED_DATA_2)); ArgumentCaptor<MotechEvent> event = ArgumentCaptor.forClass(MotechEvent.class); atomClientService.read(feedURL, feedURL2); verify(eventRelay, times(0)).sendEventMessage(event.capture()); }

Target:
public void verifyRead() { String feedURL2 = SimpleHttpServer.getInstance().start("foo2", HttpStatus.SC_OK, ATOM_FEED_DATA_2); when(feedRecordDataService.findByURL(feedURL)).thenReturn(new FeedRecord(feedURL, ATOM_FEED_DATA)); when(feedRecordDataService.findByURL(feedURL2)).thenReturn(new FeedRecord(feedURL2, ATOM_FEED_DATA_2)); atomClientService.read(feedURL, feedURL2); verify(atomClientConfigService).readNewFeeds(35, 36, feedURL); }
Source:
public static List<Map.Entry<Long, byte[]>> decode(ListIterator<ClientMessage.Frame> iterator) { List<Long> listK = ListLongCodec.decode(iterator); List<byte[]> listV = ListMultiFrameCodec.decode(iterator, ByteArrayCodec::decode); List<Map.Entry<Long, byte[]>> result = new ArrayList<>(listK.size()); for (int i = 0; i < listK.size(); i++) { result.add(new AbstractMap.SimpleEntry<>(listK.get(i), listV.get(i))); } return result; }

Target:
public static List<Map.Entry<Long, byte[]>> decode(ListIterator<ClientMessage.Frame> iterator) { List<byte[]> listV = ListMultiFrameCodec.decode(iterator, ByteArrayCodec::decode); List<Long> listK = ListLongCodec.decode(iterator); List<Map.Entry<Long, byte[]>> result = new ArrayList<>(listK.size()); for (int i = 0; i < listK.size(); i++) { result.add(new AbstractMap.SimpleEntry<>(listK.get(i), listV.get(i))); } return result; }
Source:
private AbstractExpression parseAggregationExpression(VoltXMLElement exprNode) { String type = exprNode.attributes.get("optype"); String user_aggregate_id = exprNode.attributes.get("user_aggregate_id"); String function_name = exprNode.attributes.get("name"); ExpressionType exprType = ExpressionType.get(type); if (exprType == ExpressionType.INVALID) { throw new PlanningErrorException("Unsupported aggregation type '" + type + "'"); } assert(exprNode.children.size() <= 1); VoltXMLElement childExprNode = exprNode.children.get(0); assert(childExprNode != null); AbstractExpression childExpr = parseExpressionNode(childExprNode); if (childExpr == null) { assert(exprType == ExpressionType.AGGREGATE_COUNT); exprType = ExpressionType.AGGREGATE_COUNT_STAR; } AggregateExpression expr = new AggregateExpression(exprType, user_aggregate_id, function_name); expr.setLeft(childExpr); String node; if ((node = exprNode.attributes.get("distinct")) != null && Boolean.parseBoolean(node)) { expr.setDistinct(); } if (m_aggregationList != null) { ExpressionUtil.finalizeValueTypes(expr); m_aggregationList.add(expr); } return expr; }

Target:
private AbstractExpression parseAggregationExpression(VoltXMLElement exprNode) { String type = exprNode.attributes.get("optype"); String tempId = exprNode.attributes.get("user_aggregate_id"); int userAggregateId = tempId == null ? -1 : Integer.parseInt(tempId); String functionName = exprNode.attributes.get("name"); ExpressionType exprType = ExpressionType.get(type); if (exprType == ExpressionType.INVALID) { throw new PlanningErrorException("Unsupported aggregation type '" + type + "'"); } assert(exprNode.children.size() <= 1); VoltXMLElement childExprNode = exprNode.children.get(0); assert(childExprNode != null); AbstractExpression childExpr = parseExpressionNode(childExprNode); if (childExpr == null) { assert(exprType == ExpressionType.AGGREGATE_COUNT); exprType = ExpressionType.AGGREGATE_COUNT_STAR; } AggregateExpression expr = new AggregateExpression(exprType, userAggregateId, functionName); expr.setLeft(childExpr); String node; if ((node = exprNode.attributes.get("distinct")) != null && Boolean.parseBoolean(node)) { expr.setDistinct(); } if (m_aggregationList != null) { ExpressionUtil.finalizeValueTypes(expr); m_aggregationList.add(expr); } return expr; }
Source:
public void onCastStateChanged(int newState) { try { if (isInForeground()) { if (mediaRouteMenuItem != null) { googleCastDelegate.showIntroductoryOverlay(this, mediaRouteMenuItem); } invalidateOptionsMenu(); } } catch (Exception e) { logger.error(e); } }

Target:
public void onCastStateChanged(int newState) { try { if (isInForeground()) { if (mediaRouteMenuItem != null) { googleCastDelegate.showIntroductoryOverlay(this, mediaRouteMenuItem); } invalidateOptionsMenu(); } } catch (Exception e) { logger.error(e, true); } }
Source:
public QueryResult getInfoForPostion(String contig, int pos, String alt) throws IOException { String queryStr = contig + ":" + pos + "-" + (pos); try { TabixReader.Iterator iter = reader.query(queryStr); if(iter != null) { String str = iter.next(); while(str != null) { String[] toks = str.split("\t"); Integer qPos = Integer.parseInt(toks[1]); String ALT = toks[3]; String overall = toks[4]; if (qPos == pos && ALT.equals(alt) && overall.equals("overall")) { String sampleTotalStr = toks[5]; String hetsFoundStr = toks[6]; String homsFoundStr = toks[7]; double totalSamples = Double.parseDouble(sampleTotalStr); double overallHets = Double.parseDouble(hetsFoundStr); double overallHoms = Double.parseDouble(homsFoundStr); double overallAF = (overallHets + 2.0*overallHoms)/(double)(2.0*totalSamples); String details = "Samples: " + (int)totalSamples + " Hets: " + (int)overallHets + " Homs: " + (int)overallHoms; QueryResult result = new QueryResult(); result.overallFreq = overallAF; result.totHets = overallHets; result.totHoms = overallHoms; result.totSamples = totalSamples; result.details = details; return result; } if (qPos > pos) { break; } str = iter.next(); } } } catch (RuntimeException rex) { } return null; }

Target:
public QueryResult getInfoForPostion(String contig, int pos, String alt) throws IOException { String queryStr = contig + ":" + pos + "-" + (pos); try { TabixReader.Iterator iter = reader.query(queryStr); if(iter != null) { String str = iter.next(); while(str != null) { String[] toks = str.split("\t"); Integer qPos = Integer.parseInt(toks[1]); String qAlt = toks[3]; String overall = toks[4]; if (qPos == pos && qAlt.equals(alt) && overall.equals("overall")) { String sampleTotalStr = toks[5]; String hetsFoundStr = toks[6]; String homsFoundStr = toks[7]; double totalSamples = Double.parseDouble(sampleTotalStr); double overallHets = Double.parseDouble(hetsFoundStr); double overallHoms = Double.parseDouble(homsFoundStr); double overallAF = (overallHets + 2.0*overallHoms)/(double)(2.0*totalSamples); String details = "Samples: " + (int)totalSamples + " Hets: " + (int)overallHets + " Homs: " + (int)overallHoms; QueryResult result = new QueryResult(); result.overallFreq = overallAF; result.totHets = overallHets; result.totHoms = overallHoms; result.totSamples = totalSamples; result.details = details; return result; } if (qPos > pos) { break; } str = iter.next(); } } } catch (RuntimeException rex) { } return null; }
Source:
public static void startSession(List<IResource> resources, final List<JID> contacts) { projectAPI.saveAllDocuments(); final Map<IProject, List<IResource>> newResources = acquireResources( resources, null); UIMonitoredJob sessionStartupJob = new UIMonitoredJob( "Session Startup") { @Override protected IStatus run(IProgressMonitor monitor) { monitor .beginTask("Starting session...", IProgressMonitor.UNKNOWN); try { sessionManager.startSession(newResources); Set<JID> participantsToAdd = new HashSet<JID>(contacts); monitor.worked(50); ISarosSession session = sessionManager.getSession(); if (session == null) { return Status.CANCEL_STATUS; } monitor.setTaskName("Inviting participants..."); sessionManager.invite(participantsToAdd, getShareProjectDescription(session)); monitor.done(); } catch (Exception e) { LOG.error("could not start a Saros session", e); return new Status(IStatus.ERROR, SarosComponent.PLUGIN_ID, e.getMessage(), e); } return Status.OK_STATUS; } }; sessionStartupJob.schedule(); }

Target:
public static void startSession(List<IResource> resources, final List<JID> contacts) { final Map<IProject, List<IResource>> newResources = acquireResources( resources, null); UIMonitoredJob sessionStartupJob = new UIMonitoredJob( "Session Startup") { @Override protected IStatus run(IProgressMonitor monitor) { monitor .beginTask("Starting session...", IProgressMonitor.UNKNOWN); try { sessionManager.startSession(newResources); Set<JID> participantsToAdd = new HashSet<JID>(contacts); monitor.worked(50); ISarosSession session = sessionManager.getSession(); if (session == null) { return Status.CANCEL_STATUS; } monitor.setTaskName("Inviting participants..."); sessionManager.invite(participantsToAdd, getShareProjectDescription(session)); monitor.done(); } catch (Exception e) { LOG.error("could not start a Saros session", e); return new Status(IStatus.ERROR, SarosComponent.PLUGIN_ID, e.getMessage(), e); } return Status.OK_STATUS; } }; sessionStartupJob.schedule(); }
Source:
private Guid getTargetClusterId(Action action) { if (action.isSetCluster() && (action.getCluster().isSetId() || action.getCluster().isSetName())) { return getClusterId(action); } return null; }

Target:
private Guid getTargetClusterId(Action action) { if (action.isSetCluster()) { return getClusterId(action); } return null; }
Source:
public List<TopicPartition> getFilteredTopicPartitions(KafkaConsumer<?, ?> consumer) { List<TopicPartition> allPartitions = new ArrayList<>(); for (String topic : topics) { if(consumer.partitionsFor(topic) != null) { for (PartitionInfo partitionInfo : consumer.partitionsFor(topic)) { allPartitions.add(new TopicPartition(partitionInfo.topic(), partitionInfo.partition())); } } else { LOG.warn("Topic not found, skipping addition of the topic", topic); } } return allPartitions; }

Target:
public List<TopicPartition> getFilteredTopicPartitions(KafkaConsumer<?, ?> consumer) { List<TopicPartition> allPartitions = new ArrayList<>(); for (String topic : topics) { List<PartitionInfo> partitionInfoList = consumer.partitionsFor(topic); if(partitionInfoList != null) { for (PartitionInfo partitionInfo : partitionInfoList) { allPartitions.add(new TopicPartition(partitionInfo.topic(), partitionInfo.partition())); } } else { LOG.warn("Topic not found, skipping addition of the topic", topic); } } return allPartitions; }
Source:
public void testImport2BKMs() { DMNRuntime runtime = DMNRuntimeUtil.createRuntimeWithAdditionalResources("Do_say_hello_with_2_bkms.dmn", this.getClass(), "Saying_hello_2_bkms.dmn"); DMNModel importedModel = runtime.getModel("<LINK_0>", "Saying hello 2 bkms"); assertThat(importedModel, notNullValue()); for (DMNMessage message : importedModel.getMessages()) { LOG.debug("{}", message); } DMNModel dmnModel = runtime.getModel("<LINK_1>", "Do say hello with 2 bkms"); assertThat(dmnModel, notNullValue()); for (DMNMessage message : dmnModel.getMessages()) { LOG.debug("{}", message); } DMNContext context = runtime.newContext(); context.set("Person name", "John"); DMNResult evaluateAll = runtime.evaluateAll(dmnModel, context); for (DMNMessage message : evaluateAll.getMessages()) { LOG.debug("{}", message); } LOG.debug("{}", evaluateAll); assertThat(evaluateAll.getDecisionResultByName("Say hello decision").getResult(), is("Hello, John")); assertThat(evaluateAll.getDecisionResultByName("what about hello").getResult(), is("Hello")); }

Target:
public void testImport2BKMs() { DMNRuntime runtime = DMNRuntimeUtil.createRuntimeWithAdditionalResources("Do_say_hello_with_2_bkms.dmn", this.getClass(), "Saying_hello_2_bkms.dmn"); DMNModel importedModel = runtime.getModel("<LINK_0>", "Saying hello 2 bkms"); assertThat(importedModel, notNullValue()); assertThat(DMNRuntimeUtil.formatMessages(importedModel.getMessages()), importedModel.hasErrors(), is(false)); DMNModel dmnModel = runtime.getModel("<LINK_1>", "Do say hello with 2 bkms"); assertThat(dmnModel, notNullValue()); assertThat(DMNRuntimeUtil.formatMessages(dmnModel.getMessages()), dmnModel.hasErrors(), is(false)); DMNContext context = runtime.newContext(); context.set("Person name", "John"); DMNResult evaluateAll = runtime.evaluateAll(dmnModel, context); assertThat(DMNRuntimeUtil.formatMessages(evaluateAll.getMessages()), evaluateAll.hasErrors(), is(false)); LOG.debug("{}", evaluateAll); assertThat(evaluateAll.getDecisionResultByName("Say hello decision").getResult(), is("Hello, John")); assertThat(evaluateAll.getDecisionResultByName("what about hello").getResult(), is("Hello")); }
Source:
private void setChargedThroughDates(final Invoice invoice, final InternalCallContext context) throws SubscriptionBaseApiException { final Collection<InvoiceItem> fixedPriceItems = new LinkedList<InvoiceItem>(); final Collection<InvoiceItem> recurringItems = new LinkedList<InvoiceItem>(); for (final InvoiceItem invoiceItem : invoice.getInvoiceItems()) { switch (invoiceItem.getInvoiceItemType()) { case FIXED: fixedPriceItems.add(invoiceItem); break; case RECURRING: recurringItems.add(invoiceItem); break; default: break; } } final Map<UUID, DateTime> chargeThroughDates = new HashMap<UUID, DateTime>(); addInvoiceItemsToChargeThroughDates(chargeThroughDates, fixedPriceItems, context); addInvoiceItemsToChargeThroughDates(chargeThroughDates, recurringItems, context); for (final UUID subscriptionId : chargeThroughDates.keySet()) { if (subscriptionId != null) { final DateTime chargeThroughDate = chargeThroughDates.get(subscriptionId); subscriptionApi.setChargedThroughDate(subscriptionId, chargeThroughDate, context); } } }

Target:
private void setChargedThroughDates(final Invoice invoice, final InternalCallContext context) throws SubscriptionBaseApiException { final Collection<InvoiceItem> invoiceItemsToConsider = new LinkedList<InvoiceItem>(); for (final InvoiceItem invoiceItem : invoice.getInvoiceItems()) { switch (invoiceItem.getInvoiceItemType()) { case FIXED: case RECURRING: case USAGE: invoiceItemsToConsider.add(invoiceItem); break; default: break; } } final Map<UUID, DateTime> chargeThroughDates = new HashMap<UUID, DateTime>(); addInvoiceItemsToChargeThroughDates(chargeThroughDates, invoiceItemsToConsider, context); for (final UUID subscriptionId : chargeThroughDates.keySet()) { if (subscriptionId != null) { final DateTime chargeThroughDate = chargeThroughDates.get(subscriptionId); subscriptionApi.setChargedThroughDate(subscriptionId, chargeThroughDate, context); } } }
Source:
protected void validate(Element element, ElementValidation validation) { super.validate(element, validation); validatorHelper.param.inOrder() .type(CanonicalNameConstants.VIEW_PAGER).optional() .primitiveOrWrapper(TypeKind.INT).optional() .validate((ExecutableElement) element, validation); }

Target:
protected void validate(Element element, ElementValidation validation) { super.validate(element, validation); validatorHelper.param.anyOrder() .type(CanonicalNameConstants.VIEW_PAGER).optional() .primitiveOrWrapper(TypeKind.INT).optional() .validate((ExecutableElement) element, validation); }