auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected void setValuesFromAlignment(final SAMRecord rec, final SAMRecord alignment) { for (final SAMRecord.SAMTagAndValue attr : alignment.getAttributes()) { if ((!isReservedTag(attr.tag) || this.attributesToRetain.contains(attr.tag)) && !this.attributesToRemove.contains(attr.tag)) { rec.setAttribute(attr.tag, attr.value); } } rec.setReadUnmappedFlag(alignment.getReadUnmappedFlag()); rec.setReferenceName(alignment.getReferenceName()); rec.setAlignmentStart(alignment.getAlignmentStart()); rec.setReadNegativeStrandFlag(alignment.getReadNegativeStrandFlag()); rec.setNotPrimaryAlignmentFlag(alignment.getNotPrimaryAlignmentFlag()); rec.setSupplementaryAlignmentFlag(alignment.getSupplementaryAlignmentFlag()); if (!alignment.getReadUnmappedFlag()) { rec.setCigar(alignment.getCigar()); rec.setMappingQuality(alignment.getMappingQuality()); } if (rec.getReadPairedFlag()) { rec.setProperPairFlag(alignment.getProperPairFlag()); } if (rec.getReadNegativeStrandFlag()) { rec.reverseComplement(); } }

Target:
protected void setValuesFromAlignment(final SAMRecord rec, final SAMRecord alignment) { for (final SAMRecord.SAMTagAndValue attr : alignment.getAttributes()) { if ((!isReservedTag(attr.tag) || this.attributesToRetain.contains(attr.tag)) && !this.attributesToRemove.contains(attr.tag)) { rec.setAttribute(attr.tag, attr.value); } } rec.setReadUnmappedFlag(alignment.getReadUnmappedFlag()); rec.setReferenceName(alignment.getReferenceName()); rec.setAlignmentStart(alignment.getAlignmentStart()); rec.setReadNegativeStrandFlag(alignment.getReadNegativeStrandFlag()); rec.setNotPrimaryAlignmentFlag(alignment.getNotPrimaryAlignmentFlag()); rec.setSupplementaryAlignmentFlag(alignment.getSupplementaryAlignmentFlag()); if (!alignment.getReadUnmappedFlag()) { rec.setCigar(alignment.getCigar()); rec.setMappingQuality(alignment.getMappingQuality()); } if (rec.getReadPairedFlag()) { rec.setProperPairFlag(alignment.getProperPairFlag()); } if (rec.getReadNegativeStrandFlag()) { rec.reverseComplement(true); } }
Source:
public Mono<T> doWith(@Nullable Document document) { if (document == null) { return Mono.empty(); } T materializedEntity = reader.read(type, document); return maybeCallAfterConvert(materializedEntity, document, index); }

Target:
public Mono<T> doWith(@Nullable Document document) { if (document == null) { return Mono.empty(); } T entity = reader.read(type, document); return maybeCallAfterConvert(entity, document, index); }
Source:
private void writeServiceProviderMetadataToResource(final String tempMetadata) throws Exception { final WritableResource metadataResource = configuration.getServiceProviderMetadataResource(); if (metadataResource != null && CommonHelper.isNotBlank(tempMetadata)) { if (metadataResource.exists() && !configuration.isForceServiceProviderMetadataGeneration()) { logger.info("Metadata file already exists at {}.", metadataResource.getFilename()); } else { logger.info("Writing sp metadata to {}", metadataResource.getFilename()); File resourceFile; try { resourceFile = metadataResource.getFile(); if (resourceFile != null) { final File parent = resourceFile.getParentFile(); if (parent != null) { logger.info("Attempting to create directory structure for: {}", parent.getCanonicalPath()); if (!parent.exists() && !parent.mkdirs()) { logger.warn("Could not construct the directory structure for SP metadata: {}", parent.getCanonicalPath()); } } } } catch (UnsupportedOperationException e) { logger.warn("no filesystem", e); } final Transformer transformer = TransformerFactory.newInstance().newTransformer(); transformer.setOutputProperty(OutputKeys.INDENT, "yes"); transformer.setOutputProperty("{<LINK_0>}indent-amount", "4"); final StreamResult result = new StreamResult(new StringWriter()); final StreamSource source = new StreamSource(new StringReader(tempMetadata)); transformer.transform(source, result); try (final OutputStream spMetadataOutputStream = metadataResource.getOutputStream()) { spMetadataOutputStream.write(result.getWriter().toString().getBytes(StandardCharsets.UTF_8)); } } } }

Target:
private void writeServiceProviderMetadataToResource(final String tempMetadata) throws Exception { final WritableResource metadataResource = configuration.getServiceProviderMetadataResource(); if (metadataResource != null && CommonHelper.isNotBlank(tempMetadata)) { if (metadataResource.exists() && !configuration.isForceServiceProviderMetadataGeneration()) { logger.info("Metadata resource already exists at {}.", metadataResource); } else { logger.info("Writing sp metadata to {}", metadataResource); configuration.getMetadataResolverFactory().getInstance(metadataResource).createParentDirectories(); final Transformer transformer = TransformerFactory.newInstance().newTransformer(); transformer.setOutputProperty(OutputKeys.INDENT, "yes"); transformer.setOutputProperty("{<LINK_0>}indent-amount", "4"); final StreamResult result = new StreamResult(new StringWriter()); final StreamSource source = new StreamSource(new StringReader(tempMetadata)); transformer.transform(source, result); try (final OutputStream spMetadataOutputStream = metadataResource.getOutputStream()) { spMetadataOutputStream.write(result.getWriter().toString().getBytes(StandardCharsets.UTF_8)); } } } }
Source:
public Fork create( @NotNull(message = "organization can't be NULL") final String organization) { return new Fork() { @Override public JsonObject json() throws IOException { return RtForks.this.request.method(Request.POST) .body().set( Json.createObjectBuilder() .add("organization", organization) .build() ) .back().fetch() .as(RestResponse.class) .assertStatus(HttpURLConnection.HTTP_ACCEPTED) .as(JsonResponse.class).json().readObject(); } }; }

Target:
public Fork create( @NotNull(message = "organization can't be NULL") final String organization) { return new Fork() { @Override public JsonObject json() throws IOException { return RtForks.this.request.method(Request.POST) .fetch() .as(RestResponse.class) .assertStatus(HttpURLConnection.HTTP_ACCEPTED) .as(JsonResponse.class).json().readObject(); } @Override public int number() { throw new UnsupportedOperationException(""); } @Override public void patch(final JsonObject json) throws IOException { throw new UnsupportedOperationException(""); } }; }
Source:
public void bCreateClaimAndUpdateStandaloneTask() { String authenticatedUserId = securityManager.getAuthenticatedUserId(); Task standaloneTask = taskRuntime.create(TaskPayloadBuilder.create() .withName("test task update") .withDescription("test task update description") .withDueDate(new Date()) .withPriority(50) .build()); assertThat(RuntimeTestConfiguration.createdTasks).contains(standaloneTask.getId()); Page<Task> tasks = taskRuntime.tasks(Pageable.of(0, 50)); assertThat(tasks.getTotalItems()).isEqualTo(2); assertThat(tasks.getContent()) .extracting("status", "id") .contains(tuple(Task.TaskStatus.CREATED, standaloneTask.getId())); final UpdateTaskPayload updateTaskPayload = TaskPayloadBuilder.update() .withTaskId(standaloneTask.getId()) .withName(standaloneTask.getName() + " [UPDATED]") .withPriority(60) .withDueDate(new Date()) .withDescription(standaloneTask.getDescription() + " [UPDATED]") .build(); Throwable thrown = catchThrowable(() -> taskRuntime.update(updateTaskPayload)); assertThat(thrown).isInstanceOf(IllegalStateException.class).hasMessage("You cannot update a task where you are not the assignee"); taskRuntime.claim(TaskPayloadBuilder.claim().withTaskId(standaloneTask.getId()).build()); final Task updatedTask = taskRuntime.update(updateTaskPayload); tasks = taskRuntime.tasks(Pageable.of(0, 50)); assertThat(RuntimeTestConfiguration.updatedTasks).contains(updatedTask.getId()); assertThat(tasks.getTotalItems()).isEqualTo(2); assertThat(tasks.getContent()) .extracting("status", "id") .contains(tuple(Task.TaskStatus.ASSIGNED, standaloneTask.getId())); }

Target:
public void bCreateClaimAndUpdateStandaloneTask() { Task standaloneTask = taskRuntime.create(TaskPayloadBuilder.create() .withName("test task update") .withDescription("test task update description") .withDueDate(new Date()) .withPriority(50) .build()); assertThat(RuntimeTestConfiguration.createdTasks).contains(standaloneTask.getId()); Page<Task> tasks = taskRuntime.tasks(Pageable.of(0, 50)); assertThat(tasks.getTotalItems()).isEqualTo(2); assertThat(tasks.getContent()) .extracting("status", "id") .contains(tuple(Task.TaskStatus.CREATED, standaloneTask.getId())); final UpdateTaskPayload updateTaskPayload = TaskPayloadBuilder.update() .withTaskId(standaloneTask.getId()) .withName(standaloneTask.getName() + " [UPDATED]") .withPriority(60) .withDueDate(new Date()) .withDescription(standaloneTask.getDescription() + " [UPDATED]") .build(); Throwable thrown = catchThrowable(() -> taskRuntime.update(updateTaskPayload)); assertThat(thrown).isInstanceOf(IllegalStateException.class).hasMessage("You cannot update a task where you are not the assignee"); taskRuntime.claim(TaskPayloadBuilder.claim().withTaskId(standaloneTask.getId()).build()); final Task updatedTask = taskRuntime.update(updateTaskPayload); tasks = taskRuntime.tasks(Pageable.of(0, 50)); assertThat(RuntimeTestConfiguration.updatedTasks).contains(updatedTask.getId()); assertThat(tasks.getContent()) .extracting("status", "id") .contains(tuple(Task.TaskStatus.ASSIGNED, standaloneTask.getId())); }
Source:
private void executeLocalOperation(final DataOperation operation) { final DataOpType operationType = operation.getOperationType(); final String dataType = operation.getDataType(); final long key = operation.getDataKey(); final Object value = operation.getDataValue(); final boolean result; Object outputData = null; readWriteLock.writeLock().lock(); try { if (operationType == DataOpType.PUT) { if (!dataMap.containsKey(dataType)) { dataMap.put(dataType, new TreeMap<Long, Object>()); } dataMap.get(dataType).put(key, value); result = true; } else if (operationType == DataOpType.GET) { result = dataMap.containsKey(dataType); outputData = result ? dataMap.get(dataType).get(key) : null; } else if (operationType == DataOpType.REMOVE) { if (!dataMap.containsKey(dataType)) { result = false; } else { result = dataMap.get(dataType).remove(key) != null; } } else { throw new RuntimeException("Undefined operation"); } } finally { readWriteLock.writeLock().unlock(); } resultHandler.handleLocalResult(operation, result, outputData); }

Target:
private void executeLocalOperation(final DataOperation operation) { final DataOpType operationType = operation.getOperationType(); final String dataType = operation.getDataType(); final long key = operation.getDataKey(); final Object value = operation.getDataValue().get(); final boolean result; final Object outputData; switch (operationType) { case PUT: readWriteLock.writeLock().lock(); try { if (!dataMap.containsKey(dataType)) { dataMap.put(dataType, new TreeMap<Long, Object>()); } dataMap.get(dataType).put(key, value); result = true; outputData = null; } finally { readWriteLock.writeLock().unlock(); } break; case GET: readWriteLock.readLock().lock(); try { result = dataMap.containsKey(dataType); outputData = result ? dataMap.get(dataType).get(key) : null; } finally { readWriteLock.readLock().unlock(); } break; case REMOVE: readWriteLock.writeLock().lock(); try { if (!dataMap.containsKey(dataType)) { result = false; outputData = null; } else { outputData = dataMap.get(dataType).remove(key); result = outputData != null; } } finally { readWriteLock.writeLock().unlock(); } break; default: throw new RuntimeException("Undefined operation"); } resultHandler.handleLocalResult(operation, result, outputData); }
Source:
public String disableEffectsAsString() { StringBuilder disableEffectsBuffer = new StringBuilder(""); int countdown = getWanDisableEffects().size(); for (ConsoleOptions.WanDisableEffects disabledEffect : getWanDisableEffects()) { disableEffectsBuffer.append(disabledEffect.asString()); if (countdown != 1) { disableEffectsBuffer.append(", "); } countdown--; } return disableEffectsBuffer.toString(); }

Target:
public String disableEffectsAsString() { StringBuilder disableEffectsBuffer = new StringBuilder(); int countdown = getWanDisableEffects().size(); for (ConsoleOptions.WanDisableEffects disabledEffect : getWanDisableEffects()) { disableEffectsBuffer.append(disabledEffect.asString()); if (countdown != 1) { disableEffectsBuffer.append(", "); } countdown--; } return disableEffectsBuffer.toString(); }
Source:
protected AggregateStateId fromString(String s) { checkNotNull(s); final int typeUrlEndIndex = s.indexOf(DIVIDER); checkArgument(typeUrlEndIndex > 0, "Passed string does not contain a type URL."); final String typeUrlString = s.substring(0, typeUrlEndIndex); final TypeUrl typeUrl = TypeUrl.parse(typeUrlString); final int idTypeStartIndex = typeUrlEndIndex + 1; final int idTypeEndIndex = s.indexOf(DIVIDER, idTypeStartIndex); checkArgument(typeUrlEndIndex > 0, "Passed string does not contain the ID type."); final String idTypeString = s.substring(idTypeStartIndex, idTypeEndIndex); final Class idType = idTypeFromString(idTypeString); final String idStringValue = s.substring(idTypeEndIndex + 1); final Object genericId = Stringifiers.fromString(idStringValue, idType); final AggregateStateId result = AggregateStateId.of(genericId, typeUrl); return result; }

Target:
protected AggregateStateId fromString(String s) { checkNotNull(s); final int typeUrlEndIndex = s.indexOf(DIVIDER); checkArgument(typeUrlEndIndex > 0, "Passed string does not contain a type URL."); final String typeUrlString = s.substring(0, typeUrlEndIndex); final TypeUrl typeUrl = TypeUrl.parse(typeUrlString); final int idTypeStartIndex = typeUrlEndIndex + 1; final int idTypeEndIndex = s.indexOf(DIVIDER, idTypeStartIndex); checkArgument(idTypeEndIndex > 0, "Passed string does not contain the ID type."); final String idTypeString = s.substring(idTypeStartIndex, idTypeEndIndex); final Class idType = idTypeFromString(idTypeString); final String idStringValue = s.substring(idTypeEndIndex + 1); final Object genericId = Stringifiers.fromString(idStringValue, idType); final AggregateStateId result = AggregateStateId.of(genericId, typeUrl); return result; }
Source:
public List<String> getGroupsForUser(String userId) { List<String> groups = groupStore.get(userId); if( groups == null ) { groups = new ArrayList<String>(0); } return new java.util.ArrayList<String>(groups); }

Target:
public List<String> getGroupsForUser(String userId) { List<String> groups = groupStore.get(userId); if( groups == null ) { groups = new ArrayList<String>(0); } return new ArrayList<String>(groups); }
Source:
static Set<String> dataStreamsUsingTemplate(final ClusterState state, final String templateName) { final Set<String> dataStreams = state.metadata().dataStreams().keySet(); final ComposableIndexTemplate template = state.metadata().templatesV2().get(templateName); if (template == null) { return Collections.emptySet(); } Set<String> matches = new HashSet<>(); template.indexPatterns().forEach(indexPattern -> matches.addAll(dataStreams.stream().filter(stream -> Regex.simpleMatch(indexPattern, stream)).collect(Collectors.toList()))); return matches; }

Target:
static Set<String> dataStreamsUsingTemplate(final ClusterState state, final String templateName) { final ComposableIndexTemplate template = state.metadata().templatesV2().get(templateName); if (template == null) { return Collections.emptySet(); } final Set<String> dataStreams = state.metadata().dataStreams().keySet(); Set<String> matches = new HashSet<>(); template.indexPatterns().forEach(indexPattern -> matches.addAll(dataStreams.stream().filter(stream -> Regex.simpleMatch(indexPattern, stream)).collect(Collectors.toList()))); return matches; }
Source:
public void testKeepTagsOnTrash() { DocumentModel file = session.createDocumentModel("/", "foo", "File"); file.setPropertyValue("dc:title", "File1"); file = session.createDocument(file); String file1Id = file.getId(); tagService.tag(session, file1Id, "mytag"); Set<String> tags = tagService.getTags(session, file1Id); assertEquals(Collections.singleton("mytag"), tags); Framework.getService(TrashService.class).trashDocument(file); txFeature.nextTransaction(); file = session.getDocument(file.getRef()); assertTrue(file.isTrashed()); tags = tagService.getTags(session, file1Id); assertEquals(Collections.singleton("mytag"), tags); }

Target:
public void testKeepTagsOnTrash() { DocumentModel file = session.createDocumentModel("/", "foo", "File"); file.setPropertyValue("dc:title", "File1"); file = session.createDocument(file); String file1Id = file.getId(); tagService.tag(session, file1Id, "mytag"); Set<String> tags = tagService.getTags(session, file1Id); assertEquals(Collections.singleton("mytag"), tags); Framework.getService(TrashService.class).trashDocument(file); txFeature.nextTransaction(); file.refresh(); assertTrue(file.isTrashed()); tags = tagService.getTags(session, file1Id); assertEquals(Collections.singleton("mytag"), tags); }
Source:
private FeedbackSubmissionEditQuestion createQuestion(FeedbackQuestionAttributes questionAttributes, int qnIndx) { boolean isModeratedQuestion = String.valueOf(questionAttributes.questionNumber).equals(getModeratedQuestion()); return new FeedbackSubmissionEditQuestion(questionAttributes.courseId, questionAttributes.questionNumber, qnIndx, questionAttributes.getId(), questionAttributes.getQuestionDetails().questionText, questionAttributes.getVisibilityMessage(), questionAttributes.questionType, questionAttributes.numberOfEntitiesToGiveFeedbackTo, isModeratedQuestion, questionAttributes.isRecipientNameHidden()); }

Target:
private FeedbackSubmissionEditQuestion createQuestion(FeedbackQuestionAttributes questionAttributes, int qnIndx) { boolean isModeratedQuestion = String.valueOf(questionAttributes.questionNumber).equals(getModeratedQuestion()); return new FeedbackSubmissionEditQuestion(questionAttributes, qnIndx, isModeratedQuestion); }
Source:
public void run() { m_pinActive = !m_pinActive; if (m_pinActive) { m_visualizer.pin(); } else { m_visualizer.unpin(); } m_visualizer.setSelection(m_visualizer.getSelection()); }

Target:
public void run() { m_pinActive = !m_pinActive; if (m_pinActive) { m_visualizer.pin(); } else { m_visualizer.unpin(); } m_visualizer.updateUI(); }
Source:
public void handleGet(RestRequestInfo restRequestInfo) throws RestServiceException { RestRequestMetadata restRequestMetadata = restRequestInfo.getRestRequestMetadata(); logger.trace("Handling GET request - {}", restRequestMetadata.getUri()); try { String operationInUri = getOperationFromRequestUri(restRequestMetadata); logger.trace("GET operation requested - {}", operationInUri); AdminOperationType operationType = AdminOperationType.getAdminOperationType(operationInUri); switch (operationType) { case echo: EchoHandler.handleRequest(restRequestInfo, adminMetrics); break; case getReplicasForBlobId: GetReplicasForBlobIdHandler.handleRequest(restRequestInfo, clusterMap, adminMetrics); break; default: logger.debug("While trying to perform GET: Unsupported operation type - {}", operationType); adminMetrics.unsupportedGetOperation.inc(); throw new RestServiceException("Unsupported operation (" + operationInUri + ") for Admin service", RestServiceErrorCode.UnsupportedOperation); } } finally { if (restRequestInfo.isFirstPart()) { adminMetrics.getOperationRate.mark(); } } }

Target:
public void handleGet(RestRequestInfo restRequestInfo) throws RestServiceException { RestRequestMetadata restRequestMetadata = restRequestInfo.getRestRequestMetadata(); logger.trace("Handling GET request - {}", restRequestMetadata.getUri()); try { String operationInUri = getOperationFromRequestUri(restRequestMetadata); logger.trace("GET operation requested - {}", operationInUri); AdminOperationType operationType = AdminOperationType.getAdminOperationType(operationInUri); switch (operationType) { case echo: EchoHandler.handleRequest(restRequestInfo, adminMetrics); break; case getReplicasForBlobId: GetReplicasForBlobIdHandler.handleRequest(restRequestInfo, clusterMap, adminMetrics); break; default: adminMetrics.unsupportedGetOperationError.inc(); throw new RestServiceException("Unsupported operation during GET (" + operationInUri + ") for Admin service", RestServiceErrorCode.UnsupportedOperation); } } finally { if (restRequestInfo.isFirstPart()) { adminMetrics.getOperationRate.mark(); } } }
Source:
public void testSecondIndexUsedWhenExecutingJoinQuery() throws Exception { locator = clusterRule.startLocatorVM(0); server = clusterRule.startServerVM(1, locator.getPort()); server.invoke(() -> createServerRegionsAndIndexes()); client = clusterRule.startClientVM(2, c -> c.withLocatorConnection(locator.getPort())); client.invoke(() -> createClientRegions()); int numProducts = 1000, numInstruments = 100; client.invoke(() -> loadRegions(numProducts, numInstruments)); long deserializationsBeforeQuery = server.invoke(() -> getDeserializations()); client.invoke(() -> executeQuery(numInstruments)); long deserializationsAfterQuery = server.invoke(() -> getDeserializations()); assertThat(deserializationsAfterQuery - deserializationsBeforeQuery) .isEqualTo((numInstruments * 2) + 1); }

Target:
public void testSecondIndexUsedWhenExecutingJoinQuery() throws Exception { locator = clusterRule.startLocatorVM(0); server = clusterRule.startServerVM(1, locator.getPort()); server.invoke(() -> createServerRegionsAndIndexes()); client = clusterRule.startClientVM(2, c -> c.withLocatorConnection(locator.getPort())); client.invoke(() -> createClientRegions()); int numProducts = 1000; int numInstruments = 100; client.invoke(() -> loadRegions(numProducts, numInstruments)); long deserializationsBeforeQuery = server.invoke(() -> getDeserializations()); client.invoke(() -> executeQuery(numInstruments)); long deserializationsAfterQuery = server.invoke(() -> getDeserializations()); assertThat(deserializationsAfterQuery - deserializationsBeforeQuery) .isEqualTo((numInstruments * 2) + 1); }
Source:
private boolean propertiesTableExists(Connection conn) { try { DatabaseMetaData md = conn.getMetaData(); ResultSet tables = md.getTables(null, null, "PROPERTIES", null); if (tables.next()) { return true; } return false; } catch (SQLException e) { e.printStackTrace(); } return false; }

Target:
private boolean propertiesTableExists(Connection conn) { try { DatabaseMetaData md = conn.getMetaData(); ResultSet tables = md.getTables(null, null, "PROPERTIES", null); if (tables.next()) { return true; } return false; } catch (SQLException e) { log.warn("Ran into problems when checking to see if the PROPERTIES table existed."); log.warn(e.toString()); e.printStackTrace(); } return false; }
Source:
public AkimTheSoaringWind(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{U}{R}{W}"); this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.BIRD); this.subtype.add(SubType.DINOSAUR); this.power = new MageInt(3); this.toughness = new MageInt(4); this.addAbility(FlyingAbility.getInstance()); this.addAbility(new AkimTheSoaringTokenAbility(), new AkimTheSoaringWindWatcher()); this.addAbility(new SimpleActivatedAbility( new GainAbilityControlledEffect( DoubleStrikeAbility.getInstance(), Duration.EndOfTurn, filter, false), new ManaCostsImpl("{3}{U}{R}{W}")) ); }

Target:
public AkimTheSoaringWind(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{U}{R}{W}"); this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.BIRD); this.subtype.add(SubType.DINOSAUR); this.power = new MageInt(3); this.toughness = new MageInt(4); this.addAbility(FlyingAbility.getInstance()); this.addAbility( new AkimTheSoaringTokenAbility() .addHint(new ConditionHint(AkimTheSoaringWindCondition.instance, "You create one or more tokens for the first time each turn")), new AkimTheSoaringWindWatcher() ); this.addAbility(new SimpleActivatedAbility( new GainAbilityControlledEffect( DoubleStrikeAbility.getInstance(), Duration.EndOfTurn, filter, false), new ManaCostsImpl("{3}{U}{R}{W}")) ); }
Source:
private void updateInputPartitionsAndResume(final Task task, final Set<TopicPartition> topicPartitions) { final boolean requiresUpdate = !task.inputPartitions().equals(topicPartitions); if (requiresUpdate) { log.trace("update inputPartitions {}", task, topicPartitions); task.setProcessorTopology(builder.buildSubtopology(task.id().topicGroupId)); for (final TopicPartition inputPartition : task.inputPartitions()) { partitionToTask.remove(inputPartition); } for (final TopicPartition topicPartition : topicPartitions) { partitionToTask.put(topicPartition, task); } task.setInputPartitions(topicPartitions); } task.resume(requiresUpdate); }

Target:
private void updateInputPartitionsAndResume(final Task task, final Set<TopicPartition> topicPartitions) { final boolean requiresUpdate = !task.inputPartitions().equals(topicPartitions); if (requiresUpdate) { log.trace("Update task inputPartitions: current {}, new {}", task, task.inputPartitions(), topicPartitions); for (final TopicPartition inputPartition : task.inputPartitions()) { partitionToTask.remove(inputPartition); } for (final TopicPartition topicPartition : topicPartitions) { partitionToTask.put(topicPartition, task); } task.update(topicPartitions, builder.buildSubtopology(task.id().topicGroupId)); } task.resume(); }
Source:
public Date getCreated() { return created; }

Target:
public Long getCreated() { return created; }
Source:
protected void updateAsync(KeyValPair<byte[], byte[]> tuple) { if (taskQueue.size() > taskBarrier) { try { logger.info("Queue Size: {}, wait time(milli-seconds): {}", taskQueue.size(), taskQueue.size() / taskBarrier); Thread.sleep(taskQueue.size() / taskBarrier); } catch (Exception e) { } } { Slice key = new Slice(tuple.getKey()); Future<Slice> task = store.getAsync(bucketId, key); taskQueue.add(task); taskToPair.put(task, tuple); } while (!taskQueue.isEmpty()) { if (!taskQueue.peek().isDone()) { break; } Future<Slice> task = taskQueue.poll(); insertValueToStore(taskToPair.remove(task)); } }

Target:
protected void updateAsync(KeyValPair<byte[], byte[]> tuple) { if (taskQueue.size() > taskBarrier) { try { logger.info("Queue Size: {}, wait time(milli-seconds): {}", taskQueue.size(), taskQueue.size() / taskBarrier); Thread.sleep(taskQueue.size() / taskBarrier); } catch (Exception e) { } } { Slice key = new Slice(tuple.getKey()); Future<Slice> task = store.getAsync(getTimeByKey(tuple.getKey()), key); taskQueue.add(task); taskToPair.put(task, tuple); } while (!taskQueue.isEmpty()) { if (!taskQueue.peek().isDone()) { break; } Future<Slice> task = taskQueue.poll(); insertValueToStore(taskToPair.remove(task)); } }
Source:
public void putIdsOnQueue(List<String> idList) { var success = send(session -> session.createObjectMessage((ArrayList<String>) idList)); if (success) { idList.forEach(this::addToProcessed); } }

Target:
public void putIdsOnQueue(List<String> idList) { var success = send(session -> session.createObjectMessage((ArrayList<String>) idList)); if (success) { processedRepository.saveBatch(idList); } }
Source:
private void removeOldAndCleanedTasks() { Set<Guid> poolsOfClearedAndOldTasks = removeClearedAndOldTasks(); for (Guid storagePoolID : poolsOfClearedAndOldTasks) { log.infoFormat("AsyncTaskManager::RemoveOldAndCleanedTasks: Cleared all tasks of pool {0}.", storagePoolID); storage_pool storagePool = DbFacade.getInstance().getStoragePoolDAO().get(storagePoolID); if (storagePool != null && storagePool.getspm_vds_id() != null) { VDS vds = DbFacade.getInstance().getVdsDAO().get(storagePool.getspm_vds_id()); if (vds != null && vds.getstatus() == VDSStatus.NonOperational) { log.infoFormat( "AsyncTaskManager::RemoveOldAndCleanedTasks: vds {0} is spm and non-operational, calling SetNonOperationalVds", vds.getvds_name()); SetNonOperationalVdsParameters tempVar = new SetNonOperationalVdsParameters(vds.getId(), NonOperationalReason.GENERAL, null); tempVar.setSaveToDb(true); tempVar.setShouldBeLogged(false); Backend.getInstance().runInternalAction(VdcActionType.SetNonOperationalVds, tempVar); } else { log.info("AsyncTaskManager::RemoveOldAndCleanedTasks: could not find vds that is spm and non-operational."); } } } }

Target:
private void removeOldAndCleanedTasks() { Set<Guid> poolsOfClearedAndOldTasks = removeClearedAndOldTasks(); for (Guid storagePoolID : poolsOfClearedAndOldTasks) { log.infoFormat("AsyncTaskManager::RemoveOldAndCleanedTasks: Cleared all tasks of pool {0}.", storagePoolID); storage_pool storagePool = DbFacade.getInstance().getStoragePoolDAO().get(storagePoolID); if (storagePool != null && storagePool.getspm_vds_id() != null) { VDS vds = DbFacade.getInstance().getVdsDAO().get(storagePool.getspm_vds_id()); if (vds != null && vds.getstatus() == VDSStatus.NonOperational) { log.infoFormat( "AsyncTaskManager::RemoveOldAndCleanedTasks: vds {0} is spm and non-operational, calling SetNonOperationalVds", vds.getvds_name()); SetNonOperationalVdsParameters tempVar = new SetNonOperationalVdsParameters(vds.getId(), NonOperationalReason.GENERAL); tempVar.setSaveToDb(true); tempVar.setShouldBeLogged(false); Backend.getInstance().runInternalAction(VdcActionType.SetNonOperationalVds, tempVar); } else { log.info("AsyncTaskManager::RemoveOldAndCleanedTasks: could not find vds that is spm and non-operational."); } } } }
Source:
private Iterable<ConfigKey<?>> validateAll() { List<ConfigKey<?>> violating = Lists.newArrayList(); BrooklynObjectInternal.ConfigurationSupportInternal configInternal = getConfigurationSupportInternal(); Iterable<ConfigKey<?>> configKeys = getBrooklynObjectTypeConfigKeys(); LOG.trace("Checking config keys on {}: {}", getBrooklynObject(), configKeys); for (ConfigKey<?> configKey : configKeys) { Object value = configInternal.getRaw(configKey).or(configKey.getDefaultValue()); if (value == null || value.getClass().isAssignableFrom(configKey.getType())) { try { Predicate<Object> po = (Predicate<Object>) configKey.getConstraint(); boolean isValid; if (po instanceof BrooklynObjectPredicate) { isValid = BrooklynObjectPredicate.class.cast(po).apply(value, brooklynObject); } else { isValid = po.apply(value); } if (!isValid) { violating.add(configKey); } } catch (Exception e) { LOG.debug("Error checking constraint on ", configKey.getName(), e); } } } return violating; }

Target:
private Iterable<ConfigKey<?>> validateAll() { List<ConfigKey<?>> violating = Lists.newLinkedList(); Iterable<ConfigKey<?>> configKeys = getBrooklynObjectTypeConfigKeys(); LOG.trace("Checking config keys on {}: {}", getBrooklynObject(), configKeys); for (ConfigKey<?> configKey : configKeys) { BrooklynObjectInternal.ConfigurationSupportInternal configInternal = getConfigurationSupportInternal(); Maybe<?> maybeValue = configInternal.getNonBlocking(configKey); if (maybeValue.isPresent()) { ConfigKey<Object> ck = (ConfigKey<Object>) configKey; if (!isValueValid(ck, maybeValue.get())) { violating.add(configKey); } } } return violating; }
Source:
private String generatePreviewSentence() { String outOfSyncPreviewSentence = constants.hostOutOfSyncPreviewSentence(); outOfSyncPreviewSentence = outOfSyncPreviewSentence.replaceAll("Host", "<strong>Host</strong>"); outOfSyncPreviewSentence = outOfSyncPreviewSentence.replaceAll("DC", "<strong>DC</strong>"); final String output = "<p>" + outOfSyncPreviewSentence + "</p>"; return output; }

Target:
private String generatePreviewSentence() { String outOfSyncPreviewSentence = constants.hostOutOfSyncPreviewSentence(); outOfSyncPreviewSentence = outOfSyncPreviewSentence.replaceAll("Host", templates.strongText("Host").asString()); outOfSyncPreviewSentence = outOfSyncPreviewSentence.replaceAll("DC", templates.strongText("DC").asString()); return outOfSyncPreviewSentence; }
Source:
protected void registerPartitions() throws InterruptedException, ParseException { if (!Conduit.isHCatEnabled()) { return; } HCatClient hcatClient = getHCatClient(); if (hcatClient == null) { LOG.warn("Did not get hcat client hence not rgistering partitions"); for (String stream : streamsToProcess) { ConduitMetrics.updateSWGuage(getServiceType(), FAILED_TO_GET_HCAT_CLIENT_COUNT, stream, 1); } return; } try { for (String stream : streamsToProcess) { String tableName = getTableName(stream); preparePartitionsTobeRegistered(stream); if (lastAddedPartitionMap.get(tableName) == FAILED_GET_PARTITIONS) { continue; } List<Path> partitionsTobeRegistered = pathsToBeregisteredPerTable.get(tableName); while (partitionsTobeRegistered.size() > 1) { Path path = partitionsTobeRegistered.get(0); Date date = getTimeStampFromHCatPartition(path.toString(), stream); LOG.info("Adding the partition " + path.toString() + " in " + tableName + " table"); if (addPartition(path.toString(), stream, date.getTime(), tableName, hcatClient)) { partitionsTobeRegistered.remove(0); updateLastAddedPartitionMap(tableName, date.getTime()); } else { break; } } } } finally { addToPool(hcatClient); } }

Target:
protected void registerPartitions() throws InterruptedException, ParseException { if (!Conduit.isHCatEnabled()) { return; } HCatClient hcatClient = getHCatClient(); if (hcatClient == null) { LOG.warn("Did not get hcat client hence not rgistering partitions"); for (String stream : streamsToProcess) { ConduitMetrics.updateSWGuage(getServiceType(), FAILED_TO_GET_HCAT_CLIENT_COUNT, stream, 1); } return; } try { for (String stream : streamsToProcess) { String tableName = getTableName(stream); preparePartitionsTobeRegistered(stream); if (lastAddedPartitionMap.get(tableName) == FAILED_GET_PARTITIONS) { LOG.warn("Failed to get partitions for stream from server hence" + " not registering new partiotions"); continue; } List<Path> partitionsTobeRegistered = pathsToBeregisteredPerTable.get(tableName); while (partitionsTobeRegistered.size() > 1) { Path path = partitionsTobeRegistered.get(0); Date date = getTimeStampFromHCatPartition(path.toString(), stream); LOG.info("Adding the partition " + path.toString() + " in " + tableName + " table"); if (addPartition(path.toString(), stream, date.getTime(), tableName, hcatClient)) { partitionsTobeRegistered.remove(0); updateLastAddedPartitionMap(tableName, date.getTime()); } else { break; } } } } finally { addToPool(hcatClient); } }
Source:
public static void main(String[] args) { String path = "C:\\Users\\nsleheen\\DATA\\6smoker_lab_csv_data\\"; for (int i = 1; i < 7; i++) { String person = "p" + String.format("%02d", i); for (int sid : sIds[i]) { doProcess(person, sid); } } System.setOut(System.out); System.out.println("total puff "+puffcount); }

Target:
public static void main(String[] args) { String path = args[0]; String pathToPuffMarkerModelFile = args[1]; for (int i = 1; i < 7; i++) { String person = "p" + String.format("%02d", i); for (int sid : sIds[i]) { doProcess(person, sid, path, pathToPuffMarkerModelFile); } } }
Source:
private void runTasksInPendingAcquisitionQueue() { ensureInEventLoop(); this.ensureInEventLoop(); int channelsAvailable = this.availableChannels.size(); do { final AcquireTask task = this.pendingAcquisitions.poll(); if (task == null) { break; } final ScheduledFuture<?> timeoutFuture = task.timeoutFuture; if (timeoutFuture != null) { timeoutFuture.cancel(false); } task.acquired(true); this.acquire(task.promise); } while (--channelsAvailable> 0); }

Target:
private void runTasksInPendingAcquisitionQueue() { this.ensureInEventLoop(); int channelsAvailable = this.availableChannels.size(); do { final AcquireTask task = this.pendingAcquisitions.poll(); if (task == null) { break; } task.acquired(true); this.acquire(task.promise); } while (--channelsAvailable > 0); }
Source:
public BaragonGroup(@JsonProperty("name") String name, @JsonProperty("domain") Optional<String> domain, @JsonProperty("trafficSources") Set<TrafficSource> trafficSources, @JsonProperty("sources") Set<String> sources, @JsonProperty("defaultDomain") Optional<String> defaultDomain, @JsonProperty("domains") Set<String> domains) { this.name = name; this.domain = domain; this.defaultDomain = defaultDomain; this.domains = MoreObjects.firstNonNull(domains, Collections.<String>emptySet()); if (sources == null) { setTrafficSources(MoreObjects.firstNonNull(trafficSources, Collections.<TrafficSource>emptySet())); } else if (trafficSources == null) { setSources(sources); } else { setTrafficSources(trafficSources); } }

Target:
public BaragonGroup(@JsonProperty("name") String name, @JsonProperty("domain") Optional<String> domain, @JsonProperty("trafficSources") Set<TrafficSource> trafficSources, @JsonProperty("sources") Set<String> sources, @JsonProperty("defaultDomain") Optional<String> defaultDomain, @JsonProperty("domains") Set<String> domains) { this.name = name; this.domain = domain; this.defaultDomain = defaultDomain; this.domains = MoreObjects.firstNonNull(domains, Collections.<String>emptySet()); this.sources = Collections.emptySet(); if (trafficSources == null && sources != null) { this.trafficSources = sources.stream() .map(source -> new TrafficSource(source, TrafficSourceType.CLASSIC)) .collect(Collectors.<TrafficSource>toSet()); } else { this.trafficSources = MoreObjects.<Set<TrafficSource>>firstNonNull(trafficSources, Collections.<TrafficSource>emptySet()); } }
Source:
public boolean isEnabled() { return selectionMapsToSingleRepository(); }

Target:
public boolean isEnabled() { return true; }
Source:
@Override public void registerMaterializationRules(List<UnifyRule> rules) { materializationRules = rules; }

Target:
@Override public void registerMaterializationRules(List<UnifyRule> rules) { materializationRules = ImmutableList.copyOf(rules); }
Source:
public void cosmosAsyncClient() { TracerProvider tracer = Mockito.spy(new TracerProvider(ServiceLoader.load(Tracer.class))); ReflectionUtils.setTracerProvider(client, tracer); client.createDatabaseIfNotExists(cosmosAsyncDatabase.getId()).block(); Mockito.verify(tracer, Mockito.times(1)).startSpan(Matchers.anyString(), Matchers.anyString(), Matchers.anyString(), Matchers.any(Context.class)); client.readAllDatabases(new FeedOptions()).byPage().single().block(); Mockito.verify(tracer, Mockito.times(2)).startSpan(Matchers.anyString(), Matchers.anyString(), Matchers.anyString(), Matchers.any(Context.class)); String query = "select * from c where c.id = '" + cosmosAsyncDatabase.getId() + "'"; client.queryDatabases(query, new FeedOptions()).byPage().single().block(); Mockito.verify(tracer, Mockito.times(3)).startSpan(Matchers.anyString(), Matchers.anyString(), Matchers.anyString(), Matchers.any(Context.class)); }

Target:
public void cosmosAsyncClient() { TracerProvider tracer = Mockito.spy(new TracerProvider(ServiceLoader.load(Tracer.class))); ReflectionUtils.setTracerProvider(client, tracer); client.createDatabaseIfNotExists(cosmosAsyncDatabase.getId()).block(); Mockito.verify(tracer, Mockito.times(1)).startSpan(Matchers.anyString(), Matchers.anyString(), Matchers.anyString(), Matchers.any(Context.class)); client.readAllDatabases(new CosmosQueryRequestOptions()).byPage().single().block(); Mockito.verify(tracer, Mockito.times(2)).startSpan(Matchers.anyString(), Matchers.anyString(), Matchers.anyString(), Matchers.any(Context.class)); String query = "select * from c where c.id = '" + cosmosAsyncDatabase.getId() + "'"; client.queryDatabases(query, new CosmosQueryRequestOptions()).byPage().single().block(); Mockito.verify(tracer, Mockito.times(3)).startSpan(Matchers.anyString(), Matchers.anyString(), Matchers.anyString(), Matchers.any(Context.class)); }
Source:
public void testNormalizeBySampleAverageWithweightingNoTargetIntervals(final ReadCountCollectionInfo info) { org.broadinstitute.hellbender.utils.Utils.validateArg(info.intervals == null, "this instance given by the DataProvider has intervals and is thus irrelevant"); final boolean weightByTargetSize = true; final ReadCountCollection counts = info.newInstance(); final ReadCountCollection normalizedCounts = counts.normalizeByColumnAverages(weightByTargetSize); }

Target:
public void testNormalizeBySampleAverageWithweightingNoTargetIntervals(final ReadCountCollectionInfo info) { Utils.validateArg(info.intervals == null, "this instance given by the DataProvider has intervals and is thus irrelevant"); final boolean weightByTargetSize = true; final ReadCountCollection counts = info.newInstance(); final ReadCountCollection normalizedCounts = counts.normalizeByColumnAverages(weightByTargetSize); }
Source:
public static float evaluateOceanHeightAtPosition(Vector3f position, float days) { float height = 0.0f; float size = RefractiveReflectiveBlocksNode.waveSize; float intens = RefractiveReflectiveBlocksNode.waveIntens; float timeFactor = RefractiveReflectiveBlocksNode.waveSpeed; for (int i = 0; i < OCEAN_OCTAVES; ++i) { height += (smoothTriangleWave(timeToTick(days, timeFactor) + position.x * OCEAN_WAVE_DIRECTIONS[i].x * size + position.z * OCEAN_WAVE_DIRECTIONS[i].y * size) * 2.0 - 1.0) * intens; size *= RefractiveReflectiveBlocksNode.waveSizeFalloff; intens *= RefractiveReflectiveBlocksNode.waveIntensFalloff; timeFactor *= RefractiveReflectiveBlocksNode.waveSpeedFalloff; } height /= OCEAN_OCTAVES; return height + RefractiveReflectiveBlocksNode.waterOffsetY; }

Target:
public static float evaluateOceanHeightAtPosition(Vector3f position, float days) { float height = 0.0f; float waveSize = RefractiveReflectiveBlocksNode.waveSize; float waveIntensity = RefractiveReflectiveBlocksNode.waveIntensity; float timeFactor = RefractiveReflectiveBlocksNode.waveSpeed; for (int i = 0; i < OCEAN_OCTAVES; ++i) { height += (smoothTriangleWave(timeToTick(days, timeFactor) + position.x * OCEAN_WAVE_DIRECTIONS[i].x * waveSize + position.z * OCEAN_WAVE_DIRECTIONS[i].y * waveSize) * 2.0 - 1.0) * waveIntensity; waveSize *= RefractiveReflectiveBlocksNode.waveSizeFalloff; waveIntensity *= RefractiveReflectiveBlocksNode.waveIntensityFalloff; timeFactor *= RefractiveReflectiveBlocksNode.waveSpeedFalloff; } height /= OCEAN_OCTAVES; return height + RefractiveReflectiveBlocksNode.waterOffsetY; }
Source:
public <T> LazyOptional<T> getCapability(Capability<T> cap, @Nullable EnumFacing side) { for (ICapabilityProvider c : caps) { LazyOptional<T> ret = c.getCapability(cap, side); if (ret == null) { throw new RuntimeException( String.format( "Provider %s.getCapability() returned null; this is not allowed!", c.getClass().getTypeName() ) ); } if (ret.isPresent()) { return ret; } } return LazyOptional.empty(); }

Target:
public <T> LazyOptional<T> getCapability(Capability<T> cap, @Nullable EnumFacing side) { for (ICapabilityProvider c : caps) { LazyOptional<T> ret = c.getCapability(cap, side); if (ret == null) { throw new RuntimeException( String.format( "Provider %s.getCapability() returned null; return LazyOptional.empty() instead!", c.getClass().getTypeName() ) ); } if (ret.isPresent()) { return ret; } } return LazyOptional.empty(); }
Source:
public void test8() { DynamicGraph<Node> dg = new DynamicGraph<>(); Node a1 = new Node("a1"); Node a2 = new Node("a2"); Node b1 = new Node("b1"); Node b2 = new Node("b2"); Node c1 = new Node("c1"); dg.addNode(a1); dg.addNode(a2); dg.addNode(b1); dg.addNode(b2); dg.addNode(c1); dg.addEdge(1, b1, a1, a2); dg.addEdge(1, b2, a1, a2); dg.addEdge(1, c1, b1, b2); dg.addEdge(0, a2, a1, b1, c1); dg.addEdge(0, b2, a1, b1, c1); Node x = new Node("x"); Node y = new Node("y"); dg.addNode(x); dg.addNode(y); dg.addEdge(0, a1, x, y); dg.addEdge(0, b1, x, y); dg.addEdge(0, c1, x, y); assertFreeNodesEquals(dg, y, x); dg.setStatus( dg.getFreeNodes(), Status.FINISHED); assertFreeNodesEquals(dg, a1); dg.setStatus(a1, Status.FINISHED); assertFreeNodesEquals(dg); dg.setStatus(a2, Status.FINISHED); assertFreeNodesEquals(dg, b1); dg.setStatus(b1, Status.FINISHED); assertFreeNodesEquals(dg, b2); dg.setStatus(b2, Status.FINISHED); assertFreeNodesEquals(dg, c1); }

Target:
public void test8() { DynamicGraph<Node> dg = new DynamicGraph<>(); Node a1 = new Node("a1"); Node a2 = new Node("a2"); Node b1 = new Node("b1"); Node b2 = new Node("b2"); Node c1 = new Node("c1"); dg.addNode(a1); dg.addNode(a2); dg.addNode(b1); dg.addNode(b2); dg.addNode(c1); dg.addEdge(1, b1, a1, a2); dg.addEdge(1, b2, a1, a2); dg.addEdge(1, c1, b1, b2); dg.addEdge(0, a2, a1, b1, c1); dg.addEdge(0, b2, a1, b1, c1); Node x = new Node("x"); Node y = new Node("y"); dg.addNode(x); dg.addNode(y); dg.addEdge(0, a1, x, y); dg.addEdge(0, b1, x, y); dg.addEdge(0, c1, x, y); assertFreeNodesEquals(dg, y, x); dg.setStatus(dg.getFreeNodes(), Status.RUNNING); assertFreeNodesEquals(dg); dg.setStatus(x, Status.FINISHED); dg.setStatus(y, Status.FINISHED); assertFreeNodesEquals(dg, a1); dg.setStatus(a1, Status.RUNNING); assertFreeNodesEquals(dg); dg.setStatus(a1, Status.FINISHED); assertFreeNodesEquals(dg, a2); dg.setStatus(a2, Status.RUNNING); assertFreeNodesEquals(dg); dg.setStatus(a2, Status.FINISHED); assertFreeNodesEquals(dg, b1); dg.setStatus(b1, Status.RUNNING); assertFreeNodesEquals(dg); dg.setStatus(b1, Status.FINISHED); assertFreeNodesEquals(dg, b2); dg.setStatus(b2, Status.RUNNING); assertFreeNodesEquals(dg); dg.setStatus(b2, Status.FINISHED); assertFreeNodesEquals(dg, c1); }
Source:
public String toString() { return this.getClass().getSimpleName() + " { " + getPayload() + " }"; }

Target:
public String toString() { return new ToStringBuilder(this) .append("myPayload", myPayload) .toString(); }
Source:
public void prepareForEdit(StorageDomain storage) { getOverride().setIsChangable(isEditable(storage)); super.prepareForEdit(storage); }

Target:
public void prepareForEdit(StorageDomain storage) { super.prepareForEdit(storage); getOverride().setIsChangable(isEditable(storage)); }
Source:
public static File getMissingTestDefinitionTestBundleFile(TemporaryFolder temporaryFolder) throws IOException { ZipEntrySource[] addedEntries = new ZipEntrySource[] { new FileSource(TestFiles.getTestDeploymentDescriptorFile().getName(), TestFiles.getTestDeploymentDescriptorFile()), new FileSource("models/" + TestFiles.getModelsFolderFile().listFiles()[0].getName(), TestFiles.getModelsFolderFile().listFiles()[0]), new FileSource("models/" + TestFiles.getModelsFolderFile().listFiles()[1].getName(), TestFiles.getModelsFolderFile().listFiles()[1]),}; File zipFile = temporaryFolder.newFile(new BigInteger(130, new SecureRandom()).toString(32) + ".zip"); ZipUtil.pack(addedEntries, zipFile); return zipFile; }

Target:
public static File getMissingTestDefinitionTestBundleFile(TemporaryFolder temporaryFolder) throws IOException { ZipEntrySource[] addedEntries = new ZipEntrySource[] {new FileSource(TestFiles.getTestDeploymentDescriptorFile().getName(), TestFiles.getTestDeploymentDescriptorFile())}; File zipFile = temporaryFolder.newFile(new BigInteger(130, new SecureRandom()).toString(32) + ".zip"); ZipUtil.pack(addedEntries, zipFile); addModelsToZipFile(zipFile); return zipFile; }
Source:
public ListenableFuture<Integer> call() throws Exception { switch (taskTracker.getNextAttemptStatus()) { case SUCCESS: return toListenableFuture(CompletableFuture.completedFuture(RESULT)); case SYNC_FAILURE: throw new SyncException("Failed on call " + taskTracker.totalAttemptsMade()); case ASYNC_FAILURE: CompletableFuture<Integer> result = new CompletableFuture<>(); result.completeExceptionally(new AsyncException("Failed on call " + taskTracker.totalAttemptsMade())); return toListenableFuture(result); default: throw new RuntimeException("Unexpected exception type"); } }

Target:
public ListenableFuture<Integer> call() throws Exception { switch (taskTracker.getNextAttemptStatus()) { case SUCCESS: return immediateFuture(RESULT); case SYNC_FAILURE: throw new SyncException("Failed on call " + taskTracker.totalAttemptsMade()); case ASYNC_FAILURE: return immediateFailedFuture(new AsyncException("Failed on call " + taskTracker.totalAttemptsMade())); default: throw new RuntimeException("Unexpected exception type"); } }