auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void apply(final Project project) { project.getTasks().create("release"); final ReleaseWorkflowExtension ext = project.getExtensions().create("releaseWorkflow", ReleaseWorkflowExtension.class, project); project.getGradle().addListener(new TaskExecutionListener() { public void beforeExecute(Task task) public void afterExecute(Task task, TaskState taskState) { if (taskState.getFailure() != null && ext.steps.contains(task)) { for (Task rollback : ext.rollbacks) { rollback.setEnabled(true); } } } }); GitTool gitTool = Git.gitTool(Exec.getProcessRunner(project.getProjectDir())); project.getExtensions().getExtraProperties().set("gitTool", gitTool); }

Target:
public void apply(final Project project) { project.getTasks().create("release"); final ReleaseWorkflowExtension ext = project.getExtensions().create("releaseWorkflow", ReleaseWorkflowExtension.class, project); project.getGradle().addListener(new PostStepTaskEnabler(ext)); GitTool gitTool = Git.gitTool(Exec.getProcessRunner(project.getProjectDir())); project.getExtensions().getExtraProperties().set("gitTool", gitTool); }
Source:
private void initializeMacPool(org.ovirt.engine.core.common.businessentities.MacPool macPool) { List<String> macsForMacPool = macPoolDao.getAllMacsForMacPool(macPool.getId()); final MacPool pool = createPoolInternal(macPool); log.debug("Initializing with macs: {}", pool, macsForMacPool); pool.addMacs(macsForMacPool); }

Target:
private void initializeMacPool(org.ovirt.engine.core.common.businessentities.MacPool macPool) { List<String> macsForMacPool = macPoolDao.getAllMacsForMacPool(macPool.getId()); final MacPool pool = createPoolInternal(macPool); log.debug("Initializing with macs: {}", pool, macsForMacPool); List<String> notAddedMacs = pool.addMacs(macsForMacPool); if (!notAddedMacs.isEmpty()) { throw new EngineException(EngineError.MAC_POOL_INITIALIZATION_FAILED, "Unable to initialize MAC pool due to existing duplicates"); } }
Source:
public DiskImage getDiskImageByDiskAndImageIds(Guid diskId, Guid imageId) { MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource() .addValue("disk_id", diskId) .addValue("image_id", imageId); return getCallsHandler().executeRead("GetDiskImageByDiskAndImageIds", DiskImageRowMapper.instance, parameterSource); }

Target:
public DiskImage getDiskImageByDiskAndImageIds(Guid diskId, Guid imageId) { return getDiskImageByDiskAndImageIds(diskId, imageId, null, false); }
Source:
public void deleteEntriesUsingCachePolicy(int numRowsToDelete) { try { IndexEventHolder indexEventHolder = (IndexEventHolder) stateHolder.getState().getEventHolder(); Set<Object> keys = indexEventHolder.getAllPrimaryKeyValues(); int[] minCountArray = new int[numRowsToDelete]; Arrays.fill(minCountArray, Integer.MAX_VALUE); Object[] keyOfMinCountArray = new Object[numRowsToDelete]; for (Object key: keys) { Object[] data = indexEventHolder.getEvent(key).getOutputData(); int count = (int) data[cachePolicyAttributePosition]; for (int i = 0; i < numRowsToDelete; i++) { if (count < minCountArray[i]) { minCountArray[i] = count; keyOfMinCountArray[i] = key; } } } for (Object deleteKey: keyOfMinCountArray) { if (deleteKey != null) { indexEventHolder.deleteEvent(deleteKey); } } } catch (ClassCastException e) { log.error(siddhiAppContext + ": " + e.getMessage()); } }

Target:
public void deleteEntriesUsingCachePolicy(int numRowsToDelete) { IndexEventHolder indexEventHolder = (IndexEventHolder) stateHolder.getState().getEventHolder(); if (numRowsToDelete >= indexEventHolder.size()) { indexEventHolder.deleteAll(); } else { Set<Object> keys = indexEventHolder.getAllPrimaryKeyValues(); TreeMap<Integer, Object> toDelete = new TreeMap<>(); for (Object key : keys) { if (toDelete.size() < numRowsToDelete) { toDelete.put((Integer) indexEventHolder.getEvent(key).getOutputData()[cachePolicyAttributePosition], key); } else { Integer count = (Integer) indexEventHolder.getEvent(key). getOutputData()[cachePolicyAttributePosition]; Integer firstKey = toDelete.firstKey(); if (count < firstKey) { toDelete.remove(firstKey); toDelete.put(count, key); } } } for (Object deleteKey: toDelete.values()) { if (deleteKey != null) { indexEventHolder.deleteEvent(deleteKey); } } } }
Source:
public Socket createTunnelServerSocket(String targethost, Socket socket) throws IOException { InetAddress listeningAddress = socket.getInetAddress(); SSLSocket s = (SSLSocket) getTunnelSSLSocketFactory(targethost, listeningAddress).createSocket(socket, socket .getInetAddress().getHostAddress(), socket.getPort(), true); s.setUseClientMode(false); s.startHandshake(); return s; }

Target:
public Socket createTunnelServerSocket(String targethost, Socket socket) throws IOException { InetAddress listeningAddress = socket.getLocalAddress(); SSLSocket s = (SSLSocket) getTunnelSSLSocketFactory(targethost, listeningAddress).createSocket(socket, socket .getInetAddress().getHostAddress(), socket.getPort(), true); s.setUseClientMode(false); s.startHandshake(); return s; }
Source:
public boolean equals(Object obj) { if (this == obj) { return true; } if (!(obj instanceof NetworkCluster)) { return false; } NetworkCluster other = (NetworkCluster) obj; return display == other.display && Objects.equals(status, other.status) && Objects.equals(id, other.id) && required == other.required && Objects.equals(migration, other.migration) && Objects.equals(management, other.management) && Objects.equals(gluster, other.gluster); }

Target:
public boolean equals(Object obj) { if (this == obj) { return true; } if (!(obj instanceof NetworkCluster)) { return false; } NetworkCluster other = (NetworkCluster) obj; return display == other.display && status == other.status && Objects.equals(id, other.id) && required == other.required && migration == other.migration && management == other.management && gluster == other.gluster; }
Source:
private Object deleteObjects(Environment context) { if (context.data.isPresent()) { throw new BadRequestException("DELETE must not include data argument"); } if (!context.ids.isPresent()) { throw new BadRequestException("DELETE must include ids argument"); } ConnectionContainer connection = (ConnectionContainer) fetchObjects(context); Set<PersistentResource> toDelete = connection.getPersistentResources(); toDelete.forEach(PersistentResource::deleteResource); return new ConnectionContainer( Sets.difference(connection.getPersistentResources(), toDelete), Optional.empty(), connection.getTypeName() ); }

Target:
private Object deleteObjects(Environment context) { if (context.data.isPresent()) { throw new BadRequestException("DELETE must not include data argument"); } if (!context.ids.isPresent()) { throw new BadRequestException("DELETE must include ids argument"); } ConnectionContainer connection = (ConnectionContainer) fetchObjects(context); Set<PersistentResource> toDelete = connection.getPersistentResources(); toDelete.forEach(PersistentResource::deleteResource); return new ConnectionContainer( Collections.emptySet(), Optional.empty(), connection.getTypeName() ); }
Source:
public DefaultLocalPersistenceService(final PersistenceConfiguration persistenceConfiguration) { if(persistenceConfiguration != null) { rootDirectory = persistenceConfiguration.getRootDirectory(); } else { throw new IllegalArgumentException("PersistenceConfiguration cannot be null"); } diskStorePathManager = new DiskStorePathManager(rootDirectory.getAbsolutePath()); }

Target:
public DefaultLocalPersistenceService(final PersistenceConfiguration persistenceConfiguration) { if(persistenceConfiguration != null) { rootDirectory = persistenceConfiguration.getRootDirectory(); } else { throw new NullPointerException("PersistenceConfiguration cannot be null"); } diskStorePathManager = new DiskStorePathManager(rootDirectory.getAbsolutePath()); }
Source:
private static File[] getFilesInFolderByRegex(File folder, final String regex) throws FileNotFoundException { if (!folder.exists()) { throw new FileNotFoundException(); } if (!folder.isDirectory()) { throw new IllegalStateException( "execution jar is suppose to be in this folder, but the object present is not a directory: " + folder); } File[] matchingFiles = folder.listFiles(new FilenameFilter() { @Override public boolean accept(File dir, String name) { if (name.matches(regex)) return true; else return false; } }); if (matchingFiles == null) { throw new IllegalStateException( "the ls command in ResolveExecutionJarName threw an IOException"); } return matchingFiles; }

Target:
private static File[] getFilesInFolderByRegex(File folder, final String regex) throws FileNotFoundException { if (!folder.exists()) { throw new FileNotFoundException(); } if (!folder.isDirectory()) { throw new IllegalStateException( "execution jar is suppose to be in this folder, but the object present is not a directory: " + folder); } File[] matchingFiles = folder.listFiles(new FilenameFilter() { @Override public boolean accept(File dir, String name) { if (name.matches(regex)) return true; else return false; } }); if (matchingFiles == null) { throw new IllegalStateException( "the File[] matchingFiles variable is null. This means an IOException occured while doing listFiles. Please check disk availability and retry again"); } return matchingFiles; }
Source:
public Response deactivate(Action action) { boolean forceMaintenance = action.isForce() == null ? false : action.isForce(); return doAction(ActionType.DeactivateStorageDomainWithOvfUpdate, new DeactivateStorageDomainWithOvfUpdateParameters(guid, dataCenterId, forceMaintenance), action); }

Target:
public Response deactivate(Action action) { boolean forceMaintenance = action.isSetForce() ? action.isForce() : false; return doAction(ActionType.DeactivateStorageDomainWithOvfUpdate, new DeactivateStorageDomainWithOvfUpdateParameters(guid, dataCenterId, forceMaintenance), action); }
Source:
public LocalDateTime toLocalDateTimeBin(TimeZone tz, byte[] bytes) throws PSQLException { ParsedBinaryTimestamp parsedTimestamp = this.toParsedTimestampBin(null, bytes, true); if (parsedTimestamp.infinity == Infinity.POSITIVE) { return LocalDateTime.MAX; } else if (parsedTimestamp.infinity == Infinity.NEGATIVE) { return LocalDateTime.MAX; } return LocalDateTime.ofEpochSecond(parsedTimestamp.millis / 1000L, parsedTimestamp.nanos, ZoneOffset.UTC); }

Target:
public LocalDateTime toLocalDateTimeBin(TimeZone tz, byte[] bytes) throws PSQLException { ParsedBinaryTimestamp parsedTimestamp = this.toParsedTimestampBin(tz, bytes, true); if (parsedTimestamp.infinity == Infinity.POSITIVE) { return LocalDateTime.MAX; } else if (parsedTimestamp.infinity == Infinity.NEGATIVE) { return LocalDateTime.MAX; } return LocalDateTime.ofEpochSecond(parsedTimestamp.millis / 1000L, parsedTimestamp.nanos, ZoneOffset.UTC); }
Source:
private List<String> relationPK(RelationModel rm) throws OrmException, SQLException { Collection<ColumnModel> cols = rm.getPrimaryKeyColumns(); List<String> pk = new ArrayList<>(cols.size()); for (ColumnModel cm : cols) { pk.add(cm.getColumnName().toUpperCase(Locale.US)); } return pk; }

Target:
private List<String> relationPK(RelationModel rm) { Collection<ColumnModel> cols = rm.getPrimaryKeyColumns(); List<String> pk = new ArrayList<>(cols.size()); for (ColumnModel cm : cols) { pk.add(cm.getColumnName().toLowerCase(Locale.US)); } return pk; }
Source:
public void testMetadataContentRecordV1() throws IOException, MessageFormatException { List<String> keys = getKeys(60, 5); ByteBuffer metadataContent = getMetadataContent(keys); List<String> outKeys = deserializeMetadataContent(metadataContent); compareLists(outKeys, keys); metadataContent.flip(); byte currentRandomByte = metadataContent.get(16); metadataContent.put(16, (byte) (currentRandomByte + 1)); try { deserializeMetadataContent(metadataContent); Assert.assertEquals(true, false); } catch (MessageFormatException e) { Assert.assertEquals(e.getErrorCode(), MessageFormatErrorCodes.Data_Corrupt); } }

Target:
public void testMetadataContentRecordV1() throws IOException, MessageFormatException { List<StoreKey> keys = getKeys(60, 5); ByteBuffer metadataContent = getSerializedMetadataContent(keys); List<StoreKey> outKeys = deserializeMetadataContent(metadataContent, new MockIdFactory()); Assert.assertEquals("List of keys dont match", keys, outKeys); }
Source:
public static void assumeKafkaEnabled() { if ("true".equals(System.getProperty("kafka")) || STREAM_KAFKA.equals(System.getProperty(STREAM_PROPERTY))) { if (!KafkaUtils.kafkaDetected()) { fail("Kafka is enabled, but no Kafka server found."); } } else { Assume.assumeTrue("Kafka not enabled", false); } }

Target:
public static void assumeKafkaEnabled() { if ("true".equals(System.getProperty("kafka")) || STREAM_KAFKA.equals(System.getProperty(STREAM_PROPERTY))) { if (!KafkaUtils.kafkaDetected()) { fail("Kafka is enabled, but no Kafka server found."); } } else { assumeTrue("Kafka not enabled", false); } }
Source:
private Transaction startTransaction(PreCommitCondition preCommitCondition, ConflictHandler conflictHandler) { ImmutableMap<TableReference, ConflictHandler> tablesToWriteWrite = ImmutableMap.of( TEST_TABLE, conflictHandler, TransactionConstants.TRANSACTION_TABLE, ConflictHandler.IGNORE_ALL); return new SerializableTransaction( MetricsManagers.createForTests(), keyValueService, new LegacyTimelockService(timestampService, lockService, lockClient), transactionService, NoOpCleaner.INSTANCE, Suppliers.ofInstance(timestampService.getFreshTimestamp()), TestConflictDetectionManagers.createWithStaticConflictDetection(tablesToWriteWrite), SweepStrategyManagers.createDefault(keyValueService), 0L, Optional.empty(), preCommitCondition, AtlasDbConstraintCheckingMode.NO_CONSTRAINT_CHECKING, null, TransactionReadSentinelBehavior.THROW_EXCEPTION, true, timestampCache, AtlasDbConstants.DEFAULT_TRANSACTION_LOCK_ACQUIRE_TIMEOUT_MS, AbstractTransactionTest.GET_RANGES_EXECUTOR, AbstractTransactionTest.DEFAULT_GET_RANGES_CONCURRENCY, MultiTableSweepQueueWriter.NO_OP, MoreExecutors.newDirectExecutorService(), CommitProfileProcessor.createNonLogging(metricsManager)) { @Override protected Map<Cell, byte[]> transformGetsForTesting(Map<Cell, byte[]> map) { return Maps.transformValues(map, input -> input.clone()); } }; }

Target:
private Transaction startTransaction(PreCommitCondition preCommitCondition, ConflictHandler conflictHandler) { ImmutableMap<TableReference, ConflictHandler> tablesToWriteWrite = ImmutableMap.of( TEST_TABLE, conflictHandler, TransactionConstants.TRANSACTION_TABLE, ConflictHandler.IGNORE_ALL); return new SerializableTransaction( MetricsManagers.createForTests(), keyValueService, timelockService, transactionService, NoOpCleaner.INSTANCE, Suppliers.ofInstance(timestampService.getFreshTimestamp()), TestConflictDetectionManagers.createWithStaticConflictDetection(tablesToWriteWrite), SweepStrategyManagers.createDefault(keyValueService), 0L, Optional.empty(), preCommitCondition, AtlasDbConstraintCheckingMode.NO_CONSTRAINT_CHECKING, null, TransactionReadSentinelBehavior.THROW_EXCEPTION, true, timestampCache, AtlasDbConstants.DEFAULT_TRANSACTION_LOCK_ACQUIRE_TIMEOUT_MS, AbstractTransactionTest.GET_RANGES_EXECUTOR, AbstractTransactionTest.DEFAULT_GET_RANGES_CONCURRENCY, MultiTableSweepQueueWriter.NO_OP, MoreExecutors.newDirectExecutorService(), CommitProfileProcessor.createNonLogging(metricsManager)) { @Override protected Map<Cell, byte[]> transformGetsForTesting(Map<Cell, byte[]> map) { return Maps.transformValues(map, input -> input.clone()); } }; }
Source:
public AccessToken ensureAccessToken() { try { Claims claims = Jwts.parser() .setSigningKey(getDataStore().getApiKey().getSecret().getBytes("UTF-8")) .parseClaimsJws(getString(JWT)).getBody(); Assert.isTrue(Strings.hasText((String) claims.get("rti"))); return this; } catch (Exception e) { throw new JwtException("JWT failed validation; it cannot be trusted."); } }

Target:
private void ensureAccessToken() { try { Claims claims = Jwts.parser() .setSigningKey(getDataStore().getApiKey().getSecret().getBytes("UTF-8")) .parseClaimsJws(getString(JWT)).getBody(); Assert.isTrue(Strings.hasText((String) claims.get("rti"))); } catch (Exception e) { throw new JwtException("JWT failed validation; it cannot be trusted."); } }
Source:
public void run() { if (!isPlanExecuting.compareAndSet(false, true)) { LOG.log(Level.INFO, "Skipping Optimization, because it is already under optimization process"); return; } optimizationThreadPool.submit(new Runnable() { @Override public void run() { LOG.log(Level.INFO, "Optimization start. Start calculating the optimal plan"); final Collection<EvaluatorParameters> serverEvalParams = serverEM.generateEvalParams(DATA_TYPE_SERVER).values(); final Collection<EvaluatorParameters> workerEvalParams = workerEM.generateEvalParams(DATA_TYPE_WORKER).values(); final Map<String, List<EvaluatorParameters>> evaluatorParameters = new HashMap<>(2); evaluatorParameters.put(NAMESPACE_SERVER, new ArrayList<>(serverEvalParams)); evaluatorParameters.put(NAMESPACE_WORKER, new ArrayList<>(workerEvalParams)); final Plan plan = optimizer.optimize(evaluatorParameters, maxNumEvals); LOG.log(Level.INFO, "Calculating the optimal plan is finished. Start executing plan: {0}", plan); final Future<PlanResult> planExecutionResultFuture = planExecutor.execute(plan); try { final PlanResult planResult = planExecutionResultFuture.get(); LOG.log(Level.INFO, "Result of plan execution: {0}", planResult); Thread.sleep(10000); } catch (final InterruptedException | ExecutionException e) { LOG.log(Level.WARNING, "Exception while waiting for the plan execution to be completed"); } isPlanExecuting.set(false); } }); }

Target:
public void run() { if (!isPlanExecuting.compareAndSet(false, true)) { LOG.log(Level.INFO, "Skipping Optimization, because it is already under optimization process"); return; } optimizationThreadPool.submit(new Runnable() { @Override public void run() { LOG.log(Level.INFO, "Optimization start. Start calculating the optimal plan"); final Collection<EvaluatorParameters> serverEvalParams = serverEM.generateEvalParams(DATA_TYPE_SERVER).values(); final Collection<EvaluatorParameters> workerEvalParams = workerEM.generateEvalParams(DATA_TYPE_WORKER).values(); final Map<String, List<EvaluatorParameters>> evaluatorParameters = new HashMap<>(2); evaluatorParameters.put(NAMESPACE_SERVER, new ArrayList<>(serverEvalParams)); evaluatorParameters.put(NAMESPACE_WORKER, new ArrayList<>(workerEvalParams)); final Plan plan = optimizer.optimize(evaluatorParameters, maxNumEvals); LOG.log(Level.INFO, "Calculating the optimal plan is finished. Start executing plan: {0}", plan); final Future<PlanResult> planExecutionResultFuture = planExecutor.execute(plan); try { final PlanResult planResult = planExecutionResultFuture.get(); LOG.log(Level.INFO, "Result of plan execution: {0}", planResult); Thread.sleep(MARGIN_TIME_MS); } catch (final InterruptedException | ExecutionException e) { LOG.log(Level.WARNING, "Exception while waiting for the plan execution to be completed"); } isPlanExecuting.set(false); } }); }
Source:
public void run(ToolConfig config, SystemAccess system) { this.config = config; this.system = system; PromptPomMigrationService promptService = new PromptPomMigrationService(system, config); String jsonPath = promptService.promptForExternalConfiguration(); Path niogitDir = config.getTarget(); system.out().println("Starting POMs migration"); if (projectMigrationWasExecuted()) { try { MigrationSetup.configureProperties(system, niogitDir); weldContainer = new Weld().initialize(); cdiWrapper = weldContainer.instance().select(ServiceCDIWrapper.class).get(); if (systemMigrationWasExecuted()) { WorkspaceProjectService service = weldContainer.instance().select(WorkspaceProjectService.class).get(); Collection<WorkspaceProject> projects = service.getAllWorkspaceProjects(); for(WorkspaceProject prj : projects){ processWorkspaceProject(prj, jsonPath); } } String userHome = System.getProperty("user.home"); system.out().println("End POMs migration, detailed log available on "+userHome + "/migration_tool.log"); }finally { if (weldContainer != null) { try { cdiWrapper = null; weldContainer.close(); } catch (Exception ex) { } } } } }

Target:
public void run(ToolConfig config, SystemAccess system) { this.config = config; this.system = system; if (projectMigrationWasExecuted()) { system.out().println("Starting POMs migration"); migrate(); system.out().println("Finished POMs migration, detailed log available in " + System.getProperty("user.dir") + "/migration_tool.log"); } }
Source:
public void end() { set(Value.IS_CURRENT, false); set(Value.WALLTIME_END, ScoreBoardClock.getInstance().getCurrentWalltime()); if (getTeam().hasFieldingAdvancePending() && getCurrentFielding().getTeamJam().isRunningOrUpcoming()) { getCurrentFielding().setSkater(null); remove(Child.FIELDING, getCurrentFielding()); } set(Value.END_FIELDING, get(Value.CURRENT_FIELDING)); set(Value.END_BETWEEN_JAMS, !scoreBoard.isInJam() && !getTeam().hasFieldingAdvancePending()); set(Value.END_AFTER_S_P, getEndFielding().getTeamJam().isStarPass()); set(Value.JAM_CLOCK_END, endedBetweenJams() ? 0L : scoreBoard.getClock(Clock.ID_JAM).getTimeElapsed()); getCurrentFielding().updateBoxTripSymbols(); if (getStartFielding() == getEndFielding() && endedBetweenJams()) { unlink(); } }

Target:
public void end() { set(Value.IS_CURRENT, false); set(Value.WALLTIME_END, ScoreBoardClock.getInstance().getCurrentWalltime()); if (!scoreBoard.isInJam() && getCurrentFielding().getTeamJam().isRunningOrUpcoming()) { if (getTeam().hasFieldingAdvancePending()) { getCurrentFielding().setSkater(null); } remove(Child.FIELDING, getCurrentFielding()); } if (getCurrentFielding() == null) { unlink(); } else { set(Value.END_FIELDING, get(Value.CURRENT_FIELDING)); set(Value.END_BETWEEN_JAMS, !scoreBoard.isInJam() && !getTeam().hasFieldingAdvancePending() && getEndFielding().getTeamJam().isRunningOrEnded()); set(Value.END_AFTER_S_P, getEndFielding().getTeamJam().isStarPass() && getEndFielding().isCurrent()); set(Value.JAM_CLOCK_END, endedBetweenJams() ? 0L : scoreBoard.getClock(Clock.ID_JAM).getTimeElapsed()); getCurrentFielding().updateBoxTripSymbols(); } }
Source:
public void invoke() { for (int x = 0; x < retry; x++) { try { Optional<ManagementClient> orchestrator = getOrchestrator(); if(orchestrator.isPresent()){ UUID workflowId = sendRequest(orchestrator.get()); waitForWorkflow(workflowId, orchestrator.get(), timeout, pollPeriod); } else{ throw new IllegalStateException("Orchestrator can not be selected"); } } catch(RuntimeException e) { log.warn("WorkflowRequest: Additional handling of the exception wrapped herein." + " Running on attempt {}, cause:", this, x, e); } catch (NetworkException | TimeoutException | IllegalStateException e) { log.warn("WorkflowRequest: Error while running on attempt {}, cause:", this, x, e); } for (int y = 0; y < runtime.getParameters().getInvalidateRetry(); y++) { runtime.invalidateLayout(); Layout layoutToVerify = new Layout(runtime.getLayoutView().getLayout()); if (verifyRequest(layoutToVerify)) { log.info("WorkflowRequest: Successfully completed {}", this); return; } } log.warn("WorkflowRequest: Retrying on attempt {}", this, x); } throw new WorkflowResultUnknownException(); }

Target:
public void invoke() { for (int retryIteration = 0; retryIteration < retry; retryIteration++) { try { Optional<ManagementClient> orchestrator = getOrchestrator(); if(orchestrator.isPresent()){ UUID workflowId = sendRequest(orchestrator.get()); waitForWorkflow(workflowId, orchestrator.get(), timeout, pollPeriod); } else { log.warn("Orchestrator can not be selected"); } } catch (TimeoutException e) { log.warn("WorkflowRequest: Error while running on attempt {}, cause:", this, retryIteration, e); } catch (RuntimeException e) { handleException(e); } for (int y = 0; y < runtime.getParameters().getInvalidateRetry(); y++) { runtime.invalidateLayout(); Layout layoutToVerify = new Layout(runtime.getLayoutView().getLayout()); if (verifyRequest(layoutToVerify)) { log.info("WorkflowRequest: Successfully completed {}", this); return; } } log.warn("WorkflowRequest: Retrying on attempt {}", this, retryIteration); } throw new WorkflowResultUnknownException(); }
Source:
public Sequence<T> run(final Query<T> query, final Map<String, Object> responseContext) { final Period p = getChunkPeriod(query); if (p.toStandardDuration().getMillis() == 0) { return baseRunner.run(query, responseContext); } List<Interval> chunkIntervals = Lists.newArrayList(FunctionalIterable .create(query.getIntervals()) .transformCat( new Function<Interval, Iterable<Interval>>() { @Override public Iterable<Interval> apply(Interval input) { return splitInterval(input, p); } } )); if(chunkIntervals.size() <= 1) { return baseRunner.run(query, responseContext); } final QueryRunner<T> finalQueryRunner = new AsyncQueryRunner<T>( toolChest.mergeResults( new MetricsEmittingQueryRunner<T>( emitter, new Function<Query<T>, ServiceMetricEvent.Builder>() { @Override public ServiceMetricEvent.Builder apply(Query<T> input) { return toolChest.makeMetricBuilder(query); } }, baseRunner ).withWaitMeasuredFromNow()), executor, queryWatcher); return Sequences.concat( Lists.newArrayList(FunctionalIterable.create(chunkIntervals).transform( new Function<Interval, Sequence<T>>() { @Override public Sequence<T> apply(Interval singleInterval) { return finalQueryRunner.run( query.withQuerySegmentSpec(new MultipleIntervalSegmentSpec(Arrays.asList(singleInterval))), responseContext ); } } )) ); }

Target:
public Sequence<T> run(final Query<T> query, final Map<String, Object> responseContext) { final Period chunkPeriod = getChunkPeriod(query); if (chunkPeriod.toStandardDuration().getMillis() == 0) { return baseRunner.run(query, responseContext); } List<Interval> chunkIntervals = Lists.newArrayList(FunctionalIterable .create(query.getIntervals()) .transformCat( new Function<Interval, Iterable<Interval>>() { @Override public Iterable<Interval> apply(Interval input) { return splitInterval(input, chunkPeriod); } } )); if(chunkIntervals.size() <= 1) { return baseRunner.run(query, responseContext); } final QueryRunner<T> finalQueryRunner = new AsyncQueryRunner<T>( toolChest.mergeResults( new MetricsEmittingQueryRunner<T>( emitter, new Function<Query<T>, ServiceMetricEvent.Builder>() { @Override public ServiceMetricEvent.Builder apply(Query<T> input) { return toolChest.makeMetricBuilder(input); } }, baseRunner ).withWaitMeasuredFromNow()), executor, queryWatcher); return Sequences.concat( Lists.newArrayList(FunctionalIterable.create(chunkIntervals).transform( new Function<Interval, Sequence<T>>() { @Override public Sequence<T> apply(Interval singleInterval) { return finalQueryRunner.run( query.withQuerySegmentSpec(new MultipleIntervalSegmentSpec(Arrays.asList(singleInterval))), responseContext ); } } )) ); }
Source:
private void addAffinityLabels() { List<Label> affinityLabels = getParameters().getAffinityLabels(); for (Label label : affinityLabels) { label.addVm(getVm()); labelDao.update(label); } }

Target:
private void addAffinityLabels() { List<Label> affinityLabels = getParameters().getAffinityLabels(); List<Guid> labelIds = affinityLabels.stream() .map(Label::getId) .collect(Collectors.toList()); labelDao.addVmToLabels(getVmId(), labelIds); }
Source:
private boolean shouldUpdateImageProperties() { if (getOldDisk().getDiskStorageType() == DiskStorageType.IMAGE) { return false; } Guid oldQuotaId = ((DiskImage) getOldDisk()).getQuotaId(); return !ObjectUtils.objectsEqual(oldQuotaId, getQuotaId()); }

Target:
private boolean shouldUpdateImageProperties() { if (getOldDisk().getDiskStorageType() != DiskStorageType.IMAGE) { return false; } Guid oldQuotaId = ((DiskImage) getOldDisk()).getQuotaId(); return !ObjectUtils.objectsEqual(oldQuotaId, getQuotaId()); }
Source:
private boolean isISOCompatible( File iso, RpmVersion ovirtHostOsVersion ) { boolean ret = false; log.debug("Check if ISO compatible: '{}'", iso); for (OVirtNodeInfo.Entry info : OVirtNodeInfo.getInstance().get()) { if (info.path.equals(iso.getParentFile())) { try { Matcher matcher = info.isoPattern.matcher( iso.getCanonicalFile().getName() ); if (matcher.find()) { String rpmLike = matcher.group(1).replaceAll("-", "."); log.debug("ISO version: '{}' '{}' '{}'", iso, rpmLike, ovirtHostOsVersion); RpmVersion isoVersion = new RpmVersion(rpmLike, "", true); if (VdsHandler.isIsoVersionCompatibleForUpgrade(ovirtHostOsVersion, isoVersion)) { log.debug("ISO compatible '{}'", iso); ret = true; break; } } } catch (IOException e) { log.error( "Cannot get canonical path to '{}' with error {}", iso.getName(), ExceptionUtils.getMessage(e) ); } } } return ret; }

Target:
private boolean isISOCompatible( File iso, RpmVersion ovirtHostOsVersion ) { boolean ret = false; log.debug("Check if ISO compatible: '{}'", iso); for (OVirtNodeInfo.Entry info : OVirtNodeInfo.getInstance().get()) { if (info.path.equals(iso.getParentFile())) { try { Matcher matcher = info.isoPattern.matcher( iso.getCanonicalFile().getName() ); if (matcher.find()) { String rpmLike = matcher.group(1).replaceAll("-", "."); log.debug("ISO version: '{}' '{}' '{}'", iso, rpmLike, ovirtHostOsVersion); RpmVersion isoVersion = new RpmVersion(rpmLike, "", true); if (VdsHandler.isIsoVersionCompatibleForUpgrade(ovirtHostOsVersion, isoVersion)) { log.debug("ISO compatible '{}'", iso); ret = true; break; } } } catch (IOException e) { log.error( "Cannot get canonical path to '{}': {}", iso.getName(), ExceptionUtils.getMessage(e) ); log.debug("Exception", e); } } } return ret; }
Source:
private void launchVerificationActivity() { Intent i = new Intent(this, CommCareVerificationActivity.class); i.putExtra(AppManagerActivity.KEY_LAUNCH_FROM_MANAGER, true); this.startActivityForResult(i, DispatchActivity.MISSING_MEDIA_ACTIVITY); }

Target:
private void launchVerificationActivity() { Intent i = new Intent(this, CommCareVerificationActivity.class); i.putExtra(AppManagerActivity.KEY_LAUNCH_FROM_MANAGER, true); this.startActivityForResult(i, MISSING_MEDIA_ACTIVITY); }
Source:
private MethodSpec createConstructor(StorIOSQLiteTypeMeta storIOSQLiteTypeMeta) { final ClassName putResolver = ClassName.get(storIOSQLiteTypeMeta.packageName, PutResolverGenerator.generateName(storIOSQLiteTypeMeta)); final ClassName getResolver = ClassName.get(storIOSQLiteTypeMeta.packageName, GetResolverGenerator.generateName(storIOSQLiteTypeMeta)); final ClassName deleteResolver = ClassName.get(storIOSQLiteTypeMeta.packageName, DeleteResolverGenerator.generateName(storIOSQLiteTypeMeta)); return MethodSpec.constructorBuilder() .addModifiers(PUBLIC) .addStatement("super(new $T(), new $T(), new $T())", putResolver, getResolver, deleteResolver) .build(); }

Target:
private MethodSpec createConstructor(StorIOSQLiteTypeMeta storIOSQLiteTypeMeta) { final ClassName putResolver = ClassName.get(storIOSQLiteTypeMeta.packageName, PutResolverGenerator.generateName(storIOSQLiteTypeMeta)); final ClassName getResolver = ClassName.get(storIOSQLiteTypeMeta.packageName, GetResolverGenerator.generateName(storIOSQLiteTypeMeta)); final ClassName deleteResolver = ClassName.get(storIOSQLiteTypeMeta.packageName, DeleteResolverGenerator.generateName(storIOSQLiteTypeMeta)); return MethodSpec.constructorBuilder() .addModifiers(PUBLIC) .addStatement("super(new $T(),\nnew $T(),\nnew $T())", putResolver, getResolver, deleteResolver) .build(); }
Source:
private void dispatchFromQueue() { while (true) { try { RATE_LIMITED_LOGGER.trace("Asking dispatch queue for the next entry..."); Map.Entry<String, S> messageEntry = dispatchQueue.dequeue(); RATE_LIMITED_LOGGER.trace("Received message entry from dispatch queue {}", messageEntry); activeDispatchers.incrementAndGet(); RATE_LIMITED_LOGGER.trace("Sending message via sync dispatcher", messageEntry); syncDispatcher.send(messageEntry.getValue()); RATE_LIMITED_LOGGER.trace("Successfully sent message {}", messageEntry); if (messageEntry.getKey() != null) { RATE_LIMITED_LOGGER.trace("Attempting to complete future for message {}", messageEntry); CompletableFuture<DispatchStatus> messageFuture = futureMap.remove(messageEntry.getKey()); if (messageFuture != null) { messageFuture.complete(DispatchStatus.DISPATCHED); RATE_LIMITED_LOGGER.trace("Completed future for message {}", messageEntry); } else { RATE_LIMITED_LOGGER.warn("No future found for message {}", messageEntry); } } else { RATE_LIMITED_LOGGER.trace("Dequeued an entry with a null key"); } activeDispatchers.decrementAndGet(); } catch (InterruptedException e) { break; } catch (Exception e) { RATE_LIMITED_LOGGER.warn("Encountered exception while taking from dispatch queue", e); } } }

Target:
private void dispatchFromQueue() { while (true) { try { LOG.trace("Asking dispatch queue for the next entry..."); Map.Entry<String, S> messageEntry = dispatchQueue.dequeue(); LOG.trace("Received message entry from dispatch queue {}", messageEntry); activeDispatchers.incrementAndGet(); LOG.trace("Sending message via sync dispatcher", messageEntry); syncDispatcher.send(messageEntry.getValue()); LOG.trace("Successfully sent message {}", messageEntry); if (messageEntry.getKey() != null) { LOG.trace("Attempting to complete future for message {}", messageEntry); CompletableFuture<DispatchStatus> messageFuture = futureMap.remove(messageEntry.getKey()); if (messageFuture != null) { messageFuture.complete(DispatchStatus.DISPATCHED); LOG.trace("Completed future for message {}", messageEntry); } else { RATE_LIMITED_LOGGER.warn("No future found for message {}", messageEntry); } } else { LOG.trace("Dequeued an entry with a null key"); } activeDispatchers.decrementAndGet(); } catch (InterruptedException e) { break; } catch (Exception e) { RATE_LIMITED_LOGGER.warn("Encountered exception while taking from dispatch queue", e); } } }
Source:
private void registerReceivers() { this.registrar = new BroadcastRegistrar(); this.registrar .addAction(ConnectionService.ACTION_FAN_CONNECTED, new IBroadcastActionHandler() { @Override public void onReceiveAction(Context context, Intent intent) { String bluetoothID = intent.getStringExtra(ConnectionService.EXTRA_FAN_NAME); String macAddress = intent.getStringExtra(ConnectionService.EXTRA_FAN_ADDRESS); userList.addUser(bluetoothID, macAddress); Log.i(TAG, "User List: " + userList.toString()); notifyUserListUpdate(); } }) .addAction(ConnectionService.ACTION_FAN_DISCONNECTED, new IBroadcastActionHandler() { @Override public void onReceiveAction(Context context, Intent intent) { String macAddress = intent.getStringExtra(ConnectionService.EXTRA_FAN_ADDRESS); userList.removeUser(macAddress); notifyUserListUpdate(); } }) .addAction(MessagingService.ACTION_NEW_CONNECTED_USERS, new IBroadcastActionHandler() { @Override public void onReceiveAction(Context context, Intent intent) { Log.i(TAG, "New Connected Users Message Recieved"); userList = intent.getParcelableExtra(MessagingService.EXTRA_USER_LIST); Log.i(TAG,"New User List:" + userList.toString()); new BroadcastIntent(UserList.ACTION_USER_LIST_UPDATE).send(CustomApp.this); } }) .register(this); }

Target:
private void registerReceivers() { this.registrar = new BroadcastRegistrar(); this.registrar .addAction(ConnectionService.ACTION_FAN_CONNECTED, new IBroadcastActionHandler() { @Override public void onReceiveAction(Context context, Intent intent) { String bluetoothID = intent.getStringExtra(ConnectionService.EXTRA_FAN_NAME); String macAddress = intent.getStringExtra(ConnectionService.EXTRA_FAN_ADDRESS); userList.addUser(bluetoothID, macAddress); notifyUserListUpdate(); } }) .addAction(ConnectionService.ACTION_FAN_DISCONNECTED, new IBroadcastActionHandler() { @Override public void onReceiveAction(Context context, Intent intent) { String macAddress = intent.getStringExtra(ConnectionService.EXTRA_FAN_ADDRESS); userList.removeUser(macAddress); notifyUserListUpdate(); } }) .addAction(MessagingService.ACTION_NEW_CONNECTED_USERS_MESSAGE, new IBroadcastActionHandler() { @Override public void onReceiveAction(Context context, Intent intent) { userList = intent.getParcelableExtra(MessagingService.EXTRA_USER_LIST); new BroadcastIntent(UserList.ACTION_USER_LIST_UPDATE).send(CustomApp.this); } }) .register(this); }
Source:
public boolean save(Intent intent) { synchronized(STATIC_LOCK) { File file = getFile(); if (file.exists()) { ProvisionLogger.loge("Cannot save to the intent store because it already contains" + " an intent"); return false; } AtomicFile atomicFile = null; FileOutputStream stream = null; boolean success = false; try { atomicFile = new AtomicFile(file); stream = atomicFile.startWrite(); XmlSerializer serializer = new FastXmlSerializer(); serializer.setOutput(stream, StandardCharsets.UTF_8.name()); serializer.startDocument(null, true); serializer.startTag(null, TAG_INTENT_STORE); writeIntent(intent, serializer); serializer.endTag(null, TAG_INTENT_STORE); serializer.endDocument(); success = true; return true; } catch (IOException | XmlPullParserException e) { ProvisionLogger.loge("Caught exception while trying to save an intent to the" + " intentStore", e); file.delete(); return false; } finally { if (success) { atomicFile.finishWrite(stream); } else { atomicFile.failWrite(stream); } } } }

Target:
public boolean save(Intent intent) { synchronized(STATIC_LOCK) { File file = getFile(); if (file.exists()) { ProvisionLogger.loge("Cannot save to the intent store because it already contains" + " an intent"); return false; } AtomicFile atomicFile = null; FileOutputStream stream = null; try { atomicFile = new AtomicFile(file); stream = atomicFile.startWrite(); XmlSerializer serializer = new FastXmlSerializer(); serializer.setOutput(stream, StandardCharsets.UTF_8.name()); serializer.startDocument(null, true); serializer.startTag(null, TAG_INTENT_STORE); writeIntent(intent, serializer); serializer.endTag(null, TAG_INTENT_STORE); serializer.endDocument(); atomicFile.finishWrite(stream); return true; } catch (IOException | XmlPullParserException e) { ProvisionLogger.loge("Caught exception while trying to save an intent to the" + " intentStore", e); file.delete(); atomicFile.failWrite(stream); return false; } } }
Source:
public BlobStore getById(Function<String, InputStream> configGetter, String storeId) { logger.debug("Looking blob store with id {}", storeId); try { HierarchicalConfiguration config = getConfiguration(configGetter); if (config != null) { return findStore(config, store -> StringUtils.equals(storeId, store.getString(CONFIG_KEY_ID))); } } catch (ConfigurationException e) { logger.error("Error reading blob store configuration", e); } return null; }

Target:
public BlobStore getById(Function<String, InputStream> configGetter, String storeId) throws ConfigurationException, IOException { logger.debug("Looking blob store with id {}", storeId); HierarchicalConfiguration config = getConfiguration(configGetter); if (config != null) { return findStore(config, store -> StringUtils.equals(storeId, store.getString(CONFIG_KEY_ID))); } return null; }
Source:
public List<String> list(String bucket, String prefix) throws IOException { if (prefix.length() > 0 && !prefix.endsWith("/")) prefix += "/"; final ListParser lp = new ListParser(bucket, prefix); do { lp.list(); } while (lp.truncated); Collections.sort(lp.entries); return lp.entries.stream().map(anEntity -> anEntity.name).collect(Collectors.toList()); }

Target:
public List<String> list(String bucket, String prefix) throws IOException { if (prefix.length() > 0 && !prefix.endsWith("/")) prefix += "/"; final ListParser lp = new ListParser(bucket, prefix); do { lp.list(); } while (lp.truncated); Comparator<KeyInfo> comparator = (k1, k2) -> Long.compare(k1.getLastModifiedSecs(), k2.getLastModifiedSecs()); return lp.entries.stream().sorted(comparator.reversed()) .map(e -> e.getName()).collect(Collectors.toList()); }
Source:
public long getWaitTimeoutOnBackpressureMillis() { return getLong(WAIT_TIMEOUT_ON_BACKPRESSURE, 500); }

Target:
public long getWaitTimeoutOnBackpressureMillis() { return getLong(WAIT_TIMEOUT_ON_BACKPRESSURE, -1); }
Source:
public void setUseTrackingSessionState (boolean shouldUseTrackingSessionState) { getButtonUseTrackingSessionState().setEnabled(shouldUseTrackingSessionState); delegate.setUseGlobalState(shouldUseTrackingSessionState); if (!shouldUseTrackingSessionState) { getButtonUseTrackingSessionState().setSelected(false); } }

Target:
private void setUseTrackingSessionState(boolean shouldUseTrackingSessionState) { if (delegate != null) { delegate.setUseGlobalState(shouldUseTrackingSessionState); } }
Source:
expectThat(TuAggregatePart entity) { return super.expectThat(entity); }

Target:
public EventApplierExpected<TuComments> expectThat(TuAggregatePart entity) { return super.expectThat(entity); }
Source:
public SystemOffsetProfile(ProfileCallback callback, ProfileContext context) { this.callback = callback; this.context = context; Object paramValue = this.context.getConfiguration().get(OFFSET_PARAM); logger.debug("Parameter '{}' has value '{}' ", OFFSET_PARAM, paramValue); if (paramValue instanceof String) { try { offset = new QuantityType<>((String) paramValue); } catch (IllegalArgumentException e) { logger.error("Cannot convert value '{}' of parameter '{}' into a valid offset of type QyantityType.", paramValue, OFFSET_PARAM); } } else { logger.error("Parameter '{}' is not of type String", OFFSET_PARAM); } }

Target:
public SystemOffsetProfile(ProfileCallback callback, ProfileContext context) { this.callback = callback; this.context = context; Object paramValue = this.context.getConfiguration().get(OFFSET_PARAM); logger.debug("Configuring profile with parameter '{}'", OFFSET_PARAM, paramValue); if (paramValue instanceof String) { try { offset = new QuantityType<>((String) paramValue); } catch (IllegalArgumentException e) { logger.error("Cannot convert value '{}' of parameter '{}' into a valid offset of type QuantityType.", paramValue, OFFSET_PARAM); } } else if (paramValue instanceof BigDecimal) { BigDecimal bd = (BigDecimal) paramValue; offset = new QuantityType<>(bd.toString()); } else { logger.error("Parameter '{}' is not of type String or BigDecimal", OFFSET_PARAM); } }
Source:
public void run() { LOG.info("Check server of machine at {}", serverRef, machineName, System.currentTimeMillis()); if (isTimedOut()) { reportFuture.completeExceptionally(new InfrastructureException( "Server " + serverRef + " in machine " + machineName + " not available.")); } else if (isAvailable()) { LOG.info("Server of machine started", serverRef, machineName); reportFuture.complete(serverRef); } else { timer.schedule(new ServerCheckingTask(), period); } }

Target:
public void run() { if (isTimedOut()) { reportFuture.completeExceptionally(new InfrastructureException( String.format("Server '%s' in machine '%s' not available.", serverRef, machineName))); } else if (isAvailable()) { reportFuture.complete(serverRef); } else { timer.schedule(new ServerCheckingTask(), period); } }
Source:
public void cloneWithSparseCheckout(String directory, String remoteUrl, String branch) throws GitException, UnauthorizedException { init(newDto(InitRequest.class).withInitCommit(false).withBare(false)); remoteAdd(newDto(RemoteAddRequest.class).withName("origin").withUrl(remoteUrl)); getConfig().add("core.sparsecheckout", "true"); final File sparseCheckout = new File(getWorkingDir(), ".git" + File.separator + "info" + File.separator + "sparse-checkout"); try (BufferedWriter writer = Files.newBufferedWriter(sparseCheckout.toPath(), Charset.forName("UTF-8"))) { writer.write(directory.startsWith("/") ? directory : "/" + directory); } catch (IOException e) { throw new GitException(e); } try { fetch(newDto(FetchRequest.class).withRemote("origin")); } catch (GitException e) { throw new GitException( String.format("Unable to fetch remote branch %s. Make sure it exists and can be accessed.", branch), e); } try { checkout(newDto(CheckoutRequest.class).withName(branch)); } catch (GitException e) { throw new GitException( String.format("Unable to checkout branch %s. Make sure it exists and can be accessed.", branch), e); } }

Target:
public void cloneWithSparseCheckout(String directory, String remoteUrl, String branch) throws GitException, UnauthorizedException { init(newDto(InitRequest.class).withInitCommit(false).withBare(false)); remoteAdd(newDto(RemoteAddRequest.class).withName("origin").withUrl(remoteUrl)); getConfig().add("core.sparsecheckout", "true"); try { Files.write(Paths.get(getWorkingDir() + "/.git/info/sparse-checkout"), (directory.startsWith("/") ? directory : "/" + directory).getBytes()); } catch (IOException exception) { throw new GitException(exception.getMessage(), exception); } try { fetch(newDto(FetchRequest.class).withRemote("origin")); } catch (GitException exception) { throw new GitException( String.format("Unable to fetch remote branch %s. Make sure it exists and can be accessed.", branch), exception); } try { checkout(newDto(CheckoutRequest.class).withName(branch)); } catch (GitException exception) { throw new GitException( String.format("Unable to checkout branch %s. Make sure it exists and can be accessed.", branch), exception); } }
Source:
public void authenticateWithoutProvider() throws SecurityException, SecurityProviderNotFoundException { expected.expect(SecurityProviderNotFoundException.class); manager.authenticate(authentication); verify(provider).authenticate(authentication); verifyZeroInteractions(provider); }

Target:
public void authenticateWithoutProvider() throws SecurityException, SecurityProviderNotFoundException { expected.expect(SecurityProviderNotFoundException.class); try { manager.authenticate(authentication); } finally { verifyZeroInteractions(provider); } }
Source:
public void testNegationAllExceptJavaInSrcAndExceptChildDirInSrc() throws IOException { writeIgnoreFile(".gitignore", " "); writeTrashFile("src/keep.java", ""); writeTrashFile("src/nothere.o", ""); writeTrashFile("src/a/nothere.java", ""); writeTrashFile("src/a/nothere.o", ""); beginWalk(); assertEntry(F, ignored, ".gitignore"); assertEntry(F, ignored, "nothere.o"); assertEntry(D, false, "src"); assertEntry(F, ignored, "src/.gitignore"); assertEntry(D, tracked, "src/a"); assertEntry(F, tracked, "src/a/nothere.java"); assertEntry(F, tracked, "src/a/nothere.o"); assertEntry(F, tracked, "src/keep.java"); }

Target:
public void testNegationAllExceptJavaInSrcAndExceptChildDirInSrc() throws IOException { writeIgnoreFile(".gitignore", " "); writeTrashFile("src/keep.java", ""); writeTrashFile("src/nothere.o", ""); writeTrashFile("src/a/keep.java", ""); writeTrashFile("src/a/keep.o", ""); beginWalk(); assertEntry(F, ignored, ".gitignore"); assertEntry(F, ignored, "nothere.o"); assertEntry(D, tracked, "src"); assertEntry(F, ignored, "src/.gitignore"); assertEntry(D, tracked, "src/a"); assertEntry(F, tracked, "src/a/keep.java"); assertEntry(F, tracked, "src/a/keep.o"); assertEntry(F, tracked, "src/keep.java"); assertEntry(F, ignored, "src/nothere.o"); endWalk(); }
Source:
public Command getRefactorCommand(final IRefactorRequest request) { CompoundCommand compoundCommand = new CompoundCommand(); Iterator<IRefactorParticipant> refactorParticipants = participantsRegistry.getRefactorParticipants(); Command scopeCommand = null; if (null == request.getScope()) { scopeCommand = RefactorScopeProvider.getInstance(editingDomain).getScopeCommand(request); if (null != scopeCommand && scopeCommand.canExecute()) { compoundCommand.append(scopeCommand); } else { request.setScope(RefactorPreferencesUtils.getScopePreference()); } } IRefactorParticipant participant = null; while (((null != scopeCommand && scopeCommand.canExecute()) || null != request.getScope()) && refactorParticipants.hasNext()) { participant = refactorParticipants.next(); Command refactorCommand = participant.getRefactorCommand(request); if (refactorCommand != null && refactorCommand.canExecute()) { compoundCommand.append(refactorCommand); } } return compoundCommand; }

Target:
public Command getRefactorCommand(final IRefactorRequest request) { CompoundCommand compoundCommand = new CompoundCommand(); List<IRefactorParticipant> refactorParticipants = participantsRegistry.getRefactorParticipants(); launchRefactoring(request, refactorParticipants); if (null != request.getScope()) { for (IRefactorParticipant participant : refactorParticipants) { Command refactorCommand = participant.getRefactorCommand(); if (refactorCommand != null) { compoundCommand.append(refactorCommand); } } } return compoundCommand; }