auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void run() { final long oldTimeStamp; if (lastMeasuredTimestamp == 0L) { oldTimeStamp = System.currentTimeMillis(); lastMeasuredTimestamp = oldTimeStamp; } else { oldTimeStamp = lastMeasuredTimestamp; lastMeasuredTimestamp = System.currentTimeMillis(); } final boolean clusterOverloaded = isClusterOverloaded(); final boolean clusterIdle = isClusterIdle(); if (clusterOverloaded) { overloadedTimeElapsed += lastMeasuredTimestamp - oldTimeStamp; } else { overloadedTimeElapsed = 0; } if (clusterIdle) { idleTimeElapsed += lastMeasuredTimestamp - oldTimeStamp; } else { idleTimeElapsed = 0; } if (overloadedTimeElapsed > scaleOutGracePeriod && taskStatsMap.getTaskList().size() < maxTaskNum) { overloadedTimeElapsed = 0; } else if (idleTimeElapsed > scaleInGracePeriod && taskStatsMap.getTaskList().size() > minTaskNum) { idleTimeElapsed = 0; } }

Target:
public void run() { final long oldTimeStamp = lastMeasuredTimestamp; lastMeasuredTimestamp = System.currentTimeMillis(); final boolean clusterOverloaded = isClusterOverloaded(); final boolean clusterIdle = isClusterIdle(); if (clusterOverloaded) { overloadedTimeElapsed += lastMeasuredTimestamp - oldTimeStamp; if (overloadedTimeElapsed > scaleOutGracePeriod && taskStatsMap.getTaskList().size() < maxTaskNum) { overloadedTimeElapsed = 0; return; } } else { overloadedTimeElapsed = 0; } if (clusterIdle) { idleTimeElapsed += lastMeasuredTimestamp - oldTimeStamp; if (idleTimeElapsed > scaleInGracePeriod && taskStatsMap.getTaskList().size() > minTaskNum) { idleTimeElapsed = 0; return; } } else { idleTimeElapsed = 0; } }
Source:
public HtmlLanguageBuilder addSubstitution(SpanType spanType, String alternativeTagName) { spanTypeStringSubstitutions.put(checkNotNull(spanType, "Must provide a spanType for substitution"), checkNotNull(alternativeTagName, "Must provide an alternativeTagName")); return this; }

Target:
public HtmlLanguageBuilder addSubstitution(SpanType spanType, String alternativeTagName) { checkNotNull(spanType, "Must provide a spanType"); checkNotNull(alternativeTagName, "Must provide an alternativeTagName"); spanTypeStringSubstitutions.put(spanType, alternativeTagName); return this; }
Source:
public SelectGraphWizard(IDataSet data, GraphData gdata) { model = new GraphModel(data); if (edit = (gdata != null) ) { model.setGraph(gdata.graphID); model.setKey(gdata.key); model.setTitle(gdata.title); model.setXSeries(gdata.xSeries); model.setYSeries(gdata.ySeries); } }

Target:
public SelectGraphWizard(IDataSet data, GraphData gdata) { model = new GraphModel(data); edit = (gdata != null); if (edit) { model.setGraph(gdata.graphID); model.setKey(gdata.key); model.setTitle(gdata.title); model.setXSeries(gdata.xSeries); model.setYSeries(gdata.ySeries); } }
Source:
public static KeyStroke getKeystrokeOfBestActiveBindingFor(String commandId) { KeyStroke stroke = null; IBindingService bindingService = (IBindingService) PlatformUI .getWorkbench().getAdapter(IBindingService.class); TriggerSequence ts = bindingService .getBestActiveBindingFor("org.eclipse.ui.edit.text.contentAssist.proposals"); if (ts == null) return null; Trigger[] triggers = ts.getTriggers(); for (Trigger t : triggers) { if (t instanceof KeyStroke) stroke = (KeyStroke) t; } return stroke; }

Target:
public static KeyStroke getKeystrokeOfBestActiveBindingFor(String commandId) { IBindingService bindingService = (IBindingService) PlatformUI .getWorkbench().getAdapter(IBindingService.class); TriggerSequence ts = bindingService.getBestActiveBindingFor(commandId); if (ts == null) return null; Trigger[] triggers = ts.getTriggers(); if (triggers.length == 1 && triggers[0] instanceof KeyStroke) return (KeyStroke) triggers[0]; else return null; }
Source:
boolean isSourceAvailable(Source source) { if (source == null) { LOGGER.debug("source is null, therefore not available"); return false; } final Optional<Status> sourceStatusOptional = sourceStatusCache.getCachedValueForSource(source); if (sourceStatusOptional.isPresent()) { return sourceStatusOptional.get() == Status.AVAILABLE; } else { LOGGER.debug("Unknown source status for source id={}", source.getId()); return false; } }

Target:
boolean isSourceAvailable(Source source) { if (source == null) { LOGGER.debug("source is null, therefore not available"); return false; } if (LOGGER.isTraceEnabled()) { LOGGER.trace("Checking if source \"{}\" is available...", source.getId()); } return sourceStatusCache .getCachedValueForSource(source) .map( sourceStatus -> { final boolean available = sourceStatus == SourceStatus.AVAILABLE; if (!available) { LOGGER.debug("source \"{}\" is not available", source.getId()); } return available; }) .orElseGet( () -> { LOGGER.debug("Unknown availability for source id={}", source.getId()); return false; }); }
Source:
public boolean basebackend(String backend) { return getBoolean("basebackend?", backend); }

Target:
public boolean basebackend(String backend) { return isBasebackend(backend); }
Source:
public PairDevice(@NonNull String name, @NonNull String guid, boolean connected) { if (name.isEmpty() || guid.isEmpty()) { throw new IllegalArgumentException("Empty name/guid is not allowed"); } mName = name; mGuid = guid; mConnected = connected; }

Target:
public PairDevice(@NonNull String name, @NonNull String guid, boolean connected) { Preconditions.checkStringNotEmpty(name); Preconditions.checkStringNotEmpty(guid); mName = name; mGuid = guid; mConnected = connected; }
Source:
public RDF4JQuad asQuad(final Statement statement) { return new QuadImpl(statement, salt); }

Target:
public RDF4JQuad asQuad(final Statement statement) { return rdf4j.createQuadImpl(statement, salt); }
Source:
public void processAst(IASTTranslationUnit ast) { String regex = getRegex(); if (regex == null || regex.isEmpty()) regex = DEF_REGEX; try { fPattern = Pattern.compile(regex, Pattern.MULTILINE | Pattern.DOTALL); } catch (PatternSyntaxException e) { CodanCheckersActivator.log(e); return; } IASTComment[] comments = ast.getComments(); if (comments == null) { setProblem(); return; } Result found = Result.NOT_FOUND; for (IASTComment comment : comments) { found = processComment(comment); if (found == Result.FOUND || found == Result.FOUND_MATCH) break; } if (found != Result.FOUND_MATCH) setProblem(); }

Target:
public void processAst(IASTTranslationUnit ast) { multiLine = false; lastOffset = 0; builder.setLength(0); String regex = getRegex(); if (regex == null || regex.isEmpty()) regex = DEF_REGEX; try { fPattern = Pattern.compile(regex, Pattern.MULTILINE | Pattern.DOTALL); } catch (PatternSyntaxException e) { CodanCheckersActivator.log(e); return; } IASTComment[] comments = ast.getComments(); if (comments == null) { setProblem(); return; } Result found = Result.NOT_FOUND; for (IASTComment comment : comments) { found = processComment(comment); if (found == Result.FOUND || found == Result.FOUND_MATCH) break; } if (found == Result.NOT_FOUND && multiLine) { String c = builder.toString(); if (!fPattern.matcher(c).matches()) { setProblem(); } } else if (found != Result.FOUND_MATCH) setProblem(); }
Source:
public void toStream(JsonStream writer) throws java.io.IOException { writer.beginObject(); writer.name("id").value(packageName); writer.name("name").value(appName); writer.name("packageName").value(packageName); writer.name("versionName").value(versionName); writer.name("versionCode").value(versionCode); writer.name("version").value(getAppVersion()); writer.name("releaseStage").value(getReleaseStage()); writer.endObject(); }

Target:
public void toStream(JsonStream writer) throws IOException { writer.beginObject(); writer.name("id").value(packageName); writer.name("name").value(appName); writer.name("packageName").value(packageName); writer.name("versionName").value(versionName); writer.name("versionCode").value(versionCode); writer.name("version").value(getAppVersion()); writer.name("releaseStage").value(getReleaseStage()); writer.endObject(); }
Source:
public ImageTemplate buildImageTemplateFromNode(String name, String id) { Server server = api.serverApi().getServer(id); if (server == null) throw new NoSuchElementException("Cannot find server with id: " + id); List<Storage> storages = server.storages(); if (storages.isEmpty() || !Iterables.tryFind(storages, matchBootDevice).isPresent()) throw new NoSuchElementException("Server " + id + " does not contain a boot device"); return new ImageTemplateBuilder.CloneImageTemplateBuilder().nodeId(id).name(name).build(); }

Target:
public ImageTemplate buildImageTemplateFromNode(String name, String id) { Server server = api.serverApi().getServer(id); if (server == null) throw new NoSuchElementException("Cannot find server with id: " + id); List<Storage> storages = server.storages(); if (!Iterables.any(storages, matchBootDevice)) throw new NoSuchElementException("Server " + id + " does not contain a boot device"); return new ImageTemplateBuilder.CloneImageTemplateBuilder().nodeId(id).name(name).build(); }
Source:
private static String checkVoltDBKitExistence(String newKitPath) { Path newKit = Paths.get(newKitPath); if (Files.exists(newKit) && Files.isDirectory(newKit)) { try { String version = new String(Files.readAllBytes(Paths.get(newKitPath, "version.txt"))); System.out.println("Check VoltDB Kit: version is " + version); String[] versionNumber = version.split("\\."); if (versionNumber.length < 2) { return "Illegal version string format found in " + newKitPath; } int majorVersion = Integer.parseInt(versionNumber[0].trim()); int minorVersion = Integer.parseInt(versionNumber[1].trim()); if ( majorVersion < MINIMUM_MAJOR_VERSION || (majorVersion == MINIMUM_MAJOR_VERSION && minorVersion < MINIMUM_MINOR_VERSION)) { return "Version of new VoltDB kit is lower than the minimum supported version (v" + MINIMUM_MAJOR_VERSION + "." + MINIMUM_MINOR_VERSION + ")"; } else { return "Success"; } } catch (IOException | NumberFormatException e) { return "Failed to parse version string in the new VoltDB kit"; } } else { return newKitPath + " doesn't exist."; } }

Target:
private static String checkVoltDBKitExistence(String newKitPath) { Path newKit = Paths.get(newKitPath); if (!Files.exists(newKit)) { return newKitPath + " doesn't exist."; } else if (Files.isDirectory(newKit)) { return newKitPath + " is not a directory."; } try { String version = new String(Files.readAllBytes(Paths.get(newKitPath, "version.txt"))); System.out.println("Check VoltDB Kit: version is " + version); String[] versionNumber = version.split("\\."); if (versionNumber.length < 2) { return "Illegal version string format found in " + newKitPath + ": " + version; } int majorVersion = Integer.parseInt(versionNumber[0].trim()); int minorVersion = Integer.parseInt(versionNumber[1].trim()); if ( majorVersion < MINIMUM_MAJOR_VERSION || (majorVersion == MINIMUM_MAJOR_VERSION && minorVersion < MINIMUM_MINOR_VERSION)) { return "Version of new VoltDB kit is lower than the minimum supported version (v" + MINIMUM_MAJOR_VERSION + "." + MINIMUM_MINOR_VERSION + ")"; } else { return SUCCESS; } } catch (IOException | NumberFormatException e) { return "Failed to parse version string in the new VoltDB kit"; } }
Source:
Set<String> getUpInstances() { Set<String> upInstances = new HashSet<>(); for (MockHelixAdmin helixAdmin : helixAdmins.values()) { upInstances.addAll(helixAdmin.getUpInstances()); } dataCenterToZkAddress.values() .stream() .filter(info -> info.getReplicaType() == ReplicaType.CLOUD_BACKED) .forEach(info -> upInstances.add(ClusterMapUtils.getInstanceName(info.getDcName(), -1))); return upInstances; }

Target:
Set<String> getUpInstances() { Set<String> upInstances = new HashSet<>(); for (MockHelixAdmin helixAdmin : helixAdmins.values()) { upInstances.addAll(helixAdmin.getUpInstances()); } dataCenterToZkAddress.values() .stream() .filter(info -> info.getReplicaType() == ReplicaType.CLOUD_BACKED) .forEach(info -> upInstances.add(ClusterMapUtils.getInstanceName(info.getDcName(), UNKNOWN_PORT))); return upInstances; }
Source:
public void shouldUpdatePatientList_allOk() { List<Patient> patientList = new ArrayList<>(); Patient patient = createPatient(1l); patientList.add(patient); String mQuery = "someQuery"; when(StringUtils.notNull(anyString())).thenReturn(true); when(FilterUtil.getPatientsFilteredByQuery(patientList, mQuery)).thenReturn(patientList); when(patientDAO.getAllPatients()).thenReturn(patientList); presenter.setQuery(mQuery); presenter.updatePatientsList(); int NO_STRING_ID = R.string.last_vitals_none_label; verify(view).updateListVisibility(true, NO_STRING_ID, null); verify(view).updateAdapter(patientList); }

Target:
public void shouldUpdatePatientList_allOk() { Patient patient = createPatient(1l, mQuery); patientList.add(patient); when(StringUtils.notNull(anyString())).thenReturn(true); when(patientDAO.getAllPatients()).thenReturn(Observable.just(patientList)); presenter.setQuery(mQuery); presenter.updatePatientsList(); verify(view).updateListVisibility(true, NO_STRING_ID, null); verify(view).updateAdapter(patientList); }
Source:
protected ListenableFuture<HttpResponse> invokeAsync(final HttpURLConnection nativeRequest) { throw new UnsupportedOperationException("unsupported operation"); }

Target:
protected ListenableFuture<HttpResponse> invokeAsync(final HttpURLConnection nativeRequest) { throw new UnsupportedOperationException("Async calls are not supported. " + "Please use ApacheHC or OkHttp driver"); }
Source:
public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise) throws Exception { if (requestInProgress) { if (msg instanceof HttpResponse) { HttpResponse response = (HttpResponse) msg; logHeaders("Response", response, publicAccessLogger.getResponseHeaders()); logMessage.append(", "); logMessage.append("status=").append(response.getStatus().code()); logMessage.append(", "); if (!HttpHeaders.isTransferEncodingChunked(response)) { requestInProgress = false; logDurations(); publicAccessLogger.logInfo(logMessage); } else { this.responseFirstChunkStartTimeInMs = System.currentTimeMillis(); } } else if (msg instanceof HttpContent) { HttpContent httpContent = (HttpContent) msg; if (httpContent instanceof LastHttpContent) { requestInProgress = false; logDurations(); publicAccessLogger.logInfo(logMessage); } } else { logger.error("Sending response (writeRequested) that is not of type HttpResponse or HttpChunk. " + "Sending response to " + ctx.channel().remoteAddress() + ". " + "Request is of type " + msg.getClass() + ". " + "No action being taken other than logging this unexpected state."); } } else { logger.error("Sending response (writeRequested) without any request in progress. " + "Sending response to " + ctx.channel().remoteAddress() + ". " + "No action being taken other than logging this unexpected state."); } super.write(ctx, msg, promise); }

Target:
public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise) throws Exception { if (request != null) { boolean recognized = false; if (msg instanceof HttpResponse) { recognized = true; HttpResponse response = (HttpResponse) msg; logHeaders("Response", response, publicAccessLogger.getResponseHeaders()); logMessage.append(", "); logMessage.append("status=").append(response.getStatus().code()); logMessage.append(", "); if (HttpHeaders.isTransferEncodingChunked(response)) { responseFirstChunkStartTimeInMs = System.currentTimeMillis(); } } if (msg instanceof LastHttpContent) { recognized = true; logDurations(); publicAccessLogger.logInfo(logMessage.toString()); reset(); } if (!recognized && !(msg instanceof HttpContent)) { logger.error("Sending response (writeRequested) that is not of type HttpResponse or HttpContent. " + "Sending response to " + ctx.channel().remoteAddress() + ". " + "Request is of type " + msg.getClass() + ". " + "No action being taken other than logging this unexpected state."); } } else { logger.error("Sending response (writeRequested) without any request in progress. " + "Sending response to " + ctx.channel().remoteAddress() + ". " + "No action being taken other than logging this unexpected state."); } super.write(ctx, msg, promise); }
Source:
protected void addToContextMenu(String mergeActionId, Action action, IMenuManager manager) { IContributionItem group = null;; if (mergeActionId!=null) switch (mergeActionId) { case SynchronizationActionProvider.MERGE_ACTION_ID: group = manager.find(MERGE_ACTION_GROUP); break; case SynchronizationActionProvider.OVERWRITE_ACTION_ID: group = manager.find(MERGE_ACTION_GROUP); break; case SynchronizationActionProvider.MARK_AS_MERGE_ACTION_ID: group = manager.find(OTHER_ACTION_GROUP); break; default: break; } if (group != null) { manager.appendToGroup(group.getId(), action); } else { manager.add(action); } }

Target:
protected void addToContextMenu(String mergeActionId, Action action, IMenuManager manager) { IContributionItem group = null; if (mergeActionId != null) { switch (mergeActionId) { case SynchronizationActionProvider.MERGE_ACTION_ID: group = manager.find(MERGE_ACTION_GROUP); break; case SynchronizationActionProvider.OVERWRITE_ACTION_ID: group = manager.find(MERGE_ACTION_GROUP); break; case SynchronizationActionProvider.MARK_AS_MERGE_ACTION_ID: group = manager.find(OTHER_ACTION_GROUP); break; default: break; } if (group != null) { manager.appendToGroup(group.getId(), action); } else { manager.add(action); } } }
Source:
public static Map<String, TestClass> findTestResultsInDirectory(Run<?,?> build, TaskListener listener, @CheckForNull FilePath workspace){ if(workspace==null){ return Collections.emptyMap(); } String[] tests = null; Map<String, TestClass> data = new TreeMap<String, TestClass>(); final String baseDir = workspace.getRemote(); String separator = null; final List<String> testFilesExpression = new ArrayList<String>(); testFilesExpression.add("**/src/test/java Test*.java"); testFilesExpression.add("**/src/test/java *Test.java"); testFilesExpression.add("**/src/test/java *Tests.java"); testFilesExpression.add("**/src/test/java *TestCase.java"); try { separator = workspace.act(new MasterToSlaveCallable<String, Throwable>() { @Override public String call() throws Throwable { return File.separator; } }); tests = workspace.act(new MasterToSlaveCallable<String[], Throwable>() { @Override public String[] call() throws Throwable { return Util.createFileSet(new File(baseDir), StringUtils.join(testFilesExpression,",")).getDirectoryScanner().getIncludedFiles(); } }); } catch (Throwable throwable) { throwable.printStackTrace(listener.getLogger()); return data; } if(separator.equals("\\")){ separator = separator + separator; } for(String test : tests){ String path = StringUtils.join(new String[]{"src", "test", "java"}, separator); test = test.split(path + separator)[1]; test = test.substring(0,test.length()-5); data.put(test, new TestClass(test)); } return data; }

Target:
public static Map<String, TestClass> findTestResultsInDirectory(Run<?,?> build, TaskListener listener, @CheckForNull FilePath workspace){ if(workspace==null){ return Collections.emptyMap(); } String[] tests = null; Map<String, TestClass> data = new TreeMap<String, TestClass>(); final String baseDir = workspace.getRemote(); String separator = null; final List<String> testFilesExpression = new ArrayList<String>(); testFilesExpression.add("**/src/test/java Test*.java"); testFilesExpression.add("**/src/test/java *Test.java"); testFilesExpression.add("**/src/test/java *Tests.java"); testFilesExpression.add("**/src/test/java *TestCase.java"); try { separator = workspace.act(new MasterToSlaveCallable<String, Throwable>() { @Override public String call() throws Throwable { return File.separator; } }); tests = workspace.act(new MasterToSlaveCallable<String[], Throwable>() { @Override public String[] call() throws Throwable { return Util.createFileSet(new File(baseDir), StringUtils.join(testFilesExpression,",")).getDirectoryScanner().getIncludedFiles(); } }); } catch (Throwable throwable) { throwable.printStackTrace(listener.getLogger()); return data; } if(separator.equals("\\")){ separator = separator + separator; } for(String test : tests){ String path = StringUtils.join(new String[]{"src", "test", "java"}, separator); test = test.split(path + separator)[1]; test = FilenameUtils.removeExtension(test); data.put(test, new TestClass(test)); } return data; }
Source:
public ExperimentModel getExperimentByProjectIdAndLocation(final Integer projectId, final Integer locationId) throws MiddlewareQueryException { try { final Criteria criteria = this.getSession().createCriteria(this.getPersistentClass()); criteria.add(Restrictions.eq("project.projectId", projectId)); criteria.add(Restrictions.eq("geoLocation.locationId", locationId)); @SuppressWarnings("rawtypes") final List list = criteria.list(); if (list != null && !list.isEmpty()) { return (ExperimentModel) list.get(0); } } catch (final HibernateException e) { this.logAndThrowException("Error at getExperimentByProjectIdAndLocation=" + projectId + "," + locationId + " query at ExperimentDao: " + e.getMessage(), e); } return null; }

Target:
public ExperimentModel getExperimentByProjectIdAndLocation(final Integer projectId, final Integer locationId) throws MiddlewareQueryException { try { final Criteria criteria = this.getSession().createCriteria(this.getPersistentClass()); criteria.add(Restrictions.eq("project.projectId", projectId)); criteria.add(Restrictions.eq("geoLocation.locationId", locationId)); final List<ExperimentModel> list = criteria.list(); if (list != null && !list.isEmpty()) { return (ExperimentModel) list.get(0); } } catch (final HibernateException e) { this.logAndThrowException("Error at getExperimentByProjectIdAndLocation=" + projectId + "," + locationId + " query at ExperimentDao: " + e.getMessage(), e); } return null; }
Source:
private void parseReportsXML() { try { constructRequestBuilder("/" + BaseContextPathData.getInstance().getRelativePath() + "services/reports-xml").sendRequest(null, new RequestCallback() { @Override public void onError(Request request, Throwable exception) { if (!reportBaseUrl.trim().isEmpty()) { scheduleCheckStatus(); } setXmlInitialized(); } @Override public void onResponseReceived(Request request, Response response) { try { switch (response.getStatusCode()) { case Response.SC_NOT_FOUND: if (!reportBaseUrl.trim().isEmpty()) { scheduleCheckStatus(); } break; case Response.SC_OK: if (ReportParser.getInstance().parseReport(response.getText())) { resourceMap = ReportParser.getInstance().getResourceMap(); dashboardMap = ReportParser.getInstance().getDashboardMap(); isCommunityEdition = ReportParser.getInstance().isCommunityEdition(); } break; } } catch (DOMParseException e) { } finally { setXmlInitialized(); } } }); } catch (RequestException e) { setXmlInitialized(); } }

Target:
private void parseReportsXML() { try { constructServiceRequestBuilder(ReportXmlService).sendRequest(null, new RequestCallback() { @Override public void onError(Request request, Throwable exception) { if (!reportBaseUrl.trim().isEmpty() && !scheduledStatusCheckInProgress && !reportsWebappDeployed) { scheduleCheckStatus(); } setXmlInitialized(); } @Override public void onResponseReceived(Request request, Response response) { switch (response.getStatusCode()) { case Response.SC_NOT_FOUND: if (!reportBaseUrl.trim().isEmpty() && !scheduledStatusCheckInProgress && !reportsWebappDeployed) { scheduleCheckStatus(); } setXmlInitialized(); break; case Response.SC_OK: try { if (ReportParser.getInstance().parseReport(response.getText())) { resourceMap = ReportParser.getInstance().getResourceMap(); dashboardMap = ReportParser.getInstance().getDashboardMap(); isCommunityEdition = ReportParser.getInstance().isCommunityEdition(); } } catch (DOMParseException e) { } finally { setXmlInitialized(); } break; } } }); } catch (RequestException e) { setXmlInitialized(); } }
Source:
private void createProject(final DeploymentMode mode) { view.showBusyIndicator(view.getSavingMessage()); final String name = view.getName(); final String description = view.getDescription(); final String groupId = view.getGroupId(); final String artifactId = view.getArtifactId(); final String version = view.getVersion(); validateFields(name, groupId, artifactId, version, () -> { final ParameterizedCommand<WorkspaceProject> successCallback = getSuccessCallback(); final ErrorCallback<?> errorCallback = getErrorCallback(); final POM pom = setDefaultPOM(groupId, artifactId, version, name, description); libraryService.call(successCallback, errorCallback).createProject(projectContext.getActiveOrganizationalUnit() .orElseThrow(() -> new IllegalStateException("Cannot create new project without an active organizational unit.")), pom, mode); }); }

Target:
private void createProject(final DeploymentMode mode) { view.showBusyIndicator(view.getSavingMessage()); final String name = view.getName(); final String description = view.getDescription(); final String groupId = view.getGroupId(); final String artifactId = view.getArtifactId(); final String version = view.getVersion(); validateFields(name, groupId, artifactId, version, () -> { final ParameterizedCommand<WorkspaceProject> successCallback = getSuccessCallback(); final ErrorCallback<?> errorCallback = getErrorCallback(); final POM pom = setDefaultPOM(groupId, artifactId, version, name, description); libraryService.call((WorkspaceProject project) -> successCallback.execute(project), errorCallback).createProject(projectContext.getActiveOrganizationalUnit() .orElseThrow(() -> new IllegalStateException("Cannot create new project without an active organizational unit.")), pom, mode); }); }
Source:
public void close() throws ProcessorStateException { RuntimeException firstException = null; if (!stores.isEmpty()) { log.debug("Closing its state manager and all the registered state stores: {}", stores); for (final Map.Entry<String, StateStoreMetadata> entry : stores.entrySet()) { final StateStore store = entry.getValue().stateStore; log.trace("Closing store {}", store.name()); try { store.close(); } catch (final RuntimeException exception) { if (firstException == null) { if (exception instanceof StreamsException) firstException = exception; else firstException = new ProcessorStateException( format("%sFailed to close state store %s", logPrefix, store.name()), exception); } log.error("Failed to close state store {}: ", store.name(), exception); } } stores.clear(); } if (firstException != null) { throw firstException; } }

Target:
public void close() throws ProcessorStateException { RuntimeException firstException = null; if (!stores.isEmpty()) { log.debug("Closing its state manager and all the registered state stores: {}", stores); for (final Map.Entry<String, StateStoreMetadata> entry : stores.entrySet()) { final StateStore store = entry.getValue().stateStore; log.trace("Closing store {}", store.name()); try { store.close(); } catch (final RuntimeException exception) { if (firstException == null) { if (exception instanceof StreamsException) firstException = exception; else firstException = new ProcessorStateException( format("%sFailed to close state store %s", logPrefix, store.name()), exception); } log.error("Failed to close state store {}: ", store.name(), exception); } } } if (firstException != null) { throw firstException; } }
Source:
protected Object getGranularitiesToTest() { return new Object[] { Granularity.FULL, Granularity.MIN_5, Granularity.MIN_20, Granularity.MIN_60, Granularity.MIN_240, Granularity.MIN_1440 }; }

Target:
protected Object getGranularitiesToTest() { return Granularity.granularities(); }
Source:
public ADBInfo(HashMap<String,String> env) { this.env = env; try { String dockerHost = env.get("DOCKER_HOST"); URI url = new URI(dockerHost); String h = url.getHost(); openshiftHost = "https://" + h; } catch(URISyntaxException murle) { murle.printStackTrace(); } }

Target:
public ADBInfo(HashMap<String,String> env) throws URISyntaxException { this.env = env; String dockerHost = env.get("DOCKER_HOST"); URI url = new URI(dockerHost); String h = url.getHost(); openshiftHost = "https://" + h; }
Source:
public PatientData<T> load(Patient patient) { try { XWikiDocument doc = (XWikiDocument) this.documentAccessBridge.getDocument(patient.getDocument()); BaseObject data = doc.getXObject(Patient.CLASS_REFERENCE); if (data == null) { throw new NullPointerException(ERROR_MESSAGE_NO_PATIENT_CLASS); } Map<String, T> result = new LinkedHashMap<String, T>(); for (String propertyName : getProperties()) { BaseProperty<EntityReference> field = (BaseProperty<EntityReference>) data.getField(propertyName); if (field != null) { Object propertyValue = field.getValue(); if (getCodeFields().contains(propertyName) && isCodeFieldsOnly()) { List<VocabularyProperty> propertyValuesList = new LinkedList<>(); List<String> terms = (List<String>) propertyValue; for (String termId : terms) { propertyValuesList.add(new QuickOntologyProperty(termId)); } propertyValue = propertyValuesList; } result.put(propertyName, (T) propertyValue); } } return new DictionaryPatientData<>(getName(), result); } catch (Exception e) { this.logger.error( "Could not find requested document or some unforeseen error has occurred during controller loading"); } return null; }

Target:
public PatientData<T> load(Patient patient) { try { XWikiDocument doc = (XWikiDocument) this.documentAccessBridge.getDocument(patient.getDocument()); BaseObject data = doc.getXObject(Patient.CLASS_REFERENCE); if (data == null) { throw new NullPointerException(ERROR_MESSAGE_NO_PATIENT_CLASS); } Map<String, T> result = new LinkedHashMap<String, T>(); for (String propertyName : getProperties()) { BaseProperty<ObjectPropertyReference> field = (BaseProperty<ObjectPropertyReference>) data.getField(propertyName); if (field != null) { Object propertyValue = field.getValue(); if (getCodeFields().contains(propertyName) && isCodeFieldsOnly()) { List<VocabularyProperty> propertyValuesList = new LinkedList<>(); List<String> terms = (List<String>) propertyValue; for (String termId : terms) { propertyValuesList.add(new QuickOntologyProperty(termId)); } propertyValue = propertyValuesList; } result.put(propertyName, (T) propertyValue); } } return new DictionaryPatientData<>(getName(), result); } catch (Exception e) { this.logger.error( "Could not find requested document or some unforeseen error has occurred during controller loading"); } return null; }
Source:
public void testMetaCharsetUpdateUtf8() { final Document doc = createHtmlDocument("changeThis"); doc.updateMetaCharset(true); doc.charset(Charset.forName(charsetUtf8)); final String htmlCharsetUTF8 = "<html>\n" + " <head>\n" + " <meta charset=\"" + charsetUtf8 + "\">\n" + " </head>\n" + " <body></body>\n" + "</html>"; assertEquals(htmlCharsetUTF8, doc.toString()); Element selectedElement = doc.select("meta[charset]").first(); assertEquals(charsetUtf8, doc.charset().displayName()); assertEquals(charsetUtf8, selectedElement.attr("charset")); assertEquals(doc.charset(), doc.outputSettings().charset()); }

Target:
public void testMetaCharsetUpdateUtf8() { final Document doc = createHtmlDocument("changeThis"); doc.updateMetaCharsetElement(true); doc.charset(Charset.forName(charsetUtf8)); final String htmlCharsetUTF8 = "<html>\n" + " <head>\n" + " <meta charset=\"" + charsetUtf8 + "\">\n" + " </head>\n" + " <body></body>\n" + "</html>"; assertEquals(htmlCharsetUTF8, doc.toString()); Element selectedElement = doc.select("meta[charset]").first(); assertEquals(charsetUtf8, doc.charset().name()); assertEquals(charsetUtf8, selectedElement.attr("charset")); assertEquals(doc.charset(), doc.outputSettings().charset()); }
Source:
public NetworkExternalSubnetListModel() { setTitle(ConstantsManager.getInstance().getConstants().externalSubnetsTitle()); setHashName("external_subnets"); }

Target:
public NetworkExternalSubnetListModel() { setHashName("external_subnets"); setComparator(new NameableComparator()); }
Source:
public void nodeFinished(JupiterEngineExecutionContext context, TestDescriptor descriptor, TestExecutionResult result) { invokeTestWatchers(context, t -> { ExtensionContext extensionContext = context.getExtensionContext(); Status status = result.getStatus(); String identifier = createTestIdentifier(); switch (status) { case SUCCESSFUL: t.testSuccessful(identifier, extensionContext); break; case FAILED: t.testFailed(identifier, result.getThrowable().get(), extensionContext); break; case ABORTED: t.testAborted(identifier, result.getThrowable().get(), extensionContext); break; } }); }

Target:
public void nodeFinished(JupiterEngineExecutionContext context, TestDescriptor descriptor, TestExecutionResult result) { if (context != null) { invokeTestWatchers(context, watcher -> { ExtensionContext extensionContext = context.getExtensionContext(); TestExecutionResult.Status status = result.getStatus(); switch (status) { case SUCCESSFUL: watcher.testSuccessful(extensionContext); break; case FAILED: watcher.testFailed(extensionContext, result.getThrowable().get()); break; case ABORTED: watcher.testAborted(extensionContext, result.getThrowable().get()); break; } }, true); } }
Source:
protected DriverConfiguration create(String elementId, IConfigurationElement element) { if (element.getName().equals("driver")) { DriverConfiguration driverConfiguration = new DriverConfiguration(elementId, element); if (!driverConfiguration.isFileBased()) return driverConfiguration; } return null; }

Target:
protected DriverConfiguration create(String elementId, IConfigurationElement element) { if (element.getName().equals("driver")) { return new DriverConfiguration(elementId, element); } return null; }
Source:
public static Collection<CommunicationSummaryStatistics> buildCommunicationSummaryTree( Collection<CommunicationSummaryStatistics> nodes, Set<String> endpoints) { Map<String, CommunicationSummaryStatistics> nodeMap = new HashMap<String, CommunicationSummaryStatistics>(); for (CommunicationSummaryStatistics css : nodes) { nodeMap.put(css.getId(), css); } List<CommunicationSummaryStatistics> ret = new ArrayList<>(); for (String endpoint : endpoints) { if (nodeMap.containsKey(endpoint)) { CommunicationSummaryStatistics n = nodeMap.get(nodeMap.containsKey(EndpointUtil.encodeClientURI(endpoint)) ? EndpointUtil.encodeClientURI(endpoint) : endpoint); CommunicationSummaryStatistics rootNode = new CommunicationSummaryStatistics(n); initCommunicationSummaryTreeNode(rootNode, nodeMap, new HashSet<>(Collections.singleton(rootNode.getId()))); ret.add(rootNode); } } return ret; }

Target:
public static Collection<CommunicationSummaryStatistics> buildCommunicationSummaryTree( Collection<CommunicationSummaryStatistics> nodes, Set<String> endpoints) { Map<String, CommunicationSummaryStatistics> nodeMap = new HashMap<String, CommunicationSummaryStatistics>(); for (CommunicationSummaryStatistics css : nodes) { nodeMap.put(css.getId(), css); } List<CommunicationSummaryStatistics> ret = new ArrayList<>(); for (String endpoint : endpoints) { CommunicationSummaryStatistics n = nodeMap.get(EndpointUtil.encodeClientURI(endpoint)); if (n == null) { n = nodeMap.get(endpoint); } if (n != null) { CommunicationSummaryStatistics rootNode = new CommunicationSummaryStatistics(n); initCommunicationSummaryTreeNode(rootNode, nodeMap, new HashSet<>(Collections.singleton(rootNode.getId()))); ret.add(rootNode); } } return ret; }
Source:
public void buyFromBank(Market market, String symbol, int volume) throws StockMarketExpection { totalPrice=market.getStockForSymbol(symbol).getPrice()*volume; if(market.getStockForSymbol(symbol).getPrice()*volume>this.cashInHand){ throw new StockMarketExpection("Cannot place order for "+symbol+" since there is not enough money. Trader: "+this.name); } this.cashInHand -= market.getStockForSymbol(symbol).getPrice()*volume; BuyOrder newOrder = new BuyOrder(symbol, volume, m.getStockForSymbol(symbol).getPrice()*volume, this); this.position.add(newOrder); }

Target:
public void buyFromBank(Market market, String symbol, int volume) throws StockMarketExpection { totalPrice=market.getStockForSymbol(symbol).getPrice()*volume; if(totalPrice>this.cashInHand){ throw new StockMarketExpection("Cannot place order for "+symbol+" since there is not enough money. Trader: "+this.name); } this.cashInHand -= totalPrice; BuyOrder newOrder = new BuyOrder(symbol, volume, totalPrice, this); this.position.add(newOrder); }
Source:
public void testCompressedFrame() { EmbeddedChannel encoderChannel = new EmbeddedChannel(new PerFrameDeflateEncoder(9, 15, false, NEVER_SKIP)); EmbeddedChannel decoderChannel = new EmbeddedChannel( ZlibCodecFactory.newZlibDecoder(ZlibWrapper.NONE)); byte[] payload = new byte[300]; random.nextBytes(payload); BinaryWebSocketFrame frame = new BinaryWebSocketFrame(true, WebSocketExtension.RSV3, Unpooled.wrappedBuffer(payload)); encoderChannel.writeOutbound(frame); BinaryWebSocketFrame compressedFrame = encoderChannel.readOutbound(); assertNotNull(compressedFrame); assertNotNull(compressedFrame.content()); assertEquals(WebSocketExtension.RSV1 | WebSocketExtension.RSV3, compressedFrame.rsv()); decoderChannel.writeInbound(compressedFrame.content()); decoderChannel.writeInbound(DeflateDecoder.FRAME_TAIL); ByteBuf uncompressedPayload = decoderChannel.readInbound(); assertEquals(300, uncompressedPayload.readableBytes()); byte[] finalPayload = new byte[300]; uncompressedPayload.readBytes(finalPayload); assertArrayEquals(finalPayload, payload); uncompressedPayload.release(); }

Target:
public void testCompressedFrame() { EmbeddedChannel encoderChannel = new EmbeddedChannel(new PerFrameDeflateEncoder(9, 15, false)); EmbeddedChannel decoderChannel = new EmbeddedChannel( ZlibCodecFactory.newZlibDecoder(ZlibWrapper.NONE)); byte[] payload = new byte[300]; random.nextBytes(payload); BinaryWebSocketFrame frame = new BinaryWebSocketFrame(true, WebSocketExtension.RSV3, Unpooled.wrappedBuffer(payload)); assertTrue(encoderChannel.writeOutbound(frame)); BinaryWebSocketFrame compressedFrame = encoderChannel.readOutbound(); assertNotNull(compressedFrame); assertNotNull(compressedFrame.content()); assertEquals(WebSocketExtension.RSV1 | WebSocketExtension.RSV3, compressedFrame.rsv()); assertTrue(decoderChannel.writeInbound(compressedFrame.content())); assertTrue(decoderChannel.writeInbound(Unpooled.wrappedBuffer(DeflateDecoder.FRAME_TAIL))); ByteBuf uncompressedPayload = decoderChannel.readInbound(); assertEquals(300, uncompressedPayload.readableBytes()); byte[] finalPayload = new byte[300]; uncompressedPayload.readBytes(finalPayload); assertArrayEquals(finalPayload, payload); uncompressedPayload.release(); }
Source:
public void start(Collection<? extends Location> locations) { super.start(locations); policy = new AbstractMembershipTrackingPolicy(MutableMap.of("name", "Cassandra Cluster Tracker")) { @Override protected void onEntityChange(Entity member) { } @Override protected void onEntityAdded(Entity member) { log.debug("Node added to Cluster {}", getClusterName()); update(); } @Override protected void onEntityRemoved(Entity member) { log.debug("Node removed from Cluster {}", getClusterName()); update(); } }; addPolicy(policy); policy.setGroup(this); setAttribute(Startable.SERVICE_UP, true); }

Target:
public void start(Collection<? extends Location> locations) { super.start(locations); policy = new AbstractMembershipTrackingPolicy(MutableMap.of("name", "Cassandra Cluster Tracker")) { @Override protected void onEntityChange(Entity member) { } @Override protected void onEntityAdded(Entity member) { if (log.isDebugEnabled()) log.debug("Node added to Cluster {}", member, getClusterName()); update(); } @Override protected void onEntityRemoved(Entity member) { if (log.isDebugEnabled()) log.debug("Node removed from Cluster {}", member, getClusterName()); update(); } }; addPolicy(policy); policy.setGroup(this); setAttribute(Startable.SERVICE_UP, true); }
Source:
public static void persistRealtimeToOfflineSegmentsTaskMetadata(HelixPropertyStore<ZNRecord> propertyStore, String taskType, RealtimeToOfflineSegmentsTaskMetadata realtimeToOfflineSegmentsTaskMetadata, int expectedVersion) { String path = ZKMetadataProvider.constructPropertyStorePathForMinionTaskMetadata(taskType, realtimeToOfflineSegmentsTaskMetadata.getTableNameWithType()); if (!propertyStore .set(path, realtimeToOfflineSegmentsTaskMetadata.toZNRecord(), expectedVersion, AccessOption.PERSISTENT)) { throw new ZkException( "Failed to persist minion realtimeToOfflineSegmentsTask metadata: " + realtimeToOfflineSegmentsTaskMetadata); } }

Target:
public static void persistRealtimeToOfflineSegmentsTaskMetadata(HelixPropertyStore<ZNRecord> propertyStore, String taskType, RealtimeToOfflineSegmentsTaskMetadata realtimeToOfflineSegmentsTaskMetadata, int expectedVersion) { String path = ZKMetadataProvider.constructPropertyStorePathForMinionTaskMetadata(taskType, realtimeToOfflineSegmentsTaskMetadata.getTableNameWithType()); if (!propertyStore .set(path, realtimeToOfflineSegmentsTaskMetadata.toZNRecord(), expectedVersion, AccessOption.PERSISTENT)) { throw new ZkException( "Failed to persist minion RealtimeToOfflineSegmentsTask metadata: " + realtimeToOfflineSegmentsTaskMetadata); } }
Source:
public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { if (viewType == VIEW_TYPE_HEADER) { View itemView = LayoutInflater.from(parent.getContext()).inflate(R.layout.site_creation_domain_header, parent, false); return new HeaderViewHolder(itemView); } else if (viewType == VIEW_TYPE_INPUT) { View itemView = LayoutInflater.from(parent.getContext()).inflate(R.layout.site_creation_domain_input, parent, false); return new InputViewHolder(itemView); } else { View itemView = LayoutInflater.from(parent.getContext()).inflate(R.layout.site_creation_domain_item, parent, false); return new DomainViewHolder(itemView); } }

Target:
public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { switch (viewType) { case VIEW_TYPE_HEADER: return new HeaderViewHolder(LayoutInflater.from(parent.getContext()) .inflate(R.layout.site_creation_domain_header, parent, false)); case VIEW_TYPE_INPUT: return new InputViewHolder(LayoutInflater.from(parent.getContext()) .inflate(R.layout.site_creation_domain_input, parent, false)); case VIEW_TYPE_ITEM: return new DomainViewHolder(LayoutInflater.from(parent.getContext()) .inflate(R.layout.site_creation_domain_item, parent, false)); default: throw new RuntimeException("Unknown view type " + viewType); } }
Source:
protected void processBatchOfDocuments(List<String> batch) { if (batch == null || batch.isEmpty()) { return; } TransactionHelper.runInTransaction(() -> { try { String username = command.getUsername(); String repository = command.getRepository(); try (NuxeoLoginContext loginContext = loginSystemOrUser(username)) { CoreSession session = null; if (repository != null) { session = CoreInstance.getCoreSession(repository); } compute(session, batch, command.getParams()); } } catch (LoginException e) { throw new NuxeoException(e); } }); }

Target:
protected void processBatchOfDocuments(List<String> batch) { if (batch == null || batch.isEmpty()) { return; } TransactionHelper.runInTransaction(() -> { try { String username = command.getUsername(); String repository = command.getRepository(); try (NuxeoLoginContext ignored = loginSystemOrUser(username)) { CoreSession session = repository == null ? null : CoreInstance.getCoreSession(repository); compute(session, batch, command.getParams()); } } catch (LoginException e) { throw new NuxeoException(e); } }); }
Source:
public void testNotEnoughSpaceToMergeSnapshotsWithMultipleDisk() { ArrayList<DiskImage> imagesDisks = mockMultipleSourceImagesForDomain(4, STORAGE_DOMAIN_ID, 4); System.out.println(imagesDisks); doReturn(imagesDisks).when(cmd).getSourceImages(); mockStorageDomainDAOGetForStoragePool(15, STORAGE_DOMAIN_ID); assertFalse("Validation should fail. Free space minus threshold should be smaller then summarize all disks size", cmd.isEnoughSpaceToMergeSnapshots()); }

Target:
public void testNotEnoughSpaceToMergeSnapshotsWithMultipleDisk() { List<DiskImage> imagesDisks = mockMultipleSourceImagesForDomain(4, STORAGE_DOMAIN_ID, IMAGE_ACTUAL_SIZE_GB); doReturn(imagesDisks).when(cmd).getSourceImages(); mockStorageDomainDAOGetForStoragePool(15, STORAGE_DOMAIN_ID); assertFalse("Validation should fail. Free space minus threshold should be smaller then summarize all disks size", cmd.isEnoughSpaceToMergeSnapshots()); }
Source:
public void testDatabaseCanGetAllUsers() { try { List<User> users = MockFactory.generateMockUsers(6); for (User user : users) { mDatabaseHelper.addUser(user); } List<User> usersFromDatabase = mDatabaseHelper.getAllUsers(); assertEquals(users.size(), usersFromDatabase.size()); for (int i = 0; i < users.size(); i++) { assertEquals(users.get(i).getName(), usersFromDatabase.get(i).getName()); assertEquals(users.get(i).getEmail(), usersFromDatabase.get(i).getEmail()); assertEquals(users.get(i).getId().getId(), usersFromDatabase.get(i).getId().getId()); } } catch (CacheDatabaseException exception) { fail(); } finally { mDatabaseHelper.clearDatabase(); } }

Target:
public void testDatabaseCanGetAllUsers() { try { List<User> users = MockFactory.generateMockUsers(6); for (User user : users) { mDatabaseHelper.addUser(user); } List<User> usersFromDatabase = mDatabaseHelper.getAllUsers(); assertEquals(users.size(), usersFromDatabase.size()); for (int i = 0; i < users.size(); i++) { assertEquals(users.get(i).getName(), usersFromDatabase.get(i).getName()); assertEquals(users.get(i).getEmail(), usersFromDatabase.get(i).getEmail()); assertEquals(users.get(i).getId().getId(), usersFromDatabase.get(i).getId().getId()); } } catch (CacheDatabaseException exception) { fail(exception.getMessage()); } finally { mDatabaseHelper.clearDatabase(); } }
Source:
public TravelTimeReducer (AnalysisTask task) { this.maxTripDurationMinutes = task.maxTripDurationMinutes; if (task.inRoutingFareCalculator != null) { this.timesPerDestination = task.monteCarloDraws; } else { if (task.monteCarloDraws == 0) { this.timesPerDestination = task.getTimeWindowLengthMinutes(); } else { this.timesPerDestination = task.getTimeWindowLengthMinutes() * task.getMonteCarloDrawsPerMinute(); } } this.nPercentiles = task.percentiles.length; this.percentileIndexes = new int[nPercentiles]; for (int p = 0; p < nPercentiles; p++) { percentileIndexes[p] = findPercentileIndex(timesPerDestination, task.percentiles[p]); } calculateTravelTimes = task instanceof TravelTimeSurfaceTask || task.makeTauiSite; if (calculateTravelTimes) { travelTimes = new TimeGrid(task); } calculateAccessibility = false; if (task instanceof RegionalTask) { RegionalTask regionalTask = (RegionalTask) task; if (regionalTask.recordAccessibility) { calculateAccessibility = true; accessibilityAccumulator = new AccessibilityAccumulator(task); } if (regionalTask.recordTimes) { travelTimes = new TravelTimeResult(regionalTask); calculateTravelTimes = true; } } }

Target:
public TravelTimeReducer (AnalysisTask task) { this.maxTripDurationMinutes = task.maxTripDurationMinutes; if (task.inRoutingFareCalculator != null) { this.timesPerDestination = task.monteCarloDraws; } else { if (task.monteCarloDraws == 0) { this.timesPerDestination = task.getTimeWindowLengthMinutes(); } else { this.timesPerDestination = task.getTimeWindowLengthMinutes() * task.getMonteCarloDrawsPerMinute(); } } this.nPercentiles = task.percentiles.length; this.percentileIndexes = new int[nPercentiles]; for (int p = 0; p < nPercentiles; p++) { percentileIndexes[p] = findPercentileIndex(timesPerDestination, task.percentiles[p]); } calculateAccessibility = calculateTravelTimes = false; if (task instanceof TravelTimeSurfaceTask) { calculateTravelTimes = true; } else { RegionalTask regionalTask = (RegionalTask) task; if (regionalTask.recordAccessibility) { calculateAccessibility = true; } if (regionalTask.recordTimes || regionalTask.makeTauiSite) { calculateTravelTimes = true; } } if (calculateAccessibility) { accessibilityResult = new AccessibilityResult(task); } if (calculateTravelTimes) { travelTimeResult = new TravelTimeResult(task); } }
Source:
private OAuth2CredentialSource(String grantType, URL tokenEndpointUri, String scopes, Supplier<SSLContext> sslContextSupplier, Supplier<HostnameVerifier> hostnameVerifierSupplier) { this(grantType, tokenEndpointUri, (Consumer<Map<String, String>>) stringStringMap -> {}, scopes, sslContextSupplier, hostnameVerifierSupplier); }

Target:
private OAuth2CredentialSource(String grantType, URL tokenEndpointUri, String scopes, Supplier<SSLContext> sslContextSupplier, Supplier<HostnameVerifier> hostnameVerifierSupplier) { this(grantType, tokenEndpointUri, stringStringMap -> {}, scopes, sslContextSupplier, hostnameVerifierSupplier); }