auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void recordUnreachableRemotes() throws Exception { StringBuilder xmlContent = new StringBuilder(); xmlContent.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n") .append("<manifest>") .append("<remote name=\"remote1\" fetch=\"<LINK_0>\" />") .append("<default revision=\"master\" remote=\"remote1\" />") .append("<project path=\"base\" name=\"platform/base\" />") .append("</manifest>"); Repository dest = Git.cloneRepository() .setURI(db.getDirectory().toURI().toString()) .setDirectory(createUniqueTestGitDir(true)).setBare(true).call() .getRepository(); assertTrue(dest.isBare()); RepoCommand cmd = new RepoCommand(dest); RevCommit commit = cmd .setInputStream(new ByteArrayInputStream( xmlContent.toString().getBytes(UTF_8))) .setRemoteReader(new IndexedRepos()) .setURI("platform/") .setTargetURI("platform/superproject") .setRecordRemoteBranch(true) .setIgnoreRemoteFailures(true) .setRecordSubmoduleLabels(true) .call(); String idStr = commit.getId().name() + ":" + ".gitmodules"; ObjectId modId = dest.resolve(idStr); try (ObjectReader reader = dest.newObjectReader()) { byte[] bytes = reader.open(modId).getCachedBytes(Integer.MAX_VALUE); Config base = new Config(); BlobBasedConfig cfg = new BlobBasedConfig(base, bytes); String subUrl = cfg.getString("submodule", "base", "url"); assertEquals(subUrl, "<LINK_0>platform/base"); } dest.close(); }

Target:
public void recordUnreachableRemotes() throws Exception { StringBuilder xmlContent = new StringBuilder(); xmlContent.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n") .append("<manifest>") .append("<remote name=\"remote1\" fetch=\"<LINK_0>\" />") .append("<default revision=\"master\" remote=\"remote1\" />") .append("<project path=\"base\" name=\"platform/base\" />") .append("</manifest>"); Repository dest = Git.cloneRepository() .setURI(db.getDirectory().toURI().toString()) .setDirectory(createUniqueTestGitDir(true)).setBare(true).call() .getRepository(); assertTrue(dest.isBare()); RevCommit commit = new RepoCommand(dest) .setInputStream(new ByteArrayInputStream( xmlContent.toString().getBytes(UTF_8))) .setRemoteReader(new IndexedRepos()) .setURI("platform/") .setTargetURI("platform/superproject") .setRecordRemoteBranch(true) .setIgnoreRemoteFailures(true) .setRecordSubmoduleLabels(true) .call(); String idStr = commit.getId().name() + ":" + ".gitmodules"; ObjectId modId = dest.resolve(idStr); try (ObjectReader reader = dest.newObjectReader()) { byte[] bytes = reader.open(modId).getCachedBytes(Integer.MAX_VALUE); Config base = new Config(); BlobBasedConfig cfg = new BlobBasedConfig(base, bytes); String subUrl = cfg.getString("submodule", "base", "url"); assertEquals(subUrl, "<LINK_0>platform/base"); } dest.close(); }
Source:
public static GlobalConfigCache getInstance() { return INSTANCE.get(); }

Target:
public static GlobalConfigCache getInstance() { return INSTANCE; }
Source:
protected String getStreamForCategory(String category) { if (category != null && streamIds.contains(category)) { return category; } return "default"; }

Target:
protected String getStreamForCategory(String category) { if (category != null && streamIds.contains(category)) { return category; } return DEFAULT_CATEGORY; }
Source:
public void showPlaceholder(User user) { portraitImage.setImageBitmap(null); textView.setBackground(getResources().getDrawable(R.drawable.rounded_corner, null)); String nameInitial = user.getFirstName().substring(0, 1); String surnameInitial = user.getLastName().isEmpty() ? "" : user.getLastName().substring(0, 1); String fullNameUppercase = (nameInitial + surnameInitial).toUpperCase(); textView.setText(fullNameUppercase); }

Target:
public void showPlaceholder(User user) { portraitImage.setImageBitmap(null); textView.setBackground(ContextCompat.getDrawable(getContext(), R.drawable.rounded_corner)); String nameInitial = user.getFirstName().substring(0, 1); String surnameInitial = user.getLastName().isEmpty() ? "" : user.getLastName().substring(0, 1); String fullNameUppercase = (nameInitial + surnameInitial).toUpperCase(); textView.setText(fullNameUppercase); }
Source:
public void createAuthenticationDialog(WebView webView, HttpAuthHandler handler) { CredentialsDialogFragment dialog = CredentialsDialogFragment.newInstanceForCredentials(webView, handler); FragmentManager fm = getSupportFragmentManager(); FragmentTransaction ft = fm.beginTransaction(); ft.addToBackStack(null); dialog.setCancelable(false); dialog.show(ft, CREDENTIALS_DIALOG_TAG); if (!mIsFirstAuthAttempt) { Snackbar snackbar = Snackbar.make( findViewById(android.R.id.content), getText(R.string.saml_authentication_wrong_pass), Snackbar.LENGTH_LONG ); snackbar.show(); } else { mIsFirstAuthAttempt = false; } }

Target:
public void createAuthenticationDialog(WebView webView, HttpAuthHandler handler) { CredentialsDialogFragment dialog = CredentialsDialogFragment.newInstanceForCredentials(webView, handler); FragmentManager fm = getSupportFragmentManager(); FragmentTransaction ft = fm.beginTransaction(); ft.addToBackStack(null); dialog.setCancelable(false); dialog.show(ft, CREDENTIALS_DIALOG_TAG); if (!mIsFirstAuthAttempt) { showSnackMessage(R.string.saml_authentication_wrong_pass); } else { mIsFirstAuthAttempt = false; } }
Source:
public Date getArtStartDate(Patient patient) { List<Obs> list = Context.getObsService().getObservationsByPersonAndConcept(patient, Context.getConceptService().getConcept(99161)); if (list.size() <= 0) { list = getObsListFromIdList("SELECT obs_id FROM obs where obs.person_id='" + patient.getPatientId() + "' AND obs.concept_id = 90315 AND obs.voided = false ORDER BY obs.encounter_id DESC"); if (list.size() > 0) { return list.get(0).getEncounter().getEncounterDatetime(); } else { return null; } } else { return list.get(0).getValueDatetime(); } }

Target:
public Date getArtStartDate(Patient patient) { List<Obs> list = Context.getObsService().getObservationsByPersonAndConcept(patient, Context.getConceptService().getConcept(99161)); Date artStartDate = null; if (list.size() > 0) { artStartDate = list.get(0).getValueDatetime(); } return artStartDate; }
Source:
private static void inlineIncludes(NodeList signatureNodes, Collection<Attachment> attachments) throws IOException { for (int i = 0; i < signatureNodes.getLength(); ++i) { Element sigElement = (Element) signatureNodes.item(i); Object child = sigElement.getFirstChild(); if (child instanceof Element && isIncludeElement((Element) child)) { String refId = ((Element) child).getAttribute(HREF_ATTRIBUTE).replaceFirst(CONTENT_ID_PREFIX, ""); Optional<Attachment> attachment = getAttachment(attachments, refId); if (attachment.isPresent()) { String attachmentValue = convertToBase64Data(attachment.get().getDataHandler()); sigElement.setTextContent(attachmentValue); } else { LOG.warn( "Failed to inline signature/digest element to the header. Cannot find reference id: " + refId); } } } }

Target:
private static void inlineIncludes(NodeList signatureNodes, Collection<Attachment> attachments) throws IOException { for (int i = 0; i < signatureNodes.getLength(); ++i) { Element sigElement = (Element) signatureNodes.item(i); Object child = sigElement.getFirstChild(); if (child instanceof Element && isIncludeElement((Element) child)) { String refId = ((Element) child).getAttribute(HREF_ATTRIBUTE).replaceFirst(CONTENT_ID_PREFIX, ""); Optional<Attachment> attachment = getAttachment(attachments, refId); if (attachment.isPresent()) { String attachmentValue = convertToBase64Data(attachment.get().getDataHandler()); sigElement.setTextContent(attachmentValue); } else { LOG.warn( "Failed to inline signature/digest element to the header. Cannot find reference id: {}", refId); } } } }
Source:
public List<@Nullable Object> getOngoingStateValues() { fRWLock.readLock().lock(); try { return Collections.unmodifiableList(fOngoingStateInfo); } finally { fRWLock.readLock().unlock(); } }

Target:
public List<@Nullable Object> getOngoingStateValues() { fRWLock.readLock().lock(); try { return new ArrayList<>(fOngoingStateInfo); } finally { fRWLock.readLock().unlock(); } }
Source:
public Collection<Source> getAllSources() { RestTemplate restTemplate = new RestTemplate(); String url = ClientUtils.getSourceUrl(config, SOURCE_QUERY); HttpHeaders headers = ClientUtils.getAuthHeaders(config); HttpEntity<String> request = new HttpEntity<String>(headers); Class<SourceAttrs[]> sourceAttrsClass = SourceAttrs[].class; ResponseEntity<SourceAttrs[]> response = restTemplate.exchange(url, HttpMethod.GET, request, sourceAttrsClass); Collection<Source> sources = Lists.newArrayList(); for (SourceAttrs info : response.getBody()) { sources.add(info.createSource()); } return sources; }

Target:
public Collection<Source> getAllSources() { RestTemplate restTemplate = new RestTemplate(); String url = getUrl(); HttpHeaders headers = getAuthHeaders(); HttpEntity<String> request = new HttpEntity<String>(headers); ResponseEntity<SourceAttrs[]> response = restTemplate.exchange(url, HttpMethod.GET, request, SourceAttrs[].class); Collection<Source> sources = Lists.newArrayList(); for (SourceAttrs info : response.getBody()) { sources.add(info.createSource()); } return sources; }
Source:
public Iterator<E> iterator(Predicate<E> filter) { final Iterator<E> allEntities = loadAll(); final Iterator<E> result = filter(allEntities, filter); return result; }

Target:
public Iterator<E> iterator(Predicate<E> filter) { Iterator<E> allEntities = loadAll(); Iterator<E> result = filter(allEntities, filter); return result; }
Source:
public <T> T map(Multihash hash, Function<Multihash, T> success, Function<Throwable, T> absent) { try { return success.apply(hash); } catch (AmazonServiceException e) { if ("NoSuchKey".equals(e.getErrorCode())) { Histogram.Timer readTimer = readTimerLog.labels("0").startTimer(); readTimer.observeDuration(); return absent.apply(e); } LOG.warning("AmazonServiceException: " + e.getMessage()); LOG.warning("AWS Error Code: " + e.getErrorCode()); throw new RuntimeException(e.getMessage(), e); } catch (AmazonClientException e) { LOG.severe("AmazonClientException: " + e.getMessage()); LOG.severe("Thrown at:" + e.getCause().toString()); throw new RuntimeException(e.getMessage(), e); } }

Target:
public <T> T map(Multihash hash, Function<Multihash, T> success, Function<Throwable, T> absent) { try { return success.apply(hash); } catch (AmazonServiceException e) { if ("NoSuchKey".equals(e.getErrorCode())) { Histogram.Timer readTimer = readTimerLog.labels("absent").startTimer(); readTimer.observeDuration(); return absent.apply(e); } LOG.warning("AmazonServiceException: " + e.getMessage()); LOG.warning("AWS Error Code: " + e.getErrorCode()); throw new RuntimeException(e.getMessage(), e); } catch (AmazonClientException e) { LOG.severe("AmazonClientException: " + e.getMessage()); LOG.severe("Thrown at:" + e.getCause().toString()); throw new RuntimeException(e.getMessage(), e); } }
Source:
private List<Queue.Item> filterQueue(List<Queue.Item> base) { if (!isFilterQueue()) { return base; } Collection<TopLevelItem> items = getItems(); List<Queue.Item> result = new ArrayList<Queue.Item>(); for (Queue.Item qi : base) { Queue.Task currentTask = null; do { currentTask = currentTask == null ? qi.task : currentTask.getOwnerTask(); if (items.contains(currentTask)) { result.add(qi); break; } } while (currentTask.getOwnerTask() != currentTask); if (qi.task instanceof AbstractProject<?, ?>) { AbstractProject<?,?> project = (AbstractProject<?, ?>) qi.task; if (items.contains(project.getRootProject())) { result.add(qi); } } } return result; }

Target:
private List<Queue.Item> filterQueue(List<Queue.Item> base) { if (!isFilterQueue()) { return base; } Collection<TopLevelItem> items = getItems(); return base.stream().filter(qi -> filterQueueItemTest(qi, items)) .collect(Collectors.toList()); }
Source:
public void delete(Collection<RepositoryGroup> groupsToDelete) { for (RepositoryGroup group : groupsToDelete) { preferences .remove(PREFS_GROUP_PREFIX + group.getGroupId().toString()); groupMap.remove(group.getGroupId()); } savePreferences(); }

Target:
public void delete(Collection<RepositoryGroup> groupsToDelete) { for (RepositoryGroup group : groupsToDelete) { preferences .remove(PREFS_GROUP_PREFIX + group.getGroupId()); groupMap.remove(group.getGroupId()); } savePreferences(); }
Source:
private void createBanner() { if (mVungleManager == null || pendingRequestBanner.compareAndSet(false, false)) return; mVungleManager.cleanUpBanner(mPlacementForPlay); vungleNativeAd = mVungleManager.getVungleNativeAd(mAdapterId, mPlacementForPlay, adConfig, new VungleListener() { @Override void onAdEnd(String placement, boolean wasSuccessfulView, boolean wasCallToActionClicked) { if (mMediationBannerListener != null) { if (wasCallToActionClicked) { mMediationBannerListener.onAdClicked(VungleInterstitialAdapter.this); mMediationBannerListener.onAdOpened(VungleInterstitialAdapter.this); mMediationBannerListener.onAdLeftApplication(VungleInterstitialAdapter.this); mMediationBannerListener.onAdClosed(VungleInterstitialAdapter.this); } } } @Override void onAdStart(String placement) { mVungleManager.loadAd(mAdapterId, placement, null); } @Override void onAdFail(String placement) { if (mMediationBannerListener != null) { mMediationBannerListener.onAdFailedToLoad(VungleInterstitialAdapter.this, AdRequest.ERROR_CODE_INTERNAL_ERROR); } } }); View adView = vungleNativeAd == null ? null : vungleNativeAd.renderNativeView(); if (adView != null) { updateVisibility(); adLayout.addView(adView); } else { if (mMediationBannerListener != null) { mMediationBannerListener.onAdFailedToLoad(VungleInterstitialAdapter.this, AdRequest.ERROR_CODE_INTERNAL_ERROR); } } }

Target:
private void createBanner() { if (mVungleManager == null || !pendingRequestBanner.get()) return; mVungleManager.cleanUpBanner(mPlacementForPlay); vungleNativeAd = mVungleManager.getVungleNativeAd(mPlacementForPlay, adConfig, new VungleListener() { @Override void onAdEnd(String placement, boolean wasSuccessfulView, boolean wasCallToActionClicked) { if (mMediationBannerListener != null) { if (wasCallToActionClicked) { mMediationBannerListener.onAdClicked(VungleInterstitialAdapter.this); mMediationBannerListener.onAdOpened(VungleInterstitialAdapter.this); mMediationBannerListener.onAdClosed(VungleInterstitialAdapter.this); } } } @Override void onAdStart(String placement) { mVungleManager.loadAd(placement, null); } @Override void onAdFail(String placement) { if (mMediationBannerListener != null) { mMediationBannerListener.onAdFailedToLoad(VungleInterstitialAdapter.this, AdRequest.ERROR_CODE_INTERNAL_ERROR); } } }); View adView = vungleNativeAd != null ? vungleNativeAd.renderNativeView() : null; if (adView != null) { updateVisibility(); adLayout.addView(adView); if (mMediationBannerListener != null) { mMediationBannerListener.onAdLoaded(VungleInterstitialAdapter.this); } } else { if (mMediationBannerListener != null) { mMediationBannerListener.onAdFailedToLoad(VungleInterstitialAdapter.this, AdRequest.ERROR_CODE_INTERNAL_ERROR); } } }
Source:
private Map<String, String> getPropertyOverrides() { ServletContext context = ResteasyProviderFactory.getContextData(ServletContext.class); Map<String, String> propertyOverridesMap = new HashMap<>(); String propertyOverrides = context.getInitParameter(SERVER_CONTEXT_CONFIG_PROPERTY_OVERRIDES); try { if (context.getInitParameter(SERVER_CONTEXT_CONFIG_PROPERTY_OVERRIDES) != null) { JsonNode jsonObj = new ObjectMapper().readTree(propertyOverrides); jsonObj.fields().forEachRemaining(e -> propertyOverridesMap.put(e.getKey(), e.getValue().asText())); } } catch (IOException e) { } return propertyOverridesMap; }

Target:
private Map<String, String> getPropertyOverrides() { ServletContext context = ResteasyProviderFactory.getContextData(ServletContext.class); Map<String, String> propertyOverridesMap = new HashMap<>(); String propertyOverrides = context.getInitParameter(SERVER_CONTEXT_CONFIG_PROPERTY_OVERRIDES); try { if (context.getInitParameter(SERVER_CONTEXT_CONFIG_PROPERTY_OVERRIDES) != null) { JsonNode jsonObj = JsonSerialization.mapper.readTree(propertyOverrides); jsonObj.fields().forEachRemaining(e -> propertyOverridesMap.put(e.getKey(), e.getValue().asText())); } } catch (IOException e) { } return propertyOverridesMap; }
Source:
private void verifyIdentificationHeader(BitInputStream input) throws IOException { verifyTypeAndHeader("Identification", input, 0x80); checkHeaderField("Identification", "VMAJ", input, 8, not(v -> v != 3)); checkHeaderField("Identification", "VMIN", input, 8, not(v -> v != 2)); checkHeaderField("Identification", "VREV", input, 8, not(v -> v > 1)); int FMBW = checkHeaderField("Identification", "FMBW", input, 16, not(v -> v == 0)); int FMBH = checkHeaderField("Identification", "FMBH", input, 16, not(v -> v == 0)); checkHeaderField( "Identification", "PICW", input, 24, not(v -> v > FMBW * 16)); checkHeaderField("Identification", "PICH", input, 24, not(v -> v > FMBH * 16)); checkHeaderField("Identification", "PICX", input, 8, not(v -> v > FMBW * 16 - v)); checkHeaderField("Identification", "PICY", input, 8, not(v -> v > FMBH * 16 - v)); checkHeaderField("Identification", "FRN", input, 32, not(v -> v == 0)); checkHeaderField("Identification", "FRD", input, 32, not(v -> v == 0)); input.skip(48); checkHeaderField("Identification", "CS", input, 8, not(v -> !(v == 0 || v == 1 || v == 2))); input.skip(35); checkHeaderField("Identification", "PF", input, 2, not(v -> v == 1)); checkHeaderField("Identification", "Res", input, 3, not(v -> v != 0)); }

Target:
private void verifyIdentificationHeader(BitInputStream input) throws IOException { verifyTypeAndHeader("Identification", input, 0x80); checkHeaderField("Identification", "VMAJ", input, 8, not(v -> v != 3)); checkHeaderField("Identification", "VMIN", input, 8, not(v -> v != 2)); input.skip(8); int FMBW = checkHeaderField("Identification", "FMBW", input, 16, v -> v > 0); int FMBH = checkHeaderField("Identification", "FMBH", input, 16, v -> v > 0); checkHeaderField("Identification", "PICW", input, 24, not(v -> v > FMBW * 16)); checkHeaderField("Identification", "PICH", input, 24, not(v -> v > FMBH * 16)); checkHeaderField("Identification", "PICX", input, 8, not(v -> v > FMBW * 16 - v)); checkHeaderField("Identification", "PICY", input, 8, not(v -> v > FMBH * 16 - v)); checkHeaderField("Identification", "FRN", input, 32, v -> v > 0); checkHeaderField("Identification", "FRD", input, 32, v -> v > 0); input.skip(48); checkHeaderField("Identification", "CS", input, 8, v -> v == 0 || v == 1 || v == 2); input.skip(35); checkHeaderField("Identification", "PF", input, 2, not(v -> v == 1)); checkHeaderField("Identification", "Res", input, 3, not(v -> v != 0)); }
Source:
@Override public Scope decorateScope(@Nullable TraceContext currentSpan, Scope scope) { ScopeEvent event = new ScopeEvent(); if (!event.isEnabled()) return scope; if (currentSpan != null) { event.traceId = currentSpan.traceIdString(); event.parentId = currentSpan.parentIdString(); event.spanId = currentSpan.spanIdString(); } event.begin(); class JfrCurrentTraceContextScope implements Scope { @Override public void close() { scope.close(); if (!event.shouldCommit()) return; event.end(); event.commit(); } } return new JfrCurrentTraceContextScope(); }

Target:
@Override public Scope decorateScope(@Nullable TraceContext currentSpan, Scope scope) { ScopeEvent event = new ScopeEvent(); if (!event.isEnabled()) return scope; if (currentSpan != null) { event.traceId = currentSpan.traceIdString(); event.parentId = currentSpan.parentIdString(); event.spanId = currentSpan.spanIdString(); } event.begin(); class JfrCurrentTraceContextScope implements Scope { @Override public void close() { scope.close(); event.commit(); } } return new JfrCurrentTraceContextScope(); }
Source:
private void handleSimpleBlob(BlobData blobData, byte[] userMetadata, ByteBuffer encryptionKey) { totalSize = blobData.getSize(); chunkSize = totalSize; boolean rangeResolutionFailure = false; if (encryptionKey == null) { rangeResolutionFailure = resolveRange(totalSize); } else { } if (!rangeResolutionFailure) { chunkIdIterator = null; dataChunks = null; chunkIndex = 0; numChunksTotal = 1; if (encryptionKey == null) { chunkIndexToBuffer.put(0, filterChunkToRange(blobData.getStream().getByteBuffer())); numChunksRetrieved = 1; } else { logger.trace("Submitting decrypt job for simple blob {}", blobId); long startTimeMs = System.currentTimeMillis(); decryptCallbackResultInfo = new DecryptCallBackResultInfo(); progressTracker.initializeDecryptionTracker(); decryptJobMetricsTracker = new CryptoJobMetricsTracker(routerMetrics.decryptJobMetrics); decryptJobMetricsTracker.startTracker(); cryptoJobHandler.submitJob(new DecryptJob(blobId, encryptionKey, blobData.getStream().getByteBuffer(), userMetadata != null ? ByteBuffer.wrap(userMetadata) : null, cryptoService, kms, decryptJobMetricsTracker, (DecryptJob.DecryptJobResult result, Exception exception) -> { routerMetrics.decryptTimeMs.update(System.currentTimeMillis() - startTimeMs); logger.trace("Handling decrypt job call back for simple blob to set decrypt callback results", blobId); decryptCallbackResultInfo.setResultAndException(result, exception); routerCallback.onPollReady(); })); } } }

Target:
private void handleSimpleBlob(BlobData blobData, byte[] userMetadata, ByteBuffer encryptionKey) { totalSize = blobData.getSize(); chunkSize = totalSize; boolean rangeResolutionFailure = false; if (encryptionKey == null) { rangeResolutionFailure = resolveRange(totalSize); } else { } if (!rangeResolutionFailure) { chunkIdIterator = null; dataChunks = null; chunkIndex = 0; numChunksTotal = 1; if (encryptionKey == null) { chunkIndexToBuffer.put(0, filterChunkToRange(blobData.getStream().getByteBuffer())); numChunksRetrieved = 1; } else { logger.trace("Submitting decrypt job for simple blob {}", blobId); long startTimeMs = System.currentTimeMillis(); decryptCallbackResultInfo = new DecryptCallBackResultInfo(); progressTracker.initializeDecryptionTracker(); decryptJobMetricsTracker.onJobSubmission(); cryptoJobHandler.submitJob(new DecryptJob(blobId, encryptionKey, blobData.getStream().getByteBuffer(), userMetadata != null ? ByteBuffer.wrap(userMetadata) : null, cryptoService, kms, decryptJobMetricsTracker, (DecryptJob.DecryptJobResult result, Exception exception) -> { routerMetrics.decryptTimeMs.update(System.currentTimeMillis() - startTimeMs); decryptJobMetricsTracker.onJobCallbackProcessingStart(); logger.trace("Handling decrypt job call back for simple blob to set decrypt callback results", blobId); decryptCallbackResultInfo.setResultAndException(result, exception); routerCallback.onPollReady(); decryptJobMetricsTracker.onJobCallbackProcessingComplete(); })); } } }
Source:
static boolean upgradeDeviceIdToDB(Context context, String sourcePkgName) { if (sourcePkgName == null) { sourcePkgName = Constants.PACKAGE_NAME; } String prefsName = sourcePkgName + "." + context.getPackageName(); SharedPreferences preferences = context.getSharedPreferences(prefsName, Context.MODE_PRIVATE); String deviceId = preferences.getString(Constants.PREFKEY_DEVICE_ID, null); if (!TextUtils.isEmpty(deviceId)) { DatabaseHelper dbHelper = DatabaseHelper.getDatabaseHelper(context); dbHelper.insertOrReplaceKeyValue(DEVICE_ID_KEY, deviceId); } return true; }

Target:
static boolean upgradeDeviceIdToDB(Context context, String sourcePkgName) { if (sourcePkgName == null) { sourcePkgName = Constants.PACKAGE_NAME; } String prefsName = sourcePkgName + "." + context.getPackageName(); SharedPreferences preferences = context.getSharedPreferences(prefsName, Context.MODE_PRIVATE); String deviceId = preferences.getString(Constants.PREFKEY_DEVICE_ID, null); if (!TextUtils.isEmpty(deviceId)) { DatabaseHelper dbHelper = DatabaseHelper.getDatabaseHelper(context); dbHelper.insertOrReplaceKeyValue(DEVICE_ID_KEY, deviceId); preferences.edit().remove(Constants.PREFKEY_DEVICE_ID).apply(); } return true; }
Source:
public <T> T await(Operation<Optional<T>> f) { TaskState pollState = state.nestedState(stateKey); Long startTime = pollState.params().get(START_TIME, Long.class, null); if (startTime == null) { startTime = System.currentTimeMillis(); pollState.params().set(START_TIME, startTime); } TaskState operationState = pollState.nestedState(OPERATION); Long now = System.currentTimeMillis(); if (timeout.isPresent() && timeout.get().toMillis() <= now - startTime) { logger.debug("Timeout happened. startTime:{}, timeout:{}", startTime, timeout.get()); throw new PollingTimeoutException("Timeout happened"); } Optional<T> result; try { result = f.perform(operationState); } catch (Throwable e) { throw Throwables.propagate(e); } if (!result.isPresent()) { int iteration = pollState.params().get(ITERATION, int.class, 0); pollState.params().set(ITERATION, iteration + 1); int interval = (int) Math.min(pollInterval.min().getSeconds() * Math.pow(nextIntervalExpBase, iteration), pollInterval.max().getSeconds()); String formattedErrorMessage = String.format(waitMessage, waitMessageParameters); logger.info("{}: checking again in {}", formattedErrorMessage, Durations.formatDuration(Duration.ofSeconds(interval))); throw pollState.pollingTaskExecutionException(interval); } pollState.params().remove(OPERATION); pollState.params().remove(ITERATION); return result.get(); }

Target:
public <T> T await(Operation<Optional<T>> f) { TaskState pollState = state.nestedState(stateKey); Optional<Instant> startTime = pollState.params().getOptional(START_TIME, Instant.class); if (!startTime.isPresent()) { startTime = Optional.of(Instant.now()); pollState.params().set(START_TIME, startTime.get()); } TaskState operationState = pollState.nestedState(OPERATION); Optional<T> result; try { result = f.perform(operationState); } catch (Throwable e) { throw Throwables.propagate(e); } Instant now = Instant.now(); if (timeout.isPresent() && timeout.get().toMillis() <= now.toEpochMilli() - startTime.get().toEpochMilli()) { logger.trace("Timeout happened. startTime:{}, timeout:{}", startTime, timeout.get()); throw new PollingTimeoutException("Timeout happened"); } if (!result.isPresent()) { int iteration = pollState.params().get(ITERATION, int.class, 0); pollState.params().set(ITERATION, iteration + 1); int interval = calculateNextInterval(now, startTime.get(), iteration); String formattedErrorMessage = String.format(waitMessage, waitMessageParameters); logger.info("{}: checking again in {}", formattedErrorMessage, Durations.formatDuration(Duration.ofSeconds(interval))); throw pollState.pollingTaskExecutionException(interval); } pollState.params().remove(OPERATION); pollState.params().remove(ITERATION); return result.get(); }
Source:
private boolean isAllowed( MutableHttpServletRequest request, String paramName, String method) { String typeNameParam = request.getParameterIgnoreCase(paramName); List<Layer> all = layerService.findAll(); boolean match = false; for (Layer layer : all) { if (layer.getSource() instanceof WfsLayerDataSource) { WfsLayerDataSource source = (WfsLayerDataSource) layer.getSource(); if ((source.getTypeName().equalsIgnoreCase(typeNameParam) || source.getTypeNames().equalsIgnoreCase(typeNameParam)) && source.getUrl().equalsIgnoreCase(request.getContextPath() + "/geoserver.action")) { if (method.equals("UPDATE")) { match = checkForPermission(layer, Permission.UPDATE); } else if (method.equals("READ")) { match = true; } } } else if (layer.getSource() instanceof ImageWmsLayerDataSource) { ImageWmsLayerDataSource source = (ImageWmsLayerDataSource) layer.getSource(); if (source.getLayerNames().equalsIgnoreCase(typeNameParam) && source.getUrl().equalsIgnoreCase(request.getContextPath() + "/geoserver.action")) { if (method.equals("UPDATE")) { match = checkForPermission(layer, Permission.UPDATE); } else if (method.equals("READ")) { match = true; } } } } return match; }

Target:
private boolean isAllowed( MutableHttpServletRequest request, String paramName, String method) { String typeNameParam = request.getParameterIgnoreCase(paramName); List<Layer> all = layerService.findAll(); boolean match = false; for (Layer layer : all) { if (layer.getSource() instanceof WfsLayerDataSource) { WfsLayerDataSource source = (WfsLayerDataSource) layer.getSource(); if ((source.getTypeName().equalsIgnoreCase(typeNameParam) || source.getTypeNames().equalsIgnoreCase(typeNameParam)) && source.getUrl().equalsIgnoreCase(request.getContextPath() + "/geoserver.action")) { if (method.equals("UPDATE")) { match = checkForPermission(layer, Permission.UPDATE); } else if (method.equals("READ")) { match = true; } break; } } else if (layer.getSource() instanceof ImageWmsLayerDataSource) { ImageWmsLayerDataSource source = (ImageWmsLayerDataSource) layer.getSource(); if (source.getLayerNames().equalsIgnoreCase(typeNameParam) && source.getUrl().equalsIgnoreCase(request.getContextPath() + "/geoserver.action")) { if (method.equals("UPDATE")) { match = checkForPermission(layer, Permission.UPDATE); } else if (method.equals("READ")) { match = true; } break; } } } return match; }
Source:
private void resetComponents() { PlatformImpl.runLater(()-> { webEngine.setJavaScriptEnabled(false); javaScriptButton.setText(enableJavaScriptTxt); }); loadWebEngineContent(""); }

Target:
private void resetComponents() { Platform.runLater(()-> { webEngine.setJavaScriptEnabled(false); javaScriptButton.setText(enableJavaScriptTxt); }); loadWebEngineContent(""); }
Source:
public void onEvent(UnsupportedDMNEvent event) { confirmPopupPresenter.show("Unsupported DMN", event.getMessage()); }

Target:
public void onEvent(UnsupportedDMNEvent event) { confirmPopupPresenter.show("Unsupported DMN asset", event.getMessage()); }
Source:
public Object deserialize(Object serializedSketch) { if (serializedSketch instanceof String) { String str = (String) serializedSketch; return deserializeFromByteArray(Base64.decodeBase64(str.getBytes(Charsets.UTF_8))); } else if (serializedSketch instanceof byte[]) { return deserializeFromByteArray((byte[]) serializedSketch); } else if (serializedSketch instanceof MomentSketchWrapper) { return (MomentSketchWrapper) serializedSketch; } throw new ISE( "Object is not of a type that can be deserialized to a Moments Sketch" + serializedSketch.getClass()); }

Target:
public Object deserialize(Object serializedSketch) { if (serializedSketch instanceof String) { String str = (String) serializedSketch; return deserializeFromByteArray(StringUtils.decodeBase64(StringUtils.toUtf8(str))); } else if (serializedSketch instanceof byte[]) { return deserializeFromByteArray((byte[]) serializedSketch); } else if (serializedSketch instanceof MomentSketchWrapper) { return serializedSketch; } throw new ISE( "Object cannot be deserialized to a Moments Sketch: " + serializedSketch.getClass() ); }
Source:
public boolean writeHPCCFileData(byte data, String fileName, String targetLandingZone, boolean append, long offset, int uploadchunksize) throws Exception { boolean success = true; log.debug("Attempting to write data to HPCC File: " + fileName); getSoapProxy(); WriteFileDataRequest writefileparams = new WriteFileDataRequest(); writefileparams.setAppend(append); writefileparams.setDestDropZone(targetLandingZone); writefileparams.setDestRelativePath(fileName); writefileparams.setOffset(offset); int dataindex = 0; int limit = uploadchunksize <= 0 ? defaultUploadChunkSize : uploadchunksize; int payloadsize = 0; int bytesleft = data.length; byte subdata = null; while (bytesleft > 0) { payloadsize = bytesleft >= limit ? limit : bytesleft; log.trace("Writing offset: "+dataindex+"\t size: "+(dataindex + payloadsize)); subdata = Arrays.copyOfRange(data, 0, payloadsize-1); writefileparams.setData(subdata); writefileparams.setAppend(dataindex > 0); writefileparams.setOffset((long)dataindex); try { WriteFileDataResponse writeFileDataResponse = wsFileIOServiceSoapProxy.writeFileData(writefileparams); String result = writeFileDataResponse.getResult(); log.debug(result); if (!result.startsWith("Failed")) { success = true; bytesleft = bytesleft - subdata.length; } else { bytesleft = 0; } } catch (Exception e) { log.error(e.getLocalizedMessage()); return false; } } return success; }

Target:
public boolean writeHPCCFileData(byte data, String fileName, String targetLandingZone, boolean append, long offset, int uploadchunksize) throws Exception { boolean success = true; log.debug("Attempting to write data to HPCC File: " + fileName); getSoapProxy(); WriteFileDataRequest writefileparams = new WriteFileDataRequest(); writefileparams.setAppend(append); writefileparams.setDestDropZone(targetLandingZone); writefileparams.setDestRelativePath(fileName); writefileparams.setOffset(offset); int dataindex = 0; int limit = uploadchunksize <= 0 ? defaultUploadChunkSize : uploadchunksize; int payloadsize = 0; int bytesleft = data.length; byte subdata = null; while (bytesleft > 0) { payloadsize = bytesleft >= limit ? limit : bytesleft; log.trace("Writing offset: "+dataindex+"\t size: " + payloadsize); subdata = Arrays.copyOfRange(data, dataindex, dataindex + payloadsize); dataindex += payloadsize; writefileparams.setData(subdata); writefileparams.setAppend(dataindex > 0); writefileparams.setOffset((long)dataindex); try { WriteFileDataResponse writeFileDataResponse = wsFileIOServiceSoapProxy.writeFileData(writefileparams); String result = writeFileDataResponse.getResult(); log.debug(result); if (!result.startsWith("Failed")) { success = true; bytesleft = bytesleft - subdata.length; } else { bytesleft = 0; } } catch (Exception e) { log.error(e.getLocalizedMessage()); return false; } } return success; }
Source:
public void inflatesubmissionDate() { mfDatePicker = MFDatePicker.newInsance(this); tvSubmittedOnDate.setText(MFDatePicker.getDatePickedAsString()); tvSubmittedOnDate.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { mfDatePicker.show(getActivity().getSupportFragmentManager(), FragmentConstants .DFRAG_DATE_PICKER); } }); }

Target:
public void inflatesubmissionDate() { mfDatePicker = MFDatePicker.newInsance(this); tvSubmittedOnDate.setText(MFDatePicker.getDatePickedAsString()); }
Source:
public void addFile(String fileName, File file) throws Exception { Git gitProject = getGitProject(); CommonTestUtil.copy(file, new File(getFolder(), fileName)); gitProject.add().addFilepattern(".").call(); }

Target:
public void addFile(String fileName, File file) throws Exception { Git gitProject = getGitProject(); CommonTestUtil.copy(file, new File(getFolder(), fileName)); gitProject.add().addFilepattern(fileName).call(); }
Source:
public void multiIndex_incompatibleAnalyzer_skipAnalysis() { StubMappingSearchScope scope = indexManager.createSearchScope( incompatibleAnalyzerIndexManager ); String absoluteFieldPath = indexMapping.analyzedStringField1.relativeFieldName; IndexSearchQuery<DocumentReference> query = scope.query().asReference() .predicate( f -> f.phrase().onField( absoluteFieldPath ).matching( PHRASE_1_UNIQUE_TERM ) .skipAnalysis() ) .toQuery(); assertThat( query ).assertThat( query ).hasDocRefHitsAnyOrder( b -> { b.doc( INDEX_NAME, DOCUMENT_1, DOCUMENT_2, DOCUMENT_3, DOCUMENT_4 ); b.doc( INCOMPATIBLE_ANALYZER_INDEX_NAME, INCOMPATIBLE_ANALYZER_INDEX_DOCUMENT_1 ); } ); }

Target:
public void multiIndex_incompatibleAnalyzer_skipAnalysis() { StubMappingSearchScope scope = indexManager.createSearchScope( incompatibleAnalyzerIndexManager ); String absoluteFieldPath = indexMapping.analyzedStringField1.relativeFieldName; IndexSearchQuery<DocumentReference> query = scope.query().asReference() .predicate( f -> f.phrase().onField( absoluteFieldPath ).matching( PHRASE_1_UNIQUE_TERM ) .skipAnalysis() ) .toQuery(); assertThat( query ).hasDocRefHitsAnyOrder( b -> { b.doc( INDEX_NAME, DOCUMENT_1, DOCUMENT_2, DOCUMENT_3, DOCUMENT_4 ); b.doc( INCOMPATIBLE_ANALYZER_INDEX_NAME, INCOMPATIBLE_ANALYZER_INDEX_DOCUMENT_1 ); } ); }
Source:
public AzureMonitorExporterBuilder connectionString(String connectionString) { this.instrumentationKey = extractInstrumentationKey(connectionString); return this; }

Target:
public AzureMonitorExporterBuilder connectionString(String connectionString) { Map<String, String> keyValues = extractKeyValuesFromConnectionString(connectionString); if (!keyValues.containsKey("InstrumentationKey")) { throw logger.logExceptionAsError( new IllegalArgumentException("InstrumentationKey not found in connectionString")); } this.instrumentationKey = keyValues.get("InstrumentationKey"); String endpoint = keyValues.get("IngestionEndpoint"); if (endpoint != null) { this.endpoint(endpoint); } return this; }
Source:
private void waitForJobStatusChangeOrTimeout(SolverManager<TestdataSolution, Long> solverManager, Long problemId, SolverStatus expectedStatusChange) throws InterruptedException { long t = System.currentTimeMillis(); long end = t + 5000; while (true) { t = System.currentTimeMillis(); if (t < end) { if (solverManager.getSolverStatus(problemId) == expectedStatusChange) { break; } TimeUnit.MILLISECONDS.sleep(5); } else { fail("Job with id " + problemId + " took too long and timed-out not changing its status from " + solverManager.getSolverStatus(problemId) + " to " + expectedStatusChange + "."); } } }

Target:
private void waitForJobStatusChangeOrTimeout(SolverManager<TestdataSolution, Long> solverManager, Long problemId, SolverStatus expectedStatusChange) throws InterruptedException { long t = System.currentTimeMillis(); long end = t + 5000; while (t < end) { if (solverManager.getSolverStatus(problemId) == expectedStatusChange) { return; } TimeUnit.MILLISECONDS.sleep(5); t = System.currentTimeMillis(); } fail("Job with id " + problemId + " took too long and timed-out not changing its status from " + solverManager.getSolverStatus(problemId) + " to " + expectedStatusChange + "."); }
Source:
private String branchUrlOf(Project project, Branch branch) { if (branch.getType() == Branch.Type.LONG) { if (branch.isMain()) { return projectUrlOf(project); } return format("%s/dashboard?branch=%s&id=%s", server.getPublicRootUrl(), encode(branch.getName().orElse("")), encode(project.getKey())); } else if (branch.getType() == Branch.Type.SHORT) { return format("%s/project/issues?branch=%s&id=%s&resolved=false", server.getPublicRootUrl(), encode(branch.getName().orElse("")), encode(project.getKey())); } else { return format("%s/project/issues?pullRequest=%s&id=%s&resolved=false", server.getPublicRootUrl(), encode(branch.getName().orElse("")), encode(project.getKey())); } }

Target:
private String branchUrlOf(Project project, Branch branch) { if (branch.getType() == Branch.Type.LONG) { if (branch.isMain()) { return projectUrlOf(project); } return format("%s/dashboard?branch=%s&id=%s", server.getPublicRootUrl(), encode(branch.getName().orElse("")), encode(project.getKey())); } if (branch.getType() == Branch.Type.SHORT) { return format("%s/project/issues?branch=%s&id=%s&resolved=false", server.getPublicRootUrl(), encode(branch.getName().orElse("")), encode(project.getKey())); } if (branch.getType() == Branch.Type.PULL_REQUEST) { return format("%s/project/issues?pullRequest=%s&id=%s&resolved=false", server.getPublicRootUrl(), encode(branch.getName().orElse("")), encode(project.getKey())); } return projectUrlOf(project); }
Source:
public boolean isApplicable(UpgradeCheckRequest request) throws AmbariException { UpgradeType upgradeType = request.getUpgradeType(); UpgradeCheckInfo annotation = m_checkClass.getAnnotation(UpgradeCheckInfo.class); if (null == annotation) { return true; } UpgradeType[] upgradeTypes = annotation.required(); if (ArrayUtils.isEmpty(upgradeTypes) || ArrayUtils.contains(upgradeTypes, upgradeType)) { return true; } return false; }

Target:
public boolean isApplicable(UpgradeCheckRequest request) throws AmbariException { UpgradeType upgradeType = request.getUpgradeType(); UpgradeCheckInfo annotation = m_checkClass.getAnnotation(UpgradeCheckInfo.class); if (null == annotation) { return true; } UpgradeType[] upgradeTypes = annotation.required(); return (ArrayUtils.isEmpty(upgradeTypes) || ArrayUtils.contains(upgradeTypes, upgradeType)); }
Source:
public void receiveDmg(float dmg, SolGame game, Vector2 position, DmgType dmgType) { if(isInvincible == true){ return; } if (dmg <= 0) { return; } if (myShield != null && myShield.canAbsorb(dmgType)) { myShield.absorb(game, dmg, position, this, dmgType); return; } if (myArmor != null) { if (dmgType == DmgType.ENERGY) { dmg *= ENERGY_DMG_FACTOR; } dmg *= (1 - myArmor.getPerc()); } getHitWith(dmg, game, position, dmgType); }

Target:
public void receiveDmg(float dmg, SolGame game, Vector2 position, DmgType dmgType) { Hero hero = game.getHero(); if (dmg <= 0 || (hero.isInvincible() && hero.getShip() == this)) { return; } if (myShield != null && myShield.canAbsorb(dmgType)) { myShield.absorb(game, dmg, position, this, dmgType); return; } if (myArmor != null) { if (dmgType == DmgType.ENERGY) { dmg *= ENERGY_DMG_FACTOR; } dmg *= (1 - myArmor.getPerc()); } getHitWith(dmg, game, position, dmgType); }
Source:
public void run() { logger.debug("Error storing object to dynamo, unprocessed items: {}. Retrying with exponential back-off", unprocessedItems); lastException = null; while (!unprocessedItems.isEmpty() && retry < WAIT_MILLIS_IN_RETRIES.length) { if (!sleep()) { return; } retry++; try { BatchWriteItemOutcome outcome = DynamoDBPersistenceService.this.db.getDynamoDB() .batchWriteItemUnprocessed(unprocessedItems); unprocessedItems = outcome.getUnprocessedItems(); lastException = null; } catch (AmazonServiceException e) { if (e instanceof ResourceNotFoundException) { logger.debug( "DynamoDB query raised unexpected exception: {}. This might happen if table was recently created", e.getMessage()); } else { logger.debug("DynamoDB query raised unexpected exception: {}.", e.getMessage()); } lastException = e; continue; } } if (unprocessedItems.isEmpty()) { logger.debug("After retries successfully wrote all unprocessed items", retry); } else { logger.error( "Even after retries failed to write some items. Last exception: {}, unprocessed items: {}", lastException == null ? "null" : lastException.getClass().getName(), lastException == null ? "null" : lastException.getMessage(), unprocessedItems); } }

Target:
public void run() { logger.debug("Error storing object to dynamo, unprocessed items: {}. Retrying with exponential back-off", unprocessedItems); lastException = null; while (!unprocessedItems.isEmpty() && retry < WAIT_MILLIS_IN_RETRIES.length) { if (!sleep()) { return; } retry++; try { BatchWriteItemOutcome outcome = DynamoDBPersistenceService.this.db.getDynamoDB() .batchWriteItemUnprocessed(unprocessedItems); unprocessedItems = outcome.getUnprocessedItems(); lastException = null; } catch (AmazonServiceException e) { if (e instanceof ResourceNotFoundException) { logger.debug( "DynamoDB query raised unexpected exception: {}. This might happen if table was recently created", e.getMessage()); } else { logger.debug("DynamoDB query raised unexpected exception: {}.", e.getMessage()); } lastException = e; continue; } } if (unprocessedItems.isEmpty()) { logger.debug("After retries successfully wrote all unprocessed items", retry); } else { logger.warn( "Even after retries failed to write some items. Last exception: {}, unprocessed items: {}", lastException == null ? "null" : lastException.getClass().getName(), lastException == null ? "null" : lastException.getMessage(), unprocessedItems); } }
Source:
public void onLoadFinished(Loader<Cursor> loader, Cursor data) { if (isThreadDisplay && data.getCount() == 0) { handler.goBack(); return; } swipeRefreshLayout.setRefreshing(false); swipeRefreshLayout.setEnabled(isPullToRefreshAllowed()); final int loaderId = loader.getId(); cursors[loaderId] = data; cursorValid[loaderId] = true; Cursor cursor; if (cursors.length > 1) { cursor = new MergeCursorWithUniqueId(cursors, getComparator()); uniqueIdColumn = cursor.getColumnIndex("_id"); } else { cursor = data; uniqueIdColumn = ID_COLUMN; } if (adapter != null) adapter.setUniqueIdColumn(uniqueIdColumn); if (isThreadDisplay) { if (cursor.moveToFirst()) { title = cursor.getString(SUBJECT_COLUMN); if (!TextUtils.isEmpty(title)) { title = Utility.stripSubject(title); } if (TextUtils.isEmpty(title)) { title = getString(R.string.general_no_subject); } updateTitle(); } else { } } cleanupSelected(cursor); updateContextMenu(cursor); adapter.swapCursor(cursor); resetActionMode(); computeBatchDirection(); if (isLoadFinished()) { if (savedListState != null) { handler.restoreListPosition(); } fragmentListener.updateMenu(); } }

Target:
public void onLoadFinished(Loader<Cursor> loader, Cursor data) { if (isThreadDisplay && data.getCount() == 0) { handler.goBack(); return; } swipeRefreshLayout.setRefreshing(false); swipeRefreshLayout.setEnabled(isPullToRefreshAllowed()); final int loaderId = loader.getId(); cursors[loaderId] = data; cursorValid[loaderId] = true; Cursor cursor; if (cursors.length > 1) { cursor = new MergeCursorWithUniqueId(cursors, getComparator()); uniqueIdColumn = cursor.getColumnIndex("_id"); } else { cursor = data; uniqueIdColumn = ID_COLUMN; } adapter.setUniqueIdColumn(uniqueIdColumn); if (isThreadDisplay) { if (cursor.moveToFirst()) { title = cursor.getString(SUBJECT_COLUMN); if (!TextUtils.isEmpty(title)) { title = Utility.stripSubject(title); } if (TextUtils.isEmpty(title)) { title = getString(R.string.general_no_subject); } updateTitle(); } else { } } cleanupSelected(cursor); updateContextMenu(cursor); adapter.swapCursor(cursor); resetActionMode(); computeBatchDirection(); if (isLoadFinished()) { if (savedListState != null) { handler.restoreListPosition(); } fragmentListener.updateMenu(); } }
Source:
@Override public void initialize(InputSplit spl, TaskAttemptContext ctx) throws IOException { if(isInitialized) close(); isInitialized = true; final Configuration conf = ContextUtil.getConfiguration(ctx); final FileVirtualSplit split = (FileVirtualSplit)spl; final Path file = split.getPath(); final FileSystem fs = file.getFileSystem(conf); this.stringency = SAMHeaderReader.getValidationStringency(conf); final FSDataInputStream in = fs.open(file); final SAMFileHeader header = SAMHeaderReader.readSAMHeaderFrom(in, conf); codec = new BAMRecordCodec(header); in.seek(0); bci = new BlockCompressedInputStream( new WrapSeekable<FSDataInputStream>( in, fs.getFileStatus(file).getLen(), file)); virtualStart = split.getStartVirtualOffset(); fileStart = virtualStart >>> 16; virtualEnd = split.getEndVirtualOffset(); bci.seek(virtualStart); codec.setInputStream(bci); if(BAMInputFormat.DEBUG_BAM_SPLITTER) { final long recordStart = virtualStart & 0xffff; System.err.println("XXX inizialized BAMRecordReader byte offset: " + fileStart + " record offset: " + recordStart); } keepReadPairsTogether = SortOrder.queryname.equals(header.getSortOrder()) && conf.getBoolean(BAMInputFormat.KEEP_PAIRED_READS_TOGETHER_PROPERTY, false); readPair = false; lastOfPair = false; intervals = BAMInputFormat.getIntervals(conf); if (intervals != null) { overlapDetector = new OverlapDetector<>(0, 0); overlapDetector.addAll(intervals, intervals); } }

Target:
@Override public void initialize(InputSplit spl, TaskAttemptContext ctx) throws IOException { if(isInitialized) close(); isInitialized = true; final Configuration conf = ctx.getConfiguration(); final FileVirtualSplit split = (FileVirtualSplit)spl; final Path file = split.getPath(); final FileSystem fs = file.getFileSystem(conf); this.stringency = SAMHeaderReader.getValidationStringency(conf); final FSDataInputStream in = fs.open(file); final SAMFileHeader header = SAMHeaderReader.readSAMHeaderFrom(in, conf); codec = new BAMRecordCodec(header); in.seek(0); bci = new BlockCompressedInputStream( new WrapSeekable<FSDataInputStream>( in, fs.getFileStatus(file).getLen(), file)); virtualStart = split.getStartVirtualOffset(); fileStart = virtualStart >>> 16; virtualEnd = split.getEndVirtualOffset(); bci.seek(virtualStart); codec.setInputStream(bci); if(BAMInputFormat.DEBUG_BAM_SPLITTER) { final long recordStart = virtualStart & 0xffff; System.err.println("XXX inizialized BAMRecordReader byte offset: " + fileStart + " record offset: " + recordStart); } keepReadPairsTogether = SortOrder.queryname.equals(header.getSortOrder()) && conf.getBoolean(BAMInputFormat.KEEP_PAIRED_READS_TOGETHER_PROPERTY, false); readPair = false; lastOfPair = false; intervals = BAMInputFormat.getIntervals(conf); if (intervals != null) { overlapDetector = new OverlapDetector<>(0, 0); overlapDetector.addAll(intervals, intervals); } }
Source:
public GetVmConfigurationBySnapshotQueryParams(Guid snapshotSourceId) { super(); this.snapshotSourceId = snapshotSourceId; }

Target:
public GetVmConfigurationBySnapshotQueryParams(Guid snapshotSourceId) { this.snapshotSourceId = snapshotSourceId; }