auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void checkPool() throws Exception { AbstractPool pool = getPool(); assertEquals(pool.getManagedConnectionPools().size(), 0); SimpleConnection[] simpleConnections = fillPoolToSize(5); String[] mcHashes = new String[5]; for (int i = 0; i < 5; i++) { SimpleConnection sc = simpleConnections[i]; SimpleConnectionImpl sci = (SimpleConnectionImpl) sc; mcHashes[i] = sci.getManagedConnection().toString(); } assertEquals(pool.getManagedConnectionPools().size(), 1); PoolStatistics ps = pool.getStatistics(); checkStatistics(ps, 5, 0, 5); ManagedConnectionPool mcp = pool.getManagedConnectionPools().values().iterator().next(); callRemoveIdleConnections(mcp); checkStatistics(ps, 5, 0, 2, 3); callRemoveIdleConnections(mcp); checkStatistics(ps, 5, 0, 2, 3); simpleConnections = fillPoolToSize(5); String[] mcHashesAfterIdleConnectionCleanup = new String[5]; for (int i = 0; i < 5; i++) { SimpleConnection sc = simpleConnections[i]; SimpleConnectionImpl sci = (SimpleConnectionImpl) sc; mcHashesAfterIdleConnectionCleanup[i] = sci.getManagedConnection().toString(); } assertEquals(mcHashes[3], mcHashesAfterIdleConnectionCleanup[0]); assertEquals(mcHashes[4], mcHashesAfterIdleConnectionCleanup[1]); }

Target:
public void checkPool() throws Exception { AbstractPool pool = getPool(); assertEquals(pool.getManagedConnectionPools().size(), 0); String[] mcsIds = fillPoolToSize(5);; assertEquals(pool.getManagedConnectionPools().size(), 1); PoolStatistics ps = pool.getStatistics(); checkStatistics(ps, 5, 0, 5); ManagedConnectionPool mcp = pool.getManagedConnectionPools().values().iterator().next(); callRemoveIdleConnections(mcp); checkStatistics(ps, 5, 0, 2, 3); callRemoveIdleConnections(mcp); checkStatistics(ps, 5, 0, 2, 3); String[] mcsIdsAfterIdleConnectionCleanup = fillPoolToSize(5);; assertEquals(mcsIds[3], mcsIdsAfterIdleConnectionCleanup[0]); assertEquals(mcsIds[4], mcsIdsAfterIdleConnectionCleanup[1]); assertEquals("SimpleManagedConnection #5", mcsIdsAfterIdleConnectionCleanup[2]); assertEquals("SimpleManagedConnection #6", mcsIdsAfterIdleConnectionCleanup[3]); assertEquals("SimpleManagedConnection #7", mcsIdsAfterIdleConnectionCleanup[4]); }
Source:
public void setupMocks() { MockitoAnnotations.initMocks(this); doReturn(macPoolManagerStrategy).when(vmInterfaceManager).getMacPoolManager(Mockito.any(Guid.class)); doReturn(vmNetworkStatisticsDAO).when(vmInterfaceManager).getVmNetworkStatisticsDao(); doReturn(vmNetworkInterfaceDAO).when(vmInterfaceManager).getVmNetworkInterfaceDao(); doReturn(vmNicDao).when(vmInterfaceManager).getVmNicDao(); doReturn(vmDAO).when(vmInterfaceManager).getVmDAO(); doNothing().when(vmInterfaceManager).auditLogMacInUseUnplug(any(VmNic.class)); doNothing().when(vmInterfaceManager).removeFromExternalNetworks(anyList()); doNothing().when(vmInterfaceManager).log(any(AuditLogableBase.class), any(AuditLogType.class)); }

Target:
public void setupMocks() { MockitoAnnotations.initMocks(this); doReturn(vmNetworkStatisticsDAO).when(vmInterfaceManager).getVmNetworkStatisticsDao(); doReturn(vmNetworkInterfaceDAO).when(vmInterfaceManager).getVmNetworkInterfaceDao(); doReturn(vmNicDao).when(vmInterfaceManager).getVmNicDao(); doReturn(vmDAO).when(vmInterfaceManager).getVmDAO(); doNothing().when(vmInterfaceManager).auditLogMacInUseUnplug(any(VmNic.class)); doNothing().when(vmInterfaceManager).removeFromExternalNetworks(anyList()); doNothing().when(vmInterfaceManager).log(any(AuditLogableBase.class), any(AuditLogType.class)); vmInterfaceManager.setMacPool(macPoolManagerStrategy); }
Source:
public AlleleFractionSegmenter(final int initialNumStates, final AllelicCountCollection acc, final AllelicPanelOfNormals allelicPoN) { super(initialNumStates, acc.getCounts().stream().map(AllelicCount::getInterval).collect(Collectors.toList()), acc.getCounts(), initialMinorFractions(initialNumStates)); this.allelicPoN = Utils.nonNull(allelicPoN); biasParameters = new AlleleFractionGlobalParameters(INITIAL_MEAN_ALLELIC_BIAS, INITIAL_ALLELIC_BIAS_VARIANCE, INITIAL_OUTLIER_PROBABILITY); }

Target:
public AlleleFractionSegmenter(final int initialNumStates, final AllelicCountCollection acc, final AllelicPanelOfNormals allelicPoN) { super(acc.getCounts().stream().map(AllelicCount::getInterval).collect(Collectors.toList()), acc.getCounts(), NEUTRAL_MINOR_ALLELE_FRACTION, initialNonConstantMinorFractions(initialNumStates - 1)); this.allelicPoN = Utils.nonNull(allelicPoN); globalParameters = new AlleleFractionGlobalParameters(INITIAL_MEAN_ALLELIC_BIAS, INITIAL_ALLELIC_BIAS_VARIANCE, INITIAL_OUTLIER_PROBABILITY); }
Source:
public ValueDistributionAnalyzerResult reduce(Collection<? extends ValueDistributionAnalyzerResult> analyzerResults) { final ValueCountList topValues = ValueCountListImpl.emptyList(); final Collection<String> uniqueValues = Collections.emptyList(); final Map<String, RowAnnotation> annotations = Collections.emptyMap(); final InputColumn<?>[] highlightedColumns = null; SingleValueDistributionResult reducedResult = new SingleValueDistributionResult(null, topValues, uniqueValues, 0, 0, 0, annotations, new RowAnnotationImpl(), _rowAnnotationFactory, highlightedColumns); for (ValueDistributionAnalyzerResult partialResult : analyzerResults) { if (partialResult instanceof SingleValueDistributionResult) { final SingleValueDistributionResult singleResult = (SingleValueDistributionResult) partialResult; reducedResult = reduceSingleResult(annotations, highlightedColumns, reducedResult, singleResult); } else if (partialResult instanceof GroupedValueDistributionResult) { GroupedValueDistributionResult groupedResult = (GroupedValueDistributionResult) partialResult; for (ValueCountingAnalyzerResult valueCountingResult : groupedResult.getGroupResults()) { if (valueCountingResult instanceof SingleValueDistributionResult) { SingleValueDistributionResult singleResult = (SingleValueDistributionResult) valueCountingResult; reducedResult = reduceSingleResult(annotations, highlightedColumns, reducedResult, singleResult); } else { throw new IllegalStateException("Expected " + SingleValueDistributionResult.class.getSimpleName() + ", but encountered " + valueCountingResult.getClass().getSimpleName()); } } } else { throw new IllegalStateException("Unsupported type of " + ValueDistributionAnalyzerResult.class.getSimpleName() + ": " + partialResult.getClass().getSimpleName()); } } return reducedResult; }

Target:
public ValueDistributionAnalyzerResult reduce(Collection<? extends ValueDistributionAnalyzerResult> analyzerResults) { final Map<String, RowAnnotation> annotations = Collections.emptyMap(); ValueDistributionAnalyzerResult reducedResult = null; for (ValueDistributionAnalyzerResult partialResult : analyzerResults) { if (partialResult instanceof SingleValueDistributionResult) { final SingleValueDistributionResult singleReducedResult = (SingleValueDistributionResult) reducedResult; final SingleValueDistributionResult singlePartialResult = (SingleValueDistributionResult) partialResult; reducedResult = reduceSingleResult(annotations, singlePartialResult.getHighlightedColumns(), singleReducedResult, singlePartialResult); } else if (partialResult instanceof GroupedValueDistributionResult) { final GroupedValueDistributionResult groupedReducedResult = (GroupedValueDistributionResult) reducedResult; final GroupedValueDistributionResult groupedPartialResult = (GroupedValueDistributionResult) partialResult; reducedResult = reduceGroupedResult(annotations, groupedReducedResult, groupedPartialResult); } else { throw new IllegalStateException("Unsupported type of " + ValueDistributionAnalyzerResult.class.getSimpleName() + ": " + partialResult.getClass().getSimpleName()); } } return reducedResult; }
Source:
public Object invoke(final Object proxy, final Method method, final Object[] args) throws Throwable { String groupKey = this.target.name(); String commandKey = method.getName(); HystrixCommand.Setter setter = HystrixCommand.Setter .withGroupKey(HystrixCommandGroupKey.Factory.asKey(groupKey)) .andCommandKey(HystrixCommandKey.Factory.asKey(commandKey)); HystrixCommand<Object> hystrixCommand = new HystrixCommand<Object>(setter) { @Override protected Object run() throws Exception { try { return HystrixInvocationHandler.this.dispatch.get(method).invoke(args); } catch (Exception e) { throw e; } catch (Throwable t) { throw (Error)t; } } }; if (HystrixCommand.class.isAssignableFrom(method.getReturnType())) { return hystrixCommand; } else if (Observable.class.isAssignableFrom(method.getReturnType())) { return hystrixCommand.toObservable(); } return hystrixCommand.execute(); }

Target:
public Object invoke(final Object proxy, final Method method, final Object[] args) throws Throwable { String groupKey = this.target.name(); String commandKey = method.getName(); HystrixCommand.Setter setter = HystrixCommand.Setter .withGroupKey(HystrixCommandGroupKey.Factory.asKey(groupKey)) .andCommandKey(HystrixCommandKey.Factory.asKey(commandKey)); HystrixCommand<Object> hystrixCommand = new HystrixCommand<Object>(setter) { @Override protected Object run() throws Exception { try { return HystrixInvocationHandler.this.dispatch.get(method).invoke(args); } catch (Exception e) { throw e; } catch (Throwable t) { throw (Error)t; } } }; if (HystrixCommand.class.isAssignableFrom(method.getReturnType())) { return hystrixCommand; } else if (Observable.class.isAssignableFrom(method.getReturnType())) { return hystrixCommand.toObservable(); } else if (Single.class.isAssignableFrom(method.getReturnType())) { return hystrixCommand.toObservable().toSingle(); } return hystrixCommand.execute(); }
Source:
public void setPushShuffleListener(final PushShuffleListener pushShuffleListener) { this.pushShuffleListener = pushShuffleListener; }

Target:
public synchronized void setPushShuffleListener(final PushShuffleListener pushShuffleListener) { this.pushShuffleListener = pushShuffleListener; }
Source:
public BranchConfigurationDialog(Shell shell, String branchName, Repository repository) { super(shell); myBranchName = branchName; myRepository = repository; myConfig = myRepository.getConfig(); setShellStyle(getShellStyle() | SWT.SHELL_TRIM); myTitle = "Branch Configuration"; setHelpAvailable(false); }

Target:
public BranchConfigurationDialog(Shell shell, String branchName, Repository repository) { super(shell); myBranchName = branchName; myRepository = repository; myConfig = myRepository.getConfig(); setShellStyle(getShellStyle() | SWT.SHELL_TRIM); myTitle = UIText.BranchConfigurationDialog_BranchConfiguration; setHelpAvailable(false); }
Source:
private static GeneratedHttpRequest stripExpectHeaderIfContentZero(GeneratedHttpRequest request) { boolean isBodyEmpty = false; if (request.getPayload() != null) { Long length = request.getPayload().getContentMetadata().getContentLength(); if (length != null && length == 0) { isBodyEmpty = true; } } else { isBodyEmpty = true; } if (isBodyEmpty) { request = request.toBuilder().removeHeader("Expect").build(); } return request; }

Target:
private static GeneratedHttpRequest stripExpectHeaderIfContentZero(GeneratedHttpRequest request) { boolean isBodyEmpty = true; if (request.getPayload() != null) { Long length = request.getPayload().getContentMetadata().getContentLength(); isBodyEmpty = length != null && length == 0; } if (isBodyEmpty) { request = request.toBuilder().removeHeader("Expect").build(); } return request; }
Source:
public boolean onOptionsItemSelected(final MenuItem item) { if (item.getItemId() == android.R.id.home) { onBackPressed(); return true; } else if (item.getItemId() == R.id.remove_person) { confirmRemovePerson(); return true; } else if (item.getItemId() == R.id.invite) { FragmentManager fragmentManager = getFragmentManager(); Fragment peopleInviteFragment = fragmentManager.findFragmentByTag(KEY_PERSON_DETAIL_FRAGMENT); if (peopleInviteFragment == null) { Blog blog = WordPress.getCurrentBlog(); String dotComBlogId = blog.getDotComBlogId(); if (dotComBlogId != null && !dotComBlogId.isEmpty()) { peopleInviteFragment = PeopleInviteFragment.newInstance(dotComBlogId); } else { AppLog.e(T.PEOPLE, "getDotComBlogId() returned null or empty string!"); ToastUtils.showToast(this, R.string.error_generic).show(); } } if (peopleInviteFragment != null && !peopleInviteFragment.isAdded()) { FragmentTransaction fragmentTransaction = getFragmentManager().beginTransaction(); fragmentTransaction.replace(R.id.fragment_container, peopleInviteFragment, KEY_PEOPLE_INVITE_FRAGMENT); fragmentTransaction.addToBackStack(null); fragmentTransaction.commit(); } } else if (item.getItemId() == R.id.send_invitation) { FragmentManager fragmentManager = getFragmentManager(); Fragment peopleInviteFragment = fragmentManager.findFragmentByTag(KEY_PEOPLE_INVITE_FRAGMENT); if (peopleInviteFragment != null) { ((InvitationSender) peopleInviteFragment).send(); } } return super.onOptionsItemSelected(item); }

Target:
public boolean onOptionsItemSelected(final MenuItem item) { if (item.getItemId() == android.R.id.home) { onBackPressed(); return true; } else if (item.getItemId() == R.id.remove_person) { confirmRemovePerson(); return true; } else if (item.getItemId() == R.id.invite) { FragmentManager fragmentManager = getFragmentManager(); Fragment peopleInviteFragment = fragmentManager.findFragmentByTag(KEY_PERSON_DETAIL_FRAGMENT); if (peopleInviteFragment == null) { Blog blog = WordPress.getCurrentBlog(); String dotComBlogId = blog.getDotComBlogId(); if (!TextUtils.isEmpty(dotComBlogId)) { peopleInviteFragment = PeopleInviteFragment.newInstance(dotComBlogId); } else { String blogUrl = blog.getUrl(); AppLog.e(T.PEOPLE, "getDotComBlogId() returned null or empty string! Blog URL: " + (blogUrl == null ? "null" : blogUrl)); ToastUtils.showToast(this, R.string.error_generic).show(); } } if (peopleInviteFragment != null && !peopleInviteFragment.isAdded()) { FragmentTransaction fragmentTransaction = getFragmentManager().beginTransaction(); fragmentTransaction.replace(R.id.fragment_container, peopleInviteFragment, KEY_PEOPLE_INVITE_FRAGMENT); fragmentTransaction.addToBackStack(null); fragmentTransaction.commit(); } } else if (item.getItemId() == R.id.send_invitation) { FragmentManager fragmentManager = getFragmentManager(); Fragment peopleInviteFragment = fragmentManager.findFragmentByTag(KEY_PEOPLE_INVITE_FRAGMENT); if (peopleInviteFragment != null) { ((InvitationSender) peopleInviteFragment).send(); } } return super.onOptionsItemSelected(item); }
Source:
public void initializeDatastream(Datastream stream, List<Datastream> allDatastreams) throws DatastreamValidationException { if (stream == null || stream.getSource() == null) { throw new DatastreamValidationException("Failed to get source from datastream."); } stream.getMetadata().putAll(_config); }

Target:
public void initializeDatastream(Datastream stream, List<Datastream> allDatastreams) throws DatastreamValidationException { if (stream == null || stream.getSource() == null) { throw new DatastreamValidationException("Failed to get source from datastream."); } if (!stream.hasMetadata()) { stream.getMetadata().putAll(_config); } }
Source:
public static List<LogEntry> toSlowLogPayloads( final HBaseProtos.LogEntry logEntry) { try { final String logClassName = logEntry.getLogClassName(); Class<?> logClass = Class.forName(logClassName).asSubclass(Message.class); Method method = logClass.getMethod("parseFrom", ByteString.class); if (logClassName.contains("SlowLogResponses")) { AdminProtos.SlowLogResponses slowLogResponses = (AdminProtos.SlowLogResponses) method .invoke(null, logEntry.getLogInitializerMessage()); return slowLogResponses.getSlowLogPayloadsList().stream() .map(ProtobufUtil::getSlowLogRecord).collect(Collectors.toList()); } } catch (ClassNotFoundException | NoSuchMethodException | IllegalAccessException | InvocationTargetException e) { throw new RuntimeException("Error while retrieving response from server"); } throw new RuntimeException("Invalid response from server"); }

Target:
public static List<LogEntry> toSlowLogPayloads( final HBaseProtos.LogEntry logEntry) { try { final String logClassName = logEntry.getLogClassName(); Class<?> logClass = Class.forName(logClassName).asSubclass(Message.class); Method method = logClass.getMethod("parseFrom", ByteString.class); if (logClassName.contains("SlowLogResponses")) { AdminProtos.SlowLogResponses slowLogResponses = (AdminProtos.SlowLogResponses) method .invoke(null, logEntry.getLogMessage()); return slowLogResponses.getSlowLogPayloadsList().stream() .map(ProtobufUtil::getSlowLogRecord).collect(Collectors.toList()); } } catch (ClassNotFoundException | NoSuchMethodException | IllegalAccessException | InvocationTargetException e) { throw new RuntimeException("Error while retrieving response from server"); } throw new RuntimeException("Invalid response from server"); }
Source:
public DecoratedCache(AdvancedCache<K, V> delegate, ClassLoader classLoader) { this(delegate, classLoader, null, null); }

Target:
public DecoratedCache(AdvancedCache<K, V> delegate, ClassLoader classLoader) { this(delegate, classLoader, null); }
Source:
static String encodeUriParts(final String uri) throws UnsupportedEncodingException { String[] uriParts = uri.split("/"); for (int i = 3; i < uriParts.length; i++) { uriParts[i] = URLEncoder.encode(uriParts[i], SFTP_URL_ENCODING); } return StringUtils.join(uriParts, "/"); }

Target:
static String encodeUriParts(final String uri) throws UnsupportedEncodingException { String[] uriParts = uri.split("/"); for (int i = FIRST_SUB_PATH_INDEX; i < uriParts.length; i++) { uriParts[i] = URLEncoder.encode(uriParts[i], SFTP_URL_ENCODING); } return StringUtils.join(uriParts, "/"); }
Source:
public String getLocationPayload() { Location deviceLocation = locationService.getLastKnownLocation(); String locationString = null; if (deviceLocation != null) { double latitude = deviceLocation.getLatitude(); double longitude = deviceLocation.getLongitude(); if (latitude != 0 && longitude != 0) { locationString = "{" + Constants.LocationInfo.LATITUDE + ":" + latitude + "," + Constants.LocationInfo.LONGITUDE + ":" + longitude + "," + Constants.LocationInfo.TIME_STAMP + ":" + new Date().getTime() + "}"; } } return locationString; }

Target:
public String getLocationPayload() { Location deviceLocation = locationService.getLastKnownLocation(); String locationString = null; if (deviceLocation != null) { double latitude = deviceLocation.getLatitude(); double longitude = deviceLocation.getLongitude(); if (latitude != 0 && longitude != 0) { JSONObject locationObject = new JSONObject(); try { locationObject.put(Constants.LocationInfo.LATITUDE, latitude); locationObject.put(Constants.LocationInfo.LONGITUDE, longitude); locationObject.put(Constants.LocationInfo.TIME_STAMP, new Date().getTime()); locationString = locationObject.toString(); } catch (JSONException e) { Log.e(TAG, "Error occured while creating a location payload for location event publishing", e); } } } return locationString; }
Source:
public void insert(DbSession session, AnalysisPropertyDto analysisPropertyDto) { checkArgument(analysisPropertyDto.getUuid() != null, "uuid cannot be null"); checkArgument(analysisPropertyDto.getKey() != null, "key cannot be null"); checkArgument(analysisPropertyDto.getSnapshotUuid() != null, "snapshot uuid cannot be null"); checkArgument(analysisPropertyDto.getValue() != null, "value cannot be null"); String value = analysisPropertyDto.getValue(); long now = system2.now(); if (isEmpty(value)) { getMapper(session).insertAsEmpty(analysisPropertyDto, now); } else if (mustBeStoredInClob(value)) { getMapper(session).insertAsClob(analysisPropertyDto, now); } else { getMapper(session).insertAsText(analysisPropertyDto, now); } }

Target:
public void insert(DbSession session, AnalysisPropertyDto analysisPropertyDto) { requireNonNull(analysisPropertyDto.getUuid(), "uuid cannot be null"); requireNonNull(analysisPropertyDto.getKey(), "key cannot be null"); requireNonNull(analysisPropertyDto.getSnapshotUuid(), "snapshot uuid cannot be null"); requireNonNull(analysisPropertyDto.getValue(), "value cannot be null"); String value = analysisPropertyDto.getValue(); long now = system2.now(); if (isEmpty(value)) { getMapper(session).insertAsEmpty(analysisPropertyDto, now); } else if (mustBeStoredInClob(value)) { getMapper(session).insertAsClob(analysisPropertyDto, now); } else { getMapper(session).insertAsText(analysisPropertyDto, now); } }
Source:
protected void onShowErrata() { logger.info(this.getClass().toString() + " onShowErrata"); if (getWindow() != null) { return; } HostErrataCountModel transferObj = new HostErrataCountModel(); transferObj.setTitle(messages.errataForHost(getName())); transferObj.setGuid(getGuid()); transferObj.setName(getName()); setWindow(transferObj); initCommands(transferObj); }

Target:
protected void onShowErrata() { if (getWindow() != null) { return; } HostErrataCountModel transferObj = new HostErrataCountModel(); transferObj.setTitle(messages.errataForHost(getName())); transferObj.setGuid(getGuid()); transferObj.setName(getName()); setWindow(transferObj); initCommands(transferObj); }
Source:
public T withFactor(final IProperty<Double> spacingOption, final double factor) { if (!factorMap.keySet().contains(spacingOption)) { throw new IllegalArgumentException( "'" + spacingOption.getId() + "' is not a configurable spacing option."); } if (spacingOption.getId().equals(getBaseSpacingOption().getId())) { throw new IllegalArgumentException("'" + spacingOption.getId() + "' is the base spacing option not allowed to use with 'withFactor'."); } factorMap.put(spacingOption, factor); return thisT(); }

Target:
public T withFactor(final IProperty<Double> spacingOption, final double factor) { if (!factorMap.keySet().contains(spacingOption)) { throw new IllegalArgumentException( "'" + spacingOption.getId() + "' is not a configurable spacing option."); } if (factor < 0.0) { throw new IllegalArgumentException( "The factor for '" + spacingOption.getId() + "' must not be negative (" + factor + ")."); } if (spacingOption.getId().equals(getBaseSpacingOption().getId())) { throw new IllegalArgumentException("'" + spacingOption.getId() + "' is the base spacing option not allowed to use with 'withFactor'."); } factorMap.put(spacingOption, factor); return thisT(); }
Source:
public void testQueriesFromQueryFile() throws Exception { URL resourceUrl = BaseClusterIntegrationTestSet.class.getClassLoader().getResource(getQueryFileName()); assertNotNull(resourceUrl); File queryFile = new File(resourceUrl.getFile()); try (BufferedReader reader = new BufferedReader(new FileReader(queryFile))) { while (true) { String queryString = reader.readLine(); if (queryString == null) { return; } if (queryString.startsWith("#") || queryString.isEmpty()) { continue; } JsonNode query = JsonUtils.stringToJsonNode(queryString); String pqlQuery = query.get("pql").asText(); JsonNode hsqls = query.get("hsqls"); List<String> sqlQueries = new ArrayList<>(); int length = hsqls.size(); for (int i = 0; i < length; i++) { sqlQueries.add(hsqls.get(i).asText()); } testQuery(pqlQuery, sqlQueries); } } }

Target:
public void testQueriesFromQueryFile() throws Exception { URL resourceUrl = BaseClusterIntegrationTestSet.class.getClassLoader().getResource(getQueryFileName()); assertNotNull(resourceUrl); File queryFile = new File(resourceUrl.getFile()); try (BufferedReader reader = new BufferedReader(new FileReader(queryFile))) { String queryString; while ((queryString = reader.readLine()) != null) { queryString = queryString.trim(); if (queryString.startsWith("#") || queryString.isEmpty()) { continue; } JsonNode query = JsonUtils.stringToJsonNode(queryString); String pqlQuery = query.get("pql").asText(); JsonNode hsqls = query.get("hsqls"); List<String> sqlQueries = new ArrayList<>(); int length = hsqls.size(); for (int i = 0; i < length; i++) { sqlQueries.add(hsqls.get(i).asText()); } testQuery(pqlQuery, sqlQueries); } } }
Source:
SimpleAjaxLink createFixCRSLink(String id, final IModel<ImportTask> itemModel) { return new SimpleAjaxLink(id, new Model("Fix...")) { @Override protected void onClick(AjaxRequestTarget target) { dialog.showOkCancel(target, new DialogDelegate() { @Override protected boolean onSubmit(AjaxRequestTarget target, Component contents) { try { ImporterWebUtils.importer().changed(itemModel.getObject()); } catch (IOException e) { throw new RuntimeException(e); } target.add(ImportTaskTable.this); return true; } @Override protected Component getContents(String id) { return new NoCRSPanel(id, itemModel); } }); } }; }

Target:
SimpleAjaxLink createFixCRSLink(String id, final IModel<ImportTask> itemModel) { return new SimpleAjaxLink(id, new Model("Fix...")) { @Override protected void onClick(AjaxRequestTarget target) { dialog.showOkCancel(target, new DialogDelegate() { @Override protected boolean onSubmit(AjaxRequestTarget target, Component contents) { try { ImporterWebUtils.importer().changed(itemModel.getObject()); } catch (IOException e) { error(e); return false; } target.add(ImportTaskTable.this); return true; } @Override protected Component getContents(String id) { return new NoCRSPanel(id, itemModel); } }); } }; }
Source:
public HttpEntity<?> convertOutbound(Message message, HttpEndpointConfiguration endpointConfiguration, TestContext context) { HttpMessage httpMessage = convertOutboundMessage(message); HttpHeaders httpHeaders = createHttpHeaders(httpMessage, endpointConfiguration); Object payload = httpMessage.getPayload(); if (httpMessage.getStatusCode() != null) { return new ResponseEntity<>(payload, httpHeaders, httpMessage.getStatusCode()); } else { for (Cookie cookie : httpMessage.getCookies()) { httpHeaders.add( "Cookie", cookie.getName() + "=" + context.replaceDynamicContentInString(cookie.getValue())); } } HttpMethod method = determineHttpMethod(endpointConfiguration, httpMessage); return createHttpEntity(httpHeaders, payload, method); }

Target:
public HttpEntity<?> convertOutbound(Message message, HttpEndpointConfiguration endpointConfiguration, TestContext context) { HttpMessage httpMessage = convertOutboundMessage(message); HttpHeaders httpHeaders = createHttpHeaders(httpMessage, endpointConfiguration); Object payload = httpMessage.getPayload(); if (httpMessage.getStatusCode() != null) { return new ResponseEntity<>(payload, httpHeaders, httpMessage.getStatusCode()); } else { for (Cookie cookie : httpMessage.getCookies()) { httpHeaders.add( HttpHeaders.COOKIE, cookie.getName() + "=" + context.replaceDynamicContentInString(cookie.getValue())); } } HttpMethod method = determineHttpMethod(endpointConfiguration, httpMessage); return createHttpEntity(httpHeaders, payload, method); }
Source:
public void updateStatusLabel(String statusMessage) { if (status != ReportStatus.CANCELED) { logger.log(Level.INFO, "Report Progress Logger status update: {0}", statusMessage); } }

Target:
public void updateStatusLabel(String statusMessage) { if (status != ReportStatus.CANCELED) { logger.log(Level.INFO, statusMessage); } }
Source:
public void onReceive(Context context, Intent intent) { Log.d(TAG, "Received intent"); if (intent == null || intent.getExtras() == null) { return; } KeyEvent event = (KeyEvent) intent.getExtras().get(Intent.EXTRA_KEY_EVENT); if (event != null && event.getAction() == KeyEvent.ACTION_DOWN && event.getRepeatCount()==0) { ClientConfig.initialize(context); Intent serviceIntent = new Intent(context, PlaybackService.class); serviceIntent.putExtra(EXTRA_KEYCODE, event.getKeyCode()); serviceIntent.putExtra(EXTRA_SOURCE, event.getSource()); context.startService(serviceIntent); } }

Target:
public void onReceive(Context context, Intent intent) { Log.d(TAG, "Received intent"); if (intent == null || intent.getExtras() == null) { return; } KeyEvent event = (KeyEvent) intent.getExtras().get(Intent.EXTRA_KEY_EVENT); if (event != null && event.getAction() == KeyEvent.ACTION_DOWN && event.getRepeatCount()==0) { ClientConfig.initialize(context); Intent serviceIntent = new Intent(context, PlaybackService.class); serviceIntent.putExtra(EXTRA_KEYCODE, event.getKeyCode()); serviceIntent.putExtra(EXTRA_SOURCE, event.getSource()); ContextCompat.startForegroundService(context, serviceIntent); } }
Source:
public String toString() { return "Offset: " + offset + ", Size: " + getSize() + ", Deleted: " + isFlagSet(Flags.Delete_Index) + ", TTL Updated: " + isFlagSet(Flags.Ttl_Update_Index) + ", Undelete: " + isFlagSet(Flags.Undelete_Index) + ", ExpiresAtMs: " + getExpiresAtMs() + ", Original Message Offset: " + getOriginalMessageOffset() + ( formatVersion != PersistentIndex.VERSION_0 ? (", OperationTimeAtSecs " + getOperationTimeInMs() + ", AccountId " + getAccountId() + ", ContainerId " + getContainerId()) : "") + (formatVersion > PersistentIndex.VERSION_2 ? ", Life Version:" + lifeVersion : ""); }

Target:
public String toString() { return "Offset: " + offset + ", Size: " + getSize() + ", Deleted: " + isDelete() + ", TTL Updated: " + isTTLUpdate() + ", Undelete: " + isUndelete() + ", ExpiresAtMs: " + getExpiresAtMs() + ", Original Message Offset: " + getOriginalMessageOffset() + (formatVersion != PersistentIndex.VERSION_0 ? (", OperationTimeAtSecs " + getOperationTimeInMs() + ", AccountId " + getAccountId() + ", ContainerId " + getContainerId()) : "") + ( formatVersion > PersistentIndex.VERSION_2 ? ", Life Version:" + lifeVersion : ""); }
Source:
public AwsS3EnvironmentRepository build( AwsS3EnvironmentProperties environmentProperties) { final AmazonS3ClientBuilder clientBuilder = AmazonS3ClientBuilder.standard(); if (environmentProperties.getRegion() != null) { clientBuilder.withRegion(environmentProperties.getRegion()); } AwsS3EnvironmentRepository repository = new AwsS3EnvironmentRepository( clientBuilder.build(), environmentProperties.getBucket(), server); return repository; }

Target:
public AwsS3EnvironmentRepository build( AwsS3EnvironmentProperties environmentProperties) { final AmazonS3ClientBuilder clientBuilder = AmazonS3ClientBuilder.standard(); if (environmentProperties.getRegion() != null) { clientBuilder.withRegion(environmentProperties.getRegion()); } final AmazonS3 client = clientBuilder.build(); if (environmentProperties.getEndpoint() != null) { client.setEndpoint(environmentProperties.getEndpoint()); } AwsS3EnvironmentRepository repository = new AwsS3EnvironmentRepository(client, environmentProperties.getBucket(), server); return repository; }
Source:
public List<PartitionDescProto> getPartitionsByAlgebra(PartitionsByAlgebraProto request) throws UndefinedDatabaseException, UndefinedTableException, UndefinedPartitionMethodException, PartitionNotFoundException, UnsupportedException { List<PartitionDescProto> list = null; try { String databaseName = request.getDatabaseName(); String tableName = request.getTableName(); TableDescProto tableDesc = getTable(databaseName, tableName); String filter = getFilter(databaseName, tableName, tableDesc.getPartition().getExpressionSchema().getFieldsList() , request.getAlgebra()); list = getPartitionsByFilterFromHiveMetaStore(databaseName, tableName, filter); } catch (UnsupportedException ue) { throw ue; } catch (Exception se) { throw new TajoInternalError(se); } return list; }

Target:
public List<PartitionDescProto> getPartitionsByAlgebra(PartitionsByAlgebraProto request) throws UndefinedDatabaseException, UndefinedTableException, UndefinedPartitionMethodException, UnsupportedException { List<PartitionDescProto> list = null; try { String databaseName = request.getDatabaseName(); String tableName = request.getTableName(); if (!existDatabase(databaseName)) { throw new UndefinedDatabaseException(tableName); } if (!existTable(databaseName, tableName)) { throw new UndefinedTableException(tableName); } if (!existPartitionMethod(databaseName, tableName)) { throw new UndefinedPartitionMethodException(tableName); } TableDescProto tableDesc = getTable(databaseName, tableName); String filter = getFilter(databaseName, tableName, tableDesc.getPartition().getExpressionSchema().getFieldsList() , request.getAlgebra()); list = getPartitionsFromHiveMetaStore(databaseName, tableName, filter); } catch (UnsupportedException ue) { throw ue; } catch (Exception se) { throw new TajoInternalError(se); } return list; }
Source:
public <T> BeanBuilder<T> addBean() { Class<? extends Extension> extensionClass = getReceiver().getClass(); BeanManagerImpl beanManager = getOrCreateBeanDeployment(extensionClass).getBeanManager(); BeanBuilderImpl<T> builder = new BeanBuilderImpl<T>(beanManager, extensionClass); additionalBeans.add(new BeanRegistration(builder, beanManager)); return builder; }

Target:
public <T> BeanBuilder<T> addBean() { BeanBuilderImpl<T> builder = new BeanBuilderImpl<T>(getReceiver().getClass(), getBeanDeployments(), getDeployment(), getContexts(), getBeanManager()); additionalBeans.add(new BeanRegistration(builder)); return builder; }
Source:
public void setUp() { Mockito.doCallRealMethod().when(inventoryCommonValidator) .validateTransactionNotes(Mockito.anyString(), Mockito.any( BindingResult.class)); }

Target:
public void setUp() { }
Source:
public String toRevision(final Project.NameKey project, final PatchSet ps) { ParamertizedString pattern = new ParamertizedString(type.getRevision()); final Map<String, String> p = new HashMap<String, String>(); String proj_qs = URL.encodeQueryString(project.get()); p.put("project", proj_qs); p.put("project_path", proj_qs.replace("%2F", "/")); p.put("commit", URL.encodeQueryString(ps.getRevision().get())); return baseUrl + pattern.replace(p); }

Target:
public String toRevision(final Project.NameKey project, final PatchSet ps) { ParamertizedString pattern = new ParamertizedString(type.getRevision()); final Map<String, String> p = new HashMap<String, String>(); p.put("project", URL.encodeQueryString(project.get()).replace("%2F", "/")); p.put("commit", URL.encodeQueryString(ps.getRevision().get())); return baseUrl + pattern.replace(p); }
Source:
protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { if (StringUtils.isEmpty(request.getParameter(SSOUtils.POST_ACTION_URL))) { throw new RuntimeException("No post action url found in request."); } boolean enableBasicAuth = false; String strVal = request.getSession().getServletContext().getInitParameter("enable-basic-auth"); if (StringUtils.isNotEmpty(strVal)) { enableBasicAuth = Boolean.parseBoolean(strVal); } if (enableBasicAuth) { response.sendRedirect(request.getContextPath() + SSOUtils.LOGIN_EXTERNAL_URI + request.getQueryString()); } else { response.sendRedirect(request.getContextPath() + SSOUtils.LOGIN_PHASE2_URI + request.getQueryString()); } }

Target:
protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { if (StringUtils.isEmpty(request.getParameter(SSOUtils.POST_ACTION_URL))) { throw new RuntimeException("No post action url found in request."); } boolean enableBasicAuth = (boolean) request.getSession().getServletContext().getAttribute(SSOUtils.ENABLE_BASIC_AUTH); request.getSession(true).setAttribute(SSOUtils.PARAMS_MAP, new HashMap<>(request.getParameterMap())); if (enableBasicAuth) { response.sendRedirect(request.getContextPath() + SSOUtils.LOGIN_EXTERNAL_URI); } else { response.sendRedirect(request.getContextPath() + SSOUtils.LOGIN_PHASE2_URI); } }
Source:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_splash); getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); move = AnimationUtils.loadAnimation(getApplicationContext(), R.anim.logo_anim); logo = findViewById(R.id.logo); AnimationSet set = new AnimationSet(true); fadeIn = new AlphaAnimation(0,1); fadeIn.setInterpolator(new AccelerateInterpolator()); fadeIn.setDuration(1000); set.addAnimation(fadeIn); set.addAnimation(move); logo.startAnimation(set); new Thread(){ @Override public void run() { super.run(); try { Thread.sleep(4500); Intent intent = new Intent(SplashActivity.this, LoginActivity.class); startActivity(intent); } catch (InterruptedException e) { e.printStackTrace(); } } }.start(); }

Target:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_splash); getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); Animation move = AnimationUtils.loadAnimation(getApplicationContext(), R.anim.splash_screen_logo_anim); ImageView logo = findViewById(R.id.logo); AnimationSet set = new AnimationSet(true); Animation fadeIn = new AlphaAnimation(0,1); fadeIn.setInterpolator(new AccelerateInterpolator()); fadeIn.setDuration(1000); set.addAnimation(fadeIn); set.addAnimation(move); logo.startAnimation(set); new Thread(){ @Override public void run() { super.run(); try { Thread.sleep(SPLASH_TIMER); Intent intent = new Intent(SplashActivity.this, LoginActivity.class); startActivity(intent); } catch (InterruptedException e) { Thread.currentThread().interrupt(); return; } } }.start(); }
Source:
public void signInOnLocalDoesNotSetCookieWithSSL() throws Exception { String json = TestUtils.createJson( "{'study':'" + TEST_STUDY_ID_STRING + "','email':'email@email.com','password':'bar'}"); response = mockPlayContextWithJson(json); when(controller.bridgeConfig.getEnvironment()).thenReturn(Environment.LOCAL); when(controller.bridgeConfig.get("webservices.url")).thenReturn("http://localhost:9000"); UserSession session = createSession(null, null); when(authenticationService.signIn(any(), any(), any())).thenReturn(session); controller.signIn(); verify(response).setCookie(BridgeConstants.SESSION_TOKEN_HEADER, TEST_SESSION_TOKEN, BridgeConstants.BRIDGE_SESSION_EXPIRE_IN_SECONDS, "/", BridgeConfigFactory.getConfig().get("webservices.url"), false, false); }

Target:
public void signInOnLocalDoesNotSetCookieWithSSL() throws Exception { String json = TestUtils.createJson( "{'study':'" + TEST_STUDY_ID_STRING + "','email':'email@email.com','password':'bar'}"); response = mockPlayContextWithJson(json); when(controller.bridgeConfig.getEnvironment()).thenReturn(Environment.LOCAL); UserSession session = createSession(null, null); when(authenticationService.signIn(any(), any(), any())).thenReturn(session); controller.signIn(); verify(response).setCookie(BridgeConstants.SESSION_TOKEN_HEADER, TEST_SESSION_TOKEN, BridgeConstants.BRIDGE_SESSION_EXPIRE_IN_SECONDS, "/", WEBSERVICES_URL, false, false); }
Source:
protected void handleJSON(HttpServletRequest request, HttpServletResponse response, final JSONObject json) throws IOException { if (request.getPathInfo().equalsIgnoreCase("/load")) { scoreBoard.runInBatch(new Runnable() { public void run() { scoreBoard.reset(); ScoreBoardJSONSetter.set(scoreBoard, json); } }); } else if (request.getPathInfo().equalsIgnoreCase("/merge")) { scoreBoard.runInBatch(new Runnable() { public void run() { ScoreBoardJSONSetter.set(scoreBoard, json); } }); } else { response.sendError(HttpServletResponse.SC_NOT_FOUND, "Must specify to load or merge"); } response.setContentType("text/plain"); response.setStatus(HttpServletResponse.SC_OK); }

Target:
protected void handleJSON(HttpServletRequest request, HttpServletResponse response, final JSONObject json) throws IOException { if (request.getPathInfo().equalsIgnoreCase("/load")) { scoreBoard.runInBatch(new Runnable() { @Override public void run() { scoreBoard.reset(); ScoreBoardJSONSetter.set(scoreBoard, json); } }); } else if (request.getPathInfo().equalsIgnoreCase("/merge")) { scoreBoard.runInBatch(new Runnable() { @Override public void run() { ScoreBoardJSONSetter.set(scoreBoard, json); } }); } else { response.sendError(HttpServletResponse.SC_NOT_FOUND, "Must specify to load or merge"); } response.setContentType("text/plain"); response.setStatus(HttpServletResponse.SC_OK); }
Source:
public ServiceBusReceiverAsyncClient buildAsyncClient() { final MessagingEntityType entityType = validateEntityPaths(logger, connectionStringEntityName, topicName, queueName); final String entityPath; switch (entityType) { case QUEUE: entityPath = queueName; break; case TOPIC: if (isNullOrEmpty(subscriptionName)) { throw logger.logExceptionAsError(new IllegalStateException(String.format( "topicName (%s) must have a subscriptionName associated with it.", topicName))); } entityPath = topicName; break; default: throw logger.logExceptionAsError( new IllegalArgumentException("Unknown entity type: " + entityType)); } if (prefetchCount < 1) { throw logger.logExceptionAsError(new IllegalArgumentException(String.format( "prefetchCount (%s) cannot be less than 1.", prefetchCount))); } final MessageLockContainer messageLockContainer = new MessageLockContainer(); final ServiceBusConnectionProcessor connectionProcessor = getOrCreateConnectionProcessor(messageSerializer); final ReceiverOptions receiverOptions = new ReceiverOptions(receiveMode, prefetchCount); return new ServiceBusReceiverAsyncClient(connectionProcessor.getFullyQualifiedNamespace(), entityPath, entityType, receiverOptions, connectionProcessor, tracerProvider, messageSerializer, messageLockContainer, ServiceBusClientBuilder.this::onClientClose); }

Target:
public ServiceBusReceiverAsyncClient buildAsyncClient() { final MessagingEntityType entityType = validateEntityPaths(logger, connectionStringEntityName, topicName, queueName); final String entityPath; switch (entityType) { case QUEUE: entityPath = queueName; break; case TOPIC: if (isNullOrEmpty(subscriptionName)) { throw logger.logExceptionAsError(new IllegalStateException(String.format( "topicName (%s) must have a subscriptionName associated with it.", topicName))); } entityPath = topicName; break; default: throw logger.logExceptionAsError( new IllegalArgumentException("Unknown entity type: " + entityType)); } if (prefetchCount < 1) { throw logger.logExceptionAsError(new IllegalArgumentException(String.format( "prefetchCount (%s) cannot be less than 1.", prefetchCount))); } final MessageLockContainer messageLockContainer = new MessageLockContainer(); final ServiceBusConnectionProcessor connectionProcessor = getOrCreateConnectionProcessor(messageSerializer); final ReceiverOptions receiverOptions = new ReceiverOptions(receiveMode, prefetchCount, sessionId); return new ServiceBusReceiverAsyncClient(connectionProcessor.getFullyQualifiedNamespace(), entityPath, entityType, receiverOptions, connectionProcessor, tracerProvider, messageSerializer, messageLockContainer, ServiceBusClientBuilder.this::onClientClose); }
Source:
private void showAlertDialogOnNewSettingNewTheme(Theme newTheme) { AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(this); dialogBuilder.setMessage(String.format(getString(R.string.theme_prompt), newTheme.getName(), newTheme.getAuthor())); dialogBuilder.setNegativeButton(R.string.theme_done, null); dialogBuilder.setPositiveButton(R.string.theme_manage_site, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { finish(); } }); AlertDialog alertDialog = dialogBuilder.create(); alertDialog.show(); }

Target:
private void showAlertDialogOnNewSettingNewTheme(Theme newTheme) { AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(this); String thanksMessage = String.format(getString(R.string.theme_prompt), newTheme.getName()); if (!newTheme.getAuthor().isEmpty()) { thanksMessage = thanksMessage + String.format(getString(R.string.theme_by_author_prompt_append), newTheme.getAuthor()); } dialogBuilder.setMessage(thanksMessage); dialogBuilder.setNegativeButton(R.string.theme_done, null); dialogBuilder.setPositiveButton(R.string.theme_manage_site, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { finish(); } }); AlertDialog alertDialog = dialogBuilder.create(); alertDialog.show(); }
Source:
public void parse(InputStream historyFile, JobKey jobKey) throws ProcessingException { try { jobHistoryListener = new JobHistoryListener(jobKey); JobHistoryCopy.parseHistoryFromIS(historyFile, jobHistoryListener); } catch (IOException ioe) { LOG.error(" Exception during parsing hadoop 1.0 file " + ioe.getMessage()); LOG.error(ioe.getStackTrace()); throw new ProcessingException( " Unable to parse history file in function parse, " + "cannot process this record!" + jobKey + " error: " + ioe.getMessage()); } }

Target:
public void parse(InputStream historyFile, JobKey jobKey) throws ProcessingException { try { jobHistoryListener = new JobHistoryListener(jobKey); JobHistoryCopy.parseHistoryFromIS(historyFile, jobHistoryListener); } catch (IOException ioe) { LOG.error(" Exception during parsing hadoop 1.0 file ", ioe); throw new ProcessingException( " Unable to parse history file in function parse, " + "cannot process this record!" + jobKey + " error: " , ioe); } }
Source:
public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class Handler {\n"); sb.append(" exec: ").append(toIndentedString(exec)).append("\n"); sb.append("}"); return sb.toString(); }

Target:
public String toString() { return "Handler{" + "exec=" + exec + '}'; }
Source:
public boolean accepts(String spec, LocationRegistry registry) { if (BasicLocationRegistry.isResolverPrefixForSpec(this, spec, true)) return true; JcloudsSpecParser details = JcloudsSpecParser.parse(spec, false); if (details==null) return false; if (details.isProvider() || details.isApi()) return true; return false; }

Target:
public boolean accepts(String spec, LocationRegistry registry) { if (BasicLocationRegistry.isResolverPrefixForSpec(this, spec, true)) return true; JcloudsSpecParser details = JcloudsSpecParser.parse(spec, true); if (details==null) return false; if (details.isProvider() || details.isApi()) return true; return false; }
Source:
public static void getPushNotificationSettings(Context context, RestRequest.Listener listener, RestRequest.ErrorListener errorListener) { if (!AccountHelper.isSignedInWordPressDotCom()) { return; } if (TextUtils.isEmpty(GCMRegistrar.getRegistrationId(context))) { AppLog.e(T.NOTIFS, "can't get push notification settings, gcm token is null."); } SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(context); String deviceID = settings.getString(WPCOM_PUSH_DEVICE_SERVER_ID, null); WordPress.getRestClientUtilsV1_1().get("/me/notifications/settings/?device_id=" + deviceID, listener, errorListener); }

Target:
public static void getPushNotificationSettings(Context context, RestRequest.Listener listener, RestRequest.ErrorListener errorListener) { if (!AccountHelper.isSignedInWordPressDotCom()) { return; } if (TextUtils.isEmpty(GCMRegistrar.getRegistrationId(context))) { AppLog.e(T.NOTIFS, "can't get push notification settings, gcm token is null."); } SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(context); String deviceID = settings.getString(WPCOM_PUSH_DEVICE_SERVER_ID, null); String settingsEndpoint = WPCOM_SETTINGS_ENDPOINT; if (!TextUtils.isEmpty(deviceID)) { settingsEndpoint += "?device_id=" + deviceID; } WordPress.getRestClientUtilsV1_1().get(settingsEndpoint, listener, errorListener); }
Source:
public DirFileLookuper(String path) { if (!Strings.isEmpty(path)) { this.dir = new File(path); } }

Target:
public DirFileLookuper(String path) { this.dir = new File(path); }
Source:
public void canSustainConcurrentModification() { final DefaultPackageManager.IntentComparator intentComparator = new DefaultPackageManager.IntentComparator(); Intent mockedIntent1 = mock(Intent.class); when(mockedIntent1.getAction()).thenReturn("actionstring0", (String) null); Intent mockedIntent2 = mock(Intent.class); when(mockedIntent2.getAction()).thenReturn("actionstring1", (String) null); Assertions.assertThat(intentComparator.compare(mockedIntent1, mockedIntent2)).isEqualTo(-1); }

Target:
public void canSustainConcurrentModification() { final DefaultPackageManager.IntentComparator intentComparator = new DefaultPackageManager.IntentComparator(); Intent intent1 = new Intent("actionstring0"); Intent intent2 = new Intent("actionstring1"); Assertions.assertThat(intentComparator.compare(intent1, intent2)).isEqualTo(-1); }
Source:
public TestRowExpressionTranslator() { this.functionManager = METADATA.getFunctionManager(); this.functionResolution = new FunctionResolution(functionManager); this.determinismEvaluator = new RowExpressionDeterminismEvaluator(functionManager); this.sqlToRowExpressionTranslator = new TestingRowExpressionTranslator(METADATA); }

Target:
public TestRowExpressionTranslator() { this.functionManager = METADATA.getFunctionManager(); this.sqlToRowExpressionTranslator = new TestingRowExpressionTranslator(METADATA); }