auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public String findMailAddressFor(User u) { if (disabled) return null; String username = u.getId(); for (JiraSite site : JiraGlobalConfiguration.getInstance().getSites()) { JiraSession session = site.getSession(); if (session == null) { continue; } com.atlassian.jira.rest.client.api.domain.User user = session.service .getUser(username); if (user != null) { String email = user.getEmailAddress(); if (email != null) { email = unmaskEmail(email); return email; } } } return null; }

Target:
public String findMailAddressFor(User u) { if (disabled) return null; String username = u.getId(); for (JiraSite site : JiraGlobalConfiguration.get().getSites()) { JiraSession session = site.getSession(); if (session == null) { continue; } com.atlassian.jira.rest.client.api.domain.User user = session.service.getUser(username); if (user != null) { String email = user.getEmailAddress(); if (email != null) { email = unmaskEmail(email); return email; } } } return null; }
Source:
public void testFrameworkProducerUpdate() throws Exception { setupFrameworkProducer(false); Exchange mockExchange = mock(Exchange.class); Message message = mock(Message.class); when(mockExchange.getIn()).thenReturn(message); when(mockExchange.getOut()).thenReturn(message); when(mockExchange.getIn().getHeader(OPERATION_HEADER_KEY)).thenReturn(UPDATE_OPERATION); when(mockExchange.getIn().getHeader(TIMEOUT_HEADER_KEY)).thenReturn(1000L); when(mockExchange.getIn().getBody()).thenReturn(new MetacardImpl()); when(mockExchange.getIn().getBody(any())).thenReturn(new MetacardImpl()); frameworkProducer.process(mockExchange); }

Target:
public void testFrameworkProducerUpdate() throws Exception { setupFrameworkProducer(false); Exchange mockExchange = mock(Exchange.class); Message message = mock(Message.class); when(mockExchange.getIn()).thenReturn(message); when(mockExchange.getOut()).thenReturn(message); when(mockExchange.getIn().getHeader(OPERATION_HEADER_KEY)).thenReturn(UPDATE_OPERATION); when(mockExchange.getIn().getHeader(TIMEOUT_HEADER_KEY)).thenReturn(1000L); when(mockExchange.getIn().getBody()).thenReturn(new MetacardImpl()); when(mockExchange.getIn().getBody(any())).thenReturn(new MetacardImpl()); frameworkProducer.process(mockExchange); verify(catalogFramework).update(any(UpdateRequest.class)); }
Source:
public boolean isVersioningEnabled(IsVersioningEnabledArgs args) throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, InternalException, InvalidBucketNameException, InvalidKeyException, InvalidResponseException, IOException, NoSuchAlgorithmException, XmlParserException { checkArgs(args); Map<String, String> queryParamMap = new HashMap<>(); queryParamMap.put("versioning", ""); try (Response response = executeGet(args.bucket(), null, null, queryParamMap)) { VersioningConfiguration result = Xml.unmarshal(VersioningConfiguration.class, response.body().charStream()); return result.status(); } catch (ErrorResponseException e) { if (e.errorResponse().errorCode() != ErrorCode.ILLEGAL_VERSIONING_CONFIGURATION_EXCEPTION) { throw e; } } return false; }

Target:
public boolean isVersioningEnabled(IsVersioningEnabledArgs args) throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, InternalException, InvalidBucketNameException, InvalidKeyException, InvalidResponseException, IOException, NoSuchAlgorithmException, XmlParserException { checkArgs(args); Map<String, String> queryParamMap = new HashMap<>(); queryParamMap.put("versioning", ""); try (Response response = executeGet(args.bucket(), null, null, queryParamMap)) { VersioningConfiguration result = Xml.unmarshal(VersioningConfiguration.class, response.body().charStream()); return result.status(); } }
Source:
public List<Sprite> getAllClonesOfSprite(Sprite sprite) { List<Sprite> clonesOfSprite = new ArrayList<Sprite>(); Pattern pattern = createCloneRegexPattern(sprite.getName()); for (Sprite spriteOfStage : sprites) { Matcher matcher = pattern.matcher(spriteOfStage.getName()); if (spriteOfStage.isClone && matcher.matches()) { clonesOfSprite.add(spriteOfStage); } } return clonesOfSprite; }

Target:
public List<Sprite> getAllClonesOfSprite(Sprite sprite) { List<Sprite> clonesOfSprite = new ArrayList<>(); Pattern pattern = createCloneRegexPattern(sprite.getName()); for (Sprite spriteOfStage : sprites) { if (!spriteOfStage.isClone) { continue; } Matcher matcher = pattern.matcher(spriteOfStage.getName()); if (matcher.matches()) { clonesOfSprite.add(spriteOfStage); } } return clonesOfSprite; }
Source:
public void shouldExecuteOnlyWhenNecessary() { DefaultFileSystem fileSystemPython = new DefaultFileSystem(); DefaultFileSystem fileSystemForeign = new DefaultFileSystem(); DefaultInputFile inputFile1 = new DefaultInputFile("src/test/resources/example_project/example.swift").setLanguage(Python.KEY); inputFile1.setAbsolutePath((new File("src/test/resources/example_project/example.swift")).getAbsolutePath()); fileSystemPython.add(inputFile1); Project pythonProject = mock(Project.class); Project foreignProject = mock(Project.class); RulesProfile emptyProfile = mock(RulesProfile.class); RulesProfile pylintProfile = createPylintProfile(); checkNecessityOfExecution(pythonProject, pylintProfile, fileSystemPython, true); checkNecessityOfExecution(pythonProject, emptyProfile, fileSystemPython, false); checkNecessityOfExecution(foreignProject, pylintProfile, fileSystemForeign, false); checkNecessityOfExecution(foreignProject, emptyProfile, fileSystemForeign, false); }

Target:
public void shouldExecuteOnlyWhenNecessary() { DefaultFileSystem fileSystemPython = new DefaultFileSystem(); DefaultFileSystem fileSystemForeign = new DefaultFileSystem(); DefaultInputFile inputFile1 = new DefaultInputFile("src/test/resources/example_project/example.py").setLanguage(Python.KEY); inputFile1.setAbsolutePath((new File("src/test/resources/example_project/example.py")).getAbsolutePath()); fileSystemPython.add(inputFile1); Project pythonProject = mock(Project.class); Project foreignProject = mock(Project.class); RulesProfile emptyProfile = mock(RulesProfile.class); RulesProfile pylintProfile = createPylintProfile(); checkNecessityOfExecution(pythonProject, pylintProfile, fileSystemPython, true); checkNecessityOfExecution(pythonProject, emptyProfile, fileSystemPython, false); checkNecessityOfExecution(foreignProject, pylintProfile, fileSystemForeign, false); checkNecessityOfExecution(foreignProject, emptyProfile, fileSystemForeign, false); }
Source:
public List<EmailWrapper> generateFeedbackSessionClosedEmails(FeedbackSessionAttributes session) { boolean isEmailNeeded = fsLogic.isFeedbackSessionForStudentsToAnswer(session); CourseAttributes course = coursesLogic.getCourse(session.getCourseId()); List<InstructorAttributes> instructors = isEmailNeeded ? instructorsLogic.getInstructorsForCourse(session.getCourseId()) : new ArrayList<InstructorAttributes>(); List<EmailWrapper> emails = generateFeedbackSessionClosedEmail(course, session, instructors); return emails; }

Target:
public List<EmailWrapper> generateFeedbackSessionClosedEmails(FeedbackSessionAttributes session) { if (session.isPrivateSession()) { return new ArrayList<EmailWrapper>(); } CourseAttributes course = coursesLogic.getCourse(session.getCourseId()); boolean isEmailNeededForStudents = false; try { isEmailNeededForStudents = fsLogic.isFeedbackSessionHasQuestionForStudents( session.getFeedbackSessionName(), session.getCourseId()); } catch (EntityDoesNotExistException e) { log.severe("Course " + session.getCourseId() + " does not exist or " + "session " + session.getFeedbackSessionName() + " does not exist"); } List<InstructorAttributes> instructors = instructorsLogic.getInstructorsForCourse(session.getCourseId()); List<StudentAttributes> students = isEmailNeededForStudents ? studentsLogic.getStudentsForCourse(session.getCourseId()) : new ArrayList<StudentAttributes>(); return generateFeedbackSessionClosedEmail(course, session, instructors, students); }
Source:
protected List<SortInfo> getSortInfo(String sortBy, String sortOrder) { List<SortInfo> sortInfoList = null; if (!StringUtils.isBlank(sortBy)) { String[] sorts = sortBy.split(","); String[] orders = null; if (!StringUtils.isBlank(sortOrder)) { orders = sortOrder.split(","); } if (sorts.length > 0) { sortInfoList = new ArrayList<>(); } for (int i = 0; i < sorts.length; i++) { String sort = sorts[i]; boolean sortAscending = (orders != null && orders.length > i && orders[i].equalsIgnoreCase("asc")); sortInfoList.add(new SortInfo(sort, sortAscending)); } } return sortInfoList; }

Target:
protected List<SortInfo> getSortInfo(String sortBy, String sortOrder) { List<SortInfo> sortInfoList = null; if (!StringUtils.isBlank(sortBy)) { String[] sorts = sortBy.split(","); String[] orders = null; if (!StringUtils.isBlank(sortOrder)) { orders = sortOrder.split(","); } if (sorts.length > 0) { sortInfoList = new ArrayList<>(); } for (int i = 0; i < sorts.length; i++) { String sort = sorts[i]; boolean sortAscending = orders != null && orders.length > i && "asc".equalsIgnoreCase(orders[i]); sortInfoList.add(new SortInfo(sort, sortAscending)); } } return sortInfoList; }
Source:
public String getLocalNameFromDelegate( AbstractLiteralIV<BigdataLiteral, ?> delegate) { final BigInteger bigintVal; if (delegate instanceof XSDIntegerIV) { bigintVal = ((XSDIntegerIV<?>)delegate).getInlineValue(); } else { final String intStr = super.getLocalNameFromDelegate(delegate); bigintVal = new BigInteger(intStr, 10); } String localName = bigintVal.toString(16); if (localName.length() < fixedWidth) { localName = zeroPadding.substring(localName.length()) + localName; } return localName; }

Target:
public String getLocalNameFromDelegate( AbstractLiteralIV<BigdataLiteral, ?> delegate) { final BigInteger bigintVal; if (delegate instanceof XSDIntegerIV) { bigintVal = ((XSDIntegerIV<?>)delegate).getInlineValue(); } else { final String intStr = super.getLocalNameFromDelegate(delegate); bigintVal = new BigInteger(intStr, 10); } String localName = toFixedWidthHexString(bigintVal); return localName; }
Source:
public Page getNextPage() { if (isFinished()) { close(); return null; } if (!isPinotDataFetched) { fetchPinotData(); } if (currentDataTable != null) { estimatedMemoryUsageInBytes -= currentDataTable.getEstimatedSizeInBytes(); } if (dataTableList.size() == 0) { close(); return null; } currentDataTable = dataTableList.pop(); List<PinotColumnHandle> expectedColumnHandles = split.getExpectedColumnHandles(); PageBuilder pageBuilder = new PageBuilder(columnTypes); pageBuilder.declarePositions(currentDataTable.getDataTable().getNumberOfRows()); for (int columnHandleIdx = 0; columnHandleIdx < columnHandles.size(); columnHandleIdx++) { BlockBuilder blockBuilder = pageBuilder.getBlockBuilder(columnHandleIdx); Type columnType = columnTypes.get(columnHandleIdx); PinotColumnHandle handle = columnHandles.get(columnHandleIdx); int idxReturnedByPinot = expectedColumnHandles.indexOf(handle); if (idxReturnedByPinot < 0) { throw new PinotException(PinotErrorCode.PINOT_INVALID_PQL_GENERATED, split.getSegmentPql(), String.format("Expected column handle %s to be present in the handles %s corresponding to the segment PQL", handle, expectedColumnHandles)); } writeBlock(blockBuilder, columnType, idxReturnedByPinot); } return pageBuilder.build(); }

Target:
public Page getNextPage() { if (isFinished()) { close(); return null; } if (!isPinotDataFetched) { fetchPinotData(); } if (currentDataTable != null) { estimatedMemoryUsageInBytes -= currentDataTable.getEstimatedSizeInBytes(); } if (dataTableList.size() == 0) { close(); return null; } currentDataTable = dataTableList.pop(); List<PinotColumnHandle> expectedColumnHandles = split.getExpectedColumnHandles(); PageBuilder pageBuilder = new PageBuilder(columnTypes); pageBuilder.declarePositions(currentDataTable.getDataTable().getNumberOfRows()); for (int columnHandleIndex = 0; columnHandleIndex < columnHandles.size(); columnHandleIndex++) { BlockBuilder blockBuilder = pageBuilder.getBlockBuilder(columnHandleIndex); Type columnType = columnTypes.get(columnHandleIndex); PinotColumnHandle handle = columnHandles.get(columnHandleIndex); int indexReturnedByPinot = expectedColumnHandles.indexOf(handle); if (indexReturnedByPinot < 0) { throw new PinotException( PINOT_INVALID_PQL_GENERATED, split.getSegmentPql(), String.format("Expected column handle %s to be present in the handles %s corresponding to the segment PQL", handle, expectedColumnHandles)); } writeBlock(blockBuilder, columnType, indexReturnedByPinot); } return pageBuilder.build(); }
Source:
protected void parseSplitSampleData(Variant variant, String fileId, String studyId, String[] fields, String[] alternateAlleles, String[] secondaryAlternates, int alternateAlleleIdx) throws NonStandardCompliantSampleField, NotAVariantException { String[] formatFields = variant.getSourceEntry(fileId, studyId).getFormat().split(":"); for (int i = 9; i < fields.length; i++) { Map<String, String> map = new TreeMap<>(); int countreferencegenotypes=0; String[] sampleFields = fields[i].split(":"); for (int j = 0; j < sampleFields.length; j++) { if(sampleFields[j].equals("./.") || sampleFields.equals("0/0") || sampleFields.equals("0|0")){ countreferencegenotypes++; } String formatField = formatFields[j]; String sampleField = processSampleField(alternateAlleleIdx, formatField, sampleFields[j]); map.put(formatField, sampleField); if(countreferencegenotypes == sampleFields.length){ throw new NotAVariantException("all the sample genotypes are non-variant"); }else{ variant.getSourceEntry(fileId, studyId).addSampleData(map); } } } }

Target:
protected void parseSplitSampleData(Variant variant, String fileId, String studyId, String[] fields, String[] alternateAlleles, String[] secondaryAlternates, int alternateAlleleIdx) throws NonStandardCompliantSampleField, NotAVariantException { String[] formatFields = variant.getSourceEntry(fileId, studyId).getFormat().split(":"); for (int i = 9; i < fields.length; i++) { Map<String, String> map = new TreeMap<>(); int countReferenceGenotypes = 0; String[] sampleFields = fields[i].split(":"); for (int j = 0; j < sampleFields.length; j++) { if(formatFields[0].equals("GT")){ if(sampleFields[j].equals("./.") || sampleFields[j].equals("0/0") || sampleFields[j].equals("0|0")){ countReferenceGenotypes++; } } String formatField = formatFields[j]; String sampleField = processSampleField(alternateAlleleIdx, formatField, sampleFields[j]); map.put(formatField, sampleField); if(countReferenceGenotypes == sampleFields.length){ throw new NotAVariantException("all the sample genotypes are non-variant"); }else{ variant.getSourceEntry(fileId, studyId).addSampleData(map); } } } }
Source:
TopologyMaster.MetricResponse getMetricsFromMetricsCache( String metric, String component, Instant start, Duration duration) { TopologyMaster.MetricRequest request = TopologyMaster.MetricRequest.newBuilder() .setComponentName(component) .setExplicitInterval( MetricInterval.newBuilder() .setStart(start.getEpochSecond()) .setEnd(start.plus(duration).getEpochSecond()) .build()) .addMetric(metric) .build(); LOG.info("MetricsCache Query request: " + request.toString()); NetworkUtils.sendHttpPostRequest(con, "X", request.toByteArray()); byte[] responseData = NetworkUtils.readHttpResponse(con); try { TopologyMaster.MetricResponse response = TopologyMaster.MetricResponse.parseFrom(responseData); LOG.info("MetricsCache Query response: " + response.toString()); return response; } catch (com.google.protobuf.InvalidProtocolBufferException e) { LOG.severe("protobuf cannot parse the reply from MetricsCache " + e); return null; } }

Target:
TopologyMaster.MetricResponse getMetricsFromMetricsCache( String metric, String component, Instant start, Duration duration) { TopologyMaster.MetricRequest request = TopologyMaster.MetricRequest.newBuilder() .setComponentName(component) .setExplicitInterval( MetricInterval.newBuilder() .setStart(start.getEpochSecond()) .setEnd(start.plus(duration).getEpochSecond()) .build()) .addMetric(metric) .build(); LOG.log(Level.FINE, "MetricsCache Query request: %s", request); NetworkUtils.sendHttpPostRequest(con, "X", request.toByteArray()); byte[] responseData = NetworkUtils.readHttpResponse(con); try { TopologyMaster.MetricResponse response = TopologyMaster.MetricResponse.parseFrom(responseData); LOG.log(Level.FINE, "MetricsCache Query response: %s", response); return response; } catch (com.google.protobuf.InvalidProtocolBufferException e) { LOG.severe("protobuf cannot parse the reply from MetricsCache " + e); return null; } }
Source:
public static void notifyNodeCommandException(Project project) { Notification notification = new Notification(GROUP_ANALYSIS_PROBLEM, "<b>SonarLint - Unmet Analysis Requirement</b>", "Node.js >= 8.x is required to perform JavaScript or TypeScript analysis. Check the <a href='#'>SonarLint Log</a> for details.", NotificationType.WARNING, new ShowSonarLintLogListener(project)); notification.setImportant(true); notification.notify(project); }

Target:
public static void notifyNodeCommandException(Project project) { Notification notification = new Notification(GROUP_ANALYSIS_PROBLEM, "<b>SonarLint - Node.js Required</b>", "Node.js >= 8.x is required to perform JavaScript or TypeScript analysis. Check the <a href='#'>SonarLint Log</a> for details.", NotificationType.WARNING, new ShowSonarLintLogListener(project)); notification.setImportant(true); notification.notify(project); }
Source:
static Func1<ChangeNotification<InstanceInfo>, Observable<ChangeNotification<InstanceInfo>>> bufferStartEndDelineateFun(Interest<InstanceInfo> interest) { final ChangeNotification<InstanceInfo> bufferStartNotification = StreamStateNotification.bufferStartNotification(interest); final ChangeNotification<InstanceInfo> bufferEndNotification = StreamStateNotification.bufferEndNotification(interest); final List<ChangeNotification<InstanceInfo>> buffer = new ArrayList<>(); return new Func1<ChangeNotification<InstanceInfo>, Observable<ChangeNotification<InstanceInfo>>>() { @Override public Observable<ChangeNotification<InstanceInfo>> call(ChangeNotification<InstanceInfo> notification) { if (notification.getKind() != Kind.BufferSentinel) { buffer.add(notification); return Observable.empty(); } if (buffer.isEmpty()) { return Observable.empty(); } Observable<ChangeNotification<InstanceInfo>> result; if (buffer.size() == 1) { result = Observable.just(buffer.get(0)); } else { List<ChangeNotification<InstanceInfo>> batch = new ArrayList<>(2 + buffer.size()); batch.add(bufferStartNotification); for (ChangeNotification<InstanceInfo> item : buffer) { batch.add(item); } batch.add(bufferEndNotification); result = Observable.from(batch); } buffer.clear(); return result; } }; }

Target:
static Func1<ChangeNotification<InstanceInfo>, Observable<ChangeNotification<InstanceInfo>>> bufferStartEndDelineateFun(Interest<InstanceInfo> interest) { final ChangeNotification<InstanceInfo> bufferStartNotification = StreamStateNotification.bufferStartNotification(interest); final ChangeNotification<InstanceInfo> bufferEndNotification = StreamStateNotification.bufferEndNotification(interest); final List<ChangeNotification<InstanceInfo>> buffer = new ArrayList<>(); return new Func1<ChangeNotification<InstanceInfo>, Observable<ChangeNotification<InstanceInfo>>>() { @Override public Observable<ChangeNotification<InstanceInfo>> call(ChangeNotification<InstanceInfo> notification) { if (notification.getKind() != Kind.BufferSentinel) { buffer.add(notification); return Observable.empty(); } if (buffer.isEmpty()) { return Observable.empty(); } Observable<ChangeNotification<InstanceInfo>> result; if (buffer.size() == 1) { result = Observable.just(buffer.get(0)); } else { List<ChangeNotification<InstanceInfo>> batch = new ArrayList<>(2 + buffer.size()); batch.add(bufferStartNotification); batch.addAll(buffer); batch.add(bufferEndNotification); result = Observable.from(batch); } buffer.clear(); return result; } }; }
Source:
public void incrementGoalStats() throws MojoExecutionException { try { loadStatistics(); if(sdkStatistics.getStatsEnabled() && wizard.isInteractiveMode()){ String goal = getGoal(); if (StringUtils.isNotBlank(goal)) { sdkStatistics.incrementGoal(goal); sdkStatistics.setLastUsed(); sdkStatistics.save(); } sdkStatistics.sendReport(wizard); } } catch (Exception e) { wizard.showMessage("Failed to send anonymous user statistics"); } }

Target:
public void incrementGoalStats() throws MojoExecutionException { try { loadStatistics(); if(sdkStatistics.getStatsEnabled() && wizard.isInteractiveMode()){ String goal = getGoal(); if (StringUtils.isNotBlank(goal)) { sdkStatistics.incrementGoal(goal); sdkStatistics.setLastUsed(); sdkStatistics.save(); } sdkStatistics.sendReport(wizard); } } catch (Exception e) { wizard.showMessage("Failed to send anonymous user statistics. " + e.getMessage()); } }
Source:
public void testProcessingCatalog() { String variable = "%{translate}"; String translation = "Translate"; String catalog = "..." + variable + "..."; MondrianProperties.instance().LocalePropFile.set( "resources.properties" ); DynamicSchemaProcessor dsp = new LocalizingDynamicSchemaProcessor(); Util.PropertyList connectInfo = new Util.PropertyList(); try { String catalogProcessed = dsp.processCatalog(catalog, connectInfo); assertEquals( catalog.replace( variable, translation ), catalogProcessed ); } catch (Exception e) { assertEquals(0, 1); } }

Target:
public void testProcessingCatalog() { String variable = "%{translate}"; String translation = "Translate"; String catalog = "..." + variable + "..."; MondrianProperties.instance().LocalePropFile.set("mondrian/i18n/LocalizingDynamicSchemaProcessor/resources.properties" ); DynamicSchemaProcessor dsp = new LocalizingDynamicSchemaProcessor(); Util.PropertyList connectInfo = new Util.PropertyList(); try { String catalogProcessed = dsp.processCatalog(catalog, connectInfo); assertEquals( catalog.replace( variable, translation ), catalogProcessed ); } catch (Exception e) { assertEquals(0, 1); } MondrianProperties.instance().LocalePropFile.set( "" ); }
Source:
public static void closeView(String title, SWTWorkbenchBot bot) { final List<SWTBotView> openViews = bot.views(); for (SWTBotView view : openViews) { if (view.getTitle().toLowerCase().equals(title.toLowerCase())) { view.close(); bot.waitUntil(ConditionHelpers.ViewIsClosed(view)); } } }

Target:
public static void closeView(String title, SWTWorkbenchBot bot) { final List<SWTBotView> openViews = bot.views(); for (SWTBotView view : openViews) { if (view.getTitle().equalsIgnoreCase(title)) { view.close(); bot.waitUntil(ConditionHelpers.ViewIsClosed(view)); } } }
Source:
private static Optional<List<Tree>> findIssueForOperand(Expression expr) { if (instantiatesFreshObject(expr)) { return Optional.of(Collections.emptyList()); } else if (expr.is(Tree.Kind.NAME)) { Name name = (Name) expr; Expression rhs = Expressions.singleAssignedValue((Name) expr); if (rhs != null && instantiatesFreshObject(rhs) && cannotEscape(name.symbol())) { return Optional.of(Collections.singletonList(rhs)); } } return Optional.empty(); }

Target:
private static Optional<List<Tree>> findIssueForOperand(Expression expr) { if (instantiatesFreshObject(expr)) { return Optional.of(Collections.emptyList()); } else if (expr.is(Tree.Kind.NAME)) { Name name = (Name) expr; Symbol symb = name.symbol(); if (symb != null) { Expression rhs = Expressions.singleAssignedValue((Name) expr); if (rhs != null && instantiatesFreshObject(rhs) && cannotEscape(symb)) { return Optional.of(Collections.singletonList(rhs)); } } } return Optional.empty(); }
Source:
private Request startBlockwiseUpload(final Exchange exchange, final Request request) { final KeyUri key = getKey(exchange, request); synchronized (block1Transfers) { Block1BlockwiseStatus status = getBlock1Status(key); if (status != null) { status.cancelRequest(); clearBlock1Status(key); } status = getOutboundBlock1Status(key, exchange, request); final Request block = status.getNextRequestBlock(); block.addMessageObserver(new MessageObserverAdapter() { private void copyToken() { request.setToken(block.getToken()); } @Override public void onAcknowledgement() { copyToken(); } @Override public void onReject() { copyToken(); clearBlock1Status(key); } @Override public void onTimeout() { copyToken(); clearBlock1Status(key); } @Override public void onCancel() { clearBlock1Status(key); } @Override public void onSendError(Throwable error) { copyToken(); clearBlock1Status(key); } }); return block; } }

Target:
private Request startBlockwiseUpload(final Exchange exchange, final Request request) { final KeyUri key = getKey(exchange, request); synchronized (block1Transfers) { Block1BlockwiseStatus status = getBlock1Status(key); if (status != null) { status.cancelRequest(); clearBlock1Status(key); } status = getOutboundBlock1Status(key, exchange, request); final Request block = status.getNextRequestBlock(); block.addMessageObserver(new MessageObserverAdapter() { private void copyToken() { request.setToken(block.getToken()); } @Override public void onCancel() { failed(); } @Override public void onSent() { copyToken(); } @Override public void onSendError(Throwable error) { copyToken(); failed(); } @Override public void failed() { clearBlock1Status(key); } }); return block; } }
Source:
private String getImageDaemonUri(String daemonHostname) { String scheme = Config.<Boolean>getValue(ConfigValues.ImageDaemonSSLEnabled) ? "https" : "http"; String port = Config.getValue(ConfigValues.ImageDaemonPort); return scheme + "://" + daemonHostname + ":" + port; }

Target:
private String getImageDaemonUri(String daemonHostname) { String port = Config.getValue(ConfigValues.ImageDaemonPort); return "https://" + daemonHostname + ":" + port; }
Source:
protected void loadInterstitial(Context context, CustomEventInterstitialListener listener, Map<String, Object> localExtras, Map<String, String> serverExtras) { if (context == null) { Log.e(LOG_TAG, "Context cannot be null."); listener.onInterstitialFailed(ADAPTER_CONFIGURATION_ERROR); return; } if (listener == null) { Log.e(LOG_TAG, "CustomEventInterstitialListener cannot be null."); return; } if (!(context instanceof Activity)) { Log.e(LOG_TAG, "Ad can be rendered only in Activity context."); listener.onInterstitialFailed(ADAPTER_CONFIGURATION_ERROR); return; } if (!extrasAreValid(serverExtras)) { listener.onInterstitialFailed(ADAPTER_CONFIGURATION_ERROR); return; } mContext = context; mListener = listener; String apiKey = serverExtras.get(FlurryAgentWrapper.PARAM_API_KEY); mAdSpaceName = serverExtras.get(FlurryAgentWrapper.PARAM_AD_SPACE_NAME); FlurryAgentWrapper.getInstance().startSession(context, apiKey, null); Log.d(LOG_TAG, "Fetching Flurry ad, ad unit name:" + mAdSpaceName); mInterstitial = new FlurryAdInterstitial(mContext, mAdSpaceName); mInterstitial.setListener(new FlurryMopubInterstitialListener()); mInterstitial.fetchAd(); }

Target:
protected void loadInterstitial(Context context, CustomEventInterstitialListener listener, Map<String, Object> localExtras, Map<String, String> serverExtras) { if (context == null) { Log.e(LOG_TAG, "Context cannot be null."); listener.onInterstitialFailed(ADAPTER_CONFIGURATION_ERROR); return; } if (listener == null) { Log.e(LOG_TAG, "CustomEventInterstitialListener cannot be null."); return; } if (!(context instanceof Activity)) { Log.e(LOG_TAG, "Ad can be rendered only in Activity context."); listener.onInterstitialFailed(ADAPTER_CONFIGURATION_ERROR); return; } if (!validateExtras(serverExtras)) { Log.e(LOG_TAG, "Failed interstitial ad fetch: Missing required server extras" + " [FLURRY_APIKEY and/or FLURRY_ADSPACE]."); listener.onInterstitialFailed(ADAPTER_CONFIGURATION_ERROR); return; } mContext = context; mListener = listener; String apiKey = serverExtras.get(FlurryAgentWrapper.PARAM_API_KEY); mAdSpaceName = serverExtras.get(FlurryAgentWrapper.PARAM_AD_SPACE_NAME); FlurryAgentWrapper.getInstance().startSession(context, apiKey, null); Log.d(LOG_TAG, "Fetching Flurry ad, ad unit name:" + mAdSpaceName); mInterstitial = new FlurryAdInterstitial(mContext, mAdSpaceName); mInterstitial.setListener(new FlurryMopubInterstitialListener()); mInterstitial.fetchAd(); }
Source:
public boolean execute(MatchingFrame frame, ISearchContext context) throws LocalSearchException { if (it.hasNext()) { final Tuple next = it.next(); for (int i = 0; i < positions.length; i++) { frame.setValue(positions[i], next.get(i)); } return true; } else { return false; } }

Target:
public boolean execute(MatchingFrame frame, ISearchContext context) throws LocalSearchException { if (it.hasNext()) { final Tuple next = it.next(); for (Integer position : unboundVariableIndex) { frame.setValue(position, null); } for (int i = 0; i < positions.length; i++) { Object newValue = next.get(i); Object oldValue = frame.getValue(positions[i]); if (oldValue != null && !Objects.equals(oldValue, newValue)) { return false; } frame.setValue(positions[i], newValue); } return true; } else { return false; } }
Source:
public void testAboutDialog() throws IOException { solo.clickOnMenuItem("About"); solo.sleep(2000); assertTrue("Could not find the dialog!", solo.searchText("Musicdroid")); }

Target:
public void testAboutDialog() throws IOException { solo.clickOnMenuItem(getActivity().getResources().getString(R.string.action_project_about)); solo.waitForDialogToOpen(); assertTrue(solo.searchText(getActivity().getResources().getString(R.string.about_Dialog))); }
Source:
private void moveResource(Resource resource, Path path, Notification notification) { if (resource.isProject()) { closeRelatedEditors(resource); } resource .move(path) .then( arg -> { if (arg.isFolder()) { return; } final List<EditorPartPresenter> openedEditors = editorAgent.getOpenedEditors(); for (EditorPartPresenter editor : openedEditors) { VirtualFile file = editor.getEditorInput().getFile(); if (arg.getLocation().equals(file.getLocation())) { eventBus.fireEvent(FileEvent.createFileOpenedEvent(file)); return; } } }) .catchError( arg -> { notification.setContent(arg.getMessage()); }); }

Target:
private void moveResource(Resource resource, Path path, Notification notification) { if (resource.isProject()) { closeRelatedEditors(resource); } resource .move(path) .then( movedResource -> { if (movedResource.isFolder()) { return; } final List<EditorPartPresenter> openedEditors = editorAgent.getOpenedEditors(); for (EditorPartPresenter editor : openedEditors) { VirtualFile file = editor.getEditorInput().getFile(); if (movedResource.getLocation().equals(file.getLocation())) { eventBus.fireEvent(FileEvent.createFileOpenedEvent(file)); return; } } }) .catchError( arg -> { notification.setContent(arg.getMessage()); }); }
Source:
public void onDeath(DoDestroyEvent event, EntityRef entity) { CharacterComponent character = entity.getComponent(CharacterComponent.class); DeathEvent deathEvent = new DeathEvent(); deathEvent.lastDamageType = event.getDamageTypeString(); if (event.getInstigatorString() != null) { deathEvent.lastInstigator = event.getInstigatorString(); } else { deathEvent.lastInstigator = translationSystem.translate("${engine:menu#unknown}"); } character.controller.send(deathEvent); }

Target:
public void onDeath(DoDestroyEvent event, EntityRef entity) { CharacterComponent character = entity.getComponent(CharacterComponent.class); DeathEvent deathEvent = new DeathEvent(); deathEvent.damageTypeName = getDamageTypeName(event.getDamageType()); deathEvent.instigatorName = getInstigatorName(event.getInstigator()); character.controller.send(deathEvent); }
Source:
public Preview.PreviewSurfaceCallback getPreviewSurfaceCallback() { return new Preview.PreviewSurfaceCallback() { final Map<Surface, SurfaceTexture> mSurfaceTextureMap = new HashMap<>(); @NonNull @Override public ListenableFuture<Surface> createSurfaceFuture(@NonNull Size resolution, int imageFormat) { final SurfaceTexture surfaceTexture = new SurfaceTexture(0); surfaceTexture.setDefaultBufferSize(resolution.getWidth(), resolution.getHeight()); surfaceTexture.detachFromGLContext(); final ViewGroup parent = (ViewGroup) mTextureView.getParent(); parent.removeView(mTextureView); parent.addView(mTextureView); mTextureView.setSurfaceTexture(surfaceTexture); final Surface surface = new Surface(surfaceTexture); mSurfaceTextureMap.put(surface, surfaceTexture); return Futures.immediateFuture(surface); } @Override public void onSafeToRelease(@NonNull ListenableFuture<Surface> surfaceFuture) { try { final Surface surface = surfaceFuture.get(); final SurfaceTexture surfaceTexture = mSurfaceTextureMap.get(surface); if (surfaceTexture != null) { surfaceTexture.release(); mSurfaceTextureMap.remove(surface); } surface.release(); } catch (ExecutionException | InterruptedException e) { e.printStackTrace(); } } }; }

Target:
public Preview.PreviewSurfaceCallback getPreviewSurfaceCallback() { return PreviewUtil.createPreviewSurfaceCallback(new PreviewUtil.SurfaceTextureCallback() { @Override public void onSurfaceTextureReady(@NonNull SurfaceTexture surfaceTexture) { Log.d(TAG, "onSurfaceTextureReady"); final ViewGroup parent = (ViewGroup) mTextureView.getParent(); parent.removeView(mTextureView); parent.addView(mTextureView); mTextureView.setSurfaceTexture(surfaceTexture); } @Override public void onSafeToRelease(@NonNull SurfaceTexture surfaceTexture) { Log.d(TAG, "onSafeToRelease"); surfaceTexture.release(); } }); }
Source:
private boolean defaultKubernetesMasterReachable() { try { InetAddress.getByName("kubernetes.default.svc"); return true; } catch (UnknownHostException e) { LOGGER.warning("Hazelcast running on Kubernetes, but \"kubernetes.default.svc\" is not reachable. " + "Check your Kubernetes DNS configuration."); LOGGER.finest(e); return false; } }

Target:
private boolean defaultKubernetesMasterReachable() { try { InetAddress.getByName("kubernetes.default.svc"); return true; } catch (UnknownHostException e) { ILogger logger = Logger.getLogger(HazelcastKubernetesDiscoveryStrategyFactory.class); logger.warning("Hazelcast running on Kubernetes, but \"kubernetes.default.svc\" is not reachable. " + "Check your Kubernetes DNS configuration."); logger.finest(e); return false; } }
Source:
public void send(byte[] payload) throws TTransportException { if (payload == null || payload.length == 0) { return; } int requestSizeLimit = this.getMaxRequestSize(); if (requestSizeLimit > 0 && payload.length > requestSizeLimit) { throw new FMessageSizeException( String.format("Message exceeds %d bytes, was %d bytes", requestSizeLimit, payload.length)); } byte[] response = makeRequest(payload); if (response.length < 4) { throw new TTransportException("invalid frame size"); } if (response.length == 4) { if (ByteBuffer.wrap(response).getInt() != 0) { throw new TTransportException("missing data"); } return; } try { executeFrame(response); } catch (TException e) { throw new TTransportException("could not execute response callback: " + e.getMessage()); } }

Target:
public void send(byte[] payload) throws TTransportException { int requestSizeLimit = getRequestSizeLimit(); if (requestSizeLimit > 0 && payload.length > requestSizeLimit) { throw new FMessageSizeException( String.format("Message exceeds %d bytes, was %d bytes", requestSizeLimit, payload.length)); } byte[] response = makeRequest(payload); if (response.length < 4) { throw new TTransportException("invalid frame size"); } if (response.length == 4) { if (ByteBuffer.wrap(response).getInt() != 0) { throw new TTransportException("missing data"); } return; } try { executeFrame(response); } catch (TException e) { throw new TTransportException("could not execute response callback: " + e.getMessage()); } }
Source:
private void sortByPrice(ArrayList<Order> orders) { int i = 0; while (i < orders.size()) { int j = 0; while (j < orders.size() - 1) { Order tempTarg = orders.get(j); Order tempNext = orders.get(j+1); if (tempTarg.getPrice() < tempNext.getPrice()) { Collections.swap(orders, j, j+1); } j++; } i++; } }

Target:
private void sortByPrice(ArrayList<Order> orders) { int i = 0; while (i < orders.size()) { int j = 0; while (j < orders.size() - 1) { Order tempOrder = orders.get(j); Order tempNext = orders.get(j+1); if (tempOrder.getPrice() < tempNext.getPrice()) { Collections.swap(orders, j, j+1); } j++; } i++; } }
Source:
public <T> void testWriteToTable_dataWritten() throws Exception { int INSERT_COUNT = 50; try (Admin admin = connection.getAdmin()) { LOG.info("Creating table in testWriteToTable_dataWritten()"); TableName tableName = createNewTable(admin); try { writeThroughDataflow(tableName, INSERT_COUNT); checkTableRowCount(tableName, INSERT_COUNT); } finally { admin.deleteTable(tableName); } } }

Target:
public void testWriteToTable_dataWritten() throws Exception { final int INSERT_COUNT = 50; try (Admin admin = connection.getAdmin()) { LOG.info("Creating table in testWriteToTable_dataWritten()"); TableName tableName = createNewTable(admin); try { writeThroughDataflow(tableName, INSERT_COUNT); checkTableRowCount(tableName, INSERT_COUNT); } finally { admin.deleteTable(tableName); } } }
Source:
public Factories.LeaderPingerFactory leaderPingerFactory() { return leaderPingerFactoryBuilder().from(this).build(); }

Target:
public Factories.LeaderPingerFactoryContainer leaderPingerFactory() { return leaderPingerFactoryBuilder().from(this).build(); }
Source:
public boolean setEnableAutoJoinWhenAssociated(boolean enabled) { enforceChangePermission(); mLog.trace("setEnableAutoJoinWhenAssociated uid=%").c(Binder.getCallingUid()).flush(); return mWifiStateMachine.setEnableAutoJoinWhenAssociated(enabled); }

Target:
public boolean setEnableAutoJoinWhenAssociated(boolean enabled) { enforceChangePermission(); mLog.trace("setEnableAutoJoinWhenAssociated uid=% enabled=%") .c(Binder.getCallingUid()) .c(enabled ? "true" : "false").flush(); return mWifiStateMachine.setEnableAutoJoinWhenAssociated(enabled); }
Source:
private void initDetachableFields() { detachableMemSizeEditor = new EntityModelDetachableWidgetWithLabel(memSizeEditor); isHighlyAvailableEditorWithDetachable = new EntityModelDetachableWidget(isHighlyAvailableEditor, Align.RIGHT); overrideMigrationDowntimeEditorWithDetachable = new EntityModelDetachableWidget(overrideMigrationDowntimeEditor, Align.RIGHT); overrideMigrationDowntimeEditor.getContentWidgetContainer().getElement().getStyle().setWidth(20, Unit.PX); migrationModeEditorWithDetachable = new EntityModelDetachableWidget(migrationModeEditor, Align.RIGHT); migrationModeEditor.getContentWidgetContainer().getElement().getStyle().setWidth(300, Unit.PX); StringEntityModelLabel rnglabel = new StringEntityModelLabel(); rnglabel.setText(constants.rngDevEnabled()); isRngEnabledCheckboxWithInfoIcon = new EntityModelWidgetWithInfo<String>(rnglabel, isRngEnabledEditor); isRngEnabledCheckboxWithInfoIcon.setExplanation(SafeHtmlUtils.fromTrustedString(constants.rngDevExplanation())); }

Target:
private void initDetachableFields() { detachableMemSizeEditor = new EntityModelDetachableWidgetWithLabel(memSizeEditor); isHighlyAvailableEditorWithDetachable = new EntityModelDetachableWidget(isHighlyAvailableEditor, Align.RIGHT); overrideMigrationDowntimeEditorWithDetachable = new EntityModelDetachableWidget(overrideMigrationDowntimeEditor, Align.IGNORE); overrideMigrationDowntimeEditorWithDetachable.setupContentWrapper(Align.RIGHT); overrideMigrationDowntimeEditor.getContentWidgetContainer().getElement().getStyle().setWidth(20, Unit.PX); migrationModeEditorWithDetachable = new EntityModelDetachableWidget(migrationModeEditor, Align.IGNORE); migrationModeEditorWithDetachable.setupContentWrapper(Align.RIGHT); StringEntityModelLabel rnglabel = new StringEntityModelLabel(); rnglabel.setText(constants.rngDevEnabled()); isRngEnabledCheckboxWithInfoIcon = new EntityModelWidgetWithInfo<String>(rnglabel, isRngEnabledEditor); isRngEnabledCheckboxWithInfoIcon.setExplanation(SafeHtmlUtils.fromTrustedString(constants.rngDevExplanation())); }
Source:
AzureFileSystem(AzureFileSystemProvider parentFileSystemProvider, String accountName, Map<String, ?> config) throws IOException { if (Objects.isNull(parentFileSystemProvider)) { throw new IllegalArgumentException("AzureFileSystem cannot be instantiated without a parent " + "FileSystemProvider"); } this.parentFileSystemProvider = parentFileSystemProvider; try { this.blobServiceClient = this.buildBlobServiceClient(accountName, config); this.blockSize = (Integer) config.get(AZURE_STORAGE_BLOCK_SIZE); this.downloadResumeRetries = (Integer) config.get(AZURE_STORAGE_DOWNLOAD_RESUME_RETRIES); } catch (Exception e) { throw new IllegalArgumentException("There was an error parsing the configurations map. Please ensure all" + "fields are set to a legal value of the correct type."); } try { this.fileStores = this.initializeFileStores(config); } catch (IOException e) { throw new IOException("Initializing FileStores failed. FileSystem could not be opened.", e); } this.closed = false; }

Target:
AzureFileSystem(AzureFileSystemProvider parentFileSystemProvider, String accountName, Map<String, ?> config) throws IOException { if (Objects.isNull(parentFileSystemProvider)) { throw Utility.logError(logger, new IllegalArgumentException("AzureFileSystem cannot be instantiated" + " without a parent FileSystemProvider")); } this.parentFileSystemProvider = parentFileSystemProvider; try { this.blobServiceClient = this.buildBlobServiceClient(accountName, config); this.blockSize = (Integer) config.get(AZURE_STORAGE_UPLOAD_BLOCK_SIZE); this.downloadResumeRetries = (Integer) config.get(AZURE_STORAGE_DOWNLOAD_RESUME_RETRIES); } catch (Exception e) { throw Utility.logError(logger, new IllegalArgumentException("There was an error parsing the configurations " + "map. Please ensure all fields are set to a legal value of the correct type.")); } try { this.fileStores = this.initializeFileStores(config); } catch (IOException e) { throw Utility.logError(logger, new IOException("Initializing FileStores failed. FileSystem could not be opened.", e)); } this.closed = false; }
Source:
public ScalarFunctionImplementation specialize(BoundVariables boundVariables, int arity, TypeManager typeManager, FunctionRegistry functionRegistry) { Type fromType = boundVariables.getTypeVariable("F"); Type toType = boundVariables.getTypeVariable("T"); Class<?> returnType = Primitives.wrap(toType.getJavaType()); List<ArgumentProperty> argumentProperties; MethodHandle tryCastHandle; if (fromType.equals(UNKNOWN)) { argumentProperties = ImmutableList.of(valueTypeArgumentProperty(USE_BOXED_TYPE)); tryCastHandle = dropArguments(constant(returnType, null), 0, Boolean.class); } else { Signature signature = functionRegistry.getCoercion(fromType, toType); ScalarFunctionImplementation implementation = functionRegistry.getScalarFunctionImplementation(signature); argumentProperties = ImmutableList.of(implementation.getArgumentProperty(0)); MethodHandle coercion = implementation.getMethodHandle(); coercion = coercion.asType(methodType(returnType, coercion.type())); MethodHandle exceptionHandler = dropArguments(constant(returnType, null), 0, RuntimeException.class); tryCastHandle = catchException(coercion, RuntimeException.class, exceptionHandler); } return new ScalarFunctionImplementation(true, argumentProperties, tryCastHandle, isDeterministic()); }

Target:
public ScalarFunctionImplementation specialize(BoundVariables boundVariables, int arity, TypeManager typeManager, FunctionRegistry functionRegistry) { Type fromType = boundVariables.getTypeVariable("F"); Type toType = boundVariables.getTypeVariable("T"); Class<?> returnType = Primitives.wrap(toType.getJavaType()); List<ArgumentProperty> argumentProperties; MethodHandle tryCastHandle; Signature signature = functionRegistry.getCoercion(fromType, toType); ScalarFunctionImplementation implementation = functionRegistry.getScalarFunctionImplementation(signature); argumentProperties = ImmutableList.of(implementation.getArgumentProperty(0)); MethodHandle coercion = implementation.getMethodHandle(); coercion = coercion.asType(methodType(returnType, coercion.type())); MethodHandle exceptionHandler = dropArguments(constant(returnType, null), 0, RuntimeException.class); tryCastHandle = catchException(coercion, RuntimeException.class, exceptionHandler); return new ScalarFunctionImplementation(true, argumentProperties, tryCastHandle, isDeterministic()); }
Source:
void resourceNegotiationRequestReceived( JID remoteAddress, List<ResourceNegotiationData> resourceNegotiationData, String negotiationID) { INegotiationHandler handler = negotiationHandler; if (handler == null) { log.warn("could not accept resource negotiation because no handler is installed"); return; } AbstractIncomingResourceNegotiation negotiation; synchronized (this) { if (!startStopSessionLock.tryLock()) { log.warn( "could not accept resource negotiation because the current session is about to stop"); return; } ResourceNegotiationFactory currentResourceNegotiationFactory = resourceNegotiationFactory; if (currentResourceNegotiationFactory == null) { log.warn( "could not accept resource negotiation because no resource negotiation factory is present"); return; } try { negotiation = currentResourceNegotiationFactory.newIncomingResourceNegotiation( remoteAddress, negotiationID, resourceNegotiationData, this, session); negotiation.setNegotiationListener(negotiationListener); currentResourceNegotiations.add(negotiation); } finally { startStopSessionLock.unlock(); } } handler.handleIncomingResourceNegotiation(negotiation); }

Target:
void resourceNegotiationRequestReceived( JID remoteAddress, List<ResourceNegotiationData> resourceNegotiationData, String negotiationID) { INegotiationHandler handler = negotiationHandler; if (handler == null) { log.warn("could not accept resource negotiation because no handler is installed"); return; } AbstractIncomingResourceNegotiation negotiation; synchronized (this) { if (!startStopSessionLock.tryLock()) { log.warn( "could not accept resource negotiation because the current session is about to stop"); return; } ResourceNegotiationFactory currentResourceNegotiationFactory = resourceNegotiationFactory; if (currentResourceNegotiationFactory == null) { log.warn("could not accept resource negotiation as no session is running"); return; } try { negotiation = currentResourceNegotiationFactory.newIncomingResourceNegotiation( remoteAddress, negotiationID, resourceNegotiationData, this, session); negotiation.setNegotiationListener(negotiationListener); currentResourceNegotiations.add(negotiation); } finally { startStopSessionLock.unlock(); } } handler.handleIncomingResourceNegotiation(negotiation); }
Source:
public boolean initializeContainerInfo() { this.imageMeta = lookupImageMetadata(); if (this.imageMeta == null) { return false; } final List<EnvironmentVariable> envVars = this.imageMeta.env().stream().map(env -> env.split("=")) .map(splittedEnv -> new EnvironmentVariable(splittedEnv[0], splittedEnv[1])) .collect(Collectors.toList()); setEnvironmentVariables(envVars); final List<IPort> portSpecs = this.imageMeta.exposedPorts().stream().map(spec -> new PortSpecAdapter(spec)) .collect(Collectors.toList()); setPortSpecs(portSpecs); setVolumes(new ArrayList<>(this.imageMeta.volumes())); setReplicas(DEFAULT_REPLICA_COUNT); return true; }

Target:
public boolean initializeContainerInfo() { this.imageMeta = lookupImageMetadata(); if (this.imageMeta == null) { return false; } final List<EnvironmentVariable> envVars = this.imageMeta.env().stream().filter(env -> env.indexOf('=') != -1) .map(env -> env.split("=")).map(splittedEnv -> new EnvironmentVariable(splittedEnv[0], splittedEnv[1])) .collect(Collectors.toList()); setEnvironmentVariables(envVars); final List<IPort> portSpecs = this.imageMeta.exposedPorts().stream().map(spec -> new PortSpecAdapter(spec)) .collect(Collectors.toList()); setPortSpecs(portSpecs); if(this.imageMeta.volumes() != null && !this.imageMeta.volumes().isEmpty()) { setVolumes(new ArrayList<>(this.imageMeta.volumes())); } else { setVolumes(new ArrayList<>()); } setReplicas(DEFAULT_REPLICA_COUNT); return true; }
Source:
public Converter<ResponseBody, ?> responseBodyConverter(Type type, Annotation[] annotations, Retrofit retrofit) { JsonAdapter<?> adapter = moshi.adapter(type, jsonAnnotations(annotations)); if (lenient) { adapter = adapter.lenient(); } if (failOnUnknown) { adapter.failOnUnknown(); } return new MoshiResponseBodyConverter<>(adapter); }

Target:
public Converter<ResponseBody, ?> responseBodyConverter(Type type, Annotation[] annotations, Retrofit retrofit) { JsonAdapter<?> adapter = moshi.adapter(type, jsonAnnotations(annotations)); if (lenient) { adapter = adapter.lenient(); } if (failOnUnknown) { adapter = adapter.failOnUnknown(); } return new MoshiResponseBodyConverter<>(adapter); }