auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public List<ServerComponentHealth> getResponses(String componentType, String componentScope, String componentInputs, DiagnosticsAware component) { List<String> hosts = getLiveInstances(); StringArray statues = new StringArray(); StringArray statuesDetails = new StringArray(); for (String hostName : hosts) { ServerComponentHealthRestClient restClient = null; try { String dmsUri = getDmsUri(hostName); LOG.info("Send restli status request to " + dmsUri); restClient = ServerComponentHealthRestClientFactory.getClient(dmsUri, Collections.singletonMap( HttpClientFactory.HTTP_REQUEST_TIMEOUT, HTTP_TIMEOUT)); List<ServerComponentHealth> response = restClient.getServerComponentHealthStatues(componentType, componentScope, componentInputs); if (response == null) { statues.add(DiagnosticsAware.UNHEALTHY_STATUS); String errorMessage = "No restli response from the host: " + dmsUri; LOG.error(errorMessage); statuesDetails.add(errorMessage); } else { if (!response.isEmpty()) { statues.add(response.get(0).getStatus()); if (!response.get(0).getStatusDetail().isEmpty()) { statuesDetails.add(response.get(0).getStatusDetail().get(0)); } else { LOG.error("Empty restli statusDetail response from the host: " + dmsUri); } } else { LOG.error("Empty restli status response from the host: " + dmsUri); } } } finally { if (restClient != null) { restClient.shutdown(); } } } ServerComponentHealth serverComponentHealth = new ServerComponentHealth(); serverComponentHealth.setStatus(component.mergeStatus(statues)); serverComponentHealth.setStatusDetail(component.mergeStatusDetail(statuesDetails)); serverComponentHealth.setName(componentScope + componentType); return Arrays.asList(serverComponentHealth); }

Target:
public List<ServerComponentHealth> getResponses(String componentType, String componentScope, String componentInputs, DiagnosticsAware component) { List<String> hosts = getLiveInstances(); ConcurrentMap<String, String> responses = new ConcurrentHashMap<>(); hosts.parallelStream().forEach(hostName -> { ServerComponentHealthRestClient restClient = null; try { String dmsUri = getDmsUri(hostName); LOG.info("Send restli status request to " + dmsUri); restClient = ServerComponentHealthRestClientFactory.getClient(dmsUri, Collections.singletonMap( HttpClientFactory.HTTP_REQUEST_TIMEOUT, HTTP_TIMEOUT)); ServerComponentHealth response = restClient.getStatus(componentType, componentScope, componentInputs); if (response == null) { String errorMessage = "No restli response from the host: " + dmsUri; LOG.error(errorMessage); responses.put(hostName, errorMessage); } else { String message = "Get restli response from the host: " + dmsUri + " with status: " + response.getStatus(); LOG.info(message); responses.put(hostName, response.getStatus()); } } finally { if (restClient != null) { restClient.shutdown(); } } }); ServerComponentHealth serverComponentHealth = new ServerComponentHealth(); serverComponentHealth.setStatus(component.reduce(componentInputs, responses)); return Arrays.asList(serverComponentHealth); }
Source:
private ProcReturn execCommandInContainer(String containerName, Node node, boolean quiet, String... cmd) throws Exception { if (containerName != null && ! containerName.isEmpty()) { decorator.setContainerName(containerName); } ByteArrayOutputStream out = new ByteArrayOutputStream(); Launcher launcher = decorator .decorate(new DummyLauncher(new StreamTaskListener(new TeeOutputStream(out, System.out))), node); Map<String, String> envs = new HashMap<>(100); for (int i = 0; i < 50; i++) { envs.put("aaaaaaaa" + i, "bbbbbbbb"); } envs.put("workingDir1", "/home/jenkins/agent"); ContainerExecProc proc = (ContainerExecProc) launcher .launch(launcher.new ProcStarter().pwd("/tmp").cmds(cmd).envs(envs).quiet(quiet)); for (int i = 0; proc.isAlive() && i < 200; i++) { Thread.sleep(100); } assertFalse("proc is alive", proc.isAlive()); int exitCode = proc.joinWithTimeout(20, TimeUnit.SECONDS, StreamTaskListener.fromStderr()); return new ProcReturn(proc, exitCode, out.toString()); }

Target:
private ProcReturn execCommandInContainer(String containerName, Node node, boolean quiet, String... cmd) throws Exception { if (containerName != null && ! containerName.isEmpty()) { decorator.setContainerName(containerName); } ByteArrayOutputStream out = new ByteArrayOutputStream(); Launcher launcher = decorator .decorate(new DummyLauncher(new StreamTaskListener(new TeeOutputStream(out, System.out))), node); Map<String, String> envs = new HashMap<>(100); for (int i = 0; i < 50; i++) { envs.put("aaaaaaaa" + i, "bbbbbbbb"); } envs.put("workingDir1", "/home/jenkins/agent"); ContainerExecProc proc = (ContainerExecProc) launcher .launch(launcher.new ProcStarter().pwd("/tmp").cmds(cmd).envs(envs).quiet(quiet)); for (int i = 0; proc.isAlive() && i < 200; i++) { Thread.sleep(100); } assertFalse("proc is alive", proc.isAlive()); int exitCode = proc.join(); return new ProcReturn(proc, exitCode, out.toString()); }
Source:
public void readsEnumsUsingToString() throws Exception { mapper.configure(DeserializationFeature.READ_ENUMS_USING_TO_STRING, true); assertThat(mapper.readValue("\"Pound sterling\"", CurrencyCode.class)).isEqualTo(CurrencyCode.GBP); }

Target:
public void readsEnumsUsingToString() throws Exception { final ObjectMapper toStringEnumsMapper = mapper.copy() .configure(DeserializationFeature.READ_ENUMS_USING_TO_STRING, true); assertThat(toStringEnumsMapper.readValue("\"Pound sterling\"", CurrencyCode.class)).isEqualTo(CurrencyCode.GBP); }
Source:
public Optional<BlockState> bridge$getStateWithData(final IBlockState blockState, final ImmutableDataManipulator<?, ?> manipulator) { if (manipulator instanceof ImmutableConnectedDirectionData) { ImmutableConnectedDirectionData connectedDirectionData = (ImmutableConnectedDirectionData) manipulator; return Optional.of((BlockState) DirectionalBlockUtils.applyConnectedDirections(blockState, DIRECTION_TO_PROPERTY_MAPPING, (sourceBlockState, property) -> true, (sourceBlockState, property) -> false, connectedDirectionData.connectedDirections().get())); } return super.bridge$getStateWithData(blockState, manipulator); }

Target:
public Optional<BlockState> bridge$getStateWithData(final IBlockState blockState, final ImmutableDataManipulator<?, ?> manipulator) { if (manipulator instanceof ImmutableConnectedDirectionData) { final ImmutableConnectedDirectionData connectedDirectionData = (ImmutableConnectedDirectionData) manipulator; return Optional.of((BlockState) impl$applyConnectedDirections(blockState, connectedDirectionData.connectedDirections().get())); } return super.bridge$getStateWithData(blockState, manipulator); }
Source:
private String identifier(Class<?> caller) { return Optional.ofNullable(FrameworkUtil.getBundle(caller)) .map(b -> b.getSymbolicName()) .orElse(Optional.ofNullable(caller) .map(c -> c.getName()) .orElse(Status.class.getName())); }

Target:
private String identifier(Class<?> caller) { return Optional.ofNullable(caller) .flatMap(c -> Optional.ofNullable(FrameworkUtil.getBundle(c))) .map(b -> b.getSymbolicName()) .orElseGet(() -> Optional.ofNullable(caller) .map(c -> c.getName()) .orElse(getClass().getName())); }
Source:
static com.basho.riak.pbc.RiakObject convert(IRiakObject riakObject) { final VClock vc = riakObject.getVClock(); ByteString bucketName = nullSafeToByteString(riakObject.getBucket()); ByteString key = nullSafeToByteString(riakObject.getKey()); ByteString content = ByteString.copyFrom(riakObject.getValue()); ByteString vclock = null; if (vc != null) { vclock = nullSafeFromBytes(vc.getBytes()); } com.basho.riak.pbc.RiakObject result = new com.basho.riak.pbc.RiakObject(vclock, bucketName, key, content); for (com.basho.riak.client.RiakLink link : riakObject) { result.addLink(link.getTag(), link.getBucket(), link.getKey()); } for (Entry<String, String> metaDataItem : riakObject.userMetaEntries()) { result.addUsermetaItem(metaDataItem.getKey(), metaDataItem.getValue()); } for (Map.Entry<com.basho.riak.client.query.indexes.IntIndex, Set<Integer>> i : riakObject.allIntIndexes().entrySet()) { String name = i.getKey().getFullname(); for (Integer v : i.getValue()) { result.addIndex(name, v); } } for (Map.Entry<BinIndex, Set<String>> i : riakObject.allBinIndexes().entrySet()) { String name = i.getKey().getFullname(); for (String v : i.getValue()) { result.addIndex(name, v); } } result.setContentType(riakObject.getContentType()); return result; }

Target:
static com.basho.riak.pbc.RiakObject convert(IRiakObject riakObject) { final VClock vc = riakObject.getVClock(); ByteString bucketName = nullSafeToByteString(riakObject.getBucket()); ByteString key = nullSafeToByteString(riakObject.getKey()); ByteString content = ByteString.copyFrom(riakObject.getValue()); ByteString vclock = null; if (vc != null) { vclock = nullSafeFromBytes(vc.getBytes()); } com.basho.riak.pbc.RiakObject result = new com.basho.riak.pbc.RiakObject(vclock, bucketName, key, content); for (com.basho.riak.client.RiakLink link : riakObject) { result.addLink(link.getTag(), link.getBucket(), link.getKey()); } for (Entry<String, String> metaDataItem : riakObject.userMetaEntries()) { result.addUsermetaItem(metaDataItem.getKey(), metaDataItem.getValue()); } for (Map.Entry<IntIndex, Set<Integer>> i : riakObject.allIntIndexes().entrySet()) { String name = i.getKey().getFullname(); for (Integer v : i.getValue()) { result.addIndex(name, v); } } for (Map.Entry<BinIndex, Set<String>> i : riakObject.allBinIndexes().entrySet()) { String name = i.getKey().getFullname(); for (String v : i.getValue()) { result.addIndex(name, v); } } result.setContentType(riakObject.getContentType()); return result; }
Source:
protected void executeCommand() { if (getDiskImages().isEmpty()) { setSucceeded(true); return; } SealDisksVDSCommandParameters parameters = new SealDisksVDSCommandParameters(); parameters.setVmId(getParameters().getVmTemplateId()); parameters.setJobId(getParameters().getHostJobId()); getDiskImages().forEach(diskImage -> parameters.addVolume( diskImage.getStorageIds().get(0), diskImage.getId(), diskImage.getImageId())); lockTemplateInDb(); lockDiskImagesInDb(); VDSReturnValue vdsReturnValue = VdsCommandsHelper.runVdsCommandWithFailover( VDSCommandType.SealDisks, parameters, getDiskImages().get(0).getStoragePoolId(), this); if (!vdsReturnValue.getSucceeded()) { setCommandStatus(CommandStatus.FAILED); unlockDiskImagesInDb(); unlockTemplateInDb(); } setSucceeded(vdsReturnValue.getSucceeded()); }

Target:
protected void executeCommand() { if (getDiskImages().isEmpty()) { setSucceeded(true); return; } SealDisksVDSCommandParameters parameters = new SealDisksVDSCommandParameters(); parameters.setVmId(getParameters().getVmTemplateId()); parameters.setJobId(getParameters().getHostJobId()); getDiskImages().forEach(diskImage -> parameters.addVolume( diskImage.getStorageIds().get(0), diskImage.getId(), diskImage.getImageId())); VDSReturnValue vdsReturnValue = VdsCommandsHelper.runVdsCommandWithFailover( VDSCommandType.SealDisks, parameters, getDiskImages().get(0).getStoragePoolId(), this); if (!vdsReturnValue.getSucceeded()) { setCommandStatus(CommandStatus.FAILED); unlockTemplateInDb(); } setSucceeded(vdsReturnValue.getSucceeded()); }
Source:
public Enumeration<URL> getResources(String name) throws IOException { @SuppressWarnings("unchecked") Enumeration<URL>[] enums = (Enumeration<URL>[]) new Enumeration<?>[2]; enums[0] = findResources(name); enums[1] = getParent() == null ? null : getParent().getResources(name); return new Enumeration<URL>() { int index = 0; @Override public boolean hasMoreElements() { while (index < enums.length) { if (enums[index] != null && enums[index].hasMoreElements()) { return true; } index++; } return false; } @Override public URL nextElement() { if (!hasMoreElements()) { throw new NoSuchElementException(); } return enums[index].nextElement(); } }; }

Target:
public Enumeration<URL> getResources(String name) throws IOException { List<URL> resources = Collections.list(findResources(name)); if (getParent() != null) { Enumeration<URL> parentResources = getParent().getResources(name); if (parentResources.hasMoreElements()) { resources.addAll(Collections.list(parentResources)); } } return Collections.enumeration(resources); }
Source:
@Override public Double predict(Vector input) { Vector likelihood = likelihood(input); double maxLikelihood = -1.; int idxOfMax = -1; for (int i = 0; i < likelihood.size(); i++) { double prob = likelihood.get(i); if (prob > maxLikelihood) { maxLikelihood = prob; idxOfMax = i; } } return (double)idxOfMax; }

Target:
@Override public Double predict(Vector input) { return (double)likelihood(input).maxElement().index(); }
Source:
public void removeJob(T job) throws InternalErrorException { if (job == null) throw new InternalErrorException("Can't remove null job from set of running jobs."); jobsAccessLock.lock(); boolean removedSuccesfully = runningJobs.remove(job); jobsAccessLock.unlock(); if (!removedSuccesfully) throw new InternalErrorException("We can't remove job defined by PerunBean " + job.toString() + " because it is not defined as running!"); }

Target:
public boolean removeJob(T job) { if (job == null) return false; boolean removedSuccessfully; try { jobsAccessLock.lock(); removedSuccessfully = runningJobs.remove(job); } finally { jobsAccessLock.unlock(); } return removedSuccessfully; }
Source:
protected void handleReceive(final Context context, Intent data){ try { if (data != null && data.hasExtra(DownloadManager.EXTRA_DOWNLOAD_ID)) { long id = data.getLongExtra(DownloadManager.EXTRA_DOWNLOAD_ID, -1); if (id != -1) { logger.debug("Received download notification for id: " + id); NativeDownloadModel nm = environment.getDownloadManager().getDownload(id); if (nm == null || nm.status != DownloadManager.STATUS_SUCCESSFUL) { logger.debug("Download seems failed or cancelled for id : " + id); return; } else { logger.debug("Download successful for id : " + id); } environment.getStorage().markDownloadAsComplete(id, new DataCallback<VideoModel>() { @Override public void onResult(VideoModel result) { if(result!=null){ DownloadEntry download = (DownloadEntry) result; ISegment segIO = environment.getSegment(); segIO.trackDownloadComplete(download.videoId, download.eid, download.lmsUrl); PrefManager p = new PrefManager(context, download.username); long count = p.getLong(PrefManager.Key.COUNT_OF_VIDEOS_DOWNLOADED); if (count < 0) { count = 0; } count ++; p.put(PrefManager.Key.COUNT_OF_VIDEOS_DOWNLOADED, count); } } @Override public void onFail(Exception ex) { logger.error(ex); } }); } } } catch(Exception ex) { logger.error(ex); } }

Target:
protected void handleReceive(final Context context, Intent data){ try { if (data != null && data.hasExtra(DownloadManager.EXTRA_DOWNLOAD_ID)) { long id = data.getLongExtra(DownloadManager.EXTRA_DOWNLOAD_ID, -1); if (id != -1) { logger.debug("Received download notification for id: " + id); NativeDownloadModel nm = environment.getDownloadManager().getDownload(id); if (nm == null || nm.status != DownloadManager.STATUS_SUCCESSFUL) { logger.debug("Download seems failed or cancelled for id : " + id); return; } else { logger.debug("Download successful for id : " + id); } environment.getStorage().markDownloadAsComplete(id, new DataCallback<VideoModel>() { @Override public void onResult(VideoModel result) { if(result!=null){ DownloadEntry download = (DownloadEntry) result; ISegment segIO = environment.getSegment(); segIO.trackDownloadComplete(download.videoId, download.eid, download.lmsUrl); } } @Override public void onFail(Exception ex) { logger.error(ex); } }); } } } catch(Exception ex) { logger.error(ex); } }
Source:
public void shouldSeeSingleRelationshipInTransaction() throws Exception { int label; long n1, n2; try ( Transaction tx = session.beginTransaction() ) { n1 = tx.dataWrite().nodeCreate(); n2 = tx.dataWrite().nodeCreate(); long decoyNode = tx.dataWrite().nodeCreate(); label = tx.tokenWrite().relationshipTypeGetOrCreateForName( "R" ); tx.dataWrite().relationshipCreate( n2, label, decoyNode ); tx.success(); } try ( Transaction tx = session.beginTransaction() ) { label = tx.tokenWrite().relationshipTypeGetOrCreateForName( "R" ); long r = tx.dataWrite().relationshipCreate( n1, label, n2 ); try ( RelationshipScanCursor relationship = cursors.allocateRelationshipScanCursor() ) { tx.dataRead().singleRelationship( r, relationship ); assertTrue( "should find relationship", relationship.next() ); assertEquals( label, relationship.label() ); assertEquals( n1, relationship.sourceNodeReference() ); assertEquals( n2, relationship.targetNodeReference() ); assertEquals( r, relationship.relationshipReference() ); assertFalse( "should only find one relationship", relationship.next() ); } tx.success(); } }

Target:
public void shouldSeeSingleRelationshipInTransaction() throws Exception { int label; long n1, n2; try ( Transaction tx = session.beginTransaction() ) { n1 = tx.dataWrite().nodeCreate(); n2 = tx.dataWrite().nodeCreate(); long decoyNode = tx.dataWrite().nodeCreate(); label = tx.tokenWrite().relationshipTypeGetOrCreateForName( "R" ); tx.dataWrite().relationshipCreate( n2, label, decoyNode ); tx.success(); } try ( Transaction tx = session.beginTransaction() ) { long r = tx.dataWrite().relationshipCreate( n1, label, n2 ); try ( RelationshipScanCursor relationship = cursors.allocateRelationshipScanCursor() ) { tx.dataRead().singleRelationship( r, relationship ); assertTrue( "should find relationship", relationship.next() ); assertEquals( label, relationship.label() ); assertEquals( n1, relationship.sourceNodeReference() ); assertEquals( n2, relationship.targetNodeReference() ); assertEquals( r, relationship.relationshipReference() ); assertFalse( "should only find one relationship", relationship.next() ); } tx.success(); } }
Source:
public TermsOfUse getTermsOfUse() { return termsOfUse; }

Target:
public String getTermsOfUse() { return termsOfUse; }
Source:
public ItemStack slotClick(int par1, int par2, int par3, EntityPlayer par4EntityPlayer) { ItemStack st = par4EntityPlayer.inventory.getItemStack(); if(st != null && st.getItem() == EnderIO.itemExtractSpeedUpgrade && st.getItemDamage() != 0) { speedUpgradeSlotLimit = 1; } if(par4EntityPlayer.worldObj != null) { if(par1 >= startFilterSlot && itemConduit != null) { itemConduit.setInputFilter(dir, inputFilter); itemConduit.setOutputFilter(dir, outputFilter); } } try { return super.slotClick(par1, par2, par3, par4EntityPlayer); } catch (Exception e) { return null; } finally { speedUpgradeSlotLimit = 15; } }

Target:
public ItemStack slotClick(int par1, int par2, int par3, EntityPlayer par4EntityPlayer) { ItemStack st = par4EntityPlayer.inventory.getItemStack(); if(st != null && st.getItem() == EnderIO.itemExtractSpeedUpgrade) { SpeedUpgrade speedUpgrade = EnderIO.itemExtractSpeedUpgrade.getSpeedUpgrade(st); speedUpgradeSlotLimit = speedUpgrade.maxStackSize; } if(par4EntityPlayer.worldObj != null) { if(par1 >= startFilterSlot && itemConduit != null) { itemConduit.setInputFilter(dir, inputFilter); itemConduit.setOutputFilter(dir, outputFilter); } } try { return super.slotClick(par1, par2, par3, par4EntityPlayer); } catch (Exception e) { return null; } }
Source:
protected DeploymentUnitStatus.State getJobState(String jobName) { PagedResources<JobDefinitionResource> list = distributedTestSupport.ensureTemplate() .jobOperations().list(); for (JobDefinitionResource job : list) { if (job.getName().equals(jobName)) { return DeploymentUnitStatus.State.valueOf(job.getStatus()); } } throw new IllegalStateException(String.format("Job %s not deployed", jobName)); }

Target:
protected DeploymentUnitStatus.State getJobState(String jobName) { JobDefinitionResource job = getJob(jobName); if (job == null) { throw new IllegalStateException(String.format("Job %s not deployed", jobName)); } return DeploymentUnitStatus.State.valueOf(job.getStatus()); }
Source:
public VcfReader(VariantSource source, File file) { this.source = source; this.file = file; Resource resource = new GzipLazyResource(file); setResource(resource); setLineMapper(new VcfLineMapper(source)); }

Target:
public VcfReader(VariantSource source, File file) throws IOException { Resource resource; resource = FileUtils.getResource(file); setResource(resource); setLineMapper(new VcfLineMapper(source)); }
Source:
public List<MetricFamilySamples> collect() { List<MetricFamilySamples.Sample> samples = new ArrayList<MetricFamilySamples.Sample>(); for (Map.Entry<List<String>, Child> c : children.entrySet()) { Child.Value v = c.getValue().get(); samples.add(new MetricFamilySamples.Sample(fullname + "_count", labelNames, c.getKey(), v.count)); samples.add(new MetricFamilySamples.Sample(fullname + "_sum", labelNames, c.getKey(), v.sum)); if (this.shouldCalculateQuantiles()) { double[] data = c.getValue().reservoir.getSnapshot(); Arrays.sort(data); List<String> labelNamesWithQuantile = new ArrayList<String>(labelNames); labelNamesWithQuantile.add("quantile"); for (int i = 0; i < quantiles.length; i++) { List<String> labelValuesWithQuantile = new ArrayList<String>(c.getKey()); labelValuesWithQuantile.add(Double.toString(quantiles[i])); samples.add(new MetricFamilySamples.Sample(fullname, labelNamesWithQuantile, labelValuesWithQuantile, c.getValue().reservoir.getQuantile(quantiles[i], data))); } } } MetricFamilySamples mfs = new MetricFamilySamples(fullname, Type.SUMMARY, help, samples); List<MetricFamilySamples> mfsList = new ArrayList<MetricFamilySamples>(); mfsList.add(mfs); return mfsList; }

Target:
public List<MetricFamilySamples> collect() { List<MetricFamilySamples.Sample> samples = new ArrayList<MetricFamilySamples.Sample>(); for (Map.Entry<List<String>, Child> c : children.entrySet()) { Child.Value v = c.getValue().get(); samples.add(new MetricFamilySamples.Sample(fullname + "_count", labelNames, c.getKey(), v.count)); samples.add(new MetricFamilySamples.Sample(fullname + "_sum", labelNames, c.getKey(), v.sum)); if (this.shouldCalculateQuantiles()) { Map<Quantile, Double> snapshot; synchronized (stream) { snapshot = c.getValue().stream.getSnapshot(this.quantiles); } List<String> labelNamesWithQuantile = new ArrayList<String>(labelNames); labelNamesWithQuantile.add("quantile"); for (Map.Entry<Quantile, Double> qe : snapshot.entrySet()) { List<String> labelValuesWithQuantile = new ArrayList<String>(c.getKey()); labelValuesWithQuantile.add(Double.toString(qe.getKey().getQuantile())); samples.add(new MetricFamilySamples.Sample(fullname, labelNamesWithQuantile, labelValuesWithQuantile, qe.getValue())); } } } MetricFamilySamples mfs = new MetricFamilySamples(fullname, Type.SUMMARY, help, samples); List<MetricFamilySamples> mfsList = new ArrayList<MetricFamilySamples>(); mfsList.add(mfs); return mfsList; }
Source:
public static void proceedToNextStateFrom(InstallState prior) { InstallState current = Jenkins.getInstance().getInstallState(); if (!current.equals(prior)) { LOGGER.warning("Transitioning state from: " + prior + ", but current is: " + current); } InstallState next = getNextInstallState(prior); LOGGER.info("Install state tranisitioning from: " + prior + " to: " + next); if (next != null) { Jenkins.getInstance().setInstallState(next); } }

Target:
public static void proceedToNextStateFrom(InstallState prior) { InstallState current = Jenkins.getInstance().getInstallState(); if (!current.equals(prior)) { if (Main.isDevelopmentMode) LOGGER.warning("Transitioning state from: " + prior + ", but current is: " + current); } InstallState next = getNextInstallState(prior); if (Main.isDevelopmentMode) LOGGER.info("Install state tranisitioning from: " + prior + " to: " + next); if (next != null) { Jenkins.getInstance().setInstallState(next); } }
Source:
private void doAddReviewer() { final String nameEmail = addMemberBox.getText(); if (nameEmail == null || nameEmail.length() == 0 || com.google.gerrit.client.admin.Util.C.defaultAccountName().equals( nameEmail)) { return; } addMemberBox.setEnabled(false); final List<String> reviewers = Arrays.asList(nameEmail.split(";")); Util.DETAIL_SVC.addReviewers(reviewers, changeId, new GerritCallback<VoidResult>() { public void onSuccess(final VoidResult result) { addMemberBox.setEnabled(true); addMemberBox.setText(""); } @Override public void onFailure(final Throwable caught) { addMemberBox.setEnabled(true); super.onFailure(caught); } }); }

Target:
private void doAddReviewer() { final String nameEmail = addMemberBox.getText(); if (nameEmail.length() == 0) { return; } addMemberBox.setEnabled(false); final List<String> reviewers = Arrays.asList(nameEmail.split(";")); PatchUtil.DETAIL_SVC.addReviewers(changeId, reviewers, new GerritCallback<VoidResult>() { public void onSuccess(final VoidResult result) { addMemberBox.setEnabled(true); addMemberBox.setText(""); } @Override public void onFailure(final Throwable caught) { addMemberBox.setEnabled(true); super.onFailure(caught); } }); }
Source:
private void cacheNullForGroup(GroupColumnIO group, int r) { if (!groupNullCache.containsKey(group)) { groupNullCache.put(group, new IntArrayList()); } groupNullCache.get(group).add(r); }

Target:
private void cacheNullForGroup(GroupColumnIO group, int r) { IntArrayList nulls = groupNullCache.get(group); if (nulls == null) { nulls = new IntArrayList(); groupNullCache.put(group, nulls); } nulls.add(r); }
Source:
public String solveProblemForSingle() { this.solution.setId(getIdForCorrection(this.solutionTask)); serviceManager.getWorkflowService().setSolution(getSolution()); try { setCurrentStep(serviceManager.getWorkflowService().solveProblem(this.currentStep)); saveStep(); } catch (DAOException | DataException e) { Helper.setFehlerMeldung("correctionSolveProblem"); logger.error(e.getMessage(), e); } setSolution(serviceManager.getWorkflowService().getSolution()); this.solutionTask = ""; AktuelleSchritteForm asf = (AktuelleSchritteForm) Helper.getManagedBeanValue("#{AktuelleSchritteForm}"); return asf.filterAll(); }

Target:
public String solveProblemForSingle() { this.solution.setId(getIdForCorrection(this.solutionTask)); serviceManager.getWorkflowControllerService().setSolution(getSolution()); try { setCurrentStep(serviceManager.getWorkflowControllerService().solveProblem(this.currentStep)); saveStep(); } catch (DAOException | DataException e) { Helper.setErrorMessage("correctionSolveProblem", logger, e); } setSolution(serviceManager.getWorkflowControllerService().getSolution()); this.solutionTask = ""; AktuelleSchritteForm asf = (AktuelleSchritteForm) Helper.getManagedBeanValue("#{AktuelleSchritteForm}"); return asf.filterAll(); }
Source:
CommonsRequestLoggingFilter commonsRequestLoggingFilter() { CommonsRequestLoggingFilter result = new CommonsRequestLoggingFilter() { @Override protected String createMessage(HttpServletRequest request, String prefix, String suffix) { return super.createMessage(request, String.format("%smethod=%s;", prefix, request.getMethod()), suffix); } }; result.setIncludeQueryString(true); result.setIncludeHeaders(false); result.setIncludeClientInfo(true); return result; }

Target:
CommonsRequestLoggingFilter commonsRequestLoggingFilter() { CommonsRequestLoggingFilter result = new CommonsRequestLoggingFilter() { @Override protected String createMessage(HttpServletRequest request, String prefix, String suffix) { return super.createMessage(request, String.format("%smethod=%s;", prefix, request.getMethod()), suffix); } }; result.setIncludeQueryString(true); result.setIncludeHeaders(true); result.setHeaderPredicate(s -> !(s.equals("Authorization") || s.equals("Cookie"))); result.setIncludeClientInfo(true); return result; }
Source:
public void put(long entryLogId, EntryLogMetadata entryLogMeta) throws EntryLogMetadataMapException { LongWrapper key = LongWrapper.get(entryLogId); try { baos.get().reset(); try { entryLogMeta.serialize(dataos.get()); dataos.get().flush(); metadataMapDB.put(key.array, baos.get().toByteArray()); } catch (IllegalStateException | IOException e) { LOG.error("Failed to deserialize entrylog-metadata, entryLogId {}", entryLogId); throw new EntryLogMetadataMapException(e); } } finally { key.recycle(); } }

Target:
public void put(long entryLogId, EntryLogMetadata entryLogMeta) throws EntryLogMetadataMapException { LongWrapper key = LongWrapper.get(entryLogId); try { baos.get().reset(); try { entryLogMeta.serialize(dataos.get()); metadataMapDB.put(key.array, baos.get().toByteArray()); } catch (IllegalStateException | IOException e) { LOG.error("Failed to serialize entrylog-metadata, entryLogId {}", entryLogId); throw new EntryLogMetadataMapException(e); } } finally { key.recycle(); } }
Source:
public List<MaplayerGroup> findByParentId(final int groupId) { final List<MaplayerGroup> allGroups = findAll(); List<MaplayerGroup> retGroups = new ArrayList<>(); for(MaplayerGroup group : allGroups) { if(group.getParentId() == groupId) { retGroups.add(group); } } retGroups.stream() .filter(g -> g.getParentId() == -1) .sorted(Comparator.comparing(MaplayerGroup::getOrderNumber, Comparator.nullsLast(Comparator.naturalOrder()))) .collect(Collectors.toList()); return retGroups; }

Target:
public List<MaplayerGroup> findByParentId(final int groupId) { final List<MaplayerGroup> groups = queryForList(getNameSpace() + ".findByParentId", groupId); return groups; }
Source:
static <T> Future<T> future(Handler<Promise<T>> handler) { Promise<T> promise = Promise.promise(); try{ handler.handle(promise); }catch (Exception e){ promise.fail(e); } return promise.future(); }

Target:
static <T> Future<T> future(Handler<Promise<T>> handler) { Promise<T> promise = Promise.promise(); try { handler.handle(promise); } catch (Exception e){ promise.tryFail(e); } return promise.future(); }
Source:
private ConfigurationBuilder getScriptCacheConfiguration() { GlobalConfiguration globalConfiguration = cacheManager.getGlobalComponentRegistry().getGlobalConfiguration(); CacheMode cacheMode = globalConfiguration.isClustered() ? CacheMode.REPL_SYNC : CacheMode.LOCAL; ConfigurationBuilder cfg = new ConfigurationBuilder(); cfg.transaction() .transactionMode(TransactionMode.TRANSACTIONAL).invocationBatching().enable() .transaction().lockingMode(LockingMode.PESSIMISTIC).syncCommitPhase(true).syncRollbackPhase(true) .locking().isolationLevel(IsolationLevel.READ_COMMITTED).useLockStriping(false) .clustering().cacheMode(cacheMode).sync() .stateTransfer().fetchInMemoryState(true).awaitInitialTransfer(false) .compatibility().enable().marshaller(new GenericJBossMarshaller()) .customInterceptors().addInterceptor() .interceptor(new ScriptingManagerInterceptor()).after(PessimisticLockingInterceptor.class); return cfg; }

Target:
private ConfigurationBuilder getScriptCacheConfiguration() { GlobalConfiguration globalConfiguration = cacheManager.getGlobalComponentRegistry().getGlobalConfiguration(); CacheMode cacheMode = globalConfiguration.isClustered() ? CacheMode.REPL_SYNC : CacheMode.LOCAL; ConfigurationBuilder cfg = new ConfigurationBuilder(); cfg.clustering().cacheMode(cacheMode).sync().stateTransfer().fetchInMemoryState(true).awaitInitialTransfer(false).compatibility().enable() .marshaller(new GenericJBossMarshaller()).customInterceptors().addInterceptor().interceptor(new ScriptingInterceptor()).before(CacheMgmtInterceptor.class); if (globalConfiguration.security().authorization().enabled()) { globalConfiguration.security().authorization().roles().put(SCRIPT_MANAGER_ROLE, new CacheRoleImpl(SCRIPT_MANAGER_ROLE, AuthorizationPermission.ALL)); cfg.security().authorization().enable().role(SCRIPT_MANAGER_ROLE); } return cfg; }
Source:
private String getPassword(Properties properties) throws IOException { if (isNotEmpty(properties.getProperty(PASSWORD_KEY))) { return properties.getProperty(PASSWORD_KEY); } else if (isNotEmpty(properties.getProperty(JDBC_JCEKS_FILE)) && isNotEmpty(properties.getProperty(JDBC_JCEKS_CREDENTIAL_KEY))) { try { Configuration configuration = new Configuration(); configuration.set(CredentialProviderFactory.CREDENTIAL_PROVIDER_PATH, properties.getProperty(JDBC_JCEKS_FILE)); CredentialProvider provider = CredentialProviderFactory.getProviders(configuration).get(0); CredentialProvider.CredentialEntry credEntry = provider.getCredentialEntry(properties.getProperty(JDBC_JCEKS_CREDENTIAL_KEY)); if (credEntry != null) { return new String(credEntry.getCredential()); } else { throw new InterpreterException("Failed to retrieve password from JCEKS from key: " + properties.getProperty(JDBC_JCEKS_CREDENTIAL_KEY)); } } catch (Exception e) { logger.error("Failed to retrieve password from JCEKS", e); logger.error("For file: " + properties.getProperty(JDBC_JCEKS_FILE)); logger.error("For key: " + properties.getProperty(JDBC_JCEKS_CREDENTIAL_KEY)); throw e; } } return null; }

Target:
private String getPassword(Properties properties) throws IOException { if (isNotEmpty(properties.getProperty(PASSWORD_KEY))) { return properties.getProperty(PASSWORD_KEY); } else if (isNotEmpty(properties.getProperty(JDBC_JCEKS_FILE)) && isNotEmpty(properties.getProperty(JDBC_JCEKS_CREDENTIAL_KEY))) { try { Configuration configuration = new Configuration(); configuration.set(CredentialProviderFactory.CREDENTIAL_PROVIDER_PATH, properties.getProperty(JDBC_JCEKS_FILE)); CredentialProvider provider = CredentialProviderFactory.getProviders(configuration).get(0); CredentialProvider.CredentialEntry credEntry = provider.getCredentialEntry(properties.getProperty(JDBC_JCEKS_CREDENTIAL_KEY)); if (credEntry != null) { return new String(credEntry.getCredential()); } else { throw new InterpreterException("Failed to retrieve password from JCEKS from key: " + properties.getProperty(JDBC_JCEKS_CREDENTIAL_KEY)); } } catch (Exception e) { logger.error("Failed to retrieve password from JCEKS \n" + "For file: " + properties.getProperty(JDBC_JCEKS_FILE) + "\nFor key: " + properties.getProperty(JDBC_JCEKS_CREDENTIAL_KEY), e); throw e; } } return null; }
Source:
public CommandResult exec(ContextAwareCommandInvocation invocation) { if (paths.size() < 3) { throw Messages.MSG.patchCreateArgumentsRequired(); } PatchTool patchTool = new PatchTool(invocation.getShellOutput(), invocation.getShellError()); try { Path patch = Paths.get(paths.get(0).getAbsolutePath()); Path target = Paths.get(paths.get(1).getAbsolutePath()); Path sources[] = new Path[paths.size() - 2]; for (int i = 2; i < paths.size(); i++) { sources[i - 2] = Paths.get(paths.get(i).getAbsolutePath()); } patchTool.createPatch(qualifier, patch, target, sources); return CommandResult.SUCCESS; } catch (IOException e) { throw new RuntimeException(e); } }

Target:
public CommandResult exec(ContextAwareCommandInvocation invocation) throws CommandException { if (paths == null || paths.size() < 3) { throw Messages.MSG.patchCreateArgumentsRequired(); } PatchTool patchTool = new PatchTool(invocation.getShellOutput(), invocation.getShellError()); try { Path patch = Paths.get(paths.get(0).getAbsolutePath()); Path target = Paths.get(paths.get(1).getAbsolutePath()); Path sources[] = new Path[paths.size() - 2]; for (int i = 2; i < paths.size(); i++) { sources[i - 2] = Paths.get(paths.get(i).getAbsolutePath()); } patchTool.createPatch(qualifier, patch, target, sources); return CommandResult.SUCCESS; } catch (IOException e) { throw new CommandException(e); } }
Source:
public int hashCode() { return Objects.hash(name); }

Target:
public int hashCode() { return Objects.hashCode(name); }
Source:
public void setVSync(boolean vsync) { this.vsync = vsync; try{ Display.setVSyncEnabled(vsync); } catch (Exception e) { Log.error("GL error", e); } }

Target:
public void setVSync(boolean vsync) { this.vsync = vsync; Display.setVSyncEnabled(vsync); }
Source:
protected void updateVersion(Version newVersion) { checkNotNull(newVersion); if (this.version.equals(newVersion)) { return; } final int currentVersionNumber = versionNumber(); final int newVersionNumber = newVersion.getNumber(); if (currentVersionNumber > newVersionNumber) { final String errMsg = format( "A version with the lower number (%d) passed to `updateVersion()` " + "of the entity with the version number %d.", newVersionNumber, currentVersionNumber ); throw new IllegalArgumentException(errMsg); } this.version = newVersion; }

Target:
private void updateVersion(Version newVersion) { checkNotNull(newVersion); if (version.equals(newVersion)) { return; } final int currentVersionNumber = versionNumber(); final int newVersionNumber = newVersion.getNumber(); if (currentVersionNumber > newVersionNumber) { final String errMsg = format( "A version with the lower number (%d) passed to `updateVersion()` " + "of the entity with the version number %d.", newVersionNumber, currentVersionNumber ); throw new IllegalArgumentException(errMsg); } setVersion(newVersion); }
Source:
public boolean onCreateOptionsMenu(Menu menu) { MenuItem buttonSettings = menu.add(R.string.title_settings); buttonSettings.setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER); buttonSettings.setOnMenuItemClickListener(new MenuItem. OnMenuItemClickListener() { @Override public boolean onMenuItemClick(MenuItem item) { Intent settingsIntent = new Intent(AddBudgetActivity.this, SettingsActivity.class); settingsIntent.putExtra(PreferenceActivity.EXTRA_SHOW_FRAGMENT, SettingsFragment.class.getName()); settingsIntent.putExtra(PreferenceActivity.EXTRA_NO_HEADERS, true); AddBudgetActivity.this.startActivity(settingsIntent); return false; } }); MenuItem buttonSignout = menu.add(R.string.title_signout); buttonSignout.setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER); buttonSignout.setOnMenuItemClickListener(new MenuItem. OnMenuItemClickListener() { @Override public boolean onMenuItemClick(MenuItem item) { ApiInterface.getInstance().logOut(); Intent logOut = new Intent(AddBudgetActivity.this, LoginActivity.class); logOut.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK); startActivity(logOut); return false; } }); return true; }

Target:
public boolean onCreateOptionsMenu(Menu menu) { MenuInflater inflater = getMenuInflater(); inflater.inflate(R.menu.items, menu); return super.onCreateOptionsMenu(menu); }
Source:
public synchronized void onClusterStateChange(VersionedOperationMode mode) { m_clusterMode = mode.getMode(); switch (m_clusterMode) { case PAUSED: importLog.info("Cluster is paused shutting down all importers."); close(); importLog.info("Cluster is paused all importers shutdown."); break; case RUNNING: importLog.info("Cluster is resumed STARTING all importers."); resume(); importLog.info("Cluster is resumed STARTED all importers."); break; default: break; } }

Target:
public synchronized void onClusterStateChange(VersionedOperationMode mode) { switch (mode.getMode()) { case PAUSED: importLog.info("Cluster is paused shutting down all importers."); close(); importLog.info("Cluster is paused all importers shutdown."); break; case RUNNING: importLog.info("Cluster is resumed STARTING all importers."); resume(); importLog.info("Cluster is resumed STARTED all importers."); break; default: break; } }
Source:
public void close() { try { heliosClient.close(); } catch (IOException e) { log.warn("HeliosClient did not close cleanly: {}", e); } }

Target:
public void close() { if (!existingHeliosClient) { try { heliosClient.close(); } catch (IOException e) { log.warn("HeliosClient did not close cleanly: {}", e.toString()); } } jobPrefixFile.delete(); }
Source:
private void validateAppConfig(String fileName) throws Exception { String appsDir = getAppsDirectory(); if (appsDir.equalsIgnoreCase("apps") && !isFoundAppNameConfigInSourceServerXml(fileName)) { applicationXml.createWebApplicationElement(fileName); } else if (appsDir.equalsIgnoreCase("dropins") && isFoundAppConfigInSourceServerXml()) throw new MojoExecutionException(messages.getString("error.install.app.dropins.directory")); }

Target:
private void validateAppConfig(String fileName) throws Exception { String appsDir = getAppsDirectory(); if (appsDir.equalsIgnoreCase("apps") && !isAppConfiguredInSourceServerXml(fileName)) { applicationXml.createWebApplicationElement(fileName); } else if (appsDir.equalsIgnoreCase("dropins") && isAppConfiguredInSourceServerXml(fileName)) throw new MojoExecutionException(messages.getString("error.install.app.dropins.directory")); }
Source:
private Object createInstance(String className) throws ExecutorException { try { Class<?> clazz = Class.forName(className); Constructor<?> ctor = clazz.getConstructor(); return ctor.newInstance(); } catch (ClassNotFoundException | NoSuchMethodException | IllegalAccessException | InstantiationException | InvocationTargetException e) { throw new ExecutorException(e); } }

Target:
private Object createInstance(String className) throws Exception { try { Class<?> clazz = Class.forName(className); Constructor<?> ctor = clazz.getConstructor(); return ctor.newInstance(); } catch (ClassNotFoundException | NoSuchMethodException | IllegalAccessException | InstantiationException | InvocationTargetException e) { throw new ExecutorException(e); } }
Source:
protected void executeCommand() { GlusterGeoRepSession session = getGeoRepSession(); VDSReturnValue returnValue = runVdsCommand(VDSCommandType.SetGlusterVolumeGeoRepConfig, new GlusterVolumeGeoRepConfigVdsParameters(upServer.getId(), session.getMasterVolumeName(), session.getSlaveHostName(), session.getSlaveVolumeName(), getParameters().getConfigKey(), getParameters().getConfigValue())); setSucceeded(returnValue.getSucceeded()); if(!getSucceeded()) { handleVdsError(AuditLogType.GLUSTER_GEOREP_CONFIG_SET_FAILED, returnValue.getVdsError().getMessage()); return; } }

Target:
protected void executeCommand() { GlusterGeoRepSession session = getGeoRepSession(); String configKey = getParameters().getConfigKey(); String configValue = getParameters().getConfigValue(); VDSReturnValue returnValue = runVdsCommand(VDSCommandType.SetGlusterVolumeGeoRepConfig, new GlusterVolumeGeoRepConfigVdsParameters(upServer.getId(), session.getMasterVolumeName(), session.getSlaveHostName(), session.getSlaveVolumeName(), configKey, configValue)); setSucceeded(returnValue.getSucceeded()); if (getSucceeded()) { GlusterGeoRepSessionConfiguration geoRepSessionConfig = new GlusterGeoRepSessionConfiguration(); geoRepSessionConfig.setValue(configValue); geoRepSessionConfig.setKey(configKey); geoRepSessionConfig.setId(session.getId()); getGlusterGeoRepDao().updateConfig(geoRepSessionConfig); } else { handleVdsError(AuditLogType.GLUSTER_GEOREP_CONFIG_SET_FAILED, returnValue.getVdsError().getMessage()); return; } }
Source:
private static long getStatsAsLong(Properties stats, String key) { return (Long) firstNonNull(stats.get(key), 0); }

Target:
private static long getStatsAsLong(Properties stats, String key) { Object value = stats.get(key); if (value instanceof Number) return ((Number) value).longValue(); return 0L; }
Source:
public void testAggregation() { assertQuery("SELECT ST_AsText(point), count(*) " + "FROM (VALUES (ST_Point(1, 2)), (ST_Point(3, 4)), (ST_Point(3, 4)), (ST_Point(5, 6))) as t(point) " + "GROUP BY 1", "SELECT * FROM (VALUES ('POINT (1 2)', 1), ('POINT (3 4)', 2), ('POINT (5 6)', 1))"); }

Target:
public void testAggregation() { assertQuery("SELECT ST_AsText(point), COUNT(*) " + "FROM (VALUES (ST_Point(1, 2)), (ST_Point(3, 4)), (ST_Point(3, 4)), (ST_Point(5, 6))) as t(point) " + "GROUP BY 1", "SELECT * FROM (VALUES ('POINT (1 2)', 1), ('POINT (3 4)', 2), ('POINT (5 6)', 1))"); }
Source:
private synchronized SecretKey getUnwrappedSecretKey() throws GeneralSecurityException, IOException { Logger.v(TAG, "Reading SecretKey"); SecretKey unwrappedSecretKey; try { final byte[] wrappedSecretKey = readKeyData(); unwrappedSecretKey = unwrap(wrappedSecretKey); Logger.v(TAG, "Finished reading SecretKey"); } catch (final GeneralSecurityException | IOException ex) { Logger.e(TAG, "Unwrap failed for AndroidKeyStore", "", ADALError.ANDROIDKEYSTORE_FAILED, ex); mKeyPair = null; deleteKeyFile(); resetKeyPairFromAndroidKeyStore(); Logger.v(TAG, "Removed previous key pair info."); throw ex; } return unwrappedSecretKey; }

Target:
private synchronized SecretKey getUnwrappedSecretKey() throws GeneralSecurityException, IOException { Logger.v(TAG, "Reading SecretKey"); final SecretKey unwrappedSecretKey; try { final byte[] wrappedSecretKey = readKeyData(); unwrappedSecretKey = unwrap(wrappedSecretKey); Logger.v(TAG, "Finished reading SecretKey"); } catch (final GeneralSecurityException | IOException ex) { Logger.e(TAG, "Unwrap failed for AndroidKeyStore", "", ADALError.ANDROIDKEYSTORE_FAILED, ex); mKeyPair = null; deleteKeyFile(); resetKeyPairFromAndroidKeyStore(); Logger.v(TAG, "Removed previous key pair info."); throw ex; } return unwrappedSecretKey; }
Source:
public UnixConnectionSocketFactory(final URI socketUri) { super(); String filename = socketUri.toString() .replaceAll("^unix:/ .replaceAll("^unix://localhost", ""); this.socketFile = new File(filename); }

Target:
public UnixConnectionSocketFactory(final URI socketUri) { super(); final String filename = socketUri.toString() .replaceAll("^unix:/ .replaceAll("^unix://localhost", ""); this.socketFile = new File(filename); }
Source:
public void updateDimensions(int width, int height) { if (height > width) { setMinimumSize(getMinimumSize()); setPreferredSize(new Dimension(width, width)); setMaximumSize(new Dimension(width, width)); } else { setMinimumSize(getMinimumSize()); setPreferredSize(new Dimension(height, height)); setMaximumSize(new Dimension(height, height)); } }

Target:
public void updateDimensions(int width, int height) { int size = Math.min(width, height); setMinimumSize(new Dimension(size, size)); setPreferredSize(new Dimension(size, size)); setMaximumSize(new Dimension(size, size)); revalidate(); repaint(); }
Source:
public void setProjectName(String projectName) { fProjectName = projectName; if (fSelectedConnection != null && fSelectedConnection.isOpen()) { IRemoteFileService fileSvc = fSelectedConnection.getService(IRemoteFileService.class); if (fileSvc != null) { if(fileSvc.getBaseDirectory().equals(fLocationText.getText())) fRemoteDirSelected = false; } } if(fLocationText.getText().equals(EMPTY_STRING)) { fRemoteDirSelected = false; } if (!fRemoteDirSelected) { fLocationText.setText(getDefaultPathDisplayString()); } }

Target:
public void setProjectName(String projectName) { fProjectName = projectName; if(fLocationText.getText().equals(EMPTY_STRING)) { fRemoteDirSelected = false; } if (!fRemoteDirSelected) { fLocationText.setText(getDefaultPathDisplayString()); } }
Source:
protected BatchDeleteClientsRequest getValidRequest() throws Exception { return BatchDeleteClientsRequest.builder() .clientIdentification(ClientIdentification.builder() .clientId("14pnUs") .build()) .clientIdentification(ClientIdentification.builder() .clientId("qECLyr") .build()) .build(); }

Target:
protected BatchDeleteClientsRequest getValidRequest() throws Exception { return BatchDeleteClientsRequest.builder() .clientId("14pnUs", "qECLyr") .build(); }