auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
void proceedDownVms() { if (vdsmVm != null && vdsmVm.getVmDynamic().getStatus() == VMStatus.Down) { VMStatus prevStatus = VMStatus.Unassigned; VmDynamic dynamicFromDb = null; if (dbVm != null) { prevStatus = dbVm.getStatus(); proceedVmBeforeDeletion(); if (prevStatus == VMStatus.SavingState) { vmsMonitoring.getResourceManager().InternalSetVmStatus(dbVm, VMStatus.Suspended); } clearVm(vdsmVm.getVmDynamic().getExitStatus(), vdsmVm.getVmDynamic().getExitMessage(), vdsmVm.getVmDynamic().getExitReason()); } else { dynamicFromDb = getDbFacade().getVmDynamicDao().get(vdsmVm.getVmDynamic().getId()); if (dynamicFromDb != null) { prevStatus = dynamicFromDb.getStatus(); } } if (dbVm != null || dynamicFromDb != null) { vmsMonitoring.getResourceManager().runVdsCommand( VDSCommandType.Destroy, new DestroyVmVDSCommandParameters( getVdsManager().getVdsId(), vdsmVm.getVmDynamic().getId(), false, false, 0)); if (dbVm != null && prevStatus == VMStatus.SavingState) { afterSuspendTreatment(vdsmVm.getVmDynamic()); } else if (prevStatus != VMStatus.MigratingFrom) { handleVmOnDown(dbVm, vdsmVm.getVmDynamic()); } } } }

Target:
void proceedDownVms() { if (vdsmVm != null && vdsmVm.getVmDynamic().getStatus() == VMStatus.Down) { VMStatus prevStatus = VMStatus.Unassigned; if (dbVm != null) { prevStatus = dbVm.getStatus(); proceedVmBeforeDeletion(); if (prevStatus == VMStatus.SavingState) { vmsMonitoring.getResourceManager().InternalSetVmStatus(dbVm, VMStatus.Suspended); } clearVm(vdsmVm.getVmDynamic().getExitStatus(), vdsmVm.getVmDynamic().getExitMessage(), vdsmVm.getVmDynamic().getExitReason()); } else { VmDynamic dynamicFromDb = getDbFacade().getVmDynamicDao().get(vdsmVm.getVmDynamic().getId()); if (dynamicFromDb != null) { prevStatus = dynamicFromDb.getStatus(); } } if (prevStatus != VMStatus.Unassigned) { vmsMonitoring.getResourceManager().runVdsCommand( VDSCommandType.Destroy, new DestroyVmVDSCommandParameters( getVdsManager().getVdsId(), vdsmVm.getVmDynamic().getId(), false, false, 0)); if (dbVm != null && prevStatus == VMStatus.SavingState) { afterSuspendTreatment(vdsmVm.getVmDynamic()); } else if (prevStatus != VMStatus.MigratingFrom) { handleVmOnDown(dbVm, vdsmVm.getVmDynamic()); } } } }
Source:
private StreamBlock pollPersistentDeque(boolean actuallyPoll) { BinaryDequeReader.Entry<ExportRowSchema> entry = null; StreamBlock block = null; try { entry = m_reader.pollEntry(PersistentBinaryDeque.UNSAFE_CONTAINER_FACTORY); if (entry != null) { ByteBuffer b = entry.getData(); b.order(ByteOrder.LITTLE_ENDIAN); long seqNo = b.getLong(StreamBlock.SEQUENCE_NUMBER_OFFSET); long committedSeqNo = b.getLong(StreamBlock.COMMIT_SEQUENCE_NUMBER_OFFSET); int tupleCount = b.getInt(StreamBlock.ROW_NUMBER_OFFSET); long uniqueId = b.getLong(StreamBlock.UNIQUE_ID_OFFSET); block = new StreamBlock(entry, seqNo, committedSeqNo, tupleCount, uniqueId, true); if (!actuallyPoll) { assert(entry.getExtraHeader() != null); m_memoryDeque.offer(block); } } } catch (Exception e) { exportLog.error("Failed to poll from persistent binary deque:" + e); } return block; }

Target:
private StreamBlock pollPersistentDeque(boolean actuallyPoll) { BinaryDequeReader.Entry<ExportRowSchema> entry = null; StreamBlock block = null; try { entry = m_reader.pollEntry(PersistentBinaryDeque.UNSAFE_CONTAINER_FACTORY); if (entry != null) { ByteBuffer b = entry.getData(); b.order(ByteOrder.LITTLE_ENDIAN); long seqNo = b.getLong(StreamBlock.SEQUENCE_NUMBER_OFFSET); long committedSeqNo = b.getLong(StreamBlock.COMMIT_SEQUENCE_NUMBER_OFFSET); int tupleCount = b.getInt(StreamBlock.ROW_NUMBER_OFFSET); long uniqueId = b.getLong(StreamBlock.UNIQUE_ID_OFFSET); block = new StreamBlock(entry, seqNo, committedSeqNo, tupleCount, uniqueId, true); if (!actuallyPoll) { assert(entry.getExtraHeader() != null); m_memoryDeque.offer(block); } } } catch (Exception e) { exportLog.error("Failed to poll from persistent binary deque", e); } return block; }
Source:
public void run() { try { sendTimerEvents(); Long toNotifyTime = toNotifyQueue.peek(); long currentTime = executionPlanContext.getTimestampGenerator().currentTime(); if (!executionPlanContext.isPlayback()) { if (toNotifyTime != null) { scheduledExecutorService.schedule(eventCaller, toNotifyTime - currentTime, TimeUnit .MILLISECONDS); } else { synchronized (this) { running = false; if (toNotifyQueue.peek() != null) { running = true; scheduledExecutorService.schedule(eventCaller, 0, TimeUnit.MILLISECONDS); } } } } } catch (Throwable t) { log.error(t); } }

Target:
public void run() { try { sendTimerEvents(); Long toNotifyTime = toNotifyQueue.peek(); long currentTime = executionPlanContext.getTimestampGenerator().currentTime(); if (!executionPlanContext.isPlayback()) { if (toNotifyTime != null) { scheduledExecutorService.schedule(eventCaller, toNotifyTime - currentTime, TimeUnit .MILLISECONDS); } else { try { mutex.acquire(); running = false; if (toNotifyQueue.peek() != null) { running = true; scheduledExecutorService.schedule(eventCaller, 0, TimeUnit.MILLISECONDS); } } catch (InterruptedException e) { Thread.currentThread().interrupt(); log.error("Error when scheduling System Time Based Scheduler", e); } finally { mutex.release(); } } } } catch (Throwable t) { log.error(t); } }
Source:
public void deleteDependenciesAfterConversion(){ createWithRuntime(); new CheckBox("Delete original references from project").toggle(true); finishConversionDialog(); checkProblemsAndResolve(); PropertyDialog pd = openPropertiesProject(WEB_PROJECT_NAME); new DefaultTreeItem("Java Build Path").select(); new DefaultTabItem("Libraries").activate(); List<TreeItem> itRootDirs = new DefaultTree(1).getItems(); List<TreeItem> it = new ArrayList<TreeItem>(); for (TreeItem i: itRootDirs) { if (getJavaVersion().equals("1.8")) { it.add(i); } else { it.addAll(i.getItems()); } } log.debug("Libraries found after conversion:"); for(TreeItem i: it){ log.debug(" "+i.getText()); } assertTrue("project contains more libraries than expected",it.size()==2); for(TreeItem i: it){ if(!(i.getText().contains("JRE") || i.getText().contains("Maven Dependencies"))){ fail("Some dependencies are missing after conversion"); } } pd.ok(); new WaitWhile(new ShellIsAvailable("Properties for "+WEB_PROJECT_NAME),TimePeriod.DEFAULT); }

Target:
public void deleteDependenciesAfterConversion(){ createWithRuntime(); new CheckBox("Delete original references from project").toggle(true); finishConversionDialog(); checkProblemsAndResolve(); PropertyDialog pd = openPropertiesProject(WEB_PROJECT_NAME); List<String> libs = getJavaBuildPathLibraries(pd); assertTrue("project contains more libraries than expected", libs.size() == 2); for (String i : libs) { if (!(i.contains("JRE") || i.contains("Maven Dependencies"))) { fail("Some dependencies are missing after conversion"); } } pd.ok(); new WaitWhile(new ShellIsAvailable("Properties for "+WEB_PROJECT_NAME),TimePeriod.DEFAULT); }
Source:
public void compareLists_shouldPassIfMapOfDifferencesIsCorrect() { LinkedList<Integer> origList = new LinkedList<>(Arrays.asList(1,2,3)); LinkedList<Integer> newList = new LinkedList<>(Arrays.asList(2,3,4)); Collection<Collection<Integer>> m = OpenmrsUtil.compareLists(origList, newList); Vector<Collection<Integer>> v = new Vector<Collection<Integer>>(m); LinkedList<Integer> toAdd = (LinkedList<Integer>)v.get(0); LinkedList<Integer> toDel = (LinkedList<Integer>)v.get(1); Assert.assertThat(toAdd.size(), is(1)); Assert.assertThat(toDel.size(), is(1)); Assert.assertThat(toAdd, Matchers.hasItems(4)); Assert.assertThat(toDel, Matchers.hasItems(1)); }

Target:
public void compareLists_shouldPassIfMapOfDifferencesIsCorrect() { LinkedList<Integer> origList = new LinkedList<>(Arrays.asList(1,2,3)); LinkedList<Integer> newList = new LinkedList<>(Arrays.asList(2,3,4)); Collection<Collection<Integer>> result = OpenmrsUtil.compareLists(origList, newList); Iterator<Collection<Integer>> it = result.iterator(); assertThat(result.size(), is(2)); assertThat(it.next(), contains(4)); assertThat(it.next(), contains(1)); }
Source:
private static void setProperty(javax.jms.Message msg, String key, Object value) throws JMSException { if (value instanceof UnsignedLong) { long v = ((UnsignedLong) value).longValue(); msg.setLongProperty(key, v); } else if (value instanceof UnsignedInteger) { long v = ((UnsignedInteger) value).longValue(); if (Integer.MIN_VALUE <= v && v <= Integer.MAX_VALUE) { msg.setIntProperty(key, (int) v); } else { msg.setLongProperty(key, v); } } else if (value instanceof UnsignedShort) { int v = ((UnsignedShort) value).intValue(); if (Short.MIN_VALUE <= v && v <= Short.MAX_VALUE) { msg.setShortProperty(key, (short) v); } else { msg.setIntProperty(key, v); } } else if (value instanceof UnsignedByte) { short v = ((UnsignedByte) value).shortValue(); if (Byte.MIN_VALUE <= v && v <= Byte.MAX_VALUE) { msg.setByteProperty(key, (byte) v); } else { msg.setShortProperty(key, v); } } else if (value instanceof Symbol) { msg.setStringProperty(key, value.toString()); } else if (value instanceof Decimal128) { msg.setDoubleProperty(key, ((Decimal128) value).doubleValue()); } else if (value instanceof Decimal64) { msg.setDoubleProperty(key, ((Decimal64) value).doubleValue()); } else if (value instanceof Decimal32) { msg.setFloatProperty(key, ((Decimal32) value).floatValue()); } else if (value instanceof Binary) { msg.setObjectProperty(key, ((Binary) value).getArray()); } else { msg.setObjectProperty(key, value); } }

Target:
private static void setProperty(javax.jms.Message msg, String key, Object value) throws JMSException { if (value instanceof UnsignedLong) { long v = ((UnsignedLong) value).longValue(); msg.setLongProperty(key, v); } else if (value instanceof UnsignedInteger) { long v = ((UnsignedInteger) value).longValue(); if (Integer.MIN_VALUE <= v && v <= Integer.MAX_VALUE) { msg.setIntProperty(key, (int) v); } else { msg.setLongProperty(key, v); } } else if (value instanceof UnsignedShort) { int v = ((UnsignedShort) value).intValue(); if (Short.MIN_VALUE <= v && v <= Short.MAX_VALUE) { msg.setShortProperty(key, (short) v); } else { msg.setIntProperty(key, v); } } else if (value instanceof UnsignedByte) { short v = ((UnsignedByte) value).shortValue(); if (Byte.MIN_VALUE <= v && v <= Byte.MAX_VALUE) { msg.setByteProperty(key, (byte) v); } else { msg.setShortProperty(key, v); } } else if (value instanceof Symbol) { msg.setStringProperty(key, value.toString()); } else if (value instanceof Decimal128) { msg.setDoubleProperty(key, ((Decimal128) value).doubleValue()); } else if (value instanceof Decimal64) { msg.setDoubleProperty(key, ((Decimal64) value).doubleValue()); } else if (value instanceof Decimal32) { msg.setFloatProperty(key, ((Decimal32) value).floatValue()); } else if (value instanceof Binary) { Binary bin = (Binary) value; msg.setObjectProperty(key, Arrays.copyOfRange(bin.getArray(), bin.getArrayOffset(), bin.getLength())); } else { msg.setObjectProperty(key, value); } }
Source:
public String toString() { return toString(" ", " |-> ", ".Map"); }

Target:
public String toString() { return toString(" ", " |-> ", DataStructureSort.DEFAULT_MAP_UNIT_LABEL); }
Source:
public void close() { endOut(); if (errorThread != null) { try { errorThread.halt(); } catch (final InterruptedException e) { } finally { errorThread = null; } } super.close(); process.destroy(); }

Target:
public void close() { endOut(); if (errorThread != null) { try { errorThread.halt(); } catch (InterruptedException e) { } finally { errorThread = null; } } super.close(); process.destroy(); }
Source:
public FutureResult<ScheduleExecution> executeSchedule(final Schedule schedule) { notNull(schedule, "schedule"); ScheduleExecution scheduleExecution; try { scheduleExecution = restTemplate.postForObject(schedule.getExecutionsUri(), new ScheduleExecution(), ScheduleExecution.class); } catch (GoodDataException | RestClientException e) { throw new ScheduleExecutionException("Cannot execute schedule", e); } return new PollResult<>(this, new AbstractPollHandler<ScheduleExecution, ScheduleExecution>(scheduleExecution.getUri(), ScheduleExecution.class, ScheduleExecution.class) { @Override public boolean isFinished(ClientHttpResponse response) throws IOException { final ScheduleExecution pollResult = new ObjectMapper().readValue(response.getBody(), ScheduleExecution.class); return isFinished(pollResult.getStatus()); } @Override public void handlePollResult(final ScheduleExecution pollResult) { setResult(pollResult); } @Override public void handlePollException(final GoodDataRestException e) { throw new ScheduleExecutionException("Cannot execute schedule", e); } private boolean isFinished(final String status) { return Arrays.asList("OK", "ERROR", "CANCELED", "TIMEOUT").contains(status); } }); }

Target:
public FutureResult<ScheduleExecution> executeSchedule(final Schedule schedule) { notNull(schedule, "schedule"); ScheduleExecution scheduleExecution; try { scheduleExecution = restTemplate.postForObject(schedule.getExecutionsUri(), new ScheduleExecution(), ScheduleExecution.class); } catch (GoodDataException | RestClientException e) { throw new ScheduleExecutionException("Cannot execute schedule", e); } return new PollResult<>(this, new AbstractPollHandler<ScheduleExecution, ScheduleExecution>(scheduleExecution.getUri(), ScheduleExecution.class, ScheduleExecution.class) { @Override public boolean isFinished(ClientHttpResponse response) throws IOException { final ScheduleExecution pollResult = extractData(response, ScheduleExecution.class); return pollResult.isFinished(); } @Override public void handlePollResult(final ScheduleExecution pollResult) { setResult(pollResult); } @Override public void handlePollException(final GoodDataRestException e) { throw new ScheduleExecutionException("Cannot execute schedule", e); } }); }
Source:
protected void findUsers(String searchString, AsyncQuery query) { Frontend.getInstance() .runQuery(VdcQueryType.Search, new SearchParameters("ADUSER@" + extractAuthorizationProvider((String) getProfile().getSelectedItem()) + ": " + searchString, SearchType.DirectoryUser), query); }

Target:
protected void findUsers(String searchString, AsyncQuery query) { Frontend.getInstance() .runQuery(VdcQueryType.Search, new SearchParameters("ADUSER@" + extractAuthorizationProvider((ProfileEntry) getProfile().getSelectedItem()) + ": " + searchString, SearchType.DirectoryUser), query); }
Source:
private static String initMiniCluster(Configuration conf, ReadOnlyProps overrideProps) { setUpConfigForMiniCluster(conf, overrideProps); utility = new HBaseTestingUtility(conf); try { utility.startMiniCluster(NUM_SLAVES_BASE, true); return getLocalClusterUrl(utility); } catch (Throwable t) { throw new RuntimeException(t); } }

Target:
private static String initMiniCluster(Configuration conf, ReadOnlyProps overrideProps) { setUpConfigForMiniCluster(conf, overrideProps); utility = new HBaseTestingUtility(conf); try { utility.startMiniCluster(NUM_SLAVES_BASE); return getLocalClusterUrl(utility); } catch (Throwable t) { throw new RuntimeException(t); } }
Source:
public void setUp() { workerApplicationContext = new AnnotationConfigApplicationContext(WorkerConfiguration.class); System.out.println("Started a worker.."); }

Target:
public void setUp() throws Exception { this.brokerService = new BrokerService(); this.brokerService.addConnector(this.brokerUrl); this.brokerService.setDataDirectory(BROKER_DATA_DIRECTORY); this.brokerService.start(); this.workerApplicationContext = new AnnotationConfigApplicationContext(WorkerConfiguration.class); }
Source:
private void setupAudioButton(int rowId, AudioPlaybackButton audioPlaybackButton, MenuDisplayable menuDisplayable) { final String audioURI = menuDisplayable.getAudioURI(); String audioFilename = ""; if (audioURI != null && !audioURI.equals("")) { try { audioFilename = ReferenceManager.instance().DeriveReference(audioURI).getLocalURI(); } catch (InvalidReferenceException e) { Log.e("AVTLayout", "Invalid reference exception"); e.printStackTrace(); } } File audioFile = new File(audioFilename); ViewId viewId = ViewId.buildListViewId(rowId); if (!"".equals(audioFilename) && audioFile.exists()) { audioPlaybackButton.modifyButtonForNewView(viewId, audioURI, true); } else { if (audioPlaybackButton != null) { audioPlaybackButton.modifyButtonForNewView(viewId, audioURI, false); audioPlaybackButton.setVisibility(View.GONE); } } }

Target:
private void setupAudioButton(int rowId, AudioPlaybackButton audioPlaybackButton, MenuDisplayable menuDisplayable) { final String audioURI = menuDisplayable.getAudioURI(); String audioFilename = ""; if (audioURI != null && !audioURI.equals("")) { try { audioFilename = ReferenceManager.instance().DeriveReference(audioURI).getLocalURI(); } catch (InvalidReferenceException e) { Log.e("AVTLayout", "Invalid reference exception"); e.printStackTrace(); } } File audioFile = new File(audioFilename); ViewId viewId = ViewId.buildListViewId(rowId); if (!"".equals(audioFilename) && audioFile.exists()) { audioPlaybackButton.modifyButtonForNewView(viewId, audioURI, true); } else { if (audioPlaybackButton != null) { audioPlaybackButton.modifyButtonForNewView(viewId, audioURI, false); } } }
Source:
private Connection getConnectionWithRetry(String connectionURL) { Connection connection=null; try{ connection = getConnectionWithRetry(connectionURL, true); } catch (Exception e) { LOG.error("Failed to get connection with namespace enabled", e); try { connection = getConnectionWithRetry(connectionURL, false); } catch (Exception ex) { LOG.error("Failed to get connection without namespace enabled", ex); } } return connection; }

Target:
private Connection getConnectionWithRetry(String connectionURL) { Connection connection=null; try{ connection = getConnectionWithRetry(connectionURL, true); } catch (Exception e) { LOG.info("Failed to get connection with namespace enabled", e); try { connection = getConnectionWithRetry(connectionURL, false); } catch (Exception ex) { LOG.info("Failed to get connection without namespace enabled", ex); } } return connection; }
Source:
public static OzoneClient getRpcClient(String omServiceId, Configuration config) throws IOException { Preconditions.checkNotNull(omServiceId); Preconditions.checkNotNull(config); config.set(OZONE_OM_ADDRESS_KEY, omServiceId); return getClient(getClientProtocol(config, omServiceId), config); }

Target:
public static OzoneClient getRpcClient(String omServiceId, Configuration config) throws IOException { Preconditions.checkNotNull(omServiceId); Preconditions.checkNotNull(config); return getClient(getClientProtocol(config, omServiceId), config); }
Source:
private void createReasonNote(ActionForm form) { KualiDocumentFormBase kualiDocumentFormBase = (KualiDocumentFormBase) form; try { Note noteObj = SpringContext.getBean(DocumentService.class).createNoteFromDocument(kualiDocumentFormBase.getDocument(), ((PurchasingFormBase)kualiDocumentFormBase).getReasonToChange()); populateIdentifierOnNoteAndExtension(noteObj); kualiDocumentFormBase.getDocument().addNote(noteObj); if (isNoteReadyToBeSaved(kualiDocumentFormBase.getDocument(), noteObj)) { getNoteService().save(noteObj); } ((PurchasingFormBase)kualiDocumentFormBase).setReasonToChange(KFSConstants.EMPTY_STRING); } catch(Exception e){ String errorMessage = "Error creating and saving close note for reason change requirement with document service"; LOG.error("createReasonNote " + errorMessage, e); throw new RuntimeException(errorMessage, e); } }

Target:
private void createReasonNote(ActionForm form) { KualiDocumentFormBase kualiDocumentFormBase = (KualiDocumentFormBase) form; try { Note noteObj = SpringContext.getBean(DocumentService.class).createNoteFromDocument(kualiDocumentFormBase.getDocument(), ((PurchasingFormBase)kualiDocumentFormBase).getReasonToChange()); populateIdentifierOnNoteAndExtension(noteObj); kualiDocumentFormBase.getDocument().addNote(noteObj); if (doesDocumentAllowImmediateSaveOfNewNote(kualiDocumentFormBase.getDocument(), noteObj)) { getNoteService().save(noteObj); } ((PurchasingFormBase)kualiDocumentFormBase).setReasonToChange(KFSConstants.EMPTY_STRING); } catch(Exception e){ String errorMessage = "Error creating and saving close note for reason change requirement with document service"; LOG.error("createReasonNote " + errorMessage, e); throw new RuntimeException(errorMessage, e); } }
Source:
public void onError(Throwable t) { throw newIllegalStateException(t, "Error observing the external messages for consumer " + "with tag %s.", delegate.getTag()); }

Target:
public void onError(Throwable t) { throw newIllegalStateException(t, "Error observing the messages for consumer with tag %s.", delegate.getTag()); }
Source:
public void uploadFile(final Path localPath, final Path remotePath, final AbstractBackupPath path, final int retry, final boolean deleteAfterSuccessfulUpload) throws FileNotFoundException, BackupRestoreException { if (localPath == null || remotePath == null || !localPath.toFile().exists() || localPath.toFile().isDirectory()) throw new FileNotFoundException("File do not exist or is a directory. localPath: " + localPath + ", remotePath: " + remotePath); if (!tasksQueued.contains(localPath)) { tasksQueued.add(localPath); logger.info("Uploading file: to location: {}", localPath, remotePath); try { notifyEventStart(new BackupEvent(path)); long uploadedFileSize = new BoundedExponentialRetryCallable<Long>(500, 10000, retry) { @Override public Long retriableCall() throws Exception { return uploadFileImpl(localPath, remotePath); } }.call(); backupMetrics.recordUploadRate(uploadedFileSize); backupMetrics.incrementValidUploads(); path.setCompressedFileSize(uploadedFileSize); notifyEventSuccess(new BackupEvent(path)); logger.info("Successfully uploaded file: to location: {}", localPath, remotePath); if (deleteAfterSuccessfulUpload) FileUtils.deleteQuietly(localPath.toFile()); } catch (Exception e) { backupMetrics.incrementInvalidUploads(); notifyEventFailure(new BackupEvent(path)); logger.error("Error while uploading file: to location: {}", localPath, remotePath); throw new BackupRestoreException(e.getMessage()); } finally { tasksQueued.remove(localPath); } } else logger.info("Already in queue, no-op. File: {}", localPath); }

Target:
public void uploadFile(final Path localPath, final Path remotePath, final AbstractBackupPath path, final int retry, final boolean deleteAfterSuccessfulUpload) throws FileNotFoundException, BackupRestoreException { if (localPath == null || remotePath == null || !localPath.toFile().exists() || localPath.toFile().isDirectory()) throw new FileNotFoundException("File do not exist or is a directory. localPath: " + localPath + ", remotePath: " + remotePath); if (tasksQueued.add(localPath)) { logger.info("Uploading file: to location: {}", localPath, remotePath); try { notifyEventStart(new BackupEvent(path)); long uploadedFileSize = new BoundedExponentialRetryCallable<Long>(500, 10000, retry) { @Override public Long retriableCall() throws Exception { return uploadFileImpl(localPath, remotePath); } }.call(); backupMetrics.recordUploadRate(uploadedFileSize); backupMetrics.incrementValidUploads(); path.setCompressedFileSize(uploadedFileSize); notifyEventSuccess(new BackupEvent(path)); logger.info("Successfully uploaded file: to location: {}", localPath, remotePath); if (deleteAfterSuccessfulUpload) FileUtils.deleteQuietly(localPath.toFile()); } catch (Exception e) { backupMetrics.incrementInvalidUploads(); notifyEventFailure(new BackupEvent(path)); logger.error("Error while uploading file: to location: {}", localPath, remotePath); throw new BackupRestoreException(e.getMessage()); } finally { tasksQueued.remove(localPath); } } else logger.info("Already in queue, no-op. File: {}", localPath); }
Source:
public void tailsNonUtf() throws Exception { final SSHD sshd = new SSHD(this.temp.newFolder()); final File home = new File(sshd.home(), "testTail"); FileUtils.forceMkdir(home); final String clean = "some output"; FileUtils.write( new File(home, "stdout"), String.format("%s\u00ea", clean) ); final Talk talk = new Talk.InFile(); final String hash = "a1b5c3e3"; talk.modify( new Directives().xpath("/talk") .add("daemon") .attr(TailITCase.DIRECTIVE_ID_KEY, hash) .add("title").set("tail").up() .add("script").set("empty").up() .add("dir").set(home.getAbsolutePath()).up() .add("code").set("-7").up() .add("started").set(new Time().iso()).up() .add("ended").set(new Time().iso()).up().up() .add("shell").attr(TailITCase.DIRECTIVE_ID_KEY, hash) .add("host").set("localhost").up() .add("port").set(Integer.toString(sshd.port())).up() .add("login").set(sshd.login()).up() .add("key").set(sshd.key()).up().up() ); final Tail agent = new Tail(talk.read(), hash); MatcherAssert.assertThat( IOUtils.toString(agent.read(), Charsets.UTF_8), Matchers.equalTo(String.format("%sê\n", clean)) ); }

Target:
public void tailsNonUtf() throws Exception { final SSHD sshd = new SSHD(this.temp.newFolder()); final File home = new File(sshd.home(), "testTail"); FileUtils.forceMkdir(home); final String clean = "some output"; FileUtils.write( new File(home, "stdout"), String.format("%s\u00ea", clean) ); final Talk talk = new Talk.InFile(); final String hash = "a1b5c3e3"; final String key = "id"; talk.modify( new Directives().xpath("/talk") .add("daemon") .attr(key, hash) .add("title").set("tail").up() .add("script").set("empty").up() .add("dir").set(home.getAbsolutePath()).up() .add("code").set("-7").up() .add("started").set(new Time().iso()).up() .add("ended").set(new Time().iso()).up().up() .add("shell").attr(key, hash) .add("host").set("localhost").up() .add("port").set(Integer.toString(sshd.port())).up() .add("login").set(sshd.login()).up() .add("key").set(sshd.key()).up().up() ); MatcherAssert.assertThat( IOUtils.toString( new Tail(talk.read(), hash).read(), Charsets.UTF_8 ), Matchers.is(String.format("%sê\n", clean)) ); }
Source:
public static void setInterestClient(EurekaInterestClient interestClient) { Eureka2Clients.interestClient = interestClient; }

Target:
public static EurekaInterestClient setInterestClient(EurekaInterestClient interestClient) { return Eureka2Clients.interestClient.getAndSet(interestClient); }
Source:
public boolean addPredicates(AbstractSqlWriter writer) throws OseeCoreException { Collection<String> ids = criteria.getIds(); if (ids.size() > 1) { joinQuery = writer.writeCharJoin(ids); writer.write(artAlias); writer.write(".guid = "); writer.write(jguidAlias); writer.write(".id AND "); writer.write(jguidAlias); writer.write(".query_id = ?"); writer.addParameter(joinQuery.getQueryId()); } else { writer.write(artAlias); writer.write(".guid = ?"); writer.addParameter(ids.iterator().next()); } if (withClause != null) { writer.write(" AND "); writer.write(withClauseName); writer.write(".transaction_id = "); writer.write(txsAlias); writer.write(".transaction_id AND "); writer.write(withClauseName); writer.write(".art_id = "); writer.write(artAlias); writer.write(".art_id\n"); } writer.write(" AND "); writer.write(artAlias); writer.write(".gamma_id = "); writer.write(txsAlias); writer.write(".gamma_id AND "); ArtifactQuerySqlWriter specificWriter = (ArtifactQuerySqlWriter) writer; writer.write(specificWriter.getTxFilterWithBranch(txsAlias, OptionsUtil.areDeletedArtifactsIncluded(writer.getOptions()))); return true; }

Target:
public boolean addPredicates(AbstractSqlWriter writer) throws OseeCoreException { Collection<String> ids = criteria.getIds(); if (ids.size() > 1) { joinQuery = writer.writeCharJoin(ids); writer.write(artAlias); writer.write(".guid = "); writer.write(jguidAlias); writer.write(".id AND "); writer.write(jguidAlias); writer.write(".query_id = ?"); writer.addParameter(joinQuery.getQueryId()); } else { writer.write(artAlias); writer.write(".guid = ?"); writer.addParameter(ids.iterator().next()); } if (withClause != null) { writer.write(" AND "); writer.write(withClauseName); writer.write(".transaction_id = "); writer.write(txsAlias); writer.write(".transaction_id AND "); writer.write(withClauseName); writer.write(".art_id = "); writer.write(artAlias); writer.write(".art_id\n"); } writer.write(" AND "); writer.write(artAlias); writer.write(".gamma_id = "); writer.write(txsAlias); writer.write(".gamma_id AND "); writer.write(getTxFilterWithBranch(txsAlias, OptionsUtil.areDeletedArtifactsIncluded(writer.getOptions()), branchId, writer)); return true; }
Source:
public void run(ITestInvocationListener listener) throws DeviceNotAvailableException { for (int j = 0; j < mRepeatedRun; j++) { String runName = mBaseRunName + j; if (mIncludeFilters.isEmpty()) { listener.testRunStarted(runName, mNumTest); } else { CLog.e("%s", mIncludeFilters); listener.testRunStarted(runName, mIncludeFilters.size() / mRepeatedRun); } for (int i = 0; i < mNumTest - mFailedTest; i++) { TestDescription test = new TestDescription(runName + "class", "test" + i); if (!mIncludeFilters.isEmpty() && !mIncludeFilters.contains(test.toString())) { continue; } listener.testStarted(test); listener.testEnded(test, new HashMap<String, Metric>()); } for (int i = 0; i < mFailedTest; i++) { TestDescription test = new TestDescription(runName + "class", "fail" + i); if (!mIncludeFilters.isEmpty() && !mIncludeFilters.contains(test.toString())) { continue; } listener.testStarted(test); listener.testFailed(test, "I failed."); listener.testEnded(test, new HashMap<String, Metric>()); } listener.testRunEnded(0, new HashMap<String, Metric>()); } }

Target:
public void run(ITestInvocationListener listener) throws DeviceNotAvailableException { for (int j = 0; j < mRepeatedRun; j++) { String runName = mBaseRunName + j; if (mIncludeFilters.isEmpty()) { listener.testRunStarted(runName, mNumTest); } else { listener.testRunStarted(runName, mIncludeFilters.size() / mRepeatedRun); } for (int i = 0; i < mNumTest - mFailedTest; i++) { TestDescription test = new TestDescription(runName + "class", "test" + i); if (!mIncludeFilters.isEmpty() && !mIncludeFilters.contains(test.toString())) { continue; } listener.testStarted(test); listener.testEnded(test, new HashMap<String, Metric>()); } for (int i = 0; i < mFailedTest; i++) { TestDescription test = new TestDescription(runName + "class", "fail" + i); if (!mIncludeFilters.isEmpty() && !mIncludeFilters.contains(test.toString())) { continue; } listener.testStarted(test); listener.testFailed(test, "I failed."); listener.testEnded(test, new HashMap<String, Metric>()); } listener.testRunEnded(0, new HashMap<String, Metric>()); } }
Source:
public void play() { try { Log.i(TAG, filePath); new File((new File(this.filePath).getParentFile().list())[0]) .exists(); if (player.isPlaying()) { player.stop(); } this.paused = false; player.reset(); FileInputStream fis = new FileInputStream(this.filePath); player.setDataSource(fis.getFD()); player.prepare(); player.start(); this.messagingService .getService() .sendPlayStatusMessage(PlayStatusMessage.PLAY_MESSAGE); } catch (Exception e) { Log.wtf(TAG, "Unable to play song: " + this.filePath); e.printStackTrace(); } }

Target:
public void play() { if (isValidPath()) { try { if (player.isPlaying()) { player.stop(); } this.paused = false; player.reset(); FileInputStream fis = new FileInputStream(entry.getFilePath()); player.setDataSource(fis.getFD()); player.prepare(); player.start(); this.messagingService.getService().sendPlayStatusMessage( this.entry, true); } catch (Exception e) { Log.wtf(TAG, "Unable to play song: " + entry.getFilePath()); } } else { Log.w(TAG, "File Path was not valid"); } }
Source:
void toggleCamera() { editor = sp.edit(); CameraSettings settings = barcodeView.getBarcodeView().getCameraSettings(); if (barcodeView.getBarcodeView().isPreviewActive()) { barcodeView.pause(); } if (cameraState == Camera.CameraInfo.CAMERA_FACING_BACK) { cameraState = Camera.CameraInfo.CAMERA_FACING_FRONT; } else { cameraState = Camera.CameraInfo.CAMERA_FACING_BACK; } settings.setRequestedCameraId(cameraState); barcodeView.getBarcodeView().setCameraSettings(settings); editor.putInt("cameraState",cameraState); editor.apply(); barcodeView.resume(); }

Target:
void toggleCamera() { editor = sp.edit(); CameraSettings settings = barcodeView.getBarcodeView().getCameraSettings(); if (barcodeView.getBarcodeView().isPreviewActive()) { barcodeView.pause(); } if (settings.getRequestedCameraId() == Camera.CameraInfo.CAMERA_FACING_BACK) { cameraState = Camera.CameraInfo.CAMERA_FACING_FRONT; } else { cameraState = Camera.CameraInfo.CAMERA_FACING_BACK; } settings.setRequestedCameraId(cameraState); barcodeView.getBarcodeView().setCameraSettings(settings); editor.putInt("cameraState",cameraState); editor.apply(); barcodeView.resume(); }
Source:
private void beforeTest(Config cfg, boolean memory, boolean enableHttpd) throws Exception { server = startServer(cfg, memory, enableHttpd); server.getTestInjector().injectMembers(this); init(); }

Target:
private void beforeTest(Config cfg, boolean memory, boolean enableHttpd) throws Exception { server = startServer(cfg, memory, enableHttpd); server.getTestInjector().injectMembers(this); try { dbHandle = server.getTestInjector().getInstance(InMemoryDatabase.class); } catch (Exception e) init(); }
Source:
setChannelOptions(Configuration configuration, BigtableOptions.Builder builder) throws IOException { setCredentialOptions(builder, configuration); builder.setRetryOptions(createRetryOptions(configuration)); int channelCount = configuration.getInt( BIGTABLE_DATA_CHANNEL_COUNT_KEY, BigtableOptions.BIGTABLE_DATA_CHANNEL_COUNT_DEFAULT); builder.setDataChannelCount(channelCount); StringBuilder agentBuidler = new StringBuilder(); agentBuidler.append("hbase-").append(VersionInfo.getVersion()); String customUserAgent = configuration.get(CUSTOM_USER_AGENT_KEY); if (customUserAgent != null) { agentBuidler.append(',').append(customUserAgent); } builder.setUserAgent(agentBuidler.toString()); }

Target:
setChannelOptions(Configuration configuration, BigtableOptions.Builder builder) throws IOException { setCredentialOptions(builder, configuration); builder.setRetryOptions(createRetryOptions(configuration)); int channelCount = configuration.getInt( BIGTABLE_DATA_CHANNEL_COUNT_KEY, BigtableOptions.BIGTABLE_DATA_CHANNEL_COUNT_DEFAULT); builder.setDataChannelCount(channelCount); StringBuilder agentBuilder = new StringBuilder(); agentBuilder.append("hbase-").append(VersionInfo.getVersion()); String customUserAgent = configuration.get(CUSTOM_USER_AGENT_KEY); if (customUserAgent != null) { agentBuilder.append(',').append(customUserAgent); } builder.setUserAgent(agentBuilder.toString()); }
Source:
private void validateProjects(Devfile devfile) throws DevfileFormatException { Set<String> existingNames = new HashSet<>(); for (Project project : devfile.getProjects()) { if (!existingNames.add(project.getName())) { throw new DevfileFormatException( format("Duplicate project name found:'%s'", project.getName())); } if (!PROJECT_NAME_PATTERN.matcher(project.getName()).matches()) { throw new DevfileFormatException( format( "Invalid project name found:'%s'. Name must contain only Latin letters,\n" + "digits or these following special characters ._-", project.getName())); } } }

Target:
private void validateProjects(Devfile devfile) throws DevfileFormatException { Set<String> existingNames = new HashSet<>(); for (Project project : devfile.getProjects()) { if (!existingNames.add(project.getName())) { throw new DevfileFormatException( format("Duplicate project name found:'%s'", project.getName())); } if (!PROJECT_NAME_PATTERN.matcher(project.getName()).matches()) { throw new DevfileFormatException( format( "Invalid project name found:'%s'. Name must contain only Latin letters," + "digits or these following special characters ._-", project.getName())); } } }
Source:
private static Set<CfgBranchingBlock> findRootBranchingBlocks(ControlFlowGraph flowGraph, IterationStatementTree iteration, @Nullable JavaScriptTree condition) { return flowGraph.blocks().stream() .filter(cfgBlock -> cfgBlock instanceof CfgBranchingBlock) .map(cfgBlock -> (CfgBranchingBlock) cfgBlock) .filter(cfgBranchingBlock -> { final Tree branchingTree = cfgBranchingBlock.branchingTree(); if (iteration.equals(branchingTree)) { return true; } if (condition != null) { return condition.equals(branchingTree) || condition.isAncestorOf((JavaScriptTree) branchingTree); } return false; }) .collect(Collectors.toSet()); }

Target:
private static Set<CfgBranchingBlock> findRootBranchingBlocks(ControlFlowGraph flowGraph, IterationStatementTree iteration, @Nullable JavaScriptTree condition) { return flowGraph.blocks().stream() .filter(cfgBlock -> cfgBlock instanceof CfgBranchingBlock) .map(cfgBlock -> (CfgBranchingBlock) cfgBlock) .filter(cfgBranchingBlock -> blockBelongsToLoopEndCondition(cfgBranchingBlock, iteration, condition)) .collect(Collectors.toSet()); }
Source:
public KeyAsyncClient buildAsyncClient() { Configuration buildConfiguration = (configuration == null) ? Configuration.getGlobalConfiguration().clone() : configuration; URL buildEndpoint = getBuildEndpoint(buildConfiguration); if (buildEndpoint == null) { throw logger .logExceptionAsError(new IllegalStateException(KeyVaultErrorCodeStrings .getErrorString(KeyVaultErrorCodeStrings.VAULT_END_POINT_REQUIRED))); } KeyServiceVersion serviceVersion = version != null ? version : KeyServiceVersion.getLatest(); if (pipeline != null) { return new KeyAsyncClient(vaultUrl, pipeline, serviceVersion); } if (credential == null) { throw logger.logExceptionAsError( new IllegalStateException(KeyVaultErrorCodeStrings .getErrorString(KeyVaultErrorCodeStrings.CREDENTIAL_REQUIRED))); } final List<HttpPipelinePolicy> policies = new ArrayList<>(); policies.add(new UserAgentPolicy(httpLogOptions.getApplicationId(), properties.get(SDK_NAME), properties.get(SDK_VERSION), buildConfiguration)); HttpPolicyProviders.addBeforeRetryPolicies(policies); policies.add(retryPolicy); policies.add(new KeyVaultCredentialPolicy(credential)); policies.addAll(this.policies); HttpPolicyProviders.addAfterRetryPolicies(policies); policies.add(new HttpLoggingPolicy(httpLogOptions)); HttpPipeline pipeline = new HttpPipelineBuilder() .policies(policies.toArray(new HttpPipelinePolicy[0])) .httpClient(httpClient) .build(); return new KeyAsyncClient(vaultUrl, pipeline, serviceVersion); }

Target:
public KeyAsyncClient buildAsyncClient() { Configuration buildConfiguration = (configuration == null) ? Configuration.getGlobalConfiguration().clone() : configuration; URL buildEndpoint = getBuildEndpoint(buildConfiguration); if (buildEndpoint == null) { throw logger .logExceptionAsError(new IllegalStateException(KeyVaultErrorCodeStrings .getErrorString(KeyVaultErrorCodeStrings.VAULT_END_POINT_REQUIRED))); } KeyServiceVersion serviceVersion = version != null ? version : KeyServiceVersion.getLatest(); if (pipeline != null) { return new KeyAsyncClient(vaultUrl, pipeline, serviceVersion); } if (credential == null) { throw logger.logExceptionAsError( new IllegalStateException(KeyVaultErrorCodeStrings .getErrorString(KeyVaultErrorCodeStrings.CREDENTIAL_REQUIRED))); } final List<HttpPipelinePolicy> policies = new ArrayList<>(); String clientName = properties.getOrDefault(SDK_NAME, "UnknownName"); String clientVersion = properties.getOrDefault(SDK_VERSION, "UnknownVersion"); policies.add(new UserAgentPolicy(httpLogOptions.getApplicationId(), clientName, clientVersion, buildConfiguration)); HttpPolicyProviders.addBeforeRetryPolicies(policies); policies.add(retryPolicy); policies.add(new KeyVaultCredentialPolicy(credential)); policies.addAll(this.policies); HttpPolicyProviders.addAfterRetryPolicies(policies); policies.add(new HttpLoggingPolicy(httpLogOptions)); HttpPipeline pipeline = new HttpPipelineBuilder() .policies(policies.toArray(new HttpPipelinePolicy[0])) .httpClient(httpClient) .build(); return new KeyAsyncClient(vaultUrl, pipeline, serviceVersion); }
Source:
public List<SourceRecord> poll() throws InterruptedException { log.trace("{} Polling for new data"); while (!stop.get()) { final TableQuerier querier = tableQueue.peek(); if (!querier.querying()) { final long nextUpdate = querier.getLastUpdate() + config.getInt(JdbcSourceTaskConfig.POLL_INTERVAL_MS_CONFIG); final long untilNext = nextUpdate - time.milliseconds(); if (untilNext > 0) { log.trace("Waiting ms to poll next", untilNext, querier.toString()); time.sleep(untilNext); continue; } } final List<SourceRecord> results = new ArrayList<>(); try { log.debug("Checking for next block of results from {}", querier.toString()); querier.maybeStartQuery(cachedConnectionProvider.getValidConnection()); int batchMaxRows = config.getInt(JdbcSourceTaskConfig.BATCH_MAX_ROWS_CONFIG); boolean hadNext = true; while (results.size() < batchMaxRows && (hadNext = querier.next())) { results.add(querier.extractRecord()); } if (!hadNext) { resetAndRequeueHead(querier); } if (results.isEmpty()) { log.trace("No updates for {}", querier.toString()); continue; } log.debug("Returning records for {}", results.size(), querier.toString()); return results; } catch (SQLException sqle) { log.error("Failed to run query for table {}: {}", querier.toString(), sqle); resetAndRequeueHead(querier); return null; } catch (Exception e) { resetAndRequeueHead(querier); throw e; } } final TableQuerier querier = tableQueue.peek(); if (querier != null) { resetAndRequeueHead(querier); } return null; }

Target:
public List<SourceRecord> poll() throws InterruptedException { log.trace("{} Polling for new data"); while (!stop.get()) { final TableQuerier querier = tableQueue.peek(); if (!querier.querying()) { final long nextUpdate = querier.getLastUpdate() + config.getInt(JdbcSourceTaskConfig.POLL_INTERVAL_MS_CONFIG); final long untilNext = nextUpdate - time.milliseconds(); if (untilNext > 0) { log.trace("Waiting ms to poll next", untilNext, querier.toString()); time.sleep(untilNext); continue; } } final List<SourceRecord> results = new ArrayList<>(); try { log.debug("Checking for next block of results from {}", querier.toString()); querier.maybeStartQuery(cachedConnectionProvider.getValidConnection()); int batchMaxRows = config.getInt(JdbcSourceTaskConfig.BATCH_MAX_ROWS_CONFIG); boolean hadNext = true; while (results.size() < batchMaxRows && (hadNext = querier.next())) { results.add(querier.extractRecord()); } if (!hadNext) { resetAndRequeueHead(querier); } if (results.isEmpty()) { log.trace("No updates for {}", querier.toString()); continue; } log.debug("Returning records for {}", results.size(), querier.toString()); return results; } catch (SQLException sqle) { log.error("Failed to run query for table {}: {}", querier.toString(), sqle); resetAndRequeueHead(querier); return null; } catch (Throwable t) { resetAndRequeueHead(querier); throw t; } } final TableQuerier querier = tableQueue.peek(); if (querier != null) { resetAndRequeueHead(querier); } return null; }
Source:
@Override public RelNode convert(RelNode rel) { LogicalRepeatUnion union = (LogicalRepeatUnion) rel; EnumerableConvention out = EnumerableConvention.INSTANCE; RelTraitSet traitSet = union.getTraitSet().replace(out); RelNode seedRel = union.getSeedRel(); RelNode iterativeRel = union.getIterativeRel(); return new EnumerableRepeatUnion( union.getMaxRep(), rel.getCluster(), traitSet, convert(seedRel, seedRel.getTraitSet().replace(EnumerableConvention.INSTANCE)), convert(iterativeRel, iterativeRel.getTraitSet().replace(EnumerableConvention.INSTANCE))); }

Target:
@Override public RelNode convert(RelNode rel) { LogicalRepeatUnion union = (LogicalRepeatUnion) rel; EnumerableConvention out = EnumerableConvention.INSTANCE; RelTraitSet traitSet = union.getTraitSet().replace(out); RelNode seedRel = union.getSeedRel(); RelNode iterativeRel = union.getIterativeRel(); return new EnumerableRepeatUnion( rel.getCluster(), traitSet, convert(seedRel, seedRel.getTraitSet().replace(out)), convert(iterativeRel, iterativeRel.getTraitSet().replace(out)), union.all, union.maxRep); }
Source:
CapacityPermit permitFor(String name, ScheduledExecutorConfig config) { CapacityPermit permit = permits.get(name); if (permit == null) { CapacityPermit newPermit = new MemberCapacityPermit(name, config.getCapacity()); permit = permits.putIfAbsent(name, newPermit); permit = (permit == null) ? newPermit : permit; } return permit; }

Target:
CapacityPermit permitFor(String name, ScheduledExecutorConfig config) { return permits.computeIfAbsent(name, n -> new MemberCapacityPermit(n, config.getCapacity())); }
Source:
public String getClasspath(){ try{ if(classpath != null) return classpath; if(!new File(targetDir + File.separator + "tacoco.cp").exists()) { MavenCli mavenCli = new MavenCli(); mavenCli.doMain(new String[]{"dependency:build-classpath", "-Dmdep.outputFile=tacoco.cp"}, targetDir, System.out, System.out); } classpath = new String(Files.readAllBytes(Paths.get(targetDir,"tacoco.cp"))) + File.pathSeparator + StringUtils.join(new String[]{targetDir, "target", "test-classes"}, File.separator) + File.pathSeparator + StringUtils.join(new String[]{targetDir, "target", "classes"}, File.separator); }catch(Exception e){ e.printStackTrace(); } return classpath; }

Target:
public String getClasspath(){ try{ if(classpath != null) return classpath; final String tacocoCpPath = new PathBuilder().path(targetDir).path("tacoco.cp").buildFilePath(); if(!new File(tacocoCpPath).exists()) { MavenCli mavenCli = new MavenCli(); mavenCli.doMain(new String[]{"dependency:build-classpath", "-Dmdep.outputFile=tacoco.cp"}, targetDir, System.out, System.out); } final String tacocoDependencies = new String(Files.readAllBytes(Paths.get(targetDir, "tacoco.cp"))); final String targetPath = new PathBuilder().path(targetDir).path("classes").buildFilePath(); final String targetTestPath = new PathBuilder().path(targetDir).path("test-classes").buildFilePath(); classpath = new PathBuilder().path(tacocoDependencies) .path(targetPath) .path(targetTestPath) .buildClassPath(); }catch(Exception e){ e.printStackTrace(); } return classpath; }
Source:
public <T> Repository<T> createRepository(EventStore eventStore, AggregateFactory<T> aggregateFactory, SnapshotTriggerDefinition snapshotTriggerDefinition, ParameterResolverFactory parameterResolverFactory) { return createRepository(eventStore, aggregateFactory, snapshotTriggerDefinition, parameterResolverFactory, new ClasspathHandlerDefinition(getClass().getClassLoader())); }

Target:
public <T> Repository<T> createRepository(EventStore eventStore, AggregateFactory<T> aggregateFactory, SnapshotTriggerDefinition snapshotTriggerDefinition, ParameterResolverFactory parameterResolverFactory) { return createRepository(eventStore, aggregateFactory, snapshotTriggerDefinition, parameterResolverFactory, ClasspathHandlerDefinition.forClass(aggregateFactory.getAggregateType()), null); }
Source:
BookieStateManager(ServerConfiguration conf, RegistrationManager registrationManager) throws IOException { this.conf = conf; this.registrationManager = registrationManager; this.statsLogger = null; this.ledgerDirsManager = new LedgerDirsManager(conf, conf.getLedgerDirs(), new DiskChecker(conf.getDiskUsageThreshold(), conf.getDiskUsageWarnThreshold()), NullStatsLogger.INSTANCE); this.bookieId = getMyId(); }

Target:
BookieStateManager(ServerConfiguration conf, RegistrationManager registrationManager) throws IOException { this(conf, NullStatsLogger.INSTANCE, registrationManager, new LedgerDirsManager(conf, conf.getLedgerDirs(), new DiskChecker(conf.getDiskUsageThreshold(), conf.getDiskUsageWarnThreshold()), NullStatsLogger.INSTANCE)); }