auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private <K, V> JsrCacheLoaderWriter<K, V> initCacheLoaderWriter(CompleteConfiguration<K, V> config, MultiCacheException mce) { Factory<CacheLoader<K, V>> cacheLoaderFactory = config.getCacheLoaderFactory(); Factory<CacheWriter<K, V>> cacheWriterFactory = getCacheWriterFactory(config); if (config.isReadThrough() && cacheLoaderFactory == null) { throw new IllegalArgumentException("read-through enabled without a CacheLoader factory provided"); } if (config.isWriteThrough() && cacheWriterFactory == null) { throw new IllegalArgumentException("write-through enabled without a CacheWriter factory provided"); } CacheLoader<K, V> cacheLoader = cacheLoaderFactory == null ? null : cacheLoaderFactory.create(); CacheWriter<K, V> cacheWriter; try { cacheWriter = cacheWriterFactory == null ? null : cacheWriterFactory.create(); } catch (Throwable t) { if (t != mce) { mce.addThrowable(t); } CacheResources.close(cacheLoader, mce); throw mce; } if (cacheLoader == null && cacheWriter == null) { return null; } else { return new Eh107CacheLoaderWriter<K, V>(cacheLoader, config.isReadThrough(), cacheWriter, config.isWriteThrough()); } }

Target:
private <K, V> Jsr107CacheLoaderWriter<K, V> initCacheLoaderWriter(CompleteConfiguration<K, V> config, MultiCacheException mce) { Factory<CacheLoader<K, V>> cacheLoaderFactory = config.getCacheLoaderFactory(); @SuppressWarnings("unchecked") Factory<CacheWriter<K, V>> cacheWriterFactory = (Factory<CacheWriter<K, V>>) (Object) config.getCacheWriterFactory(); if (config.isReadThrough() && cacheLoaderFactory == null) { throw new IllegalArgumentException("read-through enabled without a CacheLoader factory provided"); } if (config.isWriteThrough() && cacheWriterFactory == null) { throw new IllegalArgumentException("write-through enabled without a CacheWriter factory provided"); } CacheLoader<K, V> cacheLoader = cacheLoaderFactory == null ? null : cacheLoaderFactory.create(); CacheWriter<K, V> cacheWriter; try { cacheWriter = cacheWriterFactory == null ? null : cacheWriterFactory.create(); } catch (Throwable t) { if (t != mce) { mce.addThrowable(t); } CacheResources.close(cacheLoader, mce); throw mce; } if (cacheLoader == null && cacheWriter == null) { return null; } else { return new Eh107CacheLoaderWriter<K, V>(cacheLoader, config.isReadThrough(), cacheWriter, config.isWriteThrough()); } }
Source:
public String getName() { WebElement nameCell = getDaemonRowElement().findElements(By.xpath("./td[1]")).get(0); Assert.assertThat(nameCell.isDisplayed(), is(true)); Assert.assertThat(nameCell.isEnabled(), is(true)); return nameCell.getText(); }

Target:
public String getName() { WebElement nameCell = getDaemonRowElement().findElement(By.xpath("./td[1]")); Assert.assertThat(nameCell.isDisplayed(), is(true)); Assert.assertThat(nameCell.isEnabled(), is(true)); return nameCell.getText(); }
Source:
private String getErrorSubMessage(ValidationEvent validationError) { String eventMessage = getErrorEventMessage(validationError); LOG.warn("getErrorSubMessage: Detected validation error when parsing XML document: " + eventMessage); Matcher matcher = EXCEPTION_MESSAGE_PATTERN.matcher(eventMessage); if (!matcher.matches()) { return eventMessage; } String exceptionClassname = matcher.group(EXCEPTION_CLASSNAME_GROUP); if (StringUtils.isBlank(exceptionClassname)) { throw new IllegalStateException( "Pattern matched message but it does not contain exception classname; this should NEVER happen!"); } String subMessage; String detailMessage = matcher.group(DETAIL_MESSAGE_GROUP); if (StringUtils.isNotBlank(detailMessage)) { subMessage = detailMessage; } else if (StringUtils.equals(NumberFormatException.class.getName(), exceptionClassname)) { subMessage = getStringProperty(CuFPKeyConstants.ERROR_CREATE_ACCOUNTING_DOCUMENT_GENERIC_NUMERIC_ERROR); } else { subMessage = getStringProperty(CuFPKeyConstants.ERROR_CREATE_ACCOUNTING_DOCUMENT_GENERIC_ERROR); } return subMessage; }

Target:
private String getErrorSubMessage(ValidationEvent validationError) { String eventMessage = getErrorEventMessage(validationError); LOG.warn("getErrorSubMessage: Detected validation error when parsing XML document: " + eventMessage); Matcher matcher = exceptionMessagePattern.matcher(eventMessage); if (!matcher.matches()) { return eventMessage; } String detailMessage = matcher.group(DETAIL_MESSAGE_GROUP); String exceptionClassname = matcher.group(EXCEPTION_CLASSNAME_GROUP); if (StringUtils.isBlank(exceptionClassname)) { LOG.warn("getErrorSubMessage: Pattern matched message but it does not contain exception classname"); } return getUserFriendlySubMessage(detailMessage, exceptionClassname); }
Source:
private void bindSocialView(final DiscussionSocialLayoutViewHolder holder, final int position, final DiscussionComment response) { holder.setDiscussionResponse(response); holder.voteViewContainer.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { boolean isVoted = holder.toggleVote(discussionThread.isVoted() ? discussionThread.getVoteCount()-1: discussionThread.getVoteCount()); discussionService.setCommentVoted(response.getIdentifier(), new VoteBody(isVoted)) .enqueue(new ErrorHandlingCallback<DiscussionComment>( context, null, new DialogErrorNotification(baseFragment)) { @Override protected void onResponse(@NonNull final DiscussionComment comment) { discussionResponses.get(position - 1).patchObject(comment); discussionResponses.set(position - 1, comment); } @Override protected void onFailure(@NonNull final Throwable error) { notifyItemChanged(position); } }); } }); }

Target:
private void bindSocialView(final DiscussionSocialLayoutViewHolder holder, final int position, final DiscussionComment response) { holder.setDiscussionResponse(response); holder.voteViewContainer.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { boolean isVoted = holder.toggleVote(response.isVoted() ? response.getVoteCount()-1: response.getVoteCount()); discussionService.setCommentVoted(response.getIdentifier(), new VoteBody(isVoted)) .enqueue(new ErrorHandlingCallback<DiscussionComment>( context, null, new DialogErrorNotification(baseFragment)) { @Override protected void onResponse(@NonNull final DiscussionComment comment) { discussionResponses.get(position - 1).patchObject(comment); discussionResponses.set(position - 1, comment); } @Override protected void onFailure(@NonNull final Throwable error) { notifyItemChanged(position); } }); } }); }
Source:
private List<Project> getVisibleProjects(IProgressMonitor monitor, GerritConfig gerritConfig) throws GerritException { List<Project> result = new ArrayList<Project>(); try { List<ProjectDetailX> projectDetails = restClient.execute(monitor, new Operation<List<ProjectDetailX>>(client) { @Override public void execute(IProgressMonitor monitor) throws GerritException { getProjectAdminService(monitor).visibleProjectDetails(this); } }); for (ProjectDetailX projectDetail : projectDetails) { if (!GerritUtil.isPermissionOnlyProject(projectDetail, gerritConfig)) { result.add(projectDetail.project); } } } catch (GerritException e) { if (isNoSuchServiceError(e)) { addProjectsWhenNoSuchService(monitor, gerritConfig, result); } else { throw e; } } Collections.sort(result, new ProjectByNameComparator()); return result; }

Target:
private List<Project> getVisibleProjects(IProgressMonitor monitor, GerritConfig gerritConfig) throws GerritException { List<Project> result = new ArrayList<Project>(); try { getProjectDetails(monitor, gerritConfig, result); } catch (GerritException e) { if (isNoSuchServiceError(e)) { addProjectsWhenNoSuchService(monitor, gerritConfig, result); } else { throw e; } } Collections.sort(result, new ProjectByNameComparator()); return result; }
Source:
protected C retrieveCredentials(final WebContext context) throws HttpAction { CommonHelper.assertNotNull("credentialsExtractor", this.credentialsExtractor); CommonHelper.assertNotNull("authenticator", this.authenticator); try { final C credentials = this.credentialsExtractor.extract(context); if (credentials == null) { return null; } this.authenticator.validate(credentials, context); return credentials; } catch (CredentialsException e) { if (logger.isDebugEnabled()) { logger.info("Failed to retrieve or validate credentials", e); } else { logger.info("Failed to retrieve or validate credentials: {}", e.getMessage()); } return null; } catch (TechnicalException e) { logger.error("Error during credentials validation", e); return null; } }

Target:
protected C retrieveCredentials(final WebContext context) throws HttpAction { CommonHelper.assertNotNull("credentialsExtractor", this.credentialsExtractor); CommonHelper.assertNotNull("authenticator", this.authenticator); try { final C credentials = this.credentialsExtractor.extract(context); if (credentials == null) { return null; } this.authenticator.validate(credentials, context); return credentials; } catch (CredentialsException e) { logger.info("Failed to retrieve or validate credentials: {}", e.getMessage()); logger.debug("Failed to retrieve or validate credentials", e); return null; } }
Source:
public void setUp() throws Exception { System.setProperty(IBinaryCapability.OPENSHIFT_BINARY_LOCATION, helper.getOpenShiftLocation()); IClient client = helper.createClientForBasicAuth(); List<IResource> pods = client.list(ResourceKind.POD, "default"); pod = (IPod) pods.stream().filter(p->p.getName().startsWith("docker-registry")).findFirst().orElse(null); assertNotNull("Need a pod to continue the test. Expected to find the registry", pod); }

Target:
public void setUp() throws Exception { IClient client = helper.createClientForBasicAuth(); List<IResource> pods = client.list(ResourceKind.POD, "default"); pod = (IPod) pods.stream().filter(p->p.getName().startsWith("docker-registry")).findFirst().orElse(null); assertNotNull("Need a pod to continue the test. Expected to find the registry", pod); }
Source:
public FeedbackSessionAttributes unpublishFeedbackSession(String feedbackSessionName, String courseId) throws EntityDoesNotExistException, InvalidParametersException { FeedbackSessionAttributes sessionToUnpublish = getFeedbackSession(feedbackSessionName, courseId); if (sessionToUnpublish == null) { throw new EntityDoesNotExistException(ERROR_NON_EXISTENT_FS_UPDATE + sessionToUnpublish.getCourseId() + "/" + sessionToUnpublish.getFeedbackSessionName()); } if (!sessionToUnpublish.isPublished()) { throw new InvalidParametersException(ERROR_FS_ALREADY_UNPUBLISH); } return updateFeedbackSession( FeedbackSessionAttributes .updateOptionsBuilder(sessionToUnpublish.getFeedbackSessionName(), sessionToUnpublish.getCourseId()) .withResultsVisibleFromTime(Const.TIME_REPRESENTS_LATER) .build()); }

Target:
public FeedbackSessionAttributes unpublishFeedbackSession(String feedbackSessionName, String courseId) throws EntityDoesNotExistException, InvalidParametersException { FeedbackSessionAttributes sessionToUnpublish = getFeedbackSession(feedbackSessionName, courseId); if (sessionToUnpublish == null) { throw new EntityDoesNotExistException(ERROR_NON_EXISTENT_FS_UPDATE + courseId + "/" + feedbackSessionName); } if (!sessionToUnpublish.isPublished()) { throw new InvalidParametersException(ERROR_FS_ALREADY_UNPUBLISH); } return updateFeedbackSession( FeedbackSessionAttributes .updateOptionsBuilder(sessionToUnpublish.getFeedbackSessionName(), sessionToUnpublish.getCourseId()) .withResultsVisibleFromTime(Const.TIME_REPRESENTS_LATER) .build()); }
Source:
public static String readUTF(InputStream stream, long offset) throws IOException { StringBuilder result = new StringBuilder(); skipFully(stream, offset); InputStreamReader reader = null; try { reader = new InputStreamReader(stream, "UTF-8"); char[] buf = new char[4096]; int length = 0; while((length = reader.read(buf)) > 0) { result.append(buf, 0, length); } } finally { Closer.close(reader); } return result.toString(); }

Target:
public static StringBuilder readUTF(InputStream stream, long offset) throws IOException { StringBuilder result = new StringBuilder(); skipFully(stream, offset); InputStreamReader reader = null; try { reader = new InputStreamReader(stream, "UTF-8"); char[] buf = new char[4096]; int length = 0; while((length = reader.read(buf)) > 0) { result.append(buf, 0, length); } } finally { Closer.close(reader); } return result; }
Source:
protected boolean validate() { ValidationResult vr = ValidationResult.VALID; vr = validationFailed(vr) ? vr : validateHostId(getParameters().getSourceHostId()); vr = validationFailed(vr) ? vr : validateHostId(getParameters().getVdsId()); vr = validationFailed(vr) ? vr : validateHost(getLazySourceHost()); vr = validationFailed(vr) ? vr : validateHost(getLazyDestinationHost()); vr = validationFailed(vr) ? vr : validateClusterId(); vr = validationFailed(vr) ? vr : validateInterfaceCount(); return validate(vr); }

Target:
protected boolean validate() { return validateHostId(getSourceHostId()) && validateHostId(getDestinationHostId()) && validateHost(getLazySourceHost()) && validateHost(getLazyDestinationHost()) && validateClusterId() && validateInterfaceCount(); }
Source:
@Override public long totalRowCount(IndexingQueryCacheFilter partsFilter) { return 0; }

Target:
@Override public long totalRowCount(IndexingQueryCacheFilter partsFilter) { throw unsupported(); }
Source:
protected InputStream inputStream() throws IOException { if (this.pushbackStream == null || super.inputStream() != this.original) { this.pushbackStream = new PushbackInputStream(super.inputStream(), this.pushbackBufferSize); } return this.pushbackStream; }

Target:
protected InputStream inputStream() throws IOException { InputStream wrapped = super.inputStream(); if (this.pushbackStream == null || wrapped != this.wrapped) { this.pushbackStream = new PushbackInputStream(wrapped, this.pushbackBufferSize); this.wrapped = wrapped; } return this.pushbackStream; }
Source:
public final void drawMap() { readMap(); for (int row = 0; row < NUM_ROWS; row++) { for (int col = 0; col < NUM_COLS; col++) { if (map[row][col] == 1) { walls.add(new Wall(col * SPRITE_SIZE, row * SPRITE_SIZE, 0, 0, 0, 0)); } else if (map[row][col] == 2) { monsters.add(new Walker(col * SPRITE_SIZE - 32, row * SPRITE_SIZE - 32, 0, 0, 0, 0, Settings.MONSTER_SPEED, true, levelController)); } else if (map[row][col] == 3) { monsters.add(new Walker(col * SPRITE_SIZE - 32, row * SPRITE_SIZE - 32, 0, 0, 0, 0, Settings.MONSTER_SPEED, false, levelController)); } else if (map[row][col] == 9) { System.out.format("Player found in %d, %d", row, col); players.add(new Player(col * SPRITE_SIZE - 32, row * SPRITE_SIZE - 32, 0, 0, 0, 0, Settings.PLAYER_SPEED, null, levelController)); } } } }

Target:
public final void drawMap() { readMap(); for (int row = 0; row < NUM_ROWS; row++) { for (int col = 0; col < NUM_COLS; col++) { if (map[row][col] == 1) { walls.add(new Wall(col * SPRITE_SIZE, row * SPRITE_SIZE, 0, 0, 0, 0)); } else if (map[row][col] == 2) { monsters.add(new Walker(col * SPRITE_SIZE - 32, row * SPRITE_SIZE - 32, 0, 0, 0, 0, Settings.MONSTER_SPEED, true, levelController)); } else if (map[row][col] == 3) { monsters.add(new Walker(col * SPRITE_SIZE - 32, row * SPRITE_SIZE - 32, 0, 0, 0, 0, Settings.MONSTER_SPEED, false, levelController)); } else if (map[row][col] == 9) { System.out.format("Player found in %d, %d\n", row, col); players.add(new Player(col * SPRITE_SIZE - 32, row * SPRITE_SIZE - 32, 0, 0, 0, 0, Settings.PLAYER_SPEED, null, levelController)); } } } }
Source:
public ConsumerDTO create( @ApiParam(name = "consumer", required = true) ConsumerDTO dto, @Context Principal principal, @QueryParam("username") String userName, @QueryParam("owner") String ownerKey, @QueryParam("activation_keys") String activationKeys, @QueryParam("identity_cert_creation") @DefaultValue("true") boolean identityCertCreation) throws BadRequestException { Consumer consumer = null; if (ownerKey != null && dto.getFact("system_uuid") != null && !"true".equalsIgnoreCase(dto.getFact("virt.is_guest"))) { Owner owner = ownerCurator.lookupByKey(ownerKey); if (owner != null) { consumer = consumerCurator.getHypervisor(dto.getFact("system_uuid"), owner); if (consumer != null) { consumer.setIdCert(generateIdCert(consumer, false)); this.updateConsumer(consumer.getUuid(), dto, principal); return translator.translate( consumerCurator.findByUuid(consumer.getUuid()), ConsumerDTO.class); } } } if (consumer == null) { consumer = new Consumer(); } if (dto.getUuid() != null) { consumer.setUuid(dto.getUuid()); } populateEntity(consumer, dto); if (dto.getType() == null) { throw new BadRequestException(i18n.tr("Unit type must be specified.")); } ConsumerType ctype = this.consumerTypeCurator.lookupByLabel(dto.getType().getLabel()); if (ctype == null) { throw new BadRequestException(i18n.tr("Invalid unit type: {0}", dto.getType().getLabel())); } consumer.setType(ctype); if (dto.getCreated() != null) { consumer.setCreated(dto.getCreated()); } return translator.translate(createConsumerFromEntity(consumer, principal, userName, ownerKey, activationKeys, identityCertCreation), ConsumerDTO.class); }

Target:
public ConsumerDTO create( @ApiParam(name = "consumer", required = true) ConsumerDTO dto, @Context Principal principal, @QueryParam("username") String userName, @QueryParam("owner") String ownerKey, @QueryParam("activation_keys") String activationKeys, @QueryParam("identity_cert_creation") @DefaultValue("true") boolean identityCertCreation) throws BadRequestException { Consumer consumer = null; if (ownerKey != null && dto.getFact("system_uuid") != null && !"true".equalsIgnoreCase(dto.getFact("virt.is_guest"))) { Owner owner = ownerCurator.lookupByKey(ownerKey); if (owner != null) { consumer = consumerCurator.getHypervisor(dto.getFact("system_uuid"), owner); if (consumer != null) { consumer.setIdCert(generateIdCert(consumer, false)); this.updateConsumer(consumer.getUuid(), dto, principal); return translator.translate(consumer, ConsumerDTO.class); } } } if (consumer == null) { consumer = new Consumer(); } if (dto.getUuid() != null) { consumer.setUuid(dto.getUuid()); } consumer.setOwner(ownerCurator.lookupByKey(ownerKey)); populateEntity(consumer, dto); if (dto.getType() == null) { throw new BadRequestException(i18n.tr("Unit type must be specified.")); } ConsumerType ctype = this.consumerTypeCurator.lookupByLabel(dto.getType().getLabel()); if (ctype == null) { throw new BadRequestException(i18n.tr("Invalid unit type: {0}", dto.getType().getLabel())); } return translator.translate(createConsumerFromDTO(dto, ctype, principal, userName, ownerKey, activationKeys, identityCertCreation), ConsumerDTO.class); }
Source:
private boolean compareAlignments() { if (!compareValues(reader1.getFileHeader().getSortOrder(), reader2.getFileHeader().getSortOrder(), "Sort Order")) { System.out.println("Cannot compare alignments if sort orders differ."); return false; } switch (reader1.getFileHeader().getSortOrder()) { case coordinate: if (sequenceDictionariesDiffer) { System.out.println("Cannot compare coordinate-sorted SAM files because sequence dictionaries differ."); return false; } return compareCoordinateSortedAlignments(); case queryname: return compareQueryNameSortedAlignments(); case duplicate: case unsorted: return compareUnsortedAlignments(); default: return false; } }

Target:
private boolean compareAlignments() { if (!compareValues(reader1.getFileHeader().getSortOrder(), reader2.getFileHeader().getSortOrder(), "Sort Order")) { System.out.println("Cannot compare alignments if sort orders differ."); return false; } switch (reader1.getFileHeader().getSortOrder()) { case coordinate: if (sequenceDictionariesDiffer) { System.out.println("Cannot compare coordinate-sorted SAM files because sequence dictionaries differ."); return false; } return compareCoordinateSortedAlignments(); case queryname: return compareQueryNameSortedAlignments(); case duplicate: case unsorted: return compareUnsortedAlignments(); default: throw new PicardException(String.format("Unrecognized sort order (%s) found.", reader1.getFileHeader().getSortOrder())); } }
Source:
private Flux<Instant> renewMessageLock(ServiceBusReceivedMessage[] messagesforRenewLock) { return cbsAuthorizationOnce() .then( channelMono.flatMap(requestResponseChannel -> { UUID[] lockTokens = new UUID[messagesforRenewLock.length]; int index = 0; for (ServiceBusReceivedMessage receivedMessage : messagesforRenewLock ) { lockTokens[index++] = receivedMessage.getLockToken(); } HashMap<String, UUID[]> requestBodyMap = new HashMap<>(); requestBodyMap.put(REQUEST_RESPONSE_LOCKTOKENS, lockTokens); Message requestMessage = createRequestMessageFromValueBody(REQUEST_RESPONSE_RENEWLOCK_OPERATION, requestBodyMap, MessageUtils.adjustServerTimeout(Duration.ofSeconds(60))); return requestResponseChannel.sendWithAck(requestMessage); }) ) .flatMapMany(responseMessage -> { int statusCode = RequestResponseUtils.getResponseStatusCode(responseMessage); List<Instant> expirationsForLocks = null; if (statusCode == REQUEST_RESPONSE_OK_STATUS_CODE) { @SuppressWarnings("unchecked") Map<String, Object> responseBody = (Map<String, Object>) ((AmqpValue) responseMessage .getBody()).getValue(); Object expirationListObj = responseBody.get(REQUEST_RESPONSE_EXPIRATIONS); if (expirationListObj instanceof Date[]){ Date[] expirations = (Date[]) expirationListObj; expirationsForLocks = Arrays.stream(expirations) .map(Date::toInstant) .collect(Collectors.toList()); } } return Flux.fromIterable(expirationsForLocks); }); }

Target:
private Flux<Instant> renewMessageLock(ServiceBusReceivedMessage[] messagesforRenewLock) { return isAuthorized(PEEK_OPERATION_VALUE).thenMany(createRequestResponse.flatMap(requestResponseChannel -> { UUID[] lockTokens = Arrays.stream(messagesforRenewLock) .map(ServiceBusReceivedMessage::getLockToken) .toArray(UUID[]::new); Message requestMessage = createRequestMessageFromValueBody(REQUEST_RESPONSE_RENEWLOCK_OPERATION, Collections.singletonMap(REQUEST_RESPONSE_LOCKTOKENS, lockTokens), MessageUtils.adjustServerTimeout(Duration.ofSeconds(60))); return requestResponseChannel.sendWithAck(requestMessage); }).flatMapMany(responseMessage -> { int statusCode = RequestResponseUtils.getResponseStatusCode(responseMessage); List<Instant> expirationsForLocks = new ArrayList<>(); if (statusCode == REQUEST_RESPONSE_OK_STATUS_CODE) { @SuppressWarnings("unchecked") Map<String, Object> responseBody = (Map<String, Object>) ((AmqpValue) responseMessage .getBody()).getValue(); Object expirationListObj = responseBody.get(REQUEST_RESPONSE_EXPIRATIONS); if (expirationListObj instanceof Date[]) { Date[] expirations = (Date[]) expirationListObj; expirationsForLocks = Arrays.stream(expirations) .map(Date::toInstant) .collect(Collectors.toList()); } } return Flux.fromIterable(expirationsForLocks); })); }
Source:
public HaxeClass getUnderlyingClass() { HaxeUnderlyingType underlyingTypePsi = getAbstractClass().getUnderlyingType(); if (underlyingTypePsi == null) return null; final HaxeType underlyingType = underlyingTypePsi.getTypeOrAnonymousList().get(0).getType(); if (underlyingType != null) { final HaxeClassResolveResult result = underlyingType.getReferenceExpression().resolveHaxeClass(); if (result != HaxeClassResolveResult.EMPTY) { return result.getHaxeClass(); } } return null; }

Target:
public HaxeClass getUnderlyingClass() { HaxeUnderlyingType underlyingTypePsi = getAbstractClass().getUnderlyingType(); if (underlyingTypePsi == null) return null; final HaxeType underlyingType = underlyingTypePsi.getTypeOrAnonymousList().get(0).getType(); if (underlyingType != null) { final HaxeClassResolveResult result = underlyingType.getReferenceExpression().resolveHaxeClass(); return result.getHaxeClass(); } return null; }
Source:
public void testDeleteEPerson() throws SQLException, AuthorizeException { EPerson deleteEperson = ePersonService.findByEmail(context, EMAIL); context.turnOffAuthorisationSystem(); try { ePersonService.delete(context, deleteEperson); } catch (AuthorizeException | IOException ex) { log.error("Cannot delete EPersion, caught " + ex.getClass().getName() + ":", ex); fail("Caught an Exception while deleting an EPerson. " + ex.getClass().getName() + ": " + ex.getMessage()); } context.restoreAuthSystemState(); context.commit(); EPerson fundDeletedEperson = ePersonService.findByEmail(context, EMAIL); assertNull("EPerson has not been deleted correctly!", fundDeletedEperson); }

Target:
public void testDeleteEPerson() throws SQLException, AuthorizeException { EPerson deleteEperson = ePersonService.findByEmail(context, EMAIL); context.turnOffAuthorisationSystem(); try { ePersonService.delete(context, deleteEperson); } catch (AuthorizeException | IOException ex) { log.error("Cannot delete EPersion, caught " + ex.getClass().getName() + ":", ex); fail("Caught an Exception while deleting an EPerson. " + ex.getClass().getName() + ": " + ex.getMessage()); } context.restoreAuthSystemState(); context.commit(); EPerson findDeletedEperson = ePersonService.findByEmail(context, EMAIL); assertNull("EPerson has not been deleted correctly!", findDeletedEperson); }
Source:
public void end(Context ctx) throws Exception { if (objectsToUpdate != null && handlesToDelete != null) { for (UUID id : objectsToUpdate) { Item iu = itemService.find(ctx, id); String hdl = iu.getHandle(); if (hdl != null && !handlesToDelete.contains(hdl)) { try { indexer.indexContent(ctx, iu, true); log.debug("Indexed " + Constants.typeText[iu.getType()] + ", id=" + String.valueOf(iu.getID()) + ", handle=" + hdl); } catch (Exception e) { log.error("Failed while indexing object: ", e); } } } for (String hdl : handlesToDelete) { try { indexer.unIndexContent(ctx, hdl, true); if (log.isDebugEnabled()) { log.debug("UN-Indexed Item, handle=" + hdl); } } catch (Exception e) { log.error("Failed while UN-indexing object: " + hdl, e); } } } objectsToUpdate = null; handlesToDelete = null; }

Target:
public void end(Context ctx) throws Exception { if (objectsToUpdate != null && handlesToDelete != null) { for (DSpaceObject o : objectsToUpdate) { DSpaceObject iu = ctx.reloadEntity(o); String hdl = iu.getHandle(); if (hdl != null && !handlesToDelete.contains(hdl)) { try { indexer.indexContent(ctx, iu, true); log.debug("Indexed " + Constants.typeText[iu.getType()] + ", id=" + String.valueOf(iu.getID()) + ", handle=" + hdl); } catch (Exception e) { log.error("Failed while indexing object: ", e); } } } for (String hdl : handlesToDelete) { try { indexer.unIndexContent(ctx, hdl, true); if (log.isDebugEnabled()) { log.debug("UN-Indexed Item, handle=" + hdl); } } catch (Exception e) { log.error("Failed while UN-indexing object: " + hdl, e); } } } objectsToUpdate = null; handlesToDelete = null; }
Source:
public void updated(Dictionary<String, ?> config) throws ConfigurationException { logger.debug("updated()"); if (config != null) { Enumeration<String> keys = config.keys(); while (keys.hasMoreElements()) { String key = (String) keys.nextElement(); String value = (String) config.get(key); logger.debug(String.format("Got configuration %s of value %s", key, value)); if (key.equals("baseUrl")) { mMyOHBaseUrl = value; } else if (key.equals("localPort")) { mLocalPort = Integer.valueOf(value); } } } else { logger.debug("config is null"); } logger.debug("UUID = " + getUUID() + ", secret = " + getSecret()); myOHClient = new MyOHClient(getUUID(), getSecret()); if (mMyOHBaseUrl != null) myOHClient.setMyOHBaseUrl(mMyOHBaseUrl); if (mLocalPort != 8080) myOHClient.setOHBaseUrl("http://localhost:" + String.valueOf(mLocalPort)); myOHClient.setOpenHABVersion(getVersion()); myOHClient.connect(); myOHClient.setListener(this); MyOpenHAB.mMyOpenHABService = this; }

Target:
public void updated(Dictionary<String, ?> config) throws ConfigurationException { if (config != null) { String baseUrlString = (String) config.get("baseUrl"); if (StringUtils.isNotBlank(baseUrlString)) { mMyOHBaseUrl = baseUrlString; } String localPortString = (String) config.get("localPort"); if (StringUtils.isNotBlank(localPortString)) { mLocalPort = Integer.valueOf(localPortString); } } else { logger.debug("config is null"); } logger.debug("UUID = " + getUUID() + ", secret = " + getSecret()); myOHClient = new MyOHClient(getUUID(), getSecret()); if (mMyOHBaseUrl != null) { myOHClient.setMyOHBaseUrl(mMyOHBaseUrl); } if (mLocalPort != 8080) { myOHClient.setOHBaseUrl("http://localhost:" + String.valueOf(mLocalPort)); } myOHClient.setOpenHABVersion(getVersion()); myOHClient.connect(); myOHClient.setListener(this); MyOpenHAB.mMyOpenHABService = this; }
Source:
public void scan() { try { final HttpMessage originalMsg = getBaseMsg(); String currentHeader = originalMsg.getRequestHeader().getHeader("SOAPAction"); if (currentHeader != null && originalMsg.getRequestBody().length() > 0) { currentHeader = currentHeader.trim(); String[] soapActions = ImportWSDL.getInstance().getSourceSoapActions(originalMsg); boolean endScan = false; if (soapActions == null || soapActions.length == 0 ) { if (log.isDebugEnabled()) { log.debug("Skipping " + getName() + " because no actions were found."); } getParent().pluginSkipped(getId(), Constant.messages.getString("soap.soapactionspoofing.skip.reason")); return; } for (int j = 0; j < soapActions.length && !endScan; j++) { HttpMessage msg = getNewMsg(); if (!currentHeader.equals(soapActions[j])) { HttpRequestHeader header = msg.getRequestHeader(); header.setHeader("SOAPAction", soapActions[j]); msg.setRequestHeader(header); if (this.isStop()) return; sendAndReceive(msg); if (this.isStop()) return; int code = scanResponse(msg, originalMsg); if (code > 0) endScan = true; raiseAlert(msg, code); } else { if (log.isDebugEnabled()) { log.debug("Ignoring matching actions: " + currentHeader + " : " + soapActions[j]); } } if (this.isStop()) return; } } } catch (Exception e) { log.error(e.getMessage(), e); } }

Target:
public void scan() { try { final HttpMessage originalMsg = getBaseMsg(); String currentHeader = originalMsg.getRequestHeader().getHeader("SOAPAction"); if (currentHeader != null && originalMsg.getRequestBody().length() > 0) { currentHeader = currentHeader.trim(); String[] soapActions = ImportWSDL.getInstance().getSourceSoapActions(originalMsg); boolean endScan = false; if (soapActions == null || soapActions.length == 0 ) { log.info("Skipping " + getName() + " because no actions were found. (URL: " + originalMsg.getRequestHeader().getURI().toString() + ")"); return; } for (int j = 0; j < soapActions.length && !endScan; j++) { HttpMessage msg = getNewMsg(); if (!currentHeader.equals(soapActions[j])) { HttpRequestHeader header = msg.getRequestHeader(); header.setHeader("SOAPAction", soapActions[j]); msg.setRequestHeader(header); if (this.isStop()) return; sendAndReceive(msg); if (this.isStop()) return; int code = scanResponse(msg, originalMsg); if (code > 0) endScan = true; raiseAlert(msg, code); } else { if (log.isDebugEnabled()) { log.debug("Ignoring matching actions: " + currentHeader + " : " + soapActions[j]); } } if (this.isStop()) return; } } } catch (Exception e) { log.error(e.getMessage(), e); } }
Source:
protected RuleBuilder(Rule rule) { this.triggers = rule.getTriggers(); this.conditions = rule.getConditions(); this.actions = rule.getActions(); this.configuration = rule.getConfiguration(); this.configDescriptions = rule.getConfigurationDescriptions(); this.templateUID = rule.getTemplateUID(); this.uid = rule.getUID(); this.name = rule.getName(); this.tags = rule.getTags(); this.visibility = rule.getVisibility(); this.description = rule.getDescription(); }

Target:
protected RuleBuilder(Rule rule) { this.triggers = new LinkedList<>(rule.getTriggers()); this.conditions = new LinkedList<>(rule.getConditions()); this.actions = new LinkedList<>(rule.getActions()); this.configuration = rule.getConfiguration(); this.configDescriptions = new LinkedList<>(rule.getConfigurationDescriptions()); this.templateUID = rule.getTemplateUID(); this.uid = rule.getUID(); this.name = rule.getName(); this.tags = new HashSet<>(rule.getTags()); this.visibility = rule.getVisibility(); this.description = rule.getDescription(); }
Source:
protected void manageRelatedTextOfTopLevelDocument(CoreSession session, Comment comment) { checkArgument(isNotEmpty(comment.getId()), "Comment id is required"); checkArgument(isNotEmpty(comment.getParentId()), "Comment parent id is required"); DocumentRef topLevelDocRef = getTopLevelCommentAncestor(session, new IdRef(comment.getParentId())); DocumentModel topLevelDoc = session.getDocument(topLevelDocRef); topLevelDoc.addFacet(HAS_RELATED_TEXT); String relatedTextId = String.format( comment instanceof Annotation ? ANNOTATION_RELATED_TEXT_ID : COMMENT_RELATED_TEXT_ID, comment.getId()); @SuppressWarnings("unchecked") List<Map<String, String>> resources = (List<Map<String, String>>) topLevelDoc.getPropertyValue( RELATED_TEXT_RESOURCES); Map<String, String> relatedTextMap = resources.stream() .filter(m -> relatedTextId.contains(m.get(RELATED_TEXT_ID))) .findAny() .orElseGet(() -> new HashMap<>(0)); if (isNotEmpty(comment.getText())) { if (relatedTextMap.isEmpty()) { resources.add(Map.of(RELATED_TEXT_ID, relatedTextId, RELATED_TEXT, comment.getText())); } else { relatedTextMap.put(RELATED_TEXT, comment.getText()); } } else { resources.remove(relatedTextMap); } topLevelDoc.setPropertyValue(RELATED_TEXT_RESOURCES, (Serializable) resources); session.saveDocument(topLevelDoc); }

Target:
protected void manageRelatedTextOfTopLevelDocument(CoreSession session, Comment comment) { requireNonNull(comment.getId(), "Comment id is required"); requireNonNull(comment.getParentId(), "Comment parent id is required"); DocumentRef topLevelDocRef = getTopLevelCommentAncestor(session, new IdRef(comment.getParentId())); DocumentModel topLevelDoc = session.getDocument(topLevelDocRef); topLevelDoc.addFacet(HAS_RELATED_TEXT); String relatedTextId = String.format(COMMENT_RELATED_TEXT_ID, comment.getId()); @SuppressWarnings("unchecked") List<Map<String, String>> resources = (List<Map<String, String>>) topLevelDoc.getPropertyValue( RELATED_TEXT_RESOURCES); Optional<Map<String, String>> optional = resources.stream() .filter(m -> relatedTextId.equals(m.get(RELATED_TEXT_ID))) .findAny(); if (isEmpty(comment.getText())) { optional.ifPresent(resources::remove); } else { optional.ifPresentOrElse( (map) -> map.put(RELATED_TEXT, comment.getText()), () -> resources.add(Map.of(RELATED_TEXT_ID, relatedTextId, RELATED_TEXT, comment.getText()))); } topLevelDoc.setPropertyValue(RELATED_TEXT_RESOURCES, (Serializable) resources); session.saveDocument(topLevelDoc); }
Source:
public boolean onTouchEvent(MotionEvent ev) { if (getAdapter() != null) { return super.onTouchEvent(ev); } else { return true; } }

Target:
public boolean onTouchEvent(MotionEvent ev) { return mAdapter == null || super.onTouchEvent(ev); }
Source:
public WindowSpec.WindowStartBound buildWindowStartBound(Window_frame_start_boundContext context) { WindowFrameStartBoundType boundType = null; if (checkIfExist(context.UNBOUNDED())) { boundType = WindowFrameStartBoundType.UNBOUNDED_PRECEDING; } else if (checkIfExist(context.PRECEDING())) { boundType = WindowFrameStartBoundType.PRECEDING; } else if (checkIfExist(context.FOLLOWING())) { boundType = WindowFrameStartBoundType.FOLLOWING; } else { boundType = WindowFrameStartBoundType.CURRENT_ROW; } WindowSpec.WindowStartBound bound = new WindowSpec.WindowStartBound(boundType); if (boundType == WindowFrameStartBoundType.PRECEDING || boundType == WindowFrameStartBoundType.FOLLOWING) { bound.setNumber(visitUnsigned_value_specification(context.unsigned_value_specification())); } return bound; }

Target:
public WindowSpec.WindowBound buildWindowStartBound(Window_frame_start_boundContext context) { WindowFrameBoundType boundType = null; if (checkIfExist(context.UNBOUNDED())) { boundType = WindowFrameBoundType.UNBOUNDED_PRECEDING; } else if (checkIfExist(context.PRECEDING())) { boundType = WindowFrameBoundType.PRECEDING; } else if (checkIfExist(context.FOLLOWING())) { boundType = WindowFrameBoundType.FOLLOWING; } else if (checkIfExist(context.CURRENT())){ boundType = WindowFrameBoundType.CURRENT_ROW; } else { throw new SQLSyntaxError("Window frame - unknown start bound type"); } WindowSpec.WindowBound bound = new WindowSpec.WindowBound(boundType); if (boundType == WindowFrameBoundType.PRECEDING || boundType == WindowFrameBoundType.FOLLOWING) { bound.setNumber(visitUnsigned_value_specification(context.unsigned_value_specification())); } return bound; }
Source:
public Attribute[] getAttributes() { return attributeMap.values().toArray(new Attribute[attributeMap.size()]); }

Target:
public Collection<Attribute> getAttributes() { return attributeMap.values(); }
Source:
public Object execute(OperationRequest request) throws IOException { AsyncRequest req; String content = JsonMarshalling.writeRequest(request); String ctype; Object input = request.getInput(); if (input instanceof OperationInput && ((OperationInput) input).isBinary()) { MultipartInput mpinput = Request.buildMultipartInput(input, content); req = new AsyncRequest(Request.POST, request.getUrl(), mpinput); ctype = mpinput.getContentType(); } else { req = new AsyncRequest(Request.POST, request.getUrl(), content); ctype = CTYPE_REQUEST_NOCHARSET; } for (Map.Entry<String, String> entry : request.getHeaders().entrySet()) { req.put(entry.getKey(), entry.getValue()); } req.put("Accept", REQUEST_ACCEPT_HEADER); req.put("Content-Type", ctype); if (req.get(HEADER_NX_SCHEMAS) == null && session.getDefaultSchemas() != null) { req.put(HEADER_NX_SCHEMAS, session.getDefaultSchemas()); } try { return req.execute().get(); } catch (ExecutionException | InterruptedException e) { if (e.getCause() instanceof RemoteException) { throw (RemoteException) e.getCause(); } throw new IOException(e); } }

Target:
public Object execute(OperationRequest request) throws IOException { AsyncRequest req; String content = JsonMarshalling.writeRequest(request); String ctype; Object input = request.getInput(); if (input instanceof OperationInput && ((OperationInput) input).isBinary()) { MultipartInput mpinput = Request.buildMultipartInput(input, content); req = new AsyncRequest(Request.POST, request.getUrl(), mpinput); ctype = mpinput.getContentType(); } else { req = new AsyncRequest(Request.POST, request.getUrl(), content); ctype = CTYPE_REQUEST_NOCHARSET; } for (Map.Entry<String, String> entry : request.getHeaders().entrySet()) { req.put(entry.getKey(), entry.getValue()); } req.put(HttpHeaders.ACCEPT, REQUEST_ACCEPT_HEADER); req.put(HttpHeaders.CONTENT_TYPE, ctype); if (req.get(HEADER_NX_SCHEMAS) == null && session.getDefaultSchemas() != null) { req.put(HEADER_NX_SCHEMAS, session.getDefaultSchemas()); } try { return req.execute().get(); } catch (ExecutionException e) { if (e.getCause() instanceof RemoteException) { throw (RemoteException) e.getCause(); } throw new IOException(e); } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new RuntimeException(e); } }
Source:
private static <T> T assertInstanceOf(Class<T> expectedType, Object actualValue, Object messageOrSupplier) { if (!expectedType.isInstance(actualValue)) { String template = actualValue instanceof Throwable ? "Unexpected exception type" : "Unexpected instance type"; if (actualValue == null) template = "Unexpected null value"; String message = buildPrefix(nullSafeGet(messageOrSupplier)) + format(expectedType, actualValue == null ? null : actualValue.getClass(), template); throw new AssertionFailedError(message); } return expectedType.cast(actualValue); }

Target:
private static <T> T assertInstanceOf(Class<T> expectedType, Object actualValue, Object messageOrSupplier) { if (!expectedType.isInstance(actualValue)) { String template = "Unexpected type"; if (actualValue == null) template = "Unexpected null value"; String message = buildPrefix(nullSafeGet(messageOrSupplier)) + format(expectedType, actualValue == null ? null : actualValue.getClass(), template); throw new AssertionFailedError(message); } return expectedType.cast(actualValue); }
Source:
public void defaultRequests() throws Exception { PodTemplate template = new PodTemplate(); Pod pod = new PodTemplateBuilder(template).build(); ResourceRequirements resources = pod.getSpec().getContainers().get(0).getResources(); assertNotNull(resources); Map<String, Quantity> requests = resources.getRequests(); assertNotNull(requests); assertEquals(PodTemplateBuilder.DEFAULT_JNLP_CONTAINER_CPU_REQUEST, requests.get("cpu")); assertEquals(PodTemplateBuilder.DEFAULT_JNLP_CONTAINER_MEMORY_REQUEST, requests.get("memory")); }

Target:
public void defaultRequests() throws Exception { PodTemplate template = new PodTemplate(); Pod pod = new PodTemplateBuilder(template).build(); ResourceRequirements resources = pod.getSpec().getContainers().get(0).getResources(); assertNotNull(resources); Map<String, Quantity> requests = resources.getRequests(); assertNotNull(requests); PodTemplateUtilsTest.assertQuantity(PodTemplateBuilder.DEFAULT_JNLP_CONTAINER_CPU_REQUEST, requests.get("cpu")); PodTemplateUtilsTest.assertQuantity(PodTemplateBuilder.DEFAULT_JNLP_CONTAINER_MEMORY_REQUEST, requests.get("memory")); }
Source:
public NewMessageWallThreadPageObject openThread(String threadName) { for (WebElement thread:threadList) { if (thread.getText().contains(threadName)){ scrollAndClick(thread); } break; } return new NewMessageWallThreadPageObject(driver); }

Target:
public NewMessageWallThreadPageObject openThread(String threadName) { for (WebElement thread:threadList) { if (thread.getText().contains(threadName)){ scrollAndClick(thread); break; } } return new NewMessageWallThreadPageObject(driver); }
Source:
public boolean isMangledName(String docName) { Matcher matcher = TRASHED_PATTERN.matcher(docName); return (matcher.matches()); }

Target:
public boolean isMangledName(String docName) { return TRASHED_PATTERN.matcher(docName).matches(); }
Source:
public void setup(Graph graph) { AlertPatchService alertPatchService = new AlertPatchServiceImpl(graph); this.alertPatchService = alertPatchService; SiriFuzzyTripMatcher fuzzyTripMatcher = new SiriFuzzyTripMatcher(new RoutingService(graph)); if (updateHandler == null) { updateHandler = new SiriAlertsUpdateHandler(feedId); } updateHandler.setEarlyStart(earlyStart); updateHandler.setAlertPatchService(alertPatchService); updateHandler.setSiriFuzzyTripMatcher(fuzzyTripMatcher); }

Target:
public void setup(Graph graph) { this.alertPatchService = new AlertPatchServiceImpl(graph); SiriFuzzyTripMatcher fuzzyTripMatcher = new SiriFuzzyTripMatcher(new RoutingService(graph)); if (updateHandler == null) { updateHandler = new SiriAlertsUpdateHandler(feedId); } updateHandler.setEarlyStart(earlyStart); updateHandler.setAlertPatchService(alertPatchService); updateHandler.setSiriFuzzyTripMatcher(fuzzyTripMatcher); }
Source:
public String toString() { return timestamp + " " + opId + " " + measurement + " " + value + " " + queryId + "." + subqueryId; }

Target:
public String toString() { return Joiner.on(" ").join(timestamp, opId, measurement, value, queryId + "." + subqueryId); }
Source:
private void performCopy() { if (clipboard == null) { this.clipboard = new Clipboard(null); } String detailsStr = new CopyActionDetails(awa).getDetailsString(); clipboard.setContents(new Object[] {detailsStr}, new Transfer[] {TextTransfer.getInstance()}); this.clipboard.dispose(); this.clipboard = null; }

Target:
private void performCopy() { Clipboard clipboard = new Clipboard(null); try { String detailsStr = new CopyActionDetails(awa).getDetailsString(); clipboard.setContents(new Object[] {detailsStr}, new Transfer[] {TextTransfer.getInstance()}); } finally { clipboard.dispose(); } }
Source:
public void testEncoding() throws Exception { MockSchemaRegistry mockSchemaRegistry = new MockSchemaRegistry(); String schemaID = mockSchemaRegistry.registerSchema(MockSchema.COMPLEX_SCHEMA.getName(), MockSchema.COMPLEX_SCHEMA); Datastream stream = OracleConnectorTestUtils.createDatastream("oracle/dbName/tableName", schemaID, "ListBackedTransportProvider"); DatastreamTaskImpl task = OracleConnectorTestUtils.createDatastreamTask(stream); MessageHandler handler = new MessageHandler(_complexSource, MockSchema.COMPLEX_SCHEMA, task); List<OracleChangeEvent> events = OracleConnectorTestUtils.generateComplexMockEvents(2); BrooklinEnvelope envelope = handler.generateBrooklinEnvelope(events.get(1)); byte[] keyByteArray = (byte[]) envelope.getKey(); Assert.assertNotNull(keyByteArray); Assert.assertFalse(keyByteArray.length == 0); Assert.assertFalse(keyByteArray[0] > MAGIC_BYTE); long val = 0L; int var6 = keyByteArray.length; for (int var7 = 0; var7 < var6; ++var7) { byte b = keyByteArray[var7]; val <<= 8; val |= (long) (b & 255); } Assert.assertEquals((long) Long.valueOf(val), 1L); }

Target:
public void testEncoding() throws Exception { MockSchemaRegistry mockSchemaRegistry = new MockSchemaRegistry(); String schemaID = mockSchemaRegistry.registerSchema(MockSchema.COMPLEX_SCHEMA.getName(), MockSchema.COMPLEX_SCHEMA); Datastream stream = OracleConnectorTestUtils.createDatastream("oracle/dbName/tableName", schemaID, "ListBackedTransportProvider"); DatastreamTaskImpl task = OracleConnectorTestUtils.createDatastreamTask(stream); MessageHandler handler = new MessageHandler(_complexSource, MockSchema.COMPLEX_SCHEMA, task); List<OracleChangeEvent> events = OracleConnectorTestUtils.generateComplexMockEvents(2); BrooklinEnvelope envelope = handler.generateBrooklinEnvelope(events.get(1)); byte[] keyByteArray = (byte[]) envelope.getKey(); Assert.assertNotNull(keyByteArray); Assert.assertFalse(keyByteArray.length == 0); Assert.assertFalse(keyByteArray[0] > MAGIC_BYTE); long val = 0L; int len = keyByteArray.length; for (int index = 0; index < len; ++index) { byte b = keyByteArray[index]; val <<= 8; val |= (long) (b & 255); } Assert.assertEquals((long) Long.valueOf(val), 1L); }
Source:
public GlowLightningStrike(Location location, boolean effect, Random random) { super(location); this.effect = effect; this.ticksToLive = 30; distanceToDamage = 5; distanceToIgnition = 1; burnTicks = 75; this.random = random; }

Target:
public GlowLightningStrike(Location location, boolean effect, Random random) { super(location); this.effect = effect; this.ticksToLive = 30; this.distanceToDamageSquared = 25; this.distanceToIgnitionSquared = 1; this.burnTicks = 75; this.random = random; }
Source:
public void run() { try { if (notifyListeners() || checkIfListenersHaveDataToSendOnly()) { future = autoFlushExecutor.submit(this); } else { synchronized (this) { if (isMoreDataAvailable) { isMoreDataAvailable = false; future = autoFlushExecutor.submit(this); } else { future = null; } } } } catch (Exception e) { logger.error("{}", DataList.this, e); } }

Target:
public void run() { try { if (addedData() || checkIfListenersHaveDataToSendOnly()) { future = autoFlushExecutor.submit(this); } else { synchronized (this) { if (isMoreDataAvailable) { isMoreDataAvailable = false; future = autoFlushExecutor.submit(this); } else { future = null; } } } } catch (Exception e) { logger.error("{}", DataList.this, e); } }
Source:
public Map<String, Long> getValueAndReset() { Map<String, Long> ret = new ConcurrentHashMap<>(); for (String key : value.keySet()) { ret.put(key, value.get(key).getValueAndReset()); } return ret; }

Target:
public Map<String, Long> getValueAndReset() { Map<String, Long> ret = new HashMap<>(); for (String key : value.keySet()) { ret.put(key, value.get(key).getValueAndReset()); } return ret; }
Source:
public Cookie setSameSiteMode(final String mode) { final String m = Cookies.lookupSameSiteMode(mode); if (m != null) { UndertowLogger.REQUEST_LOGGER.tracef("Setting SameSite mode to [%s] for cookie [%s]", m, this.name); this.sameSiteMode = m; this.setSameSite(true); } else { UndertowLogger.REQUEST_LOGGER.warnf(UndertowMessages.MESSAGES.invalidSameSiteMode(mode, Arrays.toString(Cookie.SameSiteMode.values())), "Ignoring specified SameSite mode [%s] for cookie [%s]", mode, this.name); } return this; }

Target:
public Cookie setSameSiteMode(final String mode) { final String m = CookieSameSiteMode.lookupModeString(mode); if (m != null) { UndertowLogger.REQUEST_LOGGER.tracef("Setting SameSite mode to [%s] for cookie [%s]", m, this.name); this.sameSiteMode = m; this.setSameSite(true); } else { UndertowLogger.REQUEST_LOGGER.warnf(UndertowMessages.MESSAGES.invalidSameSiteMode(mode, Arrays.toString(CookieSameSiteMode.values())), "Ignoring specified SameSite mode [%s] for cookie [%s]", mode, this.name); } return this; }