auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected int doWork() { IOUtil.assertFileIsReadable(INPUT); IOUtil.assertFileIsWritable(OUTPUT); if (PROBABILITY == 1) { log.warn("Running DownsampleSam with PROBABILITY=1! This will likely just recreate the input file."); } final Random r = RANDOM_SEED == null ? new Random() : new Random(RANDOM_SEED); final SamReader in = SamReaderFactory.makeDefault().referenceSequence(REFERENCE_SEQUENCE).open(SamInputResource.of(INPUT)); final SAMFileWriter out = new SAMFileWriterFactory().makeSAMOrBAMWriter(in.getFileHeader(), true, OUTPUT); final ProgressLogger progress = new ProgressLogger(log, (int) 1e7, "Wrote"); final DownsamplingIterator iterator = DownsamplingIteratorFactory.make(in, STRATEGY, PROBABILITY, ACCURACY, RANDOM_SEED); final PublicCollectQualityYieldMetrics metricsCollector = new PublicCollectQualityYieldMetrics(); while (iterator.hasNext()) { final SAMRecord rec = iterator.next(); out.addAlignment(rec); metricsCollector.acceptRead(rec, null); progress.record(rec); } out.close(); CloserUtil.close(in); final NumberFormat fmt = new DecimalFormat("0.00%"); log.info("Finished downsampling."); log.info("Kept ", iterator.getAcceptedCount(), " out of ", iterator.getSeenCount(), " reads (", fmt.format(iterator.getAcceptedFraction()), ")."); if (METRICS_FILE != null) metricsCollector.finish(); return 0; }

Target:
protected int doWork() { IOUtil.assertFileIsReadable(INPUT); IOUtil.assertFileIsWritable(OUTPUT); if (PROBABILITY == 1) { log.warn("Running DownsampleSam with PROBABILITY=1! This will likely just recreate the input file."); } final Random r = RANDOM_SEED == null ? new Random() : new Random(RANDOM_SEED); final SamReader in = SamReaderFactory.makeDefault().referenceSequence(REFERENCE_SEQUENCE).open(SamInputResource.of(INPUT)); final SAMFileWriter out = new SAMFileWriterFactory().makeSAMOrBAMWriter(in.getFileHeader(), true, OUTPUT); final ProgressLogger progress = new ProgressLogger(log, (int) 1e7, "Wrote"); final DownsamplingIterator iterator = DownsamplingIteratorFactory.make(in, STRATEGY, PROBABILITY, ACCURACY, RANDOM_SEED); final QualityYieldMetricsCollector metricsCollector = new QualityYieldMetricsCollector(true, false, false); while (iterator.hasNext()) { final SAMRecord rec = iterator.next(); out.addAlignment(rec); if (METRICS_FILE != null) metricsCollector.acceptRecord(rec, null); progress.record(rec); } out.close(); CloserUtil.close(in); final NumberFormat fmt = new DecimalFormat("0.00%"); log.info("Finished downsampling."); log.info("Kept ", iterator.getAcceptedCount(), " out of ", iterator.getSeenCount(), " reads (", fmt.format(iterator.getAcceptedFraction()), ")."); if (METRICS_FILE != null) { final MetricsFile<QualityYieldMetrics, Integer> metricsFile = getMetricsFile(); metricsCollector.finish(); metricsCollector.addMetricsToFile(metricsFile); metricsFile.write(METRICS_FILE); } return 0; }
Source:
static <T> Single<? extends T>[] iterableToArray(final Iterable<? extends Single<? extends T>> singlesIterable) { final Single<? extends T>[] singlesArray; int count; if (singlesIterable instanceof List) { List<? extends Single<? extends T>> list = (List<? extends Single<? extends T>>) singlesIterable; count = list.size(); singlesArray = list.toArray(new Single[count]); } else { Single<? extends T>[] tempArray = new Single[8]; count = 0; for (Single<? extends T> s : singlesIterable) { if (count == tempArray.length) { Single<? extends T>[] sb = new Single[count + (count >> 2)]; System.arraycopy(tempArray, 0, sb, 0, count); tempArray = sb; } tempArray[count] = s; count++; } if (tempArray.length == count) { singlesArray = tempArray; } else { singlesArray = new Single[count]; System.arraycopy(tempArray, 0, singlesArray, 0, count); } } return singlesArray; }

Target:
static <T> Single<? extends T>[] iterableToArray(final Iterable<? extends Single<? extends T>> singlesIterable) { final Single<? extends T>[] singlesArray; int count; if (singlesIterable instanceof Collection) { Collection<? extends Single<? extends T>> list = (Collection<? extends Single<? extends T>>) singlesIterable; count = list.size(); singlesArray = list.toArray(new Single[count]); } else { Single<? extends T>[] tempArray = new Single[8]; count = 0; for (Single<? extends T> s : singlesIterable) { if (count == tempArray.length) { Single<? extends T>[] sb = new Single[count + (count >> 2)]; System.arraycopy(tempArray, 0, sb, 0, count); tempArray = sb; } tempArray[count] = s; count++; } if (tempArray.length == count) { singlesArray = tempArray; } else { singlesArray = new Single[count]; System.arraycopy(tempArray, 0, singlesArray, 0, count); } } return singlesArray; }
Source:
public InputStream openStream(String bucketName, String key) { ReadChannel readChannel; try { Blob blob = googleCloudStorageClient.getObject(bucketName, key); if (blob == null) { throw new IllegalArgumentException("Did not find Google Cloud object at key " + key + " from bucket " + bucketName); } readChannel = blob.reader(); } catch (StorageException e) { throw new IllegalArgumentException("Could not read object at key " + key + " from bucket " + bucketName, e); } return Channels.newInputStream(readChannel); }

Target:
public InputStream openStream(String bucketName, String key) { ReadChannel readChannel = null; try { Blob blob = googleCloudStorageClient.getObject(bucketName, key); if (blob == null) { throw new IllegalArgumentException("Did not find Google Cloud object at key " + key + " from bucket " + bucketName); } readChannel = blob.reader(); return Channels.newInputStream(readChannel); } catch (Throwable e) { dispose(readChannel); if (e instanceof IllegalArgumentException) { throw e; } throw new IllegalArgumentException("Could not read object at key " + key + " from bucket " + bucketName, e); } }
Source:
private void checkEditorStateAfterSave(String location, boolean canSave) { ((CDK3ServerEditor) editor).getMinishiftBinaryLabel().setText(location); AbstractWait.sleep(TimePeriod.getCustom(1)); if (canSave) { verifyEditorCanSave(); } else { verifyEditorCannotSave(); } }

Target:
private void checkEditorStateAfterSave(String location, boolean canSave) { LabeledText label = ((CDK3ServerEditor) editor).getMinishiftBinaryLabel(); label.setText(location); new WaitUntil(new SystemJobIsRunning(jobMatcher), TimePeriod.SHORT, false); new WaitWhile(new SystemJobIsRunning(jobMatcher), TimePeriod.SHORT, false); if (canSave) { verifyEditorCanSave(); } else { verifyEditorCannotSave(); } }
Source:
public boolean isDefault() { boolean isDefault = false; if ( mapperToImplement != null ) { isDefault = Executables.isInterfaceDefaultMethod( executable, mapperToImplement.getTypeElement() ); } return isDefault; }

Target:
public boolean isDefault() { return Executables.isDefaultMethod( executable ); }
Source:
public void nextTuple() { try { if (refreshSubscriptionTimer.isExpiredResetOnTrue()) { kafkaSpoutConfig.getSubscription().refreshAssignment(); } if (commit()) { commitOffsetsForAckedTuples(); } Set<TopicPartition> pollablePartitions = poll(); if (!pollablePartitions.isEmpty()) { try { setWaitingToEmit(pollKafkaBroker(pollablePartitions)); } catch (RetriableException e) { LOG.error("Failed to poll from kafka.", e); } } emitIfWaitingNotEmitted(); } catch (InterruptException e) { throwKafkaConsumerInterruptedException(); } }

Target:
public void nextTuple() { try { if (refreshSubscriptionTimer.isExpiredResetOnTrue()) { kafkaSpoutConfig.getSubscription().refreshAssignment(); } if (shouldCommit()) { commitOffsetsForAckedTuples(kafkaConsumer.assignment()); } PollablePartitionsInfo pollablePartitionsInfo = getPollablePartitionsInfo(); if (pollablePartitionsInfo.shouldPoll()) { try { setWaitingToEmit(pollKafkaBroker(pollablePartitionsInfo)); } catch (RetriableException e) { LOG.error("Failed to poll from kafka.", e); } } emitIfWaitingNotEmitted(); } catch (InterruptException e) { throwKafkaConsumerInterruptedException(); } }
Source:
private List<BuiltinMacs> checkAndSetGitMacs(String gitSshMacs) { if (gitSshMacs == null || gitSshMacs.isEmpty()) { return managedMACs; } else { List<BuiltinMacs> macs = new ArrayList<>(); List<String> macsInput = Arrays.asList(gitSshMacs.split(",")); for (String macCode : macsInput) { BuiltinMacs mac = BuiltinMacs.fromFactoryName(macCode.trim().toLowerCase()); if (mac != null && managedMACs.contains(mac)) { macs.add(mac); LOG.info("Added MAC to the git ssh configuration. ", mac); }else{ LOG.info("MAC not handled in git ssh configuration. ", mac); } } return macs; } }

Target:
private List<BuiltinMacs> checkAndSetGitMacs(String gitSshMacs) { if (gitSshMacs == null || gitSshMacs.isEmpty()) { return managedMACs; } else { List<BuiltinMacs> macs = new ArrayList<>(); List<String> macsInput = Arrays.asList(gitSshMacs.split(",")); for (String macCode : macsInput) { BuiltinMacs mac = BuiltinMacs.fromFactoryName(macCode.trim().toLowerCase()); if (mac != null && managedMACs.contains(mac)) { macs.add(mac); LOG.info("Added MAC to the git ssh configuration. ", mac); } else { LOG.warn("MAC not handled in git ssh configuration. ", mac); } } return macs; } }
Source:
public IpSecTransform.Builder setEncryption( @TransformDirection int direction, IpSecAlgorithm algo) { if (mConfig.getAuthenticatedEncryption(direction) != null) { throw new IllegalArgumentException( "Encryption is unsupported while " + "Authenticated Encryption algorithm is specified"); } mConfig.setEncryption(direction, algo); return this; }

Target:
public IpSecTransform.Builder setEncryption( @TransformDirection int direction, IpSecAlgorithm algo) { mConfig.setEncryption(direction, algo); return this; }
Source:
public RetryPolicy() { this(new RetryPolicyOptions(new ExponentialBackoff(), RETRY_AFTER_MS_HEADER, ChronoUnit.MILLIS)); }

Target:
public RetryPolicy() { this(new RetryPolicyOptions(new ExponentialBackoff())); }
Source:
public void shouldNotTimeout() { try { WebTestClient.ResponseSpec response = webTestClient.get() .uri("/timeout/{timeout}", 1) .exchange(); response.expectStatus() .isOk() .expectBody(String.class) .isEqualTo("OK"); } catch (ReadTimeoutException e) { Assert.fail(); } }

Target:
public void shouldNotTimeout() { WebTestClient.ResponseSpec response = webTestClient.get() .uri("/timeout/{timeout}", 1) .exchange(); response.expectStatus() .isOk() .expectBody(String.class) .isEqualTo("OK"); }
Source:
public Object get(String name) { if ( attrs.containsKey(name) ) { return attrs.get(name).get(g); } else if ( g.hasAnyAttribute(name) ) { return g.getAnyAttribute(name); } else if ( g.getFilters().contains(name) ) { return "1"; } else return super.get(name); }

Target:
public Object get(String name) { if ( attributes.containsKey(name) ) { return attributes.get(name).get(g); } else if ( g.hasAnyAttribute(name) ) { return g.getAnyAttribute(name); } else if ( g.getFilters().contains(name) ) { return "1"; } else return super.get(name); }
Source:
@Test public void getWithQueryParamIterable() throws Exception { Request request = new Helper() .setMethod("GET") .setUrl("<LINK_0>") .setPath("/foo/bar/") .addQueryParam("ping", Arrays.asList(new String[]{"pong", "pong-too"})) .build(); assertThat(request.getMethod()).isEqualTo("GET"); assertThat(request.getHeaders()).isEmpty(); assertThat(request.getUrl()).isEqualTo("<LINK_0>/foo/bar/?ping=pong&ping=pong-too"); assertThat(request.getBody()).isNull(); }

Target:
@Test public void getWithQueryParamIterable() throws Exception { Request request = new Helper() .setMethod("GET") .setUrl("<LINK_0>") .setPath("/foo/bar/") .addQueryParam("ping", Arrays.asList("pong", "pong-too")) .build(); assertThat(request.getMethod()).isEqualTo("GET"); assertThat(request.getHeaders()).isEmpty(); assertThat(request.getUrl()).isEqualTo("<LINK_0>/foo/bar/?ping=pong&ping=pong-too"); assertThat(request.getBody()).isNull(); }
Source:
public static QuotaModeType fromValue(String value) { try { return valueOf(value.toUpperCase()); } catch (IllegalArgumentException e) { log.error("missing value: " + value, e); return null; } }

Target:
public static QuotaModeType fromValue(String value) { try { return valueOf(value.toUpperCase()); } catch (IllegalArgumentException e) { log.error("The value '{}' isn't a valid quota mode.", value); log.error("Exception", e); return null; } }
Source:
private void doInitialize(final RequestMonitor requestMonitor) { fCommandControl = getServicesTracker().getService(IGDBControl.class); requestMonitor.done(); }

Target:
private void doInitialize(final RequestMonitor requestMonitor) { fCommandControl = getServicesTracker().getService(IGDBControl.class); getSession().addServiceEventListener(this, null); register( new String[] { IMemory.class.getName(), MIMemory.class.getName(), IGDBMemory.class.getName(), GDBMemory.class.getName(), }, new Hashtable<String, String>()); requestMonitor.done(); }
Source:
private void deleteVolumeCommitToDB(VolumeList newVolumeList, String volume, String owner) throws IOException { try (BatchOperation batch = metadataManager.getStore() .initBatchOperation()) { String dbUserKey = metadataManager.getUserKey(owner); if (newVolumeList.getVolumeNamesList().size() == 0) { metadataManager.getUserTable().deleteWithBatch(batch, dbUserKey); } else { metadataManager.getUserTable().putWithBatch(batch, dbUserKey, newVolumeList); } metadataManager.getVolumeTable().deleteWithBatch(batch, metadataManager.getVolumeKey(volume)); metadataManager.getStore().commitBatchOperation(batch); } catch (IOException ex) { throw ex; } }

Target:
private void deleteVolumeCommitToDB(VolumeList newVolumeList, String volume, String owner) throws IOException { try (BatchOperation batch = metadataManager.getStore() .initBatchOperation()) { String dbUserKey = metadataManager.getUserKey(owner); if (newVolumeList.getVolumeNamesList().size() == 0) { metadataManager.getUserTable().deleteWithBatch(batch, dbUserKey); } else { metadataManager.getUserTable().putWithBatch(batch, dbUserKey, newVolumeList); } metadataManager.getVolumeTable().deleteWithBatch(batch, metadataManager.getVolumeKey(volume)); metadataManager.getStore().commitBatchOperation(batch); } }
Source:
public void handleData(ITmfEvent data) { if (data != null && !(data instanceof ITmfLostEvent)) { fNbRead++; } }

Target:
public void handleData(ITmfEvent data) { if (data != null) { fNbRead++; } }
Source:
public NanoWebSocketTestServer(int port) { super(port); connectionsList = new ArrayList<>(); }

Target:
public NanoWebSocketTestServer(int port){ this(null,port); }
Source:
public void download(String url, String downloadPath) { try { URL downloadUrl = new URL(url); downloadUrl.openConnection(); InputStream reader = downloadUrl.openStream(); FileOutputStream writer = new FileOutputStream(downloadPath); int bufSize = 100000; byte[] buffer = new byte[bufSize]; int bytesRead = 0; while ((bytesRead = reader.read(buffer)) > 0) { writer.write(buffer, 0, bytesRead); buffer = new byte[bufSize]; } writer.close(); reader.close(); } catch (MalformedURLException e) { log.error(e); } catch (IOException e) { log.error(e); } }

Target:
public boolean download(String url, String downloadPath) { InputStream in = null; try { in = new URL(url).openStream(); FileUtils.writeByteArrayToFile(new File(downloadPath), IOUtils.toByteArray(in)); return true; } catch (IOException e) { log.error(e); return false; } finally { IOUtils.closeQuietly(in); } }
Source:
public ValidationResult isOperationAllowedOnDisk(VdcActionType actionType) { List<DiskContentType> allowedTypes = allowedCommandsOnTypes.get(actionType); if (allowedTypes == null) { throw new IllegalArgumentException(); } if (!allowedTypes.contains(disk.getContentType())) { return new ValidationResult(EngineMessage.ACTION_TYPE_FAILED_DISK_CONTENT_TYPE_NOT_SUPPORTED_FOR_OPERATION, String.format("$diskContentType %s", disk.getContentType())); } return ValidationResult.VALID; }

Target:
public ValidationResult isOperationAllowedOnDisk(VdcActionType actionType) { List<DiskContentType> allowedTypes = allowedCommandsOnTypes.get(actionType); if (allowedTypes == null) { throw new IllegalArgumentException( String.format("Cannot validate operation on disk for action of type %s as it is not included in the allowed commands.", actionType)); } if (!allowedTypes.contains(disk.getContentType())) { return new ValidationResult(EngineMessage.ACTION_TYPE_FAILED_DISK_CONTENT_TYPE_NOT_SUPPORTED_FOR_OPERATION, String.format("$diskContentType %s", disk.getContentType())); } return ValidationResult.VALID; }
Source:
private void checkTokenExpiration(String tokenSignature, JWTClaimsSet payload, String tenantDomain) throws APISecurityException { long timestampSkew = OAuthServerConfiguration.getInstance().getTimeStampSkewInSeconds(); Date now = new Date(); Date exp = payload.getExpirationTime(); if (exp != null && !DateUtils.isAfter(exp, now, timestampSkew)) { if (isGatewayTokenCacheEnabled) { getGatewayTokenCache().remove(tokenSignature); getGatewayJWTTokenCache().remove(tokenSignature); getInvalidTokenCache().put(tokenSignature, tenantDomain); } log.error("JWT token is expired"); throw new APISecurityException(APISecurityConstants.API_AUTH_INVALID_CREDENTIALS, APISecurityConstants.API_AUTH_INVALID_CREDENTIALS_MESSAGE); } }

Target:
private void checkTokenExpiration(String tokenSignature, JWTClaimsSet payload, String tenantDomain) throws APISecurityException { long timestampSkew = OAuthServerConfiguration.getInstance().getTimeStampSkewInSeconds(); Date now = new Date(); Date exp = payload.getExpirationTime(); if (exp != null && !DateUtils.isAfter(exp, now, timestampSkew)) { if (isGatewayTokenCacheEnabled) { getGatewayTokenCache().remove(tokenSignature); getGatewayJWTTokenCache().remove(tokenSignature); getInvalidTokenCache().put(tokenSignature, tenantDomain); } log.error("JWT token is expired :" + GatewayUtils.getMaskedToken(tokenSignature)); throw new APISecurityException(APISecurityConstants.API_AUTH_INVALID_CREDENTIALS, APISecurityConstants.API_AUTH_INVALID_CREDENTIALS_MESSAGE); } }
Source:
public long guessTotalNumberOfPages() { final int kWeekdayPages = 40; final int kSundayPages = 240; long result = 0; for (Block block : this) { LocalDate lastAppearance = block.getLastAppearance(); for (LocalDate day = block.getFirstAppearance(); !day.isAfter(lastAppearance); day = day.plusDays(1)) { for (Issue issue : block.getIssues()) { if (issue.isMatch(day)) { result += day.getDayOfWeek() != DateTimeConstants.SUNDAY ? kWeekdayPages : kSundayPages; } } } } return result; }

Target:
public long guessTotalNumberOfPages() { final int weekdayPages = 40; final int sundayPages = 240; long result = 0; for (Block block : this) { LocalDate lastAppearance = block.getLastAppearance(); for (LocalDate day = block.getFirstAppearance(); !day.isAfter(lastAppearance); day = day.plusDays(1)) { for (Issue issue : block.getIssues()) { if (issue.isMatch(day)) { result += day.getDayOfWeek() != DateTimeConstants.SUNDAY ? weekdayPages : sundayPages; } } } } return result; }
Source:
Point computeSizeInPixels (int wHint, int hHint, boolean changed) { Point size = super.computeSizeInPixels(wHint, hHint, changed); int width; if(OS.GTK3){ width = computeNativeSize (handle, SWT.DEFAULT, SWT.DEFAULT, false).x; } else{ int x_thickness=OS.gtk_style_get_xthickness (OS.gtk_widget_get_style (handle)); int LABEL_PAD=1; int LABEL_SIDE_PAD=2; width = computeNativeSize (labelHandle, SWT.DEFAULT, SWT.DEFAULT, false).x+2*(LABEL_PAD+LABEL_SIDE_PAD+x_thickness); } size.x = Math.max (size.x, width); return size; }

Target:
Point computeSizeInPixels (int wHint, int hHint, boolean changed) { Point size = super.computeSizeInPixels(wHint, hHint, changed); int width; if(OS.GTK3){ width = computeNativeSize (handle, SWT.DEFAULT, SWT.DEFAULT, false).x; } else{ int x_thickness=OS.gtk_style_get_xthickness (OS.gtk_widget_get_style (handle)); int minimalSizeAroundLabel=2*(OS.GTK_FRAME_LABEL_PAD+OS.GTK_FRAME_LABEL_SIDE_PAD+x_thickness); width = computeNativeSize (labelHandle, SWT.DEFAULT, SWT.DEFAULT, false).x+minimalSizeAroundLabel; } size.x = Math.max (size.x, width); return size; }
Source:
public Set<String> getFreeVariables() { Set<String> freeVars = new HashSet<>(); freeVars.addAll(getDefinition().getFreeVariables()); return freeVars; }

Target:
public Set<String> getFreeVariables() { return getDefinition().getFreeVariables(); }
Source:
public void update() throws Exception { DomainNameList domainNames = new DomainNameList(Lists.newArrayList("dName")); List<Network3GPP> networks = Lists.newArrayList(new Network3GPP("name", "123", "445")); List<NAI> naiList = Lists.newArrayList(new NAI("N/A")); Object id = repository.create(new NewServiceProvider("name", "descr", networks, domainNames, naiList)); List<Network3GPP> newNetworks = Lists.newArrayList(new Network3GPP("newName", "321", "555")); DomainNameList newDomainNames = new DomainNameList(Lists.newArrayList("newDomainName")); List<NAI> newNAIList = Lists.newArrayList(new NAI("N/A")); ServiceProvider newService = new ServiceProvider(new ID(id), "name", "newDescr", newNetworks, newDomainNames, newNAIList); repository.update(newService); ServiceProvider result = repository.findById(new ID(id)).get(); assertThat(result, deepEquals(newService)); }

Target:
public void update() throws Exception { DomainNameList names = new DomainNameList(Lists.newArrayList("dName")); List<Network3GPP> networks = Lists.newArrayList(new Network3GPP("name", "123", "445")); List<RoamingConsortium> list = Lists.newArrayList(new RoamingConsortium("name", "0xAAFFAA")); List<NAI> naiList = Lists.newArrayList(new NAI("N/A")); Object id = repository.create(new NewServiceProvider("name", "descr", networks, names, list, naiList)); List<Network3GPP> newNetworks = Lists.newArrayList(new Network3GPP("newName", "321", "555")); DomainNameList newNames = new DomainNameList(Lists.newArrayList("newDomainName")); List<RoamingConsortium> newList = Lists.newArrayList(new RoamingConsortium("newName", "0xAAAAAA")); List<NAI> newNAIList = Lists.newArrayList(new NAI("EAP-SIM")); ServiceProvider newService = new ServiceProvider(new ID(id), "name", "newDescr", newNetworks, newNames, newList, newNAIList); repository.update(newService); ServiceProvider result = repository.findById(new ID(id)).get(); assertThat(result, deepEquals(newService)); }
Source:
public boolean equals(final Object obj) { if (!(obj instanceof URIish)) return false; final URIish b = (URIish) obj; if (!eq(getScheme(), b.getScheme())) return false; if (!eq(getUser(), b.getUser())) return false; if (!eq(getPass(), b.getPass())) return false; if (!eq(getHost(), b.getHost())) return false; if (!Objects.equals(port, b.port)) return false; if (!eq(getPath(), b.getPath())) return false; return true; }

Target:
public boolean equals(final Object obj) { if (!(obj instanceof URIish)) return false; final URIish b = (URIish) obj; if (!eq(getScheme(), b.getScheme())) return false; if (!eq(getUser(), b.getUser())) return false; if (!eq(getPass(), b.getPass())) return false; if (!eq(getHost(), b.getHost())) return false; if (getPort() != b.getPort()) return false; if (!eq(getPath(), b.getPath())) return false; return true; }
Source:
protected void innerClose() { executor.executeOutgoing((new Runnable() { @Override public void run() { serverSideConnection.close(null, null); } @Override public String toString() { return "Client Closed EOF. " + MockedClientConnection.this; } })); executor.shutdownIncoming(); System.out.println(">>>> >>>>>"); }

Target:
protected void innerClose() { executor.executeOutgoing((new Runnable() { @Override public void run() { serverSideConnection.close(null, null); } @Override public String toString() { return "Client Closed EOF. " + MockedClientConnection.this; } })); executor.shutdownIncoming(); }
Source:
public static IBinding resolveUnknown(ICPPUnknownBinding unknown, InstantiationContext context) throws DOMException { if (unknown instanceof ICPPDeferredClassInstance) { return resolveDeferredClassInstance((ICPPDeferredClassInstance) unknown, context); } if (unknown instanceof ICPPUnknownMember) { return resolveUnknownMember((ICPPUnknownMember) unknown, context); } if (unknown instanceof ICPPTemplateParameter && unknown instanceof IType) { IType type= resolveTemplateTypeParameter((ICPPTemplateParameter) unknown, context.withoutContextTypeSpecialization()); if (type instanceof IBinding) return (IBinding) type; } if (unknown instanceof TypeOfDependentExpression) { IType type= instantiateType((IType) unknown, context); if (type instanceof IBinding) return (IBinding) type; } return unknown; }

Target:
public static IBinding resolveUnknown(ICPPUnknownBinding unknown, InstantiationContext context) throws DOMException { if (unknown instanceof ICPPDeferredClassInstance) { return resolveDeferredClassInstance((ICPPDeferredClassInstance) unknown, context); } if (unknown instanceof ICPPUnknownMember) { return resolveUnknownMember((ICPPUnknownMember) unknown, context); } if (unknown instanceof ICPPTemplateParameter && unknown instanceof IType) { IType type= resolveTemplateTypeParameter((ICPPTemplateParameter) unknown, context); if (type instanceof IBinding) return (IBinding) type; } if (unknown instanceof TypeOfDependentExpression) { IType type= instantiateType((IType) unknown, context); if (type instanceof IBinding) return (IBinding) type; } return unknown; }
Source:
public void testCreateTableWithDefaultExpressionLiteral() { CreateTableAnalyzedStatement analysis = e.analyze( "create table foo (name text default 'bar')"); Map<String, Object> mappingProperties = analysis.mappingProperties(); Map<String, Object> aMapping = (Map<String, Object>) mappingProperties.get("name"); assertThat(aMapping.get("default_expr"), is("'bar'")); }

Target:
public void testCreateTableWithDefaultExpressionLiteral() { CreateTableAnalyzedStatement analysis = e.analyze( "create table foo (name text default 'bar')"); Map<String, Object> mappingProperties = analysis.mappingProperties(); assertThat(mapToSortedString(mappingProperties), is("name={default_expr='bar', position=1, type=keyword}")); }
Source:
static void checkColumnName(String columnName) { checkNotEmptyOrBlank(columnName); }

Target:
static void checkColumnName(String columnName) { checkNotEmptyOrBlank(columnName, "Entity column name must not be empty or blank."); }
Source:
public void requestResetPasswordWithPhone() throws Exception { when(service.createTimeLimitedToken()).thenReturn("ABC"); when(mockAccountDao.getAccount(ACCOUNT_ID_WITH_PHONE)).thenReturn(mockAccount); when(mockStudyService.getStudy(TEST_STUDY)).thenReturn(study); when(mockAccount.getPhone()).thenReturn(TestConstants.PHONE); when(mockAccount.getPhoneVerified()).thenReturn(Boolean.TRUE); when(mockAccount.getStudyIdentifier()).thenReturn(TEST_STUDY); service.requestResetPassword(study, ACCOUNT_ID_WITH_PHONE); verify(mockCacheProvider).setString(eq("ABC:phone:api"), stringCaptor.capture(), eq(60*60*2)); Phone captured = BridgeObjectMapper.get().readValue(stringCaptor.getValue(), Phone.class); assertEquals(TestConstants.PHONE, captured); verify(mockNotificationsService).sendSMSMessage(eq(TEST_STUDY), eq(TestConstants.PHONE), stringCaptor.capture()); String message = stringCaptor.getValue(); assertTrue(message.contains("Reset ShortName password: ")); assertTrue(message.contains("/mobile/resetPassword.html?study=api&sptoken=ABC")); }

Target:
public void requestResetPasswordWithPhone() throws Exception { when(service.createTimeLimitedToken()).thenReturn("ABC"); when(mockAccountDao.getAccount(ACCOUNT_ID_WITH_PHONE)).thenReturn(mockAccount); when(mockStudyService.getStudy(TEST_STUDY)).thenReturn(study); when(mockAccount.getPhone()).thenReturn(TestConstants.PHONE); when(mockAccount.getPhoneVerified()).thenReturn(Boolean.TRUE); when(mockAccount.getStudyIdentifier()).thenReturn(TEST_STUDY); service.requestResetPassword(study, ACCOUNT_ID_WITH_PHONE); verify(mockCacheProvider).setString(eq("ABC:phone:api"), stringCaptor.capture(), eq(60*60*2)); verify(mockNotificationsService).sendSMSMessage(eq(TEST_STUDY), eq(TestConstants.PHONE), secondStringCaptor.capture()); Phone captured = BridgeObjectMapper.get().readValue(stringCaptor.getValue(), Phone.class); assertEquals(TestConstants.PHONE, captured); String message = secondStringCaptor.getValue(); assertTrue(message.contains("Reset ShortName password: ")); assertTrue(message.contains("/mobile/resetPassword.html?study=api&sptoken=ABC")); }
Source:
public static List<Rule> compose(Collection<ExternalDependency> dependencies) { return dependencies .stream() .peek( dependency -> { if (!ImmutableSet.of(JAR, AAR).contains(dependency.getPackaging())) { throw new IllegalStateException("Dependency not a valid prebuilt: " + dependency); } }) .sorted( (o1, o2) -> ComparisonChain.start() .compare(o1.getPackaging(), o2.getPackaging()) .compare(o1.getTargetName(), o2.getTargetName()) .result()) .map( dependency -> { Prebuilt rule = new Prebuilt() .mavenCoords(dependency.getMavenCoords()) .sha256(DependencyUtils.sha256(dependency.getRealDependencyFile())); if (dependency.hasSourceFile()) { rule.sourcesMavenCoords(dependency.getSourceMavenCoords()) .sourcesSha256(DependencyUtils.sha256(dependency.getRealSourceFile())); } rule.name(dependency.getTargetName()); return ImmutableList.of(rule); }) .flatMap(Collection::stream) .collect(Collectors.toList()); }

Target:
public static List<Rule> compose(Collection<ExternalDependency> dependencies) { return dependencies .stream() .peek( dependency -> { if (!ImmutableSet.of(JAR, AAR).contains(dependency.getPackaging())) { throw new IllegalStateException("Dependency not a valid prebuilt: " + dependency); } }) .sorted(ExternalDependency.compareByName) .map( dependency -> { Prebuilt rule = new Prebuilt() .mavenCoords(dependency.getMavenCoords()) .enableJetifier(dependency.enableJetifier()) .sha256(DependencyUtils.shaSum256(dependency.getRealDependencyFile())); if (dependency.hasSourceFile()) { rule.sourcesSha256(DependencyUtils.shaSum256(dependency.getRealSourceFile())); } rule.name(dependency.getTargetName()); rule.ruleType(RuleType.PREBUILT.getBuckName()); return rule; }) .collect(Collectors.toList()); }
Source:
public Float getRetentionTime() { for (MzMLCVParam param : cvParams) { String accession = param.getAccession(); String unitAccession = param.getUnitAccession(); String value = param.getValue(); if ((accession == null) || (value == null)) continue; if (accession.equals(MzMLCV.cvScanStartTime)) { try { float retentionTime; if ((unitAccession == null) || (unitAccession.equals(MzMLCV.cvUnitsMin1)) || unitAccession.equals(MzMLCV.cvUnitsMin2)) { retentionTime = Float.parseFloat(value) * 60f; } else { retentionTime = Float.parseFloat(value); } return retentionTime; } catch (Exception e) { e.printStackTrace(); } } } return null; }

Target:
public Float getRetentionTime() { float retentionTime = 0; if (retentionTime == 0) { for (MzMLCVParam param : cvParams) { String accession = param.getAccession(); String unitAccession = param.getUnitAccession(); String value = param.getValue(); if ((accession == null) || (value == null)) continue; if (accession.equals(MzMLCV.cvScanStartTime)) { try { if ((unitAccession == null) || (unitAccession.equals(MzMLCV.cvUnitsMin1)) || unitAccession.equals(MzMLCV.cvUnitsMin2)) { retentionTime = Float.parseFloat(value) * 60f; } else { retentionTime = Float.parseFloat(value); } return retentionTime; } catch (Exception e) { e.printStackTrace(); } } } return null; } return retentionTime; }
Source:
public static ObjectNode getElementsById(Collection<String> elementIds, Project project, ProgressStatus progressStatus) throws IOException, ServerException, URISyntaxException { if (elementIds == null || elementIds.isEmpty()) { return null; } final ObjectNode requests = JacksonUtils.getObjectMapper().createObjectNode(); ArrayNode idsArrayNode = requests.putArray("elements"); for (String id : elementIds) { ObjectNode element = JacksonUtils.getObjectMapper().createObjectNode(); element.put(MDKConstants.SYSML_ID_KEY, id); idsArrayNode.add(element); } URIBuilder requestUri = MMSUtils.getServiceProjectsRefsElementsUri(project); if (requestUri == null) { return null; } Utils.guilog("[INFO] Searching for " + elementIds.size() + " elements from server..."); if (progressStatus != null) { return MMSUtils.sendCancellableMMSRequest(MMSUtils.buildRequest(MMSUtils.HttpRequestType.GET, requestUri, requests), progressStatus); } return MMSUtils.sendMMSRequest(MMSUtils.buildRequest(MMSUtils.HttpRequestType.GET, requestUri, requests)); }

Target:
public static ObjectNode getElementsById(Collection<String> elementIds, Project project, ProgressStatus progressStatus) throws IOException, ServerException, URISyntaxException { if (elementIds == null || elementIds.isEmpty()) { return null; } final ObjectNode requests = JacksonUtils.getObjectMapper().createObjectNode(); ArrayNode idsArrayNode = requests.putArray("elements"); for (String id : elementIds) { ObjectNode element = JacksonUtils.getObjectMapper().createObjectNode(); element.put(MDKConstants.SYSML_ID_KEY, id); idsArrayNode.add(element); } URIBuilder requestUri = MMSUtils.getServiceProjectsRefsElementsUri(project); if (requestUri == null) { return null; } Utils.guilog("[INFO] Searching for " + elementIds.size() + " elements from server."); if (progressStatus != null) { return MMSUtils.sendCancellableMMSRequest(MMSUtils.buildRequest(MMSUtils.HttpRequestType.GET, requestUri, requests), progressStatus); } return MMSUtils.sendMMSRequest(MMSUtils.buildRequest(MMSUtils.HttpRequestType.GET, requestUri, requests)); }
Source:
void setUp() { underTest = new AttemptAuditEventResultToGrpcAttemptAuditEventResultConverter(new LinkedHashMap<>()); mockAuditEventDataUtilizer = mock(AuditEventDataUtilizer.class); }

Target:
void setUp() { builderProvider = mock(AttemptAuditEventResultBuilderProvider.class); mockBuilder = mock(AuditProto.AttemptAuditEventResult.Builder.class); result = mock(AuditProto.AttemptAuditEventResult.class); when(mockBuilder.build()).thenReturn(result); when(builderProvider.getNewAttemptAuditEventResultBuilder()).thenReturn(mockBuilder); when(mockBuilder.setId(any())).thenReturn(mockBuilder); when(mockBuilder.setResultCode(any())).thenReturn(mockBuilder); underTest = new AttemptAuditEventResultToGrpcAttemptAuditEventResultConverter(new LinkedHashMap<>(), builderProvider); mockAttemptAuditEventResultBuilderUpdater = mock(AttemptAuditEventResultBuilderUpdater.class); }
Source:
public void update(RuleBaseElementId name, String newCode) throws RuleBaseException { RuleBaseElement newBean = new RuleBaseElement(name, newCode); Map<String, String> metaData = newBean.toMetadata(); RuleBaseConfiguration conf = new RuleBaseConfiguration(metaData, newBean); try { rulePersistence.persist(conf); } catch (PersistenceException e) { throw new RuleBaseException(e); } builder.reloadPackage(name.getPackageName()); }

Target:
public void update(RuleBaseElementId name, String newCode) throws RuleBaseException { RuleBaseElement newBean = new RuleBaseElement(name, newCode); RuleBaseConfiguration conf = new RuleBaseConfiguration(newBean); try { rulePersistence.persist(conf); } catch (PersistenceException e) { throw new RuleBaseException(e); } builder.reloadPackage(name.getPackageName()); }
Source:
public boolean isType(TileEntity tile, EnumFacing dir) { if (tile instanceof IGridHost && tile.hasCapability(LPStorageMonitorableAccessor.STORAGE_MONITORABLE_ACCESSOR_CAPABILITY, dir)) { IGridNode tempNode = ((IGridHost) tile).getGridNode(AEPartLocation.fromFacing(dir)); if (tempNode == null) return false; return true; } return false; }

Target:
public boolean isType(TileEntity tile, EnumFacing dir) { if (tile instanceof IGridHost && tile.hasCapability(LPStorageMonitorableAccessor.STORAGE_MONITORABLE_ACCESSOR_CAPABILITY, dir)) { return ((IGridHost) tile).getGridNode(AEPartLocation.fromFacing(dir)) != null; } return false; }
Source:
private List<String> objIdsAsStrings(Collection<ObjectId> objIds) { List<String> result = new ArrayList<>(objIds.size()); for (ObjectId oid: objIds) { result.add(oid.name()); } return result; }

Target:
private static List<String> objIdsAsStrings(Collection<ObjectId> objIds) { return objIds.stream().map(ObjectId::name).collect(Collectors.toList()); }
Source:
public String toString() { return Objects.toStringHelper(this) .add("tags", tags) .add("id", symbolicName) .add("version", version) .add("deprecated", deprecated) .toString(); }

Target:
public String toString() { return Objects.toStringHelper(this) .add("id", symbolicName) .add("version", version) .add("deprecated", deprecated) .toString(); }
Source:
public final B filterByIds(Collection<String> ids) { this.ids = ImmutableSet.copyOf(ids); return getSelf(); }

Target:
public final B filterByIds(Collection<String> ids) { for (final String id : ids) { if (Strings.isNullOrEmpty(id)) { throw new BadRequestException("ID filter cannot contain empty values"); } } addOption(OptionKey.COMPONENT_IDS, ImmutableSet.copyOf(ids)); return getSelf(); }
Source:
ProjectionRepository<I, P, S> mockRepository() { TestProjectionRepository mockedRepo = mock(TestProjectionRepository.class); when(mockedRepo.lifecycleOf(any())).thenCallRealMethod(); when(mockedRepo.getEntityStateType()).thenReturn(TypeUrl.of(Any.class)); return mockedRepo; }

Target:
ProjectionRepository<I, P, S> mockRepository() { TestProjectionRepository mockedRepo = mock(TestProjectionRepository.class); when(mockedRepo.lifecycleOf(any())).thenCallRealMethod(); return mockedRepo; }
Source:
private boolean hasAllele(final Allele allele, final boolean ignoreRefState, final boolean considerRefAllele) { if ( (considerRefAllele && allele == REF) || allele == ALT ) return true; final List<Allele> allelesToConsider = considerRefAllele ? getAlleles() : getAlternateAlleles(); for ( int i = 0; i < allelesToConsider.size(); i++) { if ( allelesToConsider.get(i).equals(allele, ignoreRefState) ) return true; } return false; }

Target:
private boolean hasAllele(final Allele allele, final boolean ignoreRefState, final boolean considerRefAllele) { if ( (considerRefAllele && allele == REF) || allele == ALT ) return true; final List<Allele> allelesToConsider = considerRefAllele ? getAlleles() : getAlternateAlleles(); for (int i = 0, allelesToConsiderSize = allelesToConsider.size(); i < allelesToConsiderSize; i++) { Allele anAllelesToConsider = allelesToConsider.get(i); if (anAllelesToConsider.equals(allele, ignoreRefState)) return true; } return false; }
Source:
public static Optional<File> savePersonnel(JFrame frame, Campaign campaign, FileType format) { String fileName = String.format( "%s%s_ExportedPersonnel." + format.getRecommendedExtension(), campaign.getName(), campaign.getShortDateAsString() ); return GUI.fileDialogSave( frame, "Save Personnel", new File(".", fileName), format ); }

Target:
public static Optional<File> savePersonnel(JFrame frame, Campaign campaign, FileType format) { String fileName = campaign.getName() + campaign.getShortDateAsString() + "_ExportedPersonnel." + format.getRecommendedExtension(); return GUI.fileDialogSave( frame, "Save Personnel", new File(".", fileName), format ); }
Source:
public void testContributions() throws Exception { deployContrib("org.nuxeo.runtime.test.tests", "MyComp1.xml"); deployContrib("org.nuxeo.runtime.test.tests", "MyComp2.xml"); applyInlineDeployments(); try { RuntimeService runtime = Framework.getRuntime(); ComponentManager mgr = runtime.getComponentManager(); assertTrue(mgr.size() > 0); ComponentInstance co = runtime.getComponentInstance("service:my.comp1"); assertNotNull(co); assertEquals(co.getName(), new ComponentName("service:my.comp1")); co = runtime.getComponentInstance("service:my.comp2"); assertNotNull(co); assertEquals(co.getName(), new ComponentName("service:my.comp2")); mgr.unregister(new ComponentName("service:my.comp2")); mgr.unstash(); co = runtime.getComponentInstance("service:my.comp2"); assertNull(co); co = runtime.getComponentInstance("service:my.comp1"); assertNotNull(co); } finally { undeployContrib("org.nuxeo.runtime.test.tests", "MyComp2.xml"); undeployContrib("org.nuxeo.runtime.test.tests", "MyComp1.xml"); removeInlineDeployments(); } }

Target:
public void testContributions() throws Exception { pushInlineDeployments("org.nuxeo.runtime.test.tests:MyComp1.xml", "org.nuxeo.runtime.test.tests:MyComp2.xml"); try { RuntimeService runtime = Framework.getRuntime(); ComponentManager mgr = runtime.getComponentManager(); assertTrue(mgr.size() > 0); ComponentInstance co = runtime.getComponentInstance("service:my.comp1"); assertNotNull(co); assertEquals(co.getName(), new ComponentName("service:my.comp1")); co = runtime.getComponentInstance("service:my.comp2"); assertNotNull(co); assertEquals(co.getName(), new ComponentName("service:my.comp2")); mgr.unregister(new ComponentName("service:my.comp2")); mgr.unstash(); co = runtime.getComponentInstance("service:my.comp2"); assertNull(co); co = runtime.getComponentInstance("service:my.comp1"); assertNotNull(co); } finally { undeployContrib("org.nuxeo.runtime.test.tests", "MyComp2.xml"); undeployContrib("org.nuxeo.runtime.test.tests", "MyComp1.xml"); removeInlineDeployments(); } }
Source:
String generate() { Collections.sort(this, (o1, o2) -> o1.model.getElement().getSimpleName().toString().compareTo( o2.model.getElement().getSimpleName().toString())); int index = 0; StringBuilder buffer = new StringBuilder(); for (int i = 0; i < size(); i++) { ModelProcessing processing = get(i); Map<String, Object> vars = new HashMap<>(); vars.putAll(TypeNameTranslator.vars(processing.generator.name)); if (processing.generator.incremental) { vars.put("incrementalIndex", index++); vars.put("incrementalSize", size()); vars.put("session", session); } try { String part = processing.generator.template.render(processing.model, vars); if (part != null) { buffer.append(part); } } catch (GenException e) { throw e; } catch (Exception e) { e.printStackTrace(); throw new GenException(processing.model.getElement(), e.getMessage()); } } return buffer.toString(); }

Target:
String generate() { Collections.sort(this, (o1, o2) -> o1.model.getElement().getSimpleName().toString().compareTo( o2.model.getElement().getSimpleName().toString())); int index = 0; StringBuilder buffer = new StringBuilder(); for (int i = 0; i < size(); i++) { ModelProcessing processing = get(i); Map<String, Object> vars = new HashMap<>(); vars.putAll(TypeNameTranslator.vars(processing.generator.name)); if (processing.generator.incremental) { vars.put("incrementalIndex", index++); vars.put("incrementalSize", size()); vars.put("session", session); } try { String part = processing.generator.template.render(processing.model, vars); if (part != null) { buffer.append(part); } } catch (GenException e) { throw e; } catch (Exception e) { throw new GenException(processing.model.getElement(), e.getMessage()); } } return buffer.toString(); }
Source:
public void cleanupSnapshotsByVolume(Long volumeId) { List<SnapshotVO> volSnapShots = _snapshotDao.listByVolumeId(volumeId); for(SnapshotVO snapshot: volSnapShots) { SnapshotInfo info = snapshotFactory.getSnapshot(snapshot.getId(), DataStoreRole.Primary); try { snapshotSrv.deleteSnapshot(info); } catch(CloudRuntimeException e) { String msg = "Cleanup of Snapshot with uuid " + snapshot.getUuid() + " in primary storage is failed. Ignoring"; s_logger.warn(msg); } } }

Target:
public void cleanupSnapshotsByVolume(Long volumeId) { List<SnapshotInfo> infos = snapshotFactory.getSnapshots(volumeId, DataStoreRole.Primary); for(SnapshotInfo info: infos) { try { if(info != null) { snapshotSrv.deleteSnapshot(info); } } catch(CloudRuntimeException e) { String msg = "Cleanup of Snapshot with uuid " + info.getUuid() + " in primary storage is failed. Ignoring"; s_logger.warn(msg); } } }
Source:
public boolean isInitiator() { return isActive(); }

Target:
public boolean isInitiator() { return true; }
Source:
public Response remove() { get(); return performAction(VdcActionType.RemoveVmTemplate, new VmTemplateParametersBase(asGuid(id))); }

Target:
public Response remove() { get(); return performAction(VdcActionType.RemoveVmTemplate, new VmTemplateParametersBase(guid)); }
Source:
public Reply getReply(Long replyId) { Reply result = null; for (Reply reply : replies) { if (reply.id == replyId) { result = reply; return result; } } return result; }

Target:
public Reply getReply(Long replyId) { return replyStore.get(replyId); }
Source:
private ByteBuf decodeLine(ChannelHandlerContext ctx, ByteBuf buffer) throws Exception { final int eol = findEndOfLine(buffer); if (!discarding) { if (eol >= 0) { final int length = eol - buffer.readerIndex(); final int delimLength = buffer.getByte(eol) == '\r'? 2 : 1; if (length > V1_MAX_LENGTH) { buffer.readerIndex(eol + delimLength); failOverLimit(ctx, length); return null; } ByteBuf frame = buffer.readSlice(length); buffer.skipBytes(delimLength); return frame; } else { final int length = buffer.readableBytes(); if (length > V1_MAX_LENGTH) { discardedBytes = length; buffer.skipBytes(length); discarding = true; failOverLimit(ctx, "over " + discardedBytes); } return null; } } else { if (eol >= 0) { final int delimLength = buffer.getByte(eol) == '\r' ? 2 : 1; buffer.readerIndex(eol + delimLength); discardedBytes = 0; discarding = false; } else { discardedBytes += buffer.readableBytes(); buffer.skipBytes(discardedBytes); } return null; } }

Target:
private ByteBuf decodeLine(ChannelHandlerContext ctx, ByteBuf buffer) throws Exception { if (headerExtractor == null) { headerExtractor = new LineHeaderExtractor(V1_MAX_LENGTH); } return headerExtractor.extract(ctx, buffer); }
Source:
public void inflatedisbusmentDate() { mfDatePicker = MFDatePicker.newInsance(this); tvDisbursementonDate.setText(MFDatePicker.getDatePickedAsString()); tvDisbursementonDate.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { isdisbursementDate = true; mfDatePicker.show(getActivity().getSupportFragmentManager(), FragmentConstants .DFRAG_DATE_PICKER); } }); }

Target:
public void inflatedisbusmentDate() { mfDatePicker = MFDatePicker.newInsance(this); tvDisbursementonDate.setText(MFDatePicker.getDatePickedAsString()); }
Source:
public void run(TableReference tableRef, Set<Cell> cells) { follower.run(txManager, tableRef, cells, Transaction.TransactionType.HARD_DELETE); }

Target:
public void run(TableReference tableRef, Set<Cell> cells) { followers.forEach(flwr -> flwr.run(txManager, tableRef, cells, Transaction.TransactionType.HARD_DELETE)); }
Source:
private static String unixNormalizeObjectName(final String objectName) { final String path; if (objectName.startsWith("/")) { path = objectName.substring(1); } else if (objectName.startsWith("./")) { path = objectName.substring(2); } else if (objectName.startsWith("../")) { path = objectName.substring(3); } else { path = objectName; } return path; }

Target:
protected static String unixNormalizeObjectName(final String objectName) { final String path; if (objectName.startsWith("/")) { path = objectName.substring(1); } else if (objectName.startsWith("./")) { path = objectName.substring(2); } else if (objectName.startsWith("../")) { path = removePrefixRecursively(objectName, "../"); } else { path = objectName; } return path; }
Source:
public void shouldThrowException() throws Exception { expectedException.expect(FilterFactory.FilterNotCreatedException.class); CategoryFilterFactory categoryFilterFactory = new CategoryFilterFactoryStub(); Filter filter = categoryFilterFactory.createFilter("NonExistentFilter"); assertThat(filter, is((Filter) null)); }

Target:
public void shouldThrowException() throws Exception { FilterFactoryParams params = new FilterFactoryParams( "NonExistentFilter"); expectedException.expect(FilterFactory.FilterNotCreatedException.class); categoryFilterFactory.createFilter(params); }
Source:
protected boolean canDoAction() { if (getParameters().getPubKeys().size() == 0 || getParameters().getId() == null) { return false; } return super.canDoAction(); }

Target:
protected boolean canDoAction() { if (getParameters().getPubKeys().isEmpty()) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_NO_PUB_KEYS_PASSED); } if (getParameters().getId() == null) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_HOST_NOT_EXIST); } return super.canDoAction(); }