auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public BasicQueryInfo getBasicQueryInfo(Optional<BasicStageStats> rootStage) { QueryState state = queryState.get(); Duration elapsedTime; if (endNanos.get() != 0) { elapsedTime = succinctNanos(endNanos.get() - createNanos); } else { elapsedTime = nanosSince(createNanos); } ErrorCode errorCode = null; if (state == FAILED) { ExecutionFailureInfo failureCause = this.failureCause.get(); if (failureCause != null) { errorCode = failureCause.getErrorCode(); } } Duration queuedTime = this.queuedTime.get(); if (queuedTime == null) { queuedTime = elapsedTime; } Duration executionTime = succinctNanos((long) Math.max(0, elapsedTime.getValue(NANOSECONDS) - queuedTime.getValue(NANOSECONDS))); BasicStageStats stageStats = rootStage.orElse(EMPTY_STAGE_STATS); BasicQueryStats queryStats = new BasicQueryStats( createTime, executionStartTime.get(), queuedTime, elapsedTime.convertToMostSuccinctTimeUnit(), executionTime, stageStats.getTotalDrivers(), stageStats.getQueuedDrivers(), stageStats.getRunningDrivers(), stageStats.getCompletedDrivers(), stageStats.getRawInputDataSize(), stageStats.getRawInputPositions(), stageStats.getCumulativeUserMemory(), stageStats.getUserMemoryReservation(), stageStats.getTotalMemoryReservation(), succinctBytes(getPeakUserMemoryInBytes()), stageStats.getTotalCpuTime(), stageStats.getTotalScheduledTime(), stageStats.isFullyBlocked(), stageStats.getBlockedReasons(), stageStats.getProgressPercentage()); return new BasicQueryInfo( queryId, session.toSessionRepresentation(), resourceGroup, state, memoryPool.get().getId(), stageStats.isScheduled(), self, query, queryStats, errorCode == null ? null : errorCode.getType(), errorCode); }

Target:
public BasicQueryInfo getBasicQueryInfo(Optional<BasicStageStats> rootStage) { QueryState state = queryState.get(); ErrorCode errorCode = null; if (state == FAILED) { ExecutionFailureInfo failureCause = this.failureCause.get(); if (failureCause != null) { errorCode = failureCause.getErrorCode(); } } BasicStageStats stageStats = rootStage.orElse(EMPTY_STAGE_STATS); BasicQueryStats queryStats = new BasicQueryStats( queryStateTimer.getCreateTime(), getEndTime().orElse(null), queryStateTimer.getQueuedTime(), queryStateTimer.getElapsedTime(), queryStateTimer.getExecutionTime(), stageStats.getTotalDrivers(), stageStats.getQueuedDrivers(), stageStats.getRunningDrivers(), stageStats.getCompletedDrivers(), stageStats.getRawInputDataSize(), stageStats.getRawInputPositions(), stageStats.getCumulativeUserMemory(), stageStats.getUserMemoryReservation(), stageStats.getTotalMemoryReservation(), succinctBytes(getPeakUserMemoryInBytes()), stageStats.getTotalCpuTime(), stageStats.getTotalScheduledTime(), stageStats.isFullyBlocked(), stageStats.getBlockedReasons(), stageStats.getProgressPercentage()); return new BasicQueryInfo( queryId, session.toSessionRepresentation(), resourceGroup, state, memoryPool.get().getId(), stageStats.isScheduled(), self, query, queryStats, errorCode == null ? null : errorCode.getType(), errorCode); }
Source:
private static IEditorDescriptor getEditorDescriptor(String name, IEditorRegistry editorReg, IEditorDescriptor defaultDescriptor, boolean allowInteractive) throws PartInitException, OperationCanceledException { if (defaultDescriptor != null) { return defaultDescriptor; } IUnknownEditorStrategy strategy = getUnknowEditorStrategy(allowInteractive); if (strategy == null) { strategy = new SystemEditorOrTextEditorStrategy(); } IEditorDescriptor editorDesc; try { editorDesc = strategy.getEditorDescriptor(name, editorReg); } catch (CoreException e) { throw new PartInitException(IDEWorkbenchMessages.IDE_noFileEditorFound, e); } if (editorDesc == null) { throw new PartInitException( IDEWorkbenchMessages.IDE_noFileEditorFound); } return editorDesc; }

Target:
private static IEditorDescriptor getEditorDescriptor(String name, IEditorRegistry editorReg, IEditorDescriptor defaultDescriptor, boolean allowInteractive) throws PartInitException, OperationCanceledException { if (defaultDescriptor != null) { return defaultDescriptor; } IUnknownEditorStrategy strategy = getUnknowEditorStrategy(allowInteractive); IEditorDescriptor editorDesc; try { editorDesc = strategy.getEditorDescriptor(name, editorReg); } catch (CoreException e) { throw new PartInitException(IDEWorkbenchMessages.IDE_noFileEditorFound, e); } if (editorDesc == null) { throw new PartInitException( IDEWorkbenchMessages.IDE_noFileEditorFound); } return editorDesc; }
Source:
private static IResource getAdapter(IEditorReference ref) { IEditorInput input; try { input = ref.getEditorInput(); } catch (PartInitException e) { return null; } if (input instanceof FileEditorInput) { FileEditorInput fi = (FileEditorInput) input; IFile file = fi.getFile(); if (file != null) { return file; } } IFile adapter = Adapters.getAdapter(input, IFile.class, true); if (adapter != null) { return adapter; } return Adapters.getAdapter(input, IResource.class, true); }

Target:
private static IResource getAdapter(IEditorReference ref) { IEditorInput input; try { input = ref.getEditorInput(); } catch (PartInitException e) { return null; } IFile adapter = Adapters.getAdapter(input, IFile.class, true); if (adapter != null) { return adapter; } return Adapters.getAdapter(input, IResource.class, true); }
Source:
public URL getRedirectURL(String queryString, String requestURI) { if (!requestURI.startsWith("/")) { throw new IAE("Expected requestURI starting with '/'"); } try { final String leader = taskMaster.getLeader(); if (leader == null || leader.isEmpty()) { return null; } else { return new URI("http", leader, requestURI, queryString, null).toURL(); } } catch (Exception e) { throw Throwables.propagate(e); } }

Target:
public URL getRedirectURL(String queryString, String requestURI) { try { final String leader = taskMaster.getLeader(); if (leader == null || leader.isEmpty()) { return null; } else { return new URI("http", leader, requestURI, queryString, null).toURL(); } } catch (Exception e) { throw Throwables.propagate(e); } }
Source:
public void process(final Exchange exchange) throws Exception { final Message in = exchange.getIn(); String uri = (String) in.getHeader(FCREPO_URI); String uuid = PIDs.get(uri).getUUID(); String objBasePath = idToPath(uuid, HASHED_PATH_DEPTH, HASHED_PATH_SIZE); File imgFile = new File(Paths.get(dataDir,objBasePath, uuid).toString()); if (imgFile.isFile()) { in.setHeader(CdrEditThumbnail, "true"); in.setHeader(CdrBinaryPath, imgFile.getAbsolutePath()); in.setHeader(CdrBinaryMimeType, "image/*"); } }

Target:
public void process(final Exchange exchange) throws Exception { final Message in = exchange.getIn(); String uri = (String) in.getHeader(FCREPO_URI); String uuid = PIDs.get(uri).getUUID(); String objBasePath = idToPath(uuid, HASHED_PATH_DEPTH, HASHED_PATH_SIZE); Path imgFile = Paths.get(sourceImagesDir, objBasePath, uuid); if (Files.isRegularFile(imgFile)) { in.setHeader(CdrBinaryPath, imgFile.toAbsolutePath().toString()); in.setHeader(CdrBinaryMimeType, "image/*"); } }
Source:
public @NonNull Image getIcon() { String iconFile = getIconFile(); if (iconFile != null) { Bundle bundle = getBundle(); if (bundle != null) { Image icon = TmfProjectModelIcons.loadIcon(bundle, iconFile); if (icon != null) { return icon; } } } return TmfProjectModelIcons.DEFAULT_ANALYSIS_ICON; }

Target:
public Image getIcon() { String iconFile = getIconFile(); if (iconFile != null) { Bundle bundle = getBundle(); if (bundle != null) { Image icon = TmfProjectModelIcons.loadIcon(bundle, iconFile); if (icon != null) { return icon; } } } return TmfProjectModelIcons.DEFAULT_ANALYSIS_ICON; }
Source:
protected void executeCommand() { boolean isDomainUpdateRequired = doDomainsUseConnection(getConnection()); StoragePoolIsoMap map = null; boolean isUpdateSucceeded = true; boolean hasConnectStorageSucceeded = false; if (isDomainUpdateRequired) { hasConnectStorageSucceeded = connectToStorage(); VDSReturnValue returnValueUpdatedStorageDomain = null; if (!hasConnectStorageSucceeded) { setSucceeded(false); VdcFault f = new VdcFault(); f.setError(VdcBllErrors.StorageServerConnectionError); getReturnValue().setFault(f); return; } for (StorageDomain domain : domains) { map = getStoragePoolIsoMap(domain); changeStorageDomainStatusInTransaction(map, StorageDomainStatus.Locked); returnValueUpdatedStorageDomain = getStatsForDomain(domain); if (returnValueUpdatedStorageDomain.getSucceeded()) { final StorageDomain updatedStorageDomain = (StorageDomain) returnValueUpdatedStorageDomain.getReturnValue(); executeInNewTransaction(new TransactionMethod<Void>() { @Override public Void runInTransaction() { getStorageDomainDynamicDao().update(updatedStorageDomain.getStorageDynamicData()); return null; } }); } else { isUpdateSucceeded = false; break; } } } if(isUpdateSucceeded) { getStorageConnDao().update(getParameters().getStorageServerConnection()); } if (isDomainUpdateRequired) { for (StorageDomain domain : domains) { map = getStoragePoolIsoMap(domain); restoreStateAfterUpdate(map); } disconnectFromStorage(); } setSucceeded(isUpdateSucceeded); }

Target:
protected void executeCommand() { boolean isDomainUpdateRequired = doDomainsUseConnection(getConnection()); StoragePoolIsoMap map = null; List<StorageDomain> updatedDomains = new ArrayList<>(); boolean hasConnectStorageSucceeded = false; if (isDomainUpdateRequired) { hasConnectStorageSucceeded = connectToStorage(); VDSReturnValue returnValueUpdatedStorageDomain = null; if (hasConnectStorageSucceeded) { changeStorageDomainStatusInTransaction(StorageDomainStatus.Locked); for (StorageDomain domain : domains) { returnValueUpdatedStorageDomain = getStatsForDomain(domain); if (returnValueUpdatedStorageDomain.getSucceeded()) { StorageDomain updatedStorageDomain = (StorageDomain) returnValueUpdatedStorageDomain.getReturnValue(); updatedDomains.add(updatedStorageDomain); } } if(!updatedDomains.isEmpty()) { updateStorageDomain(updatedDomains); } } } getStorageConnDao().update(getParameters().getStorageServerConnection()); if (isDomainUpdateRequired) { for (StorageDomain domain : domains) { map = getStoragePoolIsoMap(domain); restoreStateAfterUpdate(map); } if (hasConnectStorageSucceeded) { disconnectFromStorage(); } } setSucceeded(true); }
Source:
protected String[] createValidParamsForProfile() { return new String[] { Const.ParamsNames.STUDENT_SHORT_NAME, "short ", Const.ParamsNames.STUDENT_PROFILE_EMAIL, "e@email.com ", Const.ParamsNames.STUDENT_PROFILE_INSTITUTION, " TEAMMATES Test Institute 5 ", Const.ParamsNames.STUDENT_NATIONALITY, "American", Const.ParamsNames.STUDENT_GENDER, "OTHER", Const.ParamsNames.STUDENT_PROFILE_MOREINFO, " This is more info on me " }; }

Target:
protected String[] createValidParamsForProfile() { return new String[] { Const.ParamsNames.STUDENT_SHORT_NAME, "short ", Const.ParamsNames.STUDENT_PROFILE_EMAIL, "e@email.com ", Const.ParamsNames.STUDENT_PROFILE_INSTITUTION, " TEAMMATES Test Institute 5 ", Const.ParamsNames.STUDENT_NATIONALITY, "American", Const.ParamsNames.STUDENT_GENDER, "MALE", Const.ParamsNames.STUDENT_PROFILE_MOREINFO, " This is more info on me " }; }
Source:
public String getDeleteType() { return "Curl Type"; }

Target:
public String getDeleteType() { return "Tissue Piece Type"; }
Source:
public void writeData(ObjectDataOutput out) throws IOException { IOUtil.writeObject(out, key); IOUtil.writeObject(out, value); out.writeLong(creationTime); out.writeLong(hits); out.writeLong(lastAccessTime); out.writeLong(lastUpdateTime); out.writeLong(ttl); out.writeLong(maxIdle); }

Target:
public void writeData(ObjectDataOutput out) throws IOException { IOUtil.writeObject(out, key); IOUtil.writeObject(out, value); out.writeLong(creationTime); out.writeLong(hits); out.writeLong(lastAccessTime); out.writeLong(lastUpdateTime); out.writeLong(ttl); if (out.getVersion().isGreaterOrEqual(V3_11)) { out.writeLong(maxIdle); } }
Source:
void createHandAndLibrary(final int handSize) { startingHandSize = handSize; final MagicDeck deck = playerConfig.getDeck(); Thread thread = Thread.currentThread(); for (int i = 0; i < deck.size() && !thread.isInterrupted(); i++) { final MagicCardDefinition cardDefinition = deck.get(i); if (cardDefinition.isValid()) { final long id = currGame.getUniqueId(); try { library.add(new MagicCard(cardDefinition, this, id)); } catch (ScriptParseException e) { throw new InvalidDeckException( "Error parsing " + cardDefinition.getDistinctName() + ": " + e.getMessage(), e); } } } library.initialShuffle(MagicRandom.nextRNGInt()); for (int count = handSize; count > 0 && !library.isEmpty(); count--) { addCardToHand(library.removeCardAtTop()); } }

Target:
void createHandAndLibrary(final int handSize) { startingHandSize = handSize; final MagicDeck deck = playerConfig.getDeck(); Thread thread = Thread.currentThread(); for (int i = 0; i < deck.size() && !thread.isInterrupted(); i++) { final MagicCardDefinition cardDefinition = deck.get(i); if (cardDefinition.isValid()) { final long id = currGame.getUniqueId(); library.add(new MagicCard(cardDefinition, this, id)); } } library.initialShuffle(MagicRandom.nextRNGInt()); for (int count = handSize; count > 0 && !library.isEmpty(); count--) { addCardToHand(library.removeCardAtTop()); } }
Source:
public void add(double lat, double lon, double ele) { if (this.isImmutable()) { throw new IllegalStateException("You cannot change an immutable PointList"); } int newSize = size + 1; incCap(newSize); latitudes[size] = lat; longitudes[size] = lon; if (is3D) elevations[size] = ele; else if (!Double.isNaN(ele)) throw new IllegalStateException("This is a 2D list we cannot store elevation: " + ele); size = newSize; }

Target:
public void add(double lat, double lon, double ele) { ensureMutability(); int newSize = size + 1; incCap(newSize); latitudes[size] = lat; longitudes[size] = lon; if (is3D) elevations[size] = ele; else if (!Double.isNaN(ele)) throw new IllegalStateException("This is a 2D list we cannot store elevation: " + ele); size = newSize; }
Source:
public void run() { try { info("sleep for 5 seconds before actually running the job"); Thread.sleep(5 * 1000); super.run(); } catch (final Exception ex) { this.getLog().error(ex); } }

Target:
public void run() { try { info("sleep for 3 seconds before actually running the job"); Thread.sleep(3 * 1000); super.run(); } catch (final Exception ex) { this.getLog().error(ex); } }
Source:
private static void setOldProcessStatus(ITmfStateSystemBuilder ss, Long prevState, Integer formerThreadNode, long timestamp) throws AttributeNotFoundException { ITmfStateValue value; int state = (int) (prevState & (LinuxValues.TASK_NOLOAD - 1)); switch (state) { case LinuxValues.TASK_STATE_RUNNING: value = StateValues.PROCESS_STATUS_WAIT_FOR_CPU_VALUE; break; case LinuxValues.TASK_INTERRUPTIBLE: case LinuxValues.TASK_UNINTERRUPTIBLE: value = StateValues.PROCESS_STATUS_WAIT_BLOCKED_VALUE; break; case LinuxValues.TASK_DEAD: value = TmfStateValue.nullValue(); break; default: value = StateValues.PROCESS_STATUS_WAIT_UNKNOWN_VALUE; break; } int quark = ss.getQuarkRelativeAndAdd(formerThreadNode, Attributes.STATUS); ss.modifyAttribute(timestamp, value, quark); }

Target:
private static void setOldProcessStatus(ITmfStateSystemBuilder ss, Long prevState, Integer formerThreadNode, long timestamp) throws AttributeNotFoundException { ITmfStateValue value; int state = (int) (prevState & (LinuxValues.TASK_NOLOAD - 1)); if (isRunning(state)) { value = StateValues.PROCESS_STATUS_WAIT_FOR_CPU_VALUE; } else if (isWaiting(state)) { value = StateValues.PROCESS_STATUS_WAIT_BLOCKED_VALUE; } else if (isDead(state)) { value = TmfStateValue.nullValue(); } else { value = StateValues.PROCESS_STATUS_WAIT_UNKNOWN_VALUE; } int quark = ss.getQuarkRelativeAndAdd(formerThreadNode, Attributes.STATUS); ss.modifyAttribute(timestamp, value, quark); }
Source:
public void validateDefaultRepresentation() throws Exception { assertPropEquals("uuid", getUuidProperty()); assertPropPresent("name"); assertPropPresent("description"); assertPropPresent("identifierType"); }

Target:
public void validateDefaultRepresentation() throws Exception { super.validateDefaultRepresentation(); assertPropEquals("uuid", getUuidProperty()); assertPropPresent("name"); assertPropPresent("description"); assertPropPresent("identifierType"); }
Source:
public void init() { try { userService = UserService.getInstance(); } catch (Exception ex) { log.error(ex, "Unable to initialize User service!"); } try { permissionsService = OskariComponentManager.getComponentOfType(PermissionService.class); } catch (Exception ex) { log.error(ex, "Unable to initialize permission service!"); } }

Target:
public void init() { try { userService = UserService.getInstance(); } catch (ServiceException ex) { throw new ServiceRuntimeException("Exception occured while initializing user service",ex); } try { permissionsService = OskariComponentManager.getComponentOfType(PermissionService.class); } catch (Exception ex) { throw new ServiceRuntimeException("Exception occured while initializing permission service",ex); } }
Source:
public void testGetTaskIdTrailingSlash() { assertEquals("123", handler.getTaskId(repository, "<LINK_0>123/")); }

Target:
public void testGetTaskIdTrailingSlash() { TaskRepository trailingSlashRepository = new TaskRepository(GerritConnector.CONNECTOR_KIND, "<LINK_0>"); assertEquals("123", handler.getTaskId(trailingSlashRepository, "<LINK_0>123")); }
Source:
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String fileName = request.getParameter("filename"); String contentType = request.getParameter("contenttype"); String content = request.getParameter("content"); Boolean cache = Boolean.parseBoolean(request.getParameter("cache")); response.setContentType(contentType); response.setHeader("Content-Disposition", "attachment; filename=\"" + fileName + "\""); if (!cache) { response.setHeader("Cache-Control", "no-cache, must-revalidate"); response.setHeader("Expires", "Sat, 26 Jul 1997 05:00:00 GMT"); } response.getWriter().println(content); if (response.getWriter().checkError()) { throw new IOException("Error when writing to response stream"); } }

Target:
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String fileName = request.getParameter("filename"); String contentType = request.getParameter("contenttype"); String content = request.getParameter("content"); Boolean cache = Boolean.parseBoolean(request.getParameter("cache")); response.setContentType(contentType); response.setHeader("Content-Disposition", "attachment; filename=\"" + fileName + "\""); if (!cache) { response.setHeader("Cache-Control", "no-cache, must-revalidate"); response.setHeader("Expires", "Sat, 26 Jul 1997 05:00:00 GMT"); } response.getWriter().print(content); if (response.getWriter().checkError()) { throw new IOException("Error when writing to response stream"); } }
Source:
public HaplotypeProbabilities merge(final HaplotypeProbabilities other) { super.merge(other); if (!this.getHaplotype().equals(other.getHaplotype())) { throw new IllegalArgumentException("Mismatched haplotypes in call to HaplotypeProbabilities.merge(): " + getHaplotype() + ", " + other.getHaplotype()); } if (!(other instanceof HaplotypeProbabilitiesFromContaminatorSequence)) { throw new IllegalArgumentException("Can only merge HaplotypeProbabilities of same class."); } final HaplotypeProbabilitiesFromContaminatorSequence o = (HaplotypeProbabilitiesFromContaminatorSequence) other; if (o.contamination != this.contamination) { throw new IllegalArgumentException("Can only merge HaplotypeProbabilitiesFromContaminatorSequence with the same contamination value."); } for (final Genotype contGeno : Genotype.values()) { this.likelihoodMap[contGeno.v] = MathUtil.multiply(this.likelihoodMap[contGeno.v], o.likelihoodMap[contGeno.v]); } return this; }

Target:
public HaplotypeProbabilitiesFromContaminatorSequence merge(final HaplotypeProbabilities other) { super.merge(other); if (!this.getHaplotype().equals(other.getHaplotype())) { throw new IllegalArgumentException("Mismatched haplotypes in call to HaplotypeProbabilities.merge(): " + getHaplotype() + ", " + other.getHaplotype()); } if (!(other instanceof HaplotypeProbabilitiesFromContaminatorSequence)) { throw new IllegalArgumentException("Can only merge HaplotypeProbabilities of same class."); } final HaplotypeProbabilitiesFromContaminatorSequence o = (HaplotypeProbabilitiesFromContaminatorSequence) other; if (o.contamination != this.contamination) { throw new IllegalArgumentException("Can only merge HaplotypeProbabilitiesFromContaminatorSequence with the same contamination value."); } for (final Genotype contGeno : Genotype.values()) { this.likelihoodMap[contGeno.v] = MathUtil.multiply(this.likelihoodMap[contGeno.v], o.likelihoodMap[contGeno.v]); } return this; }
Source:
public void init(FilterConfig filterConfig) throws ServletException { GeoServerDataDirectory dataDirectory = GeoServerExtensions.bean(GeoServerDataDirectory.class); if (dataDirectory != null) { USE_AS_SERVLET_FILTER = true; Resource resource = dataDirectory.get(RulesDao.getRulesPath()); rules = RulesDao.getRules(resource.in()); resource.addListener(notify -> rules = RulesDao.getRules(resource.in())); } }

Target:
public void init(FilterConfig filterConfig) throws ServletException { GeoServerDataDirectory dataDirectory = GeoServerExtensions.bean(GeoServerDataDirectory.class); initRules(dataDirectory); }
Source:
protected boolean findAffectedSourceFiles(IResourceDelta delta, ClasspathLocation[] classFoldersAndJars, IProject prereqProject) { for (int i = 0, l = classFoldersAndJars.length; i < l; i++) { ClasspathLocation bLocation = classFoldersAndJars[i]; if (bLocation != null) { IPath p = bLocation.getProjectRelativePath(); if (p != null) { IResourceDelta binaryDelta = delta.findMember(p); if (binaryDelta != null) { if (bLocation instanceof ClasspathJar) { if (JavaBuilder.DEBUG) System.out.println("ABORTING incremental build... found delta to jar/zip file"); return false; } if (binaryDelta.getKind() == IResourceDelta.ADDED || binaryDelta.getKind() == IResourceDelta.REMOVED) { if (JavaBuilder.DEBUG) System.out.println("ABORTING incremental build... found added/removed binary folder"); return false; } int segmentCount = binaryDelta.getFullPath().segmentCount(); IResourceDelta[] children = binaryDelta.getAffectedChildren(); StringSet structurallyChangedTypes = null; if (bLocation.isOutputFolder()) structurallyChangedTypes = this.newState.getStructurallyChangedTypes(this.javaBuilder.getLastState(prereqProject)); for (int j = 0, m = children.length; j < m; j++) findAffectedSourceFiles(children[j], segmentCount, structurallyChangedTypes); this.notifier.checkCancel(); } } } } return true; }

Target:
protected boolean findAffectedSourceFiles(IResourceDelta delta, ClasspathLocation[] classFoldersAndJars, IProject prereqProject) { for (int i = 0, l = classFoldersAndJars.length; i < l; i++) { ClasspathLocation bLocation = classFoldersAndJars[i]; if (bLocation != null) { IPath p = bLocation.getProjectRelativePath(); if (p != null) { IResourceDelta binaryDelta = delta.findMember(p); if (binaryDelta != null) { if (bLocation instanceof ClasspathJar) { if (JavaBuilder.DEBUG) System.out.println("ABORTING incremental build... found delta to jar/zip file"); return false; } if (binaryDelta.getKind() == IResourceDelta.ADDED || binaryDelta.getKind() == IResourceDelta.REMOVED) { if (JavaBuilder.DEBUG) System.out.println("ABORTING incremental build... found added/removed binary folder"); return false; } int segmentCount = binaryDelta.getFullPath().segmentCount(); IResourceDelta[] children = binaryDelta.getAffectedChildren(); Set<String> structurallyChangedTypes = null; if (bLocation.isOutputFolder()) structurallyChangedTypes = this.newState.getStructurallyChangedTypes(this.javaBuilder.getLastState(prereqProject)); for (int j = 0, m = children.length; j < m; j++) findAffectedSourceFiles(children[j], segmentCount, structurallyChangedTypes); this.notifier.checkCancel(); } } } } return true; }
Source:
private FormValidation checkUpdatesServer() throws Exception { for (UpdateSite site : Jenkins.getInstance().getUpdateCenter().getSites()) { FormValidation v = site.updateDirectlyNow(DownloadService.signatureCheck); if (v.kind != FormValidation.Kind.OK) { return v; } } for (DownloadService.Downloadable d : DownloadService.Downloadable.all()) { FormValidation v = d.updateNow(); if (v.kind != FormValidation.Kind.OK) { return v; } } return FormValidation.ok(); }

Target:
private FormValidation checkUpdatesServer() throws Exception { for (UpdateSite site : Jenkins.get().getUpdateCenter().getSites()) { FormValidation v = site.updateDirectlyNow(DownloadService.signatureCheck); if (v.kind != FormValidation.Kind.OK) { return v; } } for (DownloadService.Downloadable d : DownloadService.Downloadable.all()) { FormValidation v = d.updateNow(); if (v.kind != FormValidation.Kind.OK) { return v; } } return FormValidation.ok(); }
Source:
public StoredProcedureQuery createNamedStoredProcedureQuery(String s) { return null; }

Target:
public StoredProcedureQuery createNamedStoredProcedureQuery(String s) { throw new UnsupportedOperationException("createNamedStoredProcedureQuery"); }
Source:
public void init() { broker = LdapFactory.getInstance(getProfileName()); context.put(ExtensionProperties.AUTHOR, "oVirt"); context.put(ExtensionProperties.EXTENSION_NAME, "Provisional Authorization (LbapBroker code based)"); context.put(ExtensionProperties.LICENSE, "ASL 2.0"); context.put(ExtensionProperties.HOME, "<LINK_0>"); context.put(ExtensionProperties.VERSION, "1.0"); }

Target:
public void init() { broker = LdapFactory.getInstance(getProfileName()); context.put(ExtensionProperties.AUTHOR, "The oVirt Project"); context.put(ExtensionProperties.EXTENSION_NAME, "Internal Kerberos/LDAP authorization (Built-in)"); context.put(ExtensionProperties.LICENSE, "ASL 2.0"); context.put(ExtensionProperties.HOME, "<LINK_0>"); context.put(ExtensionProperties.VERSION, "N/A"); }
Source:
public void restartTaskOnNodeFailure(final InternalTask task) { if (status.isUnusable()) { return; } infrastructure.getInternalOperationsThreadPool().submit(new Runnable() { @Override public void run() { TerminationData terminationData = jobs.restartTaskOnNodeFailure(task); try { terminationData.handleTermination(SchedulingService.this); } catch (IOException e) { e.printStackTrace(); } catch (ClassNotFoundException e) { e.printStackTrace(); } wakeUpSchedulingThread(); } }); }

Target:
public void restartTaskOnNodeFailure(final InternalTask task) { if (status.isUnusable()) { return; } infrastructure.getInternalOperationsThreadPool().submit(new Runnable() { @Override public void run() { TerminationData terminationData = jobs.restartTaskOnNodeFailure(task); try { terminationData.handleTermination(SchedulingService.this); } catch (Exception e) { logger.error("Exception occurred, fail to get variables into the cleaning script: ",e); } wakeUpSchedulingThread(); } }); }
Source:
public boolean updateApiFromString(String apiName, String apiData) throws APIException{ final Lock lock = getLock(); try { lock.lock(); assertNameNotEmpty(apiName); OMElement apiElement = AXIOMUtil.stringToOM(apiData); OMAttribute nameAttribute = apiElement.getAttribute(new QName("name")); if(nameAttribute == null || "".equals(nameAttribute.getAttributeValue().trim())){ apiElement.addAttribute("name", apiName, null); } API api = APIFactory.createAPI(apiElement); SynapseConfiguration synapseConfiguration = getSynapseConfiguration(); API oldAPI = synapseConfiguration.getAPI(apiName); if (oldAPI != null){ oldAPI.destroy(); api.setFileName(oldAPI.getFileName()); } synapseConfiguration.removeAPI(apiName); synapseConfiguration.addAPI(api.getName(),api); api.init(getSynapseEnvironment()); if (oldAPI.getArtifactContainerName() != null) { api.setArtifactContainerName(oldAPI.getArtifactContainerName()); api.setIsEdited(true); getApiByName(api.getName()).setIsEdited(true); } else { MediationPersistenceManager pm = getMediationPersistenceManager(); String fileName = api.getFileName(); pm.deleteItem(apiName, fileName, ServiceBusConstants.ITEM_TYPE_REST_API); pm.saveItem(apiName, ServiceBusConstants.ITEM_TYPE_REST_API); } return true; } catch (XMLStreamException e) { handleException(log, "Could not parse String to OMElement", e); return false; } finally { lock.unlock(); } }

Target:
public boolean updateApiFromString(String apiName, String apiData) throws APIException { final Lock lock = getLock(); try { lock.lock(); assertNameNotEmpty(apiName); OMElement apiElement = AXIOMUtil.stringToOM(apiData); OMAttribute nameAttribute = apiElement.getAttribute(new QName("name")); if (nameAttribute == null || nameAttribute.getAttributeValue().trim().isEmpty()) { apiElement.addAttribute("name", apiName, null); } API api = APIFactory.createAPI(apiElement); SynapseConfiguration synapseConfiguration = getSynapseConfiguration(); API oldAPI = synapseConfiguration.getAPI(apiName); if (oldAPI != null) { oldAPI.destroy(); api.setFileName(oldAPI.getFileName()); } synapseConfiguration.removeAPI(apiName); synapseConfiguration.addAPI(api.getName(),api); api.init(getSynapseEnvironment()); if (oldAPI.getArtifactContainerName() != null) { api.setArtifactContainerName(oldAPI.getArtifactContainerName()); api.setIsEdited(true); getApiByName(api.getName()).setIsEdited(true); } else { MediationPersistenceManager pm = getMediationPersistenceManager(); String fileName = api.getFileName(); pm.deleteItem(apiName, fileName, ServiceBusConstants.ITEM_TYPE_REST_API); pm.saveItem(apiName, ServiceBusConstants.ITEM_TYPE_REST_API); } return true; } catch (XMLStreamException e) { handleException(log, "Could not parse String to OMElement", e); return false; } finally { lock.unlock(); } }
Source:
public RevCommit next() throws MissingObjectException, IncorrectObjectTypeException, IOException { for (;;) { final RevCommit r = super.next(); if (r == null) { return null; } if ((r.flags & UNINTERESTING) != 0) { markTreeUninteresting(r.getTree()); if (boundary) return r; continue; } pendingObjects.add(r.getTree()); return r; } }

Target:
public RevCommit next() throws MissingObjectException, IncorrectObjectTypeException, IOException { for (;;) { final RevCommit r = super.next(); if (r == null) { return null; } final RevTree t = r.getTree(); if ((r.flags & UNINTERESTING) != 0) { if (objectFilter.include(this, t)) { markTreeUninteresting(t); } if (boundary) { return r; } continue; } if (objectFilter.include(this, t)) { pendingObjects.add(t); } return r; } }
Source:
protected String truncateValidationResultMessageToMaximumDatabaseFieldSize(String validationResultMessages) { if (validationResultMessages != null && validationResultMessages.length() > ConcurConstants.VALIDATION_RESULT_MESSAGE_MAX_LENGTH) { validationResultMessages = validationResultMessages.substring(0, ConcurConstants.VALIDATION_RESULT_MESSAGE_MAX_LENGTH); } return validationResultMessages; }

Target:
protected String truncateValidationResultMessageToMaximumDatabaseFieldSize(String validationResultMessages) { return StringUtils.left(validationResultMessages, ConcurConstants.VALIDATION_RESULT_MESSAGE_MAX_LENGTH); }
Source:
public OutputStream decorateLogger(AbstractBuild build, OutputStream logger) throws IOException, InterruptedException, Run.RunnerAbortedException { if (!bindings.isEmpty()) { return new Filter(build.getCharset().name()).decorateLogger(build, logger); } else { return logger; } }

Target:
public OutputStream decorateLogger(AbstractBuild build, OutputStream logger) throws IOException, InterruptedException, Run.RunnerAbortedException { return new Filter(build.getCharset().name()).decorateLogger(build, logger); }
Source:
public void decrementCount(ResourceProfile profile, int decrement) { Preconditions.checkArgument(decrement > 0); resources.computeIfPresent(profile, (ignored, currentCount) -> currentCount == decrement ? null : guardAgainstNegativeCount(currentCount - decrement)); }

Target:
public void decrementCount(ResourceProfile profile, int decrement) { Preconditions.checkArgument(decrement > 0); resources.compute(profile, (p, currentCount) -> { Preconditions.checkState(currentCount != null, "Attempting to decrement count of profile %s, but no count was present.", p); return currentCount == decrement ? null : guardAgainstNegativeCount(currentCount - decrement); }); }
Source:
public EMFCompare build() { if (matchEngineFactoryRegistry == null) { matchEngineFactoryRegistry = MatchEngineFactoryRegistryImpl.createStandaloneInstance(); } if (diffEngine == null) { diffEngine = new DefaultDiffEngine(new DiffBuilder()); } if (reqEngine == null) { reqEngine = new DefaultReqEngine(); } if (equiEngine == null) { equiEngine = new DefaultEquiEngine(); } if (registry == null) { registry = new PostProcessorDescriptorRegistryImpl<Object>(); } if (conflictDetector == null) { conflictDetector = new FastConflictDetector(); } return new EMFCompare(this.matchEngineFactoryRegistry, this.diffEngine, this.reqEngine, this.equiEngine, this.conflictDetector, this.registry); }

Target:
public EMFCompare build() { if (matchEngineFactoryRegistry == null) { matchEngineFactoryRegistry = MatchEngineFactoryRegistryImpl.createStandaloneInstance(); } if (diffEngine == null) { diffEngine = new DefaultDiffEngine(new DiffBuilder()); } if (reqEngine == null) { reqEngine = new DefaultReqEngine(); } if (equiEngine == null) { equiEngine = new DefaultEquiEngine(); } if (registry == null) { registry = new PostProcessorDescriptorRegistryImpl<Object>(); } if (conflictDetector == null) { conflictDetector = new MatchBasedConflictDetector(); } return new EMFCompare(this.matchEngineFactoryRegistry, this.diffEngine, this.reqEngine, this.equiEngine, this.conflictDetector, this.registry); }
Source:
public boolean isRequestAllowed(HttpServletRequest request) { String site = request.getHeader(SEC_FETCH_SITE_HEADER); if (Strings.isEmpty((site))){ return true; } if (SAME_ORIGIN.equals(site) || SAME_SITE.equals(site) || NONE.equals(site)) { return true; } return isAllowedTopLevelNavigation(request); }

Target:
public boolean isRequestAllowed(HttpServletRequest request) { String site = request.getHeader(SEC_FETCH_SITE_HEADER); if (Strings.isEmpty(site)){ return true; } if (SAME_ORIGIN.equals(site) || SAME_SITE.equals(site) || NONE.equals(site)) { return true; } return isAllowedTopLevelNavigation(request); }
Source:
public void testSetPropertiesAsNonAdmin() throws Exception { testSetProperties("Tutu"); }

Target:
public void testSetPropertiesAsNonAdmin() throws Exception { testSetProperties(USERNAME); }
Source:
public void testGetResourceBundleOK() { String moduleID = "foobar_1"; String locale = "en"; ResourceBundle resourceBundle = mock( ResourceBundle.class ); when( this.localizationService.getResourceBundle( eq( moduleID ), eq( locale ) ) ).thenReturn( resourceBundle ); Response response = this.endpoint.getResourceBundle( moduleID, locale ); assertNotNull( response ); Status actualStatus = Status.fromStatusCode( response.getStatus() ); assertEquals( Status.OK, actualStatus ); }

Target:
public void testGetResourceBundleOK() { String moduleID = "foobar_1"; String locale = "en"; ResourceBundle resourceBundle = mock( ResourceBundle.class ); when( this.localizationService.getResourceBundle( eq( moduleID ), eq( locale ) ) ).thenReturn( resourceBundle ); Response response = this.endpoint.getResourceBundle( moduleID, locale ); Status actualStatus = Status.fromStatusCode( response.getStatus() ); assertEquals( Status.OK, actualStatus ); }
Source:
public void startVDOService(VDS vds) { boolean succeeded = runVdsCommand(VDSCommandType.ManageGlusterService, new GlusterServiceVDSParameters(vds.getId(), Arrays.asList("vdo"), "restart")).getSucceeded(); if (!succeeded) { log.error("Failed to start VDO service while moving the host '{}' to maintenance", vds.getHostName()); } }

Target:
public void startVDOService(VDS vds) { boolean succeeded = runVdsCommand(VDSCommandType.ManageGlusterService, new GlusterServiceVDSParameters(vds.getId(), Arrays.asList("vdo"), "restart")).getSucceeded(); if (!succeeded) { log.error("Failed to start VDO service while activating the host '{}'", vds.getHostName()); } }
Source:
public E get(int location) { E obj; realm.checkIfValid(); if (!isTablePresent()) { return null; } TableOrView table = getTable(); if (table instanceof TableView) { obj = realm.get(classSpec, className, ((TableView) table).getSourceRowIndex(location)); } else { obj = realm.get(classSpec, className, location); } return obj; }

Target:
public E get(int location) { E obj; realm.checkIfValid(); if (isTableRemoved()) { throw new IndexOutOfBoundsException("No results were found."); } TableOrView table = getTable(); if (table instanceof TableView) { obj = realm.get(classSpec, className, ((TableView) table).getSourceRowIndex(location)); } else { obj = realm.get(classSpec, className, location); } return obj; }
Source:
private void processEntriesForContainerBucket(ScanResults results, List<IndexEntry> indexEntries, Map<StoreKey, Long> deletedKeys) { for (IndexEntry indexEntry : indexEntries) { IndexValue indexValue = indexEntry.getValue(); if (!indexValue.isFlagSet(IndexValue.Flags.Delete_Index)) { results.updateContainerBucket(results.containerForecastStartTimeMs, String.valueOf(indexValue.getServiceId()), String.valueOf(indexValue.getContainerId()), indexValue.getSize()); long expOrDelTimeInMs = indexValue.getExpiresAtMs(); if (deletedKeys.containsKey(indexEntry.getKey())) { long deleteTimeInMs = deletedKeys.get(indexEntry.getKey()); expOrDelTimeInMs = expOrDelTimeInMs != Utils.Infinite_Time && expOrDelTimeInMs < deleteTimeInMs ? expOrDelTimeInMs : deleteTimeInMs; } handleContainerBucketUpdate(results, indexValue, expOrDelTimeInMs, SUBTRACT); } } }

Target:
private void processEntriesForContainerBucket(ScanResults results, List<IndexEntry> indexEntries, Map<StoreKey, Long> deletedKeys) { for (IndexEntry indexEntry : indexEntries) { IndexValue indexValue = indexEntry.getValue(); if (!indexValue.isFlagSet(IndexValue.Flags.Delete_Index)) { results.updateContainerBaseBucket(String.valueOf(indexValue.getServiceId()), String.valueOf(indexValue.getContainerId()), indexValue.getSize()); long expOrDelTimeInMs = indexValue.getExpiresAtMs(); if (deletedKeys.containsKey(indexEntry.getKey())) { long deleteTimeInMs = deletedKeys.get(indexEntry.getKey()); expOrDelTimeInMs = expOrDelTimeInMs != Utils.Infinite_Time && expOrDelTimeInMs < deleteTimeInMs ? expOrDelTimeInMs : deleteTimeInMs; } if (expOrDelTimeInMs != Utils.Infinite_Time) { handleContainerBucketUpdate(results, indexValue, expOrDelTimeInMs, SUBTRACT); } } } }
Source:
protected Endpoint createEndpoint(String uri, String remaining, Map<String, Object> parameters) throws Exception { GraphqlConfiguration configuration = new GraphqlConfiguration(remaining, parameters); return new GraphqlEndpoint(uri, this, configuration); }

Target:
protected Endpoint createEndpoint(String uri, String remaining, Map<String, Object> parameters) throws Exception { GraphqlEndpoint endpoint = new GraphqlEndpoint(uri, this); endpoint.setHttpUri(new URI(remaining)); setProperties(endpoint, parameters); return endpoint; }
Source:
private void updateFiltersCheckState() { Object[] children = filterContentProvider .getElements(getContentService()); ICommonFilterDescriptor filterDescriptor; INavigatorFilterService filterService = getContentService() .getFilterService(); for (Object element : children) { filterDescriptor = (ICommonFilterDescriptor) element; if(filterService.isActive(filterDescriptor.getId())) { getTableViewer().setChecked(element, true); getCheckedItems().add(element); } else { getTableViewer().setChecked(element, false); } } }

Target:
private void updateFiltersCheckState() { ICommonFilterDescriptor filterDescriptor; INavigatorFilterService filterService = getContentService() .getFilterService(); for (Object child : filterContentProvider.getElements(getContentService())) { filterDescriptor = (ICommonFilterDescriptor) child; if(filterService.isActive(filterDescriptor.getId())) { getTableViewer().setChecked(child, true); getCheckedItems().add(child); } else { getTableViewer().setChecked(child, false); } } }
Source:
public void duplicatePathsTest() { rc.register(TestDuplicateResource.class); final String expectedLog = String.format("The following paths were found for the configured resources:%n" + "%n" + " GET /anotherMe (io.dropwizard.jersey.DropwizardResourceConfigTest.TestDuplicateResource)%n" + " GET /callme (io.dropwizard.jersey.DropwizardResourceConfigTest.TestDuplicateResource)%n"); final String shouldNotContainLog = String.format( " GET /callme (io.dropwizard.jersey.DropwizardResourceConfigTest.TestDuplicateResource)%n" + " GET /callme (io.dropwizard.jersey.DropwizardResourceConfigTest.TestDuplicateResource)%n" + " GET /callme (io.dropwizard.jersey.DropwizardResourceConfigTest.TestDuplicateResource)%n"); assertThat(rc.getEndpointsInfo()).contains(expectedLog); assertThat(rc.getEndpointsInfo()).doesNotContain(shouldNotContainLog); }

Target:
public void duplicatePathsTest() { rc.register(TestDuplicateResource.class); final String expectedLog = String.format("The following paths were found for the configured resources:%n" + "%n" + " GET /anotherMe (io.dropwizard.jersey.DropwizardResourceConfigTest.TestDuplicateResource)%n" + " GET /callme (io.dropwizard.jersey.DropwizardResourceConfigTest.TestDuplicateResource)%n"); assertThat(rc.getEndpointsInfo()).contains(expectedLog); assertThat(rc.getEndpointsInfo()).containsOnlyOnce(" GET /callme (io.dropwizard.jersey.DropwizardResourceConfigTest.TestDuplicateResource)"); }
Source:
public String toJSON(MaxwellOutputConfig outputConfig) throws IOException { JsonGenerator g = jsonGeneratorThreadLocal.get(); g.writeStartObject(); g.writeStringField("database", this.database); g.writeStringField("table", this.table); g.writeStringField("type", this.rowType); g.writeNumberField("ts", this.timestamp); if ( outputConfig.includesCommitInfo ) { if ( this.xid != null ) g.writeNumberField("xid", this.xid); if ( this.txCommit ) g.writeBooleanField("commit", true); } if ( outputConfig.includesBinlogPosition ) g.writeStringField("position", (nextPosition.getGtidStr() != null ? nextPosition.getGtidStr() + ":" : "") + this.nextPosition.getFile() + ":" + this.nextPosition.getOffset()); if ( outputConfig.includesServerId && this.serverId != null ) { g.writeNumberField("server_id", this.serverId); } if ( outputConfig.includesThreadId && this.threadId != null ) { g.writeNumberField("thread_id", this.threadId); } if ( outputConfig.excludeColumns.size() > 0 ) { Set<String> keys = new HashSet<>(); keys.addAll(this.data.keySet()); keys.addAll(this.oldData.keySet()); for ( Pattern p : outputConfig.excludeColumns ) { for ( String key : keys ) { if ( p.matcher(key).matches() ) { this.data.remove(key); this.oldData.remove(key); } } } } writeMapToJSON("data", this.data, outputConfig.includesNulls); if ( !this.oldData.isEmpty() ) { writeMapToJSON("old", this.oldData, true); } g.writeEndObject(); g.flush(); return jsonFromStream(); }

Target:
public String toJSON(MaxwellOutputConfig outputConfig) throws IOException { JsonGenerator g = jsonGeneratorThreadLocal.get(); g.writeStartObject(); g.writeStringField("database", this.database); g.writeStringField("table", this.table); g.writeStringField("type", this.rowType); g.writeNumberField("ts", this.timestamp); if ( outputConfig.includesCommitInfo ) { if ( this.xid != null ) g.writeNumberField("xid", this.xid); if ( this.txCommit ) g.writeBooleanField("commit", true); } if ( outputConfig.includesBinlogPosition ) g.writeStringField("position", this.nextPosition.getFile() + ":" + this.nextPosition.getOffset()); if ( outputConfig.includesGtidPosition) g.writeStringField("gtid", this.nextPosition.getGtid()); if ( outputConfig.includesServerId && this.serverId != null ) { g.writeNumberField("server_id", this.serverId); } if ( outputConfig.includesThreadId && this.threadId != null ) { g.writeNumberField("thread_id", this.threadId); } if ( outputConfig.excludeColumns.size() > 0 ) { Set<String> keys = new HashSet<>(); keys.addAll(this.data.keySet()); keys.addAll(this.oldData.keySet()); for ( Pattern p : outputConfig.excludeColumns ) { for ( String key : keys ) { if ( p.matcher(key).matches() ) { this.data.remove(key); this.oldData.remove(key); } } } } writeMapToJSON("data", this.data, outputConfig.includesNulls); if ( !this.oldData.isEmpty() ) { writeMapToJSON("old", this.oldData, true); } g.writeEndObject(); g.flush(); return jsonFromStream(); }
Source:
public DownloadConfig(DownloadService downloadService) { this.downloadService = downloadService; }

Target:
public DownloadConfig(DownloadService downloadService) { this.downloadService = requireNonNull(downloadService); }
Source:
public void metersResults() { BatchSizeRecorder batchSizeRecorder = BatchSizeRecorder.create(SAFE_IDENTIFIER); batchSizeRecorder.markBatchProcessed(5); batchSizeRecorder.markBatchProcessed(10); Histogram meter = (Histogram) SharedTaggedMetricRegistries.getSingleton().getMetrics() .get(MetricName.builder().safeName(BatchSizeRecorder.AUTOBATCHER_METER) .putSafeTags("safeIdentifier", SAFE_IDENTIFIER) .build()); assertThat(meter).isNotNull(); assertThat(meter.getCount()).isEqualTo(2); assertThat(meter.getSnapshot().getMean()).isEqualTo(7.5); }

Target:
public void metersResults() { BatchSizeRecorder batchSizeRecorder = BatchSizeRecorder.create(SAFE_IDENTIFIER); batchSizeRecorder.markBatchProcessed(5); batchSizeRecorder.markBatchProcessed(10); Histogram histogram = (Histogram) SharedTaggedMetricRegistries.getSingleton().getMetrics() .get(MetricName.builder().safeName(BatchSizeRecorder.AUTOBATCHER_METER) .putSafeTags("identifier", SAFE_IDENTIFIER) .build()); assertThat(histogram).isNotNull(); assertThat(histogram.getCount()).isEqualTo(2); assertThat(histogram.getSnapshot().getMean()).isEqualTo(7.5); }
Source:
protected <T> CompletableFuture<T> sendRequest(Request request) { requestLock.readLock().lock(); try { checkArgument(request.hasHeader()); Header header = request.getHeader(); CompletableFuture<T> retVal = new CompletableFuture<>(); pendingRequests.put(header.getRequestId(), retVal); ByteBuf outBuf = PooledByteBufAllocator.DEFAULT.buffer(); outBuf.writeByte(0x2); outBuf.writeBytes(request.toByteArray()); channel.writeAndFlush(outBuf); requestTimeoutQueue.add(new RequestTime(System.currentTimeMillis(), header.getRequestId())); return retVal; } finally { requestLock.readLock().unlock(); } }

Target:
protected <T> CompletableFuture<T> sendRequest(Request request) { requestLock.readLock().lock(); try { checkArgument(request.hasHeader()); Header header = request.getHeader(); CompletableFuture<T> retVal = new CompletableFuture<>(); pendingRequests.put(header.getRequestId(), retVal); ByteBuf outBuf = PooledByteBufAllocator.DEFAULT.buffer(); outBuf.writeByte(API.PROTO_CORFU_MSG_MARK); outBuf.writeBytes(request.toByteArray()); channel.writeAndFlush(outBuf); requestTimeoutQueue.add(new RequestTime(System.currentTimeMillis(), header.getRequestId())); return retVal; } finally { requestLock.readLock().unlock(); } }
Source:
public Callable<?> createCallable(Console console, ConsoleParameters params) { List<Long> branchUuids = new ArrayList<Long>(); for (String uuid : params.getArray("branchUuids")) { if (Strings.isNumeric(uuid)) { branchUuids.add(Long.parseLong(uuid)); } } if (branchUuids.isEmpty()) { console.writeln("No branch uuids where specified"); } Collection<String> options = params.getOptions(); boolean recurse = options.contains("R"); boolean unArchived = options.contains("A"); boolean unDeleted = options.contains("D"); boolean baseline = options.contains("B"); boolean runPurge = options.contains("P"); OrcsBranch orcsBranch = getOrcsApi().getBranchOps(null); return new PurgeBranchCallable(console, orcsBranch, getOrcsApi().getQueryFactory(null), branchUuids, recurse, unArchived, unDeleted, baseline, runPurge); }

Target:
public Callable<?> createCallable(Console console, ConsoleParameters params) { List<Long> branchUuids = new ArrayList<Long>(); for (String uuid : params.getArray("branchUuids")) { if (Strings.isNumeric(uuid)) { branchUuids.add(Long.parseLong(uuid)); } else { console.writeln("UUID listed %s is not a valid UUID", uuid); } } if (branchUuids.isEmpty()) { console.writeln("No branch uuids where specified"); } Collection<String> options = params.getOptions(); boolean recurse = options.contains("R"); boolean unArchived = options.contains("A"); boolean unDeleted = options.contains("D"); boolean baseline = options.contains("B"); boolean runPurge = options.contains("P"); OrcsBranch orcsBranch = getOrcsApi().getBranchOps(null); return new PurgeBranchCallable(console, orcsBranch, getOrcsApi().getQueryFactory(null), branchUuids, recurse, unArchived, unDeleted, baseline, runPurge); }