auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private Bitmap doOCFileInBackground() { Bitmap thumbnail = null; final String imageKey = String.valueOf(((OCFile) mFile).getRemoteId()); thumbnail = getBitmapFromDiskCache(imageKey); if (thumbnail == null || ((OCFile)mFile).needsUpdateThumbnail()) { int px = getThumbnailDimension(); if (((OCFile)mFile).isDown()) { Bitmap bitmap = BitmapUtils.decodeSampledBitmapFromFile( ((OCFile)mFile).getStoragePath(), px, px); if (bitmap != null) { thumbnail = addThumbnailToCache(imageKey, bitmap, ((OCFile)mFile).getStoragePath(), px); ((OCFile)mFile).setNeedsUpdateThumbnail(false); mStorageManager.saveFile(((OCFile)mFile)); } } else { if (mClient != null && mServerVersion != null) { OwnCloudVersion serverOCVersion = new OwnCloudVersion(mServerVersion); if (serverOCVersion.compareTo(new OwnCloudVersion(MINOR_SERVER_VERSION_FOR_THUMBS)) >= 0) { try { int status = -1; String uri = mClient.getBaseUri() + "/index.php/apps/files/api/v1/thumbnail/" + px + "/" + px + Uri.encode(((OCFile)mFile).getRemotePath(), "/"); Log_OC.d("Thumbnail", "URI: " + uri); GetMethod get = new GetMethod(uri); status = mClient.executeMethod(get); if (status == HttpStatus.SC_OK) { byte[] bytes = get.getResponseBody(); Bitmap bitmap = BitmapFactory.decodeByteArray(bytes, 0, bytes.length); thumbnail = ThumbnailUtils.extractThumbnail(bitmap, px, px); if (thumbnail != null) { addBitmapToCache(imageKey, thumbnail); } } } catch (Exception e) { e.printStackTrace(); } } else { Log_OC.d(TAG, "Server too old"); } } } } return thumbnail; }

Target:
private Bitmap doOCFileInBackground() { Bitmap thumbnail = null; OCFile file = (OCFile)mFile; final String imageKey = String.valueOf(file.getRemoteId()); thumbnail = getBitmapFromDiskCache(imageKey); if (thumbnail == null || file.needsUpdateThumbnail()) { int px = getThumbnailDimension(); if (file.isDown()) { Bitmap bitmap = BitmapUtils.decodeSampledBitmapFromFile( file.getStoragePath(), px, px); if (bitmap != null) { thumbnail = addThumbnailToCache(imageKey, bitmap, file.getStoragePath(), px); file.setNeedsUpdateThumbnail(false); mStorageManager.saveFile(file); } } else { if (mClient != null && mServerVersion != null) { OwnCloudVersion serverOCVersion = new OwnCloudVersion(mServerVersion); if (serverOCVersion.compareTo(new OwnCloudVersion(MINOR_SERVER_VERSION_FOR_THUMBS)) >= 0) { try { int status = -1; String uri = mClient.getBaseUri() + "/index.php/apps/files/api/v1/thumbnail/" + px + "/" + px + Uri.encode(file.getRemotePath(), "/"); Log_OC.d("Thumbnail", "URI: " + uri); GetMethod get = new GetMethod(uri); status = mClient.executeMethod(get); if (status == HttpStatus.SC_OK) { byte[] bytes = get.getResponseBody(); Bitmap bitmap = BitmapFactory.decodeByteArray(bytes, 0, bytes.length); thumbnail = ThumbnailUtils.extractThumbnail(bitmap, px, px); if (thumbnail != null) { addBitmapToCache(imageKey, thumbnail); } } } catch (Exception e) { e.printStackTrace(); } } else { Log_OC.d(TAG, "Server too old"); } } } } return thumbnail; }
Source:
private static IProject createExistingProject(final ProjectRecord record, final boolean open, IProgressMonitor monitor) throws CoreException { String projectName = record.getProjectName(); final IWorkspace workspace = ResourcesPlugin.getWorkspace(); final IProject project = workspace.getRoot().getProject(projectName); if (project.exists()) { if (open && !project.isOpen()) { IPath location = project.getFile( IProjectDescription.DESCRIPTION_FILE_NAME) .getLocation(); if (location != null && location.toFile().equals( record.getProjectSystemFile())) { project.open(monitor); project.refreshLocal(IResource.DEPTH_INFINITE, monitor); } } return null; } if (record.getProjectDescription() == null) { record.setProjectDescription(workspace .newProjectDescription(projectName)); IPath locationPath = new Path(record.getProjectSystemFile() .getAbsolutePath()); if (Platform.getLocation().isPrefixOf(locationPath)) record.getProjectDescription().setLocation(null); else record.getProjectDescription().setLocation(locationPath); } else record.getProjectDescription().setName(projectName); try { monitor.beginTask( UIText.WizardProjectsImportPage_CreateProjectsTask, 100); project.create(record.getProjectDescription(), SubMonitor.convert(monitor, 30)); project.open(IResource.BACKGROUND_REFRESH, SubMonitor.convert(monitor, 50)); return project; } finally { monitor.done(); } }

Target:
private static IProject createExistingProject(final ProjectRecord record, final boolean open, IProgressMonitor monitor) throws CoreException { String projectName = record.getProjectName(); final IWorkspace workspace = ResourcesPlugin.getWorkspace(); final IProject project = workspace.getRoot().getProject(projectName); if (project.exists()) { if (open && !project.isOpen()) { SubMonitor progress = SubMonitor.convert(monitor, 2); IPath location = project.getFile( IProjectDescription.DESCRIPTION_FILE_NAME) .getLocation(); if (location != null && location.toFile().equals( record.getProjectSystemFile())) { project.open(progress.newChild(1)); project.refreshLocal(IResource.DEPTH_INFINITE, progress.newChild(1)); } } return null; } if (record.getProjectDescription() == null) { record.setProjectDescription(workspace .newProjectDescription(projectName)); IPath locationPath = new Path(record.getProjectSystemFile() .getAbsolutePath()); if (Platform.getLocation().isPrefixOf(locationPath)) record.getProjectDescription().setLocation(null); else record.getProjectDescription().setLocation(locationPath); } else { record.getProjectDescription().setName(projectName); } SubMonitor progress = SubMonitor.convert(monitor, 8); progress.setTaskName( UIText.WizardProjectsImportPage_CreateProjectsTask); project.create(record.getProjectDescription(), progress.newChild(3)); project.open(IResource.BACKGROUND_REFRESH, progress.newChild(5)); return project; }
Source:
public void setPriority(final TableName tn) { int priority = HConstants.NORMAL_QOS; if (tn != null && tn.isSystemTable() && !tn.equals(SlowLogTableAccessor.SLOW_LOG_TABLE_NAME)) { priority = HConstants.SYSTEMTABLE_QOS; } setPriority(priority); }

Target:
public void setPriority(final TableName tn) { setPriority( tn != null && tn.isSystemTable() ? HConstants.SYSTEMTABLE_QOS : HConstants.NORMAL_QOS); }
Source:
public <P extends PagedResponse<T>> Stream<P> streamByPage(String continuationToken) { return (Stream<P>) pagedFlux.byPage(continuationToken).toStream(); }

Target:
public <P extends PagedResponse<T>> Stream<P> streamByPage(String continuationToken) { return (Stream<P>) pagedFluxBase.byPage(continuationToken).toStream(); }
Source:
public void doPost(HttpServletRequest req, HttpServletResponse resp) throws IOException, ServletException { settingsMap.clear(); for (Object key : req.getParameterMap().keySet()) { String parameterName = (String) key; if (!parameterName.startsWith("errorMessage") && !parameterName.equals("submit")) { addStringFieldValue(settingsMap, req, parameterName); } } validateSettings(); if (fieldErrors.size() > 0) { doGetContinue(req, resp); return; } if(log.isDebugEnabled()) { for (Map.Entry<String, Object> entry : settingsMap.entrySet()) { String key = entry.getKey(); Object value = entry.getValue(); log.debug("save plugin config " + key + "=" + value + " " + value.getClass().getName()); } } pluginSettings.put(SETTINGS_MAP, settingsMap); String redirectUrl; redirectUrl = navBuilder.addons().buildRelative(); log.debug("redirect: " + redirectUrl); resp.sendRedirect(redirectUrl); }

Target:
public void doPost(HttpServletRequest req, HttpServletResponse resp) throws IOException, ServletException { settingsMap.clear(); for (Object key : req.getParameterMap().keySet()) { String parameterName = (String) key; if (!parameterName.equals("submit")) { addStringFieldValue(settingsMap, req, parameterName); } } try { validateSettings(); } catch (Exception e) { } if (fieldErrors.size() > 0) { doGetContinue(req, resp); return; } if(log.isDebugEnabled()) { for (Map.Entry<String, Object> entry : settingsMap.entrySet()) { String key = entry.getKey(); Object value = entry.getValue(); log.debug("save plugin config " + key + "=" + value + " " + value.getClass().getName()); } } pluginSettings.put(SETTINGS_MAP, settingsMap); String redirectUrl; redirectUrl = navBuilder.addons().buildRelative(); log.debug("redirect: " + redirectUrl); resp.sendRedirect(redirectUrl); }
Source:
public void run(String resourceBase, String port) { LOGGER.warn("DEPRECATED. Will be removed in the future. Use run(String resourceBase, JBakeConfiguration config) instead"); run(resourceBase, "/", "localhost", Integer.parseInt(port)); }

Target:
public void run(String resourceBase, String port) { LOGGER.warn("DEPRECATED. This method will be removed in the next major release. Use run(String resourceBase, JBakeConfiguration config) instead."); run(resourceBase, "/", "localhost", Integer.parseInt(port)); }
Source:
public long save(Experiment experiment) throws IOException { try { long id; if (experiment.getId() == ExperimentImpl.UNSAVED_ID) { String name = namingScheme.generateNameFor(experiment); experiment.setName(name); ValidationResult nameValidation = namingScheme.validateName(experiment.getName()); if (!nameValidation.isValid()) { throw new IOException("Cannot save Experiment - invalid name:" + nameValidation.getMessage()); } id = (Long) currentSession().save(experiment); } else { ValidationResult nameValidation = namingScheme.validateName(experiment.getName()); if (!nameValidation.isValid()) { throw new IOException("Cannot save Experiment - invalid name:" + nameValidation.getMessage()); } currentSession().update(experiment); id = experiment.getId(); } return id; } catch (MisoNamingException e) { throw new IOException("Cannot save Experiment - issue with naming scheme", e); } }

Target:
public long save(Experiment experiment) throws IOException { long id; if (experiment.getId() == ExperimentImpl.UNSAVED_ID) { id = (Long) currentSession().save(experiment); } else { currentSession().update(experiment); id = experiment.getId(); } return id; }
Source:
private void changeShip(SolGame game, Hero hero, ShipItem selected) { HullConfig newConfig = selected.getConfig(); Hull hull = hero.getHull(); Engine.Config ec = newConfig.getEngineConfig(); Engine ei = ec == null ? null : ec.example.copy(); Gun g2 = hull.getGun(true); SolShip newHero = game.getShipBuilder().build(game, hero.getPosition(), new Vector2(), hero.getAngle(), 0, hero.getPilot(), hero.getItemContainer(), newConfig, newConfig.getMaxLife(), hull.getGun(false), g2, null, ei, new ShipRepairer(), hero.getMoney(), hero.getTradeContainer(), hero.getShield(), hero.getArmor()); game.getObjMan().removeObjDelayed(hero.getHero()); game.getObjMan().addObjDelayed(newHero); game.getHero().toSolShip(newHero); }

Target:
private void changeShip(SolGame game, Hero hero, ShipItem selected) { HullConfig newConfig = selected.getConfig(); Hull hull = hero.getHull(); Engine.Config ec = newConfig.getEngineConfig(); Engine ei = ec == null ? null : ec.example.copy(); Gun g2 = hull.getGun(true); SolShip newHero = game.getShipBuilder().build(game, hero.getPosition(), new Vector2(), hero.getAngle(), 0, hero.getPilot(), hero.getItemContainer(), newConfig, newConfig.getMaxLife(), hull.getGun(false), g2, null, ei, new ShipRepairer(), hero.getMoney(), hero.getTradeContainer(), hero.getShield(), hero.getArmor()); game.getObjMan().removeObjDelayed(hero.getShip()); game.getObjMan().addObjDelayed(newHero); game.getHero().setSolShip(newHero); }
Source:
public JobExecutionInfoResource getJobExecutionInfo(@PathVariable long executionId) { final JobExecution jobExecution; try { jobExecution = jobService.getJobExecution(executionId); } catch (org.springframework.batch.core.launch.NoSuchJobExecutionException e) { throw new NoSuchJobExecutionException(executionId); } final Set<String> restartableJobs = new HashSet<String>(jobLocator.getAllRestartableJobs()); final Set<String> deployedJobs = new HashSet<String>(jobLocator.getJobNames()); final Set<String> jobDefinitionNames = new HashSet<String>(getJobDefinitionNames()); final JobExecutionInfoResource jobExecutionInfoResource = jobExecutionInfoResourceAssembler.toResource(new JobExecutionInfo( jobExecution, timeZone)); final String jobName = jobExecution.getJobInstance().getJobName(); jobExecutionInfoResource.setDeleted(!jobDefinitionNames.contains(jobName)); jobExecutionInfoResource.setDeployed(deployedJobs.contains(jobName)); if (restartableJobs.contains(jobName)) { if (jobExecution.getStatus() != BatchStatus.COMPLETED) { jobExecutionInfoResource.setRestartable(isJobExecutionRestartable(jobExecution)); } } else { jobExecutionInfoResource.setRestartable(false); } return jobExecutionInfoResource; }

Target:
public JobExecutionInfoResource getJobExecutionInfo(@PathVariable long executionId) { final JobExecution jobExecution; try { jobExecution = jobService.getJobExecution(executionId); } catch (org.springframework.batch.core.launch.NoSuchJobExecutionException e) { throw new NoSuchJobExecutionException(executionId); } final Set<String> restartableJobs = new HashSet<String>(jobLocator.getAllRestartableJobs()); final Set<String> deployedJobs = new HashSet<String>(jobLocator.getJobNames()); final Set<String> jobDefinitionNames = new HashSet<String>(getJobDefinitionNames()); return getJobExecutionInfoResource(jobExecution, restartableJobs, deployedJobs, jobDefinitionNames); }
Source:
public void run() { StringBuilder buf = new StringBuilder("["); for (PartitionTopicInfo pti : partitionTopicInfos) { buf.append(format("%s-%s-%s,", pti.topic, pti.brokerString, pti.partition)); } buf.append(']'); logger.info(String.format("%s comsume at %s:%d with %s", getName(), Util.getHostFromBroker(broker), Util.getPortFromBroker(broker), buf.toString())); client = new GenClient( new ConsumerProcessor(partitionTopicInfos, Consumer.config.isBetterOrdered()), new DelegationIOConnection.DelegationIOConnectionFactory(), new DataMessageTypeFactory()); Properties prop = new Properties(); prop.setProperty("Server.host", Util.getHostFromBroker(broker)); prop.setProperty("Server.port", Util.getPortFromBroker(broker)); try { client.init(prop, getName()); } catch (ClosedChannelException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } logger.debug("stopping fetcher " + getName() + " to broker " + broker); shutdownLatch.countDown(); }

Target:
public void run() { StringBuilder buf = new StringBuilder("["); for (PartitionTopicInfo pti : partitionTopicInfos) { buf.append(pti.topic).append("-").append(pti.brokerString).append("-").append(pti.partition); } buf.append(']'); logger.info(getName() + " comsume at " + Util.getHostFromBroker(broker) + ":" + Util.getPortFromBroker(broker) + " with " + buf.toString()); client = new GenClient( new ConsumerProcessor(partitionTopicInfos, Consumer.config.isBetterOrdered()), new DelegationIOConnection.DelegationIOConnectionFactory(), new DataMessageTypeFactory()); Properties prop = new Properties(); prop.setProperty("Server.host", Util.getHostFromBroker(broker)); prop.setProperty("Server.port", Util.getPortFromBroker(broker)); try { client.init(prop, getName()); } catch (ClosedChannelException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } logger.debug("stopping fetcher " + getName() + " to broker " + broker); }
Source:
protected void sendCourseRegisteredEmail(String courseId) { CourseAttributes course = logic.getCourse(courseId); EmailWrapper email = new EmailGenerator().generateUserCourseRegisterEmail( logic.getAccount(account.googleId), course); try { emailSender.sendEmail(email); } catch (EmailSendingException e) { log.severe("Instructor course register email failed to send: " + TeammatesException.toStringWithStackTrace(e)); } }

Target:
protected void sendCourseRegisteredEmail(String courseId) { CourseAttributes course = logic.getCourse(courseId); EmailWrapper email = new EmailGenerator().generateUserCourseRegisterEmail( logic.getAccount(account.googleId), course); try { emailSender.sendEmail(email); } catch (EmailSendingException e) { log.severe("User course register email failed to send: " + TeammatesException.toStringWithStackTrace(e)); } }
Source:
@Override public void close(Status status, Metadata trailers) { Throwable error = null; try (Scope scope = currentTraceContext.maybeScope(context)) { delegate().close(status, trailers); } catch (Throwable e) { error = e; throw e; } finally { GrpcServerResponse response = new GrpcServerResponse(request, status, trailers, error); finish(response, spanRef.getAndSet(null)); } }

Target:
@Override public void close(Status status, Metadata trailers) { GrpcServerResponse response = new GrpcServerResponse(request, status, trailers, null); finish(response, spanRef.getAndSet(null)); try (Scope scope = currentTraceContext.maybeScope(context)) { delegate().close(status, trailers); } }
Source:
public String toString() { return MoreObjects.toStringHelper(this) .add("id", Integer.toHexString(System.identityHashCode(this))) .add("class", this.getClass()) .add("uuid", _uuid) .add("Tags", _tags) .add("VersionSetId", _versionSetId) .add("Position", _position) .toString(); }

Target:
public String toString() { return MoreObjects.toStringHelper(this) .add("id", Integer.toHexString(System.identityHashCode(this))) .add("class", this.getClass()) .add("Uuid", _uuid) .add("Tags", _tags) .add("VersionSetId", _versionSetId) .add("Position", _position) .toString(); }
Source:
public DefaultPromise(EventExecutor executor) { this.executor = requireNonNull(executor, "executor"); stage = new CompletionStageAdapter<>(this); }

Target:
public DefaultPromise(EventExecutor executor) { this.executor = requireNonNull(executor, "executor"); stage = new DefaultFutureCompletionStage<>(this); }
Source:
private void processResponse(org.jgroups.Address src, byte[] buffer, int offset, int length, long requestId) { try { Response response; if (length == 0) { response = CacheNotFoundResponse.INSTANCE; } else { response = (Response) marshaller.objectFromByteBuffer(buffer, offset, length); if (response == null) { response = SuccessfulResponse.SUCCESSFUL_EMPTY_RESPONSE; } } if (trace) log.tracef("%s received response for request %d from %s: %s", getAddress(), requestId, src, response); Address address = fromJGroupsAddress(src); requests.addResponse(requestId, address, response); } catch (Throwable t) { log.errorProcessingResponse(requestId, src); Exception e = t instanceof Exception ? ((Exception) t) : new CacheException(t); try { marshaller.objectFromByteBuffer(buffer, offset, length); } catch (IOException e1) { e1.printStackTrace(); } catch (ClassNotFoundException e1) { e1.printStackTrace(); } requests.addResponse(requestId, fromJGroupsAddress(src), new ExceptionResponse(e)); } }

Target:
private void processResponse(org.jgroups.Address src, byte[] buffer, int offset, int length, long requestId) { try { Response response; if (length == 0) { response = CacheNotFoundResponse.INSTANCE; } else { response = (Response) marshaller.objectFromByteBuffer(buffer, offset, length); if (response == null) { response = SuccessfulResponse.SUCCESSFUL_EMPTY_RESPONSE; } } if (trace) log.tracef("%s received response for request %d from %s: %s", getAddress(), requestId, src, response); Address address = fromJGroupsAddress(src); requests.addResponse(requestId, address, response); } catch (Throwable t) { log.errorProcessingResponse(requestId, src); } }
Source:
public void createReport(File report) throws IOException { logger.info("Writing report to " + report); int pageSize = 100; Writer fw = new OutputStreamWriter(new FileOutputStream(report), "UTF-8"); CSVWriter writer = new CSVWriter(fw); List<Term> output = this.outputTerms(ALATerm.TaxonomicIssue); String[] headers = output.stream().map(term -> term.toString()).collect(Collectors.toList()).toArray(new String[output.size()]); writer.writeNext(headers); for (String type: this.counts.keySet()) { String message = this.resources.getString(type); Integer count = this.counts.get(type); message = MessageFormat.format(message, count); logger.info(message); String[] values = new String[] { IssueType.COUNT.name(), type, message, Integer.toString(count) }; writer.writeNext(values); } IndexSearcher searcher = this.searcherManager.acquire(); try { Query query = new TermQuery(new org.apache.lucene.index.Term("type", ALATerm.TaxonomicIssue.qualifiedName())); TopDocs docs = searcher.search(query, pageSize); ScoreDoc last = null; while (docs.scoreDocs.length > 0) { for (ScoreDoc sd : docs.scoreDocs) { last = sd; Document doc = searcher.doc(sd.doc); String[] values = output.stream().map(term -> doc.get(this.fieldName(term))).collect(Collectors.toList()).toArray(new String[output.size()]); writer.writeNext(values); this.count("count.write.report"); } docs = searcher.searchAfter(last, query, pageSize); } } finally { this.searcherManager.release(searcher); } writer.close(); logger.info("Finished creating report"); }

Target:
public void createReport(File report) throws IOException { logger.info("Writing report to " + report); int pageSize = 100; try (Writer fw = new OutputStreamWriter(new FileOutputStream(report), "UTF-8")) { CSVWriter writer = new CSVWriter(fw); List<Term> output = this.outputTerms(ALATerm.TaxonomicIssue); String[] headers = output.stream().map(term -> term.toString()).collect(Collectors.toList()).toArray(new String[output.size()]); writer.writeNext(headers); for (String type : this.counts.keySet()) { String message = this.resources.getString(type); AtomicInteger count = this.counts.getOrDefault(type, new AtomicInteger(0)); message = MessageFormat.format(message, count.intValue()); logger.info(message); String[] values = new String[]{IssueType.COUNT.name(), type, message, count.toString()}; writer.writeNext(values); } IndexSearcher searcher = this.searcherManager.acquire(); try { Query query = new TermQuery(new org.apache.lucene.index.Term("type", ALATerm.TaxonomicIssue.qualifiedName())); TopDocs docs = searcher.search(query, pageSize); ScoreDoc last = null; while (docs.scoreDocs.length > 0) { for (ScoreDoc sd : docs.scoreDocs) { last = sd; Document doc = searcher.doc(sd.doc); String[] values = output.stream().map(term -> doc.get(this.fieldName(term))).collect(Collectors.toList()).toArray(new String[output.size()]); writer.writeNext(values); this.count("count.write.report"); } docs = searcher.searchAfter(last, query, pageSize); } } finally { this.searcherManager.release(searcher); } } logger.info("Finished creating report"); }
Source:
private static @NonNull ITmfTimestamp createOther(long value, int scale) { return new TmfRealTimestamp(value, scale); }

Target:
private static @NonNull ITmfTimestamp createOther(long value, int scale) { return new TmfTimestampImpl(value, scale); }
Source:
public AvatarComponentObject clickEditAvatar() { showAvatarControls(); avatarEditButton.click(); hideAvatarControls(); return new AvatarComponentObject(driver); }

Target:
public AvatarComponentObject clickEditAvatar() { showAvatarControls(); avatarEditButton.click(); hideAvatarControls(); PageObjectLogging.log("clickEditAvatar", "avatar edit button clicked", true); return new AvatarComponentObject(driver); }
Source:
public boolean isTableAvailable(TableName tableName) throws IOException { return listTableNames(tableName.getNameAsString()).length == 1; }

Target:
public boolean isTableAvailable(TableName tableName) throws IOException { throw new UnsupportedOperationException("isTableAvailable"); }
Source:
protected Long computeResult() { long result = 0; for (int i = 0; i < numBuckets; i += cycleSize) { if (buckets[(i + startFrom) % numBuckets] != null) { result += (buckets[(i + startFrom) % numBuckets]).longValue(); } else { result += 0.0; } } startFrom++; return result; }

Target:
protected Long computeResult() { long result = 0; for (int i = 0; i < numBuckets; i += cycleSize) { if (buckets[(i + startFrom) % numBuckets] != null) { result += (buckets[(i + startFrom) % numBuckets]).longValue(); } else { result += 0; } } startFrom++; return result; }
Source:
public boolean hasNext() { if (parentStream.closed) { return false; } if (this.bufferedNext != null) { return true; } while (this.blobIterator.hasNext()) { BlobItem nextBlob = this.blobIterator.next(); Path nextPath = getNextListResult(nextBlob); try { if (this.filter.accept(nextPath) && passesDirectoryDuplicateFilter(nextPath, nextBlob)) { this.bufferedNext = nextPath; return true; } } catch (IOException e) { throw LoggingUtility.logError(logger, new DirectoryIteratorException(e)); } } return false; }

Target:
public boolean hasNext() { if (parentStream.closed) { return false; } if (this.bufferedNext != null) { return true; } while (this.blobIterator.hasNext()) { BlobItem nextBlob = this.blobIterator.next(); Path nextPath = getNextListResult(nextBlob); try { if (this.filter.accept(nextPath) && isNotDuplicate(nextPath, nextBlob)) { this.bufferedNext = nextPath; return true; } } catch (IOException e) { throw LoggingUtility.logError(logger, new DirectoryIteratorException(e)); } } return false; }
Source:
public boolean isAPIDetailsExists(String APIId) throws APIManagementException { try (Connection connection = GatewayArtifactsMgtDBUtil.getArtifactSynchronizerConnection(); PreparedStatement statement = connection .prepareStatement(SQLConstants.GET_GATEWAY_PUBLISHED_API_DETAILS)) { statement.setString(1, APIId); ResultSet rs = statement.executeQuery(); return rs.next(); } catch (SQLException e) { handleException("Failed to check API details status of API with ID " + APIId, e); } return false; }

Target:
public boolean isAPIDetailsExists(String APIId) throws APIManagementException { ResultSet rs = null; try (Connection connection = GatewayArtifactsMgtDBUtil.getArtifactSynchronizerConnection(); PreparedStatement statement = connection .prepareStatement(SQLConstants.CHECK_API_EXISTS)) { connection.setAutoCommit(false); connection.commit(); statement.setString(1, APIId); rs = statement.executeQuery(); return rs.next(); } catch (SQLException e) { handleException("Failed to check API details status of API with ID " + APIId, e); } finally { GatewayArtifactsMgtDBUtil.closeResultSet(rs); } return false; }
Source:
public static long parseParamDate(final String diff) throws java.text.ParseException { String secs = "00"; String mins = "00"; String hours = "00"; String date = "01"; String month = "01"; String year = "0000"; final String[] units = diff.split("[.]"); for (final String unit : units) { if (unit.matches("[YMDhms][0-9]+")) { final char unitdesc = unit.charAt(0); switch (unitdesc) { case 's': secs = unit.replace("s", "00"); secs = secs.substring(secs.length()-2, secs.length()); break; case 'm': mins = unit.replace("m", "00"); mins = mins.substring(mins.length()-2, mins.length()); break; case 'h': hours = unit.replace("h", "0"); hours = hours.substring(hours.length()-2, hours.length()); break; case 'D': date = unit.replace("D", "00"); date = date.substring(date.length()-2, date.length()); break; case 'M': month = unit.replace("M", "00"); month = month.substring(month.length()-2, month.length()); break; case 'Y': year = unit.replace("Y", "0000"); year = year.substring(year.length()-4, year.length()); break; } } } final StringBuilder dateString = new StringBuilder(year); dateString.append("-"); dateString.append(month); dateString.append("-"); dateString.append(date); dateString.append("T"); dateString.append(hours); dateString.append(":"); dateString.append(mins); dateString.append(":"); dateString.append(secs); dateString.append(".000Z"); return Constants.DATE_FORMAT.parse(dateString.toString()).getTime(); }

Target:
public static long parseParamDate(final String diff) throws java.text.ParseException { String secs = "00"; String mins = "00"; String hours = "00"; String date = "01"; String month = "01"; String year = "0000"; final String[] units = diff.split("[.]"); for (final String unit : units) { if (unit.matches("[YMDhms][0-9]+")) { final char unitdesc = unit.charAt(0); switch (unitdesc) { case 's': secs = unit.replace("s", "00"); secs = secs.substring(secs.length()-2, secs.length()); break; case 'm': mins = unit.replace("m", "00"); mins = mins.substring(mins.length()-2, mins.length()); break; case 'h': hours = unit.replace("h", "0"); hours = hours.substring(hours.length()-2, hours.length()); break; case 'D': date = unit.replace("D", "00"); date = date.substring(date.length()-2, date.length()); break; case 'M': month = unit.replace("M", "00"); month = month.substring(month.length()-2, month.length()); break; case 'Y': year = unit.replace("Y", "0000"); year = year.substring(year.length()-4, year.length()); break; } } } final StringBuilder dateString = new StringBuilder(year) .append("-") .append(month) .append("-") .append(date) .append("T") .append(hours) .append(":") .append(mins) .append(":") .append(secs) .append(".000Z"); return Constants.DATE_FORMAT.parse(dateString.toString()).getTime(); }
Source:
public void close() { log.info("Calling close on snapshot transaction manager"); if (!isClosed.compareAndSet(false, true)) { log.info("Snapshot transaction manager has already been closed, performing no action"); return; } try (ShutdownRunner shutdownRunner = new ShutdownRunner()) { shutdownRunner.shutdownSafely(super::close); shutdownRunner.shutdownSafely(cleaner::close); shutdownRunner.shutdownSafely(keyValueService::close); shutdownRunner.shutdownSafely(() -> shutdownExecutor(deleteExecutor)); shutdownRunner.shutdownSafely(() -> shutdownExecutor(getRangesExecutor)); shutdownRunner.shutdownSafely(this::closeLockServiceIfPossible); for (Runnable callback : Lists.reverse(closingCallbacks)) { shutdownRunner.shutdownSafely(callback); } shutdownRunner.shutdownSafely(metricsManager::deregisterMetrics); } }

Target:
public void close() { log.info("Calling close on snapshot transaction manager"); if (!isClosed.compareAndSet(false, true)) { log.info("Snapshot transaction manager has already been closed, performing no action"); return; } try (ShutdownRunner shutdownRunner = new ShutdownRunner()) { shutdownRunner.shutdownSafely(super::close); shutdownRunner.shutdownSafely(cleaner::close); shutdownRunner.shutdownSafely(keyValueService::close); shutdownRunner.shutdownSafely(() -> shutdownExecutor(deleteExecutor)); shutdownRunner.shutdownSafely(() -> shutdownExecutor(getRangesExecutor)); shutdownRunner.shutdownSafely(this::closeLockServiceIfPossible); for (Runnable callback : Lists.reverse(closingCallbacks)) { shutdownRunner.shutdownSafely(callback); } shutdownRunner.shutdownSafely(metricsManager::deregisterMetrics); log.info("Close callbacks complete in snapshot transaction manager"); } log.info("Closed snapshot transaction manager without any errors"); }
Source:
public void move(Collection<Path> pathsToDelete, Collection<PathMetadata> pathsToCreate, ITtlTimeProvider ttlTimeProvider) throws IOException { if (pathsToDelete == null && pathsToCreate == null) { return; } LOG.debug("Moving paths of table in region {}: paths to delete and {}" + " paths to create", tableName, region, pathsToDelete == null ? 0 : pathsToDelete.size(), pathsToCreate == null ? 0 : pathsToCreate.size()); LOG.trace("move: pathsToDelete = {}, pathsToCreate = {}", pathsToDelete, pathsToCreate); Collection<DDBPathMetadata> newItems = new ArrayList<>(); if (pathsToCreate != null) { newItems.addAll(completeAncestry(pathMetaToDDBPathMeta(pathsToCreate))); } if (pathsToDelete != null) { for (Path meta : pathsToDelete) { final PathMetadata pmTombstone = PathMetadata.tombstone(meta); pmTombstone.setLastUpdated(ttlTimeProvider.getNow()); newItems.add(new DDBPathMetadata(pmTombstone)); } } processBatchWriteRequest(null, pathMetadataToItem(newItems)); }

Target:
public void move(Collection<Path> pathsToDelete, Collection<PathMetadata> pathsToCreate, ITtlTimeProvider ttlTimeProvider) throws IOException { if (pathsToDelete == null && pathsToCreate == null) { return; } LOG.debug("Moving paths of table in region {}: paths to delete and {}" + " paths to create", tableName, region, pathsToDelete == null ? 0 : pathsToDelete.size(), pathsToCreate == null ? 0 : pathsToCreate.size()); LOG.trace("move: pathsToDelete = {}, pathsToCreate = {}", pathsToDelete, pathsToCreate); Collection<DDBPathMetadata> newItems = new ArrayList<>(); if (pathsToCreate != null) { newItems.addAll(completeAncestry(pathMetaToDDBPathMeta(pathsToCreate))); } if (pathsToDelete != null) { for (Path meta : pathsToDelete) { Preconditions.checkArgument(ttlTimeProvider != null, "ttlTimeProvider" + " must not be null"); final PathMetadata pmTombstone = PathMetadata.tombstone(meta); pmTombstone.setLastUpdated(ttlTimeProvider.getNow()); newItems.add(new DDBPathMetadata(pmTombstone)); } } processBatchWriteRequest(null, pathMetadataToItem(newItems)); }
Source:
private void validate() { inOrderOrEqual(expiryDate, paymentCurrencyAmount.getDate().getUnadjusted(), "expiryDate", "underlying.paymentDate"); }

Target:
private void validate() { inOrderOrEqual(expiryDate, paymentCurrencyAmount.getDate().getUnadjusted(), "expiryDate", "underlying.paymentDate"); ArgChecker.isTrue(index.getCurrencyPair().contains(paymentCurrencyAmount.getCurrency()), "The payment currency must be one of the underlying currency pairs"); }
Source:
public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } Partition partition = (Partition) o; if (id == null ^ partition.id == null){ return false; } return id.equals(partition.id); }

Target:
public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } Partition partition = (Partition) o; return id.equals(partition.id); }
Source:
public Plan createPlan(Session session, @Language("SQL") String sql, List<PlanOptimizer> optimizers, LogicalPlanner.Stage stage) { Statement wrapped = sqlParser.createStatement(sql, createParsingOptions(session)); Statement statement = unwrapExecuteStatement(wrapped, sqlParser, session); List<Expression> parameters = emptyList(); if (wrapped instanceof Execute) { parameters = ((Execute) wrapped).getParameters(); } validateParameters(statement, parameters); assertFormattedSql(sqlParser, createParsingOptions(session), statement); PlanNodeIdAllocator idAllocator = new PlanNodeIdAllocator(); QueryExplainer queryExplainer = new QueryExplainer( optimizers, planFragmenter, metadata, nodePartitioningManager, accessControl, sqlParser, statsCalculator, costCalculator, nodeManager, new NodeSchedulerConfig().setIncludeCoordinator(true), dataDefinitionTask); Analyzer analyzer = new Analyzer(session, metadata, sqlParser, accessControl, Optional.of(queryExplainer), parameters); LogicalPlanner logicalPlanner = new LogicalPlanner(session, optimizers, new PlanSanityChecker(true), idAllocator, metadata, sqlParser); Analysis analysis = analyzer.analyze(statement); return logicalPlanner.plan(analysis, stage); }

Target:
public Plan createPlan(Session session, @Language("SQL") String sql, List<PlanOptimizer> optimizers, LogicalPlanner.Stage stage) { Statement wrapped = sqlParser.createStatement(sql, createParsingOptions(session)); Statement statement = unwrapExecuteStatement(wrapped, sqlParser, session); List<Expression> parameters = emptyList(); if (wrapped instanceof Execute) { parameters = ((Execute) wrapped).getParameters(); } validateParameters(statement, parameters); assertFormattedSql(sqlParser, createParsingOptions(session), statement); PlanNodeIdAllocator idAllocator = new PlanNodeIdAllocator(); QueryExplainer queryExplainer = new QueryExplainer( optimizers, planFragmenter, metadata, nodePartitioningManager, accessControl, sqlParser, statsCalculator, costCalculator, nodeManager, nodeSchedulerConfig, dataDefinitionTask); Analyzer analyzer = new Analyzer(session, metadata, sqlParser, accessControl, Optional.of(queryExplainer), parameters); LogicalPlanner logicalPlanner = new LogicalPlanner(session, optimizers, new PlanSanityChecker(true), idAllocator, metadata, sqlParser); Analysis analysis = analyzer.analyze(statement); return logicalPlanner.plan(analysis, stage); }
Source:
protected TaskResult callExecutor(Path projectPath, String type, TaskRequest mergedRequest) { OperatorFactory factory = registry.get(mergedRequest, type); if (factory == null) { throw new ConfigException("Unknown task type: " + type); } SecretStore secretStore = secretStoreManager.getSecretStore(mergedRequest.getSiteId()); Config grants = mergedRequest.getConfig().getNestedOrGetEmpty("_secrets"); SecretAccessList secretAccessList = factory.getSecretAccessList(); final Set<String> declaredSecretKeys = ImmutableSet.copyOf(secretAccessList.getSecretKeys()); SecretAccessContext secretContext = SecretAccessContext.builder() .siteId(mergedRequest.getSiteId()) .projectId(mergedRequest.getProjectId()) .revision(mergedRequest.getRevision().get()) .workflowName(mergedRequest.getWorkflowName()) .taskName(mergedRequest.getTaskName()) .operatorType(type) .build(); DefaultSecretProvider secretProvider = new DefaultSecretProvider( secretContext, secretAccessPolicy, grants, (key) -> declaredSecretKeys.contains(key), secretStore); PrivilegedVariables privilegedVariables = GrantedPrivilegedVariables.build( mergedRequest.getConfig().getNestedOrGetEmpty("_env"), mergedRequest.getConfig(), GrantedPrivilegedVariables.privilegedSecretProvider(secretContext, secretAccessPolicy, secretStore)); OperatorContext context = new DefaultOperatorContext( projectPath, mergedRequest, secretProvider, privilegedVariables); Operator operator = factory.newOperator(context); return operator.run(); }

Target:
protected TaskResult callExecutor(Path projectPath, String type, TaskRequest mergedRequest) { OperatorFactory factory = registry.get(mergedRequest, type); if (factory == null) { throw new ConfigException("Unknown task type: " + type); } SecretStore secretStore = secretStoreManager.getSecretStore(mergedRequest.getSiteId()); Config grants = mergedRequest.getConfig().getNestedOrGetEmpty("_secrets"); SecretAccessList secretAccessList = factory.getSecretAccessList(); final Set<String> declaredSecretKeys = ImmutableSet.copyOf(secretAccessList.getSecretKeys()); SecretAccessContext secretContext = SecretAccessContext.builder() .siteId(mergedRequest.getSiteId()) .projectId(mergedRequest.getProjectId()) .revision(mergedRequest.getRevision().get()) .workflowName(mergedRequest.getWorkflowName()) .taskName(mergedRequest.getTaskName()) .operatorType(type) .build(); DefaultSecretProvider secretProvider = new DefaultSecretProvider( secretContext, secretAccessPolicy, grants, (key) -> declaredSecretKeys.contains(key), secretStore); PrivilegedVariables privilegedVariables = GrantedPrivilegedVariables.build( mergedRequest.getLocalConfig().getNestedOrGetEmpty("_env"), mergedRequest.getConfig(), GrantedPrivilegedVariables.privilegedSecretProvider(secretContext, secretAccessPolicy, secretStore)); OperatorContext context = new DefaultOperatorContext( projectPath, mergedRequest, secretProvider, privilegedVariables); Operator operator = factory.newOperator(context); return operator.run(); }
Source:
public void onSettingsRead(final ChannelHandlerContext ctx, Http2Settings settings) throws Http2Exception { if (outstandingRemoteSettingsQueue == null) { encoder.writeSettingsAck(ctx, ctx.newPromise()); encoder.remoteSettings(settings); } else { outstandingRemoteSettingsQueue.add(settings); } listener.onSettingsRead(ctx, settings); }

Target:
public void onSettingsRead(final ChannelHandlerContext ctx, Http2Settings settings) throws Http2Exception { if (settingsReceivedConsumer == null) { encoder.writeSettingsAck(ctx, ctx.newPromise()); encoder.remoteSettings(settings); } else { settingsReceivedConsumer.consumeReceivedSettings(settings); } listener.onSettingsRead(ctx, settings); }
Source:
private Provider getCurrentProvider() { UserContext userContext = Context.getUserContext(); Provider currentProvider = null; if (userContext != null && userContext.getAuthenticatedUser() != null) { User currentUser = userContext.getAuthenticatedUser(); Collection<Provider> providers = new HashSet<Provider>(); try { Context.addProxyPrivilege(PrivilegeConstants.VIEW_PROVIDERS); if (currentUser.getPerson() != null) { providers = Context.getProviderService().getProvidersByPerson(currentUser.getPerson(), false); } } finally { Context.removeProxyPrivilege(PrivilegeConstants.VIEW_PROVIDERS); } if (providers.size() > 1) { throw new IllegalStateException("Can't handle users with multiple provider accounts"); } else if (providers.size() == 1) { currentProvider = providers.iterator().next(); } } return currentProvider; }

Target:
private Provider getCurrentProvider() { UserContext userContext = Context.getUserContext(); Provider currentProvider = null; if (userContext != null && userContext.getAuthenticatedUser() != null) { User currentUser = userContext.getAuthenticatedUser(); Collection<Provider> providers = new HashSet<Provider>(); try { Context.addProxyPrivilege(PrivilegeConstants.VIEW_PROVIDERS); if (currentUser.getPerson() != null) { providers = Context.getProviderService().getProvidersByPerson(currentUser.getPerson(), false); } } finally { Context.removeProxyPrivilege(PrivilegeConstants.VIEW_PROVIDERS); } if (providers.size() > 1) { log.warn("Can't handle users with multiple provider accounts"); } else if (providers.size() == 1) { currentProvider = providers.iterator().next(); } } return currentProvider; }
Source:
private static void writeBaseAspect(File f) throws IOException { final PrintWriter writer = new PrintWriter(f); writer.println("package mop;"); writer.println("public aspect BaseAspect {"); writer.println(" pointcut notwithin() :"); writer.println(" !within(sun..*) &&"); writer.println(" !within(java..*) &&"); writer.println(" !within(javax..*) &&"); writer.println(" !within(com.sun..*) &&"); writer.println(" !within(org.dacapo.harness..*) &&"); writer.println(" !within(org.apache.commons..*) &&"); writer.println(" !within(org.apache.geronimo..*) &&"); writer.println(" !within(net.sf.cglib..*) &&"); writer.println(" !within(mop..*) &&"); writer.println(" !within(javamoprt..*) &&"); writer.println(" !within(rvmonitorrt..*) &&"); writer.println(" !within(com.runtimeverification..*);"); writer.println("}"); writer.flush(); writer.close(); }

Target:
private static void writeBaseAspect(File f) throws IOException { final PrintWriter writer = new PrintWriter(f); try { writer.println("package mop;"); writer.println("public aspect BaseAspect {"); writer.println(" pointcut notwithin() :"); writer.println(" !within(sun..*) &&"); writer.println(" !within(java..*) &&"); writer.println(" !within(javax..*) &&"); writer.println(" !within(com.sun..*) &&"); writer.println(" !within(org.dacapo.harness..*) &&"); writer.println(" !within(org.apache.commons..*) &&"); writer.println(" !within(org.apache.geronimo..*) &&"); writer.println(" !within(net.sf.cglib..*) &&"); writer.println(" !within(mop..*) &&"); writer.println(" !within(javamoprt..*) &&"); writer.println(" !within(rvmonitorrt..*) &&"); writer.println(" !within(com.runtimeverification..*);"); writer.println("}"); writer.flush(); } finally { writer.close(); } }
Source:
private void runPatchMetadataTests(EPerson asUser, int expectedStatus) throws Exception { context.turnOffAuthorisationSystem(); Group group = GroupBuilder.createGroup(context).withName("Group").build(); String token = getAuthToken(asUser.getEmail(), password); new MetadataPatchSuite().runWith(getClient(token), "/api/eperson/groups/" + group.getID(), expectedStatus); }

Target:
private void runPatchMetadataTests(EPerson asUser, int expectedStatus) throws Exception { context.turnOffAuthorisationSystem(); Group group = GroupBuilder.createGroup(context).withName("Group").build(); context.restoreAuthSystemState(); String token = getAuthToken(asUser.getEmail(), password); new MetadataPatchSuite().runWith(getClient(token), "/api/eperson/groups/" + group.getID(), expectedStatus); }
Source:
public I_R_Request createRequest(@NonNull final RequestCandidate candidate) { final I_R_Request request = newInstance(I_R_Request.class); ; request.setSummary(candidate.getSummary()); request.setConfidentialType(candidate.getConfidentialType()); request.setAD_Org_ID(candidate.getOrgId().getRepoId()); request.setM_Product_ID(ProductId.toRepoId(candidate.getProductId())); request.setAD_Table_ID(candidate.getRecordRef() != null ? candidate.getRecordRef().getAD_Table_ID() : -1); request.setRecord_ID(candidate.getRecordRef() != null ? candidate.getRecordRef().getRecord_ID() : -1); request.setC_BPartner_ID(BPartnerId.toRepoId(candidate.getPartnerId())); request.setC_Order_ID(candidate.getOrderId() != null ? candidate.getOrderId().getRepoId() : 0); request.setAD_User_ID(UserId.toRepoId(candidate.getUserId())); request.setR_RequestType_ID(candidate.getRequestTypeId().getRepoId()); request.setM_QualityNote_ID(QualityNoteId.toRepoId(candidate.getQualityNoteId())); request.setPerformanceType(candidate.getPerformanceType()); request.setDateDelivered(TimeUtil.asTimestamp(candidate.getDateDelivered())); saveRecord(request); return request; }

Target:
public I_R_Request createRequest(@NonNull final RequestCandidate candidate) { final I_R_Request request = newInstance(I_R_Request.class); ; request.setSummary(candidate.getSummary()); request.setConfidentialType(candidate.getConfidentialType()); request.setAD_Org_ID(candidate.getOrgId().getRepoId()); request.setM_Product_ID(ProductId.toRepoId(candidate.getProductId())); request.setAD_Table_ID(candidate.getRecordRef() != null ? candidate.getRecordRef().getAD_Table_ID() : -1); request.setRecord_ID(candidate.getRecordRef() != null ? candidate.getRecordRef().getRecord_ID() : -1); request.setC_BPartner_ID(BPartnerId.toRepoId(candidate.getPartnerId())); request.setC_Order_ID(candidate.getRecordRef() != null ? candidate.getRecordRef().getTableName().equals(I_C_Order.Table_Name) ? candidate.getRecordRef().getRecord_ID() : -1 : -1); request.setAD_User_ID(UserId.toRepoId(candidate.getUserId())); request.setR_RequestType_ID(candidate.getRequestTypeId().getRepoId()); request.setM_QualityNote_ID(QualityNoteId.toRepoId(candidate.getQualityNoteId())); request.setPerformanceType(candidate.getPerformanceType()); request.setDateDelivered(TimeUtil.asTimestamp(candidate.getDateDelivered())); saveRecord(request); return request; }
Source:
public LookupDto toDto() { List<LookupFieldDto> lookupFields = new ArrayList<>(); for (String lookupFieldName : getFieldsOrder()) { Field field = getLookupFieldByName(LookupName.getFieldName(lookupFieldName)); LookupFieldType lookupFieldType = LookupFieldType.VALUE; if (isRangeParam(lookupFieldName)) { lookupFieldType = LookupFieldType.RANGE; } else if (isSetParam(lookupFieldName)) { lookupFieldType = LookupFieldType.SET; } String customOperator = getCustomOperators().get(lookupFieldName); boolean useGenericParam = toBoolean(getUseGenericParams().get(lookupFieldName)); if (field != null) { LookupFieldDto lookupField = new LookupFieldDto(field.getId(), field.getName(), lookupFieldType, customOperator, useGenericParam, LookupName.getRelatedFieldName(lookupFieldName)); lookupFields.add(lookupField); } else { LOGGER.info("Can't create LookupFieldDto from field with name {}", lookupFieldName); } } return new LookupDto(id, lookupName, singleObjectReturn, exposedViaRest, lookupFields, readOnly, methodName, fieldsOrder, indexRequired); }

Target:
public LookupDto toDto() { List<LookupFieldDto> lookupFields = new ArrayList<>(); for (String lookupFieldName : getFieldsOrder()) { Field field = getLookupFieldByName(LookupName.getFieldName(lookupFieldName)); LookupFieldType lookupFieldType = LookupFieldType.VALUE; if (isRangeParam(lookupFieldName)) { lookupFieldType = LookupFieldType.RANGE; } else if (isSetParam(lookupFieldName)) { lookupFieldType = LookupFieldType.SET; } String customOperator = getCustomOperators().get(lookupFieldName); boolean useGenericParam = toBoolean(getUseGenericParams().get(lookupFieldName)); if (field != null) { LookupFieldDto lookupField = new LookupFieldDto(field.getId(), field.getName(), lookupFieldType, customOperator, useGenericParam, LookupName.getRelatedFieldName(lookupFieldName)); lookupFields.add(lookupField); } else { throw new LookupWrongFieldNameException(String.format("Can't create LookupFieldDto. Field with given name %s does not exist in %s lookup", lookupFieldName, lookupName)); } } return new LookupDto(id, lookupName, singleObjectReturn, exposedViaRest, lookupFields, readOnly, methodName, fieldsOrder, indexRequired); }
Source:
public List<Type> getTypeParameters() { List<Type> parameters = new ArrayList<>(argumentTypes.size() + 1); argumentTypes.stream() .forEach(parameters::add); parameters.add(returnType); return unmodifiableList(parameters); }

Target:
public List<Type> getTypeParameters() { List<Type> parameters = new ArrayList<>(argumentTypes.size() + 1); parameters.addAll(argumentTypes); parameters.add(returnType); return unmodifiableList(parameters); }