auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private boolean withinMinMaxRecordTime(final InputRow row) { final boolean beforeMinimumMessageTime = ioConfig.getMinimumMessageTime().isPresent() && ioConfig.getMinimumMessageTime().get().isAfter(row.getTimestamp()); final boolean afterMaximumMessageTime = ioConfig.getMaximumMessageTime().isPresent() && ioConfig.getMaximumMessageTime().get().isBefore(row.getTimestamp()); if (!Intervals.ETERNITY.contains(row.getTimestamp())) { log.error("Encountered row with timestamp that cannot be represented as a long: [%s]", row); return false; } if (log.isDebugEnabled()) { if (beforeMinimumMessageTime) { log.debug( "CurrentTimeStamp[%s] is before MinimumMessageTime[%s]", row.getTimestamp(), ioConfig.getMinimumMessageTime().get() ); } else if (afterMaximumMessageTime) { log.debug( "CurrentTimeStamp[%s] is after MaximumMessageTime[%s]", row.getTimestamp(), ioConfig.getMaximumMessageTime().get() ); } } return !beforeMinimumMessageTime && !afterMaximumMessageTime; }

Target:
private boolean withinMinMaxRecordTime(final InputRow row) { final boolean beforeMinimumMessageTime = ioConfig.getMinimumMessageTime().isPresent() && ioConfig.getMinimumMessageTime().get().isAfter(row.getTimestamp()); final boolean afterMaximumMessageTime = ioConfig.getMaximumMessageTime().isPresent() && ioConfig.getMaximumMessageTime().get().isBefore(row.getTimestamp()); if (!Intervals.ETERNITY.contains(row.getTimestamp())) { final String errorMsg = StringUtils.format( "Encountered row with timestamp that cannot be represented as a long: [%s]", row ); log.debug(errorMsg); if (tuningConfig.isReportParseExceptions()) { throw new ParseException(errorMsg); } else { return false; } } if (log.isDebugEnabled()) { if (beforeMinimumMessageTime) { log.debug( "CurrentTimeStamp[%s] is before MinimumMessageTime[%s]", row.getTimestamp(), ioConfig.getMinimumMessageTime().get() ); } else if (afterMaximumMessageTime) { log.debug( "CurrentTimeStamp[%s] is after MaximumMessageTime[%s]", row.getTimestamp(), ioConfig.getMaximumMessageTime().get() ); } } return !beforeMinimumMessageTime && !afterMaximumMessageTime; }
Source:
public ResponseEntity deleteSynonymCatalog(@PathVariable("tenant") final String tenant, @PathVariable("name") final String name) { final TenantContext context = _contextFactory.getContext(tenant); final SynonymCatalog synonymCatalog = getReferenceDataCatalog(tenant).getSynonymCatalog(name); if (synonymCatalog instanceof TextFileSynonymCatalog) { try { Files.delete(getResourceFile(context, name).toPath()); } catch (final IOException e) { logger.warn("Synonym catalog file could not be deleted.", e); } } _referenceDataDao.removeSynonymCatalog(context, name); return ResponseEntity.noContent().build(); }

Target:
public ResponseEntity<Void> deleteSynonymCatalog(@PathVariable("tenant") final String tenant, @PathVariable("name") final String name) { final TenantContext context = _contextFactory.getContext(tenant); final SynonymCatalog synonymCatalog = getReferenceDataCatalog(tenant).getSynonymCatalog(name); if (synonymCatalog instanceof TextFileSynonymCatalog) { try { Files.delete(getResourceFile(context, name).toPath()); } catch (final IOException e) { logger.warn("Synonym catalog file could not be deleted.", e); } } _referenceDataDao.removeSynonymCatalog(context, name); return ResponseEntity.noContent().build(); }
Source:
public static <K, V> void assertExpirationTimeExistsEventually(final K key, final BackupAccessor<K, V> accessor) { checkInstanceOf(CacheBackupAccessor.class, accessor, "Need to supply a CacheBackupAccessor"); assertTrueEventually(new AssertTask() { @Override public void run() { assertTrueEventually(new AssertTask() { @Override public void run() throws Exception { CacheBackupAccessor<K, V> cacheBackupAccessor = (CacheBackupAccessor<K, V>) accessor; long expirationTime = cacheBackupAccessor.getExpirationTime(key); assertTrue(expirationTime != Long.MAX_VALUE && expirationTime > 0); } }); } }); }

Target:
public static <K, V> void assertExpirationTimeExistsEventually(final K key, final BackupAccessor<K, V> accessor) { checkInstanceOf(CacheBackupAccessor.class, accessor, "Need to supply a CacheBackupAccessor"); assertTrueEventually(new AssertTask() { @Override public void run() { CacheBackupAccessor<K, V> cacheBackupAccessor = (CacheBackupAccessor<K, V>) accessor; long expirationTime = cacheBackupAccessor.getExpirationTime(key); assertTrue(expirationTime != Long.MAX_VALUE && expirationTime > 0); } }); }
Source:
public void onAttackRequest(AttackRequest event, EntityRef character, CharacterComponent characterComponent) { if (event.getItem().exists()) { if (!character.equals(event.getItem().getOwner())) { return; } } OnItemUseEvent onItemUseEvent = new OnItemUseEvent(); character.send(onItemUseEvent); if (!onItemUseEvent.isConsumed()) { Vector3i positionVector = targetSystem.getTargetBlockPosition(); if (positionVector == null) { return; } EntityRef targetEntity = blockRegistry.getBlockEntityAt(positionVector); targetEntity.send(new AttackEvent(character, event.getItem())); } }

Target:
public void onAttackRequest(AttackRequest event, EntityRef character, CharacterComponent characterComponent) { if (event.getItem().exists()) { if (!character.equals(event.getItem().getOwner())) { return; } } OnItemUseEvent onItemUseEvent = new OnItemUseEvent(); character.send(onItemUseEvent); if (!onItemUseEvent.isConsumed()) { Vector3i position = targetSystem.getTargetBlockPosition(); if (position == null) { return; } EntityRef targetEntity = blockRegistry.getBlockEntityAt(position); targetEntity.send(new AttackEvent(character, event.getItem())); } }
Source:
private boolean hasAllIndexedColumns(IndexMaintainer indexMaintainer, MultiMutation multiMutation) { Map<byte[], List<Cell>> familyMap = multiMutation.getFamilyCellMap(); for (ColumnReference columnReference : indexMaintainer.getIndexedColumns()) { byte[] family = columnReference.getFamily(); List<Cell> cellList = familyMap.get(family); if (cellList == null) { return false; } boolean has = false; for (Cell cell : cellList) { if (Bytes.compareTo(CellUtil.cloneFamily(cell), family) == 0 && Bytes.compareTo(CellUtil.cloneQualifier(cell), columnReference.getQualifier() ) == 0) { has = true; break; } } if (!has) { return false; } } return true; }

Target:
private boolean hasAllIndexedColumns(IndexMaintainer indexMaintainer, MultiMutation multiMutation) { Map<byte[], List<Cell>> familyMap = multiMutation.getFamilyCellMap(); for (ColumnReference columnReference : indexMaintainer.getIndexedColumns()) { byte[] family = columnReference.getFamily(); List<Cell> cellList = familyMap.get(family); if (cellList == null) { return false; } boolean has = false; for (Cell cell : cellList) { if (CellUtil.matchingColumn(cell, family, columnReference.getQualifier())) { has = true; break; } } if (!has) { return false; } } return true; }
Source:
public MenuItem lookForViewMenu(final List<IContributionItem> contItems, final Matcher<String>... matchers) { IWorkbenchPart part = getActivePart(false); final IMenuManager m = ((IViewSite) part.getSite()).getActionBars().getMenuManager(); if (!(m instanceof MenuManager)) { throw new CoreLayerException("No Menu found in active part: " + part.getTitle()); } MenuItem contItem = Display.syncExec(new ResultRunnable<MenuItem>() { @Override public MenuItem run() { MenuItem currentItem = null; Menu currentMenu = ((MenuManager) m).getMenu(); for (Matcher<String> matcher : matchers) { for (MenuItem item : currentMenu.getItems()) { String normalized = item.getText().replace("&", ""); if (matcher.matches(normalized)) { if (item.getMenu() != null) { sendHide(item.getMenu(), true); sendShowUI(item.getMenu()); currentMenu = item.getMenu(); break; } else { currentItem = item; } } } } return currentItem; } }); return contItem; }

Target:
public MenuItem lookForViewMenu(final List<IContributionItem> contItems, final Matcher<String>... matchers) { IWorkbenchPart part = getActivePart(false); final IMenuManager m = ((IViewSite) part.getSite()).getActionBars().getMenuManager(); if (!(m instanceof MenuManager)) { throw new CoreLayerException("No Menu found in active part: " + part.getTitle()); } MenuItem contItem = Display.syncExec(new ResultRunnable<MenuItem>() { @Override public MenuItem run() { MenuItem currentItem = null; Menu currentMenu = ((MenuManager) m).getMenu(); for (Matcher<String> matcher : matchers) { for (MenuItem item : currentMenu.getItems()) { String normalized = item.getText().replace("&", ""); if (matcher.matches(normalized)) { if (item.getMenu() != null) { sendHide(item.getMenu(), true); sendShowUI(item.getMenu()); currentMenu = item.getMenu(); break; } else { currentItem = item; break; } } } } return currentItem; } }); return contItem; }
Source:
public void fail_to_update_plugin_rule_if_name_is_set() { RuleDefinitionDto ruleDto = RuleTesting.newRule(RuleKey.of("squid", "S01")); db.rules().insert(ruleDto); dbSession.commit(); expectedException.expect(IllegalArgumentException.class); expectedException.expectMessage("Not a custom rule"); createForPluginRule(ruleDto.getKey()).setName("New name"); }

Target:
public void fail_to_update_plugin_rule_if_name_is_set() { RuleDefinitionDto ruleDefinition = db.rules().insert(newRule(RuleKey.of("squid", "S01"))); dbSession.commit(); expectedException.expect(IllegalArgumentException.class); expectedException.expectMessage("Not a custom rule"); createForPluginRule(ruleDefinition.getKey()).setName("New name"); }
Source:
public int hashCode() { int result = getId(); id += getFirstName().hashCode(); id += getLastName().hashCode(); return result; }

Target:
public int hashCode() { int result = getId(); return result; }
Source:
public MVCCEntry wrapEntryForWriting(InvocationContext ctx, Object key, Wrap wrap, boolean skipRead, boolean ignoreOwnership) { if (wrap == Wrap.STORE) { throw new IllegalStateException("wrapDataContainerEntry must create a MVCCEntry"); } if (useRepeatableRead) { wrap = Wrap.WRAP_ALL; } CacheEntry contextEntry = getFromContext(ctx, key); MVCCEntry mvccEntry; if (contextEntry instanceof MVCCEntry) { mvccEntry = assertRepeatableReadEntry(contextEntry); } else if (contextEntry != null) { mvccEntry = createWrappedEntry(key, contextEntry, ctx, skipRead); ctx.putLookedUpEntry(key, mvccEntry); if (trace) log.tracef("Updated context entry %s", contextEntry); } else { InternalCacheEntry ice = getFromContainer(key, ignoreOwnership); if (ice == null && wrap == Wrap.WRAP_NON_NULL) { mvccEntry = null; } else { mvccEntry = createWrappedEntry(key, ice, ctx, skipRead); if (ice == null) { mvccEntry.setCreated(true); } ctx.putLookedUpEntry(key, mvccEntry); if (trace) log.tracef("Updated context entry %s", contextEntry); } } if (mvccEntry != null) { mvccEntry.copyForUpdate(); } return mvccEntry; }

Target:
public MVCCEntry wrapEntryForWriting(InvocationContext ctx, Object key, Wrap wrap, boolean skipRead, boolean ignoreOwnership) { if (wrap == Wrap.STORE) { throw new IllegalStateException("wrapEntryForWriting must create a MVCCEntry"); } if (useRepeatableRead) { wrap = Wrap.WRAP_ALL; } CacheEntry contextEntry = getFromContext(ctx, key); MVCCEntry mvccEntry; if (contextEntry instanceof MVCCEntry) { mvccEntry = assertRepeatableReadEntry(contextEntry); } else if (contextEntry != null) { mvccEntry = createWrappedEntry(key, contextEntry, ctx, skipRead); ctx.putLookedUpEntry(key, mvccEntry); if (trace) log.tracef("Updated context entry %s", contextEntry); } else { InternalCacheEntry ice = getFromContainer(key, ignoreOwnership); if (ice == null && wrap == Wrap.WRAP_NON_NULL) { mvccEntry = null; } else { mvccEntry = createWrappedEntry(key, ice, ctx, skipRead); if (ice == null) { mvccEntry.setCreated(true); } ctx.putLookedUpEntry(key, mvccEntry); if (trace) log.tracef("Updated context entry %s", mvccEntry); } } if (mvccEntry != null) { mvccEntry.copyForUpdate(); } return mvccEntry; }
Source:
public List<PermissionSubject> getPermissionCheckSubjects() { List<PermissionSubject> permissionList = new ArrayList<>(); permissionList.add(new PermissionSubject(getParameters().getDev().getVmId(), getParameters().isVm() ? VdcObjectType.VM : VdcObjectType.VmTemplate, getActionType().getActionGroup())); return permissionList; }

Target:
public List<PermissionSubject> getPermissionCheckSubjects() { List<PermissionSubject> permissionList = new ArrayList<>(); permissionList.add(new PermissionSubject(getVmBaseId(), getParameters().isVm() ? VdcObjectType.VM : VdcObjectType.VmTemplate, getActionType().getActionGroup())); return permissionList; }
Source:
public void resetAssetPermissions (String assetId, Long languageId) throws DotDataException, PortalException, SystemException, DotSecurityException { HibernateUtil.startTransaction(); try { UserWebAPI userWebAPI = WebAPILocator.getUserWebAPI(); WebContext ctx = WebContextFactory.get(); HttpServletRequest request = ctx.getHttpServletRequest(); User user = userWebAPI.getLoggedInUser(request); boolean respectFrontendRoles = !userWebAPI.isLoggedToBackend(request); PermissionAPI permissionAPI = APILocator.getPermissionAPI(); Permissionable asset = retrievePermissionable(assetId, languageId, user, respectFrontendRoles); permissionAPI.removePermissions(asset); if(asset instanceof Host){ systemEventsAPI.push(SystemEventType.UPDATE_SITE_PERMISSIONS, new Payload(asset, Visibility.GLOBAL, (String) null)); } } catch (DotDataException e) { HibernateUtil.rollbackTransaction(); throw e; } HibernateUtil.commitTransaction(); }

Target:
public void resetAssetPermissions (String assetId, Long languageId) throws DotDataException, PortalException, SystemException, DotSecurityException { HibernateUtil.startTransaction(); try { UserWebAPI userWebAPI = WebAPILocator.getUserWebAPI(); WebContext ctx = WebContextFactory.get(); HttpServletRequest request = ctx.getHttpServletRequest(); User user = userWebAPI.getLoggedInUser(request); boolean respectFrontendRoles = !userWebAPI.isLoggedToBackend(request); PermissionAPI permissionAPI = APILocator.getPermissionAPI(); Permissionable asset = retrievePermissionable(assetId, languageId, user, respectFrontendRoles); permissionAPI.removePermissions(asset); } catch (DotDataException e) { HibernateUtil.rollbackTransaction(); throw e; } HibernateUtil.commitTransaction(); }
Source:
public void insertOnDuplicateKeyUpdate_multiple() { SQLInsertClause clause = queryFactory.insertOnDuplicateKeyUpdate(QSurvey.survey, QSurvey.survey.id.eq(2), QSurvey.survey.name.eq("B")); assertEquals("insert into SURVEY\nvalues () on duplicate key update SURVEY.ID = ?, SURVEY.NAME = ?", clause.toString()); }

Target:
public void insertOnDuplicateKeyUpdate_multiple() { SQLInsertClause clause = queryFactory.insertOnDuplicateKeyUpdate(QSurvey.survey, SQLExpressions.set(QSurvey.survey.id, 2), SQLExpressions.set(QSurvey.survey.name, "B")); assertEquals("insert into SURVEY\n" + "values () on duplicate key update SURVEY.ID = ?, SURVEY.NAME = ?", clause.toString()); }
Source:
public String submit() throws Exception { ApplicationId applicationId = getYarnClientForSubmit().submitApplication(); if (applicationId != null) { return "Submit succesful, new id is " + applicationId.toString(); } else { return "Failure submitting new application."; } }

Target:
public String submit() throws Exception { ApplicationId applicationId = getYarnClientForSubmit().submitApplication(); if (applicationId != null) { return "Submit succesful, new application id is " + applicationId.toString(); } throw new IllegalArgumentException("Failed to submit new application instance."); }
Source:
private void getStatusCode(HttpWebResponse _response) throws IOException { int statusCode = HttpURLConnection.HTTP_OK; try { statusCode = _connection.getResponseCode(); } catch (IOException ex) { if (Build.VERSION.SDK_INT < 18) { if (ex.getMessage() == "Received authentication challenge is null") { statusCode = HttpURLConnection.HTTP_UNAUTHORIZED; } } else { statusCode = _connection.getResponseCode(); } if (statusCode != HttpURLConnection.HTTP_UNAUTHORIZED) { throw ex; } } _response.setStatusCode(statusCode); Logger.v(TAG, "Statuscode:" + statusCode); }

Target:
private void getStatusCode(HttpWebResponse _response) throws IOException { int statusCode = HttpURLConnection.HTTP_OK; try { statusCode = _connection.getResponseCode(); } catch (IOException ex) { if (Build.VERSION.SDK_INT < 18) { if (ex.getMessage() == UNAUTHORIZED_ERROR_MESSAGE_PRE18) { statusCode = HttpURLConnection.HTTP_UNAUTHORIZED; } } else { statusCode = _connection.getResponseCode(); } if (statusCode != HttpURLConnection.HTTP_UNAUTHORIZED) { throw ex; } } _response.setStatusCode(statusCode); Logger.v(TAG, "Status code:" + statusCode); }
Source:
public void removeChangeListener(ListenerToken token) { synchronized (lock) { if (token == null || (!(token instanceof ReplicatorChangeListenerToken) && !(token instanceof DocumentReplicatedListenerToken))) throw new IllegalArgumentException(); if(docEndedListenerTokens.remove(token)==true) { setProgressLevel(ReplicatorProgressLevel.OVERALL); } } }

Target:
public void removeChangeListener(ListenerToken token) { synchronized (lock) { if (token == null || (!(token instanceof ReplicatorChangeListenerToken) && !(token instanceof DocumentReplicationListenerToken))) throw new IllegalArgumentException(); changeListenerTokens.remove(token); docEndedListenerTokens.remove(token); if (docEndedListenerTokens.size() == 0) { setProgressLevel(ReplicatorProgressLevel.OVERALL); } } }
Source:
public void releaseClearLockLocalDoesNotReleaseLocksOnPrimaryBucketsWhenMemberIsNotCurrent() { BucketAdvisor bucketAdvisor = mock(BucketAdvisor.class); when(bucketAdvisor.hasPrimary()).thenReturn(true); PartitionedRegionDataStore partitionedRegionDataStore = mock(PartitionedRegionDataStore.class); Set<BucketRegion> buckets = setupBucketRegions(partitionedRegionDataStore, bucketAdvisor); when(partitionedRegion.getDataStore()).thenReturn(partitionedRegionDataStore); InternalDistributedMember member = mock(InternalDistributedMember.class); partitionedRegionClear.obtainClearLockLocal(member); assertThat(partitionedRegionClear.lockForListenerAndClientNotification.getLockRequester()) .isNull(); for (BucketRegion bucketRegion : buckets) { verify(bucketRegion, times(0)).releaseLockLocallyForClear(null); } }

Target:
public void releaseClearLockLocalDoesNotReleaseLocksOnPrimaryBucketsWhenMemberIsNotCurrent() { BucketAdvisor bucketAdvisor = mock(BucketAdvisor.class); when(bucketAdvisor.hasPrimary()).thenReturn(true); PartitionedRegionDataStore partitionedRegionDataStore = mock(PartitionedRegionDataStore.class); Set<BucketRegion> buckets = setupBucketRegions(partitionedRegionDataStore, bucketAdvisor); when(partitionedRegion.getDataStore()).thenReturn(partitionedRegionDataStore); InternalDistributedMember member = mock(InternalDistributedMember.class); partitionedRegionClear.releaseClearLockLocal(); assertThat(partitionedRegionClear.lockForListenerAndClientNotification.getLockRequester()) .isNull(); for (BucketRegion bucketRegion : buckets) { verify(bucketRegion, times(0)).releaseLockLocallyForClear(null); } }
Source:
public Map<PropertyKey, Map<String, Long>> getNewCurrentStateEndTimes() { Map<PropertyKey, Map<String, Long>> endTimeMap = new HashMap<>(); if (_updatedStateKeys != null && _prevStateMap != null) { int driftCnt = 0; for (PropertyKey propertyKey : _updatedStateKeys) { CurrentState prevState = _prevStateMap.get(propertyKey); CurrentState curState = _properties.get(propertyKey); Map<String, Long> partitionUpdateEndTimes = null; for (String partition : curState.getPartitionStateMap().keySet()) { long newEndTime = curState.getEndTime(partition); if (prevState == null || prevState.getEndTime(partition) < newEndTime && prevState.getEndTime(partition) != -1) { if (partitionUpdateEndTimes == null) { partitionUpdateEndTimes = new HashMap<>(); } partitionUpdateEndTimes.put(partition, newEndTime); } else if (prevState != null && prevState.getEndTime(partition) > newEndTime) { if (driftCnt < 1) { LOG.warn( "clock drift. partition:" + partition + " curState:" + curState.getState(partition) + " prevState: " + prevState.getState(partition)); } driftCnt++; } } if (partitionUpdateEndTimes != null) { endTimeMap.put(propertyKey, partitionUpdateEndTimes); } } } return endTimeMap; }

Target:
public Map<PropertyKey, Map<String, Long>> getNewCurrentStateEndTimes() { Map<PropertyKey, Map<String, Long>> endTimeMap = new HashMap<>(); if (_updatedStateKeys != null && _prevStateMap != null) { int driftCnt = 0; for (PropertyKey propertyKey : _updatedStateKeys) { CurrentState prevState = _prevStateMap.get(propertyKey); CurrentState curState = _properties.get(propertyKey); Map<String, Long> partitionUpdateEndTimes = null; for (String partition : curState.getPartitionStateMap().keySet()) { long newEndTime = curState.getEndTime(partition); if ((prevState == null || prevState.getEndTime(partition) < newEndTime) && newEndTime != -1) { if (partitionUpdateEndTimes == null) { partitionUpdateEndTimes = new HashMap<>(); } partitionUpdateEndTimes.put(partition, newEndTime); } else if (prevState != null && prevState.getEndTime(partition) > newEndTime) { if (driftCnt < 1) { LOG.warn( "clock drift. partition:" + partition + " curState:" + curState.getState(partition) + " prevState: " + prevState.getState(partition)); } driftCnt++; } } if (partitionUpdateEndTimes != null) { endTimeMap.put(propertyKey, partitionUpdateEndTimes); } } } return endTimeMap; }
Source:
protected boolean mergeImpl() throws IOException { boolean implicitDirCache = false; boolean clean = false; if (dircache == null) { dircache = getRepository().lockDirCache(); implicitDirCache = true; } clean = mergeTrees(mergeBase().getEntryObjectId(), sourceTrees[0], sourceTrees[1]); if (implicitDirCache) { dircache.unlock(); } return clean; }

Target:
protected boolean mergeImpl() throws IOException { boolean implicitDirCache = false; boolean clean = false; if (dircache == null) { dircache = getRepository().lockDirCache(); implicitDirCache = true; } try { clean = mergeTrees(mergeBase(), sourceTrees[0], sourceTrees[1]); } finally { if (implicitDirCache) { dircache.unlock(); } } return clean; }
Source:
public static Object navigateToObject(Object rootObject, List<String> steps, boolean createIfNull) { if (steps.size() < 1) { throw new ScenarioException(new StringBuilder().append("Invalid path to a property: path='") .append(String.join(".", steps)).append("'").toString()); } Class<?> currentClass = rootObject.getClass(); Object currentObject = rootObject; for (String step : steps) { Field declaredField = null; try { if(currentObject == null) { throw new ScenarioException(new StringBuilder().append("Impossible to reach field ") .append(step).append(" because a step is not instantiated") .toString()); } declaredField = currentClass.getDeclaredField(step); } catch (NoSuchFieldException e) { throw new ScenarioException(new StringBuilder().append("Impossible to find field with name '") .append(step).append("' in class ") .append(currentClass.getCanonicalName()).toString(), e); } declaredField.setAccessible(true); currentClass = declaredField.getType(); try { currentObject = getFieldValue(declaredField, currentObject, createIfNull); } catch (ReflectiveOperationException e) { throw new ScenarioException(new StringBuilder().append("Impossible to get or create class ") .append(currentClass.getCanonicalName()).toString()); } } return currentObject; }

Target:
public static Object navigateToObject(Object rootObject, List<String> steps, boolean createIfNull) { if (steps.size() < 1) { throw new ScenarioException(new StringBuilder().append("Invalid path to a property, no steps provided").toString()); } Class<?> currentClass = rootObject.getClass(); Object currentObject = rootObject; for (String step : steps) { Field declaredField = null; try { if (currentObject == null) { throw new ScenarioException(new StringBuilder().append("Impossible to reach field ") .append(step).append(" because a step is not instantiated") .toString()); } declaredField = currentClass.getDeclaredField(step); } catch (NoSuchFieldException e) { throw new ScenarioException(new StringBuilder().append("Impossible to find field with name '") .append(step).append("' in class ") .append(currentClass.getCanonicalName()).toString(), e); } declaredField.setAccessible(true); currentClass = declaredField.getType(); try { currentObject = getFieldValue(declaredField, currentObject, createIfNull); } catch (ReflectiveOperationException e) { throw new ScenarioException(new StringBuilder().append("Impossible to get or create class ") .append(currentClass.getCanonicalName()).toString()); } } return currentObject; }
Source:
public abstract JobExecutionResult execute(String jobName) throws Exception; public abstract String getExecutionPlan() throws Exception; public void registerCachedFile(String filePath, String name){ this.cacheFile.add(filePath); this.cacheFile.add(name); }

Target:
public abstract JobExecutionResult execute(String jobName) throws Exception; public abstract String getExecutionPlan() throws Exception; public void registerCachedFile(String filePath, String name){ this.cacheFile.add(new Tuple2<String, String>(filePath, name)); }
Source:
public SafeHtml getEntityValue(Cluster object) { SafeHtmlBuilder images = new SafeHtmlBuilder(); boolean addLineBreaks = false; if (object.isClusterCompatibilityLevelUpgradeNeeded() || isDeprecated(object)) { images.append(getImageSafeHtml(IconType.EXCLAMATION)); addLineBreaks = true; } if (!object.getHostsOutOfSync().isEmpty()) { if (addLineBreaks) { images.appendHtmlConstant(constants.space()); } images.append(templates.brokenLinkRed()); } return templates.image(images.toSafeHtml()); }

Target:
public SafeHtml getEntityValue(Cluster object) { SafeHtmlBuilder images = new SafeHtmlBuilder(); boolean addSpace = false; if (object.isClusterCompatibilityLevelUpgradeNeeded() || isDeprecated(object)) { images.append(getImageSafeHtml(IconType.EXCLAMATION)); addSpace = true; } if (!object.getHostsOutOfSync().isEmpty()) { if (addSpace) { images.appendHtmlConstant(constants.space()); } images.append(templates.brokenLinkRed()); } return templates.image(images.toSafeHtml()); }
Source:
private void publishPost() { if (!isFinishing() && NetworkUtils.checkConnection(this)) { if (!mPost.isLocalDraft()) { Map<String, Object> properties = new HashMap<>(); properties.put("has_gutenberg_blocks", PostUtils.contentContainsGutenbergBlocks(mPost.getContent())); AnalyticsUtils.trackWithSiteDetails(AnalyticsTracker.Stat.EDITOR_UPDATED_POST, mSite, properties); } if (PostStatus.fromPost(mPost) == PostStatus.DRAFT) { mPost.setStatus(PostStatus.PUBLISHED.toString()); UploadService.uploadPostAndTrackAnalytics(this, mPost); } else if (mPost.isLocalDraft() && PostStatus.fromPost(mPost) == PostStatus.PUBLISHED) { UploadService.uploadPostAndTrackAnalytics(this, mPost); } else { UploadService.uploadPost(this, mPost); } } }

Target:
private void publishPost() { if (!isFinishing() && NetworkUtils.checkConnection(this)) { if (!mPost.isLocalDraft()) { Map<String, Object> properties = new HashMap<>(); properties.put(AnalyticsUtils.HAS_GUTENBERG_BLOCKS_KEY, PostUtils.contentContainsGutenbergBlocks(mPost.getContent())); AnalyticsUtils.trackWithSiteDetails(AnalyticsTracker.Stat.EDITOR_UPDATED_POST, mSite, properties); } if (PostStatus.fromPost(mPost) == PostStatus.DRAFT) { mPost.setStatus(PostStatus.PUBLISHED.toString()); UploadService.uploadPostAndTrackAnalytics(this, mPost); } else if (mPost.isLocalDraft() && PostStatus.fromPost(mPost) == PostStatus.PUBLISHED) { UploadService.uploadPostAndTrackAnalytics(this, mPost); } else { UploadService.uploadPost(this, mPost); } } }
Source:
public void return_mismatch_object_with_double_values() { final double value0 = 0.1; final double value1 = 0.1; final double value2 = 0.1; final ValueMismatch mismatch = Mismatch.of(value0, value1, value2, VERSION); final DoubleValue expected = fromAny(mismatch.getExpected()); final DoubleValue actual = fromAny(mismatch.getActual()); final DoubleValue requested = fromAny(mismatch.getRequested()); assertEquals(value0, expected.getValue(), DELTA); assertEquals(value1, actual.getValue(), DELTA); assertEquals(value2, requested.getValue(), DELTA); }

Target:
public void return_mismatch_object_with_double_values() { final double expected = 0.1; final double actual = 0.2; final double requested = 0.3; final ValueMismatch mismatch = Mismatch.of(expected, actual, requested, VERSION); final DoubleValue expectedWrapped = fromAny(mismatch.getExpected()); final DoubleValue actualWrapped = fromAny(mismatch.getActual()); final DoubleValue requestedWrapped = fromAny(mismatch.getRequested()); assertEquals(expected, expectedWrapped.getValue(), DELTA); assertEquals(actual, actualWrapped.getValue(), DELTA); assertEquals(requested, requestedWrapped.getValue(), DELTA); }
Source:
public void dispose() { writeSettings(); LogReaderService[] services = this.logReaderServiceTracker.getServices(new LogReaderService[0]); for (LogReaderService logReaderService : services) { logReaderService.removeLogListener(this); } this.logReaderServiceTracker.close(); fClipboard.dispose(); if (fTextShell != null) fTextShell.dispose(); fLabelProvider.disconnect(this); fFilteredTree.dispose(); super.dispose(); }

Target:
public void dispose() { writeSettings(); this.logReaderServiceTracker.close(); fClipboard.dispose(); if (fTextShell != null) fTextShell.dispose(); fLabelProvider.disconnect(this); fFilteredTree.dispose(); super.dispose(); }
Source:
private static GoogleCloudStorage createGoogleCloudStorage() { try { return new GoogleCloudStorageImpl( GoogleCloudStorageTestHelper.getStandardOptionBuilder().setGrpcEnabled(true).build(), GoogleCloudStorageTestHelper.getCredential()); } catch (IOException e) { GoogleLogger logger = GoogleLogger.forEnclosingClass(); logger.atWarning().withCause(e).log( "Caught exception during GCS (%s) buckets creation", BUCKET_NAME); return null; } }

Target:
private static GoogleCloudStorage createGoogleCloudStorage() throws IOException { return new GoogleCloudStorageImpl( GoogleCloudStorageTestHelper.getStandardOptionBuilder().setGrpcEnabled(true).build(), GoogleCloudStorageTestHelper.getCredential()); }
Source:
@Override protected void onFinishInflate() { super.onFinishInflate(); TextView nameView = (TextView) findViewById(R.id.name); final EditText emailView = (EditText) findViewById(R.id.edit_email); nameView.setText(editor.name); emailView.setText(editor.email); emailView.addTextChangedListener(new TextWatcher() { @Override public void beforeTextChanged(CharSequence s, int start, int count, int after) { } @Override public void onTextChanged(CharSequence s, int start, int before, int count) { editor.email = s.toString(); } @Override public void afterTextChanged(Editable s) { } }); findViewById(R.id.save).setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { editor.email = emailView.getText().toString(); ContactsStorage storage = Flow.getService(FlowServices.CONTACTS_STORAGE, v.getContext()); storage.save(editor.toContact()); Flow.get(v).set(new ListContactsScreen()); } }); }

Target:
@Override protected void onFinishInflate() { super.onFinishInflate(); nameView = (TextView) findViewById(R.id.name); emailView = (EditText) findViewById(R.id.edit_email); saveButton = findViewById(R.id.save); }
Source:
private static IDialogSettings getOrCreateSection(IDialogSettings settings, String sectionName) { IDialogSettings section = settings.getSection(sectionName); if (section == null) { section = settings.addNewSection(sectionName); } return section; }

Target:
private static IDialogSettings getOrCreateSection(IDialogSettings settings, String sectionName) { IDialogSettings section = settings.getSection(sectionName); if (section == null) section = settings.addNewSection(sectionName); return section; }
Source:
private void testCasts() { Object o = (Object) new Object(); o = (java.lang. Long) o; o = (Object)o; o = ( Object ) o; o = (Object) o; }

Target:
private void testCasts() { Object o = (Object) new Object(); o = (Object)o; o = ( Object ) o; o = (Object) o; }
Source:
public static String resolveSymlink(@Nonnull File link) throws InterruptedException, IOException { try { Path path = link.toPath(); return Files.readSymbolicLink(path).toString(); } catch (UnsupportedOperationException | FileSystemException x) { return null; } catch (Exception x) { throw (IOException) new IOException(x.toString()).initCause(x); } }

Target:
public static String resolveSymlink(@Nonnull File link) throws InterruptedException, IOException { try { Path path = link.toPath(); return Files.readSymbolicLink(path).toString(); } catch (UnsupportedOperationException | FileSystemException x) { return null; } catch (IOException x) { throw x; } catch (Exception x) { throw (IOException) new IOException(x.toString()).initCause(x); } }
Source:
protected MethodMatchers getMethodInvocationMatchers() { return MethodMatchers.or( MethodMatchers.create() .ofTypes("org.junit.jupiter.api.Assertions", "org.junit.Assert", "junit.framework.Assert", "org.fest.assertions.Fail", "org.assertj.core.api.Fail") .name(name -> name.startsWith(ASSERT) || name.equals("fail")).withAnyParameters().build(), MethodMatchers.create().ofSubTypes(FEST_GENERIC_ASSERT).anyName().withAnyParameters().build(), MethodMatchers.create().ofSubTypes(ASSERTJ_ABSTRACT_ASSERT).anyName().withAnyParameters().build() ); }

Target:
protected MethodMatchers getMethodInvocationMatchers() { return MethodMatchers.or( MethodMatchers.create() .ofTypes("org.junit.jupiter.api.Assertions", "org.junit.Assert", "junit.framework.Assert", "org.fest.assertions.Fail", "org.assertj.core.api.Fail") .name(name -> name.startsWith(ASSERT) || name.equals("fail")).withAnyParameters().build(), MethodMatchers.create().ofSubTypes(FEST_GENERIC_ASSERT, ASSERTJ_ABSTRACT_ASSERT).anyName().withAnyParameters().build()); }
Source:
private void verifyDirectives(String header, String directives, Pattern namePattern, String type) throws Exception { verifyDirectives(header, directives, namePattern, type, (namespace, pattern) -> pattern); }

Target:
private void verifyDirectives(String header, String directives, Pattern namePattern, String type) throws Exception { verifyDirectives(header, namespace -> directives, namePattern, type); }
Source:
protected String stripKindPrefix(String str) { if (str.startsWith(kindPrefix)) { return str.substring(kindPrefix.length()); } return str; }

Target:
protected String stripKindPrefix(String str) { return StringUtils.removeStart(str, kindPrefix); }
Source:
private static boolean isInCatch(Tree tree) { if (tree.parent() == null) { return false; } if (Tree.Kind.CATCH.equals(tree.parent().kind())) { return true; } return isInCatch(tree.parent()); }

Target:
private static boolean isInCatch(Tree tree) { Tree parent = tree.parent(); return parent != null && !parent.is(Kind.METHOD) && (parent.is(Kind.CATCH) || isInCatch(parent)); }
Source:
public Object convertUnsortedEncodedKeyComponentToActualArrayOrList(Long key, boolean asList) { return Lists.newArrayList(key); }

Target:
public Object convertUnsortedEncodedKeyComponentToActualArrayOrList(Long key, boolean asList) { return ImmutableList.of(key); }
Source:
private <T, U> ListenableFuture<Response<T>> callWithEncoding( InetAddress host, int port, Request<U> request, final Class<T> responseType, ArgScheme scheme ) throws InterruptedException { RawRequest rawRequest = new RawRequest( 0, request.getTTL(), request.getService(), request.getTransportHeaders(), serializer.encodeEndpoint(request.getEndpoint(), scheme), serializer.encodeHeaders(request.getHeaders(), scheme), serializer.encodeBody(request.getBody(), scheme) ); rawRequest.setTransportHeader(TransportHeaders.CALLER_NAME_KEY, this.service); rawRequest.setTransportHeader(TransportHeaders.ARG_SCHEME_KEY, scheme.getScheme()); ListenableFuture<RawResponse> future = this.call(host, port, rawRequest); return transform(future, new AsyncFunction<RawResponse, Response<T>>() { @Override public ListenableFuture<Response<T>> apply(RawResponse rawResponse) { SettableFuture<Response<T>> settableFuture = SettableFuture.create(); Response<T> response = new Response.Builder<>( serializer.decodeBody(rawResponse, responseType), serializer.decodeEndpoint(rawResponse), rawResponse.getResponseCode() ).setHeaders(serializer.decodeHeaders(rawResponse)).build(); settableFuture.set(response); return settableFuture; } }); }

Target:
private <T, U> ListenableFuture<Response<T>> callWithEncoding( InetAddress host, int port, Request<U> request, final Class<T> responseType, ArgScheme scheme ) throws InterruptedException { RawRequest rawRequest = new RawRequest( request.getTTL(), request.getService(), request.getTransportHeaders(), serializer.encodeEndpoint(request.getEndpoint(), scheme), serializer.encodeHeaders(request.getHeaders(), scheme), serializer.encodeBody(request.getBody(), scheme) ); rawRequest.setTransportHeader(TransportHeaders.CALLER_NAME_KEY, this.service); rawRequest.setTransportHeader(TransportHeaders.ARG_SCHEME_KEY, scheme.getScheme()); ListenableFuture<RawResponse> future = this.call(host, port, rawRequest); return transform(future, new AsyncFunction<RawResponse, Response<T>>() { @Override public ListenableFuture<Response<T>> apply(RawResponse rawResponse) { SettableFuture<Response<T>> settableFuture = SettableFuture.create(); Response<T> response = new Response.Builder<>( serializer.decodeBody(rawResponse, responseType), serializer.decodeEndpoint(rawResponse), rawResponse.getResponseCode()) .setHeaders(serializer.decodeHeaders(rawResponse)) .build(); settableFuture.set(response); return settableFuture; } }); }
Source:
public boolean initialize(boolean excludePrivateDomains) { return initialize(this.getClass().getResourceAsStream(ETLD_DATA), false); }

Target:
public boolean initialize(boolean excludePrivateDomains) { return initialize(this.getClass().getResourceAsStream(ETLD_DATA), excludePrivateDomains); }
Source:
public static boolean isSendErrorAsResponse(PMode pmode) { boolean notifyProducer = false; if(pmode.getErrorHandling() != null) { if(pmode.getErrorHandling().getReport() != null) { notifyProducer = pmode.getErrorHandling().getReport().isAsResponse(); } } return notifyProducer; }

Target:
public static boolean isSendErrorAsResponse(PMode pmode) { boolean notifyProducer = false; if(pmode.getErrorHandling() != null && pmode.getErrorHandling().getReport() != null) { notifyProducer = pmode.getErrorHandling().getReport().isAsResponse(); } return notifyProducer; }
Source:
public DivolteConfiguration( final ServerConfiguration server, final TrackingConfiguration tracking, final JavascriptConfiguration javascript, final IncomingRequestProcessorConfiguration incomingRequestProcessor, final KafkaFlusherConfiguration kafkaFlusher, final HdfsFlusherConfiguration hdfsFlusher) { this.server = server; this.tracking = tracking; this.javascript = javascript; this.incomingRequestProcessor = incomingRequestProcessor; this.kafkaFlusher = kafkaFlusher; this.hdfsFlusher = hdfsFlusher; }

Target:
private DivolteConfiguration( final ServerConfiguration server, final TrackingConfiguration tracking, final JavascriptConfiguration javascript, final IncomingRequestProcessorConfiguration incomingRequestProcessor, final KafkaFlusherConfiguration kafkaFlusher, final HdfsFlusherConfiguration hdfsFlusher) { this.server = server; this.tracking = tracking; this.javascript = javascript; this.incomingRequestProcessor = incomingRequestProcessor; this.kafkaFlusher = kafkaFlusher; this.hdfsFlusher = hdfsFlusher; }
Source:
private Map<Target, Map<TargetAnnotation, String>> composeTargetToAnnotationMap(final List<File> targetAnnotations, final TargetCollection<Target> targets) { final Map<Target,Map<TargetAnnotation,String>> annotationsByTarget = targets.targets().stream() .map(TargetArgumentCollection::targetToTargetAnnotationMapPair) .collect(Collectors.toMap(Pair::getLeft, Pair::getRight)); for (final File annotationFile : targetAnnotations) { try (final TargetTableReader reader = new TargetTableReader(annotationFile)) { reader.stream() .filter(annotationsByTarget::containsKey) .forEach(annotatedTarget -> { for (final TargetAnnotation annotation : annotatedTarget.getAnnotations().annotationSet()) { final String value = annotatedTarget.getAnnotations().get(annotation); annotationsByTarget.get(annotatedTarget).put(annotation, value); } }); } catch (final IOException ex) { throw new UserException.CouldNotReadInputFile(annotationFile, ex); } } return annotationsByTarget; }

Target:
private Map<Target, Map<TargetAnnotation, String>> composeTargetToAnnotationMap(final List<File> targetAnnotations, final TargetCollection<Target> targets) { final Map<Target, Map<TargetAnnotation, String>> annotationsByTarget = targets.targets().stream().collect(Collectors.toMap(target -> target, TargetArgumentCollection::targetToTargetAnnotationMap)); for (final File annotationFile : targetAnnotations) { try (final TargetTableReader reader = new TargetTableReader(annotationFile)) { reader.stream() .filter(annotationsByTarget::containsKey) .forEach(annotatedTarget -> { for (final TargetAnnotation annotation : annotatedTarget.getAnnotations().annotationSet()) { final String value = annotatedTarget.getAnnotations().get(annotation); annotationsByTarget.get(annotatedTarget).put(annotation, value); } }); } catch (final IOException ex) { throw new UserException.CouldNotReadInputFile(annotationFile, ex); } } return annotationsByTarget; }
Source:
private boolean isJobUnsaved(FileObject lastSavedJobFile, AnalysisJobBuilder analysisJobBuilder) { if (lastSavedJobFile == null) { return true; } InputStream lastSavedOutputStream = null; ByteArrayOutputStream currentOutputStream = null; try { lastSavedOutputStream = getJobFile().getContent().getInputStream(); JaxbJobWriter writer = new JaxbJobWriter(_configuration); currentOutputStream = new ByteArrayOutputStream(); writer.write(_analysisJobBuilder.toAnalysisJob(false), currentOutputStream); String currentJob = new String(currentOutputStream.toByteArray()); String currentJobNoMetadata = currentJob.replaceAll("\n", "").replaceAll("<job-metadata>.*</job-metadata>", ""); String lastSavedJob = IOUtils.toString(lastSavedOutputStream); String lastSavedJobNoMetadata = lastSavedJob.replaceAll("\n", "").replaceAll("<job-metadata>.*</job-metadata>", ""); return !currentJobNoMetadata.equals(lastSavedJobNoMetadata); } catch (FileSystemException e) { throw new IllegalStateException(e); } catch (IOException e) { throw new IllegalStateException(e); } finally { FileHelper.safeClose(currentOutputStream); FileHelper.safeClose(lastSavedOutputStream); } }

Target:
private boolean isJobUnsaved(FileObject lastSavedJobFile, AnalysisJobBuilder analysisJobBuilder) { if (lastSavedJobFile == null) { return true; } try { if (!lastSavedJobFile.exists()) { return true; } } catch (FileSystemException e) { logger.warn("Error while determining if the job file already exists", e); } InputStream lastSavedOutputStream = null; ByteArrayOutputStream currentOutputStream = null; try { File jobFile = new File(getJobFile().getURL().getFile()); if (jobFile.length() == 0) { return true; } String lastSavedJob = FileHelper.readFileAsString(jobFile); String lastSavedJobNoMetadata = lastSavedJob.replaceAll("\n", "").replaceAll("<job-metadata>.*</job-metadata>", ""); JaxbJobWriter writer = new JaxbJobWriter(_configuration); currentOutputStream = new ByteArrayOutputStream(); writer.write(_analysisJobBuilder.toAnalysisJob(false), currentOutputStream); String currentJob = new String(currentOutputStream.toByteArray()); String currentJobNoMetadata = currentJob.replaceAll("\n", "").replaceAll("<job-metadata>.*</job-metadata>", ""); return !currentJobNoMetadata.equals(lastSavedJobNoMetadata); } catch (FileSystemException e) { throw new IllegalStateException(e); } finally { FileHelper.safeClose(currentOutputStream); FileHelper.safeClose(lastSavedOutputStream); } }
Source:
private long fractionOf( long length ) { int idealChunkCount = 10; if ( length < idealChunkCount ) { return length; } int maxArraySize = Integer.MAX_VALUE - Short.MAX_VALUE; return min( length / idealChunkCount, maxArraySize ); }

Target:
private long fractionOf( long length ) { if ( length < MAGIC_CHUNK_COUNT ) { return length; } return min( length / MAGIC_CHUNK_COUNT, MAX_ARRAY_SIZE ); }
Source:
public void createPresenceStatusObject(Registration reg, int clientAwakeTime) { clientStatusList.put(reg.getEndpoint(), new PresenceStatus(clientAwakeTime)); }

Target:
private void createPresenceStatusObject(Registration reg, int clientAwakeTime) { clientStatusList.put(reg.getEndpoint(), new PresenceStatus(clientAwakeTime)); }
Source:
public default Curve withUnderlyingCurve(int curveIndex, Curve curve) { if (curveIndex == 0) { return curve; } return this; }

Target:
public default Curve withUnderlyingCurve(int curveIndex, Curve curve) { if (curveIndex == 0) { return curve; } throw new IllegalArgumentException("curveIndex is outside the range"); }
Source:
private void test(boolean async) { ConfigurationBuilder dcc = TestCacheManagerFactory.getDefaultCacheConfiguration(true); DummyInMemoryStoreConfigurationBuilder builder = dcc.persistence().addStore(DummyInMemoryStoreConfigurationBuilder.class); if (async) { builder.async().enable(); } builder.create(); EmbeddedCacheManager cacheManager = TestCacheManagerFactory.createCacheManager(dcc); Cache<Object,Object> cache = cacheManager.getCache(); try { DummyInMemoryStore loader = (DummyInMemoryStore) TestingUtil.getFirstLoader(cache); DummyInMemoryStore writer = (DummyInMemoryStore) TestingUtil.getFirstWriter(cache); assertEquals(1, loader.initCount.get()); assertEquals(1, writer.initCount.get()); } finally { TestingUtil.killCacheManagers(cacheManager); } }

Target:
private void test(boolean async) { ConfigurationBuilder dcc = TestCacheManagerFactory.getDefaultCacheConfiguration(true); DummyInMemoryStoreConfigurationBuilder builder = dcc.persistence().addStore(DummyInMemoryStoreConfigurationBuilder.class); if (async) { builder.async().enable(); } EmbeddedCacheManager cacheManager = TestCacheManagerFactory.createCacheManager(dcc); Cache<Object,Object> cache = cacheManager.getCache(); try { CacheLoader firstLoader = TestingUtil.getFirstLoader(cache); CacheLoader undelegatedLoader = firstLoader instanceof DelegatingCacheLoader ? ((DelegatingCacheLoader) firstLoader).undelegate() : firstLoader; CacheWriter firstWriter = TestingUtil.getFirstWriter(cache); CacheWriter undelegatedWriter = firstWriter instanceof DelegatingCacheWriter ? ((DelegatingCacheWriter) firstWriter).undelegate() : firstWriter; assertEquals(1, ((DummyInMemoryStore)undelegatedLoader).initCount.get()); assertEquals(1, ((DummyInMemoryStore)undelegatedWriter).initCount.get()); } finally { TestingUtil.killCacheManagers(cacheManager); } }
Source:
protected boolean set(EntityLiving dataHolder, HandType value) { dataHolder.setActiveHand(Preconditions.checkNotNull((EnumHand) (Object) value)); return true; }

Target:
protected boolean set(EntityLiving dataHolder, HandType value) { dataHolder.setLeftHanded(value.equals(HandTypes.LEFT)); return true; }
Source:
private List<DiskImage> getDiskList() { List<DiskImage> disksList = new ArrayList<>(); for (DiskImage diskImage : diskInfoDestinationMap.values()) { DiskImage clone = DiskImage.copyOf(diskImage); clone.setVolumeType(VolumeType.Sparse); if (getDiskStorageDomain(diskImage).getStorageType().isBlockDomain()) { clone.setvolumeFormat(VolumeFormat.COW); } } return disksList; }

Target:
private List<DiskImage> getDiskList() { List<DiskImage> disksList = new ArrayList<>(); for (DiskImage diskImage : diskInfoDestinationMap.values()) { DiskImage clone = DiskImage.copyOf(diskImage); clone.setVolumeType(VolumeType.Sparse); clone.setvolumeFormat(VolumeFormat.COW); disksList.add(clone); } return disksList; }