auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void evaluateExperienceRepay() { logger.info("[ExperienceRepayScheduler] start..."); try { List<InvestRepayModel> investRepayModels = investRepayMapper.findByLoanId(1); investRepayModels.stream() .filter(investRepayModel -> new DateTime(investRepayModel.getRepayDate()).isBefore(new DateTime().plusDays(1).withTimeAtStartOfDay()) && investRepayModel.getStatus() != RepayStatus.COMPLETE) .collect(Collectors.toList()) .forEach(investRepayModel -> { InvestInfo investInfo = new InvestInfo(); investInfo.setInvestId(investRepayModel.getInvestId()); mqWrapperClient.sendMessage(MessageQueue.InvestSuccess_ExperienceRepay, new InvestSuccessMessage(investInfo, null, null)); logger.info("[ExperienceRepayScheduler] experience invest repay", investRepayModel.getInvestId()); }); } catch (Exception e) { logger.error("[ExperienceRepayScheduler:] job execution is failed.", e); } logger.info("[ExperienceRepayScheduler] done"); }

Target:
public void evaluateExperienceRepay() { logger.info("[ExperienceRepayScheduler] start..."); try { List<InvestRepayModel> investRepayModels = investRepayMapper.findByLoanId(1); investRepayModels.stream() .filter(investRepayModel -> new DateTime(investRepayModel.getRepayDate()).isBefore(new DateTime().plusDays(1).withTimeAtStartOfDay()) && investRepayModel.getStatus() == RepayStatus.REPAYING) .collect(Collectors.toList()) .forEach(investRepayModel -> { InvestInfo investInfo = new InvestInfo(); investInfo.setInvestId(investRepayModel.getInvestId()); mqWrapperClient.sendMessage(MessageQueue.InvestSuccess_ExperienceRepay, new InvestSuccessMessage(investInfo, null, null)); logger.info("[ExperienceRepayScheduler] experience invest repay", investRepayModel.getInvestId()); }); } catch (Exception e) { logger.error("[ExperienceRepayScheduler:] job execution is failed.", e); } logger.info("[ExperienceRepayScheduler] done"); }
Source:
private Resolved resolve() { final ImmutableList.Builder<ImmutableList<ImmutableBitSet>> builder = ImmutableList.builder(); List<SqlNode> extraExprs = ImmutableList.of(); Map<Integer, Integer> groupExprProjection = ImmutableMap.of(); if (select.getGroup() != null) { final SqlNodeList groupList = select.getGroup(); final SqlValidatorUtil.GroupAnalyzer groupAnalyzer = new SqlValidatorUtil.GroupAnalyzer(temporaryGroupExprList); for (SqlNode groupExpr : groupList) { SqlValidatorUtil.analyzeGroupItem(this, groupAnalyzer, builder, groupExpr); } extraExprs = groupAnalyzer.extraExprs; groupExprProjection = groupAnalyzer.groupExprProjection; } final Set<ImmutableBitSet> flatGroupSets = Sets.newTreeSet(ImmutableBitSet.COMPARATOR); final Map<ImmutableBitSet, Integer> groupSetCount = new HashMap<>(); for (List<ImmutableBitSet> groupSet : Linq4j.product(builder.build())) { final ImmutableBitSet set = ImmutableBitSet.union(groupSet); groupSetCount.put(set, groupSetCount.getOrDefault(set, 0) + 1); flatGroupSets.add(set); } if (flatGroupSets.isEmpty()) { flatGroupSets.add(ImmutableBitSet.of()); } return new Resolved(extraExprs, temporaryGroupExprList, flatGroupSets, groupSetCount, groupExprProjection); }

Target:
private Resolved resolve() { final ImmutableList.Builder<ImmutableList<ImmutableBitSet>> builder = ImmutableList.builder(); List<SqlNode> extraExprs = ImmutableList.of(); Map<Integer, Integer> groupExprProjection = ImmutableMap.of(); if (select.getGroup() != null) { final SqlNodeList groupList = select.getGroup(); final SqlValidatorUtil.GroupAnalyzer groupAnalyzer = new SqlValidatorUtil.GroupAnalyzer(temporaryGroupExprList); for (SqlNode groupExpr : groupList) { SqlValidatorUtil.analyzeGroupItem(this, groupAnalyzer, builder, groupExpr); } extraExprs = groupAnalyzer.extraExprs; groupExprProjection = groupAnalyzer.groupExprProjection; } final SortedMap<ImmutableBitSet, Integer> flatGroupSetCount = Maps.newTreeMap(ImmutableBitSet.COMPARATOR); for (List<ImmutableBitSet> groupSet : Linq4j.product(builder.build())) { final ImmutableBitSet set = ImmutableBitSet.union(groupSet); flatGroupSetCount.put(set, flatGroupSetCount.getOrDefault(set, 0) + 1); } if (flatGroupSetCount.isEmpty()) { flatGroupSetCount.put(ImmutableBitSet.of(), 1); } return new Resolved(extraExprs, temporaryGroupExprList, flatGroupSetCount.keySet(), flatGroupSetCount, groupExprProjection); }
Source:
protected Map<String,BatchInputFileType> getListOfFilesToProcess() { Map<String,BatchInputFileType> inputFileTypeMap = new LinkedHashMap<>(); for (BatchInputFileType batchInputFileType : batchInputFileTypes) { List<String> inputFileNames = batchInputFileService.listInputFileNamesWithDoneFile(batchInputFileType); if (inputFileNames == null) { criticalError("BatchInputFileService.listInputFileNamesWithDoneFile(" + batchInputFileType.getFileTypeIdentifer() + ") returned NULL which should never happen."); } else { for (String inputFileName : inputFileNames) { if (StringUtils.isBlank(inputFileName)) { criticalError("One of the file names returned as ready to process [" + inputFileName + "] was blank. This should not happen, so throwing an error to investigate."); } inputFileTypeMap.put(inputFileName, batchInputFileType); } } } return inputFileTypeMap; }

Target:
protected Map<String,BatchInputFileType> getListOfFilesToProcess() { Map<String,BatchInputFileType> inputFileTypeMap = new LinkedHashMap<>(); for (BatchInputFileType batchInputFileType : batchInputFileTypes) { List<String> inputFileNames = batchInputFileService.listInputFileNamesWithDoneFile(batchInputFileType); if (inputFileNames == null) { criticalError("getListOfFilesToProcess: BatchInputFileService.listInputFileNamesWithDoneFile(" + batchInputFileType.getFileTypeIdentifer() + ") returned NULL which should never happen."); } else { for (String inputFileName : inputFileNames) { if (StringUtils.isBlank(inputFileName)) { criticalError("getListOfFilesToProcess: One of the file names returned as ready to process [" + inputFileName + "] was blank. This should not happen, so throwing an error to investigate."); } inputFileTypeMap.put(inputFileName, batchInputFileType); } } } return inputFileTypeMap; }
Source:
public void testBasePathForStartWithFilter() { String basePath1 = "/someAbsolutePath1/someDirectory"; String basePath2 = "someRelativeDirectory2"; String basePath3 = "/someAbsolutePath3/someDirectory"; configureBasePath("project/project/*", basePath1); configureBasePath("project/*", basePath2); configureBasePath("*", basePath3); assertThat(repoCfg.getBasePath(new NameKey("project/project/someProject"))) .isEqualTo(basePath1); assertThat(repoCfg.getBasePath(new NameKey("project/someProject"))) .isEqualTo(basePath2); assertThat(repoCfg.getBasePath(new NameKey("someProject"))).isEqualTo( basePath3); }

Target:
public void testBasePathForStartWithFilter() { String basePath1 = "/someAbsolutePath1/someDirectory"; String basePath2 = "someRelativeDirectory2"; String basePath3 = "/someAbsolutePath3/someDirectory"; String basePath4 = "/someAbsolutePath4/someDirectory"; configureBasePath("pro*", basePath1); configureBasePath("project/project/*", basePath2); configureBasePath("project/*", basePath3); configureBasePath("*", basePath4); assertThat(repoCfg.getBasePath(new NameKey("project1"))) .isEqualTo(basePath1); assertThat(repoCfg.getBasePath(new NameKey("project/project/someProject"))) .isEqualTo(basePath2); assertThat(repoCfg.getBasePath(new NameKey("project/someProject"))) .isEqualTo(basePath3); assertThat(repoCfg.getBasePath(new NameKey("someProject"))).isEqualTo( basePath4); }
Source:
public void testRetainedSizeWithOverlappingBlocks() { Random random = new Random(); int entries = random.nextInt(100) + 1; BlockBuilder blockBuilder = new IntArrayBlockBuilder(new BlockBuilderStatus(), entries); for (int i = 0; i < entries; i++) { blockBuilder.writeInt(i); } Block block = blockBuilder.build(); int arraySize = random.nextInt(200) + 1; int blocks = random.nextInt(10000) + 1; BlockBigArray blockBigArray = new BlockBigArray(); blockBigArray.ensureCapacity(arraySize); for (int i = 0; i < blocks; i++) { blockBigArray.set(i % arraySize, block.getRegion(0, entries)); } ReferenceCountMap referenceCountMap = new ReferenceCountMap(); referenceCountMap.incrementReference(block); long expectedSize = ClassLayout.parseClass(BlockBigArray.class).instanceSize() + referenceCountMap.sizeOf() + (new ObjectBigArray()).sizeOf() + block.getRetainedSizeInBytes() + (min(arraySize, blocks) - 1) * ClassLayout.parseClass(block.getClass()).instanceSize(); assertEquals(blockBigArray.sizeOf(), expectedSize); }

Target:
public void testRetainedSizeWithOverlappingBlocks() { int entries = 123; BlockBuilder blockBuilder = new IntArrayBlockBuilder(new BlockBuilderStatus(), entries); for (int i = 0; i < entries; i++) { blockBuilder.writeInt(i); } Block block = blockBuilder.build(); int arraySize = 456; int blocks = 7890; BlockBigArray blockBigArray = new BlockBigArray(); blockBigArray.ensureCapacity(arraySize); for (int i = 0; i < blocks; i++) { blockBigArray.set(i % arraySize, block.getRegion(0, entries)); } ReferenceCountMap referenceCountMap = new ReferenceCountMap(); referenceCountMap.incrementReference(block); long expectedSize = ClassLayout.parseClass(BlockBigArray.class).instanceSize() + referenceCountMap.sizeOf() + (new ObjectBigArray()).sizeOf() + block.getRetainedSizeInBytes() + (arraySize - 1) * ClassLayout.parseClass(block.getClass()).instanceSize(); assertEquals(blockBigArray.sizeOf(), expectedSize); }
Source:
public CacheConfig(CacheSimpleConfig simpleConfig) throws Exception { this.name = simpleConfig.getName(); if (simpleConfig.getKeyType() != null) { setKeyClassName(simpleConfig.getKeyType()); } if (simpleConfig.getValueType() != null) { setValueClassName(simpleConfig.getValueType()); } this.isStatisticsEnabled = simpleConfig.isStatisticsEnabled(); this.isManagementEnabled = simpleConfig.isManagementEnabled(); this.isReadThrough = simpleConfig.isReadThrough(); this.isWriteThrough = simpleConfig.isWriteThrough(); copyFactories(simpleConfig); initExpiryPolicyFactoryConfig(simpleConfig); this.asyncBackupCount = simpleConfig.getAsyncBackupCount(); this.backupCount = simpleConfig.getBackupCount(); this.inMemoryFormat = simpleConfig.getInMemoryFormat(); if (simpleConfig.getEvictionConfig() != null) { this.evictionConfig = new EvictionConfig(simpleConfig.getEvictionConfig()); } if (simpleConfig.getWanReplicationRef() != null) { this.wanReplicationRef = new WanReplicationRef(simpleConfig.getWanReplicationRef()); } copyListeners(simpleConfig); this.quorumName = simpleConfig.getQuorumName(); this.mergePolicyConfig = simpleConfig.getMergePolicyConfig(); this.hotRestartConfig = new HotRestartConfig(simpleConfig.getHotRestartConfig()); this.eventJournalConfig = new EventJournalConfig(simpleConfig.getEventJournalConfig()); this.disablePerEntryInvalidationEvents = simpleConfig.isDisablePerEntryInvalidationEvents(); }

Target:
public CacheConfig(CacheSimpleConfig simpleConfig) throws Exception { this.name = simpleConfig.getName(); if (simpleConfig.getKeyType() != null) { setKeyClassName(simpleConfig.getKeyType()); } if (simpleConfig.getValueType() != null) { setValueClassName(simpleConfig.getValueType()); } this.isStatisticsEnabled = simpleConfig.isStatisticsEnabled(); this.isManagementEnabled = simpleConfig.isManagementEnabled(); this.isReadThrough = simpleConfig.isReadThrough(); this.isWriteThrough = simpleConfig.isWriteThrough(); copyFactories(simpleConfig); initExpiryPolicyFactoryConfig(simpleConfig); this.asyncBackupCount = simpleConfig.getAsyncBackupCount(); this.backupCount = simpleConfig.getBackupCount(); this.inMemoryFormat = simpleConfig.getInMemoryFormat(); if (simpleConfig.getEvictionConfig() != null) { this.evictionConfig = new EvictionConfig(simpleConfig.getEvictionConfig()); } if (simpleConfig.getWanReplicationRef() != null) { this.wanReplicationRef = new WanReplicationRef(simpleConfig.getWanReplicationRef()); } copyListeners(simpleConfig); this.quorumName = simpleConfig.getQuorumName(); this.mergePolicyConfig = new MergePolicyConfig(simpleConfig.getMergePolicyConfig()); this.hotRestartConfig = new HotRestartConfig(simpleConfig.getHotRestartConfig()); this.eventJournalConfig = new EventJournalConfig(simpleConfig.getEventJournalConfig()); this.disablePerEntryInvalidationEvents = simpleConfig.isDisablePerEntryInvalidationEvents(); }
Source:
private AnalysisJob readAnalysisJob(HdfsResource analysisJobXmlHdfsResource) { final InputStream analysisJobXmlInputStream = analysisJobXmlHdfsResource.read(); final JaxbJobReader jobReader = new JaxbJobReader(_dataCleanerConfiguration); final AnalysisJob analysisJob = jobReader.read(analysisJobXmlInputStream); return analysisJob; }

Target:
private AnalysisJob readAnalysisJob(HdfsResource analysisJobXmlHdfsResource) { final AnalysisJob analysisJob = analysisJobXmlHdfsResource.read(new Func<InputStream, AnalysisJob>() { @Override public AnalysisJob eval(InputStream in) { final JaxbJobReader jobReader = new JaxbJobReader(_dataCleanerConfiguration); final AnalysisJob analysisJob = jobReader.read(in); return analysisJob; } }); return analysisJob; }
Source:
public boolean equals(Object obj) { if (obj == this) { return true; } if (obj instanceof ActivationKey && super.equals(obj)) { ActivationKey that = (ActivationKey) obj; String thisOwnerId = this.getOwner() != null ? this.getOwner().getId() : null; String thatOwnerId = that.getOwner() != null ? that.getOwner().getId() : null; EqualsBuilder builder = new EqualsBuilder() .append(this.getId(), that.getId()) .append(this.getName(), that.getName()) .append(this.getDescription(), that.getDescription()) .append(thisOwnerId, thatOwnerId) .append(this.getReleaseVer(), that.getReleaseVer()) .append(this.getServiceLevel(), that.getServiceLevel()) .append(this.isAutoAttach(), that.isAutoAttach()) .append(this.getPools(), that.getPools()) .append(this.getProducts(), that.getProducts()); return builder.isEquals(); } return false; }

Target:
public boolean equals(Object obj) { if (obj == this) { return true; } boolean equals = false; if (obj instanceof ActivationKey && super.equals(obj)) { ActivationKey that = (ActivationKey) obj; String thisOwnerId = this.getOwner() != null ? this.getOwner().getId() : null; String thatOwnerId = that.getOwner() != null ? that.getOwner().getId() : null; equals = new EqualsBuilder() .append(this.getId(), that.getId()) .append(this.getName(), that.getName()) .append(this.getDescription(), that.getDescription()) .append(thisOwnerId, thatOwnerId) .append(this.getReleaseVer(), that.getReleaseVer()) .append(this.getServiceLevel(), that.getServiceLevel()) .append(this.isAutoAttach(), that.isAutoAttach()) .isEquals(); equals = equals && Util.collectionsAreEqual(this.getPools(), that.getPools(), new Comparator<ActivationKeyPool>() { public int compare(ActivationKeyPool akp1, ActivationKeyPool akp2) { return akp1 == akp2 || (akp1 != null && akp1.equals(akp2)) ? 0 : 1; } }); equals = equals && Util.collectionsAreEqual(this.getProducts(), that.getProducts(), new Comparator<Product>() { public int compare(Product prod1, Product prod2) { return prod1 == prod2 || (prod1 != null && prod1.equals(prod2)) ? 0 : 1; } }); return equals; } return false; }
Source:
public static LockRefreshingLockService create(LockService delegate) { final LockRefreshingLockService ret = new LockRefreshingLockService(delegate); task = executor.scheduleWithFixedDelay(() -> { long startTime = System.currentTimeMillis(); try { ret.refreshLocks(); } catch (Throwable t) { log.warn("Failed to refresh locks", t); } finally { long elapsed = System.currentTimeMillis() - startTime; if (elapsed > LockRequest.getDefaultLockTimeout().toMillis() / 2) { log.warn("Refreshing locks took milliseconds" + " for tokens: {}", elapsed, ret.toRefresh); } else if (elapsed > ret.refreshFrequencyMillis) { log.info("Refreshing locks took milliseconds" + " for tokens: {}", elapsed, ret.toRefresh); } } }, 0, ret.refreshFrequencyMillis, TimeUnit.MILLISECONDS); return ret; }

Target:
public static LockRefreshingLockService create(LockService delegate) { final LockRefreshingLockService ret = new LockRefreshingLockService(delegate); ret.task = executor.scheduleWithFixedDelay(() -> { long startTime = System.currentTimeMillis(); try { ret.refreshLocks(); } catch (Throwable t) { log.warn("Failed to refresh locks", t); } finally { long elapsed = System.currentTimeMillis() - startTime; if (elapsed > LockRequest.getDefaultLockTimeout().toMillis() / 2) { log.warn("Refreshing locks took milliseconds" + " for tokens: {}", elapsed, ret.toRefresh); } else if (elapsed > ret.refreshFrequencyMillis) { log.info("Refreshing locks took milliseconds" + " for tokens: {}", elapsed, ret.toRefresh); } } }, 0, ret.refreshFrequencyMillis, TimeUnit.MILLISECONDS); return ret; }
Source:
private void unschedule() throws IOException { if (forceUnschedule) { unregisterOp(OP_WRITE); scheduled.compareAndSet(true, false); return; } if (dirtyOutputBuffer() || currentFrame != null) { registerOp(OP_WRITE); return; } unregisterOp(OP_WRITE); scheduled.set(false); if (writeQueue.isEmpty() && urgentWriteQueue.isEmpty()) { return; } if (!scheduled.compareAndSet(false, true)) { return; } ioThread.addTask(this); }

Target:
private void unschedule() throws IOException { if (forceUnschedule) { unregisterOp(OP_WRITE); scheduled.set(false); return; } if (dirtyOutputBuffer() || currentFrame != null) { registerOp(OP_WRITE); return; } unregisterOp(OP_WRITE); scheduled.set(false); if (writeQueue.isEmpty() && urgentWriteQueue.isEmpty()) { return; } if (!scheduled.compareAndSet(false, true)) { return; } ioThread.addTask(this); }
Source:
private void readMetastore() throws IgniteCheckedException { try { CheckpointStatus status = readCheckpointStatus(); checkpointReadLock(); try { dataRegion(METASTORE_DATA_REGION_NAME).pageMemory().start(); performBinaryMemoryRestore(status, onlyMetastorageGroup(), physicalRecords(), false); metaStorage = createMetastorage(true); boolean encryptionDisabled = cctx.gridConfig().getEncryptionSpi() instanceof NoopEncryptionSpi; applyLogicalUpdates(status, onlyMetastorageGroup(), encryptionDisabled ? onlyMetastorageRecords() : onlyMetastorageAndEncryptionRecords(), false); fillWalDisabledGroups(); notifyMetastorageReadyForRead(); } finally { metaStorage = null; dataRegion(METASTORE_DATA_REGION_NAME).pageMemory().stop(false); cctx.pageStore().cleanupPageStoreIfMatch(new Predicate<Integer>() { @Override public boolean test(Integer grpId) { return MetaStorage.METASTORAGE_CACHE_ID == grpId; } }, false); checkpointReadUnlock(); } } catch (StorageException e) { cctx.kernalContext().failure().process(new FailureContext(FailureType.CRITICAL_ERROR, e)); throw new IgniteCheckedException(e); } }

Target:
private void readMetastore() throws IgniteCheckedException { try { CheckpointStatus status = readCheckpointStatus(); checkpointReadLock(); try { dataRegion(METASTORE_DATA_REGION_NAME).pageMemory().start(); performBinaryMemoryRestore(status, onlyMetastorageGroup(), physicalRecords(), false); metaStorage = createMetastorage(true); applyLogicalUpdates(status, onlyMetastorageGroup(), onlyMetastorageAndEncryptionRecords(), false); fillWalDisabledGroups(); notifyMetastorageReadyForRead(); } finally { metaStorage = null; dataRegion(METASTORE_DATA_REGION_NAME).pageMemory().stop(false); cctx.pageStore().cleanupPageStoreIfMatch(new Predicate<Integer>() { @Override public boolean test(Integer grpId) { return MetaStorage.METASTORAGE_CACHE_ID == grpId; } }, false); checkpointReadUnlock(); } } catch (StorageException e) { cctx.kernalContext().failure().process(new FailureContext(FailureType.CRITICAL_ERROR, e)); throw new IgniteCheckedException(e); } }
Source:
public void verifyToolRemoved(String toolName) { waitForElementNotPresent( By.xpath(toolbarAddedTool.replace(toolNameReplacement, toolName)) ); PageObjectLogging.log("verifyToolRemoved",toolName + " removed from toolbar", true); }

Target:
public void verifyToolRemoved(String toolName) { waitForElementNotPresent( By.xpath(String.format(toolbarAddedToolxPath, toolName)) ); PageObjectLogging.log("verifyToolRemoved",toolName + " removed from toolbar", true); }
Source:
public void deleteEndpointRegistry() throws APIManagementException { endpointRegistry.deleteEndpointRegistry("abc1"); }

Target:
public void deleteEndpointRegistry() throws APIManagementException { final String REGISTRY_UUID = "abc1"; endpointRegistry.deleteEndpointRegistry(REGISTRY_UUID); Mockito.verify(apiMgtDAO).deleteEndpointRegistry(REGISTRY_UUID); }
Source:
private void addActionsForCommentNotification(NotificationCompat.Builder builder, String noteId) { boolean bActionsSet = false; if (SimperiumUtils.getNotesBucket() != null) { try { Note note = SimperiumUtils.getNotesBucket().get(noteId); if (note != null) { if (note.canReply()) { addCommentReplyActionForCommentNotification(builder, noteId); } if (note.getCommentStatus().equals(CommentStatus.UNAPPROVED)) { if (note.canModerate()) { addCommentApproveActionForCommentNotification(builder, noteId); } } else { if (note.canLike()) { addCommentLikeActionForCommentNotification(builder, noteId); } } } bActionsSet = true; } catch (BucketObjectMissingException e) { e.printStackTrace(); } } if (!bActionsSet) { addCommentReplyActionForCommentNotification(builder, noteId); addCommentLikeActionForCommentNotification(builder, noteId); } }

Target:
private void addActionsForCommentNotification(NotificationCompat.Builder builder, String noteId) { boolean areActionsSet = false; if (SimperiumUtils.getNotesBucket() != null) { try { Note note = SimperiumUtils.getNotesBucket().get(noteId); if (note != null) { if (note.canReply()) { addCommentReplyActionForCommentNotification(builder, noteId); } if (note.getCommentStatus().equals(CommentStatus.UNAPPROVED)) { if (note.canModerate()) { addCommentApproveActionForCommentNotification(builder, noteId); } } else { if (note.canLike()) { addCommentLikeActionForCommentNotification(builder, noteId); } } } areActionsSet = true; } catch (BucketObjectMissingException e) { e.printStackTrace(); } } if (!areActionsSet) { addCommentReplyActionForCommentNotification(builder, noteId); addCommentLikeActionForCommentNotification(builder, noteId); } }
Source:
public OffsetQueue(HermesMetrics metrics, ConfigFactory configFactory) { int queueSize = configFactory.getIntProperty(Configs.CONSUMER_COMMIT_OFFSET_QUEUES_SIZE); this.inflightOffsetsQueue = new MonitoredMpscQueue<>(metrics, "inflightOffsets", queueSize); this.commitOffsetsQueue = new MonitoredMpscQueue<>(metrics, "committedOffsets.", queueSize); }

Target:
public OffsetQueue(HermesMetrics metrics, ConfigFactory configFactory) { int queueSize = configFactory.getIntProperty(Configs.CONSUMER_COMMIT_OFFSET_QUEUES_SIZE); this.inflightOffsetsQueue = new MonitoredMpscQueue<>(metrics, "inflightOffsets", queueSize); this.commitOffsetsQueue = new MonitoredMpscQueue<>(metrics, "committedOffsets", queueSize); }
Source:
private void setField(ExtensionEntity entity, Extension.Builder builder) { for (ExtensionFieldEntity fieldEntity : entity.getFields()) { switch (fieldEntity.getType().getName()) { case "STRING": builder.setField(fieldEntity.getName(), "null"); break; case "INTEGER": builder.setField(fieldEntity.getName(), BigInteger.ZERO); break; case "DECIMAL": builder.setField(fieldEntity.getName(), BigDecimal.ZERO); break; case "BOOLEAN": builder.setField(fieldEntity.getName(), false); break; case "DATE_TIME": builder.setField(fieldEntity.getName(), new Date(0L)); break; case "BINARY": builder.setField(fieldEntity.getName(), ByteBuffer.wrap(new byte[]{})); break; case "REFERENCE": try { builder.setField(fieldEntity.getName(), new URI("<LINK_0>")); } catch (URISyntaxException e) { throw new OsiamBackendFailureException("An unexpected error occured."); } break; default: throw new NoSuchElementException("Type " + fieldEntity.getType().getName() + " does not exist"); } } }

Target:
private void setField(ExtensionEntity entity, Extension.Builder builder) { for (ExtensionFieldEntity fieldEntity : entity.getFields()) { switch (fieldEntity.getType().getName()) { case "STRING": builder.setField(fieldEntity.getName(), "null"); break; case "INTEGER": builder.setField(fieldEntity.getName(), BigInteger.ZERO); break; case "DECIMAL": builder.setField(fieldEntity.getName(), BigDecimal.ZERO); break; case "BOOLEAN": builder.setField(fieldEntity.getName(), false); break; case "DATE_TIME": builder.setField(fieldEntity.getName(), new Date(0L)); break; case "BINARY": builder.setField(fieldEntity.getName(), ByteBuffer.wrap(new byte[]{})); break; case "REFERENCE": try { builder.setField(fieldEntity.getName(), new URI("<LINK_0>")); } catch (URISyntaxException e) { LOGGER.warn("Unable to contruct URI for <LINK_0> This should never happen!", e); throw new OsiamBackendFailureException(); } break; default: throw new NoSuchElementException("Type '" + fieldEntity.getType().getName() + "' does not exist"); } } }
Source:
public static void setup() { TuningContext context = new TuningContext("Pressure").publishSavingEvent(); pressureGauge = FloatMixing.createDispatch(FloatMixing.normalizeFloat(Igneous.makeAnalogInput(0), context.getFloat("pressure-min", 0.0f), context.getFloat("pressure-max", 1.0f)), Igneous.globalPeriodic); Cluck.publish("Pressure Switch", pressureSwitch); Cluck.publish("Pressure Gauge", pressureGauge); Cluck.publish("Compressor", compressor); }

Target:
public static void setup() { TuningContext context = new TuningContext("Pressure").publishSavingEvent(); pressureGauge = FloatMixing.createDispatch(FloatMixing.normalizeFloat(Igneous.makeAnalogInput(0), context.getFloat("pressure-min", 0.0f), context.getFloat("pressure-max", 1.0f)), Igneous.globalPeriodic); Cluck.publish("Pressure Switch", pressureSwitch); Cluck.publish("Pressure Gauge", pressureGauge); Cluck.publish("Compressor Enable", compressor); }
Source:
public List<ArtifactStore> filter( String path, Group group, List<ArtifactStore> concreteStores ) { List<String> candidates = getCandidates( concreteStores ); if ( candidates.isEmpty() ) { logger.debug( "No candidate matches, skip" ); return concreteStores; } String strategyPath = getStrategyPath( group.getKey(), path ); if ( strategyPath == null ) { logger.debug( "Can not get strategy path, group: {}, path: {}", group.getKey(), path ); return concreteStores; } Set<String> ret = new HashSet<>(); int batchSize = indyConfig.getFileSystemContainingBatchSize(); List<List<String>> subSets = Lists.partition( candidates, batchSize ); subSets.forEach( subSet -> { logger.debug( "getFileSystemContaining, strategyPath: {}, subSet: {}", strategyPath, subSet ); Set<String> s = pathMappedFileManager.getFileSystemContainingDirectory( subSet, strategyPath ); ret.addAll( s ); } ); return concreteStores.stream() .filter( store -> store.getType() == StoreType.remote || ret.contains( store.getKey().toString() ) ) .collect( Collectors.toList() ); }

Target:
public List<ArtifactStore> filter( String path, Group group, List<ArtifactStore> concreteStores ) { List<String> candidates = getCandidates( concreteStores ); if ( candidates.isEmpty() ) { logger.debug( "No candidate matches, skip" ); return concreteStores; } String strategyPath = getStrategyPath( group.getKey(), path ); if ( strategyPath == null ) { logger.debug( "Can not get strategy path, group: {}, path: {}", group.getKey(), path ); return concreteStores; } Set<String> ret = new HashSet<>(); int batchSize = indyConfig.getFileSystemContainingBatchSize(); List<List<String>> subSets = Lists.partition( candidates, batchSize ); subSets.forEach( subSet -> { logger.debug( "Get file system containing, strategyPath: {}, subSet: {}", strategyPath, subSet ); Set<String> st = pathMappedFileManager.getFileSystemContainingDirectory( subSet, strategyPath ); if ( st == null ) { logger.warn( "Get fileSystems query failed, add subSet candidates" ); ret.addAll( subSet ); } else { ret.addAll( st ); } } ); return concreteStores.stream() .filter( store -> store.getType() == StoreType.remote || ret.contains( store.getKey().toString() ) ) .collect( Collectors.toList() ); }
Source:
public Timeline2 crawlWordpress(String blogURL, BufferedReader br) { Document blogHTML = null; Post blogPost = null; Elements articles = null; Elements articleList_title = null; Elements articleList_content = null; Elements articleList_dateTime = null; Elements articleList_author = null; Timeline2 blogList = new Timeline2(this.order); try { blogHTML = Jsoup.parse(bufferedReaderToString(br)); } catch (IOException e) { DAO.trace(e); } String[][] blogPostList = new String[100][4]; Integer numberOfBlogs = 0; articles = blogHTML.getElementsByTag("article"); int iterator = 0; for (Element article : articles) { articleList_title = article.getElementsByClass("entry-title"); for (Element blogs : articleList_title) { blogPostList[iterator][0] = blogs.text().toString(); } articleList_dateTime = article.getElementsByClass("posted-on"); for (Element blogs : articleList_dateTime) { blogPostList[iterator][1] = blogs.text().toString(); } articleList_author = article.getElementsByClass("byline"); for (Element blogs : articleList_author) { String author = blogs.text().toString(); author = author.substring(author.indexOf(' ') + 1); blogPostList[iterator][2] = author; } articleList_content = article.getElementsByClass("entry-content"); for (Element blogs : articleList_content) { blogPostList[iterator][3] = blogs.text().toString(); } iterator++; } numberOfBlogs = iterator; for (int k = 0; k < numberOfBlogs; k++) { blogPost = new Post(); blogPost.put("blog_url", blogURL); blogPost.put("title", blogPostList[k][0]); blogPost.put("posted_on", blogPostList[k][1]); blogPost.put("author", blogPostList[k][2]); blogPost.put("content", blogPostList[k][3]); blogList.addPost(blogPost); } return blogList; }

Target:
public Timeline2 crawlWordpress(String blogURL, BufferedReader br) { Post blogPost = null; Timeline2 blogList = new Timeline2(this.order); Document blogHTML = null; Elements articles = null; Elements articleList_title = null; Elements articleList_content = null; Elements articleList_dateTime = null; Elements articleList_author = null; try { blogHTML = Jsoup.parse(bufferedReaderToString(br)); } catch (IOException e) { DAO.trace(e); } articles = blogHTML.getElementsByTag("article"); for (Element article : articles) { blogPost = new Post(); blogPost.put("blog_url", blogURL); articleList_title = article.getElementsByClass("entry-title"); for (Element blogs : articleList_title) { blogPost.put("title", blogs.text().toString()); } articleList_dateTime = article.getElementsByClass("posted-on"); for (Element blogs : articleList_dateTime) { blogPost.put("posted_on", blogs.text().toString()); } articleList_author = article.getElementsByClass("byline"); for (Element blogs : articleList_author) { String author = blogs.text().toString(); author = author.substring(author.indexOf(' ') + 1); blogPost.put("author", author); } articleList_content = article.getElementsByClass("entry-content"); for (Element blogs : articleList_content) { blogPost.put("content", blogs.text().toString()); } blogList.addPost(blogPost); } return blogList; }
Source:
public static List<Alarm> disableExpiredNoneRepeatedAlarms(final List<Alarm> alarms, long currentTimestampUTC, final DateTimeZone timeZone){ final ArrayList<Alarm> newAlarmList = new ArrayList<>(); for(final Alarm alarm:alarms){ if(alarm.isRepeated){ newAlarmList.add(alarm); continue; } if(isAlarmExpired(alarm, new DateTime(currentTimestampUTC, DateTimeZone.UTC), timeZone)){ final Alarm disabledAlarm = new Alarm(alarm.year, alarm.month, alarm.day, alarm.hourOfDay, alarm.minuteOfHour, new HashSet<Integer>(), false, false, alarm.isEditable, alarm.sound); newAlarmList.add(disabledAlarm); }else{ newAlarmList.add(alarm); } } return ImmutableList.copyOf(newAlarmList); }

Target:
public static List<Alarm> disableExpiredNoneRepeatedAlarms(final List<Alarm> alarms, long currentTimestampUTC, final DateTimeZone timeZone){ final ArrayList<Alarm> newAlarmList = new ArrayList<>(); for(final Alarm alarm:alarms){ if(isAlarmExpired(alarm, new DateTime(currentTimestampUTC, DateTimeZone.UTC), timeZone)){ final Alarm disabledAlarm = new Alarm(alarm.year, alarm.month, alarm.day, alarm.hourOfDay, alarm.minuteOfHour, new HashSet<Integer>(), false, false, alarm.isEditable, alarm.sound); newAlarmList.add(disabledAlarm); }else{ newAlarmList.add(alarm); } } return ImmutableList.copyOf(newAlarmList); }
Source:
public ZipVerifier(InputStream keyStoreInputStream, String keyStorePass) throws InvalidKeyStoreException, KeyStoreException, InvalidAlgorithmParameterException, NoSuchAlgorithmException { assert (keyStoreInputStream != null && keyStorePass != null); initPKIXParameter(keyStoreInputStream, keyStorePass); Calendar cal = Calendar.getInstance(); cal.set(Calendar.YEAR, 2019); cal.set(Calendar.MONTH, 0); cal.set(Calendar.DAY_OF_MONTH, 01); defaultSignatureTimeStamp = cal.getTime(); }

Target:
public ZipVerifier(InputStream keyStoreInputStream, String keyStorePass) throws InvalidKeyStoreException, KeyStoreException, InvalidAlgorithmParameterException, NoSuchAlgorithmException { assert (keyStoreInputStream != null && keyStorePass != null); initPKIXParameter(keyStoreInputStream, keyStorePass); defaultSignatureTimeStamp = Date.from(LocalDate.of(2019, 1, 1).atStartOfDay(ZoneId.systemDefault()).toInstant()); }
Source:
public void testSaveNullId() throws Exception { Document expectedDocument = new Document(); expectedDocument.setId(null); expectedDocument.setTimestamp(System.currentTimeMillis()); JsonNode data = mapper.valueToTree(Collections.singletonMap("TEST_NAME", "SINGLE_SAVE_TEST")); expectedDocument.setData(data); queryStore.save(TestUtils.TEST_TABLE_NAME, expectedDocument); }

Target:
public void testSaveNullId() throws Exception { Document expectedDocument = new Document(); expectedDocument.setId(null); expectedDocument.setTimestamp(System.currentTimeMillis()); JsonNode data = mapper.valueToTree(Collections.singletonMap("TEST_NAME", "SINGLE_SAVE_TEST")); expectedDocument.setData(data); try { queryStore.save(TestUtils.TEST_TABLE_NAME, expectedDocument); } catch (QueryStoreException e) { assertEquals(QueryStoreException.ErrorCode.INVALID_REQUEST, e.getErrorCode()); throw e; } }
Source:
public Collection<Ref> call() throws GitAPIException, InvalidRemoteException, org.eclipse.jgit.api.errors.TransportException { return callAsMap().values(); }

Target:
public Collection<Ref> call() throws GitAPIException, InvalidRemoteException, org.eclipse.jgit.api.errors.TransportException { return execute().values(); }
Source:
public Configuration getConfiguration(GraphContext context) { AbstractIterationOperation<JavaTypeReferenceModel> addTypeRefToList = new AbstractIterationOperation<JavaTypeReferenceModel>() { @Override public void perform(GraphRewrite event, EvaluationContext context, JavaTypeReferenceModel payload) { typeReferences.add(payload); } }; return ConfigurationBuilder.begin() .addRule() .when(JavaClass.references("org.jboss.forge.furnace.{name}").inType("{file}{suffix}").at(TypeReferenceLocation.IMPORT)) .perform( Classification.as("Furnace Service {file}").withDescription("Described by {file}").with(Link.to("JBoss Forge", "<LINK_0>")).withEffort(0) .and(Hint.withText("Furnace type references (such as {name}) imply that the client code must be run within a Furnace container.") .withEffort(8) .and(addTypeRefToList)) ) .where("suffix").matches("\\d") .addRule() .when(JavaClass.references("org.jboss.forge.furnace.{name}").inType("{file}{suffix}").at(TypeReferenceLocation.IMPORT)) .perform( Classification.as("Classification {param} does not exist") .and(Hint.withText("Hint {param} does not exist").withEffort(8)) ); }

Target:
public Configuration getConfiguration(GraphContext context) { AbstractIterationOperation<JavaTypeReferenceModel> addTypeRefToList = new AbstractIterationOperation<JavaTypeReferenceModel>() { @Override public void perform(GraphRewrite event, EvaluationContext context, JavaTypeReferenceModel payload) { typeReferences.add(payload); } }; return ConfigurationBuilder.begin() .addRule() .when(JavaClass.references("org.jboss.forge.furnace.{name}").inType("{file}{suffix}").at(TypeReferenceLocation.IMPORT)) .perform( Classification.as("Furnace Service {file}").withDescription("Described by {file}").with(Link.to("JBoss Forge", "<LINK_0>")).withEffort(0) .and(Hint.withText("Furnace type references (such as {name}) imply that the client code must be run within a Furnace container.") .withEffort(8) .and(addTypeRefToList)) ) .where("suffix").matches("\\d") .addRule() .when(JavaClass.references("org.jboss.forge.furnace.{name}").inType("{file}{suffix}").at(TypeReferenceLocation.IMPORT)) .perform( Classification.as("Classification {param} does not exist"), Hint.withText("Hint {param} does not exist").withEffort(8) ); }
Source:
public NexmoSmsSender(final NexmoProperties nexmo) { val builder = new NexmoClient.Builder(); builder.apiKey(nexmo.getApiToken()) .apiSecret(nexmo.getApiSecret()); if (StringUtils.isNotBlank(nexmo.getPrivateKeyContentsPath())) { try { builder.applicationId(StringUtils.isNotBlank(nexmo.getApplicationId()) ? nexmo.getApplicationId() : DEFAULT_APPLICATION_ID) .privateKeyPath(nexmo.getPrivateKeyContentsPath()); } catch (IOException e) { LOGGER.error("No NEXMO private key found", e); } } this.nexmoClient = builder.build(); }

Target:
public NexmoSmsSender(final NexmoProperties nexmo) { val builder = new NexmoClient.Builder(); this.nexmoClient = builder.apiKey(nexmo.getApiToken()) .apiSecret(nexmo.getApiSecret()) .signatureSecret(nexmo.getSignatureSecret()).build(); }
Source:
void caption() { assertEquals("", TreeNode.createCaption("")); assertEquals("@", TreeNode.createCaption("@")); assertEquals("@.", TreeNode.createCaption("@\t")); assertEquals("@..", TreeNode.createCaption("@\t\n")); assertEquals("@...", TreeNode.createCaption("@\t\n\r")); assertEquals("@".repeat(80) + "...", TreeNode.createCaption("@".repeat(1000))); }

Target:
void caption() { assertEquals("", TreeNode.createCaption("")); assertEquals("[@@]", TreeNode.createCaption("[@@]")); assertEquals("[@ @]", TreeNode.createCaption("[@ @]")); assertEquals("[@ @]", TreeNode.createCaption("[@\u000B@]")); assertEquals("[@ @]", TreeNode.createCaption("[@\t@]")); assertEquals("[@ @]", TreeNode.createCaption("[@\t\n@]")); assertEquals("[@ @]", TreeNode.createCaption("[@\t\n\r@]")); assertEquals("[@ @]", TreeNode.createCaption("[@\t\n\r\f@]")); assertEquals("@".repeat(80) + "...", TreeNode.createCaption("@".repeat(1000) + "!")); }
Source:
public void writeToDSTFile(File dstFile) throws IOException { FileOutputStream fileStream = new FileOutputStream(dstFile); writeHeader(fileStream); writeStitchPoints(fileStream); writeEnd(fileStream); fileStream.flush(); fileStream.close(); }

Target:
public void writeToDSTFile(File dstFile) throws IOException { try (FileOutputStream fileStream = new FileOutputStream(dstFile)) { stream.getHeader().appendToStream(fileStream); writeStitchPoints(fileStream); fileStream.write(DSTFileConstants.FILE_END); } }
Source:
private Long getRegistrationMillis(String playerName) { if (!isRegistered(playerName.toLowerCase())) { return null; } PlayerAuth auth = playerCache.getAuth(playerName); if (auth == null) { auth = dataSource.getAuth(playerName); } if (auth != null) { return auth.getRegistrationDate(); } return null; }

Target:
private Long getRegistrationMillis(String playerName) { PlayerAuth auth = playerCache.getAuth(playerName); if (auth == null) { auth = dataSource.getAuth(playerName); } if (auth != null) { return auth.getRegistrationDate(); } return null; }
Source:
public void triggerRedeploy() { if (this.userCanDeployProject()) { if(workspaceProjectContext.getActiveModule().get().getPom().getGav().isSnapshot()) { this.buildExecutor.triggerRedeploy(); } } }

Target:
public void triggerRedeploy() { if (deployEnabled && redeployEnabled) { this.buildExecutor.triggerRedeploy(); } }
Source:
public IncrementableEntryVersion increment(IncrementableEntryVersion initialVersion) { if (initialVersion instanceof NumericVersion) { NumericVersion old = (NumericVersion) initialVersion; long counter = old.getVersion() + 1; return createNumericVersion(counter); } throw new IllegalArgumentException( "Unexpected initial version type (only NumericVersion instances supported): " + initialVersion.getClass().getName()); }

Target:
public IncrementableEntryVersion increment(IncrementableEntryVersion initialVersion) { if (initialVersion instanceof NumericVersion) { NumericVersion old = (NumericVersion) initialVersion; long counter = old.getVersion() + 1; return createNumericVersion(counter); } throw log.unexpectedInitialVersion(initialVersion.getClass().getName()); }
Source:
public static String getContainerId(int index) { return "" + index; }

Target:
public static String getContainerId(int index) { return Integer.toString(index); }
Source:
public void transform(StructuredRecord input, Emitter<StructuredRecord> emitter) throws Exception { LOG.debug("in transform start :" + input.get("name")); Schema outputSchema = getOutputSchema(input.getSchema()); StructuredRecord.Builder builder = createOutputRecords(input, outputSchema); StructuredRecord ss = builder.build(); LOG.debug("in transform end :" + ss.get("designationName")); emitter.emit(ss); }

Target:
public void transform(StructuredRecord input, Emitter<StructuredRecord> emitter) throws Exception { StructuredRecord.Builder builder = StructuredRecord.builder(getOutputSchema(input.getSchema())); for (Schema.Field sourceField : input.getSchema().getFields()) { String sourceFieldName = sourceField.getName(); if (mappingValues.containsKey(sourceFieldName)) { ValueMapping mapping = mappingValues.get(sourceFieldName); String sourceVal = input.get(sourceFieldName); if (sourceVal == null || sourceVal.isEmpty()) { if (mapping.getDefaultValue() != null) { builder.set(mapping.getTargetField(), mapping.getDefaultValue()); } else { builder.set(mapping.getTargetField(), sourceVal); } } else { Lookup<String> valueMapperLookUp = lookupTableCache.get(mapping.getLookupTableName()); String lookupValue = valueMapperLookUp.lookup(sourceVal); if (lookupValue != null && !lookupValue.isEmpty()) { builder.set(mapping.getTargetField(), lookupValue); } else { builder.set(mapping.getTargetField(), mapping.getDefaultValue()); } } } else { builder.set(sourceFieldName, input.get(sourceFieldName)); } } emitter.emit(builder.build()); }
Source:
public void setInstalledLineNumber(int line) throws CoreException { int existingValue = ensureMarker().getAttribute(IMarker.LINE_NUMBER, -1); if (line != existingValue) { this.getMarker().setAttribute(MOVE_BACK_BREAKPOINT, Boolean.TRUE); setAttribute(IMarker.LINE_NUMBER, line); setAttribute( IMarker.MESSAGE, getMarkerMessage() ); } }

Target:
public void setInstalledLineNumber(int line) throws CoreException { int existingValue = ensureMarker().getAttribute(IMarker.LINE_NUMBER, -1); if (line != existingValue) { this.getMarker().setAttribute(RESET_INSTALLED_LOCATION, Boolean.TRUE); setAttribute(IMarker.LINE_NUMBER, line); setAttribute( IMarker.MESSAGE, getMarkerMessage() ); } }
Source:
public static Collection<StateBackend> data() { int fileStateSizeThreshold = 1024; return Arrays.asList( new FsStateBackend(new Path("file:/ new RocksDBStateBackend( (StateBackend) new FsStateBackend(new Path("file:/ ) ); }

Target:
public static Collection<StateBackend> data() { return Arrays.asList( new FsStateBackend(new Path("file:/ new RocksDBStateBackend( (StateBackend) new FsStateBackend(new Path("file:/ ) ); }
Source:
public ActionResult execute() { Intent intent = Intent.valueOf(getNonNullRequestParamValue(Const.ParamsNames.INTENT)); String regkey = getNonNullRequestParamValue(Const.ParamsNames.REGKEY); boolean isValid = true; boolean isLoggedIn = userInfo != null; if (intent == Intent.STUDENT_SUBMISSION || intent == Intent.STUDENT_RESULT) { StudentAttributes student = logic.getStudentForRegistrationKey(regkey); if (!StringHelper.isEmpty(student.googleId)) { if (isLoggedIn) { isValid = student.googleId.equals(userInfo.id); } else { isValid = false; } } return new JsonResult(new RegkeyValidityData(isValid, isLoggedIn)); } return new JsonResult(new RegkeyValidityData(false, isLoggedIn)); }

Target:
public ActionResult execute() { Intent intent = Intent.valueOf(getNonNullRequestParamValue(Const.ParamsNames.INTENT)); String regkey = getNonNullRequestParamValue(Const.ParamsNames.REGKEY); if (intent == Intent.STUDENT_SUBMISSION || intent == Intent.STUDENT_RESULT) { boolean isValid = false; StudentAttributes student = logic.getStudentForRegistrationKey(regkey); if (student != null) { if (StringHelper.isEmpty(student.googleId)) { isValid = true; } else { isValid = userInfo != null && student.googleId.equals(userInfo.id); } } return new JsonResult(new RegkeyValidityData(isValid)); } return new JsonResult(new RegkeyValidityData(false)); }
Source:
public void setDistanceTolerance(int distanceTolerance) { if (distanceTolerance < MIN_DISTANCE_TOLERANCE) { this.distanceTolerance = MIN_DISTANCE_TOLERANCE; } else { this.distanceTolerance = distanceTolerance; } }

Target:
public void setDistanceTolerance(int distanceTolerance) { if (distanceTolerance < MIN_DISTANCE_TOLERANCE_IN_METERS) { this.distanceTolerance = distanceTolerance; LOGGER.debug( "Admin supplied distance tolerance is too low. Defaulting to the minimum of meter", MIN_DISTANCE_TOLERANCE_IN_METERS); } else { this.distanceTolerance = distanceTolerance; } }
Source:
private String convertLink(String link) { return link.replace("mandate", "agreement"); }

Target:
private String convertLink(String link) { return link.replace("&mandate_", "&agreement_"); }
Source:
public MergedSelectionSet collectFields(FieldCollectorParameters parameters, MergedField mergedField) { Map<String, MergedField> subFields = new LinkedHashMap<>(); Set<String> visitedFragments = new HashSet<>(); for (Field field : mergedField.getFields()) { if (field.getSelectionSet() == null) { continue; } this.collectFields(parameters, field.getSelectionSet(), visitedFragments, subFields); } return newMergedSelectionSet().subFields(subFields).build(); }

Target:
public MergedSelectionSet collectFields(FieldCollectorParameters parameters, MergedField mergedField) { Map<String, MergedField> subFields = new LinkedHashMap<>(); Set<String> visitedFragments = new LinkedHashSet<>(); for (Field field : mergedField.getFields()) { if (field.getSelectionSet() == null) { continue; } this.collectFields(parameters, field.getSelectionSet(), visitedFragments, subFields); } return newMergedSelectionSet().subFields(subFields).build(); }
Source:
public WUQueryResponse workUnitUQuery(String wuid, String jobname, String cluster, String type, String sortby, String state, String endDate, String startDate, Long pageStartFrom, Long pageSize, Integer count, String owner, String appName, String appKey, String appData) throws Exception { WUQueryResponse wuQueryResponse = null; if (wsWorkunitsServiceSoapProxy == null) throw new Exception("wsWorkunitsServiceSoapProxy not available"); else { WUQuery request = new WUQuery(); if (cluster != null) request.setCluster(cluster); if (type != null) request.setType(type); if (sortby != null) request.setSortby(sortby); if (pageStartFrom != null) request.setPageStartFrom(pageStartFrom); if (pageSize != null) request.setPageSize(pageSize); if (state != null) request.setState(state); if (startDate != null) request.setStartDate(startDate); if (endDate != null) request.setEndDate(endDate); if (wuid != null) request.setWuid(wuid); if (jobname != null) request.setJobname(jobname); if (count != null) request.setCount(count); if (owner != null) request.setOwner(owner); ApplicationValue applicationValue[] = {new ApplicationValue(appKey,appName,appData)}; request.setApplicationValues(applicationValue); wuQueryResponse = wsWorkunitsServiceSoapProxy.WUQuery(request); ArrayOfEspException arrayOfEspException = wuQueryResponse.getExceptions(); if (arrayOfEspException != null) { throwWsWUExceptions(arrayOfEspException, "Error in WU query"); } } return wuQueryResponse; }

Target:
public WUQueryResponse workUnitUQuery(String wuid, String jobname, String cluster, String type, String sortby, String state, String endDate, String startDate, Long pageStartFrom, Long pageSize, Integer count, String owner, String appName, String appKey, String appData) throws Exception { ApplicationValue[] applicationValues = {new ApplicationValue(appKey,appName,appData)}; return this.workUnitUQuery(wuid, jobname, cluster, type, sortby, state, endDate, startDate, pageStartFrom, pageSize, count, owner, applicationValues); }