auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static void updatePersistedDomain(String previousDomain, String newDomain, int tenantId, DataSource dataSource) throws UserStoreException { Connection dbConnection = null; try { String sqlStatement = JDBCRealmConstants.UPDATE_DOMAIN_SQL; if (previousDomain != null) { previousDomain = previousDomain.toUpperCase(); } if (newDomain != null) { newDomain = newDomain.toUpperCase(); } if (isExistingDomain(previousDomain, tenantId, dataSource)) { if (!isExistingDomain(newDomain, tenantId, dataSource)) { deletePersistedDomain(newDomain, tenantId, dataSource); } dbConnection = DatabaseUtil.getDBConnection(dataSource); dbConnection.setAutoCommit(false); DatabaseUtil.updateDatabase(dbConnection, sqlStatement, newDomain, previousDomain, tenantId); dbConnection.commit(); } } catch (SQLException e) { String errorMessage = "Error occurred while updating persisted domain :" + previousDomain + " to domain :" + newDomain + " for tenant id :" + tenantId; if (log.isDebugEnabled()) { log.debug(errorMessage, e); } throw new UserStoreException(errorMessage); } finally { DatabaseUtil.closeAllConnections(dbConnection); } }

Target:
public static void updatePersistedDomain(String previousDomain, String newDomain, int tenantId, DataSource dataSource) throws UserStoreException { Connection dbConnection = null; try { String sqlStatement = JDBCRealmConstants.UPDATE_DOMAIN_SQL; if (previousDomain != null) { previousDomain = previousDomain.toUpperCase(); } if (newDomain != null) { newDomain = newDomain.toUpperCase(); } if (isExistingDomain(previousDomain, tenantId, dataSource)) { if (!isExistingDomain(newDomain, tenantId, dataSource)) { deletePersistedDomain(newDomain, tenantId, dataSource); } dbConnection = DatabaseUtil.getDBConnection(dataSource); dbConnection.setAutoCommit(false); DatabaseUtil.updateDatabase(dbConnection, sqlStatement, newDomain, previousDomain, tenantId); dbConnection.commit(); } } catch (SQLException e) { String errorMessage = "Error occurred while updating persisted domain :" + previousDomain + " to domain :" + newDomain + " for tenant id :" + tenantId; if (log.isDebugEnabled()) { log.debug(errorMessage, e); } throw new UserStoreException(errorMessage, e); } finally { DatabaseUtil.closeAllConnections(dbConnection); } }
Source:
public Object answer(InvocationOnMock invocation) throws Throwable { if (throwable == null) { throw new IllegalStateException("throwable is null: " + "you shall not call #answer if #validateFor fails!"); } if (MockUtil.isMock(throwable)) { throw throwable; } throwable.fillInStackTrace(); filter.filter(throwable); throw throwable; }

Target:
public Object answer(InvocationOnMock invocation) throws Throwable { if (throwable == null) { throw new IllegalStateException("throwable is null: " + "you shall not call #answer if #validateFor fails!"); } if (MockUtil.isMock(throwable)) { throw throwable; } Throwable t = throwable.fillInStackTrace(); if (t == null) { throw throwable; } filter.filter(t); throw t; }
Source:
public void testReferenceLocalDiskCache() { System.setProperty("samjdk.ref_cache", TEST_DIR + "%s"); final File cramFile = new File(TEST_DIR + "auxf#values.3.0.cram"); CRAMReferenceSource refSource = ReferenceSource.getDefaultCRAMReferenceSource(); CRAMFileReader cramFileReader = new CRAMFileReader(cramFile, refSource); cramFileReader.getIterator().next(); }

Target:
public void testReferenceLocalDiskCache() { final File cramFile = new File(TEST_DIR + "auxf#values.3.0.cram"); CRAMReferenceSource refSource = ReferenceSource.getDefaultCRAMReferenceSource(); CRAMFileReader cramFileReader = new CRAMFileReader(cramFile, refSource); cramFileReader.getIterator().next(); }
Source:
public void postCollectionDefaultItemReadGroupCreateDefaultItemReadGroupDcTitleUnprocessable() throws Exception { ObjectMapper mapper = new ObjectMapper(); GroupRest groupRest = new GroupRest(); MetadataRest metadataRest = new MetadataRest(); metadataRest.put("dc.description", new MetadataValueRest("testingDescription")); metadataRest.put("dc.subject", new MetadataValueRest("testSubject")); metadataRest.put("dc.title", new MetadataValueRest("testTitle")); groupRest.setMetadata(metadataRest); AtomicReference<UUID> idRef = new AtomicReference<>(); String token = getAuthToken(admin.getEmail(), password); getClient(token).perform(post("/api/core/collections/" + collection.getID() + "/itemReadGroup") .content(mapper.writeValueAsBytes(groupRest)) .contentType(contentType)) .andExpect(status().isUnprocessableEntity()); }

Target:
public void postCollectionDefaultItemReadGroupCreateDefaultItemReadGroupDcTitleUnprocessable() throws Exception { ObjectMapper mapper = new ObjectMapper(); GroupRest groupRest = new GroupRest(); MetadataRest metadataRest = new MetadataRest(); metadataRest.put("dc.description", new MetadataValueRest("testingDescription")); metadataRest.put("dc.subject", new MetadataValueRest("testSubject")); metadataRest.put("dc.title", new MetadataValueRest("testTitle")); groupRest.setMetadata(metadataRest); AtomicReference<UUID> idRef = new AtomicReference<>(); String token = getAuthToken(admin.getEmail(), password); getClient(token).perform(post("/api/core/collections/" + collection.getID() + "/itemReadGroup") .content(mapper.writeValueAsBytes(groupRest)) .contentType(contentType)) .andExpect(status().isUnprocessableEntity()); Group anon = groupService.findByName(context, Group.ANONYMOUS); getClient(token).perform(get("/api/core/collections/" + collection.getID() + "/itemReadGroup")) .andExpect(status().isOk()) .andExpect( jsonPath("$", GroupMatcher.matchGroupEntry(anon.getID(), anon.getName()))); }
Source:
private List<SimpleFeature> getFeature(List<PeakDetection.GoodPeakInfo> goodPeakList) { List<SimpleFeature> featureList = new ArrayList<SimpleFeature>(); int lowerScanBound; int upperScanBound; for (int i = 0; i < goodPeakList.size(); i++) { lowerScanBound = goodPeakList.get(i).lowerScanBound; upperScanBound = goodPeakList.get(i).upperScanBound; double mz = goodPeakList.get(i).mz; float[] rtArray = objSliceSparseMatrix.getRetentionTimeArray(lowerScanBound, upperScanBound); float[] intensityArray = objSliceSparseMatrix.getIntensities(goodPeakList.get(i)); double[] mzArray = new double[upperScanBound - lowerScanBound + 1]; for (int j = 0; j < upperScanBound - lowerScanBound + 1; j++) { mzArray[j] = mz; } SimpleChromatogram chromatogram = new SimpleChromatogram(); chromatogram.setDataPoints(rtArray, mzArray, intensityArray, upperScanBound - lowerScanBound + 1); SimpleFeature feature = new SimpleFeature(); feature.setArea(CurveTool.normalize(intensityArray)); feature.setHeight(goodPeakList.get(i).maxHeight); feature.setRetentionTime( (float) objSliceSparseMatrix.getRetentionTime(goodPeakList.get(i).maxHeightScanNumber)); feature.setMz(mz); feature.setChromatogram(chromatogram); featureList.add(feature); } return featureList; }

Target:
private List<SimpleFeature> getFeature(List<PeakDetection.GoodPeakInfo> goodPeakList) { List<SimpleFeature> featureList = new ArrayList<SimpleFeature>(); int lowerScanBound; int upperScanBound; for (PeakDetection.GoodPeakInfo goodPeakInfo : goodPeakList) { lowerScanBound = goodPeakInfo.lowerScanBound; upperScanBound = goodPeakInfo.upperScanBound; double mz = goodPeakInfo.mz; float[] rtArray = objSliceSparseMatrix.getRetentionTimeArray(lowerScanBound, upperScanBound); float[] intensityArray = objSliceSparseMatrix.getIntensities(goodPeakInfo); double[] mzArray = new double[upperScanBound - lowerScanBound + 1]; for (int j = 0; j < upperScanBound - lowerScanBound + 1; j++) { mzArray[j] = mz; } SimpleChromatogram chromatogram = new SimpleChromatogram(); chromatogram.setDataPoints(rtArray, mzArray, intensityArray, upperScanBound - lowerScanBound + 1); SimpleFeature feature = new SimpleFeature(); feature.setArea(CurveTool.normalize(intensityArray)); feature.setHeight(goodPeakInfo.maxHeight); int maxHeightScanNumber = goodPeakInfo.maxHeightScanNumber; float retentionTime = (float) objSliceSparseMatrix.getRetentionTime(maxHeightScanNumber); feature.setRetentionTime(retentionTime); feature.setMz(mz); feature.setChromatogram(chromatogram); featureList.add(feature); } return featureList; }
Source:
Map<String, InstanceMetrics> parse( TopologyMaster.MetricResponse response, String component, String metric) { Map<String, InstanceMetrics> metricsData = new HashMap<>(); if (response == null || !response.getStatus().getStatus().equals(StatusCode.OK)) { return metricsData; } if (response.getMetricCount() == 0) { LOG.info(String.format("Did not get any metrics from tracker for %s:%s ", component, metric)); return metricsData; } for (TaskMetric tm :response.getMetricList()) { String instanceId = tm.getInstanceId(); InstanceMetrics instanceMetrics = new InstanceMetrics(instanceId); for (IndividualMetric im: tm.getMetricList()) { String metricName = im.getName(); Map<Instant, Double> values = new HashMap<>(); for (IntervalValue iv: im.getIntervalValuesList()) { MetricInterval mi = iv.getInterval(); String value = iv.getValue(); values.put(Instant.ofEpochSecond(mi.getStart()), Double.parseDouble(value)); } if (!values.isEmpty()) { instanceMetrics.addMetric(metricName, values); } } metricsData.put(instanceId, instanceMetrics); } return metricsData; }

Target:
Map<String, InstanceMetrics> parse( TopologyMaster.MetricResponse response, String component, String metric) { Map<String, InstanceMetrics> metricsData = new HashMap<>(); if (response == null || !response.getStatus().getStatus().equals(StatusCode.OK)) { return metricsData; } if (response.getMetricCount() == 0) { LOG.info(String.format( "Did not get any metrics from MetricsCache for %s:%s ", component, metric)); return metricsData; } for (TaskMetric tm :response.getMetricList()) { String instanceId = tm.getInstanceId(); InstanceMetrics instanceMetrics = new InstanceMetrics(instanceId); for (IndividualMetric im: tm.getMetricList()) { String metricName = im.getName(); Map<Instant, Double> values = new HashMap<>(); for (IntervalValue iv: im.getIntervalValuesList()) { MetricInterval mi = iv.getInterval(); String value = iv.getValue(); values.put(Instant.ofEpochSecond(mi.getStart()), Double.parseDouble(value)); } if (!values.isEmpty()) { instanceMetrics.addMetric(metricName, values); } } metricsData.put(instanceId, instanceMetrics); } return metricsData; }
Source:
@Override public boolean canHandleRequest(@NonNull Request data) { Uri uri = data.uri; if (uri == null) return false; return (SCHEME_FILE.equals(uri.getScheme()) && !uri.getPathSegments().isEmpty() && ANDROID_ASSET.equals(uri.getPathSegments().get(0))); }

Target:
@Override public boolean canHandleRequest(@NonNull Request data) { Uri uri = data.uri; return uri != null && SCHEME_FILE.equals(uri.getScheme()) && !uri.getPathSegments().isEmpty() && ANDROID_ASSET.equals(uri.getPathSegments().get(0)); }
Source:
private Reader readBinaryMetaData(FileChannel metadataFileChannel) throws CTFReaderException { Reader metadataTextInput; StringBuffer metadataText = new StringBuffer(); MetadataPacketHeader packetHeader = readMetadataPacket( metadataFileChannel, metadataText); while (packetHeader != null) { packetHeader = readMetadataPacket(metadataFileChannel, metadataText); } metadataTextInput = new StringReader(metadataText.toString()); return metadataTextInput; }

Target:
private Reader readBinaryMetaData(FileChannel metadataFileChannel) throws CTFReaderException { StringBuffer metadataText = new StringBuffer(); MetadataPacketHeader packetHeader = readMetadataPacket( metadataFileChannel, metadataText); while (packetHeader != null) { packetHeader = readMetadataPacket(metadataFileChannel, metadataText); } return new StringReader(metadataText.toString()); }
Source:
private ApiInfo apiInfo() { Contact contact = new Contact("CHPL Development Team. " + "Please submit any questions using the Health IT Feedback Form and " + "select the \"Certified Health IT Products List (CHPL)\" category.", "<LINK_1>", ""); return new ApiInfo("CHPL", "Certified Health IT Product Listing", "18.0.0", "http://terms/of/service.url", contact, "License Text", "<LINK_0>"); }

Target:
private ApiInfo apiInfo() { Contact contact = new Contact("CHPL Development Team. " + "Please submit any questions using the Health IT Feedback Form and " + "select the \"Certified Health IT Products List (CHPL)\" category.", "<LINK_1>", ""); return new ApiInfo("CHPL", "Certified Health IT Product Listing", "18.0.0", "", contact, "License Text", "<LINK_0>"); }
Source:
private String getOAuthScope() { StringBuilder builder = null; if (scopes != null) { for (TencentQQScope value : scopes) { if (builder == null) { builder = new StringBuilder(); } else { builder.append(","); } builder.append(value.toString()); } } return builder == null ? null : builder.toString(); }

Target:
private String getOAuthScope() { StringBuilder builder = null; if (scopes != null) { for (QQScope value : scopes) { if (builder == null) { builder = new StringBuilder(); } else { builder.append(","); } builder.append(value.toString().toLowerCase()); } } else { builder = new StringBuilder(); builder.append(QQScope.GET_USER_INFO.toString().toLowerCase()); } return builder == null ? null : builder.toString(); }
Source:
protected Set<String> buildDependencies(IActivityManager activityManager, String activityId) { Set<String> set = new HashSet<>(); for (String string : activityManager.getDefinedActivityIds()) { IActivity activity = activityManager.getActivity(string); for (IActivityRequirementBinding binding : activity.getActivityRequirementBindings()) { if (activityId.equals(binding.getRequiredActivityId())) { set.addAll(buildDependencies(activityManager, activity.getId())); } } } set.add(activityId); return set; }

Target:
protected Set<String> buildDependencies(IActivityManager activityManager, String activityId) { Set<String> set = new HashSet<>(); for (String id : activityManager.getDefinedActivityIds()) { IActivity activity = activityManager.getActivity(id); for (IActivityRequirementBinding binding : activity.getActivityRequirementBindings()) { if (activityId.equals(binding.getRequiredActivityId())) { set.addAll(buildDependencies(activityManager, activity.getId())); } } } set.add(activityId); return set; }
Source:
private void updateProperties() { VM vm = (VM) getEntity(); setClientIp(vm.getClientIp()); setConsoleUserName(vm.getConsoleCurentUserName()); setGuestUserName(vm.getGuestCurentUserName()); setGuestOsArch(vm.getGuestOsArch()); setGuestOsCodename(vm.getGuestOsCodename()); setGuestOsDistribution(vm.getGuestOsDistribution()); setGuestOsKernelVersion(vm.getGuestOsKernelVersion()); setGuestOsType(vm.getGuestOsType()); setGuestOsVersion(vm.getGuestOsVersion()); setTimezoneName(vm.getGuestOsTimezoneName()); setTimezoneOffset(vm.getGuestOsTimezoneOffset()); if(guestOsType == OsType.Linux) { String optional = ""; if(!StringUtils.isEmpty(guestOsCodename)) { optional = messages.guestOSVersionOptional(guestOsCodename); } guestOsNamedVersion = messages.guestOSVersionLinux(guestOsDistribution, guestOsVersion, optional); } else if(guestOsType == OsType.Windows && guestOs.startsWith("Win ")) { if(guestOs.startsWith("Win 20")) { guestOsNamedVersion = messages.guestOSVersionWindowsServer(guestOs.substring(4), guestOsVersion); } else { guestOsNamedVersion = messages.guestOSVersionWindows(guestOs.substring(4), guestOsVersion); } } String hours = NumberFormat.getFormat("00").format(timezoneOffset / 60.); String minutes = NumberFormat.getFormat("00").format(timezoneOffset % 60); if(timezoneOffset >= 0) { guestOsTimezone = messages.positiveTimezoneOffset(timezoneName, hours, minutes); } else { guestOsTimezone = messages.negativeTimezoneOffset(timezoneName, hours, minutes); } }

Target:
private void updateProperties() { VM vm = getEntity(); setClientIp(vm.getClientIp()); setConsoleUserName(vm.getConsoleCurentUserName()); setGuestUserName(vm.getGuestCurentUserName()); setGuestOsArch(vm.getGuestOsArch()); setGuestOsCodename(vm.getGuestOsCodename()); setGuestOsDistribution(vm.getGuestOsDistribution()); setGuestOsKernelVersion(vm.getGuestOsKernelVersion()); setGuestOsType(vm.getGuestOsType()); setGuestOsVersion(vm.getGuestOsVersion()); setGuestOsTimezoneName(vm.getGuestOsTimezoneName()); setGuestOsTimezoneOffset(vm.getGuestOsTimezoneOffset()); if (guestOsType == OsType.Linux) { String optional = ""; if (!StringUtils.isEmpty(guestOsCodename)) { optional = messages.guestOSVersionOptional(guestOsCodename); } guestOsNamedVersion = messages.guestOSVersionLinux(guestOsDistribution, guestOsVersion, optional); } else if (guestOsType == OsType.Windows && guestOs.startsWith("Win ")) { if (guestOs.startsWith("Win 20")) { guestOsNamedVersion = messages.guestOSVersionWindowsServer(guestOs.substring(4), guestOsVersion); } else { guestOsNamedVersion = messages.guestOSVersionWindows(guestOs.substring(4), guestOsVersion); } } String hours = NumberFormat.getFormat("00").format(guestOsTimezoneOffset / 60.); String minutes = NumberFormat.getFormat("00").format(guestOsTimezoneOffset % 60); if (guestOsTimezoneOffset >= 0) { guestOsTimezone = messages.positiveTimezoneOffset(guestOsTimezoneName, hours, minutes); } else { guestOsTimezone = messages.negativeTimezoneOffset(guestOsTimezoneName, hours, minutes); } }
Source:
public Optional<Boolean> wasSuccessful() { return success; }

Target:
public Optional<Boolean> wasSuccessful() { return this.success; }
Source:
public InputStream call() throws Exception { try { ReportListenerThreadHolder.setListener( listener ); final long start = System.currentTimeMillis(); AuditHelper.audit( userSession, userSession, url, getClass().getName(), getClass() .getName(), MessageTypes.INSTANCE_START, instanceId, "", 0, null ); if ( reportComponent.execute() ) { final long end = System.currentTimeMillis(); AuditHelper.audit( userSession, userSession, url, getClass().getName(), getClass() .getName(), MessageTypes.FAILED, instanceId, "", ( (float) ( end - start ) / 1000 ), null ); listener.setStatus( AsyncExecutionStatus.FINISHED ); return handler.getStagingContent(); } listener.setStatus( AsyncExecutionStatus.FAILED ); AuditHelper.audit( userSession, userSession, url, getClass().getName(), getClass() .getName(), MessageTypes.FAILED, instanceId, "", 0, null ); return new NullInputStream( 0 ); } finally { ReportListenerThreadHolder.clear(); } }

Target:
public InputStream call() throws Exception { try { ReportListenerThreadHolder.setListener( listener ); final long start = System.currentTimeMillis(); AuditHelper.audit( userSession, userSession, url, getClass().getName(), getClass() .getName(), MessageTypes.INSTANCE_START, instanceId, "", 0, null ); if ( reportComponent.execute() ) { final long end = System.currentTimeMillis(); AuditHelper.audit( userSession, userSession, url, getClass().getName(), getClass() .getName(), MessageTypes.INSTANCE_END, instanceId, "", ( (float) ( end - start ) / 1000 ), null ); listener.setStatus( AsyncExecutionStatus.FINISHED ); return handler.getStagingContent(); } listener.setStatus( AsyncExecutionStatus.FAILED ); AuditHelper.audit( userSession, userSession, url, getClass().getName(), getClass() .getName(), MessageTypes.FAILED, instanceId, "", 0, null ); return new NullInputStream( 0 ); } finally { ReportListenerThreadHolder.clear(); } }
Source:
public void refreshStorageDevicesFromServers(List<VDS> upServers) { List<Callable<Pair<VDS, List<StorageDevice>>>> storageDevicesListCalls = new ArrayList<>(); for (final VDS server : upServers) { storageDevicesListCalls.add(new Callable<Pair<VDS, List<StorageDevice>>>() { @Override public Pair<VDS, List<StorageDevice>> call() throws Exception { List<StorageDevice> storageDevices = getStorageDevicesFromServer(server); return new Pair<VDS, List<StorageDevice>>(server, storageDevices); } }); } List<Pair<VDS, List<StorageDevice>>> storageDevices = ThreadPoolUtil.invokeAll(storageDevicesListCalls); for (Pair<VDS, List<StorageDevice>> pair : storageDevices) { updateStorageDevices(pair.getFirst(), pair.getSecond()); } }

Target:
public void refreshStorageDevicesFromServers(List<VDS> upServers) { List<Callable<Pair<VDS, List<StorageDevice>>>> storageDevicesListCalls = new ArrayList<>(); for (final VDS server : upServers) { storageDevicesListCalls.add(new Callable<Pair<VDS, List<StorageDevice>>>() { @Override public Pair<VDS, List<StorageDevice>> call() throws Exception { List<StorageDevice> storageDevices = getStorageDevicesFromServer(server); return new Pair<VDS, List<StorageDevice>>(server, storageDevices); } }); } if (storageDevicesListCalls != null) { List<Pair<VDS, List<StorageDevice>>> storageDevices = ThreadPoolUtil.invokeAll(storageDevicesListCalls); for (Pair<VDS, List<StorageDevice>> pair : storageDevices) { if (pair.getSecond() != null) { updateStorageDevices(pair.getFirst(), pair.getSecond()); } } } }
Source:
public Scheduler(AlertRepository alertRepo, CheckRepository checkRepo, EntityRepository entityRepository, QueueSelector queueSelector, SchedulerConfig schedulerConfig, MetricRegistry metrics) { this.alertRepo = alertRepo; this.checkRepo = checkRepo; this.entityRepo = entityRepository; this.queueSelector = queueSelector; this.schedulerConfig = schedulerConfig; this.schedulerMetrics = new SchedulerMetrics(metrics); taskSerializer = new JavaCommandSerializer(schedulerConfig.getTaskSerializer()); service = new ScheduledThreadPoolExecutor(schedulerConfig.getThreadCount(), new CustomizableThreadFactory("sc-pool-")); service.setRemoveOnCancelPolicy(true); shortIntervalService = new ScheduledThreadPoolExecutor(schedulerConfig.getThreadCount(), new CustomizableThreadFactory("sc-pool-fast-")); shortIntervalService.setRemoveOnCancelPolicy(true); service.scheduleAtFixedRate(new RedisMetricsUpdater(schedulerConfig, schedulerMetrics), 5, 3, TimeUnit.SECONDS); service.schedule(new AllTrialRunCleanupTask(schedulerConfig), 10, TimeUnit.SECONDS); }

Target:
public Scheduler(AlertRepository alertRepo, CheckRepository checkRepo, EntityRepository entityRepository, QueueSelector queueSelector, SchedulerConfig schedulerConfig, MetricRegistry metrics) { this.alertRepo = alertRepo; this.checkRepo = checkRepo; this.entityRepo = entityRepository; this.queueSelector = queueSelector; this.schedulerConfig = schedulerConfig; this.schedulerMetrics = new SchedulerMetrics(metrics); taskSerializer = new CommandSerializer(schedulerConfig.getTaskSerializer()); service = new ScheduledThreadPoolExecutor(schedulerConfig.getThreadCount(), new CustomizableThreadFactory("sc-pool-")); service.setRemoveOnCancelPolicy(true); shortIntervalService = new ScheduledThreadPoolExecutor(schedulerConfig.getThreadCount(), new CustomizableThreadFactory("sc-pool-fast-")); shortIntervalService.setRemoveOnCancelPolicy(true); service.scheduleAtFixedRate(new RedisMetricsUpdater(schedulerConfig, schedulerMetrics), 5, 3, TimeUnit.SECONDS); service.schedule(new AllTrialRunCleanupTask(schedulerConfig), 10, TimeUnit.SECONDS); }
Source:
public boolean onOptionsItemSelected(MenuItem item) { if (item.getItemId() == R.id.history_load) { Intent intent = new Intent(); intent.putExtra(KEY_REVISION, mRevision); getActivity().setResult(Activity.RESULT_OK, intent); getActivity().finish(); } else if (item.getItemId() == R.id.history_toggle_view) { mVisualTitle.setText(isInVisualPreview() ? null : mRevision.getPostTitle()); mVisualContent.fromHtml( isInVisualPreview() ? "" : StringUtils.notNullStr(mRevision.getPostContent()), false); mPreviousButton.setEnabled(isInVisualPreview()); mNextButton.setEnabled(isInVisualPreview()); crossfadePreviewViews(); } return super.onOptionsItemSelected(item); }

Target:
public boolean onOptionsItemSelected(MenuItem item) { if (item.getItemId() == R.id.history_load) { Intent intent = new Intent(); intent.putExtra(KEY_REVISION, mRevision); requireActivity().setResult(Activity.RESULT_OK, intent); requireActivity().finish(); } else if (item.getItemId() == R.id.history_toggle_view) { if (isInVisualPreview()) { AniUtils.fadeIn(mNextButton, Duration.SHORT); AniUtils.fadeIn(mPreviousButton, Duration.SHORT); } else { String title = TextUtils.isEmpty(mRevision.getPostTitle()) ? getString(R.string.history_no_title) : mRevision.getPostTitle(); mVisualTitle.setText(title); mVisualContent.fromHtml(StringUtils.notNullStr(mRevision.getPostContent()), false); AniUtils.fadeOut(mNextButton, Duration.SHORT, View.INVISIBLE); AniUtils.fadeOut(mPreviousButton, Duration.SHORT, View.INVISIBLE); } crossfadePreviewViews(); } return super.onOptionsItemSelected(item); }
Source:
private static Class toClass(String type) { try { return Class.forName(type); } catch (ClassNotFoundException ex) { throw new ArgumentConversionException( "Failed to convert String \"" + type + "\" to type " + Class.class.getName(), ex); } }

Target:
private static Class<?> toClass(String type) { return ReflectionUtils .loadClass(type) .orElseThrow(() -> new ArgumentConversionException( "Failed to convert String \"" + type + "\" to type " + Class.class.getName())); }
Source:
private int getMaxChildrenSeverityInCache(IContainer container) { if (!container.isAccessible()) { return -1; } Set<IResource> children = new HashSet<>(); try { children.addAll(Arrays.asList(container.members())); } catch (CoreException ex) { WorkbenchNavigatorPlugin.log("Cannot access members", WorkbenchNavigatorPlugin.createErrorStatus(ex.getMessage(), ex)); } children.addAll(Arrays.asList(NestedProjectManager.getInstance().getDirectChildrenProjects(container))); int[] severity = new int[] { -1 }; children.forEach(child -> { if (cache.containsKey(child) && cache.get(child).intValue() > severity[0]) { severity[0] = cache.get(child).intValue(); } }); return severity[0]; }

Target:
private int getMaxChildrenSeverityInCache(IContainer container) { if (!container.isAccessible()) { return -1; } Set<IResource> children = new HashSet<>(); try { children.addAll(Arrays.asList(container.members())); } catch (CoreException ex) { WorkbenchNavigatorPlugin.log("Cannot access members", WorkbenchNavigatorPlugin.createErrorStatus(ex.getMessage(), ex)); } children.addAll(Arrays.asList(NestedProjectManager.getInstance().getDirectChildrenProjects(container))); int severity = -1; for (IResource child : children) { Integer cachedSeverity = cache.get(child); if (cachedSeverity != null && cachedSeverity.intValue() > severity) { severity = cachedSeverity.intValue(); } } ; return severity; }
Source:
public static String getDirName(Props props) { String dirSuffix = props.get("azkaban.flow.nested.path"); if ((dirSuffix == null) || (dirSuffix.length() == 0)) { dirSuffix = props.get("azkaban.job.id"); if ((dirSuffix == null) || (dirSuffix.length() == 0)) { throw new RuntimeException("azkaban.flow.nested.path and azkaban.job.id were not set"); } } return "_resources_" + dirSuffix.replace(':', '_'); }

Target:
public static String getDirName(Props props) { String dirSuffix = props.get(CommonJobProperties.NESTED_FLOW_PATH); if ((dirSuffix == null) || (dirSuffix.length() == 0)) { dirSuffix = props.get(CommonJobProperties.JOB_ID); if ((dirSuffix == null) || (dirSuffix.length() == 0)) { throw new RuntimeException("azkaban.flow.nested.path and azkaban.job.id were not set"); } } return "_resources_" + dirSuffix.replace(':', '_'); }
Source:
public void visit(VarDeclNode node) { if (!scopeStack.putVarDeclNode(node)) { VarDeclNode previousDecl; try { previousDecl = scopeStack.getVarDeclNode(node.getName()); } catch (VariableNotDeclaredException e) { throw new RuntimeException(e); } visitError(node, String.format("Variable %s is already declared at [%s].", node.getName(), previousDecl.getLocation().toString())); } super.visit(node); }

Target:
public void visit(VarDeclNode node) { if (!scopeStack.putVarDeclNode(node)) { VarDeclNode previousDecl; try { previousDecl = scopeStack.getVarDeclNode(node.getName()); } catch (VariableNotDeclaredException e) { throw new RuntimeException(e); } visitError(node, String.format("Variable %s is already declared at [%s].", node.getName(), String.valueOf(previousDecl.getLocation()))); } super.visit(node); }
Source:
protected final Injector getInjector() { try { if (injector == null) { injector = createInjector(); } } catch (Exception e) { LOG.error("Failed to created injector", e); throw new ProvisionException("Failed to create injector", e); } return injector; }

Target:
protected final Injector getInjector() { if (injector != null) { throw new IllegalStateException("Injector already created."); } try { injector = createInjector(); } catch (Exception e) { LOG.error("Failed to created injector", e); throw new ProvisionException("Failed to create injector", e); } return injector; }
Source:
protected void createButtonsForButtonBar(Composite parent) { Button selectAllButton = createButton(parent, IDialogConstants.SELECT_ALL_ID, Messages.TraceControl_ImportDialog_SelectAll, true); selectAllButton.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { if (fFolderChildren != null) { for (int i = 0; i < fFolderChildren.length; i++) { fFolderViewer.setSubtreeChecked(fFolderChildren[i], true); } } updateOKButtonEnablement(); } }); Button deselectAllButton = createButton(parent, IDialogConstants.DESELECT_ALL_ID, Messages.TraceControl_ImportDialog_DeselectAll, true); deselectAllButton.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { if (fFolderChildren != null) { for (int i = 0; i < fFolderChildren.length; i++) { fFolderViewer.setSubtreeChecked(fFolderChildren[i], false); } } updateOKButtonEnablement(); } }); createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, true); createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true); }

Target:
protected void createButtonsForButtonBar(Composite parent) { Button selectAllButton = createButton(parent, IDialogConstants.SELECT_ALL_ID, Messages.TraceControl_ImportDialog_SelectAll, true); selectAllButton.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { setFolderChildrenChecked(true); } }); Button deselectAllButton = createButton(parent, IDialogConstants.DESELECT_ALL_ID, Messages.TraceControl_ImportDialog_DeselectAll, true); deselectAllButton.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { setFolderChildrenChecked(false); } }); createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, true); createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true); }
Source:
public void process(WatchedEvent event) { long notificationTime = System.currentTimeMillis(); if (LOG.isDebugEnabled()) { LOG.debug("Received event: " + event); } _zookeeperEventThread = Thread.currentThread(); boolean stateChanged = event.getPath() == null; boolean znodeChanged = event.getPath() != null; boolean dataChanged = event.getType() == Event.EventType.NodeDataChanged || event.getType() == Event.EventType.NodeDeleted || event.getType() == Event.EventType.NodeCreated || event.getType() == Event.EventType.NodeChildrenChanged; getEventLock().lock(); try { if (getShutdownTrigger()) { if (LOG.isDebugEnabled()) { LOG.debug("ignoring event '{" + event.getType() + " | " + event.getPath() + "}' since shutdown triggered"); } return; } if (stateChanged) { processStateChanged(event); } if (dataChanged) { processDataOrChildChange(event, notificationTime); } } finally { if (stateChanged) { getEventLock().getStateChangedCondition().signalAll(); if (event.getState() == KeeperState.Expired) { getEventLock().getZNodeEventCondition().signalAll(); getEventLock().getDataChangedCondition().signalAll(); } } if (znodeChanged) { getEventLock().getZNodeEventCondition().signalAll(); } if (dataChanged) { getEventLock().getDataChangedCondition().signalAll(); } getEventLock().unlock(); recordStateChange(stateChanged, dataChanged); if (LOG.isDebugEnabled()) { LOG.debug("Leaving process event"); } } }

Target:
public void process(WatchedEvent event) { long notificationTime = System.currentTimeMillis(); if (LOG.isDebugEnabled()) { LOG.debug("Received event: " + event); } _zookeeperEventThread = Thread.currentThread(); boolean stateChanged = event.getPath() == null; boolean znodeChanged = event.getPath() != null; boolean dataChanged = event.getType() == Event.EventType.NodeDataChanged || event.getType() == Event.EventType.NodeDeleted || event.getType() == Event.EventType.NodeCreated || event.getType() == Event.EventType.NodeChildrenChanged; if (event.getType() == EventType.NodeDeleted) { LOG.debug("Path is deleted", event.getPath()); } getEventLock().lock(); try { if (getShutdownTrigger()) { if (LOG.isDebugEnabled()) { LOG.debug("ignoring event '{" + event.getType() + " | " + event.getPath() + "}' since shutdown triggered"); } return; } if (stateChanged) { processStateChanged(event); } if (dataChanged) { processDataOrChildChange(event, notificationTime); } } finally { if (stateChanged) { getEventLock().getStateChangedCondition().signalAll(); if (event.getState() == KeeperState.Expired) { getEventLock().getZNodeEventCondition().signalAll(); getEventLock().getDataChangedCondition().signalAll(); } } if (znodeChanged) { getEventLock().getZNodeEventCondition().signalAll(); } if (dataChanged) { getEventLock().getDataChangedCondition().signalAll(); } getEventLock().unlock(); recordStateChange(stateChanged, dataChanged); if (LOG.isDebugEnabled()) { LOG.debug("Leaving process event"); } } }
Source:
public void testRequestMessageWithBodyBufferBase64Encoded() throws Exception { Payload requestPayload = TestUtils.createSimpleRequestPayloadWithBodyBuffer(new byte[24]); Requester<Payload> requester = msbContext.getObjectFactory().createRequester(NAMESPACE, requestOptions); requester.publish(requestPayload); String adapterJsonMessage = MockAdapter.pollJsonMessageForTopic(NAMESPACE); JsonNode jsonObject = msbContext.getPayloadMapper().readTree(adapterJsonMessage); TestUtils.assertJsonContains(jsonObject.get("payload"), "bodyBuffer", "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"); }

Target:
public void testRequestMessageWithBodyBufferBase64Encoded() throws Exception { byte[] bytesToSend = new byte[] { 1, 2 }; Payload requestPayload = TestUtils.createSimpleRequestPayloadWithBodyBuffer(bytesToSend); Requester<Payload> requester = msbContext.getObjectFactory().createRequester(NAMESPACE, requestOptions); requester.publish(requestPayload); String adapterJsonMessage = MockAdapter.pollJsonMessageForTopic(NAMESPACE); JsonNode jsonObject = msbContext.getPayloadMapper().readTree(adapterJsonMessage); String base64Encoded = Base64.getEncoder().encodeToString(bytesToSend); TestUtils.assertJsonContains(jsonObject.get("payload"), "bodyBuffer", base64Encoded); }
Source:
public void close() { if (allowReleaseEventLoopGroup) { eventLoopGroup.shutdownGracefully(config.getShutdownQuietPeriod(), config.getShutdownTimeout(), TimeUnit.MILLISECONDS) .addListener(future -> doClose()); } else doClose(); try { closeLatch.await(); } catch (InterruptedException e) { } }

Target:
public CompletableFuture<Void> close() { CompletableFuture<Void> closeFuture = CompletableFuture.completedFuture(null); if (allowReleaseEventLoopGroup) { closeFuture = toCompletableFuture( eventLoopGroup.shutdownGracefully(config.getShutdownQuietPeriod(), config.getShutdownTimeout(), TimeUnit.MILLISECONDS)); } return closeFuture.thenCompose(v -> toCompletableFuture(openChannels.close())).whenComplete((v,t) -> channelPool.destroy()); }
Source:
public void run(final RunNotifier notifier) { if (State.hasAnyArquillianRule(this.getTestClass())) { throw new RuntimeException(String.format("TestClass: %s contains Arquillian runner and Arquillian Rule." + " Arquillian doesn't support @RunWith(Arquillian.class) and ArquillianTestClass or " + "ArquillianTest to use at the same time.", this.getTestClass().getName())); } if (State.isNotRunningInEclipse()) { State.runnerStarted(); } if (!State.hasTestAdaptor()) { if (State.hasInitializationException()) { notifier.fireTestFailure( new Failure(getDescription(), new RuntimeException( "Arquillian has previously been attempted initialized, but failed. See cause for previous exception", State.getInitializationException()))); } else { try { TestRunnerAdaptor adaptor = TestRunnerAdaptorBuilder.build(); adaptor.beforeSuite(); State.testAdaptor(adaptor); } catch (Exception e) { State.caughtInitializationException(e); notifier.fireTestFailure(new Failure(getDescription(), e)); } } } notifier.addListener(new RunListener() { @Override public void testRunFinished(Result result) throws Exception { State.runnerFinished(); shutdown(); } private void shutdown() { try { if (State.isLastRunner()) { try { if (adaptor != null) { adaptor.afterSuite(); adaptor.shutdown(); } } finally { State.clean(); } } adaptor = null; } catch (Exception e) { throw new RuntimeException("Could not run @AfterSuite", e); } } }); if (State.hasTestAdaptor()) { adaptor = State.getTestAdaptor(); super.run(notifier); } }

Target:
public void run(final RunNotifier notifier) { if (State.hasAnyArquillianRule(this.getTestClass())) { throw new RuntimeException(String.format("TestClass: %s contains Arquillian runner and Arquillian Rule." + " Arquillian doesn't support @RunWith(Arquillian.class) and ArquillianTestClass or " + "ArquillianTest to use at the same time. You have to decide whether you want use runner:" + " <LINK_0> or rules : <LINK_1>", this.getTestClass().getName())); } if (State.isNotRunningInEclipse()) { State.runnerStarted(); } if (!State.hasTestAdaptor()) { if (State.hasInitializationException()) { notifier.fireTestFailure( new Failure(getDescription(), new RuntimeException( "Arquillian initialization has already been attempted, but failed. See previous exceptions for cause", State.getInitializationException()))); } else { try { TestRunnerAdaptor adaptor = TestRunnerAdaptorBuilder.build(); adaptor.beforeSuite(); State.testAdaptor(adaptor); } catch (Exception e) { State.caughtInitializationException(e); notifier.fireTestFailure(new Failure(getDescription(), e)); } } } notifier.addListener(new RunListener() { @Override public void testRunFinished(Result result) throws Exception { State.runnerFinished(); shutdown(); } private void shutdown() { try { if (State.isLastRunner()) { try { if (adaptor != null) { adaptor.afterSuite(); adaptor.shutdown(); } } finally { State.clean(); } } adaptor = null; } catch (Exception e) { throw new RuntimeException("Could not run @AfterSuite", e); } } }); if (State.hasTestAdaptor()) { adaptor = State.getTestAdaptor(); super.run(notifier); } }
Source:
private void finaliseBuildingSectionPanelWithoutStats(InstructorFeedbackResultsSectionPanel sectionPanel, String sectionWithoutResponses) { LinkedHashMap<String, Map<FeedbackQuestionAttributes, List<FeedbackResponseAttributes>>> emptyResponseMap = new LinkedHashMap<String, Map<FeedbackQuestionAttributes, List<FeedbackResponseAttributes>>>(); Set<String> emptyTeamList = new LinkedHashSet<String>(); finalizeBuildingSectionPanel(sectionPanel, sectionWithoutResponses, emptyResponseMap, emptyTeamList); }

Target:
private void finaliseBuildingSectionPanelWithoutStats(InstructorFeedbackResultsSectionPanel sectionPanel, String sectionWithoutResponses) { LinkedHashMap<String, Map<FeedbackQuestionAttributes, List<FeedbackResponseAttributes>>> emptyResponseMap = new LinkedHashMap<String, Map<FeedbackQuestionAttributes, List<FeedbackResponseAttributes>>>(); LinkedHashSet<String> emptyTeamList = new LinkedHashSet<String>(); finalizeBuildingSectionPanel(sectionPanel, sectionWithoutResponses, emptyResponseMap, emptyTeamList); }
Source:
public EEFCheckboxLifecycleManager(EEFCheckboxDescription description, IVariableManager variableManager, IInterpreter interpreter, TransactionalEditingDomain editingDomain) { super(description, variableManager, interpreter, editingDomain); this.description = description; }

Target:
public EEFCheckboxLifecycleManager(EEFCheckboxDescription description, IVariableManager variableManager, IInterpreter interpreter, TransactionalEditingDomain editingDomain) { super(variableManager, interpreter, editingDomain); this.description = description; }
Source:
public List<Document> getProxies(Document doc) { State state = transaction.getStateForRead(doc.getUUID()); Object[] proxyIds = (Object[]) state.get(KEY_PROXY_IDS); if (proxyIds != null) { List<String> ids = Arrays.stream(proxyIds).map(Object::toString).collect(Collectors.toList()); return getDocuments(ids); } return Collections.emptyList(); }

Target:
public List<Document> getProxies(Document doc) { State state = transaction.getStateForRead(doc.getUUID()); Object[] proxyIds = (Object[]) state.get(KEY_PROXY_IDS); if (proxyIds != null) { List<String> ids = Arrays.stream(proxyIds).map(String::valueOf).collect(Collectors.toList()); return getDocuments(ids); } return Collections.emptyList(); }
Source:
public <T> void registerTranslator(Class<T> objectClass, DataTranslator<T> translator) { checkState(allowRegistrations, "Registrations are no longer allowed"); checkNotNull(objectClass, "Target object class cannot be null!"); checkNotNull(translator, "DataTranslator for : " + objectClass + " cannot be null!"); checkArgument(translator.getToken().isAssignableFrom(objectClass), "DataTranslator is not compatible with the target object class: " + objectClass); if (!this.dataSerializerMap.containsKey(checkNotNull(objectClass, "Target class cannot be null!"))) { this.dataSerializerMap.put(objectClass, translator); DataTranslatorRegistryModule.getInstance().registerAdditionalCatalog(translator); } else { throw new IllegalStateException("Already registered the DataTranslator for " + objectClass.getCanonicalName()); } TypeSerializers.getDefaultSerializers().registerType(translator.getToken(), DataTranslatorTypeSerializer.from(translator)); }

Target:
public <T> void registerTranslator(Class<T> objectClass, DataTranslator<T> translator) { checkState(allowRegistrations, "Registrations are no longer allowed"); checkNotNull(objectClass, "Target object class cannot be null!"); checkNotNull(translator, "DataTranslator for : " + objectClass + " cannot be null!"); checkArgument(translator.getToken().isAssignableFrom(objectClass), "DataTranslator is not compatible with the target object class: " + objectClass); if (!this.dataSerializerMap.containsKey(checkNotNull(objectClass, "Target class cannot be null!"))) { this.dataSerializerMap.put(objectClass, translator); DataTranslatorRegistryModule.getInstance().registerAdditionalCatalog(translator); } else { throw new IllegalStateException("Already registered the DataTranslator for " + objectClass.getCanonicalName()); } if (TypeSerializers.getDefaultSerializers().get(translator.getToken()) == null) { TypeSerializers.getDefaultSerializers().registerType(translator.getToken(), DataTranslatorTypeSerializer.from(translator)); } }
Source:
public int getAddressSize() throws DebugException { final GdbMemoryBlockRetrieval retrieval = (GdbMemoryBlockRetrieval)getMemoryBlockRetrieval(); Query<Integer> query = new Query<Integer>() { @Override protected void execute(final DataRequestMonitor<Integer> drm) { IMemoryDMContext context = null; if (fMemorySpaceID != null) { IMemorySpaces memorySpacesService = (IMemorySpaces) retrieval.getMemorySpaceServiceTracker().getService(); if (memorySpacesService != null) { context = new MemorySpaceDMContext(memorySpacesService.getSession().getId(), fMemorySpaceID, getContext()); } else { drm.setStatus(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, IDsfStatusConstants.REQUEST_FAILED, Messages.Err_MemoryServiceNotAvailable, null)); drm.done(); return; } } else { context = getContext(); } IGDBMemory memoryService = (IGDBMemory)retrieval.getServiceTracker().getService(); if (memoryService != null) { memoryService.getAddressSize( context, new ImmediateDataRequestMonitor<Integer>(drm) { @Override @ConfinedToDsfExecutor("fExecutor") protected void handleSuccess() { drm.setData(getData()); drm.done(); } }); } else { drm.setStatus(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, IDsfStatusConstants.REQUEST_FAILED, Messages.Err_MemoryServiceNotAvailable, null)); drm.done(); } } }; retrieval.getExecutor().execute(query); try { return query.get().intValue(); } catch (InterruptedException e) { throw new DebugException(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, DebugException.INTERNAL_ERROR, Messages.Err_GetMemoryAddressSizeFailed, e)); } catch (ExecutionException e) { throw new DebugException(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, DebugException.INTERNAL_ERROR, Messages.Err_GetMemoryAddressSizeFailed, e)); } }

Target:
public int getAddressSize() throws DebugException { GdbMemoryBlockRetrieval retrieval = (GdbMemoryBlockRetrieval)getMemoryBlockRetrieval(); IMemoryDMContext context = null; if (fMemorySpaceID != null) { IMemorySpaces memorySpacesService = (IMemorySpaces) retrieval.getMemorySpaceServiceTracker().getService(); if (memorySpacesService != null) { context = new MemorySpaceDMContext(memorySpacesService.getSession().getId(), fMemorySpaceID, getContext()); } } else { context = getContext(); } IGDBMemory memoryService = (IGDBMemory)retrieval.getServiceTracker().getService(); if (memoryService != null) { return memoryService.getAddressSize(context); } throw new DebugException(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, IDsfStatusConstants.REQUEST_FAILED, Messages.Err_MemoryServiceNotAvailable, null)); }
Source:
private void checkLeases() { LOG.debug("Checking leases."); SortedSet<FileLease> sortedLeases = hlmAdapter.getSortedLeases(); if(sortedLeases.size() == 0) return; final FileLease oldest = sortedLeases.first(); if (!oldest.expiredHardLimit(hardLimit)) { return; } LOG.info(oldest + " has expired hard limit."); final List<String> removing = new ArrayList<String>(); Collection<FileLease> leases = hlmAdapter.getLeases(oldest.getHolder()); if(leases == null) return; for(FileLease lease : leases) { String p = lease.getPath(); try { boolean completed = namesystem.internalReleaseLease(oldest, p); if (LOG.isDebugEnabled()) { if (completed) { LOG.debug("Lease recovery for " + p + " is complete. File closed."); } else { LOG.debug("Started block recovery " + p + " lease " + oldest); } } if(!completed) return; } catch (IOException e) { LOG.error("Cannot release the path " + p + " in the lease " + oldest, e); removing.add(p); } } for(String p : removing) { hlmAdapter.removeLease(oldest, p); } }

Target:
private void checkLeases() { LOG.debug("Checking leases."); SortedSet<FileLease> sortedLeases = hlmAdapter.getSortedLeases(); if(sortedLeases.size() == 0) return; final FileLease oldest = sortedLeases.first(); if (!oldest.expiredHardLimit(hardLimit)) { return; } LOG.info(oldest + " has expired hard limit."); final List<String> removing = new ArrayList<String>(); Collection<FileLease> leases = hlmAdapter.getLeases(oldest.getHolder()); if(leases == null) return; for(FileLease lease : leases) { String p = lease.getPath(); try { boolean completed = namesystem.internalReleaseLease(oldest, p); if (LOG.isDebugEnabled()) { if (completed) { LOG.debug("Lease recovery for " + p + " is complete." + " File closed."); } else { LOG.debug("Started block recovery " + p + " lease " + oldest); } } if(!completed) return; } catch (IOException e) { LOG.error("Cannot release the path " + p + " in the lease " + oldest, e); removing.add(p); } } for(String p : removing) { hlmAdapter.removeLease(oldest, p); } }
Source:
private void deleteAccountAndReturnIfNecessary() { if (mAccount != null && mAccount.isOptionSet(Account.OPTION_REGISTER)) { xmppConnectionService.deleteAccount(mAccount); } if (xmppConnectionService.getAccounts().size() == 0) { Intent intent = new Intent(EditAccountActivity.this, WelcomeActivity.class); WelcomeActivity.addInviteUri(intent, getIntent()); startActivity(intent); } }

Target:
private void deleteAccountAndReturnIfNecessary() { if (mInitMode && mAccount != null && !mAccount.isOptionSet(Account.OPTION_LOGGED_IN_SUCCESSFULLY)) { xmppConnectionService.deleteAccount(mAccount); } if (xmppConnectionService.getAccounts().size() == 0) { Intent intent = new Intent(EditAccountActivity.this, WelcomeActivity.class); WelcomeActivity.addInviteUri(intent, getIntent()); startActivity(intent); } }
Source:
public MysqlSqlDialect(Context context) { super(context.withDataTypeSystem(MYSQL_TYPE_SYSTEM)); majorVersion = context.databaseMajorVersion(); }

Target:
public MysqlSqlDialect(Context context) { super(context); majorVersion = context.databaseMajorVersion(); }