auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void convertMutations(TabletServerMutations<QCMutation> mutations, Map<Long,CMK> cmidToCm, MutableLong cmid, Map<TKeyExtent,List<TConditionalMutation>> tmutations, CompressedIterators compressedIters) { mutations.getMutations().forEach((keyExtent, mutationList) -> { ArrayList<TConditionalMutation> tcondMutaions = new ArrayList<>(); for (var cm : mutationList) { TMutation tm = cm.toThrift(); List<TCondition> conditions = convertConditions(cm, compressedIters); cmidToCm.put(cmid.longValue(), new CMK(keyExtent, cm)); TConditionalMutation tcm = new TConditionalMutation(conditions, tm, cmid.longValue()); cmid.increment(); tcondMutaions.add(tcm); } tmutations.put(keyExtent.toThrift(), tcondMutaions); }); }

Target:
private void convertMutations(TabletServerMutations<QCMutation> mutations, Map<Long,CMK> cmidToCm, MutableLong cmid, Map<TKeyExtent,List<TConditionalMutation>> tmutations, CompressedIterators compressedIters) { mutations.getMutations().forEach((keyExtent, mutationList) -> { var tcondMutaions = new ArrayList<TConditionalMutation>(); for (var cm : mutationList) { TMutation tm = cm.toThrift(); List<TCondition> conditions = convertConditions(cm, compressedIters); cmidToCm.put(cmid.longValue(), new CMK(keyExtent, cm)); TConditionalMutation tcm = new TConditionalMutation(conditions, tm, cmid.longValue()); cmid.increment(); tcondMutaions.add(tcm); } tmutations.put(keyExtent.toThrift(), tcondMutaions); }); }
Source:
public SolenoidSubsystem(String name, boolean isInverted, SolenoidState defaultState, DoubleSolenoid... solenoids) { setName(name); setDefaultCommand(new SolenoidSet(this, defaultState)); this.solenoids = solenoids; this.isInverted = isInverted; this.defaultState = defaultState; this.state = defaultState; }

Target:
public SolenoidSubsystem(String name, boolean isInverted, SolenoidState defaultState, DoubleSolenoid... solenoids) { super(); setName(name); setDefaultCommand(new SolenoidSet(this, defaultState)); this.solenoids = solenoids; this.isInverted = isInverted; this.defaultState = defaultState; this.state = defaultState; }
Source:
public CompletableFuture<Long> getUsage(PublicKeyHash owner) { Stat stat = state.currentView.get(owner); if (stat == null) return CompletableFuture.completedFuture(0L); Usage usage = state.usage.get(stat.owner); if (usage == null) return CompletableFuture.completedFuture(0L); return CompletableFuture.completedFuture(usage.usage); }

Target:
public CompletableFuture<Long> getUsage(PublicKeyHash owner) { Stat stat = state.currentView.get(owner); if (stat == null) return Futures.errored(new IllegalStateException("Unknown identity key: " + owner)); Usage usage = state.usage.get(stat.owner); if (usage == null) return Futures.errored(new IllegalStateException("No usage present for user: " + stat.owner)); return CompletableFuture.completedFuture(usage.totalBytes); }
Source:
public Builder setPGStartupWait(Duration pgStartupWait) { if (pgStartupWait != null && pgStartupWait.isNegative()) { pgStartupWait = null; } Objects.requireNonNull(pgStartupWait); this.pgStartupWait = pgStartupWait; return this; }

Target:
public Builder setPGStartupWait(Duration pgStartupWait) { Objects.requireNonNull(pgStartupWait); if (pgStartupWait.isNegative()) { throw new IllegalArgumentException("Negative durations are not permitted."); } this.pgStartupWait = pgStartupWait; return this; }
Source:
private void assertJobHasStoppedOrFail(String jobName, long timeoutInMillis) throws InterruptedException { long startTime = System.currentTimeMillis(); long endTime = startTime + timeoutInMillis; while (startTime < endTime + 1000) { page.clickButton("Refresh"); if (page.getBatchStatusFromRow(page.selectRowForJob(jobName)).equals("STOPPED")) { return; } TimeUnit.MILLISECONDS.sleep(500); startTime = System.currentTimeMillis(); } fail("Job should have been STOPPED by now"); }

Target:
private void assertJobHasStoppedOrFail(String jobName, long timeoutInMillis) throws InterruptedException { BatchTableRowFragment jobRow = page.selectRowForJobXmlName(jobName); long currentTime = System.currentTimeMillis(); long endTime = currentTime + timeoutInMillis; while (currentTime < endTime + 1000) { page.clickButton("Refresh"); if (jobRow.getBatchStatusValue().equals("STOPPED")) { return; } TimeUnit.MILLISECONDS.sleep(500); currentTime = System.currentTimeMillis(); } fail("Job should have been STOPPED by now"); }
Source:
protected void executeVmCommand() { Guid createdSnapshotId = updateActiveSnapshotId(); setActionReturnValue(createdSnapshotId); getParameters().setCreatedSnapshotId(createdSnapshotId); MemoryImageBuilder memoryImageBuilder = getMemoryImageBuilder(); freezeVm(); ActionReturnValue actionReturnValue = createSnapshotsForDisks(); if (actionReturnValue.getSucceeded()) { memoryImageBuilder.build(); addSnapshotToDB(createdSnapshotId, memoryImageBuilder); fastForwardDisksToActiveSnapshot(); setSucceeded(true); } else { setSucceeded(false); } }

Target:
protected void executeVmCommand() { Guid createdSnapshotId = updateActiveSnapshotId(); setActionReturnValue(createdSnapshotId); getParameters().setCreatedSnapshotId(createdSnapshotId); MemoryImageBuilder memoryImageBuilder = getMemoryImageBuilder(); freezeVm(); ActionReturnValue actionReturnValue = createSnapshotsForDisks(); if (actionReturnValue.getSucceeded()) { memoryImageBuilder.build(); addSnapshotToDB(createdSnapshotId, memoryImageBuilder); fastForwardDisksToActiveSnapshot(); setSucceeded(true); } }
Source:
public UnifiedPushArchive withMessageDrivenBeans() { return addClasses(AbstractJMSMessageListener.class) .addClasses(MessageHolderWithVariantsConsumer.class, MessageHolderWithVariantsProducer.class) .addClasses(MessageHolderWithTokensConsumer.class, MessageHolderWithTokensProducer.class) .addClasses(TriggerMetricCollectionConsumer.class) .addAsWebInfResource(new File("../../servers/ups-wildfly/src/main/webapp/WEB-INF/jboss-ejb3.xml"), "jboss-ejb3.xml"); }

Target:
public UnifiedPushArchive withMessageDrivenBeans() { return addClasses(AbstractJMSMessageListener.class) .addClasses(MessageHolderWithVariantsConsumer.class, MessageHolderWithVariantsProducer.class) .addClasses(MessageHolderWithTokensConsumer.class, MessageHolderWithTokensProducer.class) .addClasses(TriggerMetricCollectionConsumer.class) .addAsWebInfResource(new File(WEB_RESOURCE_PATH + "jboss-ejb3.xml"), "jboss-ejb3.xml"); }
Source:
private void writePromiseCombiner(ChannelHandlerContext ctx, CodecOutputList out, ChannelPromise promise) { final PromiseCombiner combiner = new PromiseCombiner(); for (int i = 0; i < out.size(); i++) { combiner.add(ctx.write(out.getUnsafe(i))); } combiner.finish(promise); }

Target:
private static void writePromiseCombiner(ChannelHandlerContext ctx, CodecOutputList out, ChannelPromise promise) { final PromiseCombiner combiner = new PromiseCombiner(); for (int i = 0; i < out.size(); i++) { combiner.add(ctx.write(out.getUnsafe(i))); } combiner.finish(promise); }
Source:
public void cleanCompletedJob() { Date now = new Date(); try { DbFacade.getInstance() .getJobDao() .deleteCompletedJobs(DateUtils.addMinutes(now, succeededJobTime), DateUtils.addMinutes(now, failedJobTime)); } catch (RuntimeException e) { log.error("Failed to delete completed jobs", e); } }

Target:
public void cleanCompletedJob() { Date succeededJobsDeleteTime = new Date(System.currentTimeMillis() - TimeUnit.MILLISECONDS.convert(succeededJobTime, TimeUnit.MINUTES)); Date failedJobsDeleteTime = new Date(System.currentTimeMillis() - TimeUnit.MILLISECONDS.convert(failedJobTime, TimeUnit.MINUTES)); try { DbFacade.getInstance().getJobDao().deleteCompletedJobs(succeededJobsDeleteTime, failedJobsDeleteTime); } catch (RuntimeException e) { log.error("Failed to delete completed jobs", e); } }
Source:
protected void initializeWatchService() { if (watchService != null) { try { watchService.close(); } catch (IOException e) { logger.warn("Cannot deactivate folder watcher", e); } } String pathToWatch = getSourcePath(); if (StringUtils.isNotBlank(pathToWatch)) { Path toWatch = Paths.get(pathToWatch); try { if (watchSubDirectories()) { watchService = FileSystems.getDefault().newWatchService(); Files.walkFileTree(toWatch, Sets.newHashSet(FileVisitOption.FOLLOW_LINKS), MAX_DEPTH, new SimpleFileVisitor<Path>() { @Override public FileVisitResult preVisitDirectory(Path subDir, BasicFileAttributes attrs) throws IOException { registerDirectory(subDir); return FileVisitResult.CONTINUE; } }); } else { watchService = toWatch.getFileSystem().newWatchService(); registerDirectory(toWatch); } AbstractWatchQueueReader reader = buildWatchQueueReader(watchService, toWatch); Thread qr = new Thread(reader, "Dir Watcher"); qr.start(); } catch (IOException e) { logger.error("Cannot activate folder watcher for folder '{}': {}", toWatch, e.getMessage()); } } }

Target:
protected void initializeWatchService() { if (watchService != null) { try { watchService.close(); } catch (IOException e) { logger.warn("Cannot deactivate folder watcher", e); } } String pathToWatch = getSourcePath(); if (StringUtils.isNotBlank(pathToWatch)) { Path toWatch = Paths.get(pathToWatch); try { if (watchSubDirectories()) { watchService = FileSystems.getDefault().newWatchService(); Files.walkFileTree(toWatch, EnumSet.of(FileVisitOption.FOLLOW_LINKS), Integer.MAX_VALUE, new SimpleFileVisitor<Path>() { @Override public FileVisitResult preVisitDirectory(Path subDir, BasicFileAttributes attrs) throws IOException { registerDirectory(subDir); return FileVisitResult.CONTINUE; } }); } else { watchService = toWatch.getFileSystem().newWatchService(); registerDirectory(toWatch); } AbstractWatchQueueReader reader = buildWatchQueueReader(watchService, toWatch); Thread qr = new Thread(reader, "Dir Watcher"); qr.start(); } catch (IOException e) { logger.error("Cannot activate folder watcher for folder '{}': {}", toWatch, e.getMessage()); } } }
Source:
public void init(List<TransformFunction> arguments, Map<String, DataSource> dataSourceMap) { _arguments = arguments; Preconditions .checkState(arguments.size() > 1, String.format("Expect more than 1 argument for logical operator [%s], found %d.", getName(), arguments.size())); for (TransformFunction argument : arguments) { Preconditions.checkState( argument.getResultMetadata().getDataType().isNumeric() && argument.getResultMetadata().isSingleValue(), String .format( "Unsupported data type for logical operator [%s] arguments, only supports single-valued number. Invalid argument: expression [%s], result type [%s]", getName(), argument.getName(), argument.getResultMetadata())); } }

Target:
public void init(List<TransformFunction> arguments, Map<String, DataSource> dataSourceMap) { _arguments = arguments; Preconditions.checkState(arguments.size() > 1, String .format("Expect more than 1 argument for logical operator [%s], args [%s].", getName(), Arrays.toString(arguments.toArray()))); for (TransformFunction argument : arguments) { Preconditions.checkState( argument.getResultMetadata().getDataType().isNumeric() && argument.getResultMetadata().isSingleValue(), String .format( "Unsupported data type for logical operator [%s] arguments, only supports single-valued number. Invalid argument: expression [%s], result type [%s]", getName(), argument.getName(), argument.getResultMetadata())); } }
Source:
private static String getOriginModuleUrl(Module module) { if (module == null) { throw new IllegalArgumentException("ModuleMarkupScraper:getOriginModuleUrl() - Module must be valid."); } final String origin = ExtraDataModuleExtension.getOrigin(module); if (StringUtils.isBlank(origin) && !INTERNAL_MODULES.contains(module.getId().toString())) { return DEFAULT_GITHUB_MODULE_URL + module.getId(); } return origin; }

Target:
private static String getOriginModuleUrl(Module module) { Preconditions.checkNotNull(module); final String origin = ExtraDataModuleExtension.getOrigin(module); if (StringUtils.isBlank(origin) && !INTERNAL_MODULES.contains(module.getId().toString())) { try { return new URL(DEFAULT_GITHUB_MODULE_URL + module.getId()).toString(); }catch (MalformedURLException e) { e.printStackTrace(); } } return origin; }
Source:
public ScanResultValue next() { if (ScanQuery.ResultFormat.RESULT_FORMAT_VALUE_VECTOR.equals(resultFormat)) { throw new UOE(ScanQuery.ResultFormat.RESULT_FORMAT_VALUE_VECTOR + " is not supported yet"); } if (query.getOrder() == ScanQuery.Order.NONE || !query.getContextBoolean(ScanQuery.CTX_KEY_OUTERMOST, true)) { ScanResultValue batch = yielder.get(); List events = (List) batch.getEvents(); if (events.size() <= limit - count) { count += events.size(); yielder = yielder.next(null); return batch; } else { int numLeft = (int) (limit - count); count = limit; return new ScanResultValue(batch.getSegmentId(), batch.getColumns(), events.subList(0, numLeft)); } } else { int batchSize = query.getBatchSize(); List<Object> eventsToAdd = new ArrayList<>(batchSize); List<String> columns = new ArrayList<>(); while (eventsToAdd.size() < batchSize && !yielder.isDone() && count < limit) { ScanResultValue srv = yielder.get(); columns = columns.isEmpty() ? srv.getColumns() : columns; eventsToAdd.add(Iterables.getOnlyElement((List) srv.getEvents())); yielder = yielder.next(null); count++; } return new ScanResultValue(null, columns, eventsToAdd); } }

Target:
public ScanResultValue next() { if (ScanQuery.ResultFormat.RESULT_FORMAT_VALUE_VECTOR.equals(resultFormat)) { throw new UOE(ScanQuery.ResultFormat.RESULT_FORMAT_VALUE_VECTOR + " is not supported yet"); } if (query.getOrder() == ScanQuery.Order.NONE || !query.getContextBoolean(ScanQuery.CTX_KEY_OUTERMOST, true)) { ScanResultValue batch = yielder.get(); List events = (List) batch.getEvents(); if (events.size() <= limit - count) { count += events.size(); yielder = yielder.next(null); return batch; } else { int numLeft = (int) (limit - count); count = limit; return new ScanResultValue(batch.getSegmentId(), batch.getColumns(), events.subList(0, numLeft)); } } else { int batchSize = query.getBatchSize(); List<Object> eventsToAdd = new ArrayList<>(batchSize); List<String> columns = new ArrayList<>(); while (eventsToAdd.size() < batchSize && !yielder.isDone() && count < limit) { ScanResultValue srv = yielder.get(); columns = columns.isEmpty() ? srv.getColumns() : columns; eventsToAdd.add(Iterables.getOnlyElement((List<Object>) srv.getEvents())); yielder = yielder.next(null); count++; } return new ScanResultValue(null, columns, eventsToAdd); } }
Source:
public void writeString(Utf8 utf8) throws IOException { out.write(utf8.getBytes(), 0, utf8.getBytesLength()); }

Target:
public void writeString(Utf8 utf8) throws IOException { out.write(utf8.getBytes(), 0, utf8.getByteLength()); }
Source:
public boolean condition(List<Writable> list){ PythonVariables inputs = getPyInputsFromWritables(list); try{ PythonVariables output = PythonExecutioner.getInstance().exec(pythonTransform, inputs); boolean ret = output.getIntValue("out") != 0; return ret; } catch (Exception e){ System.out.println(e); } return true; }

Target:
public boolean condition(List<Writable> list){ PythonVariables inputs = getPyInputsFromWritables(list); try{ PythonExecutioner.exec(pythonTransform.getCode(), inputs, pythonTransform.getOutputs()); boolean ret = pythonTransform.getOutputs().getIntValue("out") != 0; return ret; } catch (Exception e){ throw new RuntimeException(e); } }
Source:
private void handleMachineRunning(final String machineId, final WorkspaceRuntimeDto workspaceRuntime) { final MachineEntity machine = getMachine(machineId, workspaceRuntime); if (machine == null) { return; } try { eventBus.fireEvent(new MachineStateEvent(machine, RUNNING)); } catch (Exception e) { Log.error(MachineStatusHandler.class, e.getMessage(), e); } }

Target:
private void handleMachineRunning(final String machineId, final WorkspaceRuntimeDto workspaceRuntime) { final MachineEntity machine = getMachine(machineId, workspaceRuntime); if (machine == null) { return; } eventBus.fireEvent(new MachineStateEvent(machine, RUNNING)); }
Source:
public void onResetClusterEmulatedMachine() { final ConfirmationModel model = (ConfirmationModel) getWindow(); if (model.getProgress() != null) { return; } ArrayList<VdcActionParametersBase> prms = new ArrayList<>(); for (Cluster cluster : getSelectedItems()) { ManagementNetworkOnClusterOperationParameters currentParam = new ManagementNetworkOnClusterOperationParameters(cluster); currentParam.setForceResetEmulatedMachine(true); prms.add(currentParam); } model.startProgress(); Frontend.getInstance().runMultipleAction(VdcActionType.UpdateCluster, prms, new IFrontendMultipleActionAsyncCallback() { @Override public void executed(FrontendMultipleActionAsyncResult result) { if (result.getReturnValue().get(0) != null && result.getReturnValue().get(0).getActionReturnValue() != null) { ConfirmationModel confirmModel = new ConfirmationModel(); setConfirmWindow(confirmModel); confirmModel.setTitle("Update Cluster fault VMs / Templates"); confirmModel.setHelpTag(HelpTag.disable_cpu_thread_support); confirmModel.setHashName("disable_cpu_thread_support"); confirmModel.setMessage("Cannot update: " + result.getReturnValue().get(0).getActionReturnValue().toString()); UICommand tempVar = UICommand.createDefaultOkUiCommand("OnSaveConfirmGenericWarnings", ClusterListModel.this); getConfirmWindow().getCommands().add(tempVar); UICommand tempVar2 = UICommand.createCancelUiCommand("CancelConfirmation", ClusterListModel.this); getConfirmWindow().getCommands().add(tempVar2); } model.stopProgress(); cancel(); } }); }

Target:
public void onResetClusterEmulatedMachine() { final ConfirmationModel model = (ConfirmationModel) getWindow(); if (model.getProgress() != null) { return; } ArrayList<VdcActionParametersBase> prms = new ArrayList<>(); for (Cluster cluster : getSelectedItems()) { ManagementNetworkOnClusterOperationParameters currentParam = new ManagementNetworkOnClusterOperationParameters(cluster); currentParam.setForceResetEmulatedMachine(true); prms.add(currentParam); } model.startProgress(); Frontend.getInstance().runMultipleAction(VdcActionType.UpdateCluster, prms, new IFrontendMultipleActionAsyncCallback() { @Override public void executed(FrontendMultipleActionAsyncResult result) { model.stopProgress(); cancel(); } }); }
Source:
public void prepareRun(BatchSourceContext context) throws Exception { LOG.debug("pluginType = {}; pluginName = {}; connectionString = {}; importQuery = {}; " + "boundingQuery = {}", sourceConfig.jdbcPluginType, sourceConfig.jdbcPluginName, sourceConfig.connectionString, sourceConfig.getImportQuery(), sourceConfig.getBoundingQuery()); Job job = Job.getInstance(); Configuration hConf = job.getConfiguration(); hConf.clear(); Class<? extends Driver> driverClass = context.loadPluginClass(getJDBCPluginId()); if (sourceConfig.user == null && sourceConfig.password == null) { DBConfiguration.configureDB(hConf, driverClass.getName(), sourceConfig.connectionString); } else { DBConfiguration.configureDB(hConf, driverClass.getName(), sourceConfig.connectionString, sourceConfig.user, sourceConfig.password); } DataDrivenETLDBInputFormat.setInput(hConf, DBRecord.class, sourceConfig.getImportQuery(), sourceConfig.getBoundingQuery(), sourceConfig.getEnableAutoCommit()); job.getConfiguration().set(DBConfiguration.INPUT_ORDER_BY_PROPERTY, sourceConfig.splitBy); context.setInput(new SourceInputFormatProvider(DataDrivenETLDBInputFormat.class, hConf)); }

Target:
public void prepareRun(BatchSourceContext context) throws Exception { LOG.debug("pluginType = {}; pluginName = {}; connectionString = {}; importQuery = {}; " + "boundingQuery = {}", sourceConfig.jdbcPluginType, sourceConfig.jdbcPluginName, sourceConfig.connectionString, sourceConfig.getImportQuery(), sourceConfig.getBoundingQuery()); Job job = Job.getInstance(); Configuration hConf = job.getConfiguration(); hConf.clear(); Class<? extends Driver> driverClass = context.loadPluginClass(getJDBCPluginId()); if (sourceConfig.user == null && sourceConfig.password == null) { DBConfiguration.configureDB(hConf, driverClass.getName(), sourceConfig.connectionString); } else { DBConfiguration.configureDB(hConf, driverClass.getName(), sourceConfig.connectionString, sourceConfig.user, sourceConfig.password); } DataDrivenETLDBInputFormat.setInput(hConf, DBRecord.class, sourceConfig.getImportQuery(), sourceConfig.getBoundingQuery(), sourceConfig.getEnableAutoCommit()); hConf.set(DBConfiguration.INPUT_ORDER_BY_PROPERTY, sourceConfig.splitBy); context.setInput(new SourceInputFormatProvider(DataDrivenETLDBInputFormat.class, hConf)); }
Source:
private void addPageToBucket(PageId pageId, int bucket) { mBucketMap.compute(bucket, (bucketKey, pageSet) -> { Set<PageId> set = pageSet == null ? new LinkedHashSet<>() : pageSet; set.add(pageId); return set; }); }

Target:
private void addPageToBucket(PageId pageId, int bucket) { mBucketMap.compute(bucket, (bucketKey, lruMap) -> { Map<PageId, Boolean> map = lruMap == null ? new LinkedHashMap<>( BUCKET_LRU_PAGE_MAP_INIT_CAPACITY, BUCKET_LRU_PAGE_MAP_INIT_LOAD_FACTOR, true) : lruMap; map.put(pageId, UNUSED_MAP_VALUE); return map; }); LOG.debug("added page to bucket {}", pageId, bucket); }
Source:
public static MassRepairPartSet performWarehouseMassRepair(List<IPartWork> selectedParts, List<MassRepairOption> mroList, MassRepairConfiguredOptions configuredOptions, CampaignGUI campaignGUI) { Campaign campaign = campaignGUI.getCampaign(); campaign.addReport("Beginning mass warehouse repair."); ArrayList<Person> techs = campaign.getTechs(true); if (techs.isEmpty()) { campaign.addReport("No available techs to repairs parts."); } else { Map<Integer, MassRepairOption> mroByTypeMap = new HashMap<Integer, MassRepairOption>(); for (int i = 0; i < mroList.size(); i++) { mroByTypeMap.put(mroList.get(i).getType(), mroList.get(i)); } MassRepairPartSet partSet = new MassRepairPartSet(); List<IPartWork> parts = filterParts(selectedParts, mroByTypeMap, techs, campaign); if (parts.isEmpty()) { return partSet; } for (IPartWork partWork : parts) { Part part = (Part) partWork; part.resetModeToNormal(); List<Person> validTechs = filterTechs(partWork, techs, mroByTypeMap, true, campaignGUI); if (validTechs.isEmpty()) { continue; } int originalQuantity = part.getQuantity(); for (int i = 0; i < originalQuantity; i++) { partSet.addPartAction( repairPart(campaignGUI, part, null, validTechs, mroByTypeMap, configuredOptions, true)); } } } return null; }

Target:
public static MassRepairPartSet performWarehouseMassRepair(List<IPartWork> selectedParts, List<MassRepairOption> mroList, MassRepairConfiguredOptions configuredOptions, CampaignGUI campaignGUI) { Campaign campaign = campaignGUI.getCampaign(); campaign.addReport("Beginning mass warehouse repair."); List<Person> techs = campaign.getTechs(true); MassRepairPartSet partSet = new MassRepairPartSet(); if (techs.isEmpty()) { campaign.addReport("No available techs to repairs parts."); } else { Map<Integer, MassRepairOption> mroByTypeMap = new HashMap<Integer, MassRepairOption>(); for (int i = 0; i < mroList.size(); i++) { mroByTypeMap.put(mroList.get(i).getType(), mroList.get(i)); } List<IPartWork> parts = filterParts(selectedParts, mroByTypeMap, techs, campaign); if (!parts.isEmpty()) { for (IPartWork partWork : parts) { Part part = (Part) partWork; part.resetModeToNormal(); List<Person> validTechs = filterTechs(partWork, techs, mroByTypeMap, true, campaignGUI); if (validTechs.isEmpty()) { continue; } int originalQuantity = part.getQuantity(); for (int i = 0; i < originalQuantity; i++) { partSet.addPartAction( repairPart(campaignGUI, part, null, validTechs, mroByTypeMap, configuredOptions, true)); } } } } return partSet; }
Source:
public IWallet createWallet(String walletLogin) { if (walletLogin !=null && !walletLogin.trim().isEmpty()) { StringTokenizer st = new StringTokenizer(walletLogin,":"); String walletType = st.nextToken(); if ("electrad".equalsIgnoreCase(walletType)) { String protocol = st.nextToken(); String username = st.nextToken(); String password = st.nextToken(); String hostname = st.nextToken(); String port = st.nextToken(); String accountName =""; if (st.hasMoreTokens()) { accountName = st.nextToken(); } if (protocol != null && username != null && password != null && hostname !=null && port != null && accountName != null) { String rpcURL = protocol +"://" + username +":" + password + "@" + hostname +":" + port; return new LindaRPCWallet(rpcURL,accountName); } } } return null; }

Target:
public IWallet createWallet(String walletLogin) { if (walletLogin !=null && !walletLogin.trim().isEmpty()) { StringTokenizer st = new StringTokenizer(walletLogin,":"); String walletType = st.nextToken(); if ("lindad".equalsIgnoreCase(walletType)) { String protocol = st.nextToken(); String username = st.nextToken(); String password = st.nextToken(); String hostname = st.nextToken(); String port = st.nextToken(); String accountName =""; if (st.hasMoreTokens()) { accountName = st.nextToken(); } if (protocol != null && username != null && password != null && hostname !=null && port != null && accountName != null) { String rpcURL = protocol +"://" + username +":" + password + "@" + hostname +":" + port; return new LindaRPCWallet(rpcURL,accountName); } } } return null; }
Source:
public Schema getSchema() { if (Strings.isNullOrEmpty(schema)) { throw new IllegalArgumentException("Schema is either null or empty. It must be specified."); } try { return Schema.parseJson(schema); } catch (IOException e) { throw new IllegalArgumentException(String.format("Invalid schema : %s", e.getMessage()), e); } }

Target:
public Schema getSchema() { if (Strings.isNullOrEmpty(schema)) { throw new IllegalArgumentException("Schema must be provided."); } try { return Schema.parseJson(schema); } catch (IOException e) { throw new IllegalArgumentException(String.format("Invalid schema : %s", e.getMessage()), e); } }
Source:
public static InterfaceParams getByName(String name) { final NetworkInterface netif = getNetworkInterfaceByName(name); if (netif == null) return null; final MacAddress macAddr = getMacAddress(netif); try { return new InterfaceParams(name, netif.getIndex(), macAddr, netif.getMTU()); } catch (IllegalArgumentException|NullPointerException|SocketException e) { return null; } }

Target:
public static InterfaceParams getByName(String name) { final NetworkInterface netif = getNetworkInterfaceByName(name); if (netif == null) return null; final MacAddress macAddr = getMacAddress(netif); try { return new InterfaceParams(name, netif.getIndex(), macAddr, netif.getMTU()); } catch (IllegalArgumentException|SocketException e) { return null; } }
Source:
private String getSentenceSeparator(Class<?> testClass) { Optional<IndicativeSentencesGeneration> indicativeSentencesGeneration = getIndicativeSentencesGeneration( testClass); if (indicativeSentencesGeneration.isPresent()) { if (indicativeSentencesGeneration.get().separator().equals("")) { return IndicativeSentencesGeneration.DEFAULT_SEPARATOR; } else { return indicativeSentencesGeneration.get().separator(); } } return IndicativeSentencesGeneration.DEFAULT_SEPARATOR; }

Target:
private String getSentenceSeparator(Class<?> testClass) { Optional<IndicativeSentencesGeneration> indicativeSentencesGeneration = getIndicativeSentencesGeneration( testClass); if (indicativeSentencesGeneration.isPresent()) { if (indicativeSentencesGeneration.get().separator().equals("")) { return IndicativeSentencesGeneration.DEFAULT_SEPARATOR; } return indicativeSentencesGeneration.get().separator(); } return IndicativeSentencesGeneration.DEFAULT_SEPARATOR; }
Source:
public void validate_shouldPassValidationIfAllFieldsAreCorrect() throws Exception { DrugOrder order = new DrugOrder(); Encounter encounter = new Encounter(); Patient patient = Context.getPatientService().getPatient(2); order.setConcept(Context.getConceptService().getConcept(88)); order.setOrderer(Context.getProviderService().getProvider(1)); order.setDosingType(DrugOrder.DosingType.FREE_TEXT); order.setInstructions("Instructions"); order.setPatient(patient); encounter.setPatient(patient); order.setEncounter(encounter); Calendar cal = Calendar.getInstance(); cal.set(Calendar.DAY_OF_MONTH, cal.get(Calendar.DAY_OF_MONTH) - 1); order.setStartDate(cal.getTime()); order.setDateStopped(new Date()); order.setAutoExpireDate(new Date()); order.setUrgency(Order.Urgency.ROUTINE); order.setAction(Order.Action.NEW); order.setOrderType(Context.getOrderService().getOrderTypeByName("Drug order")); order.setDrug(Context.getConceptService().getDrug(3)); order.setCareSetting(new CareSetting("OPD", "Outpatient", CareSetting.CareSettingType.OUTPATIENT)); double quantity = 2.00; order.setQuantity(quantity); Concept quantityUnitsConcept = new Concept(); quantityUnitsConcept.setConceptId(101); order.setQuantityUnits(quantityUnitsConcept); Assert.assertTrue(order.getQuantityUnits().getConceptId().equals(quantityUnitsConcept.getConceptId())); order.setNumRefills(10); Errors errors = new BindException(order, "order"); new DrugOrderValidator().validate(order, errors); Assert.assertFalse(errors.hasErrors()); }

Target:
public void validate_shouldPassValidationIfAllFieldsAreCorrect() throws Exception { DrugOrder order = new DrugOrder(); Encounter encounter = new Encounter(); Patient patient = Context.getPatientService().getPatient(2); order.setConcept(Context.getConceptService().getConcept(88)); order.setOrderer(Context.getProviderService().getProvider(1)); order.setDosingType(DrugOrder.DosingType.FREE_TEXT); order.setInstructions("Instructions"); order.setPatient(patient); encounter.setPatient(patient); order.setEncounter(encounter); Calendar cal = Calendar.getInstance(); cal.set(Calendar.DAY_OF_MONTH, cal.get(Calendar.DAY_OF_MONTH) - 1); order.setStartDate(cal.getTime()); order.setDateStopped(new Date()); order.setAutoExpireDate(new Date()); order.setOrderType(Context.getOrderService().getOrderTypeByName("Drug order")); order.setDrug(Context.getConceptService().getDrug(3)); order.setCareSetting(Context.getOrderService().getCareSetting(1)); double quantity = 2.00; order.setQuantity(quantity); Concept quantityUnitsConcept = new Concept(); quantityUnitsConcept.setConceptId(101); order.setQuantityUnits(quantityUnitsConcept); Assert.assertTrue(order.getQuantityUnits().getConceptId().equals(quantityUnitsConcept.getConceptId())); order.setNumRefills(10); Errors errors = new BindException(order, "order"); new DrugOrderValidator().validate(order, errors); Assert.assertFalse(errors.hasErrors()); }
Source:
public boolean test(String password, String encryptedPassword) { requireNonNull(password, "Required non-null password"); requireNonNull(password, "Required non-null encrypted password"); final Matcher matcher = PWD_REGEX.matcher(encryptedPassword); if (!matcher.matches()) { return false; } final Integer iterations = tryParse(firstNonNull(matcher.group("iterations"), "")); final String salt = matcher.group("saltHash"); final String pwdHash = matcher.group("pwdHash"); if (salt == null || iterations == null || iterations <= 0 || pwdHash == null) { return false; } final HashCode hash = computeHash(password.toCharArray(), HashCode.fromString(salt).asBytes(), iterations); return hash.toString().equals(pwdHash); }

Target:
public boolean test(String password, String encryptedPassword) { requireNonNull(password, "Required non-null password"); requireNonNull(password, "Required non-null encrypted password"); final Matcher matcher = PWD_REGEX.matcher(encryptedPassword); if (!matcher.matches()) { return false; } final Integer iterations = tryParse(matcher.group("iterations")); final String salt = matcher.group("saltHash"); final String pwdHash = matcher.group("pwdHash"); final HashCode hash = computeHash(password.toCharArray(), HashCode.fromString(salt).asBytes(), iterations); return hash.toString().equals(pwdHash); }
Source:
protected boolean addVmImages() { if (!vmDisksSource.getDiskTemplateMap().isEmpty()) { if (getVm().getStatus() != VMStatus.Down) { log.error("Cannot add images. VM is not Down"); throw new EngineException(EngineError.IRS_IMAGE_STATUS_ILLEGAL); } VmHandler.lockVm(getVmId()); Collection<DiskImage> templateDisks = getImagesToCheckDestinationStorageDomains(); List<DiskImage> diskImages = ImagesHandler.filterImageDisks(templateDisks, true, false, true); for (DiskImage image : diskImages) { VdcReturnValueBase result = runInternalActionWithTasksContext( VdcActionType.CreateSnapshotFromTemplate, buildCreateSnapshotFromTemplateParameters(image)); if (!result.getSucceeded()) { throw new EngineException(result.getFault().getError()); } else { getTaskIdList().addAll(result.getInternalVdsmTaskIdList()); DiskImage newImage = (DiskImage) result.getActionReturnValue(); srcDiskIdToTargetDiskIdMapping.put(image.getId(), newImage.getId()); } } List<CinderDisk> cinderDisks = ImagesHandler.filterDisksBasedOnCinder(templateDisks); if (!cinderDisks.isEmpty()) { addVmCinderDisks(cinderDisks); } } return true; }

Target:
protected boolean addVmImages() { if (!vmDisksSource.getDiskTemplateMap().isEmpty()) { if (getVm().getStatus() != VMStatus.Down) { log.error("Cannot add images. VM is not Down"); throw new EngineException(EngineError.IRS_IMAGE_STATUS_ILLEGAL); } VmHandler.lockVm(getVmId()); Collection<DiskImage> templateDisks = getImagesToCheckDestinationStorageDomains(); List<DiskImage> diskImages = ImagesHandler.filterImageDisks(templateDisks, true, false, true); for (DiskImage image : diskImages) { VdcReturnValueBase result = runInternalActionWithTasksContext( VdcActionType.CreateSnapshotFromTemplate, buildCreateSnapshotFromTemplateParameters(image)); if (!result.getSucceeded()) { throw new EngineException(result.getFault().getError()); } else { getTaskIdList().addAll(result.getInternalVdsmTaskIdList()); DiskImage newImage = (DiskImage) result.getActionReturnValue(); srcDiskIdToTargetDiskIdMapping.put(image.getId(), newImage.getId()); } } addVmCinderDisks(templateDisks); } return true; }
Source:
public JPanel getComponent() { myModel = new ResourceAssignmentsTableModel(myPerson); myTable = new JTable(myModel); UIUtil.setupTableUI(getTable()); setUpTasksComboColumn(getTable().getColumnModel().getColumn(ResourceAssignmentsTableModel.Column.NAME.ordinal()), getTable()); AbstractTableAndActionsComponent<ResourceAssignment> tableAndActions = new AbstractTableAndActionsComponent<ResourceAssignment>(getTable()) { @Override protected void onAddEvent() { getTable().editCellAt(myModel.getRowCount() - 1, 1); } @Override protected void onDeleteEvent() { if (getTable().isEditing() && getTable().getCellEditor() != null) { getTable().getCellEditor().stopCellEditing(); } myModel.delete(getTable().getSelectedRows()); } @Override protected ResourceAssignment getValue(int row) { java.util.List<ResourceAssignment> values = myModel.getResourcesAssignments(); return (row >= 0 && row < values.size()) ? values.get(row) : null; } }; JPanel tablePanel = AbstractTableAndActionsComponent.createDefaultTableAndActions(getTable(), tableAndActions.getActionsComponent()); return tablePanel; }

Target:
public JPanel getComponent() { myModel = new ResourceAssignmentsTableModel(myPerson); myTable = new JTable(myModel); UIUtil.setupTableUI(getTable()); setUpTasksComboColumn(getTable().getColumnModel().getColumn(ResourceAssignmentsTableModel.Column.NAME.ordinal()), getTable()); AbstractTableAndActionsComponent<ResourceAssignment> tableAndActions = new AbstractTableAndActionsComponent<ResourceAssignment>(getTable()) { @Override protected void onAddEvent() { getTable().editCellAt(myModel.getRowCount() - 1, 1); } @Override protected void onDeleteEvent() { if (getTable().isEditing() && getTable().getCellEditor() != null) { getTable().getCellEditor().stopCellEditing(); } myModel.delete(getTable().getSelectedRows()); } @Override protected ResourceAssignment getValue(int row) { java.util.List<ResourceAssignment> values = myModel.getResourcesAssignments(); return (row >= 0 && row < values.size()) ? values.get(row) : null; } }; return AbstractTableAndActionsComponent.createDefaultTableAndActions(getTable(), tableAndActions.getActionsComponent()); }
Source:
public boolean matches(RelOptRuleCall call) { LogicalTableScan scan = call.rel(1); TableSourceTable tableSourceTable = scan.getTable().unwrap(TableSourceTable.class); if (tableSourceTable != null && tableSourceTable.tableSource() instanceof SupportsProjectionPushDown) { SupportsProjectionPushDown pushDownSource = (SupportsProjectionPushDown) tableSourceTable.tableSource(); if (pushDownSource.supportsNestedProjection()) { throw new TableException("Nested projection push down is unsupported now. \n" + "Please disable nested projection (SupportsProjectionPushDown#supportsNestedProjection returns false), " + "planner will push down the top-level columns."); } else { return true; } } else { return false; } }

Target:
public boolean matches(RelOptRuleCall call) { LogicalTableScan scan = call.rel(1); TableSourceTable tableSourceTable = scan.getTable().unwrap(TableSourceTable.class); if (tableSourceTable == null || !(tableSourceTable.tableSource() instanceof SupportsProjectionPushDown)) { return false; } SupportsProjectionPushDown pushDownSource = (SupportsProjectionPushDown) tableSourceTable.tableSource(); if (pushDownSource.supportsNestedProjection()) { throw new TableException("Nested projection push down is unsupported now. \n" + "Please disable nested projection (SupportsProjectionPushDown#supportsNestedProjection returns false), " + "planner will push down the top-level columns."); } else { return true; } }
Source:
static String getDefaulResourceAdapter(DeploymentUnit deploymentUnit) { EEModuleDescription eeDescription = deploymentUnit.getAttachment(org.jboss.as.ee.component.Attachments.EE_MODULE_DESCRIPTION); if (eeDescription != null) { String defaultJndiName = eeDescription.getDefaultResourceJndiNames().getJmsConnectionFactory(); ContextNames.BindInfo bindInfo = ContextNames.bindInfoFor(defaultJndiName); ServiceController binder = deploymentUnit.getServiceRegistry().getService(bindInfo.getBinderServiceName()); if (binder != null) { Object pcf = binder.getService().getValue(); if (pcf != null && pcf instanceof ConnectionFactoryReferenceFactoryService) { return ((ConnectionFactoryReferenceFactoryService) pcf).getName(); } if (pcf != null && pcf instanceof ContextListAndJndiViewManagedReferenceFactory) { ManagedReference ref = ((ContextListAndJndiViewManagedReferenceFactory) pcf).getReference(); Object ra = ref.getInstance(); if (ra instanceof ActiveMQRAConnectionFactoryImpl) { bindInfo = ContextNames.bindInfoFor(((ActiveMQRAConnectionFactoryImpl) ra).getReference().getClassName()); binder = deploymentUnit.getServiceRegistry().getService(bindInfo.getBinderServiceName()); if (binder != null) { pcf = binder.getService().getValue(); if (pcf != null && pcf instanceof ConnectionFactoryReferenceFactoryService) { return ((ConnectionFactoryReferenceFactoryService) pcf).getName(); } } } } } } return null; }

Target:
static String getDefaulResourceAdapter(DeploymentUnit deploymentUnit) { EEModuleDescription eeDescription = deploymentUnit.getAttachment(org.jboss.as.ee.component.Attachments.EE_MODULE_DESCRIPTION); if (eeDescription != null) { String defaultJndiName = eeDescription.getDefaultResourceJndiNames().getJmsConnectionFactory(); ContextNames.BindInfo bindInfo = ContextNames.bindInfoFor(defaultJndiName); ServiceController binder = deploymentUnit.getServiceRegistry().getService(bindInfo.getBinderServiceName()); if (binder != null) { Object pcf = binder.getService().getValue(); if (pcf != null && pcf instanceof ContextListAndJndiViewManagedReferenceFactory) { ManagedReference ref = ((ContextListAndJndiViewManagedReferenceFactory) pcf).getReference(); Object ra = ref.getInstance(); if (ra instanceof ActiveMQRAConnectionFactoryImpl) { bindInfo = ContextNames.bindInfoFor(((ActiveMQRAConnectionFactoryImpl) ra).getReference().getClassName()); binder = deploymentUnit.getServiceRegistry().getService(bindInfo.getBinderServiceName()); if (binder != null) { pcf = binder.getService().getValue(); } } } if (pcf != null && pcf instanceof ConnectionFactoryReferenceFactoryService) { return ((ConnectionFactoryReferenceFactoryService) pcf).getName(); } } } return null; }
Source:
public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((additionalOptions == null) ? 0 : additionalOptions .hashCode()); result = prime * result + ((hardwareId == null) ? 0 : hardwareId.hashCode()); result = prime * result + ((hypervisorRegex == null) ? 0 : hypervisorRegex.hashCode()); result = prime * result + ((imageDescriptionRegex == null) ? 0 : imageDescriptionRegex .hashCode()); result = prime * result + ((imageId == null) ? 0 : imageId.hashCode()); result = prime * result + ((imageNameRegex == null) ? 0 : imageNameRegex.hashCode()); result = prime * result + ((imageVersionRegex == null) ? 0 : imageVersionRegex .hashCode()); result = prime * result + ((is64bit == null) ? 0 : is64bit.hashCode()); result = prime * result + ((locationId == null) ? 0 : locationId.hashCode()); result = prime * result + ((minCores == null) ? 0 : minCores.hashCode()); result = prime * result + ((minRam == null) ? 0 : minRam.hashCode()); result = prime * result + ((options == null) ? 0 : options.hashCode()); result = prime * result + ((os == null) ? 0 : os.hashCode()); result = prime * result + ((osArchictectureRegex == null) ? 0 : osArchictectureRegex .hashCode()); result = prime * result + ((osDescriptionRegex == null) ? 0 : osDescriptionRegex .hashCode()); result = prime * result + ((osNameRegex == null) ? 0 : osNameRegex.hashCode()); result = prime * result + ((osVersionRegex == null) ? 0 : osVersionRegex.hashCode()); return result; }

Target:
public int hashCode() { return Objects.hashCode( additionalOptions, hardwareId, hypervisorRegex, imageDescriptionRegex, imageId, imageNameRegex, imageVersionRegex, is64bit, locationId, minCores, minRam, options, os, osArchitectureRegex, osDescriptionRegex, osNameRegex, osVersionRegex, 0); }
Source:
protected boolean getSuiteFilterAndStrategy(Class<?> klass) throws Exception { String strategy = System.getProperty(SUITE_FILTER_STRATEGY_OVERRIDE_VARIABLE_NAME); if(StringUtils.isEmpty(strategy)){ return super.getSuiteFilterAndStrategy(klass); } else if (strategy.equalsIgnoreCase("and")){ return true; } else { return false; } }

Target:
protected boolean getSuiteFilterAndStrategy(Class<?> klass) throws Exception { String strategy = System.getProperty(SUITE_FILTER_STRATEGY_OVERRIDE_VARIABLE_NAME); if (StringUtils.isEmpty(strategy)) { return super.getSuiteFilterAndStrategy(klass); } else { return strategy.equalsIgnoreCase("and"); } }
Source:
public void init() { URL url = URL.valueOf("dubbo://" + NetUtils.getLocalAddress().getHostName() + ":2233"); url = url.addParameter( "save.file",true ); testUrl = URL.valueOf("<LINK_1>"); mockUrl = new URL("dubbo", "127.0.0.0", 2200); parametersConsumer.put("application", "demo-consumer"); parametersConsumer.put("category", "consumer"); parametersConsumer.put("check", "false"); parametersConsumer.put("dubbo", "2.0.2"); parametersConsumer.put("interface", "org.apache.dubbo.demo.DemoService"); parametersConsumer.put("methods", "sayHello"); parametersConsumer.put("pid", "1676"); parametersConsumer.put("qos.port", "333333"); parametersConsumer.put("side", "consumer"); parametersConsumer.put("timestamp", String.valueOf(System.currentTimeMillis())); abstractRegistry = new AbstractRegistry(url) { @Override public boolean isAvailable() { return false; } }; listener = urls -> notifySuccess = true; notifySuccess = false; }

Target:
public void init() { URL url = URL.valueOf("dubbo://192.168.0.2:2233"); url = url.addParameter("save.file",true); testUrl = URL.valueOf("<LINK_0>"); mockUrl = new URL("dubbo", "192.168.0.1", 2200); parametersConsumer.put("application", "demo-consumer"); parametersConsumer.put("category", "consumer"); parametersConsumer.put("check", "false"); parametersConsumer.put("dubbo", "2.0.2"); parametersConsumer.put("interface", "org.apache.dubbo.demo.DemoService"); parametersConsumer.put("methods", "sayHello"); parametersConsumer.put("pid", "1676"); parametersConsumer.put("qos.port", "333333"); parametersConsumer.put("side", "consumer"); parametersConsumer.put("timestamp", String.valueOf(System.currentTimeMillis())); abstractRegistry = new AbstractRegistry(url) { @Override public boolean isAvailable() { return false; } }; listener = urls -> notifySuccess = true; notifySuccess = false; }
Source:
private static ModuleOutput writeOutput(Compiler compiler, Flags flags) { ArrayList<File> outputFiles = new ArrayList<>(); ModuleOutput output = new ModuleOutput(); File file = new File(); file.path = flags.jsOutputFile; String code = compiler.toSource(); String prefix = ""; String postfix = ""; if (flags.outputWrapper != null) { String marker = null; int pos = flags.outputWrapper.indexOf(OUTPUT_MARKER_JS_STRING); if (pos != -1) { code = SourceCodeEscapers.javascriptEscaper().escape(code); marker = OUTPUT_MARKER_JS_STRING; } else { pos = flags.outputWrapper.indexOf(OUTPUT_MARKER); if (pos != -1) { marker = OUTPUT_MARKER; } } if (marker != null) { prefix = flags.outputWrapper.substring(0, pos); SourceMap sourceMap = compiler.getSourceMap(); if (sourceMap != null) { sourceMap.setWrapperPrefix(prefix); } } postfix = flags.outputWrapper.substring(pos + marker.length()); } if (flags.createSourceMap) { if (flags.createSourceMap) { StringBuilder b = new StringBuilder(); try { compiler.getSourceMap().appendTo(b, flags.jsOutputFile); } catch (IOException e) { } file.sourceMap = b.toString(); } } file.src = prefix + code + postfix; outputFiles.add(file); output.compiledFiles = outputFiles.toArray(new File[outputFiles.size()]); output.compiledCode = file.src; output.sourceMap = file.sourceMap; return output; }

Target:
private static ModuleOutput writeOutput(Compiler compiler, Flags flags) { ArrayList<File> outputFiles = new ArrayList<>(); ModuleOutput output = new ModuleOutput(); File file = new File(); file.path = flags.jsOutputFile; String code = compiler.toSource(); String prefix = ""; String postfix = ""; if (flags.outputWrapper != null) { String marker = null; int pos = flags.outputWrapper.indexOf(OUTPUT_MARKER_JS_STRING); if (pos != -1) { code = SourceCodeEscapers.javascriptEscaper().escape(code); marker = OUTPUT_MARKER_JS_STRING; } else { pos = flags.outputWrapper.indexOf(OUTPUT_MARKER); if (pos != -1) { marker = OUTPUT_MARKER; } } if (marker != null) { prefix = flags.outputWrapper.substring(0, pos); SourceMap sourceMap = compiler.getSourceMap(); if (sourceMap != null) { sourceMap.setWrapperPrefix(prefix); } } postfix = flags.outputWrapper.substring(pos + marker.length()); } if (flags.createSourceMap) { StringBuilder b = new StringBuilder(); try { compiler.getSourceMap().appendTo(b, flags.jsOutputFile); } catch (IOException e) { } file.sourceMap = b.toString(); } file.src = prefix + code + postfix; outputFiles.add(file); output.compiledFiles = outputFiles.toArray(new File[outputFiles.size()]); output.compiledCode = file.src; output.sourceMap = file.sourceMap; return output; }
Source:
protected LicenseInfoHandler(AttachmentDatabaseHandler attachmentDatabaseHandler, ComponentDatabaseHandler componentDatabaseHandler) throws MalformedURLException { this.componentDatabaseHandler = componentDatabaseHandler; this.licenseInfoCache = CacheBuilder.newBuilder().expireAfterWrite(15, TimeUnit.MINUTES).maximumSize(100).build(); AttachmentContentProvider contentProvider = attachment -> attachmentDatabaseHandler.getAttachmentContent(attachment.getAttachmentContentId()); parsers = Lists.newArrayList( new SPDXParser(attachmentDatabaseHandler.getAttachmentConnector(), contentProvider), new CLIParser(attachmentDatabaseHandler.getAttachmentConnector(), contentProvider), new CombinedCLIParser(attachmentDatabaseHandler.getAttachmentConnector(), contentProvider, componentDatabaseHandler) ); outputGenerators = Lists.newArrayList( new TextGenerator(), new XhtmlGenerator(), new DocxGenerator() ); }

Target:
protected LicenseInfoHandler(AttachmentDatabaseHandler attachmentDatabaseHandler, ComponentDatabaseHandler componentDatabaseHandler) throws MalformedURLException { this.componentDatabaseHandler = componentDatabaseHandler; this.licenseInfoCache = CacheBuilder.newBuilder().expireAfterWrite(CACHE_TIMEOUT_MINUTES, TimeUnit.MINUTES) .maximumSize(CACHE_MAX_ITEMS).build(); AttachmentContentProvider contentProvider = attachment -> attachmentDatabaseHandler.getAttachmentContent(attachment.getAttachmentContentId()); parsers = Lists.newArrayList( new SPDXParser(attachmentDatabaseHandler.getAttachmentConnector(), contentProvider), new CLIParser(attachmentDatabaseHandler.getAttachmentConnector(), contentProvider), new CombinedCLIParser(attachmentDatabaseHandler.getAttachmentConnector(), contentProvider, componentDatabaseHandler) ); outputGenerators = Lists.newArrayList( new TextGenerator(), new XhtmlGenerator(), new DocxGenerator() ); }