auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private synchronized void regenerateMdsDataBundle(boolean startBundle, String... moduleNames) { LOGGER.info("Regenerating the mds entities bundle"); ClassLoader currentClassLoader = Thread.currentThread().getContextClassLoader(); Thread.currentThread().setContextClassLoader(this.getClass().getClassLoader()); clearModulesCache(moduleNames); cleanEntitiesBundleCachedClasses(); boolean constructed = mdsConstructor.constructEntities(); if (!constructed) { return; } LOGGER.info("Updating mds data provider"); mdsDataProvider.updateDataProvider(); File dest = new File(monitor.bundleLocation()); if (dest.exists()) { LOGGER.info("Waiting for entities context"); monitor.waitForEntitiesContext(); } File tmpBundleFile; try { LOGGER.info("Generating bundle jar"); tmpBundleFile = generate(); LOGGER.info("Generated bundle jar"); } catch (IOException e) { throw new MdsException("Unable to generate entities bundle", e); } FileUtils.deleteQuietly(dest); try { FileUtils.copyFile(tmpBundleFile, dest); } catch (IOException e) { LOGGER.error("Unable to copy the mds-entities bundle to the bundle directory. Installing from temp directory", e); dest = tmpBundleFile; } monitor.stopEntitiesBundle(); stopModulesForCoreBundleRefresh(moduleNames); try { monitor.start(dest, false); } finally { FileUtils.deleteQuietly(tmpBundleFile); } refreshModules(moduleNames); if (startBundle) { monitor.start(); } startModulesForCoreBundleRefresh(moduleNames); ThreadSuspender.sleep(2000); Thread.currentThread().setContextClassLoader(currentClassLoader); }

Target:
private synchronized void regenerateMdsDataBundle(boolean startBundle, String... moduleNames) { LOGGER.info("Regenerating the mds entities bundle"); ClassLoader currentClassLoader = Thread.currentThread().getContextClassLoader(); try { Thread.currentThread().setContextClassLoader(this.getClass().getClassLoader()); clearModulesCache(moduleNames); cleanEntitiesBundleCachedClasses(); boolean constructed = mdsConstructor.constructEntities(); if (!constructed) { return; } LOGGER.info("Updating mds data provider"); mdsDataProvider.updateDataProvider(); File dest = new File(monitor.bundleLocation()); if (dest.exists()) { LOGGER.info("Waiting for entities context"); monitor.waitForEntitiesContext(); } File tmpBundleFile; try { LOGGER.info("Generating bundle jar"); tmpBundleFile = generate(); LOGGER.info("Generated bundle jar"); } catch (IOException e) { throw new MdsException("Unable to generate entities bundle", e); } FileUtils.deleteQuietly(dest); try { FileUtils.copyFile(tmpBundleFile, dest); } catch (IOException e) { LOGGER.error("Unable to copy the mds-entities bundle to the bundle directory. Installing from temp directory", e); dest = tmpBundleFile; } monitor.stopEntitiesBundle(); stopModulesForCoreBundleRefresh(moduleNames); try { monitor.start(dest, false); } finally { FileUtils.deleteQuietly(tmpBundleFile); } refreshModules(moduleNames); if (startBundle) { monitor.start(); } startModulesForCoreBundleRefresh(moduleNames); ThreadSuspender.sleep(2000); } finally { Thread.currentThread().setContextClassLoader(currentClassLoader); } }
Source:
public void testDebuggerStopsAtBreakpoint() throws CoreException, IOException { new ProjectExplorer().getProject("nodejs-ex").getProjectItem("server.js").open(); new WaitUntil(new EditorWithTitleIsActive("server.js")); TextEditor editor = new TextEditor("server.js"); setLineBreakpoint(editor, BREAKPOINT_LINE); triggerDebugSession(); try { new WaitUntil(new EditorWithTitleIsActive("server.js"), TimePeriod.LONG); new WaitUntil(new CursorPositionIsOnLine(editor, BREAKPOINT_LINE)); } catch (WaitTimeoutExpiredException e) { Assert.fail("Debugger hasn't stopped on breakpoint"); } }

Target:
public void testDebuggerStopsAtBreakpoint() throws CoreException, IOException { ProjectExplorer pe = new ProjectExplorer(); pe.open(); pe.getProject(OpenShiftResources.NODEJS_GIT_NAME).getProjectItem("server.js").open(); new WaitUntil(new EditorWithTitleIsActive("server.js")); TextEditor editor = new TextEditor("server.js"); setLineBreakpoint(editor, BREAKPOINT_LINE); triggerDebugSession(); try { new WaitUntil(new EditorWithTitleIsActive("server.js"), TimePeriod.LONG); new WaitUntil(new CursorPositionIsOnLine(editor, BREAKPOINT_LINE)); } catch (WaitTimeoutExpiredException e) { Assert.fail("Debugger hasn't stopped on breakpoint"); } }
Source:
public Iterator<Entry<Integer>> iterator(boolean sorted) { if (sorted) { throw new UnsupportedOperationException("sorted iterator is not supported yet"); } return new Iterator<Entry<Integer>>() { int cur = -1; boolean findNext = false; { cur = findNext(); } @Override public boolean hasNext() { if (findNext) { cur = findNext(); findNext = false; } return cur != -1; } private int findNext() { for (int i = cur + 1; i < cardinalityWithMissingValue; i++) { if (isUsedSlot(i)) { return i; } } return -1; } @Override public Entry<Integer> next() { if (cur == -1) { throw new NoSuchElementException(); } findNext = true; final Object[] values = new Object[aggregators.length]; final int recordOffset = cur * recordSize; for (int i = 0; i < aggregators.length; i++) { values[i] = aggregators[i].get(valBuffer, recordOffset + aggregatorOffsets[i]); } return new Entry<>(cur - 1, values); } }; }

Target:
public Iterator<Entry<Integer>> iterator(boolean sorted) { if (sorted) { throw new UnsupportedOperationException("sorted iterator is not supported yet"); } return new Iterator<Entry<Integer>>() { int cur = -1; boolean findNext = false; { cur = findNext(); } @Override public boolean hasNext() { if (findNext) { cur = findNext(); findNext = false; } return cur >= 0; } private int findNext() { for (int i = cur + 1; i < cardinalityWithMissingValue; i++) { if (isUsedSlot(i)) { return i; } } return -1; } @Override public Entry<Integer> next() { if (cur < 0) { throw new NoSuchElementException(); } findNext = true; final Object[] values = new Object[aggregators.length]; final int recordOffset = cur * recordSize; for (int i = 0; i < aggregators.length; i++) { values[i] = aggregators[i].get(valBuffer, recordOffset + aggregatorOffsets[i]); } return new Entry<>(cur - 1, values); } }; }
Source:
<V> void submitLocalResult(final LongKeyOperation<V> operation, final Map<Long, V> localOutput, final List<LongRange> failedRanges) { final int numRemainingSubOps = operation.commitResult(localOutput, failedRanges); if (!operation.isFromLocalClient()) { if (numRemainingSubOps == 0) { sendResultToOrigin(operation); } } else { try { if (!operation.waitOperation(TIMEOUT_MS)) { LOG.log(Level.SEVERE, "Operation timeout. OpId: {0}", operation.getOperationId()); } else { LOG.log(Level.FINE, "Operation successfully finished. OpId: {0}", operation.getOperationId()); } } catch (final InterruptedException e) { LOG.log(Level.SEVERE, "Interrupted while waiting for executing remote operation", e); } finally { deregisterOp(operation.getOperationId()); } } }

Target:
<V> void submitLocalResult(final LongKeyOperation<V> operation, final Map<Long, V> localOutput, final List<LongRange> failedRanges) { final int numRemainingSubOps = operation.commitResult(localOutput, failedRanges); LOG.log(Level.FINEST, "Local sub operation succeed. OpId: {0}, numRemainingSubOps: {1}", new Object[]{operation.getOperationId(), numRemainingSubOps}); if (!operation.isFromLocalClient()) { if (numRemainingSubOps == 0) { sendResultToOrigin(operation); } } else { try { if (!operation.waitOperation(TIMEOUT_MS)) { LOG.log(Level.SEVERE, "Operation timeout. OpId: {0}", operation.getOperationId()); } else { LOG.log(Level.FINE, "Operation successfully finished. OpId: {0}", operation.getOperationId()); } } catch (final InterruptedException e) { LOG.log(Level.SEVERE, "Interrupted while waiting for executing remote operation", e); } finally { deregisterOp(operation.getOperationId()); } } }
Source:
public void beforeCompletion() { int lastIndexProcessed = -1; Synchronization[] copiedPreJcaSyncs = (Synchronization[]) preJcaSyncs.toArray(new Synchronization[] {}); while ((lastIndexProcessed < preJcaSyncs.size() - 1)) { synchronized (preJcaSyncs) { if (copiedPreJcaSyncs.length != preJcaSyncs.size()) { copiedPreJcaSyncs = (Synchronization[]) preJcaSyncs.toArray(new Synchronization[] {}); } } lastIndexProcessed = lastIndexProcessed + 1; Synchronization preJcaSync = copiedPreJcaSyncs[lastIndexProcessed]; if (TransactionLogger.ROOT_LOGGER.isTraceEnabled()) { TransactionLogger.ROOT_LOGGER.trace("JCAOrderedLastSynchronizationList.preJcaSyncs.before_completion - Class: " + preJcaSync.getClass() + " HashCode: " + preJcaSync.hashCode() + " toString: " + preJcaSync); } preJcaSync.beforeCompletion(); } lastIndexProcessed = -1; Synchronization[] copiedJcaSyncs = (Synchronization[]) preJcaSyncs.toArray(new Synchronization[] {}); while ((lastIndexProcessed < preJcaSyncs.size() - 1)) { synchronized (preJcaSyncs) { if (copiedJcaSyncs.length != preJcaSyncs.size()) { copiedJcaSyncs = (Synchronization[]) preJcaSyncs.toArray(new Synchronization[] {}); } } lastIndexProcessed = lastIndexProcessed + 1; Synchronization jcaSync = copiedJcaSyncs[lastIndexProcessed]; if (TransactionLogger.ROOT_LOGGER.isTraceEnabled()) { TransactionLogger.ROOT_LOGGER.trace("JCAOrderedLastSynchronizationList.jcaSyncs.before_completion - Class: " + jcaSync.getClass() + " HashCode: " + jcaSync.hashCode() + " toString: " + jcaSync); } jcaSync.beforeCompletion(); } }

Target:
public void beforeCompletion() { int lastIndexProcessed = 0; while ((lastIndexProcessed < preJcaSyncs.size())) { Synchronization preJcaSync = preJcaSyncs.get(lastIndexProcessed); if (TransactionLogger.ROOT_LOGGER.isTraceEnabled()) { TransactionLogger.ROOT_LOGGER.trace("JCAOrderedLastSynchronizationList.preJcaSyncs.before_completion - Class: " + preJcaSync.getClass() + " HashCode: " + preJcaSync.hashCode() + " toString: " + preJcaSync); } preJcaSync.beforeCompletion(); lastIndexProcessed = lastIndexProcessed + 1; } lastIndexProcessed = 0; while ((lastIndexProcessed < jcaSyncs.size())) { Synchronization jcaSync = jcaSyncs.get(lastIndexProcessed); if (TransactionLogger.ROOT_LOGGER.isTraceEnabled()) { TransactionLogger.ROOT_LOGGER.trace("JCAOrderedLastSynchronizationList.jcaSyncs.before_completion - Class: " + jcaSync.getClass() + " HashCode: " + jcaSync.hashCode() + " toString: " + jcaSync); } jcaSync.beforeCompletion(); lastIndexProcessed = lastIndexProcessed + 1; } }
Source:
public File exportAsCSV(final int studyId, final int datasetId, final Set<Integer> instanceIds, final int collectionOrderId) { this.studyValidator.validate(studyId, false); this.datasetValidator.validateDataset(studyId, datasetId, false); final Study study = this.studyDataManager.getStudy(studyId); final DataSet dataSet = this.studyDataManager.getDataSet(datasetId); final List<StudyInstance> selectedDatasetInstances = getSelectedDatasetInstances(studyId, datasetId, instanceIds); try { return this.generateCSVFiles(study, dataSet, selectedDatasetInstances, collectionOrderId); } catch (final IOException e) { final BindingResult errors = new MapBindingResult(new HashMap<String, String>(), Integer.class.getName()); errors.reject("cannot.exportAsCSV.dataset", ""); throw new ResourceNotFoundException(errors.getAllErrors().get(0)); } }

Target:
public File exportAsCSV(final int studyId, final int datasetId, final Set<Integer> instanceIds, final int collectionOrderId) { this.studyValidator.validate(studyId, false); this.datasetValidator.validateDataset(studyId, datasetId, false); this.instanceValidator.validate(datasetId, instanceIds); final Study study = this.studyDataManager.getStudy(studyId); final DatasetDTO dataSet = this.datasetService.getDataset(studyId, datasetId); final List<StudyInstance> selectedDatasetInstances = getSelectedDatasetInstances(dataSet.getInstances(), instanceIds); try { return this.generateCSVFiles(study, dataSet, selectedDatasetInstances, collectionOrderId); } catch (final IOException e) { final BindingResult errors = new MapBindingResult(new HashMap<String, String>(), Integer.class.getName()); errors.reject("cannot.exportAsCSV.dataset", ""); throw new ResourceNotFoundException(errors.getAllErrors().get(0)); } }
Source:
public ProcessKillResponseDto killProcess(String workspaceId, int pid) throws ServerException { try { return requestFactory .fromUrl(serverEndpoint + "/" + pid) .useDeleteMethod() .addQueryParam("token", machineTokenProvider.getToken(workspaceId)) .setAuthorizationHeader("none") .request() .asDto(ProcessKillResponseDto.class); } catch (IOException | ConflictException | BadRequestException | UnauthorizedException | NotFoundException | MachineTokenException | ForbiddenException e) { throw new ServerException(e); } }

Target:
public ProcessKillResponseDto killProcess(String workspaceId, int pid) throws ServerException { try { return requestFactory .fromUrl(serverEndpoint + "/" + pid) .useDeleteMethod() .addQueryParam("token", machineTokenProvider.getToken(workspaceId)) .setAuthorizationHeader("none") .request() .asDto(ProcessKillResponseDto.class); } catch (IOException | ApiException | MachineTokenException e) { throw new ServerException(e); } }
Source:
private static void assertCanSetGridData(Button button) { Assert.isLegal(!DisposeUtils.isDisposed(button)); Assert.isLegal(button.getLayoutData() instanceof GridData, "Button " + button.getText() + " is not layouted with a GridLayout"); }

Target:
private static void assertCanSetGridData(Button button) { Assert.isLegal(!DisposeUtils.isDisposed(button), "Button is disposed"); Assert.isLegal(button.getLayoutData() instanceof GridData, "Button " + button.getText() + " is not layouted with a GridLayout"); }
Source:
public FileSystemConfiguration[] getConfigurations() { if (allConfigurations == null) { List<FileSystemConfiguration> result = new ArrayList<>(registeredContributions.size() + 1); result.add(defaultConfiguration); Iterator iterator = registeredContributions.iterator(); while (iterator.hasNext()) { FileSystemConfiguration configuration = (FileSystemConfiguration) iterator .next(); if (configuration != null) { result.add(configuration); } } allConfigurations = result.toArray(new FileSystemConfiguration[result.size()]); } return allConfigurations; }

Target:
public FileSystemConfiguration[] getConfigurations() { return Stream.concat(Stream.of(defaultConfiguration), registeredContributions.stream()) .toArray(FileSystemConfiguration[]::new); }
Source:
protected void init(ExpressionExecutor[] attributeExpressionExecutors, ExecutionPlanContext executionPlanContext) { if (attributeExpressionExecutors.length != 3) { throw new ExecutionPlanValidationException("Invalid no of arguments passed to ifThenElse() function, " + "required only 3, but found " + attributeExpressionExecutors.length); }else if(!attributeExpressionExecutors[0].getReturnType().equals(Attribute.Type.BOOL)){ throw new ExecutionPlanValidationException("Input type of ifThenElse function executor " + attributeExpressionExecutors[0].toString() + " should be of type BOOL. " + "Actual Type: " + attributeExpressionExecutors[0].getReturnType().toString()); }else if(!attributeExpressionExecutors[1].getReturnType().equals(attributeExpressionExecutors[2].getReturnType())){ throw new ExecutionPlanValidationException("Return type of ifThenElse function executor " + attributeExpressionExecutors[1].toString() + " and ifThenElse function executor" + attributeExpressionExecutors[2].toString() + "should be of equivalent type. Left executor: " + attributeExpressionExecutors[1].getReturnType() + " Right executor: " + attributeExpressionExecutors[2].getReturnType()); }else{ returnType = attributeExpressionExecutors[1].getReturnType(); } }

Target:
protected void init(ExpressionExecutor[] attributeExpressionExecutors, ExecutionPlanContext executionPlanContext) { if (attributeExpressionExecutors.length != 3) { throw new ExecutionPlanValidationException("Invalid no of arguments passed to ifThenElse() function, " + "required only 3, but found " + attributeExpressionExecutors.length); }else if(!attributeExpressionExecutors[0].getReturnType().equals(Attribute.Type.BOOL)){ throw new ExecutionPlanValidationException("Input type of if in ifThenElse function should be of type BOOL, but found " + attributeExpressionExecutors[0].getReturnType()); }else if(!attributeExpressionExecutors[1].getReturnType().equals(attributeExpressionExecutors[2].getReturnType())){ throw new ExecutionPlanValidationException("Input type of then in ifThenElse function and else in ifThenElse function should be of equivalent type. but found then type: " + attributeExpressionExecutors[1].getReturnType() + " and else type: " + attributeExpressionExecutors[2].getReturnType()); }else{ returnType = attributeExpressionExecutors[1].getReturnType(); } }
Source:
int unsafeCompareTo( Value other ) { ZonedDateTime that = ((DateTimeValue) other).value; int cmp = Long.compare( value.toEpochSecond(), that.toEpochSecond() ); if ( cmp == 0 ) { cmp = value.toLocalTime().getNano() - that.toLocalTime().getNano(); if ( cmp == 0 ) { cmp = value.toLocalDateTime().compareTo( that.toLocalDateTime() ); if ( cmp == 0 ) { ZoneId thisZone = value.getZone(); ZoneId thatZone = that.getZone(); if ( areDifferentZones( thisZone, thatZone ) ) { cmp = thisZone.getId().compareTo( thatZone.getId() ); } if ( cmp == 0 ) { cmp = value.getChronology().compareTo( that.getChronology() ); } } } } return cmp; }

Target:
int unsafeCompareTo( Value other ) { ZonedDateTime that = ((DateTimeValue) other).value; int cmp = Long.compare( value.toEpochSecond(), that.toEpochSecond() ); if ( cmp == 0 ) { cmp = value.toLocalTime().getNano() - that.toLocalTime().getNano(); if ( cmp == 0 ) { cmp = value.toLocalDateTime().compareTo( that.toLocalDateTime() ); if ( cmp == 0 ) { ZoneId thisZone = value.getZone(); ZoneId thatZone = that.getZone(); boolean thisIsOffset = thisZone instanceof ZoneOffset; boolean thatIsOffset = thatZone instanceof ZoneOffset; cmp = Boolean.compare( thatIsOffset, thisIsOffset ); if ( cmp == 0 && areDifferentZones( thisZone, thatZone ) ) { cmp = thisZone.getId().compareTo( thatZone.getId() ); } if ( cmp == 0 ) { cmp = value.getChronology().compareTo( that.getChronology() ); } } } } return cmp; }
Source:
public Double getRowCount(Union rel, RelMetadataQuery mq) { return rel.estimateRowCount(mq); }

Target:
public Double getRowCount(Union rel, RelMetadataQuery mq) { double rowCount = 0.0; for (RelNode input : rel.getInputs()) { Double partialRowCount = mq.getRowCount(input); if (partialRowCount == null) { return null; } rowCount += partialRowCount; } if (!rel.all) { rowCount *= 0.5; } return rowCount; }
Source:
public IdToken idTokenWithAudience(String targetAudience, List<IdTokenProvider.Option> options) throws IOException { JsonFactory jsonFactory = OAuth2Utils.JSON_FACTORY; long currentTime = clock.currentTimeMillis(); String assertion = createAssertionForIdToken( jsonFactory, currentTime, tokenServerUri.toString(), targetAudience); GenericData tokenRequest = new GenericData(); tokenRequest.set("grant_type", GRANT_TYPE); tokenRequest.set("assertion", assertion); UrlEncodedContent content = new UrlEncodedContent(tokenRequest); HttpRequestFactory requestFactory = transportFactory.create().createRequestFactory(); HttpRequest request = requestFactory.buildPostRequest(new GenericUrl(tokenServerUri), content); request.setParser(new JsonObjectParser(jsonFactory)); HttpResponse response; response = request.execute(); GenericData responseData = response.parseAs(GenericData.class); String rawToken = OAuth2Utils.validateString(responseData, "id_token", PARSE_ERROR_PREFIX); JsonWebSignature jws = JsonWebSignature.parse(OAuth2Utils.JSON_FACTORY, rawToken); return new IdToken(rawToken, jws); }

Target:
public IdToken idTokenWithAudience(String targetAudience, List<IdTokenProvider.Option> options) throws IOException { JsonFactory jsonFactory = OAuth2Utils.JSON_FACTORY; long currentTime = clock.currentTimeMillis(); String assertion = createAssertionForIdToken( jsonFactory, currentTime, tokenServerUri.toString(), targetAudience); GenericData tokenRequest = new GenericData(); tokenRequest.set("grant_type", GRANT_TYPE); tokenRequest.set("assertion", assertion); UrlEncodedContent content = new UrlEncodedContent(tokenRequest); HttpRequestFactory requestFactory = transportFactory.create().createRequestFactory(); HttpRequest request = requestFactory.buildPostRequest(new GenericUrl(tokenServerUri), content); request.setParser(new JsonObjectParser(jsonFactory)); HttpResponse response = request.execute(); GenericData responseData = response.parseAs(GenericData.class); String rawToken = OAuth2Utils.validateString(responseData, "id_token", PARSE_ERROR_PREFIX); return IdToken.create(rawToken); }
Source:
default void onShutdown() { throw new AssertionError("deprecated API, should not be invoked"); }

Target:
default void onShutdown() { throw new UnsupportedOperationException("deprecated API, should not be invoked"); }
Source:
public ResponseEntity<?> commitCursors(@PathVariable("subscriptionId") final String subscriptionId, @Valid @RequestBody final ItemsWrapper<SubscriptionCursor> cursorsIn, @NotNull @RequestHeader("X-Nakadi-StreamId") final String streamId, final HttpServletRequest request, final Client client) throws NoSuchEventTypeException, NoSuchSubscriptionException, InvalidCursorException, ServiceTemporarilyUnavailableException, InternalNakadiException { final List<NakadiCursor> cursors = convertToNakadiCursors(cursorsIn); if (cursors.isEmpty()) { throw new CursorsAreEmptyException(); } final Span commitSpan = TracingService.activateSpan(request, false) .setOperationName("commit_events"); if (blacklistService.isSubscriptionConsumptionBlocked(subscriptionId, client.getClientId())) { TracingService.logErrorInSpan(commitSpan, "Application or subscription is blocked"); throw new BlockedException("Application or subscription is blocked"); } final List<Boolean> items = cursorsService.commitCursors(streamId, subscriptionId, cursors, commitSpan); final boolean allCommitted = items.stream().allMatch(item -> item); if (allCommitted) { return noContent().build(); } else { final List<CursorCommitResult> body = IntStream.range(0, cursorsIn.getItems().size()) .mapToObj(idx -> new CursorCommitResult(cursorsIn.getItems().get(idx), items.get(idx))) .collect(Collectors.toList()); return ok(new ItemsWrapper<>(body)); } }

Target:
public ResponseEntity<?> commitCursors(@PathVariable("subscriptionId") final String subscriptionId, @Valid @RequestBody final ItemsWrapper<SubscriptionCursor> cursorsIn, @NotNull @RequestHeader("X-Nakadi-StreamId") final String streamId, final HttpServletRequest request, final Client client) throws NoSuchEventTypeException, NoSuchSubscriptionException, InvalidCursorException, ServiceTemporarilyUnavailableException, InternalNakadiException { final List<NakadiCursor> cursors = convertToNakadiCursors(cursorsIn); if (cursors.isEmpty()) { throw new CursorsAreEmptyException(); } final Span commitSpan = TracingService.extractSpan(request, "commit_events"); if (blacklistService.isSubscriptionConsumptionBlocked(subscriptionId, client.getClientId())) { TracingService.logErrorInSpan(commitSpan, "Application or subscription is blocked"); throw new BlockedException("Application or subscription is blocked"); } final List<Boolean> items = cursorsService.commitCursors(streamId, subscriptionId, cursors, commitSpan); final boolean allCommitted = items.stream().allMatch(item -> item); if (allCommitted) { return noContent().build(); } else { final List<CursorCommitResult> body = IntStream.range(0, cursorsIn.getItems().size()) .mapToObj(idx -> new CursorCommitResult(cursorsIn.getItems().get(idx), items.get(idx))) .collect(Collectors.toList()); return ok(new ItemsWrapper<>(body)); } }
Source:
public void toArchivedFlownodeInstance_should_convert_reachStateDate_for_gateways() throws Exception { final FlowNodeStateManager flowNodeStateManager = mock(FlowNodeStateManager.class); doReturn(mock(FlowNodeState.class)).when(flowNodeStateManager).getState(anyInt()); assertThat(ModelConvertor.toArchivedFlowNodeInstance(new SAGatewayInstanceImpl(), flowNodeStateManager).getReachedStateDate()).isNotNull(); }

Target:
public void toArchivedFlownodeInstance_should_convert_reachStateDate_for_gateways() throws Exception { final FlowNodeStateManager flowNodeStateManager = mock(FlowNodeStateManager.class); doReturn(mock(FlowNodeState.class)).when(flowNodeStateManager).getState(anyInt()); final SAGatewayInstanceImpl saFlowNode = new SAGatewayInstanceImpl(); final long reachedStateDate = 4534311114L; saFlowNode.setReachedStateDate(reachedStateDate); assertThat(ModelConvertor.toArchivedFlowNodeInstance(saFlowNode, flowNodeStateManager).getReachedStateDate()).isEqualTo(new Date(reachedStateDate)); }
Source:
public void testClusteredCacheWithXA() throws Exception { TransactionManagerServices.getConfiguration().setJournal("null"); BitronixTransactionManager transactionManager = TransactionManagerServices.getTransactionManager(); try { CacheManagerBuilder.newCacheManagerBuilder() .using(new LookupTransactionManagerProviderConfiguration(BitronixTransactionManagerLookup.class)) .with(ClusteringServiceConfigurationBuilder.cluster(URI.create("terracotta://localhost/my-application")).autoCreate(c -> c)) .withCache("xaCache", CacheConfigurationBuilder.newCacheConfigurationBuilder(Long.class, String.class, ResourcePoolsBuilder.newResourcePoolsBuilder() .with(ClusteredResourcePoolBuilder.clusteredDedicated("primary-server-resource", 8, MemoryUnit.MB)) ) .withService(new XAStoreConfiguration("xaCache")) .build() ) .build(true).close(); } catch (StateTransitionException e) { assertThat(e.getCause().getCause().getMessage(), is("Unsupported resource type : interface org.ehcache.clustered.client.config.DedicatedClusteredResourcePool")); } transactionManager.shutdown(); }

Target:
public void testClusteredCacheWithXA() throws Exception { TransactionManagerServices.getConfiguration().setJournal("null"); BitronixTransactionManager transactionManager = TransactionManagerServices.getTransactionManager(); try { CacheManagerBuilder.newCacheManagerBuilder() .using(new LookupTransactionManagerProviderConfiguration(BitronixTransactionManagerLookup.class)) .with(ClusteringServiceConfigurationBuilder.cluster(URI.create("terracotta://localhost/my-application")).autoCreate(c -> c)) .withCache("xaCache", CacheConfigurationBuilder.newCacheConfigurationBuilder(Long.class, String.class, ResourcePoolsBuilder.newResourcePoolsBuilder() .with(ClusteredResourcePoolBuilder.clusteredDedicated("primary-server-resource", 8, MemoryUnit.MB)) ) .withService(new XAStoreConfiguration("xaCache")) .build() ) .build(true).close(); fail("Expected StateTransitionException"); } catch (StateTransitionException e) { assertThat(e.getCause().getCause().getMessage(), is("Unsupported resource type : interface org.ehcache.clustered.client.config.DedicatedClusteredResourcePool")); } transactionManager.shutdown(); }
Source:
private static int buildHashCode(ConstraintLocation delegate, TypeVariable<?> typeParameter) { int result = delegate != null ? delegate.hashCode() : 0; result = 31 * result + typeParameter.hashCode(); return result; }

Target:
private static int buildHashCode(ConstraintLocation delegate, TypeVariable<?> typeParameter) { int result = delegate.hashCode(); result = 31 * result + typeParameter.hashCode(); return result; }
Source:
public void testIndexStateOnException() throws Exception { if (localIndex || useSnapshot || useViewIndex) { return; } String schemaName = generateUniqueName(); String dataTableName = generateUniqueName(); String dataTableFullName = SchemaUtil.getTableName(schemaName, dataTableName); String indexTableName = generateUniqueName(); String indexFullName = SchemaUtil.getTableName(schemaName, indexTableName); Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES); try (Connection conn = DriverManager.getConnection(getUrl(), props)){ Statement stmt = conn.createStatement(); stmt.execute(String.format( "CREATE TABLE %s (ID INTEGER NOT NULL PRIMARY KEY, NAME VARCHAR, ZIP INTEGER) %s", dataTableFullName, tableDDLOptions)); stmt.execute(String.format( "UPSERT INTO %s VALUES(1, 'Phoenix', 12345)", dataTableFullName)); conn.commit(); IndexRegionObserver.setIgnoreIndexRebuildForTesting(true); stmt.execute(String.format( "CREATE INDEX %s ON %s (NAME) INCLUDE (ZIP) ASYNC", indexTableName, dataTableFullName)); assertFalse(checkIndexState(conn, indexFullName, PIndexState.ACTIVE, 0L)); IndexToolIT.runIndexTool(true, false, schemaName, dataTableName, indexTableName, null, -1, IndexTool.IndexVerifyType.AFTER); IndexRegionObserver.setIgnoreIndexRebuildForTesting(false); assertFalse(checkIndexState(conn, indexFullName, PIndexState.ACTIVE, 0L)); } }

Target:
public void testIndexStateOnException() throws Exception { if (localIndex || useSnapshot || useViewIndex) { return; } String schemaName = generateUniqueName(); String dataTableName = generateUniqueName(); String dataTableFullName = SchemaUtil.getTableName(schemaName, dataTableName); String indexTableName = generateUniqueName(); String indexFullName = SchemaUtil.getTableName(schemaName, indexTableName); Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES); try (Connection conn = DriverManager.getConnection(getUrl(), props)){ Statement stmt = conn.createStatement(); stmt.execute(String.format( "CREATE TABLE %s (ID INTEGER NOT NULL PRIMARY KEY, NAME VARCHAR, ZIP INTEGER) %s", dataTableFullName, tableDDLOptions)); stmt.execute(String.format( "UPSERT INTO %s VALUES(1, 'Phoenix', 12345)", dataTableFullName)); conn.commit(); IndexRegionObserver.setIgnoreIndexRebuildForTesting(true); stmt.execute(String.format( "CREATE INDEX %s ON %s (NAME) INCLUDE (ZIP) ASYNC", indexTableName, dataTableFullName)); assertFalse(checkIndexState(conn, indexFullName, PIndexState.ACTIVE, 0L)); IndexToolIT.runIndexTool(true, false, schemaName, dataTableName, indexTableName, null, -1, IndexTool.IndexVerifyType.AFTER); IndexRegionObserver.setIgnoreIndexRebuildForTesting(false); assertFalse(checkIndexState(conn, indexFullName, PIndexState.ACTIVE, 0L)); IndexToolIT.runIndexTool(true, false, schemaName, dataTableName, indexTableName, null, 0, IndexTool.IndexVerifyType.AFTER); assertTrue(checkIndexState(conn, indexFullName, PIndexState.ACTIVE, 0L)); } }
Source:
private byte[] inflateAndReturn(final Source src, final long inflatedSize) throws IOException { ByteArrayOutputStream byteArrayOutputStream=new ByteArrayOutputStream((int)inflatedSize); inflate(src, inflatedSize, byteArrayOutputStream ); return byteArrayOutputStream.toByteArray(); }

Target:
private byte[] inflateAndReturn(final Source src, final long inflatedSize) throws IOException { final byte[] dst = new byte[(int) inflatedSize]; final InputStream inf = inflate(src, inflatedSize); IO.readFully(inf, dst, 0, dst.length); inf.close(); return dst; }
Source:
protected void registerRuntime(Runtime runtime) { try { runtimeManager.registerRuntime(runtime); StartupServiceUtils.updateServiceCache("carbon-runtime-mgt", Runtime.class, runtime); } catch (Exception e) { logger.error("Error while adding runtime to the Runtime manager", e); } }

Target:
protected void registerRuntime(Runtime runtime) { try { runtimeManager.registerRuntime(runtime); StartupServiceUtils.updateServiceCache(COMPONENT_NAME, Runtime.class); } catch (Exception e) { logger.error("Error while adding runtime to the Runtime manager", e); } }
Source:
public String addJob(JobModel job, String processId) throws RegistryException { CompositeIdentifier cis = new CompositeIdentifier(job.getTaskId(), job.getJobId()); String jobId = saveJobModelData(job, cis); String taskId = (String) cis.getTopLevelIdentifier(); job.setProcessId(processId); job.setTaskId(taskId); TaskRepository taskRepository = new TaskRepository(); TaskModel taskModel = taskRepository.getTask(taskId); List<JobModel> jobModelList = taskModel.getJobs(); if (jobModelList != null && !jobModelList.contains(job)) { logger.debug("Adding the Job to the list"); jobModelList.add(job); taskModel.setJobs(jobModelList); taskRepository.updateTask(taskModel, taskId); } return jobId; }

Target:
public String addJob(JobModel job, String processId) throws RegistryException { JobPK jobPK = new JobPK(); jobPK.setJobId(job.getJobId()); jobPK.setTaskId(job.getTaskId()); String jobId = saveJobModelData(job, jobPK); return jobId; }
Source:
private void addRange() { if (mHandler == null) { mHandler = new Handler(); } final boolean isSeekBar = FORMAT_ACTION.equals(mRangeItem.getFormat()); final ProgressBar progressBar = isSeekBar ? new SeekBar(getContext()) : new ProgressBar(getContext(), null, android.R.attr.progressBarStyleHorizontal); Drawable progressDrawable = DrawableCompat.wrap(progressBar.getProgressDrawable()); if (mTintColor != -1 && progressDrawable != null) { DrawableCompat.setTint(progressDrawable, mTintColor); progressBar.setProgressDrawable(progressDrawable); } progressBar.setMax(mRangeMaxValue - mRangeMinValue); progressBar.setProgress(mRangeValue); progressBar.setVisibility(View.VISIBLE); if (mStartItem == null) { addView(progressBar); } else { LayoutParams lp = new LayoutParams( ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT); lp.setMargins(0, dpToPixel(SEEKBAR_MARGIN_TOP), 0, 0); progressBar.setPadding(dpToPixel(SEEKBAR_PADDING_LEFT), progressBar.getPaddingTop(), progressBar.getPaddingRight(), progressBar.getPaddingBottom()); mSubContent.addView(progressBar, 0, lp); } mRangeBar = progressBar; if (isSeekBar) { SliceItem thumb = mRowContent.getInputRangeThumb(); SeekBar seekBar = (SeekBar) mRangeBar; if (thumb != null && thumb.getIcon() != null) { Drawable d = thumb.getIcon().loadDrawable(getContext()); if (d != null) { seekBar.setThumb(d); } } Drawable thumbDrawable = DrawableCompat.wrap(seekBar.getThumb()); if (mTintColor != -1 && thumbDrawable != null) { DrawableCompat.setTint(thumbDrawable, mTintColor); seekBar.setThumb(thumbDrawable); } seekBar.setOnSeekBarChangeListener(mSeekBarChangeListener); } }

Target:
private void addRange() { if (mHandler == null) { mHandler = new Handler(); } final boolean isSeekBar = FORMAT_ACTION.equals(mRangeItem.getFormat()); final boolean renderInNewLine = mStartItem == null; final ProgressBar progressBar = isSeekBar ? (renderInNewLine ? new SeekBar(getContext()) : (SeekBar) LayoutInflater.from(getContext()).inflate(R.layout.abc_slice_seekbar_view, this, false)) : new ProgressBar(getContext(), null, android.R.attr.progressBarStyleHorizontal); Drawable progressDrawable = DrawableCompat.wrap(progressBar.getProgressDrawable()); if (mTintColor != -1 && progressDrawable != null) { DrawableCompat.setTint(progressDrawable, mTintColor); progressBar.setProgressDrawable(progressDrawable); } progressBar.setMax(mRangeMaxValue - mRangeMinValue); progressBar.setProgress(mRangeValue); progressBar.setVisibility(View.VISIBLE); if (mStartItem == null) { addView(progressBar); } else { mSubContent.setVisibility(GONE); mContent.addView(progressBar, 1); } mRangeBar = progressBar; if (isSeekBar) { SliceItem thumb = mRowContent.getInputRangeThumb(); SeekBar seekBar = (SeekBar) mRangeBar; if (thumb != null && thumb.getIcon() != null) { Drawable d = thumb.getIcon().loadDrawable(getContext()); if (d != null) { seekBar.setThumb(d); } } Drawable thumbDrawable = DrawableCompat.wrap(seekBar.getThumb()); if (mTintColor != -1 && thumbDrawable != null) { DrawableCompat.setTint(thumbDrawable, mTintColor); seekBar.setThumb(thumbDrawable); } seekBar.setOnSeekBarChangeListener(mSeekBarChangeListener); } }
Source:
public static double greatCircleDistance(@SqlType(StandardTypes.DOUBLE) double latitude1, @SqlType(StandardTypes.DOUBLE) double longitude1, @SqlType(StandardTypes.DOUBLE) double latitude2, @SqlType(StandardTypes.DOUBLE) double longitude2) { checkLatitude(latitude1); checkLongitude(longitude1); checkLatitude(latitude2); checkLongitude(longitude2); latitude1 = Math.toRadians(latitude1); longitude1 = Math.toRadians(longitude1); latitude2 = Math.toRadians(latitude2); longitude2 = Math.toRadians(longitude2); double deltaLongitude = longitude1 - longitude2; double t1 = Math.cos(latitude2) * Math.sin(deltaLongitude); double t2 = Math.cos(latitude1) * Math.sin(latitude2) - Math.sin(latitude1) * Math.cos(latitude2) * Math.cos(deltaLongitude); double t3 = Math.sin(latitude1) * Math.sin(latitude2) + Math.cos(latitude1) * Math.cos(latitude2) * Math.cos(deltaLongitude); double angularDistance = Math.atan2(Math.sqrt(t1 * t1 + t2 * t2), t3); return angularDistance * EARTH_RADIUS_KM; }

Target:
public static double greatCircleDistance( @SqlType(StandardTypes.DOUBLE) double latitude1, @SqlType(StandardTypes.DOUBLE) double longitude1, @SqlType(StandardTypes.DOUBLE) double latitude2, @SqlType(StandardTypes.DOUBLE) double longitude2) { checkLatitude(latitude1); checkLongitude(longitude1); checkLatitude(latitude2); checkLongitude(longitude2); double radianLatitude1 = toRadians(latitude1); double radianLatitude2 = toRadians(latitude2); double sin1 = sin(radianLatitude1); double cos1 = cos(radianLatitude1); double sin2 = sin(radianLatitude2); double cos2 = cos(radianLatitude2); double deltaLongitude = toRadians(longitude1) - toRadians(longitude2); double cosDeltaLongitude = cos(deltaLongitude); double t1 = cos2 * sin(deltaLongitude); double t2 = cos1 * sin2 - sin1 * cos2 * cosDeltaLongitude; double t3 = sin1 * sin2 + cos1 * cos2 * cosDeltaLongitude; return atan2(sqrt(t1 * t1 + t2 * t2), t3) * EARTH_RADIUS_KM; }
Source:
private boolean servicesAreBeingProvided(PaymentWorksVendor pmwVendor) { return (StringUtils.isNotBlank(pmwVendor.getServicesProvided()) && (StringUtils.equalsIgnoreCase(pmwVendor.getServicesProvided(), PaymentWorksConstants.PaymentWorksGoodsVsServicesOptions.SERVICES.getOptionValueAsString()) | StringUtils.equalsIgnoreCase(pmwVendor.getServicesProvided(), PaymentWorksConstants.PaymentWorksGoodsVsServicesOptions.GOODS_WITH_SERVICES.getOptionValueAsString()))); }

Target:
private boolean servicesAreBeingProvided(PaymentWorksVendor pmwVendor) { return (StringUtils.isNotBlank(pmwVendor.getServicesProvided()) && (StringUtils.equalsIgnoreCase(pmwVendor.getServicesProvided(), PaymentWorksConstants.PaymentWorksGoodsVsServicesOptions.SERVICES.getOptionValueAsString()) || StringUtils.equalsIgnoreCase(pmwVendor.getServicesProvided(), PaymentWorksConstants.PaymentWorksGoodsVsServicesOptions.GOODS_WITH_SERVICES.getOptionValueAsString()))); }
Source:
public void accept(T value) { Lock lock = this.lock.writeLock(); lock.lock(); try { this.value = value; } finally { lock.unlock(); } }

Target:
public synchronized void accept(T value) { this.value = value; }
Source:
public void mayProceed() throws InsufficientPermissionException { locale = LocaleResolver.getLocale(request); if (ub.isSysAdmin()) { return; } if (!currentRole.getRole().equals(Role.RESEARCHASSISTANT)) { return; } if (!currentRole.getRole().equals(Role.RESEARCHASSISTANT2)) { return; } addPageMessage(respage.getString("no_have_correct_privilege_current_study") + respage.getString("change_study_contact_sysadmin")); throw new InsufficientPermissionException(Page.MENU, resexception.getString("not_allowed_access_extract_data_servlet"), "1"); }

Target:
public void mayProceed() throws InsufficientPermissionException { locale = LocaleResolver.getLocale(request); if (ub.isSysAdmin()) { return; } if (!( currentRole.getRole().equals(Role.RESEARCHASSISTANT) || currentRole.getRole().equals(Role.RESEARCHASSISTANT2) ) ) { return; } addPageMessage(respage.getString("no_have_correct_privilege_current_study") + respage.getString("change_study_contact_sysadmin")); throw new InsufficientPermissionException(Page.MENU, resexception.getString("not_allowed_access_extract_data_servlet"), "1"); }
Source:
public Object apply(AccountResource rsrc, Input input) throws AuthException, MethodNotAllowedException, ResourceNotFoundException, OrmException { if (!self.get().equals(rsrc.getUser()) && !self.get().getCapabilities().canAdministrateServer()) { throw new AuthException("not allowed to change name"); } if (!realm.allowsEdit(FieldName.FULL_NAME)) { throw new MethodNotAllowedException("The realm doesn't allow editing names"); } if (input == null) { input = new Input(); } Account a = dbProvider.get().accounts().get(rsrc.getUser().getAccountId()); if (a == null) { throw new ResourceNotFoundException("No such account: " + rsrc.getUser().getAccountId()); } a.setFullName(input.name); dbProvider.get().accounts().update(Collections.singleton(a)); byIdCache.evict(a.getId()); return Strings.isNullOrEmpty(a.getFullName()) ? Response.none() : a.getFullName(); }

Target:
public Object apply(AccountResource rsrc, Input input) throws AuthException, MethodNotAllowedException, ResourceNotFoundException, OrmException { IdentifiedUser s = (IdentifiedUser) self.get(); if (s.getAccountId().get() != rsrc.getUser().getAccountId().get() && !self.get().getCapabilities().canAdministrateServer()) { throw new AuthException("not allowed to change name"); } if (!realm.allowsEdit(FieldName.FULL_NAME)) { throw new MethodNotAllowedException("The realm doesn't allow editing names"); } if (input == null) { input = new Input(); } Account a = dbProvider.get().accounts().get(rsrc.getUser().getAccountId()); if (a == null) { throw new ResourceNotFoundException("No such account: " + rsrc.getUser().getAccountId()); } a.setFullName(input.name); dbProvider.get().accounts().update(Collections.singleton(a)); byIdCache.evict(a.getId()); return Strings.isNullOrEmpty(a.getFullName()) ? Response.none() : a.getFullName(); }
Source:
public void onActivityResult(int requestCode, int resultCode, Intent intent) { if (resultCode != -1) { Log.e(TAG, "Error getting geocoding results"); return; } Place place = PlaceAutocomplete.getPlace(getActivity(), intent); if (requestCode == FROM_ADDRESS_GEOCODE) { fromAddress = new CustomAddress(); builder.setFrom(fromAddress); handlePlaceResult(place, fromAddress, fromAddressTextArea); } else if (requestCode == TO_ADDRESS_GEOCODE) { toAddress = new CustomAddress(); builder.setTo(toAddress); handlePlaceResult(place, toAddress, toAddressTextArea); } }

Target:
public void onActivityResult(int requestCode, int resultCode, Intent intent) { if (resultCode != -1) { Log.e(TAG, "Error getting geocoding results"); return; } CustomAddress address = ProprietaryMapHelpV2.getCustomAddressFromPlacesIntent(Application.get().getApplicationContext(), intent); if (requestCode == USE_FROM_ADDRESS) { mFromAddress = address; mBuilder.setFrom(mFromAddress); mFromAddressTextArea.setText(mFromAddress.toString()); } else if (requestCode == USE_TO_ADDRESS) { mToAddress = address; mBuilder.setTo(mToAddress); mToAddressTextArea.setText(mToAddress.toString()); } checkRequestAndSubmit(); }
Source:
public void currentThreadInterruptStatusIsClearedAfterSuiteExecution() { core.addListener(new RunListener() { @Override public void testSuiteFinished(Description description) { interruptedFlags.add(Thread.currentThread().isInterrupted()); } }); Request request = new Request() { @Override public Runner getRunner() { try { return new BlockJUnit4ClassRunner(TestWithInterruptFromAfterClass.class) { }; } catch (InitializationError e) { return new ErrorReportingRunner(TestWithInterruptFromAfterClass.class, e); } } }; Result result = core.run(request); assertEquals(0, result.getFailureCount()); assertEquals(singletonList(false), interruptedFlags); }

Target:
public void currentThreadInterruptStatusIsClearedAfterSuiteExecution() { core.addListener(new RunListener() { @Override public void testSuiteFinished(Description description) { interruptedFlags.add(Thread.currentThread().isInterrupted()); } }); Request request = Request.aClass(TestWithInterruptFromAfterClass.class); Result result = core.run(request); assertEquals(0, result.getFailureCount()); assertEquals(singletonList(false), interruptedFlags); }
Source:
public String getDescription() { return "Dropping an Association to generate a DestroyLinkAction"; }

Target:
public String getDescription() { return Messages.AssociationToDestroyLinkActionDropStrategy_Description; }
Source:
protected void update() { this.view.clear(); this.hideEmptyState(); int offset = getOffset(); this.resolveAssetsCount(); this.getAssets(this.filter, this.filterType, offset, this.currentPage * this.pageSize, this::addAssetsToView); this.view.setCurrentPage(this.currentPage); this.checkPaginationButtons(); }

Target:
protected void update() { this.view.clear(); this.hideEmptyState(); this.resolveAssetsCount(); this.getAssets(this.filter, this.filterType, getOffset(), this.currentPage * this.pageSize, this::addAssetsToView); this.view.setCurrentPage(this.currentPage); this.checkPaginationButtons(); }
Source:
private String setParameter(HttpMessage msg, NameValuePair originalPair, String name, String value, boolean escaped) { try { URI uri = msg.getRequestHeader().getURI(); String[] paths = msg.getRequestHeader().getURI().getPath().toString().split("/"); if (originalPair.getPosition() < paths.length) { String encodedValue = (escaped) ? value : getEscapedValue(value); paths[originalPair.getPosition()] = encodedValue; String path = StringUtils.join(paths, "/"); try { uri.setEscapedPath(path); } catch (URIException e) { uri.setPath(path); } } } catch (URIException e) { LOGGER.error(e.getMessage(), e); } return value; }

Target:
private String setParameter(HttpMessage msg, NameValuePair originalPair, String name, String value, boolean escaped) { URI uri = msg.getRequestHeader().getURI(); String[] paths = uri.getEscapedPath().split("/"); if (originalPair.getPosition() < paths.length) { String encodedValue = (escaped) ? value : getEscapedValue(value); paths[originalPair.getPosition()] = encodedValue; String path = String.join("/", paths); try { uri.setEscapedPath(path); } catch (URIException e) { try { uri.setPath(path); } catch (URIException e1) { LOGGER.debug(e1.getMessage(), e1); } LOGGER.warn(e.getMessage(), e); } } return value; }
Source:
public void testInequalityWithNull() { SourceProcessingDetails sourceProcessingDetails = new SourceProcessingDetailsImpl(); assertThat(sourceProcessingDetails.equals(null), is(false)); }

Target:
public void testInequalityWithNull() { SourceProcessingDetails sourceProcessingDetails = new SourceProcessingDetailsImpl(Collections.singletonList("")); assertThat(sourceProcessingDetails.equals(null), is(false)); }