auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private ResponseEntity<Object> exportXML(XMLExportRequest exportRequest) { Map<String, Object> result = new HashMap<>(); result.put("action", "export xml"); try { <START> service.exportXml(GroupsThreadStore.getUsername(), GroupsThreadStore.getGroups(), new XMLExportRequest( <END> exportRequest.getPids(), exportRequest.getExportChildren(), exportRequest.getEmail())); } catch (Exception e) { result.put("error", e.getMessage()); if (e instanceof AccessRestrictionException) { result.put("error", "User must have a username to export xml"); return new ResponseEntity<>(result, HttpStatus.FORBIDDEN); } else { log.error("Failed to begin export of xml due to ", e); return new ResponseEntity<>(result, HttpStatus.INTERNAL_SERVER_ERROR); } } result.put("timestamp", System.currentTimeMillis()); return new ResponseEntity<>(result, HttpStatus.OK); }</code><technical_language>For consistency other new update code, want AgentPrincipals.createFromThread() pass exportXml instead</technical_language>

Target:
private ResponseEntity<Object> exportXML(XMLExportRequest exportRequest) { Map<String, Object> result = new HashMap<>(); result.put("action", "export xml"); AgentPrincipals agent = AgentPrincipals.createFromThread(); try { service.exportXml(agent.getUsername(), agent.getGroups(), new XMLExportRequest( exportRequest.getPids(), exportRequest.getExportChildren(), exportRequest.getEmail())); } catch (Exception e) { result.put("error", e.getMessage()); if (e instanceof AccessRestrictionException) { result.put("error", "User must have a username to export xml"); return new ResponseEntity<>(result, HttpStatus.FORBIDDEN); } else { log.error("Failed to begin export of xml due to ", e); return new ResponseEntity<>(result, HttpStatus.INTERNAL_SERVER_ERROR); } } result.put("timestamp", System.currentTimeMillis()); return new ResponseEntity<>(result, HttpStatus.OK); }
Source:
<code>public @NonNull View getView(int position, View convertView, @NonNull ViewGroup parent) { ViewHolder viewHolder; View rowView = convertView; if (rowView == null) { LayoutInflater layoutInflater = context.getLayoutInflater(); rowView = layoutInflater.inflate(layout, null, true); viewHolder = new ViewHolder(); viewHolder.title = (TextView) rowView.findViewById(R.id.title); viewHolder.description = (TextView) rowView.findViewById(R.id.description); viewHolder.icon = (ImageView) rowView.findViewById(R.id.icon); viewHolder.compoundButton = (CompoundButton) rowView.findViewById(R.id.compound_button); rowView.setTag(viewHolder); } else { viewHolder = (ViewHolder) rowView.getTag(); } ProfileDataObject mode = modes.get(position); Drawable iconDrawable; if (getMyApp(context) != null) { if (mode.isSelected()) { iconDrawable = getMyApp(context).getUIUtilities().getIcon(mode.getIconRes(), <START> mode.getIconColor(!getMyApp(context).getSettings().isLightContent()) <END> ); } else { iconDrawable = getMyApp(context).getUIUtilities() .getIcon(mode.getIconRes(), R.color.profile_icon_color_inactive); } } else { iconDrawable = context.getDrawable(mode.getIconRes()); } viewHolder.title.setText(mode.getName()); viewHolder.description.setText(mode.getDescription()); viewHolder.icon.setImageDrawable(iconDrawable); viewHolder.compoundButton.setChecked(mode.isSelected()); return rowView; }</code><technical_language>do need context var getMyApp method's signature</technical_language>

Target:
public @NonNull View getView(int position, View convertView, @NonNull ViewGroup parent) { ViewHolder viewHolder; View rowView = convertView; if (rowView == null) { LayoutInflater layoutInflater = context.getLayoutInflater(); rowView = layoutInflater.inflate(layout, null, true); viewHolder = new ViewHolder(); viewHolder.title = (TextView) rowView.findViewById(R.id.title); viewHolder.description = (TextView) rowView.findViewById(R.id.description); viewHolder.icon = (ImageView) rowView.findViewById(R.id.icon); viewHolder.compoundButton = (CompoundButton) rowView.findViewById(R.id.compound_button); rowView.setTag(viewHolder); } else { viewHolder = (ViewHolder) rowView.getTag(); } ProfileDataObject mode = modes.get(position); Drawable iconDrawable; if (mode.isSelected()) { iconDrawable = app.getUIUtilities().getIcon(mode.getIconRes(), mode.getIconColor(!app.getSettings().isLightContent())); } else { iconDrawable = app.getUIUtilities().getIcon(mode.getIconRes(), R.color.profile_icon_color_inactive); } viewHolder.title.setText(mode.getName()); viewHolder.description.setText(mode.getDescription()); viewHolder.icon.setImageDrawable(iconDrawable); viewHolder.compoundButton.setChecked(mode.isSelected()); return rowView; }
Source:
<code>private void findTargetLineBreakpoint( final IBreakpointsTargetDMContext bpTargetDMC, final List<MIBreakpoint> candidates, final String fileName, final Integer lineNumber, final String function, final String address, final Boolean isHardware, final Boolean isTemporary, final DataRequestMonitor<MIBreakpoint> drm) { Sequence s = new Sequence(getExecutor(), new RequestMonitor(getExecutor(), drm) { @Override @ConfinedToDsfExecutor( "fExecutor" ) <START> protected void handleCompleted() { <END> drm.setStatus(getStatus()); drm.done(); } }) { @Override public Step[] getSteps() { Step[] steps = new Step[candidates.size()]; for (int i = 0; i < steps.length; ++i) { steps[i] = new FindTargetBreakpointStep(candidates.get(i)) { @Override public void execute(final RequestMonitor rm) { if (drm.getData() != null) { rm.done(); return; } getSource( bpTargetDMC, getFileName(fMIBpt), new DataRequestMonitor<String>(getExecutor(), rm) { @Override @ConfinedToDsfExecutor( "fExecutor" ) protected void handleSuccess() { if (compareBreakpointAttributes( fMIBpt, getData(), fileName, lineNumber, function, address, isHardware, isTemporary)) { drm.setData(fMIBpt); } rm.done(); } }); } }; } return steps; } }; getExecutor().execute(s); }</code><technical_language>need override, special is done</technical_language>

Target:
private void findTargetLineBreakpoint( final IBreakpointsTargetDMContext bpTargetDMC, final List<MIBreakpoint> candidates, final String fileName, final Integer lineNumber, final String function, final String address, final Boolean isHardware, final Boolean isTemporary, final DataRequestMonitor<MIBreakpoint> drm) { class FindBreakpointRM extends ImmediateDataRequestMonitor<MIBreakpoint> { @Override @ConfinedToDsfExecutor("fExecutor") protected void handleCompleted() { final List<MIBreakpoint> bpts = new ArrayList<MIBreakpoint>(candidates); if (bpts.isEmpty()) { drm.done(); return; } final MIBreakpoint bpt = bpts.remove(0); final String debuggerPath = getFileName(bpt); getSource( bpTargetDMC, debuggerPath, new DataRequestMonitor<String>(getExecutor(), drm) { @Override @ConfinedToDsfExecutor( "fExecutor" ) protected void handleCompleted() { if (!isSuccess()) { GdbPlugin.log(getStatus()); } if (compareBreakpointAttributes( bpt, isSuccess() ? getData() : debuggerPath, fileName, lineNumber, function, address, isHardware, isTemporary)) { drm.setData(bpt); drm.done(); } else { new FindBreakpointRM().done(); } } }); } }; new FindBreakpointRM().done(); }
Source:
<code>int wifiFeatureMaskFromStaCapabilities(int capabilities) { <START> int features <END> = WifiManager.WIFI_FEATURE_INFRA; for (int i = 0; i < sFeatureCapabilityTranslation.length; i++) { if ((capabilities & sFeatureCapabilityTranslation[i][1]) != 0) { features |= sFeatureCapabilityTranslation[i][0]; } } return features; }</code><technical_language>Remove this STA iface type set this</technical_language>

Target:
int wifiFeatureMaskFromStaCapabilities(int capabilities) { int features = 0; for (int i = 0; i < sFeatureCapabilityTranslation.length; i++) { if ((capabilities & sFeatureCapabilityTranslation[i][1]) != 0) { features |= sFeatureCapabilityTranslation[i][0]; } } return features; }
Source:
<code>String normal_ping(String ip){ String result = ""; try { if(InetAddress.getByAddress(ip.getBytes()).isReachable(G.logPingTimeout() * 1000)){ result = String.format(context.getString(R.string.reachable_timeout), finish_time()); } <START> } catch (IOException e) { <END> Log.e(TAG, "Exception(04): " + e.getMessage()); result = String.format("Currently IP(%s) is not Reachable, timeout: %d ms", ip, finish_time()); } return result; }</code><technical_language>@vzool , i safe catch Generic Exception</technical_language>

Target:
String normal_ping(String ip){ String result = ""; try { if(InetAddress.getByAddress(ip.getBytes()).isReachable(G.logPingTimeout() * 1000)){ result = String.format(context.getString(R.string.reachable_timeout), finish_time()); } } catch (Exception e) { Log.e(TAG, "Exception(04): " + e.getMessage()); result = String.format("Currently IP(%s) is not Reachable, timeout: %d ms", ip, finish_time()); } return result; }
Source:
<code>protected int getMaximumTotalSize() { <START> return DiagramUIPlugin.getPlugin().getPreferenceStore().getInt(SiriusDiagramUiPreferencesKeys.PREF_MAXIMUM_EXPORT_BUFFER_SIZE.name()); <END> }</code><technical_language>retreive behavior Sirius 5.0, I 2 values here. for Windows for other OS. code like: if ("win32".equals(SWT.getPlatform())) { //$NON-NLS-1$ return DiagramUIPlugin.getPlugin().getPreferenceStore().getInt(SiriusDiagramUiPreferencesKeys.PREF_MAXIMUM_EXPORT_BUFFER_SIZE_WINDOWS.name()); } else { // Case of Linux ("gtk") Mac ("carbon") return DiagramUIPlugin.getPlugin().getPreferenceStore().getInt(SiriusDiagramUiPreferencesKeys.PREF_MAXIMUM_EXPORT_BUFFER_SIZE.name()); } PREF_MAXIMUM_EXPORT_BUFFER_SIZE_WINDOWS constant 50000000</technical_language>

Target:
protected int getMaximumTotalSize() { SiriusDiagramUiPreferencesKeys pref = SiriusDiagramUiPreferencesKeys.PREF_MAXIMUM_EXPORT_BUFFER_SIZE; if ("win32".equals(SWT.getPlatform())) { pref = SiriusDiagramUiPreferencesKeys.PREF_MAXIMUM_EXPORT_BUFFER_SIZE_WINDOWS; } return DiagramUIPlugin.getPlugin().getPreferenceStore().getInt(pref.name()); }
Source:
<code>public PwaRegistry(PWA pwa, ServletContext servletContext) throws IOException { if (System.getProperty(HEADLESS_PROPERTY) == null) { System.setProperty(HEADLESS_PROPERTY, Boolean.TRUE.toString()); } pwaConfiguration = new PwaConfiguration(pwa, servletContext); if (pwaConfiguration.isEnabled()) { <START> URL logo = getUrl(servletContext, pwaConfiguration.relIconPath()); <END> URL offlinePage = getUrl(servletContext, pwaConfiguration.relOfflinePath()); BufferedImage baseImage = getBaseImage(logo); if (baseImage == null) { LoggerFactory.getLogger(PwaRegistry.class).error( "Image is not found or can't be loaded: " + logo); } else { int bgColor = baseImage.getRGB(0, 0); icons = initializeIcons(baseImage, bgColor); } offlineHtml = initializeOfflinePage(pwaConfiguration, offlinePage); offlineHash = offlineHtml.hashCode(); manifestJson = initializeManifest().toJson(); serviceWorkerJs = initializeServiceWorker(servletContext); } }</code><technical_language>sense cover this a test? this workaround removed accidentally</technical_language>

Target:
public PwaRegistry(PWA pwa, ServletContext servletContext) throws IOException { if (System.getProperty(HEADLESS_PROPERTY) == null) { System.setProperty(HEADLESS_PROPERTY, Boolean.TRUE.toString()); } pwaConfiguration = new PwaConfiguration(pwa, servletContext); if (pwaConfiguration.isEnabled()) { URL logo = getResourceUrl(servletContext, pwaConfiguration.relIconPath()); URL offlinePage = getResourceUrl(servletContext, pwaConfiguration.relOfflinePath()); BufferedImage baseImage = getBaseImage(logo); if (baseImage == null) { LoggerFactory.getLogger(PwaRegistry.class).error( "Image is not found or can't be loaded: " + logo); } else { int bgColor = baseImage.getRGB(0, 0); icons = initializeIcons(baseImage, bgColor); } offlineHtml = initializeOfflinePage(pwaConfiguration, offlinePage); offlineHash = offlineHtml.hashCode(); manifestJson = initializeManifest().toJson(); serviceWorkerJs = initializeServiceWorker(servletContext); } }
Source:
<code>public void run() { try { synchronized (lock) { final LeaderLatch latch = leaderLatch.get(); if (latch == null || !latch.hasLeadership()) { log.info("LEGGO MY EGGO. [%s] is master.", latch == null ? null : latch.getLeader().getId()); stopBeingMaster(); return; } } List<Boolean> allStarted = Arrays.asList( databaseSegmentManager.isStarted(), serverInventoryView.isStarted() ); for (Boolean aBoolean : allStarted) { if (!aBoolean) { log.error("InventoryManagers not started[%s]", allStarted); stopBeingMaster(); return; } } <START> DynamicConfigs dynamicConfigs = configManager.watch(DynamicConfigs.CONFIG_KEY,DynamicConfigs.class).get(); <END> DruidMasterRuntimeParams params = DruidMasterRuntimeParams.newBuilder() .withStartTime(startTime) .withDatasources(databaseSegmentManager.getInventory()) .withDynamicConfigs(dynamicConfigs) .withEmitter(emitter) .build(); for (DruidMasterHelper helper : helpers) { params = helper.run(params); } } catch (Exception e) { log.makeAlert(e, "Caught exception, ignoring so that schedule keeps going.").emit(); } }</code><technical_language>watching this again</technical_language>

Target:
public void run() { try { synchronized (lock) { final LeaderLatch latch = leaderLatch.get(); if (latch == null || !latch.hasLeadership()) { log.info("LEGGO MY EGGO. [%s] is master.", latch == null ? null : latch.getLeader().getId()); stopBeingMaster(); return; } } List<Boolean> allStarted = Arrays.asList( databaseSegmentManager.isStarted(), serverInventoryView.isStarted() ); for (Boolean aBoolean : allStarted) { if (!aBoolean) { log.error("InventoryManagers not started[%s]", allStarted); stopBeingMaster(); return; } } DruidMasterRuntimeParams params = DruidMasterRuntimeParams.newBuilder() .withStartTime(startTime) .withDatasources(databaseSegmentManager.getInventory()) .withMasterSegmentSettings(segmentSettingsAtomicReference.get()) .withEmitter(emitter) .build(); for (DruidMasterHelper helper : helpers) { params = helper.run(params); } } catch (Exception e) { log.makeAlert(e, "Caught exception, ignoring so that schedule keeps going.").emit(); } }
Source:
<code>public static int fromHours(int hours) { <START> int refreshRate = hours * 3600; <END> RefreshRate.validateRefreshRate(refreshRate); return refreshRate; }</code><technical_language>nit: a constant called HOUR_IN_SECONDS, contains 3600</technical_language>

Target:
public static int fromHours(int hours) { int refreshRate = hours * RefreshRate.SECONDS_PER_HOUR; RefreshRate.validateRefreshRate(refreshRate); return refreshRate; }
Source:
<code>public List<User> getUsers(PerunSession sess, Map<String, String> attributesWithSearchingValues) throws InternalErrorException, AttributeNotExistsException, PrivilegeException, WrongAttributeAssignmentException { <START> if (!AuthzResolver.authorizedInternal(sess, "getUsers_Map<String, String>_policy", Collections.emptyList())) <END> throw new PrivilegeException(sess, "getUsers"); return searcherBl.getUsers(sess, attributesWithSearchingValues); }</code><technical_language>I replace ", " in policy name for "_" in other cases</technical_language>

Target:
public List<User> getUsers(PerunSession sess, Map<String, String> attributesWithSearchingValues) throws InternalErrorException, AttributeNotExistsException, PrivilegeException, WrongAttributeAssignmentException { if (!AuthzResolver.authorizedInternal(sess, "getUsers_Map<String_String>_policy")) throw new PrivilegeException(sess, "getUsers"); return searcherBl.getUsers(sess, attributesWithSearchingValues); }
Source:
<code>public boolean verifyPasswordStructure(String password) { if (StringUtils.isBlank(password)) { return false; } if (StringUtils.length(password) < 6) { return false; <START> } <END> return true; }</code><technical_language>Silly ifs collapsed...an empty password a length < 6 already</technical_language>

Target:
public boolean verifyPasswordStructure(String password) { if (StringUtils.length(password) < 6) { return false; } return true; }
Source:
<code>private void logFullWorkflowRefresh(final Workflow workflow) { if (workflow.getMode() == WorkflowMode.FULL) { <START> LOG.info(String.format("%s: Refreshing %s workflow named %s", dashboardPrefix, workflow.getDescriptorType(), workflow.getWorkflowPath())); <END> } }</code><technical_language>workflow.getEntryPath() here, tool.getEntryPath() simpler</technical_language>

Target:
private void logFullWorkflowRefresh(final Workflow workflow) { if (workflow.getMode() == WorkflowMode.FULL) { LOG.info(String.format("%s: Refreshing %s workflow named %s", dashboardPrefix, workflow.getDescriptorType(), workflow.getEntryPath())); } }
Source:
<code>protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_news_story); ButterKnife.inject(this); DisplayMetrics displayMetrics = getResources().getDisplayMetrics(); story = getIntent().getParcelableExtra(Constants.News.STORY); <START> Picasso.with(this).load(story.getCoverImage().getRepresentations().get(0).getUrl()) <END> .placeholder(R.drawable.grey_rect).into(storyImageView); String template = readInHtmlTemplate(); if (story.getTitle() != null) { template = template.replace("__TITLE__", story.getTitle()); } else { template = template.replace("__TITLE__", ""); } if (story.getAuthor() != null) { template = template.replace("__AUTHOR__", story.getAuthor()); } else { template = template.replace("__AUTHOR__", ""); } if (story.getPublishedAt() != null) { template = template.replace("__DATE__", NewsUtils.formatNewsPublishedTime(story.getPublishedAt())); } else { template = template.replace("__DATE__", ""); } if (story.getDek() != null) { template = template.replace("__DEK__", story.getDek()); } else { template = template.replace("__DEK__", ""); } if (story.getBodyHtml() != null) { template = template.replace("__BODY__", story.getBodyHtml()); } else { template = template.replace("__BODY__", ""); } template = template.replace("__WIDTH__", String.valueOf(displayMetrics.widthPixels)); storyWebView.loadData(template, "text/html;charset=utf-8", "UTF-8"); }</code><technical_language>I built 3 shortcut functions in story model get 3 size image urls for cover image, getOriginalCoverImageUrl() get url for this</technical_language>

Target:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_news_story); ButterKnife.inject(this); DisplayMetrics displayMetrics = getResources().getDisplayMetrics(); story = getIntent().getParcelableExtra(Constants.News.STORY); Picasso.with(this).load(story.getOriginalCoverImageUrl()) .placeholder(R.drawable.grey_rect).into(storyImageView); storyWebView.getSettings().setJavaScriptEnabled(true); String template = readInHtmlTemplate(); if (story.getTitle() != null) { template = template.replace("__TITLE__", story.getTitle()); } else { template = template.replace("__TITLE__", ""); } if (story.getAuthor() != null) { template = template.replace("__AUTHOR__", story.getAuthor()); } else { template = template.replace("__AUTHOR__", ""); } if (story.getPublishedAt() != null) { template = template.replace("__DATE__", NewsUtils.formatNewsPublishedTime(story.getPublishedAt())); } else { template = template.replace("__DATE__", ""); } if (story.getDek() != null) { template = template.replace("__DEK__", story.getDek()); } else { template = template.replace("__DEK__", ""); } if (story.getBodyHtml() != null) { template = template.replace("__BODY__", story.getBodyHtml()); } else { template = template.replace("__BODY__", ""); } template = template.replace("__WIDTH__", String.valueOf(displayMetrics.widthPixels)); storyWebView.loadData(template, "text/html;charset=utf-8", "UTF-8"); }
Source:
<code>private final void checkMaps(final boolean strict, final GridDhtCacheAdapter<String, Integer>... caches) throws Exception { if (caches.length < 2) return; assert GridTestUtils.waitForCondition(() -> { info("Checking partition maps."); for (int i = 0; i < caches.length; i++) info("Partition map for node " + i + ": " + caches[i].topology().partitionMap(false).toFullString()); GridDhtPartitionFullMap orig = caches[0].topology().partitionMap(true); for (int i = 1; i < caches.length; i++) { GridDhtPartitionFullMap cmp = caches[i].topology().partitionMap(true); if(!orig.keySet().equals(cmp.keySet())) { info("Cache[0] key set is not equal to cache[1] key set, rerun"); return false; } for (Map.Entry<UUID, GridDhtPartitionMap> entry : orig.entrySet()) { UUID nodeId = entry.getKey(); GridDhtPartitionMap nodeMap = entry.getValue(); GridDhtPartitionMap cmpMap = cmp.get(nodeId); if (cmpMap == null || !nodeMap.keySet().equals(cmpMap.keySet())) { info("Cache key set is not equal to nodeMap key set, rerun"); return false; } for (Map.Entry<Integer, GridDhtPartitionState> nodeEntry : nodeMap.entrySet()) { GridDhtPartitionState state = cmpMap.get(nodeEntry.getKey()); boolean isOk = state != null && state != GridDhtPartitionState.EVICTED && (!strict || state == GridDhtPartitionState.OWNING) && state == nodeEntry.getValue(); if (!isOk) { <START> info("Entry state is invalid, rerun"); <END> return false; } } } } return true; }, 25000); }</code><technical_language>Typo. Seems, "Partition state", entry state</technical_language>

Target:
private final void checkMaps(final boolean strict, final GridDhtCacheAdapter<String, Integer>... caches) throws Exception { if (caches.length < 2) return; assert GridTestUtils.waitForCondition(() -> { info("Checking partition maps."); for (int i = 0; i < caches.length; i++) info("Partition map for node " + i + ": " + caches[i].topology().partitionMap(false).toFullString()); GridDhtPartitionFullMap orig = caches[0].topology().partitionMap(true); for (int i = 1; i < caches.length; i++) { GridDhtPartitionFullMap cmp = caches[i].topology().partitionMap(true); if(!orig.keySet().equals(cmp.keySet())) { info("Cache[0] key set is not equal to cache[1] key set, rerun"); return false; } for (Map.Entry<UUID, GridDhtPartitionMap> entry : orig.entrySet()) { UUID nodeId = entry.getKey(); GridDhtPartitionMap nodeMap = entry.getValue(); GridDhtPartitionMap cmpMap = cmp.get(nodeId); if (cmpMap == null || !nodeMap.keySet().equals(cmpMap.keySet())) { info("Cache key set is not equal to nodeMap key set, rerun"); return false; } for (Map.Entry<Integer, GridDhtPartitionState> nodeEntry : nodeMap.entrySet()) { GridDhtPartitionState state = cmpMap.get(nodeEntry.getKey()); boolean isOk = state != null && state != GridDhtPartitionState.EVICTED && (!strict || state == GridDhtPartitionState.OWNING) && state == nodeEntry.getValue(); if (!isOk) { info("Partition state is invalid, rerun"); return false; } } } } return true; }, 25000); }
Source:
<code>public void realmResults_readableAcrossThreads() { final long TEST_SIZE = 10; Realm realm = looperThread.getRealm(); realm.beginTransaction(); for (int i = 0; i < TEST_SIZE; i++) { realm.createObject(AllTypes.class).setColumnLong(1); } realm.commitTransaction(); subscription = realm.where(AllTypes.class).sort(AllTypes.FIELD_LONG).findAllAsync().asFlowable() .subscribeOn(Schedulers.io()) .filter(RealmResults::isLoaded) .map(results -> { RealmLog.error(Thread.currentThread().getName()); <START> return new Pair<>(results.size(), results); <END> }) .observeOn(Schedulers.computation()) .subscribe( pair -> { RealmLog.error(Thread.currentThread().getName()); assertEquals(TEST_SIZE, pair.first.intValue()); assertEquals(TEST_SIZE, pair.second.size()); looperThread.testComplete(); } ); }</code><technical_language>pass multiple frozen objects assert observing another thread is ok</technical_language>

Target:
public void realmResults_readableAcrossThreads() { final long TEST_SIZE = 10; Realm realm = looperThread.getRealm(); realm.beginTransaction(); for (int i = 0; i < TEST_SIZE; i++) { realm.createObject(AllTypes.class).setColumnLong(1); } realm.commitTransaction(); AtomicLong startingThread = new AtomicLong(Thread.currentThread().getId()); AtomicLong subscriberThread = new AtomicLong(); subscription = realm.where(AllTypes.class).sort(AllTypes.FIELD_LONG).findAllAsync().asFlowable() .doOnSubscribe((r) -> { subscriberThread.set(Thread.currentThread().getId()); }) .subscribeOn(Schedulers.io()) .filter(results -> { assertNotEquals(startingThread.get(), subscriberThread.get()); return results.isLoaded(); }) .map(results -> new Pair<>(results.size(), new Pair<>(results, results.first()))) .observeOn(Schedulers.computation()) .subscribe( pair -> { assertNotEquals(startingThread.get(), Thread.currentThread().getId()); assertNotEquals(subscriberThread.get(), Thread.currentThread().getId()); assertEquals(TEST_SIZE, pair.first.intValue()); assertEquals(TEST_SIZE, pair.second.first.size()); assertEquals(pair.second.second.getColumnLong(), pair.second.first.first().getColumnLong()); disposeSuccessfulTest(realm); } ); }
Source:
<code><START> public void loadRepository(boolean refresh) { <END> Consumer subscriber = repository -> { mRepository = (Repository) repository; updateTitle(); invalidateTabs(); if (mInitialPage >= PAGE_REPO_OVERVIEW && mInitialPage <= PAGE_ACTIVITY) { getPager().setCurrentItem(mInitialPage); mInitialPage = -1; } setContentShown(true); supportInvalidateOptionsMenu(); }; RepositoryService.loadRepository(this, mRepoOwner, mRepoName, refresh) .subscribe(subscriber, e -> {}); }</code><technical_language>private Also, put 3 load methods in proximity other</technical_language>

Target:
private void loadRepository(boolean refresh) { Consumer<Repository> subscriber = repository -> { mRepository = repository; updateTitle(); invalidateTabs(); if (mInitialPage >= PAGE_REPO_OVERVIEW && mInitialPage <= PAGE_ACTIVITY) { getPager().setCurrentItem(mInitialPage); mInitialPage = -1; } setContentShown(true); supportInvalidateOptionsMenu(); }; RepositoryService.loadRepository(this, mRepoOwner, mRepoName, refresh) .subscribe(subscriber, error -> {}); }
Source:
<code>protected boolean canLoad(Object key) { <START> return !cacheConfiguration.clustering().cacheMode().isDistributed() || cdl.localNodeIsOwner(key); <END> }</code><technical_language>I ClusteringDependentLogic.localNodeIsOwner handle local, replicated distributed scenarios correctly. If need this method all</technical_language>

Target:
protected boolean canLoad(Object key) { return !cacheConfiguration.clustering().cacheMode().isDistributed() || dm.getReadConsistentHash().isKeyLocalToNode(cdl.getAddress(), key); }
Source:
<code>public List<StreamsDatum> process(StreamsDatum entry) { List<StreamsDatum> result = Lists.newArrayList(); ObjectNode metadataObjectNode; try { metadataObjectNode = mapper.readValue((String) entry.getDocument(), ObjectNode.class); } catch (IOException e) { return result; } Map<String, Object> metadata = DocumentToMetadataProcessor.asMap(metadataObjectNode); if(entry == null || entry.getMetadata() == null) return result; String index = (String) metadata.get("index"); String type = (String) metadata.get("type"); String id = (String) metadata.get("id"); <START> <END> if( index == null ) { index = this.config.getIndexes().get(0); } if( type == null ) { type = this.config.getTypes().get(0); } if( id == null ) { id = entry.getId(); } GetRequestBuilder getRequestBuilder = elasticsearchClientManager.getClient().prepareGet(index, type, id); getRequestBuilder.setFields("*", "_timestamp"); getRequestBuilder.setFetchSource(true); GetResponse getResponse = getRequestBuilder.get(); if( getResponse == null || getResponse.isExists() == false || getResponse.isSourceEmpty() == true ) return result; entry.setDocument(getResponse.getSource()); if( getResponse.getField("_timestamp") != null) { DateTime timestamp = new DateTime(((Long) getResponse.getField("_timestamp").getValue()).longValue()); entry.setTimestamp(timestamp); } result.add(entry); return result; }</code><technical_language>This code is duplicated of new processors, I a variant of exists in ElasticsearchPersistWriter. chance this abstracted out a centralized location</technical_language>

Target:
public List<StreamsDatum> process(StreamsDatum entry) { List<StreamsDatum> result = Lists.newArrayList(); ObjectNode metadataObjectNode; try { metadataObjectNode = mapper.readValue((String) entry.getDocument(), ObjectNode.class); } catch (IOException e) { return result; } Map<String, Object> metadata = ElasticsearchMetadataUtil.asMap(metadataObjectNode); if(entry == null || entry.getMetadata() == null) return result; String index = ElasticsearchMetadataUtil.getIndex(metadata, config); String type = ElasticsearchMetadataUtil.getType(metadata, config); String id = ElasticsearchMetadataUtil.getId(metadata); GetRequestBuilder getRequestBuilder = elasticsearchClientManager.getClient().prepareGet(index, type, id); getRequestBuilder.setFields("*", "_timestamp"); getRequestBuilder.setFetchSource(true); GetResponse getResponse = getRequestBuilder.get(); if( getResponse == null || getResponse.isExists() == false || getResponse.isSourceEmpty() == true ) return result; entry.setDocument(getResponse.getSource()); if( getResponse.getField("_timestamp") != null) { DateTime timestamp = new DateTime(((Long) getResponse.getField("_timestamp").getValue()).longValue()); entry.setTimestamp(timestamp); } result.add(entry); return result; }
Source:
<code><START> public boolean test() throws Exception { <END> @NonNull TmfTimeRange curWindowRange = TmfTraceManager.getInstance().getTraceContext(fTrace).getWindowRange(); if (!curWindowRange.equals(fWindowRange)) { fFailureMessage = "Current window range " + curWindowRange + " is not expected " + fWindowRange; return false; } if (fView.isDirty()) { fFailureMessage = "Time graph is dirty"; return false; } return true; }</code><technical_language>test view's current trace is expected</technical_language>

Target:
public boolean test() throws Exception { ITmfTrace trace = fView.getTrace(); if (!fTrace.equals(trace)) { String traceName = trace != null ? trace.getName() : "none"; fFailureMessage = "Expected view to display trace:" + fTrace.getName() + " but was displaying trace: " + traceName; } @NonNull TmfTimeRange curWindowRange = TmfTraceManager.getInstance().getTraceContext(fTrace).getWindowRange(); if (!curWindowRange.equals(fWindowRange)) { fFailureMessage = "Current window range " + curWindowRange + " is not expected " + fWindowRange; return false; } if (fView.isDirty()) { fFailureMessage = "Time graph is dirty"; return false; } return true; }
Source:
<code>public ResponseEntity createSampleListFolder(@PathVariable final String crop, @RequestParam final String folderName, @RequestParam final Integer parentId, @RequestParam final String programUUID) { <START> Map<String, Object> map; <END> try { map = this.sampleListService.createSampleListFolder(folderName, parentId, programUUID); } catch (final MiddlewareException e) { final ErrorResponse response = new ErrorResponse(); response.addError("Something went wrong, please try again"); return new ResponseEntity<>(response, HttpStatus.CONFLICT); } return new ResponseEntity<>(map, HttpStatus.OK); }</code><technical_language>@vmaletta add final</technical_language>

Target:
public ResponseEntity createSampleListFolder(@PathVariable final String crop, @RequestParam final String folderName, @RequestParam final Integer parentId, @RequestParam final String programUUID) { final Map<String, Object> map; try { map = this.sampleListService.createSampleListFolder(folderName, parentId, programUUID); } catch (final MiddlewareException e) { final ErrorResponse response = new ErrorResponse(); response.addError("Something went wrong, please try again"); return new ResponseEntity<>(response, HttpStatus.CONFLICT); } return new ResponseEntity<>(map, HttpStatus.OK); }
Source:
<code>public boolean isTopLevelClass() { <START> return !classInfo.name().isInner(); <END> }</code><technical_language>I ClassInfo.nestingType() here</technical_language>

Target:
public boolean isTopLevelClass() { return classInfo.nestingType().equals(ClassInfo.NestingType.TOP_LEVEL); }
Source:
<code>public void handleSlotClick(EntityPlayer player, ItemStack filter, boolean shiftClick, boolean rightClick) { <START> if (!shiftClick && !player.inventory.getItemStack().isEmpty() && cachedItemMap.getTotalItemCount() != getMaxStorage()) { <END> tryAddItem(player, player.inventory.getItemStack()); } else if (!filter.isEmpty()) { tryGetItem(player, filter, shiftClick, rightClick); } }</code><technical_language>This need fixed in a place in tryAddItem calls insertItem tile in warehouse multiblock insert return stack inserted, if single tile in warehouse is full return empty stack change player in inventory eat amount of stack clicked warehouse</technical_language>

Target:
public void handleSlotClick(EntityPlayer player, ItemStack filter, boolean shiftClick, boolean rightClick) { if (!shiftClick && !player.inventory.getItemStack().isEmpty()) { tryAddItem(player, player.inventory.getItemStack()); } else if (!filter.isEmpty()) { tryGetItem(player, filter, shiftClick, rightClick); } }
Source:
<code>private String convertBoolean(final String value) { String result = value; if (result.equals("true")) { result = "Yes"; } <START> if (result.equals("false")) { <END> result = "No"; } return result; }</code><technical_language>I recommend else if avoid comparing a string unnecessarily</technical_language>

Target:
private String convertBoolean(final String value) { String result = value; if (result.equals("true")) { result = "Yes"; } else if (result.equals("false")) { result = "No"; } return result; }
Source:
<code>public Void call() throws Exception { LOG.debug("Starting region operation on " + region); region.startRegionOperation(); try { LOG.debug("Flush region " + region.toString() + " started..."); <START> region.flushcache(families, false, FlushLifeCycleTracker.DUMMY); <END> } finally { LOG.debug("Closing region operation on " + region); region.closeRegionOperation(); } return null; }</code><technical_language>this affect other versions families, flush(TableName tableName)? region.flush(true), internally, loads families delegating flushcache(List<byte[]> families, boolean writeFlushRequestWalMarker, FlushLifeCycleTracker tracker), this now</technical_language>

Target:
public Void call() throws Exception { LOG.debug("Starting region operation on " + region); region.startRegionOperation(); try { LOG.debug("Flush region " + region.toString() + " started..."); if (families == null) { region.flush(true); } else { region.flushcache(families, false, FlushLifeCycleTracker.DUMMY); } } finally { LOG.debug("Closing region operation on " + region); region.closeRegionOperation(); } return null; }
Source:
<code>private List<Method> getAllDeclaredHandlerMethods(Class<?> clazz) { final List<Method> handlerMethods = new ArrayList<>(); while (clazz != null && !Collection.class.isAssignableFrom(clazz) && !clazz.isArray()) { for (final Method handlerMethod : clazz.getDeclaredMethods()) { if (handlerMethod.isAnnotationPresent(EventListener.class)) { if (handlerMethod.getReturnType().equals(Void.TYPE) && handlerMethod.getParameterTypes().length == 1 && ApplicationEvent.class.isAssignableFrom(handlerMethod.getParameterTypes()[0])) { handlerMethods.add(handlerMethod); } else { <START> LOG.warn( <END> "@EventListener {}.{} skipped. Methods must be public, void, and accept exactly" + " one argument extending com.netflix.governator.event.ApplicationEvent.", clazz.getName(), handlerMethod.getName()); } } } clazz = clazz.getSuperclass(); } return handlerMethods; }</code><technical_language>this exception instead of a warning</technical_language>

Target:
private List<Method> getAllDeclaredHandlerMethods(Class<?> clazz) { final List<Method> handlerMethods = new ArrayList<>(); while (clazz != null && !Collection.class.isAssignableFrom(clazz) && !clazz.isArray()) { for (final Method handlerMethod : clazz.getDeclaredMethods()) { if (handlerMethod.isAnnotationPresent(EventListener.class)) { if (handlerMethod.getReturnType().equals(Void.TYPE) && handlerMethod.getParameterTypes().length == 1 && ApplicationEvent.class.isAssignableFrom(handlerMethod.getParameterTypes()[0])) { handlerMethods.add(handlerMethod); } else { throw new IllegalArgumentException("@EventListener " + clazz.getName() + "." + handlerMethod.getName() + "skipped. Methods must be public, void, and accept exactly" + " one argument extending com.netflix.governator.event.ApplicationEvent."); } } } clazz = clazz.getSuperclass(); } return handlerMethods; }
Source:
<code>@Override public void sendMessage(ClusterNode node, Message msg, IgniteInClosure<IgniteException> ackC) { if (needStaleTop) { if (msg instanceof GridIoMessage) { GridIoMessage ioMsg = (GridIoMessage)msg; Message appMsg = ioMsg.message(); if (appMsg != null && appMsg instanceof DataStreamerRequest) { DataStreamerRequest req = (DataStreamerRequest)appMsg; AffinityTopologyVersion validTop = req.topologyVersion(); AffinityTopologyVersion staleTop = new AffinityTopologyVersion( validTop.topologyVersion() - 1, validTop.minorTopologyVersion()); appMsg = new DataStreamerRequest( req.requestId(), req.responseTopicBytes(), req.cacheName(), req.updaterBytes(), req.entries(), req.ignoreDeploymentOwnership(), req.skipStore(), req.keepBinary(), req.deploymentMode(), req.sampleClassName(), req.userVersion(), req.participants(), req.classLoaderId(), req.forceLocalDeployment(), staleTop, -1); msg = new GridIoMessage( <START> GridTestUtils.<UUID>getFieldValue(ioMsg, "secSubjId"), <END> GridTestUtils.<Byte>getFieldValue(ioMsg, "plc"), GridTestUtils.getFieldValue(ioMsg, "topic"), GridTestUtils.<Integer>getFieldValue(ioMsg, "topicOrd"), appMsg, GridTestUtils.<Boolean>getFieldValue(ioMsg, "ordered"), ioMsg.timeout(), ioMsg.skipOnTimeout()); needStaleTop = false; } } } super.sendMessage(node, msg, ackC); }</code><technical_language>Please, check changes code style checker. <UUID> required, safely remove it</technical_language>

Target:
@Override public void sendMessage(ClusterNode node, Message msg, IgniteInClosure<IgniteException> ackC) { if (needStaleTop) { if (msg instanceof GridIoMessage) { GridIoMessage ioMsg = (GridIoMessage)msg; Message appMsg = ioMsg.message(); if (appMsg != null && appMsg instanceof DataStreamerRequest) { DataStreamerRequest req = (DataStreamerRequest)appMsg; AffinityTopologyVersion validTop = req.topologyVersion(); AffinityTopologyVersion staleTop = new AffinityTopologyVersion( validTop.topologyVersion() - 1, validTop.minorTopologyVersion()); appMsg = new DataStreamerRequest( req.requestId(), req.responseTopicBytes(), req.cacheName(), req.updaterBytes(), req.entries(), req.ignoreDeploymentOwnership(), req.skipStore(), req.keepBinary(), req.deploymentMode(), req.sampleClassName(), req.userVersion(), req.participants(), req.classLoaderId(), req.forceLocalDeployment(), staleTop, -1); msg = new GridIoMessage( GridTestUtils.<Byte>getFieldValue(ioMsg, "plc"), GridTestUtils.getFieldValue(ioMsg, "topic"), GridTestUtils.<Integer>getFieldValue(ioMsg, "topicOrd"), appMsg, GridTestUtils.<Boolean>getFieldValue(ioMsg, "ordered"), ioMsg.timeout(), ioMsg.skipOnTimeout()); needStaleTop = false; } } } super.sendMessage(node, msg, ackC); }
Source:
<code>public void execute(Tuple tuple) { R obj = (R) tuple.getValue(0); consumer.accept(obj); <START> } <END></code><technical_language>Do need ack</technical_language>

Target:
public void execute(Tuple tuple) { R obj = (R) tuple.getValue(0); consumer.accept(obj); collector.ack(tuple); }
Source:
<code>public void placeNewOrder(Market market, String symbol, int volume, double price, OrderType orderType) throws StockMarketExpection { MarketHistory tempM = market.getMarketHistory(); double totalCost = (price * volume); if (cashInHand < totalCost && orderType == OrderType.BUY) { throw new StockMarketExpection( "Trader does not have enough cash for purchase\n"); } <START> for (Order o : this.ordersPlaced) { <END> if (o.getStockSymbol().equals(symbol)) { throw new StockMarketExpection( "Trader cannot place multiple orders for the same stock.\n"); } } if (orderType == OrderType.SELL) { boolean found = false; for (Order o : this.position) { if (o.getStockSymbol().equals(symbol) && o.getSize() < volume) throw new StockMarketExpection( "Trader cannot sell more stocks than they own.\n"); else if (o.getStockSymbol().equals(symbol)) { found = true; } } if (found == false) { throw new StockMarketExpection( "Trader cannot sell more stocks than they own.\n"); } } if (orderType == OrderType.BUY) { Order newBuyOrder = new BuyOrder(symbol, volume,price, this); this.ordersPlaced.add(newBuyOrder); market.addOrder(newBuyOrder); } else { Order newSellOrder = new SellOrder(symbol, volume, price, this); this.ordersPlaced.add(newSellOrder); market.addOrder(newSellOrder); } }</code><technical_language>bad variable name</technical_language>

Target:
public void placeNewOrder(Market market, String symbol, int volume, double price, OrderType orderType) throws StockMarketExpection { MarketHistory tempM = market.getMarketHistory(); double totalCost = (price * volume); if (cashInHand < totalCost && orderType == OrderType.BUY) { throw new StockMarketExpection( "Trader does not have enough cash for purchase\n"); } for (Order order : this.ordersPlaced) { if (order.getStockSymbol().equals(symbol)) { throw new StockMarketExpection( "Trader cannot place multiple orders for the same stock.\n"); } } if (orderType == OrderType.SELL) { boolean found = false; for (Order order : this.position) { if (order.getStockSymbol().equals(symbol) && order.getSize() < volume) throw new StockMarketExpection( "Trader cannot sell more stocks than they own.\n"); else if (order.getStockSymbol().equals(symbol)) { found = true; } } if (found == false) { throw new StockMarketExpection( "Trader cannot sell more stocks than they own.\n"); } } if (orderType == OrderType.BUY) { Order newBuyOrder = new BuyOrder(symbol, volume,price, this); this.ordersPlaced.add(newBuyOrder); market.addOrder(newBuyOrder); } else { Order newSellOrder = new SellOrder(symbol, volume, price, this); this.ordersPlaced.add(newSellOrder); market.addOrder(newSellOrder); } }
Source:
<code>public void setComponentPopupMenu(JPopupMenu popup) { super.setComponentPopupMenu(popup); <START> myColorChooserButton.setComponentPopupMenu(popup); <END> }</code><technical_language>if (myColorChooserButton != null)</technical_language>

Target:
public void setComponentPopupMenu(JPopupMenu popup) { super.setComponentPopupMenu(popup); myResourceChooserButton.setComponentPopupMenu(popup); }
Source:
<code>private void testMirrorMergeAction(MergeMode actionMergeMode, DifferenceState expectedLeftDiffState, DifferenceState expectedRightDiffState) { IEMFCompareConfiguration emfCC = createConfiguration(true, true); IComparisonScope scope = new DefaultComparisonScope(leftResource, rightResource, originResource); Comparison comparision = EMFCompare.builder().build().compare(scope); final MockMergeAction mergeAction = new MockMergeAction(emfCC, mergerRegistry, actionMergeMode, null); mergeAction.setMirrored(true); Diff leftDiff = get(filter(comparision.getDifferences(), fromSide(DifferenceSource.LEFT)), 0); assertEquals(DifferenceState.UNRESOLVED, leftDiff.getState()); mergeAction.updateSelection(new StructuredSelection(leftDiff)); mergeAction.run(); leftDiff = get(filter(comparision.getDifferences(), fromSide(DifferenceSource.LEFT)), 0); assertEquals(expectedLeftDiffState, leftDiff.getState()); Diff rightDiff = get(filter(comparision.getDifferences(), fromSide(DifferenceSource.RIGHT)), 0); assertEquals(DifferenceState.UNRESOLVED, rightDiff.getState()); mergeAction.updateSelection(new StructuredSelection(rightDiff)); mergeAction.run(); rightDiff = get(filter(comparision.getDifferences(), fromSide(DifferenceSource.RIGHT)), 0); assertEquals(expectedRightDiffState, rightDiff.getState()); <START> editingDomain.dispose(); <END> }</code><technical_language>disposing editing domain in tests, @After action</technical_language>

Target:
private void testMirrorMergeAction(MergeMode actionMergeMode, DifferenceState expectedLeftDiffState, DifferenceState expectedRightDiffState) { IEMFCompareConfiguration emfCC = createConfiguration(true, true); IComparisonScope scope = new DefaultComparisonScope(leftResource, rightResource, originResource); Comparison comparision = EMFCompare.builder().build().compare(scope); final MockMergeAction mergeAction = new MockMergeAction(emfCC, mergerRegistry, actionMergeMode, null); mergeAction.setMirrored(true); Diff leftDiff = get(filter(comparision.getDifferences(), fromSide(DifferenceSource.LEFT)), 0); assertEquals(DifferenceState.UNRESOLVED, leftDiff.getState()); mergeAction.updateSelection(new StructuredSelection(leftDiff)); mergeAction.run(); leftDiff = get(filter(comparision.getDifferences(), fromSide(DifferenceSource.LEFT)), 0); assertEquals(expectedLeftDiffState, leftDiff.getState()); Diff rightDiff = get(filter(comparision.getDifferences(), fromSide(DifferenceSource.RIGHT)), 0); assertEquals(DifferenceState.UNRESOLVED, rightDiff.getState()); mergeAction.updateSelection(new StructuredSelection(rightDiff)); mergeAction.run(); rightDiff = get(filter(comparision.getDifferences(), fromSide(DifferenceSource.RIGHT)), 0); assertEquals(expectedRightDiffState, rightDiff.getState()); }
Source:
<code>public Iterable<AlgorithmEvaluation> applyAlgorithm(Attribute targetAttribute, String algorithm, Iterable<Entity> sourceEntities) { return stream(sourceEntities.spliterator(), false).map(entity -> { AlgorithmEvaluation algorithmResult = new AlgorithmEvaluation(entity); Object derivedValue; try { Object result = jsMagmaScriptEvaluator.eval(algorithm, entity); derivedValue = convert(result, targetAttribute); } catch (NullPointerException npe) { return algorithmResult.errorMessage( <START> "Applying an algorithm on a null source value caused an exception. Is the target attribute required?"); <END> } catch (Exception e) { return algorithmResult.errorMessage(e.getLocalizedMessage()); } return algorithmResult.value(derivedValue); }).collect(toList()); }</code><technical_language>this sort of able code? generate (and immediately catch) a coded exception</technical_language>

Target:
public Iterable<AlgorithmEvaluation> applyAlgorithm(Attribute targetAttribute, String algorithm, Iterable<Entity> sourceEntities) { return stream(sourceEntities.spliterator(), false).map(entity -> { AlgorithmEvaluation algorithmResult = new AlgorithmEvaluation(entity); Object derivedValue; try { Object result = jsMagmaScriptEvaluator.eval(algorithm, entity); derivedValue = convert(result, targetAttribute); } catch (ScriptExecutionException e) { LOG.warn("", e); return algorithmResult.errorMessage(e.getLocalizedMessage()); } return algorithmResult.value(derivedValue); }).collect(toList()); }
Source:
<code>public Response setBranchName(long branchUuid, String newName) { BranchReadable branch = getBranchById(branchUuid); boolean modified = false; if (isDifferent(branch.getName(), newName)) { Callable<?> op = getBranchOps().changeBranchName(branch, newName); <START> executeCallable(op); <END> activityLog.createEntry(BRANCH_OPERATION_TYPEID, ActivityLog.INITIAL_STATUS, String.format( "Branch Operation Set Branch Name {branchUUID: %s prevName: %s newName: %s accountId: %s serverId: %s clientId: %s}", branchUuid, branch.getName(), newName, accountId, serverId, clientId)); modified = true; } return asResponse(modified); }</code><technical_language>try/catch</technical_language>

Target:
public Response setBranchName(long branchUuid, String newName) { BranchReadable branch = getBranchById(branchUuid); boolean modified = false; if (isDifferent(branch.getName(), newName)) { Callable<?> op = getBranchOps().changeBranchName(branch, newName); executeCallable(op); try { activityLog.createEntry(BRANCH_OPERATION_TYPEID, ActivityLog.INITIAL_STATUS, String.format( "Branch Operation Set Branch Name {branchUUID: %s prevName: %s newName: %s accountId: %s serverId: %s clientId: %s}", branchUuid, branch.getName(), newName, RestUtil.getAccountId(httpHeaders), RestUtil.getServerId(httpHeaders), RestUtil.getClientId(httpHeaders))); modified = true; } catch (OseeCoreException ex) { OseeLog.log(ActivityLog.class, OseeLevel.SEVERE_POPUP, ex); } } return asResponse(modified); }
Source:
<code>public void endWithFailure() { setSucceeded(true); <START> ImagesHandler.updateAllDiskImagesSnapshotsStatusInTransactionWithCompensation( <END> getMovedDiskIds(), ImageStatus.OK, ImageStatus.OK, getCompensationContext()); }</code><technical_language>RemoveSnapshot execution images illegal, return OK - skip part if phase</technical_language>

Target:
public void endWithFailure() { setSucceeded(true); if (getParameters().getStage() != LiveMigrateStage.AUTO_GENERATED_SNAPSHOT_REMOVE_START) { ImagesHandler.updateAllDiskImagesSnapshotsStatusInTransactionWithCompensation( getMovedDiskIds(), ImageStatus.OK, ImageStatus.OK, getCompensationContext()); } }