auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static CaseUserTaskWithVariablesList convertToCaseUserTaskWithVariablesList(List<UserTaskInstanceWithPotOwnerDesc> queryUserTasksByVariables) { List<CaseUserTaskWithVariables> data = new ArrayList<>(); for (UserTaskInstanceWithPotOwnerDesc desc : queryUserTasksByVariables) { CaseUserTaskWithVariables var = new CaseUserTaskWithVariables(); var.setId(desc.getTaskId()); var.setName(desc.getName()); var.setProcessInstanceId(desc.getProcessInstanceId()); var.setCorrelationKey(desc.getCorrelationKey()); var.setActualOwner(desc.getActualOwner()); var.setCaseDefinitionId(desc.getProcessId()); var.setPotentialOwners(desc.getPotentialOwners()); var.setCaseId(desc.getCorrelationKey()); var.setProcessVariables(desc.getProcessVariables()); var.setInputVariables(desc.getInputdata()); var.setCaseVariables(desc.getExtraData()); data.add(var); } CaseUserTaskWithVariablesList result = new CaseUserTaskWithVariablesList(); result.setCaseUserTaskWithVariables(data.parallelStream().toArray(CaseUserTaskWithVariables[]::new)); return result; }

Target:
public static CaseUserTaskWithVariablesList convertToCaseUserTaskWithVariablesList(List<UserTaskInstanceWithPotOwnerDesc> queryUserTasksByVariables) { List<CaseUserTaskWithVariables> data = new ArrayList<>(); for (UserTaskInstanceWithPotOwnerDesc desc : queryUserTasksByVariables) { CaseUserTaskWithVariables var = new CaseUserTaskWithVariables(); var.setId(desc.getTaskId()); var.setName(desc.getName()); var.setProcessInstanceId(desc.getProcessInstanceId()); var.setCorrelationKey(desc.getCorrelationKey()); var.setActualOwner(desc.getActualOwner()); var.setCaseDefinitionId(desc.getProcessId()); var.setPotentialOwners(desc.getPotentialOwners()); var.setCaseId(desc.getCorrelationKey()); var.setProcessVariables(desc.getProcessVariables()); var.setInputVariables(desc.getInputdata()); var.setCaseVariables(desc.getExtraData()); data.add(var); } CaseUserTaskWithVariablesList result = new CaseUserTaskWithVariablesList(); result.setCaseUserTaskWithVariables(data.stream().toArray(CaseUserTaskWithVariables[]::new)); return result; }
Source:
public static void main(String[] args) throws NamingException, JMSException { QueueConsumer queueConsumer = new QueueConsumer("Transactional-Queue"); TransactionalQueuePublisher transactionalQueuePublisher = new TransactionalQueuePublisher("Transactional-Queue"); log.info("------Sample for Message Sending and Committing.------"); transactionalQueuePublisher.sendMessage("My First Message."); queueConsumer.receiveMessage(); transactionalQueuePublisher.sendMessage("My Second Message."); transactionalQueuePublisher.commitMessages(); queueConsumer.receiveMessage(); queueConsumer.receiveMessage(); log.info("------Sample for Message Sending, Rollback and Committing.------"); transactionalQueuePublisher.sendMessage("My Unique Message."); queueConsumer.receiveMessage(); transactionalQueuePublisher.rollbackMessages(); transactionalQueuePublisher.sendMessage("My Unique Message."); transactionalQueuePublisher.commitMessages(); queueConsumer.receiveMessage(); queueConsumer.receiveMessage(); System.exit(0); }

Target:
public static void main(String[] args) throws NamingException, JMSException { QueueConsumer queueConsumer = new QueueConsumer("Transactional-Queue"); TransactionalQueuePublisher transactionalQueuePublisher = new TransactionalQueuePublisher("Transactional-Queue"); log.info("------Sample for Message Sending and Committing.------"); transactionalQueuePublisher.sendMessage("My First Message."); queueConsumer.receiveMessage(); transactionalQueuePublisher.sendMessage("My Second Message."); transactionalQueuePublisher.commitMessages(); queueConsumer.receiveMessage(); queueConsumer.receiveMessage(); log.info("------Sample for Message Sending, Rollback and Committing.------"); transactionalQueuePublisher.sendMessage("My Third Message."); queueConsumer.receiveMessage(); transactionalQueuePublisher.rollbackMessages(); transactionalQueuePublisher.sendMessage("My Forth Message."); transactionalQueuePublisher.commitMessages(); queueConsumer.receiveMessage(); queueConsumer.receiveMessage(); System.exit(0); }
Source:
public static void wipeDataBase() { Delete.tables( EventFlow.class, TrackedEntityDataValueFlow.class, DataElementFlow.class, ProgramFlow.class, AttributeFlow.class, AttributeValueFlow.class, ModelLinkFlow.class, OptionSetFlow.class, OptionFlow.class, OrganisationUnitFlow.class, OrganisationUnitLevelFlow.class, OrganisationUnitToProgramRelationFlow.class, ProgramStageDataElementFlow.class, ProgramStageSectionFlow.class, ProgramStageFlow.class, FailedItemFlow.class, StateFlow.class, FailedItemFlow.class ); }

Target:
public void wipeDataBase() { Delete.tables( EventFlow.class, TrackedEntityDataValueFlow.class, DataElementFlow.class, ProgramFlow.class, AttributeFlow.class, AttributeValueFlow.class, ModelLinkFlow.class, OptionSetFlow.class, OptionFlow.class, OrganisationUnitFlow.class, OrganisationUnitLevelFlow.class, OrganisationUnitToProgramRelationFlow.class, ProgramStageDataElementFlow.class, ProgramStageSectionFlow.class, ProgramStageFlow.class, FailedItemFlow.class, StateFlow.class, FailedItemFlow.class ); }
Source:
public EvaluatedCohort evaluate(CohortDefinition cohortDefinition, EvaluationContext context) { context = ObjectUtil.nvl(context, new EvaluationContext()); SqlCohortDefinition sqlCohortDefinition = (SqlCohortDefinition) cohortDefinition; EvaluatedCohort ret = new EvaluatedCohort(sqlCohortDefinition, context); if (context.getBaseCohort() != null && context.getBaseCohort().isEmpty()) { return ret; } final Boolean includeChildLocations = (Boolean) context.getParameterValue("includeChildLocations"); if (includeChildLocations != null && includeChildLocations) { final List<Location> locationList = (List<Location>) context.getParameterValue("locationList"); final Map<String, Object> parameterValues = context.getParameterValues(); parameterValues.put("locationList", getLocationsIncludingChildLocations(locationList)); context.setParameterValues(parameterValues); } SqlQueryBuilder qb = new SqlQueryBuilder(sqlCohortDefinition.getQuery(), context.getParameterValues()); if (sqlCohortDefinition.getQuery().contains(":patientIds")) { qb.addParameter("patientIds", context.getBaseCohort()); } List<Integer> l = evaluationService.evaluateToList(qb, Integer.class, context); if (context.getBaseCohort() != null) { l.retainAll(context.getBaseCohort().getMemberIds()); } ret.setMemberIds(new HashSet<Integer>(l)); return ret; }

Target:
public EvaluatedCohort evaluate(CohortDefinition cohortDefinition, EvaluationContext context) { context = ObjectUtil.nvl(context, new EvaluationContext()); SqlCohortDefinition sqlCohortDefinition = (SqlCohortDefinition) cohortDefinition; EvaluatedCohort ret = new EvaluatedCohort(sqlCohortDefinition, context); if (context.getBaseCohort() != null && context.getBaseCohort().isEmpty()) { return ret; } final Boolean includeChildLocations = (Boolean) context.getParameterValue("includeChildLocations"); Map<String, Object> parameterValues; if (includeChildLocations != null && includeChildLocations) { final List<Location> locationList = (List<Location>) context.getParameterValue("locationList"); parameterValues = new HashMap<String, Object>(context.getParameterValues()); parameterValues.put("locationList", getLocationsIncludingChildLocations(locationList)); } else { parameterValues = context.getParameterValues(); } SqlQueryBuilder qb = new SqlQueryBuilder(sqlCohortDefinition.getQuery(), parameterValues); if (sqlCohortDefinition.getQuery().contains(":patientIds")) { qb.addParameter("patientIds", context.getBaseCohort()); } List<Integer> l = evaluationService.evaluateToList(qb, Integer.class, context); if (context.getBaseCohort() != null) { l.retainAll(context.getBaseCohort().getMemberIds()); } ret.setMemberIds(new HashSet<Integer>(l)); return ret; }
Source:
public static VMImage create(String name, String label, String category, String description, OSDiskConfiguration osDiskConfiguration, List<DataVirtualHardDisk> dataDiskConfiguration, String serviceName, String deploymentName, String roleName, String location, String affinityGroup, Date createdTime, Date modifiedTime, String language, String imageFamily, RoleSize.Type recommendedVMSize, Boolean isPremium, String eula, URI iconUri, URI smallIconUri, URI privacyUri, Date publishedDate) { return new AutoValue_VMImage(name, label, category, description, osDiskConfiguration, dataDiskConfiguration, serviceName, deploymentName, roleName, location, affinityGroup, createdTime, modifiedTime, language, imageFamily, recommendedVMSize, isPremium, eula, iconUri, smallIconUri, privacyUri, publishedDate); }

Target:
public static VMImage create(String name, String label, String category, String description, OSDiskConfiguration osDiskConfiguration, List<DataVirtualHardDisk> dataDiskConfiguration, String serviceName, String deploymentName, String roleName, String location, String affinityGroup, Date createdTime, Date modifiedTime, String language, String imageFamily, RoleSize.Type recommendedVMSize, Boolean isPremium, String eula, URI iconUri, URI smallIconUri, URI privacyUri, Date publishedDate) { return new AutoValue_VMImage(name, label, category, description, osDiskConfiguration, copyOf(dataDiskConfiguration), serviceName, deploymentName, roleName, location, affinityGroup, createdTime, modifiedTime, language, imageFamily, recommendedVMSize, isPremium, eula, iconUri, smallIconUri, privacyUri, publishedDate); }
Source:
private void createDropDownPopup() { if (dropDownPopup == null) { dropDownPopup = new FilterDropdownListBox<ListType>(resources); dropDownPopup.setStyleName(this.resources.filterDropdownStyle().dropDownPopUpContainer()); dropDownPopup.setPopupPosition(this.getAbsoluteLeft(), this.getAbsoluteTop() + this.getOffsetHeight()); dropDownPopup.setWidth(this.getOffsetWidth() + "px"); dropDownPopup.show(); dropDownPopup.addCloseHandler(new CloseHandler<PopupPanel>() { @Override public void onClose(CloseEvent<PopupPanel> event) { dropDownPopup = null; } }); } }

Target:
private void createDropDownPopup() { if (dropDownPopup == null) { dropDownPopup = new FilterDropdownListBox<ListType>(resources); dropDownPopup.setStyleName(this.resources.filterDropdownStyle().dropDownPopUpContainer()); dropDownPopup.setPopupPosition(this.getAbsoluteLeft(), this.getAbsoluteTop() + this.getOffsetHeight()); dropDownPopup.setWidth(this.getOffsetWidth() + Unit.PX.getType()); dropDownPopup.show(); dropDownPopup.addCloseHandler(new CloseHandler<PopupPanel>() { @Override public void onClose(CloseEvent<PopupPanel> event) { dropDownPopup = null; } }); } }
Source:
public void build(@NotNull ErlangTarget target, @NotNull DirtyFilesHolder<ErlangSourceRootDescriptor, ErlangTarget> holder, @NotNull BuildOutputConsumer outputConsumer, @NotNull CompileContext context) throws ProjectBuildException, IOException { JpsModule module = target.getModule(); JpsProject project = module.getProject(); ErlangCompilerOptions compilerOptions = JpsErlangCompilerOptionsExtension.getOrCreateExtension(project).getOptions(); if (compilerOptions.myUseRebarCompiler) return; LOG.info("Starting build for " + target.getPresentableName()); File sourceOutput = getBuildOutputDirectory(module, false, context); File testOutput = getBuildOutputDirectory(module, true, context); if (holder.hasRemovedFiles()) { LOG.debug("Remove invalid .beam and .app files."); removeOutputFiles(holder.getRemovedFiles(target), sourceOutput, testOutput); } buildSources(target, context, compilerOptions, outputConsumer, sourceOutput, false); buildSources(target, context, compilerOptions, outputConsumer, testOutput, true); processAppConfigFiles(holder, outputConsumer, context, sourceOutput, testOutput); }

Target:
public void build(@NotNull ErlangTarget target, @NotNull DirtyFilesHolder<ErlangSourceRootDescriptor, ErlangTarget> holder, @NotNull BuildOutputConsumer outputConsumer, @NotNull CompileContext context) throws ProjectBuildException, IOException { JpsModule module = target.getModule(); JpsProject project = module.getProject(); ErlangCompilerOptions compilerOptions = JpsErlangCompilerOptionsExtension.getOrCreateExtension(project).getOptions(); if (compilerOptions.myUseRebarCompiler) return; LOG.info("Build module " + target.getPresentableName()); File sourceOutput = getBuildOutputDirectory(module, false, context); File testOutput = getBuildOutputDirectory(module, true, context); if (holder.hasRemovedFiles()) { LOG.debug("Remove invalid .beam and .app files."); removeOutputFiles(holder.getRemovedFiles(target), sourceOutput, testOutput); } buildSources(target, context, compilerOptions, outputConsumer, sourceOutput, false); buildSources(target, context, compilerOptions, outputConsumer, testOutput, true); processAppConfigFiles(holder, outputConsumer, context, sourceOutput, testOutput); }
Source:
public void updated(Dictionary<String, ?> config) throws ConfigurationException { if (config == null) { throw new ConfigurationException("influxdb", "The configuration for influxdb is missing fix openhab.cfg"); } url = (String) config.get("url"); if (StringUtils.isBlank(url)) { throw new ConfigurationException("influxdb:url", "The database URL is missing - please configure the url parameter in openhab.cfg"); } user = (String) config.get("user"); if (StringUtils.isBlank(user)) { throw new ConfigurationException("influxdb:user", "The user is missing - please configure the user parameter in openhab.cfg"); } password = (String) config.get("password"); if (StringUtils.isBlank(password)) { throw new ConfigurationException("influxdb:password", "The password is missing. To specify a password configure the password parameter in openhab.cfg."); } dbName = (String) config.get("db"); if (StringUtils.isBlank(dbName)) { throw new ConfigurationException("influxdb:db", "The db name is missing. To specify a db name configure the db parameter in openhab.cfg."); } disconnect(); connect(); isProperlyConfigured = true; }

Target:
public void updated(Dictionary<String, ?> config) throws ConfigurationException { disconnect(); if (config == null) { throw new ConfigurationException("influxdb", "The configuration for influxdb is missing fix openhab.cfg"); } url = (String) config.get("url"); if (StringUtils.isBlank(url)) { url = DEFAULT_URL; logger.debug("using default url {}", DEFAULT_URL); } user = (String) config.get("user"); if (StringUtils.isBlank(user)) { user = DEFAULT_USER; logger.debug("using default user {}", DEFAULT_USER); } password = (String) config.get("password"); if (StringUtils.isBlank(password)) { throw new ConfigurationException("influxdb:password", "The password is missing. To specify a password configure the password parameter in openhab.cfg."); } dbName = (String) config.get("db"); if (StringUtils.isBlank(dbName)) { dbName = DEFAULT_DB; logger.debug("using default db name {}", DEFAULT_DB); } isProperlyConfigured = true; connect(); if ( ! checkConnection()){ logger.error("database connection does not work for now, will retry to use the database."); } }
Source:
public void testRandomPatterns() throws UnsupportedEncodingException, IOException, IllegalStateException, GitAPIException, InterruptedException { File gitDir = Files.createTempDirectory("jgit").toFile(); Git.init().setDirectory(gitDir).call(); PseudoRandomPatternGenerator generator = new PseudoRandomPatternGenerator(); for (int i = 0; i < NB_PATTERN; i++) { String pattern = generator.nextRandomString(); FastIgnoreRule jgitIgnoreRule = new FastIgnoreRule(pattern); CGitIgnoreRule cgitIgnoreRule = new CGitIgnoreRule(gitDir, pattern); assertCgitAndJgitMatch(pattern, jgitIgnoreRule, cgitIgnoreRule, pattern); for (int p = 0; p < PATH_PER_PATTERN; p++) { String path = generator.nextRandomString(); assertCgitAndJgitMatch(pattern, jgitIgnoreRule, cgitIgnoreRule, path); } } }

Target:
public void testRandomPatterns() throws Exception { File gitDir = Files.createTempDirectory("jgit").toFile(); Git.init().setDirectory(gitDir).call(); PseudoRandomPatternGenerator generator = new PseudoRandomPatternGenerator(); for (int i = 0; i < NB_PATTERN; i++) { String pattern = generator.nextRandomString(); FastIgnoreRule jgitIgnoreRule = new FastIgnoreRule(pattern); CGitIgnoreRule cgitIgnoreRule = new CGitIgnoreRule(gitDir, pattern); assertCgitAndJgitMatch(pattern, jgitIgnoreRule, cgitIgnoreRule, pattern); for (int p = 0; p < PATH_PER_PATTERN; p++) { String path = generator.nextRandomString(); assertCgitAndJgitMatch(pattern, jgitIgnoreRule, cgitIgnoreRule, path); } } }
Source:
public final NamedInputStream getIndexScript() { return getScriptAsStream(indexScript); }

Target:
public ScriptRunner getIndexScript() throws IOException { return getScriptRunner("index_generic.sql"); }
Source:
private static Map<String, Object> parseArgs(String[] args) throws Exception { if(args.length < 1) { throw new IllegalArgumentException("Please provide module. To list existing modules use --help argument."); } return new ParametersParser( CoreUtil.loadProperties(ExtensionsToolExecutor.class, "arguments.properties"), CoreUtil.loadProperties(ExtensionsToolExecutor.class, "defaults.properties") ).parse(args); }

Target:
private static Map<String, Object> parseArgs(String[] args) throws Exception { if(args.length < 1) { throw new IllegalArgumentException("Please provide module. To list existing modules use --help argument."); } return new ParametersParser( CoreUtil.loadProperties(ExtensionsToolExecutor.class, "arguments.properties") ).parse(args); }
Source:
public void updateParentCommits(IRepository parent, IReview review, ChangeDetailX detail) { Map<Integer, CommitInfo[]> parents = detail.getParents(); if (parents == null) { return; } List<IReviewItemSet> sets = review.getSets(); for (Entry<Integer, CommitInfo[]> parentCommit : parents.entrySet()) { IReviewItemSet reviewItemSet = sets.get(parentCommit.getKey() - 1); for (CommitInfo gerritCommit : parentCommit.getValue()) { ICommit commit = IReviewsFactory.INSTANCE.createCommit(); commit.setId(gerritCommit.getCommit()); IUser commitAuthor = IReviewsFactory.INSTANCE.createUser(); GitPersonalInfo author = gerritCommit.getAuthor(); if (author != null) { commitAuthor.setId(author.getName()); commitAuthor.setDisplayName(author.getName()); commitAuthor.setEmail(author.getEmail()); commit.setAuthor(commitAuthor); } commit.setSubject(gerritCommit.getSubject()); commit.setMessage(gerritCommit.getMessage()); commit.setId(gerritCommit.getCommit()); reviewItemSet.getParentCommits().add(commit); } } }

Target:
public void updateParentCommits(IRepository parent, IReview review, ChangeDetailX detail) { Map<Integer, CommitInfo[]> parents = detail.getParents(); if (parents == null) { return; } List<IReviewItemSet> sets = review.getSets(); for (Entry<Integer, CommitInfo[]> parentCommit : parents.entrySet()) { IReviewItemSet reviewItemSet = sets.get(parentCommit.getKey() - 1); for (CommitInfo gerritCommit : parentCommit.getValue()) { ICommit commit = IReviewsFactory.INSTANCE.createCommit(); commit.setId(gerritCommit.getCommit()); commit.setSubject(gerritCommit.getSubject()); IUser commitAuthor = IReviewsFactory.INSTANCE.createUser(); GitPersonalInfo author = gerritCommit.getAuthor(); if (author != null) { commitAuthor.setId(author.getName()); commitAuthor.setDisplayName(author.getName()); commitAuthor.setEmail(author.getEmail()); commit.setAuthor(commitAuthor); } commit.setMessage(gerritCommit.getMessage()); List<ICommit> parentCommits = reviewItemSet.getParentCommits(); if (!hasCommit(parentCommits, commit)) { parentCommits.add(commit); } } } }
Source:
public void delete(IProgressMonitor progressMonitor, boolean overwriting, boolean closeEditors) throws CoreException { if (closeEditors) { Display.getDefault().syncExec(new Runnable() { @Override public void run() { closeEditors(); } }); } IPath path = getResource().getLocation(); if (path != null) { if (getParent() instanceof TmfTraceFolder) { TmfExperimentFolder experimentFolder = getProject().getExperimentsFolder(); if (experimentFolder != null && !overwriting) { for (TmfExperimentElement experiment : experimentFolder.getExperiments()) { List<TmfTraceElement> toRemove = new LinkedList<>(); for (TmfTraceElement trace : experiment.getTraces()) { if (trace.getElementPath().equals(getElementPath())) { toRemove.add(trace); } } for (TmfTraceElement child : toRemove) { experiment.removeTrace(child); } if (!toRemove.isEmpty() && experiment.getTraces().isEmpty()) { experiment.deleteSupplementaryFolder(); experiment.getResource().delete(true, progressMonitor); } } } if (overwriting) { deleteSupplementaryResources(); } else { deleteSupplementaryFolder(); } } else if (getParent() instanceof TmfExperimentElement) { TmfExperimentElement experimentElement = (TmfExperimentElement) getParent(); experimentElement.removeTrace(this); } } getResource().delete(true, progressMonitor); }

Target:
public void delete(IProgressMonitor progressMonitor, boolean overwriting, boolean closeEditors) throws CoreException { if (closeEditors) { Display.getDefault().syncExec(this::closeEditors); } IPath path = getResource().getLocation(); if (path != null) { if (getParent() instanceof TmfTraceFolder) { TmfExperimentFolder experimentFolder = getProject().getExperimentsFolder(); if (experimentFolder != null && !overwriting) { for (TmfExperimentElement experiment : experimentFolder.getExperiments()) { List<TmfTraceElement> toRemove = new LinkedList<>(); for (TmfTraceElement trace : experiment.getTraces()) { if (trace.getElementPath().equals(getElementPath())) { toRemove.add(trace); } } for (TmfTraceElement child : toRemove) { experiment.removeTrace(child, false); } if (!toRemove.isEmpty() && experiment.getTraces().isEmpty()) { experiment.deleteSupplementaryFolder(); experiment.getResource().delete(true, progressMonitor); } } } if (overwriting) { deleteSupplementaryResources(); } else { deleteSupplementaryFolder(); } } else if (getParent() instanceof TmfExperimentElement) { TmfExperimentElement experimentElement = (TmfExperimentElement) getParent(); experimentElement.removeTrace(this, false); } } getResource().delete(true, progressMonitor); }
Source:
public ActionResult execute() { String studentId = getNonNullRequestParamValue(Const.ParamsNames.STUDENT_ID); try { StudentProfileAttributes studentProfile = extractProfileData(studentId); logic.updateOrCreateStudentProfile(sanitizeProfile(studentProfile)); return new JsonResult(Const.StatusMessages.STUDENT_PROFILE_EDITED, HttpStatus.SC_ACCEPTED); } catch (InvalidParametersException ipe) { return new JsonResult(ipe.getMessage(), HttpStatus.SC_BAD_REQUEST); } }

Target:
public ActionResult execute() { String studentId = getNonNullRequestParamValue(Const.ParamsNames.STUDENT_ID); if (!studentId.equals(userInfo.id) && !isMasqueradeMode()) { return new JsonResult("You are not authorized to update this student's profile.", HttpStatus.SC_FORBIDDEN); } try { StudentProfileAttributes studentProfile = extractProfileData(studentId); logic.updateOrCreateStudentProfile(sanitizeProfile(studentProfile)); return new JsonResult(Const.StatusMessages.STUDENT_PROFILE_EDITED, HttpStatus.SC_ACCEPTED); } catch (InvalidParametersException ipe) { return new JsonResult(ipe.getMessage(), HttpStatus.SC_BAD_REQUEST); } }
Source:
public void addPermission(Permission permission) throws PermissionException { log.debug("Add permission " + permission); this.getPermissionsDAO().addPermission(permission); }

Target:
public void addPermission(Permission permission) throws PermissionException { if (log.isDebugEnabled()) { log.debug("Add permission " + permission); } this.getPermissionsDAO().addPermission(permission); }
Source:
private void handleSendImage(Intent intent) { Uri selectedImage = null; ArrayList<Uri> selectedImagesArray = new ArrayList<>(); selectedImage = intent.getParcelableExtra(Intent.EXTRA_STREAM); selectedImagesArray.add(selectedImage); chooseDialog(selectedImagesArray); }

Target:
private void handleSendImage(Intent intent) { Uri selectedImage = null; ArrayList<Uri> selectedImagesArray = new ArrayList<>(); selectedImage = intent.getParcelableExtra(Intent.EXTRA_STREAM); if (selectedImage != null) { selectedImagesArray.add(selectedImage); chooseDialog(selectedImagesArray); } }
Source:
public void onEvent(RowData event, long eventTimestamp, WatermarkOutput output) { try { Long watermark = innerWatermarkGenerator.currentWatermark(event); if (watermark != null) { currentWatermark = innerWatermarkGenerator.currentWatermark(event); } } catch (Exception e) { throw new RuntimeException( String.format("Generated WatermarkGenerator fails to generate for row: %s.", event), e); } }

Target:
public void onEvent(RowData event, long eventTimestamp, WatermarkOutput output) { try { Long watermark = innerWatermarkGenerator.currentWatermark(event); if (watermark != null) { currentWatermark = watermark; } } catch (Exception e) { throw new RuntimeException( String.format("Generated WatermarkGenerator fails to generate for row: %s.", event), e); } }
Source:
Collection<NotificationFilter> getAllFilters(boolean allWikis) throws NotificationException; Collection<NotificationFilter> getAllFilters(DocumentReference user, boolean onlyEnabled) throws NotificationException; default Collection<NotificationFilter> getAllFilters(DocumentReference user, boolean onlyEnabled, Set<NotificationFilter.FilteringMoment> filteringMoments) throws NotificationException { return getAllFilters(user, onlyEnabled); }

Target:
Collection<NotificationFilter> getAllFilters(boolean allWikis) throws NotificationException; Collection<NotificationFilter> getAllFilters(DocumentReference user, boolean onlyEnabled) throws NotificationException; @Unstable default Collection<NotificationFilter> getAllFilters(DocumentReference user, boolean onlyEnabled, NotificationFilter.FilteringPhase filteringPhase) throws NotificationException { return getAllFilters(user, onlyEnabled); }
Source:
public boolean isAPIThrottled(String apiKey){ boolean isThrottled = this.throttledAPIKeysMap.containsKey(apiKey); if(isThrottled) { long currentTime = System.currentTimeMillis(); long timestamp = this.throttledAPIKeysMap.get(apiKey); if(timestamp >= currentTime) { return isThrottled; } else { this.throttledAPIKeysMap.remove(apiKey); this.conditionDtoMap.remove(apiKey); return false; }APIUtil } else { return isThrottled; } }

Target:
public boolean isAPIThrottled(String apiKey){ boolean isThrottled = this.throttledAPIKeysMap.containsKey(apiKey); if(isThrottled) { long currentTime = System.currentTimeMillis(); long timestamp = this.throttledAPIKeysMap.get(apiKey); if(timestamp >= currentTime) { return isThrottled; } else { this.throttledAPIKeysMap.remove(apiKey); this.conditionDtoMap.remove(apiKey); return false; } } else { return isThrottled; } }
Source:
public TactViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { View tactContent; switch (viewType) { case 1: tactContent = LayoutInflater.from(parent.getContext()).inflate(R.layout.pocketmusic_add_tact_button, parent, false); tactContent.setLayoutParams(tactViewParams); tactContent.setOnClickListener(addTactClickListener); break; case 2: tactContent = LayoutInflater.from(parent.getContext()).inflate(R.layout.pocketmusic_empty_view, parent, false); tactContent.setLayoutParams(tactViewParams); break; default: tactContent = new TrackView(getContext(), trackGrid); tactContent.setLayoutParams(tactViewParams); break; } return new TactViewHolder(tactContent); }

Target:
public TactViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { View tactContent; switch (viewType) { case PLUS_VIEW_TYPE: tactContent = LayoutInflater.from(parent.getContext()).inflate(R.layout.pocketmusic_add_tact_button, parent, false); tactContent.setLayoutParams(tactViewParams); tactContent.setOnClickListener(addTactClickListener); break; case EMPTY_VIEW_TYPE: tactContent = LayoutInflater.from(parent.getContext()).inflate(R.layout.pocketmusic_empty_view, parent, false); tactContent.setLayoutParams(tactViewParams); break; default: tactContent = new TrackView(getContext(), trackGrid); tactContent.setLayoutParams(tactViewParams); break; } return new TactViewHolder(tactContent); }
Source:
public void onCreate() { super.onCreate(); AppCompatDelegate.setCompatVectorFromResourcesEnabled(true); log.info("WalletApplication.onCreate()"); config = new Configuration(PreferenceManager.getDefaultSharedPreferences(this), getResources()); autoLogout = new AutoLogout(config); myPackageReplaced = false; registerActivityLifecycleCallbacks(new ActivitiesTracker() { @Override protected void onStartedFirst(Activity activity) { autoLogout.setAppInBackground(false); if (wallet != null && config.getAutoLogoutEnabled() && (deviceWasLocked || autoLogout.shouldLogout())) { lockTheApp(WalletApplication.this, activity); if (autoLogout.isTimerActive()) { autoLogout.stopTimer(); } } } @Override protected void onStartedAny(boolean isTheFirstOne) { super.onStartedAny(isTheFirstOne); if (!BuildConfig.DEBUG && myPackageReplaced) { myPackageReplaced = false; ProcessPhoenix.triggerRebirth(WalletApplication.this); } } @Override protected void onStoppedLast() { autoLogout.setAppInBackground(true); } }); walletFile = getFileStreamPath(Constants.Files.WALLET_FILENAME_PROTOBUF); if (walletFileExists()) { fullInitialization(); } registerDeviceInteractiveReceiver(); }

Target:
public void onCreate() { super.onCreate(); AppCompatDelegate.setCompatVectorFromResourcesEnabled(true); log.info("WalletApplication.onCreate()"); config = new Configuration(PreferenceManager.getDefaultSharedPreferences(this), getResources()); autoLogout = new AutoLogout(config); registerActivityLifecycleCallbacks(new ActivitiesTracker() { @Override protected void onStartedFirst(Activity activity) { autoLogout.setAppInBackground(false); if (wallet != null && config.getAutoLogoutEnabled() && (deviceWasLocked || autoLogout.shouldLogout())) { lockTheApp(WalletApplication.this, activity); if (autoLogout.isTimerActive()) { autoLogout.stopTimer(); } } } @Override protected void onStartedAny(boolean isTheFirstOne) { super.onStartedAny(isTheFirstOne); if (!BuildConfig.DEBUG && myPackageReplaced) { myPackageReplaced = false; ProcessPhoenix.triggerRebirth(WalletApplication.this); } } @Override protected void onStoppedLast() { autoLogout.setAppInBackground(true); } }); walletFile = getFileStreamPath(Constants.Files.WALLET_FILENAME_PROTOBUF); if (walletFileExists()) { fullInitialization(); } registerDeviceInteractiveReceiver(); }
Source:
public float getProgress() throws IOException { return 1.0f; }

Target:
public float getProgress() throws IOException { float progress = (float) inputStream.getTotalBytes() / availableBytes; return Float.valueOf(df.format(progress)); }
Source:
public static Map<String, Set<String>> parseArgs(String[] args) { Map<String, Set<String>> parsedArgs = new HashMap<>(); for (String arg : args) { int index = arg.indexOf("="); if (arg.startsWith("--") && index > 0) { String key = arg.substring(2, index); Set<String> values = parsedArgs.get(key); if (values == null) { values = new HashSet<>(); parsedArgs.put(key, values); } values.add(arg.substring(index + 1)); } } return parsedArgs; }

Target:
public static Map<String, Set<String>> parseArgs(String[] args) { Map<String, Set<String>> parsedArgs = new HashMap<>(); for (String arg : args) { int index = arg.indexOf("="); if (arg.startsWith("--") && index > 0) { String argName = arg.substring(2, index); parsedArgs.computeIfAbsent(argName, k -> new HashSet<>()) .add(arg.substring(index + 1)); } } return parsedArgs; }
Source:
private void stopNetwork() { logger.debug("stopNetwork()"); try { network.close(); network = null; logger.info("Closed panStamp network"); } catch (ModemException e) { logger.error("Error closing panStamp network: " + e.getMessage(), e); } finally { } }

Target:
private void stopNetwork() { logger.debug("stopNetwork()"); try { network.close(); network = null; logger.info("Closed panStamp network"); } catch (ModemException e) { logger.error("Error closing panStamp network: " + e.getMessage(), e); } }
Source:
public void removeChangeListener() { collection = prepareRealmListInLooperThread(); Realm realm = looperThread.realm; final AtomicInteger listenerCalledCount = new AtomicInteger(0); RealmChangeListener<RealmList<Dog>> listener1 = new RealmChangeListener<RealmList<Dog>>() { @Override public void onChange(RealmList<Dog> element) { fail(); } }; OrderedRealmCollectionChangeListener<RealmList<Dog>> listener2 = new OrderedRealmCollectionChangeListener<RealmList<Dog>>() { @Override public void onChange(RealmList<Dog> collection, OrderedCollectionChangeSet changes) { fail(); } }; collection.addChangeListener(listener1); collection.addChangeListener(listener2); realm.beginTransaction(); collection.get(0).setAge(42); realm.commitTransaction(); collection.removeChangeListener(listener1); collection.removeChangeListener(listener2); realm.beginTransaction(); realm.cancelTransaction(); assertEquals(0, listenerCalledCount.get()); looperThread.testComplete(); }

Target:
public void removeChangeListener() { collection = prepareRealmListInLooperThread(); Realm realm = looperThread.realm; final AtomicInteger listenerCalledCount = new AtomicInteger(0); RealmChangeListener<RealmList<Dog>> listener1 = new RealmChangeListener<RealmList<Dog>>() { @Override public void onChange(RealmList<Dog> element) { fail(); } }; OrderedRealmCollectionChangeListener<RealmList<Dog>> listener2 = new OrderedRealmCollectionChangeListener<RealmList<Dog>>() { @Override public void onChange(RealmList<Dog> collection, OrderedCollectionChangeSet changes) { assertEquals(0, listenerCalledCount.getAndIncrement()); } }; collection.addChangeListener(listener1); collection.addChangeListener(listener2); realm.beginTransaction(); collection.get(0).setAge(42); realm.commitTransaction(); collection.removeChangeListener(listener1); realm.beginTransaction(); realm.cancelTransaction(); assertEquals(1, listenerCalledCount.get()); looperThread.testComplete(); }
Source:
private void fetchLocationProperties() { hiddenLocationIds = new ArrayList<>(); propertyOwners = new ArrayList<>(); FacilitiesManager.getLocationProperties(this, new Callback<HashMap<String, HashMap<String, String>>>() { @Override public void success(HashMap<String, HashMap<String, String>> stringHashMapHashMap, Response response) { Iterator iterator = stringHashMapHashMap.entrySet().iterator(); while (iterator.hasNext()) { Map.Entry pair = (Map.Entry) iterator.next(); if (pair.getValue().toString().contains(HIDDEN)) { hiddenLocationIds.add(pair.getKey().toString()); } if (pair.getValue().toString().contains(LEASED)) { FacilitiesPropertyOwner propertyOwner = new FacilitiesPropertyOwner(); propertyOwner.setId(pair.getKey().toString()); String value = pair.getValue().toString(); String[] valueSplits = value.split(","); for (int i = 0; i < valueSplits.length; i++) { String[] subvalueSplits = valueSplits[i].split("="); if (subvalueSplits[0].contains(PHONE)) { if (subvalueSplits.length > 1) { propertyOwner.setPhone(removeCharacter(subvalueSplits[1])); } } if (subvalueSplits[0].contains(EMAIL)) { if (subvalueSplits.length > 1) { propertyOwner.setEmail(removeCharacter(subvalueSplits[1])); } } if (subvalueSplits[0].contains(NAME)) { if (subvalueSplits.length > 1) { propertyOwner.setName(removeCharacter(subvalueSplits[1])); } } } propertyOwners.add(propertyOwner); } } if (name.equals(NEARBY_LOCATIONS)) { updatePlacesByLocation(); } else { locationIdsbyCategory = getIntent().getStringArrayListExtra(Constants.FACILITIES_LOCATIONS_KEY); updatePlacesByCategory(); } } @Override public void failure(RetrofitError error) { MitMobileApplication.bus.post(new OttoBusEvent.RetrofitFailureEvent(error)); } }); }

Target:
private void fetchLocationProperties() { propertyOwners = new ArrayList<>(); FacilitiesManager.getLocationProperties(this, new Callback<FacilitiesPropertyOwnerWrapper>() { @Override public void success(FacilitiesPropertyOwnerWrapper facilitiesPropertyOwnerWrapper, Response response) { propertyOwners = facilitiesPropertyOwnerWrapper.getPropertyOwners(); removeHiddenLocations(); if (name.equals(NEARBY_LOCATIONS)) { updatePlacesByLocation(); } else { locationIdsbyCategory = getIntent().getStringArrayListExtra(Constants.FACILITIES_LOCATIONS_KEY); updatePlacesByCategory(); } } @Override public void failure(RetrofitError error) { MitMobileApplication.bus.post(new OttoBusEvent.RetrofitFailureEvent(error)); } }); }
Source:
public FeedDTO fetchFeed(@PathVariable("id") Long feedId, Principal principal) { String username = ""; if (principal != null) { username = principal.getName(); } Optional<Feed> feedOptional = feedFetcherService.getFeed(feedId, username); Feed feed = feedOptional.orElseThrow(() -> new ResourceNotFoundException(feedId)); Optional<PostMonitor> monitorOptional = postMonitorService.getPostMonitor(feedId); PostMonitor postMonitor = monitorOptional.orElse(new PostMonitor(feedId)); return new FeedDTO(feed, postMonitor.getViews()); }

Target:
public FeedDTO fetchFeed(@PathVariable("id") Long feedId, Principal principal) { String username = ""; if (principal != null) { username = principal.getName(); } Optional<Feed> feedOptional = feedFetcherService.getFeed(feedId, username); Feed feed = feedOptional.orElseThrow(() -> new ResourceNotFoundException(feedId)); return new FeedDTO(feed); }
Source:
private void collectOverTimeStatistics() { final List<GamePlayer> players = game.getPlayerList().getPlayers(); final List<String> alliances = new ArrayList<>(game.getAllianceTracker().getAlliances()); final Map<OverTimeStatisticType, IStat> overTimeStatisticToSource = createOverTimeStatisticsMapping(game.getResourceList().getResources()); { for (OverTimeStatisticType type : overTimeStatisticToSource.keySet()) { underConstruction.getOverTimeStatistics().put(type, HashBasedTable.create()); } } for (final Round round : getRounds()) { game.getHistory().gotoNode(round); for (final GamePlayer player : players) { overTimeStatisticToSource.forEach( (type, source) -> underConstruction .getOverTimeStatistics() .get(type) .put(player.getName(), round, source.getValue(player, game))); } for (final String alliance : alliances) { overTimeStatisticToSource.forEach( (type, source) -> underConstruction .getOverTimeStatistics() .get(type) .put(alliance, round, source.getValue(alliance, game))); } } }

Target:
private void collectOverTimeStatistics() { final Map<OverTimeStatisticType, IStat> overTimeStatisticSources = createOverTimeStatisticsMapping(game.getResourceList().getResources()); { for (final OverTimeStatisticType type : overTimeStatisticSources.keySet()) { underConstruction.getOverTimeStatistics().put(type, HashBasedTable.create()); } } final List<GamePlayer> players = game.getPlayerList().getPlayers(); final List<String> alliances = new ArrayList<>(game.getAllianceTracker().getAlliances()); for (final Round round : getRounds()) { game.getHistory().gotoNode(round); collectOverTimeStatisticsForRound(overTimeStatisticSources, players, alliances, round); } }
Source:
public Map<String,Serializable> createConnectionParameters(ImportData data, Catalog catalog) throws IOException { if (dataStoreFactory instanceof FileDataStoreFactorySpi) { File f = null; if (data instanceof SpatialFile) { f = ((SpatialFile) data).getFile(); } if (data instanceof Directory) { f = ((Directory) data).getFile(); } if (f != null) { Map<String,Serializable> map = new HashMap<String, Serializable>(); map.put("url", relativeDataFileURL(f.toURI().toURL().toString(), catalog)); if (data.getCharsetEncoding() != null) { map.put("charset",data.getCharsetEncoding()); } return map; } } if (dataStoreFactory instanceof JDBCDataStoreFactory) { Database db = null; if (data instanceof Database) { db = (Database) data; } if (data instanceof Table) { db = ((Table) data).getDatabase(); } if (db != null) { return db.getParameters(); } } Database db = null; if (data instanceof Database) { db = (Database) data; } if (data instanceof Table) { db = ((Table) data).getDatabase(); } if (db != null) { return db.getParameters(); } return null; }

Target:
public Map<String,Serializable> createConnectionParameters(ImportData data, Catalog catalog) throws IOException { if (dataStoreFactory instanceof FileDataStoreFactorySpi) { File f = null; if (data instanceof SpatialFile) { f = ((SpatialFile) data).getFile(); } if (data instanceof Directory) { f = ((Directory) data).getFile(); } if (f != null) { Map<String,Serializable> map = new HashMap<String, Serializable>(); map.put("url", relativeDataFileURL(DataUtilities.fileToURL(f).toString(), catalog)); if (data.getCharsetEncoding() != null) { map.put("charset",data.getCharsetEncoding()); } return map; } } if (dataStoreFactory instanceof JDBCDataStoreFactory) { Database db = null; if (data instanceof Database) { db = (Database) data; } if (data instanceof Table) { db = ((Table) data).getDatabase(); } if (db != null) { return db.getParameters(); } } Database db = null; if (data instanceof Database) { db = (Database) data; } if (data instanceof Table) { db = ((Table) data).getDatabase(); } if (db != null) { return db.getParameters(); } return null; }
Source:
public void testLineBreakImplicitParagraph() { builder.beginDocument(); builder.characters("line"); builder.lineBreak(); builder.characters("break"); builder.endDocument(); String markup = out.toString(); TestUtil.println(markup); assertEquals("line \nbreak\n\n", markup); }

Target:
public void testLineBreakImplicitParagraph() { builder.beginDocument(); builder.characters("line"); builder.lineBreak(); builder.characters("break"); builder.endDocument(); assertMarkup("line \nbreak\n\n"); }
Source:
public void testFindPrimaryReferenceMultipleChildOfSpanContext() { Tracer tracer = new APMTracer(); Map<String, String> headers1 = new HashMap<>(); headers1.put(Constants.HAWKULAR_APM_TRACEID, TEST_APM_TRACEID); headers1.put(Constants.HAWKULAR_APM_ID, TEST_APM_ID1); headers1.put(Constants.HAWKULAR_APM_TXN, TEST_TXN); SpanContext spanCtx1 = tracer.extract(Format.Builtin.TEXT_MAP, new TextMapExtractAdapter(headers1)); Map<String, String> headers2 = new HashMap<>(); headers2.put(Constants.HAWKULAR_APM_TRACEID, TEST_APM_TRACEID); headers2.put(Constants.HAWKULAR_APM_ID, TEST_APM_ID2); headers2.put(Constants.HAWKULAR_APM_TXN, TEST_TXN); SpanContext spanCtx2 = tracer.extract(Format.Builtin.TEXT_MAP, new TextMapExtractAdapter(headers2)); Reference ref1 = new Reference(References.CHILD_OF, spanCtx1); Reference ref2 = new Reference(References.CHILD_OF, spanCtx2); assertNull(APMSpan.findPrimaryReference(Arrays.asList(ref1, ref2))); }

Target:
public void testFindPrimaryReferenceMultipleChildOfSpanContext() { Tracer tracer = new APMTracer(); SpanContext spanCtx1 = extractSpanContext(tracer, TEST_APM_ID1); SpanContext spanCtx2 = extractSpanContext(tracer, TEST_APM_ID2); Reference ref1 = new Reference(References.CHILD_OF, spanCtx1); Reference ref2 = new Reference(References.CHILD_OF, spanCtx2); assertNull(APMSpan.findPrimaryReference(Arrays.asList(ref1, ref2))); }
Source:
private File createUnixGitSSH(File key, String user) throws IOException { File ssh = createTempFile("ssh", ".sh"); File ssh_copy = new File(ssh.toString() + "-copy"); boolean isCopied = false; try (PrintWriter w = new PrintWriter(ssh, this.encoding)) { w.println("#!/bin/sh"); w.println("if [ -z \"${DISPLAY}\" ]; then"); w.println(" DISPLAY=:123.456"); w.println(" export DISPLAY"); w.println("fi"); w.println("ssh -i \"" + key.getAbsolutePath() + "\" -l \"" + user + "\" -o StrictHostKeyChecking=no \"$@\""); } ssh.setExecutable(true, true); String fromLocation = ssh.toString(); String toLocation = ssh_copy.toString(); try { new ProcessBuilder("cp", fromLocation, toLocation).start().waitFor(); isCopied = true; ssh_copy.setExecutable(true,true); deleteTempFile(ssh); } catch(InterruptedException ie) { if(isCopied) { deleteTempFile(ssh_copy); } return ssh; } return ssh_copy; }

Target:
private File createUnixGitSSH(File key, String user) throws IOException { File ssh = createTempFile("ssh", ".sh"); File ssh_copy = new File(ssh.toString() + "-copy"); boolean isCopied = false; try (PrintWriter w = new PrintWriter(ssh, encoding)) { w.println("#!/bin/sh"); w.println("if [ -z \"${DISPLAY}\" ]; then"); w.println(" DISPLAY=:123.456"); w.println(" export DISPLAY"); w.println("fi"); w.println("ssh -i \"" + key.getAbsolutePath() + "\" -l \"" + user + "\" -o StrictHostKeyChecking=no \"$@\""); } ssh.setExecutable(true, true); String fromLocation = ssh.toString(); String toLocation = ssh_copy.toString(); try { new ProcessBuilder("cp", fromLocation, toLocation).start().waitFor(); isCopied = true; ssh_copy.setExecutable(true,true); deleteTempFile(ssh); } catch(InterruptedException ie) { if(isCopied) { deleteTempFile(ssh_copy); } return ssh; } return ssh_copy; }
Source:
public static IElectriCityBus getElectriCityBus(String dgw) { IElectricityAdapter ecAdapter = ApiAdapterFactory.createElectricityAdapter(); IJourney journey = ecAdapter.getCurrentJourney(dgw); String destination = journey.getDestination(); String journeyId = journey.getJourneyId(); IWaftAdapter waftAdapter = ApiAdapterFactory.createWaftAdapter(); List<IFlag> flags = waftAdapter.getFlagsForVehicle(journeyId); return new ElectriCityBus(destination, journeyId, dgw, flags); }

Target:
public static IElectriCityBus getElectriCityBus(String dgw) { IJourney journey = electriCityAdapter.getCurrentJourney(dgw); String destination = journey.getDestination(); String journeyId = journey.getJourneyId(); List<IFlag> flags = waftAdapter.getFlagsForVehicle(journeyId); return new ElectriCityBus(destination, journeyId, dgw, flags); }
Source:
public void testValidmzMLfile() throws IOException, MSDKException, XMLStreamException { final String inputFileName = TEST_DATA_PATH + "mzML_with_UV.mzML"; final File inputFile = new File(inputFileName); Assert.assertNotNull(inputFile); MzMLFileParser mzParser = new MzMLFileParser(inputFile); mzParser.execute(); Assert.assertNotNull(new File(inputFileName)); MzMLFileParser mzParser2 = new MzMLFileParser(inputFileName); mzParser2.execute(); }

Target:
public void testValidmzMLfile() throws IOException, MSDKException, XMLStreamException { final String inputFileName = TEST_DATA_PATH + "mzML_with_UV.mzML"; final File inputFile = new File(inputFileName); MzMLFileParser mzParser = new MzMLFileParser(inputFile); mzParser.execute(); MzMLSpectrum spectrum = mzParser.getSpectrumList().get(14); Assert.assertNotNull(spectrum); Assert.assertNotNull(spectrum.getMzValues()); Assert.assertEquals(spectrum.getMzBinaryDataInfo().getArrayLength(), spectrum.getMzValues().length); Assert.assertNotNull(new File(inputFileName)); MzMLFileParser mzParser2 = new MzMLFileParser(inputFileName); mzParser2.execute(); MzMLSpectrum spectrum2 = mzParser2.getSpectrumList().get(17); Assert.assertNotNull(spectrum2); Assert.assertNotNull(spectrum2.getMzValues()); Assert.assertEquals(spectrum2.getMzBinaryDataInfo().getArrayLength(), spectrum2.getMzValues().length); }
Source:
public List<JobInfo> getJobsInfoList(List<String> jobsId) throws PermissionException, NotConnectedException, UnknownJobException { frontendState.checkPermission("getJobsInfoList", "You don't have permissions to load jobs"); List<JobInfo> jobsInfoList = new ArrayList<>(); for (String jobId : jobsId) { try { jobsInfoList.add(this.getJobInfo(jobId)); } catch (UnknownJobException e) { throw new UnknownJobException(e); } } return jobsInfoList; }

Target:
public List<JobInfo> getJobsInfoList(List<String> jobsId) throws PermissionException, NotConnectedException, UnknownJobException { List<JobInfo> jobsInfoList = new ArrayList<>(); for (String jobId : jobsId) { try { jobsInfoList.add(this.getJobInfo(jobId)); } catch (UnknownJobException e) { throw new UnknownJobException(e); } } return jobsInfoList; }