auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public MSKConcept queryCVS(String vocabularyId, String conceptId, String histologyCode, String siteCode) throws CrosswalkException { RestTemplate restTemplate = new RestTemplate(); try { ResponseEntity<MSKConcept> response = restTemplate.getForEntity(crosswalkURL, MSKConcept.class, vocabularyId, conceptId, histologyCode, siteCode); return response.getBody(); } catch (HttpClientErrorException e) { logger.error("queryCVS() -- caught HttpClientErrorException: " + e); String errorString = "URI: " + crosswalkURL + "\n" + "vocabularyId: " + vocabularyId + "\n" + "conceptId: " + conceptId != null ? conceptId : "" + "\n" + "histologyCode: " + histologyCode != null ? histologyCode : "" + "\n" + "siteCode: " + siteCode != null ? siteCode : "" + "\n"; if (e.getStatusCode().is4xxClientError()) { throw new CrosswalkConceptNotFoundException("4xx Error while getting data from CVS Service with: \n " + errorString, e); } else if (e.getStatusCode().is5xxServerError()) { throw new CrosswalkServiceUnavailableException("5xx Error while getting data from CVS", e); } throw new UnexpectedCrosswalkResponseException("Exception while getting data from CVS Service with: \n " + errorString, e); } }

Target:
public MSKConcept queryCVS(String vocabularyId, String conceptId, String histologyCode, String siteCode) throws CrosswalkException { RestTemplate restTemplate = new RestTemplate(); try { ResponseEntity<MSKConcept> response = restTemplate.getForEntity(crosswalkURL, MSKConcept.class, vocabularyId, conceptId, histologyCode, siteCode); return response.getBody(); } catch (HttpStatusCodeException e) { logger.error("queryCVS() -- caught HttpStatusCodeException: " + e); String errorString = "URI: " + crosswalkURL + "\n" + "vocabularyId: " + vocabularyId + "\n" + "conceptId: " + conceptId + "\n" + "histologyCode: " + histologyCode + "\n" + "siteCode: " + siteCode + "\n"; if (e.getStatusCode().is4xxClientError()) { throw new CrosswalkConceptNotFoundException("4xx Error while getting data from CVS Service with: \n" + errorString, e); } else if (e.getStatusCode().is5xxServerError()) { throw new CrosswalkServiceUnavailableException("5xx Error while getting data from CVS", e); } throw new UnexpectedCrosswalkResponseException("Exception while getting data from CVS Service with: \n" + errorString, e); } catch (RestClientException e) { logger.error("queryCVS() -- caught RestClientErrorException: " + e); String errorString = "URI: " + crosswalkURL + "\n" + "vocabularyId: " + vocabularyId + "\n" + "conceptId: " + conceptId + "\n" + "histologyCode: " + histologyCode + "\n" + "siteCode: " + siteCode + "\n"; throw new UnexpectedCrosswalkResponseException("RestClientException while getting data from CVS Service" + errorString, e); } }
Source:
public void postShutdown() { if (activityHelper != null) { activityHelper.shutdown(); activityHelper = null; } if (idleHelper != null) { idleHelper.shutdown(); idleHelper = null; } if (workspaceUndoMonitor != null) { workspaceUndoMonitor.shutdown(); workspaceUndoMonitor = null; } Display display = getWorkbenchConfigurer().getWorkbench().getDisplay(); IWorkspace workspace = IDEWorkbenchPlugin.getPluginWorkspace(); final Runnable disconnectFromWorkspace = new Runnable() { @Override public void run() { if (isWorkspaceLocked(workspace)) { display.asyncExec(this); return; } disconnectFromWorkspace(); } }; if (!display.isDisposed() && workspace != null && isWorkspaceLocked(workspace)) { display.asyncExec(disconnectFromWorkspace); } }

Target:
public void postShutdown() { if (activityHelper != null) { activityHelper.shutdown(); activityHelper = null; } if (idleHelper != null) { idleHelper.shutdown(); idleHelper = null; } if (workspaceUndoMonitor != null) { workspaceUndoMonitor.shutdown(); workspaceUndoMonitor = null; } Display display = getWorkbenchConfigurer().getWorkbench().getDisplay(); IWorkspace workspace = IDEWorkbenchPlugin.getPluginWorkspace(); final Runnable disconnectFromWorkspace = new Runnable() { @Override public void run() { if (isWorkspaceLocked(workspace)) { display.asyncExec(this); return; } disconnectFromWorkspace(); } }; if (workspace != null) { if (!display.isDisposed() && isWorkspaceLocked(workspace)) { display.asyncExec(disconnectFromWorkspace); } else { disconnectFromWorkspace.run(); } } workbenchAdvisor = null; }
Source:
public void run() { boolean empty; ByteBuffer sendBuffer; try { sendBuffer = bufferPool.borrow(); } catch (final InterruptedException e) { handler.handle(e); return; } while (!(messages.isEmpty() && shutdown)) { try { if (Thread.interrupted()) { return; } final Message message = messages.poll(WAIT_SLEEP_MS, TimeUnit.MILLISECONDS); if (message != null) { builder.setLength(0); message.writeTo(builder); int lowerBoundSize = builder.length(); if (sendBuffer.capacity() < lowerBoundSize) { throw new InvalidMessageException(MESSAGE_TOO_LONG, builder.toString()); } if (sendBuffer.remaining() < (lowerBoundSize + 1)) { outboundQueue.put(sendBuffer); sendBuffer = bufferPool.borrow(); } sendBuffer.mark(); if (sendBuffer.position() > 0) { sendBuffer.put((byte) '\n'); } try { writeBuilderToSendBuffer(sendBuffer); } catch (BufferOverflowException boe) { outboundQueue.put(sendBuffer); sendBuffer = bufferPool.borrow(); writeBuilderToSendBuffer(sendBuffer); } if (null == messages.peek()) { outboundQueue.put(sendBuffer); sendBuffer = bufferPool.borrow(); } } } catch (final InterruptedException e) { if (shutdown) { endSignal.countDown(); return; } } catch (final Exception e) { handler.handle(e); } } builder.setLength(0); builder.trimToSize(); endSignal.countDown(); }

Target:
public void run() { boolean empty; ByteBuffer sendBuffer; try { sendBuffer = bufferPool.borrow(); } catch (final InterruptedException e) { handler.handle(e); return; } while (!(shutdown && messages.isEmpty())) { try { final Message message = messages.poll(WAIT_SLEEP_MS, TimeUnit.MILLISECONDS); if (message != null) { builder.setLength(0); message.writeTo(builder); int lowerBoundSize = builder.length(); if (sendBuffer.capacity() < lowerBoundSize) { throw new InvalidMessageException(MESSAGE_TOO_LONG, builder.toString()); } if (sendBuffer.remaining() < (lowerBoundSize + 1)) { outboundQueue.put(sendBuffer); sendBuffer = bufferPool.borrow(); } sendBuffer.mark(); if (sendBuffer.position() > 0) { sendBuffer.put((byte) '\n'); } try { writeBuilderToSendBuffer(sendBuffer); } catch (BufferOverflowException boe) { outboundQueue.put(sendBuffer); sendBuffer = bufferPool.borrow(); writeBuilderToSendBuffer(sendBuffer); } if (null == messages.peek()) { outboundQueue.put(sendBuffer); sendBuffer = bufferPool.borrow(); } } } catch (final InterruptedException e) { if (shutdown) { endSignal.countDown(); return; } } catch (final Exception e) { handler.handle(e); } } builder.setLength(0); builder.trimToSize(); endSignal.countDown(); }
Source:
public void getBlockState(BlockPos pos, CallbackInfoReturnable<IBlockState> ci) { if (this.isCubicWorld() && this.isValid(pos)) { ci.setReturnValue(this.getCubeCache().getCube(CubePos.fromBlockCoords(pos)).getBlockState(pos)); ci.cancel(); } }

Target:
public void getBlockState(BlockPos pos, CallbackInfoReturnable<IBlockState> ci) { if (this.isCubicWorld()) { if (this.isValid(pos)) ci.setReturnValue(this.getCubeCache().getCube(CubePos.fromBlockCoords(pos)).getBlockState(pos)); else ci.setReturnValue(Blocks.AIR.getDefaultState()); ci.cancel(); } }
Source:
public boolean handleNetworkException(VDSNetworkException ex, VDS vds) { if (vds.getStatus() != VDSStatus.Down) { if (mUnrespondedAttempts.get() < Config.<Integer> GetValue(ConfigValues.VDSAttemptsToResetCount) || lastUpdate + (TimeUnit.SECONDS.toMillis(Config.<Integer> GetValue(ConfigValues.TimeoutToResetVdsInSeconds))) > System.currentTimeMillis()) { boolean result = false; if (vds.getStatus() != VDSStatus.Connecting && vds.getStatus() != VDSStatus.PreparingForMaintenance && vds.getStatus() != VDSStatus.NonResponsive) { setStatus(VDSStatus.Connecting, vds); result = true; } mUnrespondedAttempts.incrementAndGet(); return result; } if (vds.getStatus() == VDSStatus.NonResponsive || vds.getStatus() == VDSStatus.Maintenance) { setStatus(VDSStatus.NonResponsive, vds); return true; } setStatus(VDSStatus.NonResponsive, vds); log.errorFormat( "Server failed to respond, vds_id = {0}, vds_name = {1}, error = {2}", vds.getId(), vds.getName(), ex.getMessage()); AuditLogableBase logable = new AuditLogableBase(vds.getId()); AuditLogDirector.log(logable, AuditLogType.VDS_FAILURE); ResourceManager.getInstance().getEventListener().vdsNotResponding(vds); moveVMsToUnknown(); } return true; }

Target:
public boolean handleNetworkException(VDSNetworkException ex, VDS vds) { if (vds.getStatus() != VDSStatus.Down) { if (mUnrespondedAttempts.get() < Config.<Integer> GetValue(ConfigValues.VDSAttemptsToResetCount) || lastUpdate + (TimeUnit.SECONDS.toMillis(Config.<Integer> GetValue(ConfigValues.TimeoutToResetVdsInSeconds))) > System.currentTimeMillis()) { boolean result = false; if (vds.getStatus() != VDSStatus.Connecting && vds.getStatus() != VDSStatus.PreparingForMaintenance && vds.getStatus() != VDSStatus.NonResponsive) { setStatus(VDSStatus.Connecting, vds); result = true; } mUnrespondedAttempts.incrementAndGet(); return result; } if (vds.getStatus() == VDSStatus.NonResponsive || vds.getStatus() == VDSStatus.Maintenance) { setStatus(VDSStatus.NonResponsive, vds); return true; } setStatus(VDSStatus.NonResponsive, vds); log.errorFormat( "Server failed to respond, vds_id = {0}, vds_name = {1}, error = {2}", vds.getId(), vds.getName(), ex.getMessage()); AuditLogableBase logable = new AuditLogableBase(vds.getId()); AuditLogDirector.log(logable, AuditLogType.VDS_FAILURE); ResourceManager.getInstance().getEventListener().vdsNotResponding(vds); } return true; }
Source:
public ContentFileTransactionContext(File contentDirectory, File deletedTmpDirectory) { this.contentDirectory = contentDirectory; this.deletedTmpDirectory = deletedTmpDirectory; addedFilesQueue = new LinkedList<String>(); }

Target:
public ContentFileTransactionContext(File contentDirectory, File deletedTmpDirectory) { Preconditions.checkNotNull(contentDirectory); Preconditions.checkNotNull(deletedTmpDirectory); this.contentDirectory = contentDirectory; this.deletedTmpDirectory = deletedTmpDirectory; addedFilesQueue = new LinkedList<String>(); }
Source:
public void nakedS3Put() throws IOException, SignatureException, XmlProcessingException, URISyntaxException { try { final Path beowulfPath = ResourceUtils.loadFileResource(RESOURCE_BASE_NAME + "beowulf.txt"); final SeekableByteChannel beowulfChannel = new ResourceObjectPutter(RESOURCE_BASE_NAME).buildChannel("beowulf.txt"); final PutObjectResponse job = client.putObject(new PutObjectRequest(BUCKET_NAME, "beowulf.txt", beowulfChannel, Files.size(beowulfPath))); assertThat(job.getStatusCode(), is(200)); } finally { deleteAllContents(client, BUCKET_NAME); } }

Target:
public void nakedS3Put() throws IOException, SignatureException, XmlProcessingException, URISyntaxException { try { final Path beowulfPath = ResourceUtils.loadFileResource(RESOURCE_BASE_NAME + "beowulf.txt"); final SeekableByteChannel beowulfChannel = new ResourceObjectPutter(RESOURCE_BASE_NAME).buildChannel("beowulf.txt"); final PutObjectResponse putObjectResponse = client.putObject(new PutObjectRequest(BUCKET_NAME, "beowulf.txt", beowulfChannel, Files.size(beowulfPath))); assertThat(putObjectResponse.getStatusCode(), is(200)); } finally { deleteAllContents(client, BUCKET_NAME); } }
Source:
private void sanitazeOnMutation(final int what) { try{ switch (what) { case SET_PRINCIPAL: if(this.principal!=null && !this.principal.equals(AnonymousPrincipal.getInstance())){ this.userCallbackKinds.remove(CallbackKind.PRINCIPAL); } break; case SET_CRED_SOURCE: if(this.credentialSource!=null && !this.credentialSource.equals(IdentityCredentials.NONE)){ this.userCallbackKinds.remove(CallbackKind.CREDENTIAL); } break; case SET_REALM: this.userCallbackKinds.remove(CallbackKind.REALM); break; case SET_PARAM_SPECS: this.userCallbackKinds.remove(CallbackKind.PARAMETERS); break; case SET_KEY_MGR_FAC: this.userCallbackKinds.remove(CallbackKind.PEER_CREDENTIAL); break; case SET_USER_CB_KINDS: if (this.principal != null) { sanitazeOnMutation(SET_PRINCIPAL); } if (this.credentialSource != null) { sanitazeOnMutation(SET_CRED_SOURCE); } if (this.setRealm != null) { sanitazeOnMutation(SET_REALM); } if (this.parameterSpecs != null) { sanitazeOnMutation(SET_PARAM_SPECS); } if (this.keyManagerFactory != null) { sanitazeOnMutation(SET_KEY_MGR_FAC); } break; default: break; } }catch(Exception e){ e.printStackTrace(); } }

Target:
private void sanitazeOnMutation(final int what) { switch (what) { case SET_PRINCIPAL: if (this.principal != null && ! this.principal.equals(AnonymousPrincipal.getInstance())) { this.userCallbackKinds.remove(CallbackKind.PRINCIPAL); } break; case SET_CRED_SOURCE: if (this.credentialSource != null && ! this.credentialSource.equals(IdentityCredentials.NONE)) { this.userCallbackKinds.remove(CallbackKind.CREDENTIAL); } break; case SET_REALM: this.userCallbackKinds.remove(CallbackKind.REALM); break; case SET_PARAM_SPECS: this.userCallbackKinds.remove(CallbackKind.PARAMETERS); break; case SET_KEY_MGR_FAC: this.userCallbackKinds.remove(CallbackKind.PEER_CREDENTIAL); break; case SET_USER_CB_KINDS: if (this.principal != null) { sanitazeOnMutation(SET_PRINCIPAL); } if (this.credentialSource != null) { sanitazeOnMutation(SET_CRED_SOURCE); } if (this.setRealm != null) { sanitazeOnMutation(SET_REALM); } if (this.parameterSpecs != null) { sanitazeOnMutation(SET_PARAM_SPECS); } if (this.keyManagerFactory != null) { sanitazeOnMutation(SET_KEY_MGR_FAC); } break; } }
Source:
public Object apply(RevisionResource rsrc, Input input) throws NoSuchChangeException, OrmException, IOException, ResourceConflictException { final PatchSet patchSet = rsrc.getPatchSet(); final PatchSet.Id patchSetId = patchSet.getId(); final Change change = rsrc.getChange(); if (!patchSet.isDraft()) { throw new ResourceConflictException("patch set is not a draft."); } if (!rsrc.getControl().canDeleteDraft(dbProvider.get())) { throw new ResourceConflictException( "Not permitted to delete this draft patch set"); } ChangeUtil.deleteOnlyDraftPatchSet(patchSet, change, gitManager, gitRefUpdated, dbProvider.get()); if (dbProvider.get().patchSets().byChange( change.getId()).toList().size() == 0) { ChangeUtil.deleteDraftChange(patchSetId, gitManager, gitRefUpdated, dbProvider.get()); } else { if (change.currentPatchSetId().equals(patchSetId)) { try { updateCurrentPatchSet(dbProvider.get(), change, previousPatchSetInfo(patchSetId)); } catch (PatchSetInfoNotAvailableException e) { throw new NoSuchChangeException(change.getId()); } } } return Response.none(); }

Target:
public Object apply(RevisionResource rsrc, Input input) throws ResourceNotFoundException, AuthException, OrmException, IOException, ResourceConflictException { PatchSet patchSet = rsrc.getPatchSet(); PatchSet.Id patchSetId = patchSet.getId(); Change change = rsrc.getChange(); if (!patchSet.isDraft()) { throw new ResourceConflictException("Patch set is not a draft."); } if (!rsrc.getControl().canDeleteDraft(dbProvider.get())) { throw new AuthException("Not permitted to delete this draft patch set"); } deleteDraftPatchSet(patchSet, change); deleteOrUpdateDraftChange(patchSetId, change); return Response.none(); }
Source:
public void onLiveInstanceChange(List<LiveInstance> liveInstances, NotificationContext changeContext) { logger.trace("Live instance change triggered from with: {}", dcName, liveInstances); updateInstanceLiveness(liveInstances); if (!liveStateInitialized) { logger.info("Received initial notification for live instance change from {}", dcName); liveStateInitialized = true; } helixClusterManagerMetrics.liveInstanceChangeTriggerCount.inc(); }

Target:
public void onLiveInstanceChange(List<LiveInstance> liveInstances, NotificationContext changeContext) { logger.trace("Live instance change triggered from with: {}", dcName, liveInstances); updateInstanceLiveness(liveInstances); if (!liveStateInitialized.get()) { logger.info("Received initial notification for live instance change from {}", dcName); liveStateInitialized.set(true); } helixClusterManagerMetrics.liveInstanceChangeTriggerCount.inc(); }
Source:
public long getTimeForPoint(int x) { return UIThreadRunnable.syncExec((Result<Long>) () -> { Rectangle bounds = widget.getBounds(); Point p = new Point(x, bounds.y + bounds.height / 2); if (!bounds.contains(p)) { return null; } long time = widget.getTimeAtX(x); return time; }); }

Target:
public @Nullable Long getTimeForPoint(int x) { return UIThreadRunnable.syncExec((Result<@Nullable Long>) () -> { Rectangle bounds = widget.getBounds(); Point p = new Point(x, bounds.y + bounds.height / 2); if (!bounds.contains(p)) { return null; } return widget.getTimeAtX(x); }); }
Source:
public void buildAndInstallSkipDepsExistentProject() throws Exception{ DefaultRemoteExecutor executor = new DefaultRemoteExecutor(executorService); CompletableFuture<KieCompilationResponse> futureRes = executor.buildAndInstall(Paths.get(tmpRoot.toAbsolutePath()+"/dummy").toAbsolutePath().toString(), mavenRepo.toString(), Boolean.TRUE); KieCompilationResponse res = futureRes.get(); assertThat(res.isSuccessful()).isTrue(); assertThat(res.getDependencies()).isEmpty(); assertThat(res.getDependencies()).hasSize(0); }

Target:
public void buildAndInstallSkipDepsExistentProject() throws Exception{ DefaultRemoteExecutor executor = new DefaultRemoteExecutor(executorService); CompletableFuture<KieCompilationResponse> futureRes = executor.buildAndInstall(Paths.get(tmpRoot.toAbsolutePath()+"/dummy").toAbsolutePath().toString(), mavenRepo.toString(), Boolean.TRUE); KieCompilationResponse res = futureRes.get(); assertThat(res.isSuccessful()).isTrue(); assertThat(res.getDependencies()).isEmpty(); }
Source:
@Test public void unableToConnectWrongCredentials() { configureDefaultSSHSlaveLauncher().pwdCredentials("unexsisting", "unexsisting"); slave.save(); elasticSleep(3000); verifyLog("Authentication failed"); }

Target:
@Test public void unableToConnectWrongCredentials() { configureDefaultSSHSlaveLauncher().pwdCredentials("unexsisting", "unexsisting"); slave.save(); waitForLogMessage("Authentication failed"); }
Source:
public boolean hasTriggerIdCriteria() { return null != triggerId || !isEmpty(triggerIds); }

Target:
public boolean hasTriggerIdCriteria() { return !isEmpty(triggerId) || !isEmpty(triggerIds); }
Source:
private Filter getQueriesFilter(List<String> queryIds) { return filterBuilder.allOf( filterBuilder.attribute(Core.METACARD_TAGS).is().text(QUERY_TAG), filterBuilder.anyOf( queryIds .stream() .map(id -> filterBuilder.attribute(Core.ID).is().text(id)) .collect(Collectors.toList()))); }

Target:
private Filter getQueriesFilter(List<String> queryIds) { List<Filter> queryFilters = queryIds .stream() .map(id -> filterBuilder.attribute(Core.ID).is().text(id)) .collect(Collectors.toList()); return filterBuilder.allOf( filterBuilder.attribute(Core.METACARD_TAGS).is().text(QUERY_TAG), filterBuilder.anyOf(queryFilters)); }
Source:
public void purge(EncounterProvider delegate, RequestContext context) throws ResponseException { delegate.getEncounter().removeProvider(delegate.getEncounterRole(),delegate.getProvider()); }

Target:
public void purge(EncounterProvider delegate, RequestContext context) throws ResponseException { throw new ResourceDoesNotSupportOperationException(); }
Source:
filters(RecordQueryBuilder<I, R> builder, RecordSpec<I, R, ?> spec, TargetFilters filters) { if (filters.getFilterCount() > 0) { List<CompositeFilter> compositeFilters = filters.getFilterList(); for (CompositeFilter composite : compositeFilters) { CompositeFilter.CompositeOperator compositeOperator = composite.getOperator(); switch (compositeOperator) { case ALL: convert(composite, spec, builder); break; case EITHER: builder.either((either) -> convert(composite, spec, either)); break; case UNRECOGNIZED: case CCF_CO_UNDEFINED: default: throw newIllegalArgumentException( "Unsupported composite operator `%s` encountered.", compositeOperator); } } } }

Target:
filters(RecordQueryBuilder<I, R> builder, RecordSpec<I, R, ?> spec, TargetFilters filters) { for (CompositeFilter composite : filters.getFilterList()) { CompositeFilter.CompositeOperator compositeOperator = composite.getOperator(); switch (compositeOperator) { case ALL: convert(composite, spec, builder); break; case EITHER: builder.either((either) -> convert(composite, spec, either)); break; case UNRECOGNIZED: case CCF_CO_UNDEFINED: default: throw newIllegalArgumentException( "Unsupported composite operator `%s` encountered.", compositeOperator); } } }
Source:
public String update(Request request, Response response) { final String materialName = request.params(MATERIAL_NAME); final SCM existingSCM = fetchEntityFromConfig(materialName); final SCM scmFromRequest = buildEntityFromRequestBody(request); if (isRenameAttempt(existingSCM.getId(), scmFromRequest.getId()) || isRenameAttempt(existingSCM.getName(), scmFromRequest.getName())) { throw haltBecauseRenameOfEntityIsNotSupported(getEntityType().getEntityNameLowerCase()); } if (isPutRequestStale(request, existingSCM)) { throw haltBecauseEtagDoesNotMatch(getEntityType().getEntityNameLowerCase(), existingSCM.getId()); } final HttpLocalizedOperationResult operationResult = new HttpLocalizedOperationResult(); pluggableScmService.updatePluggableScmMaterial(currentUsername(), scmFromRequest, operationResult, getIfMatch(request)); return handleCreateOrUpdateResponse(request, response, scmFromRequest, operationResult); }

Target:
public String update(Request request, Response response) { final String materialName = request.params(MATERIAL_NAME); final SCM existingSCM = fetchEntityFromConfig(materialName); final SCM scmFromRequest = buildEntityFromRequestBody(request); if (isRenameAttempt(existingSCM.getId(), scmFromRequest.getId()) || isRenameAttempt(existingSCM.getName(), scmFromRequest.getName())) { throw haltBecauseRenameOfEntityIsNotSupported(getEntityType().getEntityNameLowerCase()); } haltIfEntityIsDefinedRemotely(existingSCM); if (isPutRequestStale(request, existingSCM)) { throw haltBecauseEtagDoesNotMatch(getEntityType().getEntityNameLowerCase(), existingSCM.getId()); } final HttpLocalizedOperationResult operationResult = new HttpLocalizedOperationResult(); pluggableScmService.updatePluggableScmMaterial(currentUsername(), scmFromRequest, operationResult, getIfMatch(request)); return handleCreateOrUpdateResponse(request, response, scmFromRequest, operationResult); }
Source:
default void addGutterItem(int lineStart, int lineEnd, String gutterId, Element element) { addGutterItem(lineStart, gutterId, element); }

Target:
default void addGutterItem(int lineStart, int lineEnd, String gutterId, Element element) { for (int i = lineStart; i <= lineEnd; i++) { addGutterItem(i, gutterId, element); } }
Source:
public String getExternalId() { try { for (ImmutablePair<String, String> identifier : this .<ImmutablePair<String, String>>getData("identifiers")) { if (identifier.getKey().equalsIgnoreCase("external_id")) { return identifier.getValue(); } } } catch (Exception ex) { return null; } return null; }

Target:
public String getExternalId() { return null; }
Source:
public final static String encrypt(String source, String certificateFile, String passwd, String alias) throws Exception { try { String result = ""; if (!StringHelper.isNullOrEmpty(source.trim())) { KeyStore store = EncryptionUtils.getKeyStore(certificateFile, passwd, certType); result = encrypt(source, store.getCertificate(alias)); } return result; } catch (Exception e) { log.error("Error doing the encryption", e); throw e; } }

Target:
public final static String encrypt(String source, String certificateFile, String passwd, String alias) throws Exception { try { String result = ""; if (source.trim().length() > 0) { KeyStore store = EncryptionUtils.getKeyStore(certificateFile, passwd, certType); result = encrypt(source, store.getCertificate(alias)); } return result; } catch (Exception e) { log.error("Error doing the encryption", e); throw e; } }
Source:
public static void register(MBeanServer mBeanServer, Object mbean, String type, String name) { try { ObjectName objectName = objectNameFor(type, name); if (!mBeanServer.isRegistered(objectName)) { mBeanServer.registerMBean(mbean, objectName); } } catch (Exception e) { throw new RuntimeException(e); } }

Target:
public static void register(MBeanServer mBeanServer, Object mbean, String type, String name) { try { ObjectName objectName = objectNameFor(type, name); if (!mBeanServer.isRegistered(objectName)) { mBeanServer.registerMBean(mbean, objectName); } } catch (OperationsException e) { Throwables.propagate(e); } catch (MBeanRegistrationException e) { Throwables.propagate(e); } }
Source:
public void recordsLeaderPingTimeout() { when(pingableLeader.ping()).thenAnswer(bla -> { Thread.sleep(10_000); return true; }); when(pingableLeader.getUUID()).thenReturn(REMOTE_UUID.toString()); LeaderPinger pinger = pingerWithTimeout(Duration.ofMillis(100)); assertThat(pinger.pingLeaderWithUuid(REMOTE_UUID)).isFalse(); verify(recorder).recordLeaderPingTimeout(); verifyNoMoreInteractions(recorder); }

Target:
public void recordsLeaderPingTimeout() { when(pingableLeader.ping()).thenAnswer($ -> { Thread.sleep(10_000); return true; }); when(pingableLeader.getUUID()).thenReturn(REMOTE_UUID.toString()); LeaderPinger pinger = pingerWithTimeout(Duration.ofMillis(100)); assertThat(pinger.pingLeaderWithUuid(REMOTE_UUID)).isFalse(); verify(recorder).recordLeaderPingTimeout(); verifyNoMoreInteractions(recorder); }
Source:
public void updated(Map<String, Object> properties) { logger.info("Updated Heater..."); this.properties = properties; for (String s : properties.keySet()) { logger.info("Update - " + s + ": " + properties.get(s)); } doUpdate(true); logger.info("Updated Heater... Done."); }

Target:
public void updated(Map<String, Object> properties) { logger.info("Updated Heater..."); this.properties = properties; for (String s : properties.keySet()) { logger.info("Update - {}: {}", s, properties.get(s)); } doUpdate(true); logger.info("Updated Heater... Done."); }
Source:
public void testIsValid() { Month month = MonthDay.now().getMonth(); int day = MonthDay.now().getDayOfMonth(); MonthDay future = MonthDay.of( month.plus( 1 ), day ); MonthDay past = MonthDay.of( month.minus( 1 ), day ); assertTrue( constraint.isValid( null, null ) ); assertTrue( constraint.isValid( past, null ) ); assertFalse( constraint.isValid( future, null ) ); }

Target:
public void testIsValid() { Month currentMonth = MonthDay.now().getMonth(); MonthDay future = MonthDay.of( currentMonth.plus( 1 ), 15 ); MonthDay past = MonthDay.of( currentMonth.minus( 1 ), 15 ); assertTrue( constraint.isValid( null, null ), "null fails validation." ); if ( currentMonth != Month.JANUARY ) { assertTrue( constraint.isValid( past, null ), "Past MonthDay '" + past + "' fails validation."); } if ( currentMonth != Month.DECEMBER ) { assertFalse( constraint.isValid( future, null ), "Future MonthDay '" + future + "' validated as past."); } }
Source:
private void handleUncommittedChanges(final Repository repository, final List<String> files) { PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() { public void run() { Shell shell = PlatformUI.getWorkbench() .getActiveWorkbenchWindow().getShell(); CleanupUncomittedChangesDialog cleanupUncomittedChangesDialog = new CleanupUncomittedChangesDialog( shell, MessageFormat .format(UIText.AbstractRebaseCommandHandler_cleanupDialog_title, repository), UIText.AbstractRebaseCommandHandler_cleanupDialog_text, repository, files); cleanupUncomittedChangesDialog.open(); if (cleanupUncomittedChangesDialog.shouldContinue()) { try { execute(repository); } catch (ExecutionException e) { Activator.logError(e.getMessage(), e); } } } }); }

Target:
private void handleUncommittedChanges(final Repository repository, final List<String> files) { PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() { public void run() { Shell shell = PlatformUI.getWorkbench() .getActiveWorkbenchWindow().getShell(); String repoName = Activator.getDefault().getRepositoryUtil() .getRepositoryName(repository); CleanupUncomittedChangesDialog cleanupUncomittedChangesDialog = new CleanupUncomittedChangesDialog( shell, MessageFormat .format(UIText.AbstractRebaseCommandHandler_cleanupDialog_title, repoName), UIText.AbstractRebaseCommandHandler_cleanupDialog_text, repository, files); cleanupUncomittedChangesDialog.open(); if (cleanupUncomittedChangesDialog.shouldContinue()) { try { execute(repository); } catch (ExecutionException e) { Activator.logError(e.getMessage(), e); } } } }); }
Source:
public void testInputOperator(boolean hasFailure) throws Exception { END_TUPLE message latch = new CountDownLatch(totalBrokers); int totalCount = 10000; KafkaTestProducer p = new KafkaTestProducer(TEST_TOPIC, hasMultiPartition, hasMultiCluster); p.setSendCount(totalCount); new Thread(p).start(); LocalMode lma = LocalMode.newInstance(); DAG dag = lma.getDAG(); KafkaSinglePortInputOperator node = dag.addOperator("Kafka input", KafkaSinglePortInputOperator.class); node.setInitialPartitionCount(1); node.setTopics(TEST_TOPIC); node.setInitialOffset(AbstractKafkaInputOperator.InitialOffset.EARLIEST.name()); node.setClusters(getClusterConfig()); CollectorModule collector = dag.addOperator("TestMessageCollector", new CollectorModule()); dag.addStream("Kafka message", node.outputPort, collector.inputPort).setLocality(Locality.CONTAINER_LOCAL); final LocalMode.Controller lc = lma.getController(); lc.setHeartbeatMonitoringEnabled(false); if (hasFailure) { setupHasFailureTest(node, dag); } lc.runAsync(); boolean notTimeout = latch.await(40000, TimeUnit.MILLISECONDS); Assert.assertTrue("TIMEOUT: 40s Collected " + tupleCollection, notTimeout); Assert.assertEquals("Tuple count", totalCount, tupleCollection.size()); logger.debug(String.format("Number of emitted tuples: %d", tupleCollection.size())); p.close(); lc.shutdown(); Thread.sleep(5000); }

Target:
public void testInputOperator(boolean hasFailure) throws Exception { END_TUPLE message latch = new CountDownLatch(totalBrokers); int totalCount = 10000; KafkaTestProducer p = new KafkaTestProducer(TEST_TOPIC, hasMultiPartition, hasMultiCluster); p.setSendCount(totalCount); Thread t = new Thread(p); t.start(); LocalMode lma = LocalMode.newInstance(); DAG dag = lma.getDAG(); KafkaSinglePortInputOperator node = dag.addOperator("Kafka input", KafkaSinglePortInputOperator.class); node.setInitialPartitionCount(1); node.setTopics(TEST_TOPIC); node.setInitialOffset(AbstractKafkaInputOperator.InitialOffset.EARLIEST.name()); node.setClusters(getClusterConfig()); CollectorModule collector = dag.addOperator("TestMessageCollector", new CollectorModule()); dag.addStream("Kafka message", node.outputPort, collector.inputPort).setLocality(Locality.CONTAINER_LOCAL); final LocalMode.Controller lc = lma.getController(); lc.setHeartbeatMonitoringEnabled(false); if (hasFailure) { setupHasFailureTest(node, dag); } lc.runAsync(); boolean notTimeout = latch.await(40000, TimeUnit.MILLISECONDS); Assert.assertTrue("TIMEOUT: 40s Collected " + tupleCollection, notTimeout); Assert.assertEquals("Tuple count", totalCount, tupleCollection.size()); logger.debug(String.format("Number of emitted tuples: %d", tupleCollection.size())); t.join(); p.close(); lc.shutdown(); }
Source:
private Repository<Entity> getRepository(String entityTypeId) { if (entityTypeId.equals(ENTITY_TYPE_META_DATA) || entityTypeId.equals(ATTRIBUTE_META_DATA)) { throw new RepositoryNotCapableException(entityTypeId, WRITABLE); } return metaDataService .getRepository(entityTypeId) .orElseThrow(() -> new UnknownRepositoryException(entityTypeId)); }

Target:
private Repository<Entity> getRepository(String entityTypeId) { if (entityTypeId.equals(ENTITY_TYPE_META_DATA) || entityTypeId.equals(ATTRIBUTE_META_DATA)) { throw new MetadataAccessException(); } return metaDataService .getRepository(entityTypeId) .orElseThrow(() -> new UnknownRepositoryException(entityTypeId)); }
Source:
public void run() { try { while (true) { try { request.clearProperties(); if (app.getEventQueueId() == null) { register(); } request.setProperty("queue_id", app.getEventQueueId()); request.setProperty("last_event_id", "" + app.getLastEventId()); if (!registeredOrGotEventsThisRun) { request.setProperty("dont_block", "true"); } Response httpResponse =request.execute("GET", "v1/events"); String json = httpResponse.body().string(); JSONObject response = new JSONObject(json); JSONArray events = response.getJSONArray("events"); if (events.length() > 0) { this.processEvents(events); JSONObject lastEvent = events.getJSONObject(events .length() - 1); app.setLastEventId(lastEvent.getInt("id")); failures = 0; } if (!registeredOrGotEventsThisRun) { registeredOrGotEventsThisRun = true; activity.runOnUiThread(new Runnable() { @Override public void run() { activity.onReadyToDisplay(false); } }); } if (httpResponse.code() == 400) { String msg = httpResponse.message(); if (msg.contains("Bad event queue id") || msg.contains("too old")) { Log.w(ASYNC_GET_EVENTS, "Queue dead"); app.setEventQueueId(null); continue; } } } catch (SocketTimeoutException e) { e.printStackTrace(); } catch (IOException e) { if (request.aborting) { Log.i(ASYNC_GET_EVENTS, "Thread aborted"); return; } else { backoff(e); } } catch (JSONException e) { backoff(e); } } } catch (Exception e) { ZLog.logException(e); } }

Target:
public void run() { try { while (true) { try { request.clearProperties(); if (app.getEventQueueId() == null) { register(); } request.setProperty("queue_id", app.getEventQueueId()); request.setProperty("last_event_id", "" + app.getLastEventId()); if (!registeredOrGotEventsThisRun) { request.setProperty("dont_block", "true"); } request.setMethodAndUrl("GET", "v1/events"); Response httpResponse = request.execute(); String json = httpResponse.body().string(); if (!httpResponse.isSuccessful()) { String msg = httpResponse.message(); if (msg.contains("Bad event queue id") || msg.contains("too old")) { Log.w(ASYNC_GET_EVENTS, "Queue dead"); app.setEventQueueId(null); } Log.i("WRONG", "run: " + json); continue; } else { Log.i("OkHttp200GE", json); } JSONObject response = new JSONObject(json); JSONArray events = response.getJSONArray("events"); if (events.length() > 0) { this.processEvents(events); JSONObject lastEvent = events.getJSONObject(events .length() - 1); app.setLastEventId(lastEvent.getInt("id")); failures = 0; } if (!registeredOrGotEventsThisRun) { registeredOrGotEventsThisRun = true; activity.runOnUiThread(new Runnable() { @Override public void run() { activity.onReadyToDisplay(false); } }); } } catch (SocketTimeoutException e) { Log.e(TAG, e.getMessage(), e); ZLog.logException(e); } catch (IOException e) { if (request.aborting) { Log.i(ASYNC_GET_EVENTS, "Thread aborted"); return; } else { backoff(e); } } catch (JSONException e) { backoff(e); } Thread.sleep(1000); } } catch (Exception e) { ZLog.logException(e); } }
Source:
protected LeshanServerBuilder createServerBuilder(int clientAwakeTime) { LeshanServerBuilder builder = new LeshanServerBuilder(); builder.setObjectModelProvider(new StaticModelProvider(createObjectModels())); builder.setLocalAddress(new InetSocketAddress(InetAddress.getLoopbackAddress(), 0)); builder.setLocalSecureAddress(new InetSocketAddress(InetAddress.getLoopbackAddress(), 0)); builder.setSecurityStore(new InMemorySecurityStore()); builder.setClientAwakeTimeProvider(new StaticClientAwakeTimeProvider(clientAwakeTime)); return builder; }

Target:
protected LeshanServerBuilder createServerBuilder(int clientAwakeTime) { LeshanServerBuilder builder = super.createServerBuilder(); builder.setClientAwakeTimeProvider(new StaticClientAwakeTimeProvider(clientAwakeTime)); return builder; }
Source:
public Predicate<Cell> apply(Cell deleteMarker) { checkArgument(CellUtil.isDelete(deleteMarker), "expecting delete marker cell."); switch (KeyValue.Type.codeToType(deleteMarker.getTypeByte())) { case Delete: return new ExactTimestampPredicate(false , deleteMarker); case DeleteFamilyVersion: return new ExactTimestampPredicate(true , deleteMarker); case DeleteColumn: return new TimestampRangePredicate(false , deleteMarker); case DeleteFamily: return new TimestampRangePredicate(true , deleteMarker); default: throw new IllegalStateException( "Unexpected type byte: " + deleteMarker.getTypeByte()); } }

Target:
public Predicate<Cell> apply(Cell deleteMarker) { checkArgument(CellUtil.isDelete(deleteMarker), "expecting delete marker cell."); switch (KeyValue.Type.codeToType(deleteMarker.getTypeByte())) { case Delete: return Predicates.and( new MatchQualifier(deleteMarker), new MatchExactTimestamp(deleteMarker)); case DeleteFamilyVersion: return new MatchExactTimestamp(deleteMarker); case DeleteColumn: return Predicates.and( new MatchQualifier(deleteMarker), new MatchTimestampRangeByUpperBound(deleteMarker)); case DeleteFamily: return new MatchTimestampRangeByUpperBound(deleteMarker); default: throw new IllegalStateException( "Unexpected type byte: " + deleteMarker.getTypeByte()); } }
Source:
private void uninstallAllFeatures(Application application) { try { Set<Feature> features = application.getFeatures(); for (Feature feature : features) { if (featuresService.isInstalled(feature) && isPermittedToViewFeature(feature.getName())) { tryUninstallFeature(feature); } } } catch (ApplicationServiceException ase) { LOGGER.warn("Error obtaining feature list from application", ase); } }

Target:
private void uninstallAllFeatures(Application application) { try { application .getFeatures() .stream() .filter(Objects::nonNull) .filter(featuresService::isInstalled) .filter(f -> isPermittedToViewFeature(f.getName())) .forEach(this::tryUninstallFeature); } catch (ApplicationServiceException ase) { LOGGER.warn("Error obtaining feature list from application", ase); } }
Source:
public void deserializeOnto(Object target, Map<FieldMetadata<?, ?>, PersistedData> values, DeserializationContext context, DeserializeFieldCheck check) { values.entrySet().stream().filter(field -> check.shouldDeserialize(classMetadata, field.getKey())).forEach(field -> { deserializeOnto(target, field.getKey(), field.getValue(), context); }); }

Target:
public void deserializeOnto(Object target, Map<FieldMetadata<?, ?>, PersistedData> values, DeserializationContext context, DeserializeFieldCheck check) { for (Map.Entry<FieldMetadata<?, ?>, PersistedData> field : values.entrySet()) { if (check.shouldDeserialize(classMetadata, field.getKey())) { deserializeOnto(target, field.getKey(), field.getValue(), context); } } }
Source:
public Object execute(ExecutionEvent event) throws ExecutionException { Repository[] repos = getRepositories(event); if (repos.length != repos.length) return null; GitSynchronizeDataSet gsdSet = new GitSynchronizeDataSet(); for (Repository repo : repos) { try { gsdSet.add(new GitSynchronizeData(repo, HEAD, HEAD, true)); } catch (IOException e) { Activator.handleError(e.getMessage(), e, true); } } GitModelSynchronize.launch(gsdSet, getSelectedResources(event)); return null; }

Target:
public Object execute(ExecutionEvent event) throws ExecutionException { Repository[] repos = getRepositories(event); if (repos.length == 0) return null; GitSynchronizeDataSet gsdSet = new GitSynchronizeDataSet(); for (Repository repo : repos) { try { gsdSet.add(new GitSynchronizeData(repo, HEAD, HEAD, true)); } catch (IOException e) { Activator.handleError(e.getMessage(), e, true); } } GitModelSynchronize.launch(gsdSet, getSelectedResources(event)); return null; }
Source:
protected void waitForTasksToBeCleared() throws InterruptedException { log.info("waiting for all tasks related to domain {0} to be cleared (if exist) before attempting to deactivate", getStorageDomainId()); while (true) { TimeUnit.SECONDS.sleep(3); List<Guid> tasks = getDbFacade().getAsyncTaskDao().getAsyncTaskIdsByEntity(getStorageDomainId()); if (tasks.isEmpty()) { log.info("no tasks for the deactivated domain {0}, proceeding with deactivation", getStorageDomainId()); return; } else { log.info("tasks {0} were found for domain {1}, waiting before attempting to deactivate", tasks, getStorageDomainId()); } } }

Target:
protected void waitForTasksToBeCleared() throws InterruptedException { log.info("waiting for all tasks related to domain to be cleared (if exist) before attempting to deactivate", getStorageDomainId()); while (true) { TimeUnit.SECONDS.sleep(3); List<Guid> tasks = getDbFacade().getAsyncTaskDao().getAsyncTaskIdsByEntity(getStorageDomainId()); if (tasks.isEmpty()) { log.info("no tasks for the deactivated domain {}, proceeding with deactivation", getStorageDomainId()); return; } else { log.info("tasks were found for domain {}, waiting before attempting to deactivate", tasks, getStorageDomainId()); } } }
Source:
public void whenQueryWithAggregation_thenReturnCustomResult() { List<CommentCount> commentsYear = commentRepository.countTotalCommentsByYearClass(); CommentCount countYear2019 = commentsYear.get(0); Assert.assertTrue(countYear2019.getYear().equals(2019)); Assert.assertEquals(countYear2019.getTotal().longValue(), 1l); CommentCount countYear2018 = commentsYear.get(1); Assert.assertTrue(countYear2018.getYear().equals(2018)); Assert.assertEquals(countYear2018.getTotal().longValue(), 2l); CommentCount countYear2017 = commentsYear.get(2); Assert.assertTrue(countYear2017.getYear().equals(2017)); Assert.assertEquals(countYear2017.getTotal().longValue(), 1l); }

Target:
public void whenQueryWithAggregation_thenReturnCustomResult() { List<CommentCount> commentCountsByYear = commentRepository.countTotalCommentsByYearClass(); CommentCount countYear2019 = commentCountsByYear.get(0); assertThat(countYear2019.getYear(), is(Integer.valueOf(2019))); assertThat(countYear2019.getTotal(), is(1l)); CommentCount countYear2018 = commentCountsByYear.get(1); assertThat(countYear2018.getYear(), is(Integer.valueOf(2018))); assertThat(countYear2018.getTotal(), is(2l)); CommentCount countYear2017 = commentCountsByYear.get(2); assertThat(countYear2017.getYear(), is(Integer.valueOf(2017))); assertThat(countYear2017.getTotal(), is(1l)); }
Source:
public void newLabel() { logger.info("Navigating to New Label page"); if (isBrowserActive()) { runBrowserOperation(() -> { if (!driver.getCurrentUrl().equals(GitHubURL.getPathForNewLabel())) { driver.get(GitHubURL.getPathForNewLabel()); } }); } else { resetBrowser(); newLabel(); } }

Target:
public void newLabel() { logger.info("Navigating to New Label page"); runBrowserOperation(() -> { if (!driver.getCurrentUrl().equals(GitHubURL.getPathForNewLabel())) { driver.get(GitHubURL.getPathForNewLabel()); } }); }
Source:
public BiomeBlockReplacerConfig createBiomeBlockReplacerConfig() { BiomeBlockReplacerConfig conf = new BiomeBlockReplacerConfig(); conf.fillDefaults(); conf.set(CubicChunks.MODID, "ocean_height", this.waterLevel); return conf; }

Target:
public BiomeBlockReplacerConfig createBiomeBlockReplacerConfig() { BiomeBlockReplacerConfig conf = new BiomeBlockReplacerConfig(); conf.fillDefaults(); conf.set(CubicChunks.MODID, "ocean_level", this.waterLevel); return conf; }
Source:
public void handleEvent(MotechEvent event) { LOGGER.info("Daily password reset reminder triggered"); if (settingService.isPasswordResetReminderEnabled()) { int daysTilReminder = daysTilReminder(); for (MotechUser user : allUsers.retrieveAll()) { if (daysWithoutPasswordChange(user) == daysTilReminder) { sendPasswordReminderEvent(user); } } } }

Target:
public void handleEvent(MotechEvent event) { LOGGER.info("Daily password reset reminder triggered"); if (settingService.isPasswordResetReminderEnabled()) { int daysTillPasswordChange = settingService.getNumberOfDaysToChangePassword(); int daysTillReminder = daysTillPasswordChange - settingService.getNumberOfDaysForReminder(); for (MotechUser user : allUsers.retrieveAll()) { int daysWithoutPasswordChange = daysWithoutPasswordChange(user); LOGGER.debug("User hasn't changed password in days. Notification should be sent at day {}", user.getUserName(), daysWithoutPasswordChange, daysTillReminder); if (daysWithoutPasswordChange == daysTillReminder) { sendPasswordReminderEvent(user, daysTillPasswordChange); } } } }
Source:
public void should_decode_list_with_null_elements() { when(elementCodec.decode(Bytes.fromHexString("0x0002"), ProtocolVersion.DEFAULT)).thenReturn(2); assertThat(decode("0x" + "00000002" + "FFFFFFFF" + "000000020002")).containsExactly(null, 2); }

Target:
public void should_decode_list_with_null_elements() { when(elementCodec.decode(Bytes.fromHexString("0x0002"), ProtocolVersion.DEFAULT)).thenReturn(2); assertThat( decode( "0x" + "00000002" + "FFFFFFFF" + "00000002" + "0002" )) .containsExactly(null, 2); }
Source:
public static final KeyValueStoreListener create() { return new ClientKeyValueStoreListener(); }

Target:
public static KeyValueStoreListener create() { return new ClientKeyValueStoreListener(); }
Source:
public void testBuilderWithNullValues() { FeedbackResponseCommentAttributes feedbackAttributes = FeedbackResponseCommentAttributes .builder("course", "name", "questionId", "responseId", "email") .withShowGiverNameTo(null) .withShowCommentTo(null) .withLastEditorEmail(null) .withReceiverSection(null) .withGiverSection(null) .withCommentText(null) .withCreatedAt(new Date()) .withLastEditedAt(null) .withFeedbackResponseCommentId(null) .withVisibilityFollowingFeedbackQuestion(null) .build(); assertEquals(feedbackAttributes.giverSection, "None"); assertEquals(feedbackAttributes.receiverSection, "None"); assertEquals(feedbackAttributes.lastEditorEmail, feedbackAttributes.giverEmail); assertEquals(feedbackAttributes.lastEditedAt, feedbackAttributes.createdAt); assertEquals(feedbackAttributes.commentText, new Text("")); assertTrue(feedbackAttributes.isVisibilityFollowingFeedbackQuestion); }

Target:
public void testBuilderWithNullValues() { FeedbackResponseCommentAttributes feedbackAttributes = FeedbackResponseCommentAttributes .builder("course", "name", "email", new Text("")) .withFeedbackResponseId(null) .withFeedbackQuestionId(null) .withShowGiverNameTo(null) .withShowCommentTo(null) .withLastEditorEmail(null) .withReceiverSection(null) .withGiverSection(null) .withCreatedAt(new Date()) .withLastEditedAt(null) .withFeedbackResponseCommentId(null) .withVisibilityFollowingFeedbackQuestion(null) .build(); assertEquals(feedbackAttributes.giverSection, "None"); assertEquals(feedbackAttributes.receiverSection, "None"); assertEquals(feedbackAttributes.lastEditorEmail, feedbackAttributes.giverEmail); assertEquals(feedbackAttributes.lastEditedAt, feedbackAttributes.createdAt); assertTrue(feedbackAttributes.isVisibilityFollowingFeedbackQuestion); }
Source:
public boolean restartApp(int appId) { return true; }

Target:
public boolean restartApp(int appId) { String message = "Restarting the whole topology is not supported yet. " + "Please kill and resubmit the topology."; LOG.log(Level.SEVERE, message); return false; }
Source:
protected void doDeletePath(RepositoryPath repositoryPath, boolean force) throws IOException { Repository repository = repositoryPath.getFileSystem().getRepository(); if (!repository.isTrashEnabled()) { Files.deleteIfExists(repositoryPath.getTarget()); return; } RepositoryPath trashPath = getTrashPath(repositoryPath); Files.move(repositoryPath.getTarget(), trashPath.getTarget(), StandardCopyOption.REPLACE_EXISTING); if (force && repository.isAllowsDelete()) { deleteTrash(repositoryPath); } }

Target:
protected void doDeletePath(RepositoryPath repositoryPath, boolean force) throws IOException { Repository repository = repositoryPath.getFileSystem().getRepository(); if (!repository.isTrashEnabled()) { Files.deleteIfExists(repositoryPath.getTarget()); return; } RepositoryPath trashPath = getTrashPath(repositoryPath); Files.move(repositoryPath.getTarget(), trashPath.getTarget(), StandardCopyOption.REPLACE_EXISTING); if (force && repository.allowsForceDeletion()) { deleteTrash(repositoryPath); } }