auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public List<FragmentItemModel> getFragmentItems() { ArrayList<FragmentItemModel> items = new ArrayList<>(); items.add(new FragmentItemModel(MyCoursesListFragment.class, getResources().getString(R.string.label_my_courses), FontAwesomeIcons.fa_list_alt, new FragmentItemModel.FragmentStateListener() { @Override public void onFragmentSelected() { environment.getAnalyticsRegistry().trackScreenView(Analytics.Screens.MY_COURSES); } })); if (environment.getConfig().getCourseDiscoveryConfig().isCourseDiscoveryEnabled()) { items.add(new FragmentItemModel(WebViewDiscoverCoursesFragment.class, getResources().getString(R.string.label_discover), FontAwesomeIcons.fa_search, new FragmentItemModel.FragmentStateListener() { @Override public void onFragmentSelected() { environment.getAnalyticsRegistry().trackScreenView(Analytics.Screens.FIND_COURSES); } })); } return items; }

Target:
public List<FragmentItemModel> getFragmentItems() { ArrayList<FragmentItemModel> items = new ArrayList<>(); items.add(new FragmentItemModel(MyCoursesListFragment.class, getResources().getString(R.string.label_my_courses), FontAwesomeIcons.fa_list_alt, new FragmentItemModel.FragmentStateListener() { @Override public void onFragmentSelected() { environment.getAnalyticsRegistry().trackScreenView(Analytics.Screens.MY_COURSES); } })); if (environment.getConfig().getCourseDiscoveryConfig().isCourseDiscoveryEnabled()) { items.add(new FragmentItemModel( environment.getConfig().getCourseDiscoveryConfig().isWebviewCourseDiscoveryEnabled() ? WebViewDiscoverCoursesFragment.class : NativeFindCoursesFragment.class, getResources().getString(R.string.label_discovery), FontAwesomeIcons.fa_search, new FragmentItemModel.FragmentStateListener() { @Override public void onFragmentSelected() { environment.getAnalyticsRegistry().trackScreenView(Analytics.Screens.FIND_COURSES); } })); } return items; }
Source:
protected static void ensureName(HaxeIntroduceOperation operation) { if (operation.getName() == null) { final Collection<String> suggestedNames = operation.getSuggestedNames(); if (suggestedNames.size() > 0) { operation.autoSelectName(); } else { operation.setName("x"); } } }

Target:
protected static void ensureName(HaxeIntroduceOperation operation) { if (operation.getName() == null) { final Collection<String> suggestedNames = operation.getSuggestedNames(); if (suggestedNames.size() > 0) { operation.suggestName(); } else { operation.setName("x"); } } }
Source:
protected void addPages() { try { if (getCommit().isStash()) { commitPage = new StashEditorPage(this); } else { commitPage = new CommitEditorPage(this); } addPage(commitPage); diffPage = new DiffEditorPage(this); addPage(diffPage); if (getCommit().getNotes().length > 0) { notePage = new NotesEditorPage(this); addPage(notePage); } } catch (PartInitException e) { Activator.error("Error adding page", e); } refListenerHandle = Repository.getGlobalListenerList() .addRefsChangedListener(this); }

Target:
protected void addPages() { try { if (getCommit().isStash()) commitPage = new StashEditorPage(this); else commitPage = new CommitEditorPage(this); addPage(commitPage); diffPage = new DiffEditorPage(this); addPage(diffPage); if (getCommit().getNotes().length > 0) { notePage = new NotesEditorPage(this); addPage(notePage); } } catch (PartInitException e) { Activator.error("Error adding page", e); } refListenerHandle = Repository.getGlobalListenerList() .addRefsChangedListener(this); }
Source:
public void onEvent(ActivitiEvent event) { if (event.getType().equals(ActivitiEventType.TIMER_FIRED)) { if (event instanceof ActivitiEntityEvent && JobEntity.class.isAssignableFrom(((ActivitiEntityEvent) event).getEntity().getClass())) { converter.from((ActivitiEntityEvent) event) .ifPresent(convertedEvent -> { for (BPMNElementEventListener<BPMNTimerFiredEvent> listener : processRuntimeEventListeners) { listener.onEvent(convertedEvent); } }); } } }

Target:
public void onEvent(ActivitiEvent event) { converter.from(event) .ifPresent(convertedEvent -> { for (BPMNElementEventListener<BPMNTimerFiredEvent> listener : processRuntimeEventListeners) { listener.onEvent(convertedEvent); } }); }
Source:
public synchronized void registerDeviceStatusListener(DeviceStatusListener deviceStatusListener) { if (this.devStatMan != null) { if (deviceStatusListener == null) { throw new IllegalArgumentException("It's not allowed to pass null."); } if (deviceStatusListener.getDeviceStatusListenerID() != null) { if (devStatMan.getManagerState().equals(ManagerStates.RUNNING)) { devStatMan.registerDeviceListener(deviceStatusListener); return; } if (deviceStatusListener.getDeviceStatusListenerID().equals(DeviceStatusListener.DEVICE_DISCOVERY)) { devStatMan.registerDeviceListener(deviceStatusListener); } } else { throw new IllegalArgumentException("It's not allowed to pass a DeviceStatusListener with ID = null."); } } else { if (deviceStatusListener.getDeviceStatusListenerID().equals(DeviceStatusListener.DEVICE_DISCOVERY)) { deviceDiscovery = deviceStatusListener; } } }

Target:
public synchronized void registerDeviceStatusListener(DeviceStatusListener deviceStatusListener) { if (this.devStatMan != null) { if (deviceStatusListener == null) { throw new IllegalArgumentException("It's not allowed to pass null."); } if (deviceStatusListener.getDeviceStatusListenerID() != null) { if (devStatMan.getManagerState().equals(ManagerStates.RUNNING)) { devStatMan.registerDeviceListener(deviceStatusListener); } else if (deviceStatusListener.getDeviceStatusListenerID() .equals(DeviceStatusListener.DEVICE_DISCOVERY)) { devStatMan.registerDeviceListener(deviceStatusListener); } } else { throw new IllegalArgumentException("It's not allowed to pass a DeviceStatusListener with ID = null."); } } else { if (deviceStatusListener.getDeviceStatusListenerID().equals(DeviceStatusListener.DEVICE_DISCOVERY)) { deviceDiscovery = deviceStatusListener; } } }
Source:
public void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); outState.putBoolean(KEY_LOGIN_FINISHED, mLoginFinished); outState.putBoolean(KEY_LOGIN_FINISHED, mLoginStarted); outState.putString(KEY_REQUESTED_USERNAME, mRequestedUsername); outState.putString(KEY_REQUESTED_PASSWORD, mRequestedPassword); outState.putIntegerArrayList(KEY_OLD_SITES_IDS, mOldSitesIDs); }

Target:
public void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); outState.putBoolean(KEY_LOGIN_FINISHED, mLoginFinished); outState.putBoolean(KEY_LOGIN_STARTED, mLoginStarted); outState.putString(KEY_REQUESTED_USERNAME, mRequestedUsername); outState.putString(KEY_REQUESTED_PASSWORD, mRequestedPassword); outState.putIntegerArrayList(KEY_OLD_SITES_IDS, mOldSitesIDs); }
Source:
public BloomFilter getBloomFilter(int size, double falsePositiveRate, long nTweak) { BloomFilter filter = new BloomFilter(size, falsePositiveRate, nTweak); if (basic.numKeys() > 0) filter.merge(basic.getFilter(size, falsePositiveRate, nTweak)); for (DeterministicKeyChain chain : chains) { if (isMarried(chain)) { for (Script script : marriedKeysScripts.values()) { filter.insert(script.getPubKeyHash()); filter.insert(script.getProgram()); } } else { filter.merge(chain.getFilter(size, falsePositiveRate, nTweak)); } } return filter; }

Target:
public BloomFilter getBloomFilter(int size, double falsePositiveRate, long nTweak) { BloomFilter filter = new BloomFilter(size, falsePositiveRate, nTweak); if (basic.numKeys() > 0) filter.merge(basic.getFilter(size, falsePositiveRate, nTweak)); for (DeterministicKeyChain chain : chains) { if (isMarried(chain)) { for (Map.Entry<ByteString, Script> entry : marriedKeysScripts.entrySet()) { filter.insert(entry.getKey().toByteArray()); filter.insert(ScriptBuilder.createP2SHOutputScript(entry.getValue()).getProgram()); } } else { filter.merge(chain.getFilter(size, falsePositiveRate, nTweak)); } } return filter; }
Source:
public void receiveActivityResult(int resultCode, Intent data, Activity activity) { for (String key : editableUdfDefinitions.keySet()) { if (data.getExtras().containsKey(key)) { final String json = data.getStringExtra(key); final UDFCollectionDefinition udfDef = editableUdfDefinitions.get(key); final JSONObject value; try { value = new JSONObject(json); } catch (JSONException e) { Log.e(App.LOG_TAG, "Error parsing JSON passed as activity result", e); continue; } final UDFCollectionValueField field = new UDFCollectionValueField(udfDef, sortKey, value); if (data.getExtras().containsKey(UDFCollectionEditActivity.TAG)) { final int tag = data.getIntExtra(UDFCollectionEditActivity.TAG, -1); if (tag == -1 || fields.isEmpty()) { Log.w(App.LOG_TAG, "Invalid tag for UDF, ignoring it"); } else { fields = newArrayList(concat(filter(fields, f -> f.getTag() != tag), newArrayList(field))); } } else { fields.add(field); } } } replaceEditFields(activity); }

Target:
public void receiveActivityResult(int resultCode, Intent data, Activity activity) { for (String key : editableUdfDefinitions.keySet()) { if (data.getExtras().containsKey(key)) { final String json = data.getStringExtra(key); final UDFCollectionDefinition udfDef = editableUdfDefinitions.get(key); final JSONObject value; try { value = new JSONObject(json); } catch (JSONException e) { Log.e(App.LOG_TAG, "Error parsing JSON passed as activity result", e); continue; } final UDFCollectionValueField field = new UDFCollectionValueField(udfDef, sortKey, value); if (data.getExtras().containsKey(UDFCollectionEditActivity.TAG)) { final int tag = data.getIntExtra(UDFCollectionEditActivity.TAG, -1); if (tag == -1 || fields.isEmpty()) { Log.w(App.LOG_TAG, "Invalid tag for UDF, ignoring it"); } else { fields = newArrayList(concat(filter(fields, f -> f.getTag() != tag), newArrayList(field))); } } else { fields.add(field); } } } rerenderEditFields(activity); }
Source:
private static String formatBytes(byte[] bytes, String contentType) { if (contentType.contains("json")) { try { return new JSONObject(new String(bytes)).toString(4); } catch (JSONException e) { return new String(bytes).trim(); } } else if (contentType.contains("text")) { return new String(bytes).trim(); } else { return "Not supported contentType"; } }

Target:
private static String formatBytes(byte[] bytes, String contentType) { if (contentType.contains("json")) { try { return new JSONObject(new String(bytes)).toString(4); } catch (JSONException e) { return new String(bytes).trim(); } } else if (contentType.contains("text")) { return new String(bytes).trim(); } else { throw new IllegalStateException("We can not print this " + contentType); } }
Source:
public static List<JavaTypeDefinition> inferTypes(List<Constraint> constraints, List<Bound> bounds, List<Variable> variables) { List<Bound> newBounds = new ArrayList<>(); while (!constraints.isEmpty()) { List<BoundOrConstraint> reduceResult = constraints.get(constraints.size() - 1).reduce(); constraints.remove(constraints.size() - 1); for (BoundOrConstraint boundOrConstraint : reduceResult) { if (boundOrConstraint instanceof Bound) { newBounds.add((Bound) boundOrConstraint); } else if (boundOrConstraint instanceof Constraint) { constraints.add((Constraint) boundOrConstraint); } else { throw new IllegalStateException("Unknown BoundOrConstraint subclass"); } } constraints.addAll(incorporateBounds(bounds, newBounds)); newBounds.clear(); } Map<Variable, JavaTypeDefinition> resolutionResult = resolveVariables(bounds); List<JavaTypeDefinition> result = new ArrayList<>(); for (Variable variable : variables) { result.add(resolutionResult.get(variable)); } return result; }

Target:
public static List<JavaTypeDefinition> inferTypes(List<Constraint> constraints, List<Bound> bounds, List<Variable> variables) { List<Bound> newBounds = new ArrayList<>(); while (!constraints.isEmpty()) { List<BoundOrConstraint> reduceResult = constraints.remove(constraints.size() - 1).reduce(); for (BoundOrConstraint boundOrConstraint : reduceResult) { if (boundOrConstraint instanceof Bound) { newBounds.add((Bound) boundOrConstraint); } else if (boundOrConstraint instanceof Constraint) { constraints.add((Constraint) boundOrConstraint); } else { throw new IllegalStateException("Unknown BoundOrConstraint subclass"); } } constraints.addAll(incorporateBounds(bounds, newBounds)); newBounds.clear(); } Map<Variable, JavaTypeDefinition> resolutionResult = resolveVariables(bounds); List<JavaTypeDefinition> result = new ArrayList<>(); for (Variable variable : variables) { result.add(resolutionResult.get(variable)); } return result; }
Source:
private void trimPrefix() { long endSegment = dataStore.getStartingAddress() / RECORDS_PER_LOG_FILE - 1; if (endSegment < 0) { log.debug("Only one segment detected, ignoring trim"); return; } closeSegmentHandlers(endSegment); deleteFilesMatchingFilter(file -> { try { String segmentStr = file.getName().split("\\.")[0]; return Long.parseLong(segmentStr) <= endSegment; } catch (Exception e) { log.warn("trimPrefix: ignoring file {}", file.getName()); return false; } }); log.info("trimPrefix: completed, end segment {}", endSegment); }

Target:
private void trimPrefix() { long endSegment = getStartingSegment() - 1; if (endSegment < 0) { log.debug("Only one segment detected, ignoring trim"); return; } closeSegmentHandlers(endSegment); deleteFilesMatchingFilter(file -> { try { String segmentStr = file.getName().split("\\.")[0]; return Long.parseLong(segmentStr) <= endSegment; } catch (Exception e) { log.warn("trimPrefix: ignoring file {}", file.getName()); return false; } }); log.info("trimPrefix: completed, end segment {}", endSegment); }
Source:
public boolean getProfileDefinitionStatus() { String profilePath = getProfileURI(); if (profilePath == null || profilePath == "") { return true; } URI profileURI = URI.createURI(profilePath); ResourceSet resourceSet = new ResourceSetImpl(); Resource resource = null; try { resource = resourceSet.getResource(profileURI, true); } catch (WrappedException ex) { return false; } if (resource == null) { return false; } EObject eObject = resource.getContents().get(0); if (!(eObject instanceof Profile)) { return false; } Profile profile = (Profile) eObject; if (!profile.isDefined()) { return false; } return true; }

Target:
public IStatus getProfileDefinitionStatus() { String profilePath = getProfileURI(); IStatus okStatus = new Status(IStatus.OK, Activator.PLUGIN_ID, ""); if (profilePath == null || profilePath.equalsIgnoreCase("")) { return okStatus; } URI profileURI = URI.createURI(profilePath); ResourceSet resourceSet = new ResourceSetImpl(); Resource resource = null; try { resource = resourceSet.getResource(profileURI, true); } catch (WrappedException ex) { return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.ProfileChooserComposite_ProfileStatus_UnavailableResource); } if (resource == null) { return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.ProfileChooserComposite_ProfileStatus_NullResource); } if (resource.getContents().isEmpty()) { return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.ProfileChooserComposite_ProfileStatus_EmptyResource); } EObject eObject = resource.getContents().get(0); if (!(eObject instanceof Profile)) { return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.ProfileChooserComposite_ProfileStatus_NotAProfile); } Profile profile = (Profile) eObject; if (!profile.isDefined()) { return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.ProfileChooserComposite_ProfileStatus_ProfileNotDefined); } return okStatus; }
Source:
public static Artifact getCommonAncestor(Conflict conflict) { try { if (conflict.getSourceBranch() == null) { return null; } TransactionRecord commonTransaction = ConflictManagerInternal.findCommonTransaction(conflict.getSourceBranch(), conflict.getDestBranch()); return ArtifactQuery.getHistoricalArtifactFromId(conflict.getArtifact().getGuid(), commonTransaction, INCLUDE_DELETED); } catch (OseeCoreException ex) { OseeLog.log(Activator.class, Level.SEVERE, ex); } return null; }

Target:
public static Artifact getCommonAncestor(Conflict conflict) { Artifact toReturn = null; try { if (Conditions.notNull(conflict.getSourceBranch())) { TransactionRecord commonTransaction = ConflictManagerInternal.findCommonTransaction(conflict.getSourceBranch(), conflict.getDestBranch()); toReturn = ArtifactQuery.getHistoricalArtifactFromId(conflict.getArtifact().getGuid(), commonTransaction, INCLUDE_DELETED); } } catch (OseeCoreException ex) { OseeLog.log(Activator.class, Level.SEVERE, ex); } return toReturn; }
Source:
protected void notifyListenersAboutRemovedElement(Thing element) { notifyTrackers(element, ThingTrackerEvent.THING_REMOVED); postEvent(ThingEventFactory.createRemovedEvent(element)); super.notifyListenersAboutRemovedElement(element); }

Target:
protected void notifyListenersAboutRemovedElement(Thing element) { super.notifyListenersAboutRemovedElement(element); notifyTrackers(element, ThingTrackerEvent.THING_REMOVED); postEvent(ThingEventFactory.createRemovedEvent(element)); }
Source:
public String getDescriptionOfValidInputs() { switch(this) { case ID: case UPDATED: return "a number or a number range"; case STATE: return "\"open\" or \"closed\""; case HAS: case NO: return "\"label\", \"milestone\", or \"assignee\""; case IN: return "\"title\" or \"body\""; case TYPE: return "\"issue\" or \"pr\""; case CREATED: return "a date or a date range"; case REPO: return "repo id"; default: return "string"; } }

Target:
public String getDescriptionOfValidInputs() { switch(this) { case ID: case UPDATED: return "a number or a number range"; case STATE: return "\"open\" or \"closed\""; case HAS: case NO: return "\"label\", \"milestone\", or \"assignee\""; case IN: return "\"title\" or \"body\""; case TYPE: return "\"issue\" or \"pr\""; case CREATED: return "a date or a date range"; case REPO: return "a repo id"; default: return "a string"; } }
Source:
public void logAuditMessage(final Guid clusterId, final GlusterVolumeEntity volume, final VDS server, final AuditLogType logType, final Map<String, String> customValues) { AuditLogableBase logable = new AuditLogableBase(); logable.setVds(server); logable.setGlusterVolume(volume); logable.setVdsGroupId(clusterId == null ? server.getVdsGroupId() : clusterId); if (customValues != null) { for (Entry<String, String> entry : customValues.entrySet()) { logable.addCustomValue(entry.getKey(), entry.getValue()); } } AuditLogDirector.log(logable, logType); }

Target:
public void logAuditMessage(final Guid clusterId, final GlusterVolumeEntity volume, final VDS server, final AuditLogType logType, final Map<String, String> customValues) { AuditLogableBase logable = new AuditLogableBase(); logable.setVds(server); logable.setGlusterVolume(volume); logable.setVdsGroupId(clusterId); if (customValues != null) { for (Entry<String, String> entry : customValues.entrySet()) { logable.addCustomValue(entry.getKey(), entry.getValue()); } } AuditLogDirector.log(logable, logType); }
Source:
protected void upgrade(ConfigBag parameters) { Group cluster = (Group)entity(); Collection<Entity> initialMembers = cluster.getMembers(); int initialClusterSize = initialMembers.size(); if (!BrooklynNodeUpgradeEffectorBody.isPersistenceModeEnabled(cluster)) { DynamicTasks.queue( Tasks.warning("Check persistence", new IllegalStateException("Persistence does not appear to be enabled at this cluster. " + "Cluster upgrade will not succeed unless a custom launch script enables it.")) ); } TaskAdaptable<Collection<Entity>> initialNodeTask = DynamicTasks.queue(newCreateNodesTask(1, "Creating first upgraded version node")); TaskAdaptable<Collection<Entity>> remainingNodesTask = DynamicTasks.queue(newCreateNodesTask(initialClusterSize - 1, "Creating remaining upgraded version nodes ("+(initialClusterSize - 1)+")")); DynamicTasks.queue(Effectors.invocation(cluster, BrooklynCluster.SELECT_MASTER, MutableMap.of(SelectMasterEffector.NEW_MASTER_ID, Iterables.getOnlyElement(initialNodeTask.asTask().getUnchecked()).getId()))).asTask().getUnchecked(); HashSet<Entity> oldMembers = new HashSet<Entity>(initialMembers); oldMembers.removeAll(remainingNodesTask.asTask().getUnchecked()); oldMembers.removeAll(initialNodeTask.asTask().getUnchecked()); DynamicTasks.queue(Effectors.invocation(BrooklynNode.STOP_NODE_BUT_LEAVE_APPS, Collections.emptyMap(), oldMembers)).asTask().getUnchecked(); }

Target:
protected void upgrade(ConfigBag parameters) { Group cluster = (Group)entity(); Collection<Entity> initialMembers = cluster.getMembers(); int initialClusterSize = initialMembers.size(); if (!BrooklynNodeUpgradeEffectorBody.isPersistenceModeEnabled(cluster)) { DynamicTasks.queue( Tasks.warning("Check persistence", new IllegalStateException("Persistence does not appear to be enabled at this cluster. " + "Cluster upgrade will not succeed unless a custom launch script enables it.")) ); } TaskAdaptable<Collection<Entity>> initialNodeTask = DynamicTasks.queue(newCreateNodesTask(1, "Creating first upgraded version node")); @SuppressWarnings("unused") TaskAdaptable<Collection<Entity>> remainingNodesTask = DynamicTasks.queue(newCreateNodesTask(initialClusterSize - 1, "Creating remaining upgraded version nodes ("+(initialClusterSize - 1)+")")); DynamicTasks.queue(Effectors.invocation(cluster, BrooklynCluster.SELECT_MASTER, MutableMap.of(SelectMasterEffector.NEW_MASTER_ID, Iterables.getOnlyElement(initialNodeTask.asTask().getUnchecked()).getId()))).asTask().getUnchecked(); DynamicTasks.queue(Effectors.invocation(BrooklynNode.STOP_NODE_BUT_LEAVE_APPS, Collections.emptyMap(), initialMembers)).asTask().getUnchecked(); }
Source:
private static Ordering<ProjectNode> createProjectNodeOrdering(final boolean isHierarchyFlattened) { return new Ordering<ProjectNode>() { @Override public int compare(ProjectNode left, ProjectNode right) { if (!isHierarchyFlattened) { return left.toString().compareTo(right.toString()); } else { EclipseProject leftRoot = HierarchicalElementUtils.getRoot(left.getEclipseProject()); EclipseProject rightRoot = HierarchicalElementUtils.getRoot(right.getEclipseProject()); if (leftRoot.getProjectIdentifier() == rightRoot.getProjectIdentifier()) { return 0; } else { return leftRoot.getName().compareTo(rightRoot.getName()); } } } }; }

Target:
private static Ordering<ProjectNode> createProjectNodeOrdering(final boolean isHierarchyFlattened) { return new Ordering<ProjectNode>() { @Override public int compare(ProjectNode left, ProjectNode right) { if (!isHierarchyFlattened) { return left.getDisplayName().compareTo(right.getDisplayName()); } else { EclipseProject leftRoot = HierarchicalElementUtils.getRoot(left.getEclipseProject()); EclipseProject rightRoot = HierarchicalElementUtils.getRoot(right.getEclipseProject()); if (leftRoot.getProjectIdentifier() == rightRoot.getProjectIdentifier()) { return 0; } else { return leftRoot.getName().compareTo(rightRoot.getName()); } } } }; }
Source:
public HeartbeatConnector(Properties config) { _hearbeatPeriodMs = Integer.parseInt(config.getProperty(CFG_HEARTBEAT_PERIOD, DEFAULT_HEARTBEAT_PERIOD_MS)); }

Target:
public HeartbeatConnector(Properties config) { LOG.info(String.format("Creating Heartbeat connector with config: %s", config)); _hearbeatPeriodMs = Integer.parseInt(config.getProperty(CFG_HEARTBEAT_PERIOD, DEFAULT_HEARTBEAT_PERIOD_MS)); }
Source:
private static String extractBase64String(String url) { if (url.startsWith(BASE64_URL_PREFIX)) { if (url.contains(BASE64_START)) { int base64StartIndex = url.indexOf(BASE64_START); String metadata = url.substring(BASE64_URL_PREFIX.length(), base64StartIndex); for (String md : acceptedMetadata) { if (md.equals(metadata)) { byte[] data = BaseEncoding.base64().decode( url.substring(base64StartIndex + BASE64_START.length())); return new String(data, StandardCharsets.UTF_8); } } } } return null; }

Target:
private static String extractBase64String(String url) { if (url.startsWith(BASE64_URL_PREFIX)) { if (url.contains(BASE64_START)) { int base64StartIndex = url.indexOf(BASE64_START); String metadata = url.substring(BASE64_URL_PREFIX.length(), base64StartIndex); for (String md : acceptedMetadata) { if (md.equals(metadata)) { byte[] data = BaseEncoding.base64().decode( url.substring(base64StartIndex + BASE64_START.length())); return new String(data, UTF_8); } } } } return null; }
Source:
public Object mapSearch(final String requestUrl, final List<RpslObject> objects, final Iterable<LocalDateTime> localDateTimes, final int maxResultSize) { final SearchResult searchResult = new SearchResult(); final Iterator<LocalDateTime> iterator = localDateTimes.iterator(); for (final RpslObject object : objects) { if (object.getType() == DOMAIN) { searchResult.addDomainSearchResult((Domain) getRdapObject(requestUrl, object, iterator.next(), null)); } else { searchResult.addEntitySearchResult((Entity) getRdapObject(requestUrl, object, iterator.next(), null)); } } if(objects.size() == maxResultSize) { final Notice notice = new Notice(); notice.setTitle("Search result cap to " + maxResultSize); notice.getDescription().add("Due to performace issue, we have capped the maximum search result to " + maxResultSize); searchResult.getNotices().add(notice); } return mapCommons(searchResult, requestUrl); }

Target:
public Object mapSearch(final String requestUrl, final List<RpslObject> objects, final Iterable<LocalDateTime> localDateTimes, final int maxResultSize) { final SearchResult searchResult = new SearchResult(); final Iterator<LocalDateTime> iterator = localDateTimes.iterator(); for (final RpslObject object : objects) { if (object.getType() == DOMAIN) { searchResult.addDomainSearchResult((Domain) getRdapObject(requestUrl, object, iterator.next(), null)); } else { searchResult.addEntitySearchResult((Entity) getRdapObject(requestUrl, object, iterator.next(), null)); } } if(objects.size() == maxResultSize) { final Notice notice = new Notice(); notice.setTitle(String.format("limited search results to %s maximum" , maxResultSize)); searchResult.getNotices().add(notice); } return mapCommons(searchResult, requestUrl); }
Source:
public int getChunkSize() { int networkType = NetworkHelper.INSTANCE.getNetworkType(getApplicationContext()); if (networkType == ConnectivityManager.TYPE_WIFI) { return (1024 * 1024); } else { return (256 * 1024); } }

Target:
public int getChunkSize() { int networkType = NetworkHelper.INSTANCE.getNetworkType(getApplicationContext()); int chunkSize = userManager.getChunkSize(userManager.getActiveAccount().getValue()); if (networkType == ConnectivityManager.TYPE_WIFI) { return chunkSize; } else { return (chunkSize / 2); } }
Source:
public void testFindWorkerForTask() throws Exception { final EqualDistributionWorkerSelectStrategy strategy = new EqualDistributionWorkerSelectStrategy(); Optional<ImmutableWorkerInfo> optional = strategy.findWorkerForTask( new RemoteTaskRunnerConfig(), ImmutableMap.of( "lhost", new ImmutableWorkerInfo( new Worker("lhost", "lhost", 5, "v1"), 5, Sets.<String>newHashSet(), Sets.<String>newHashSet(), DateTime.now() ), "localhost", new ImmutableWorkerInfo( new Worker("localhost", "localhost", 10, "v1"), 5, Sets.<String>newHashSet(), Sets.<String>newHashSet(), DateTime.now() ) ), new NoopTask(null, 1, 0, null, null, null) { @Override public String getDataSource() { return "foo"; } } ); ImmutableWorkerInfo worker = optional.get(); Assert.assertEquals("localhost", worker.getWorker().getHost()); }

Target:
public void testFindWorkerForTask() throws Exception { final EqualDistributionWorkerSelectStrategy strategy = new EqualDistributionWorkerSelectStrategy(); Optional<ImmutableWorkerInfo> optional = strategy.findWorkerForTask( new RemoteTaskRunnerConfig(), ImmutableMap.of( "lhost", new ImmutableWorkerInfo( new Worker("lhost", "lhost", 1, "v1"), 0, Sets.<String>newHashSet(), Sets.<String>newHashSet(), DateTime.now() ), "localhost", new ImmutableWorkerInfo( new Worker("localhost", "localhost", 1, "v1"), 1, Sets.<String>newHashSet(), Sets.<String>newHashSet(), DateTime.now() ) ), new NoopTask(null, 1, 0, null, null, null) { @Override public String getDataSource() { return "foo"; } } ); ImmutableWorkerInfo worker = optional.get(); Assert.assertEquals("lhost", worker.getWorker().getHost()); }
Source:
private ProcessVariableValue buildProcessVariableValue(Object value) throws JsonProcessingException { ProcessVariableValue variableValue = null; if (value != null) { Class<?> entryValueClass = value.getClass(); String entryType = resolveEntryType(entryValueClass, value); if("object".equals(entryType)) { value = new ObjectValue(value); } String entryValue = conversionService.convert(value, String.class); variableValue = new ProcessVariableValue(entryType, entryValue); } return variableValue; }

Target:
private ProcessVariableValue buildProcessVariableValue(Object value) { ProcessVariableValue variableValue = null; if (value != null) { Class<?> entryValueClass = value.getClass(); String entryType = resolveEntryType(entryValueClass, value); if (OBJECT_TYPE_KEY.equals(entryType)) { value = new ObjectValue(value); } String entryValue = conversionService.convert(value, String.class); variableValue = new ProcessVariableValue(entryType, entryValue); } return variableValue; }
Source:
public Long getUuid() { return new Long(getArtId()); }

Target:
public Long getUuid() { return Long.valueOf(getArtId()); }
Source:
protected void checkCount( XpathEngine xpathEngine, Document document, int expectedCount, String xpath) { try { assertThat( xpathEngine.getMatchingNodes(xpath, document).getLength(), is(expectedCount)); } catch (Exception exception) { throw new RuntimeException("Error evaluating xpath.", exception); } }

Target:
protected void checkCount( XpathEngine xpathEngine, Document document, int expectedCount, String xpath) { try { assertThat( xpathEngine.getMatchingNodes(xpath, document).getLength(), is(expectedCount)); } catch (Exception exception) { throw new RuntimeException("Error evaluating xpath: " + xpath, exception); } }
Source:
protected void handleNodeHistoryRequest(NodeHistoryRequest serviceRequest) { try { mCacheHelper.getMessagesForGroup(serviceRequest.getGroup(), serviceRequest.getDate(), NodeHistoryRequest.MESSAGE_COUNT); } catch (CacheDatabaseException e) { e.printStackTrace(); } ServerRequest serverRequest = serviceRequest.parseRequestForServer(); mController.sendToServer(serverRequest); }

Target:
protected void handleNodeHistoryRequest(NodeHistoryRequest serviceRequest) { try { mCacheHelper.getMessagesForGroup(serviceRequest.getGroup(), serviceRequest.getDate(), NodeHistoryRequest.MESSAGE_COUNT); } catch (CacheDatabaseException e) { Log.d("Y:" + this.getClass().toString(), "Failed to retrieve messages from Cache !"); } ServerRequest serverRequest = serviceRequest.parseRequestForServer(); mController.sendToServer(serverRequest); }
Source:
public void readBytes(final byte[] bytes) { try { mCompressedStream.read(bytes); } catch (IOException ioe) { throw(new RuntimeIOException("Read error in CSI compressed stream: " + ioe)); } }

Target:
public void readBytes(final byte[] bytes) { binaryCodec.readBytes(bytes); }
Source:
public String getText(Object element) { String text = super.getText(element); if (hashMap.containsKey(element)) { text = text + " (found in"; for (String s : hashMap.get(element)) { text = text + " \"" + s + "\","; } text = text.substring(0, text.length() - 1) + ")"; } return text; }

Target:
public String getText(Object element) { StringBuilder sb = new StringBuilder(super.getText(element)); if (multimap.containsKey(element)) { sb.append(" (found in "); Joiner joiner = Joiner.on(", "); sb.append(joiner.join(multimap.get(element).toArray())); sb.append(")"); } return sb.toString(); }
Source:
private void printTxn(byte[] bytes, String prefix) { try { TxnHeader hdr = new TxnHeader(); Record txn = SerializeUtils.deserializeTxn(bytes, hdr); String txnStr; txnStr = getFormattedTxnStr(txn); String txns = String.format("%s session 0x%s cxid 0x%s zxid 0x%s %s %s", DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.LONG).format(new Date(hdr.getTime())), Long.toHexString(hdr.getClientId()), Long.toHexString(hdr.getCxid()), Long.toHexString(hdr.getZxid()), TraceFormatter.op2String(hdr.getType()), txnStr); if (prefix != null && !"".equals(prefix.trim())) { System.out.print(prefix + " - "); } if (txns.endsWith("\n")) { System.out.print(txns); } else { System.out.println(txns); } } catch (Exception e) { e.printStackTrace(); } }

Target:
private void printTxn(byte[] bytes, String prefix) throws IOException { TxnHeader hdr = new TxnHeader(); Record txn = SerializeUtils.deserializeTxn(bytes, hdr); String txnStr = getFormattedTxnStr(txn); String txns = String.format("%s session 0x%s cxid 0x%s zxid 0x%s %s %s", DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.LONG).format(new Date(hdr.getTime())), Long.toHexString(hdr.getClientId()), Long.toHexString(hdr.getCxid()), Long.toHexString(hdr.getZxid()), TraceFormatter.op2String(hdr.getType()), txnStr); if (prefix != null && !"".equals(prefix.trim())) { System.out.print(prefix + " - "); } if (txns.endsWith("\n")) { System.out.print(txns); } else { System.out.println(txns); } }
Source:
private static boolean useNativeEpoll() { try { Class.forName("io.netty.channel.epoll.Epoll", true, TransportHelper.class.getClassLoader()); if (Epoll.isAvailable()) { return !EPOLL_DISABLED && IS_LINUX; } else { if (IS_LINUX) { log.epollNotAvailable(Epoll.unavailabilityCause().toString()); } } } catch (ClassNotFoundException e) { if (IS_LINUX) { log.epollNotAvailable(e.getMessage()); } } return false; }

Target:
private static boolean useNativeEpoll() { try { Class.forName("io.netty.channel.epoll.Epoll", true, EPollAvailable.class.getClassLoader()); if (Epoll.isAvailable()) { return !EPOLL_DISABLED && IS_LINUX; } else { if (IS_LINUX) { log.epollNotAvailable(Epoll.unavailabilityCause().toString()); } } } catch (ClassNotFoundException e) { if (IS_LINUX) { log.epollNotAvailable(e.getMessage()); } } return false; }
Source:
public void init(ByteBuffer buf, int position) { buf.putLong(position, Long.MIN_VALUE); buf.putFloat(position + Longs.BYTES, 0); }

Target:
public void init(ByteBuffer buf, int position) { buf.putLong(position, Long.MIN_VALUE); buf.putFloat(position + Long.BYTES, 0); }
Source:
private void generateCommands() throws IOException, TemplateException { for (final Ds3Request request : spec.getRequests()) { generateRequest(request); } if (null != spec.getTypes()) { for (final Ds3Type typeEntry : spec.getTypes().values()) { generateType(typeEntry); generateTypeMatcher(typeEntry); } } }

Target:
private void generateCommands() throws IOException, TemplateException { if (ConverterUtil.hasContent(spec.getRequests())) { for (final Ds3Request request : spec.getRequests()) { generateRequest(request); } } if (ConverterUtil.hasContent(spec.getTypes())) { for (final Ds3Type typeEntry : spec.getTypes().values()) { generateType(typeEntry); generateTypeMatcher(typeEntry); } } }
Source:
public List<RemoteXBeeDevice> discoverDevices(List<String> ids) throws XBeeException { logger.debug("{}ND for all devices.", toString(), ids.toString()); performNodeDiscovery(null, null); List<RemoteXBeeDevice> foundDevices = new ArrayList<RemoteXBeeDevice>(0); if (deviceList == null) return foundDevices; XBeeNetwork network = xbeeDevice.getNetwork(); for (RemoteXBeeDevice d: deviceList) { String nID = d.getNodeID(); if (nID != null) { for (String id : ids) { if (nID.equals(id)) { RemoteXBeeDevice rDevice = network.addRemoteDevice(d); if (rDevice != null && !foundDevices.contains(rDevice)) foundDevices.add(rDevice); } } } } return foundDevices; }

Target:
public List<RemoteXBeeDevice> discoverDevices(List<String> ids) throws XBeeException { if (!xbeeDevice.isOpen()) throw new InterfaceNotOpenException(); logger.debug("{}ND for all devices.", xbeeDevice.toString(), ids.toString()); running = true; discovering = true; performNodeDiscovery(null, null); List<RemoteXBeeDevice> foundDevices = new ArrayList<RemoteXBeeDevice>(0); if (deviceList == null) return foundDevices; XBeeNetwork network = xbeeDevice.getNetwork(); for (RemoteXBeeDevice d: deviceList) { String nID = d.getNodeID(); if (nID == null) continue; for (String id : ids) { if (nID.equals(id)) { RemoteXBeeDevice rDevice = network.addRemoteDevice(d); if (rDevice != null && !foundDevices.contains(rDevice)) foundDevices.add(rDevice); } } } return foundDevices; }
Source:
private CompletableFuture<InternalCacheEntry> invokeClusterGetCommandRemotely(List<Address> targets, RpcOptionsBuilder rpcOptionsBuilder, ClusteredGetCommand get, Object key) { ResponseFilter filter = new ClusteredGetResponseValidityFilter(targets, rpcManager.getAddress()); RpcOptions options = rpcOptionsBuilder.responseFilter(filter).build(); return rpcManager.invokeRemotelyAsync(targets, get, options).thenApply(responses -> { boolean hasSuccesfulResponse = false; if (!responses.isEmpty()) { for (Response r : responses.values()) { if (r instanceof SuccessfulResponse) { hasSuccesfulResponse = true; SuccessfulResponse response = (SuccessfulResponse) r; Object responseValue = response.getResponseValue(); if (responseValue == null) { continue; } InternalCacheValue cacheValue = (InternalCacheValue) responseValue; InternalCacheEntry ice = cacheValue.toInternalCacheEntry(key); if (rvrl != null) { rvrl.remoteValueFound(ice); } return ice; } } } if (rvrl != null) { rvrl.remoteValueNotFound(key); } if (!hasSuccesfulResponse) { RpcException rpcException = new RpcException("No successful response: " + responses); for (Response r : responses.values()) { if (r instanceof ExceptionResponse) { rpcException.addSuppressed(((ExceptionResponse) r).getException()); } } throw rpcException; } else { return null; } }); }

Target:
private CompletableFuture<InternalCacheEntry> invokeClusterGetCommandRemotely(List<Address> targets, RpcOptionsBuilder rpcOptionsBuilder, ClusteredGetCommand get, Object key) { ResponseFilter filter = new ClusteredGetResponseValidityFilter(targets, rpcManager.getAddress()); RpcOptions options = rpcOptionsBuilder.responseFilter(filter).build(); return rpcManager.invokeRemotelyAsync(targets, get, options).thenApply(responses -> { boolean hasSuccesfulResponse = false; if (!responses.isEmpty()) { for (Response r : responses.values()) { if (r instanceof SuccessfulResponse) { hasSuccesfulResponse = true; SuccessfulResponse response = (SuccessfulResponse) r; Object responseValue = response.getResponseValue(); if (responseValue == null) { continue; } InternalCacheValue cacheValue = (InternalCacheValue) responseValue; InternalCacheEntry ice = cacheValue.toInternalCacheEntry(key); if (rvrl != null) { rvrl.remoteValueFound(ice); } return ice; } } } if (rvrl != null) { rvrl.remoteValueNotFound(key); } if (!hasSuccesfulResponse) { throw new RpcException("No successful response: " + responses); } else { return null; } }); }
Source:
public void openFromDropbox(DropboxRevisionsTopComponent drtc, RevisionDisplayTopComponent revtc) { DbxClient client = DbxUtil.getDbxClient(); if (client == null) { return; } List<DbxEntryDto> dbxEntries = new ArrayList<>(); try { for (DbxEntry entry : client.searchFileAndFolderNames("/", ".tex")) { dbxEntries.add(new DbxEntryDto(entry)); } } catch (DbxException ex) { DbxUtil.showDbxAccessDeniedPrompt(); return; } JList<DbxEntryDto> list = new JList(dbxEntries.toArray()); list.setSelectionMode(DefaultListSelectionModel.SINGLE_SELECTION); int option = JOptionPane.showConfirmDialog(null, list, "Open file from Dropbox", JOptionPane.OK_CANCEL_OPTION); if (option == JOptionPane.OK_OPTION && !list.isSelectionEmpty()) { DbxEntryDto entry = list.getSelectedValue(); String localPath = ApplicationUtils.getAppDirectory() + File.separator + entry.getName(); File outputFile = DbxUtil.downloadRemoteFile(entry, localPath); revtc.close(); drtc.updateRevisionsList(entry.getPath()); drtc.open(); drtc.requestActive(); String content = FileService.readFromFile(outputFile.getAbsolutePath()); etc.setEditorContent(content); etc.setCurrentFile(outputFile); etc.setDbxState(new DbxState(entry.getPath(), entry.getRevision())); etc.setModified(false); } }

Target:
public void openFromDropbox(DropboxRevisionsTopComponent drtc, RevisionDisplayTopComponent revtc) { List<DbxEntryDto> dbxEntries = getDbxTexEntries(DbxUtil.getDbxClient()); if (!dbxEntries.isEmpty()) { JList<DbxEntryDto> list = new JList(dbxEntries.toArray()); list.setSelectionMode(DefaultListSelectionModel.SINGLE_SELECTION); int option = JOptionPane.showConfirmDialog(null, list, "Open file from Dropbox", JOptionPane.OK_CANCEL_OPTION); if (option == JOptionPane.OK_OPTION && !list.isSelectionEmpty()) { DbxEntryDto entry = list.getSelectedValue(); String localPath = ApplicationUtils.getAppDirectory() + File.separator + entry.getName(); File outputFile = DbxUtil.downloadRemoteFile(entry, localPath); revtc.close(); drtc.updateRevisionsList(entry.getPath()); drtc.open(); drtc.requestActive(); String content = FileService.readFromFile(outputFile.getAbsolutePath()); etc.setEditorContent(content); etc.setCurrentFile(outputFile); etc.setDbxState(new DbxState(entry.getPath(), entry.getRevision())); etc.setModified(false); etc.setPreviewDisplayed(false); } } else{ JOptionPane.showMessageDialog(etc, "No .tex files found!", "Error", JOptionPane.ERROR_MESSAGE); } }
Source:
public void verifyLnpTestSuccess(double errorRateLimit, double meanResTimeLimit) { checkErrorLimit(errorRateLimit); checkMeanResTimeLimit(meanResTimeLimit); if (resultsErrorMessage != null) { throw new AssertionError(resultsErrorMessage); } }

Target:
public void verifyLnpTestSuccess(double errorRateLimit, double meanResTimeLimit) { checkErrorLimit(errorRateLimit); checkMeanResTimeLimit(meanResTimeLimit); if (resultsErrorMessage.isEmpty()) { throw new AssertionError(resultsErrorMessage); } }
Source:
public Object decode(String alias, U value) { checkNotNull(alias, "Not allowed to have a null alias"); checkNotNull(value, "Value for decoding can not be null"); TypeEncoder<?, U> encoder = aliasMapping.get(alias); if (encoder != null) return encoder.decode(value); throw new TypeDecodingException("An unknown alias [" + alias + "] was encountered while decoding value [" + value + "]. Valid aliases are " + String.join(", ", aliasMapping.keySet())); }

Target:
public Object decode(String alias, U value) { checkNotNull(alias, "Not allowed to have a null alias"); checkNotNull(value, "Value for decoding can not be null"); TypeEncoder<?, U> encoder = aliasMapping.get(alias); if (encoder != null) return encoder.decode(value); throw new TypeDecodingException("An unknown alias [" + alias + "] was encountered while decoding value [" + value + "]. Valid aliases are " + Joiner.on(", ").join(aliasMapping.keySet())); }
Source:
public void teardown() { try { client.close(); } catch (IOException e) { LOGGER.error(e.getMessage(), e); } }

Target:
public void teardown() { LOGGER.debug("Tearing down operator..."); windowDataManager.teardown(); try { client.close(); } catch (IOException e) { DTThrowable.rethrow(e); } }
Source:
public ResignatureCommand(final Map<String, String> details) { _details = details; }

Target:
public ResignatureCommand(final Map<String, String> details) { this.details = Utils.getImmutableMap(details); }
Source:
private void checkState() { if (!useCookies) { resetState(); setClientsCookiePolicy(CookiePolicy.IGNORE_COOKIES); } else if (useGlobalState) { if (param.isHttpStateEnabled()) { client.setState(param.getHttpState()); clientViaProxy.setState(param.getHttpState()); setProxyAuth(clientViaProxy); setClientsCookiePolicy(CookiePolicy.BROWSER_COMPATIBILITY); } else { setClientsCookiePolicy(CookiePolicy.IGNORE_COOKIES); } } else { client.setState(new HttpState()); clientViaProxy.setState(new HttpState()); setProxyAuth(clientViaProxy); setClientsCookiePolicy(CookiePolicy.BROWSER_COMPATIBILITY); } }

Target:
private void checkState() { if (!useCookies) { resetState(); setClientsCookiePolicy(CookiePolicy.IGNORE_COOKIES); } else if (useGlobalState) { if (param.isHttpStateEnabled()) { client.setState(param.getHttpState()); clientViaProxy.setState(param.getHttpState()); setProxyAuth(clientViaProxy); setClientsCookiePolicy(CookiePolicy.BROWSER_COMPATIBILITY); } else { setClientsCookiePolicy(CookiePolicy.IGNORE_COOKIES); } } else { resetState(); setClientsCookiePolicy(CookiePolicy.BROWSER_COMPATIBILITY); } }
Source:
protected MoveOrCopyImageGroupParameters createCopyParameters(DiskImage diskImage, Guid srcStorageDomainId, Guid srcImageGroupId, Guid srcImageId, VdcActionType parentCommandType) { MoveOrCopyImageGroupParameters params = new MoveOrCopyImageGroupParameters(getVmId(), srcImageGroupId, srcImageId, diskImage.getId(), diskImage.getImageId(), diskImage.getStorageIds().get(0), ImageOperation.Copy); params.setAddImageDomainMapping(false); params.setCopyVolumeType(CopyVolumeType.LeafVol); params.setVolumeFormat(diskImage.getVolumeFormat()); params.setVolumeType(diskImage.getVolumeType()); params.setUseCopyCollapse(true); params.setSourceDomainId(srcStorageDomainId); setStorageDomainId(srcStorageDomainId); params.setWipeAfterDelete(ImagesHandler.shouldWipeAfterDelete( diskImage.isWipeAfterDelete(), getStorageDomain().getStorageType())); params.setEntityInfo(new EntityInfo(VdcObjectType.VM, getVmId())); params.setParentParameters(getParameters()); params.setParentCommand(parentCommandType); return params; }

Target:
protected MoveOrCopyImageGroupParameters createCopyParameters(DiskImage diskImage, Guid srcStorageDomainId, Guid srcImageGroupId, Guid srcImageId, VdcActionType parentCommandType) { MoveOrCopyImageGroupParameters params = new MoveOrCopyImageGroupParameters(getVmId(), srcImageGroupId, srcImageId, diskImage.getId(), diskImage.getImageId(), diskImage.getStorageIds().get(0), ImageOperation.Copy); params.setAddImageDomainMapping(false); params.setCopyVolumeType(CopyVolumeType.LeafVol); params.setVolumeFormat(diskImage.getVolumeFormat()); params.setVolumeType(diskImage.getVolumeType()); params.setUseCopyCollapse(true); params.setSourceDomainId(srcStorageDomainId); params.setWipeAfterDelete(ImagesHandler.shouldWipeAfterDelete( diskImage.isWipeAfterDelete(), destStorages.get(params.getStorageDomainId()).getStorageType())); params.setEntityInfo(new EntityInfo(VdcObjectType.VM, getVmId())); params.setParentParameters(getParameters()); params.setParentCommand(parentCommandType); return params; }
Source:
public void executeCommand(UICommand command) { super.executeCommand(command); if (command == getRemoveCommand()) { remove(); } else if ("OnRemove".equals(command.getName())) { onRemove(); } else if ("Upload".equals(command.getName())) { upload(); } else if ("CancelUpload".equals(command.getName())) { cancelUpload(); } else if ("OnCancelUpload".equals(command.getName())) { onCancelUpload(); } else if ("PauseUpload".equals(command.getName())) { pauseUpload(); } else if ("ResumeUpload".equals(command.getName())) { resumeUpload(); } else if ("Cancel".equals(command.getName())) { cancel(); } else if (command == getDownloadCommand()) { download(); } else if ("Move".equals(getMoveCommand().getName())) { move(); } }

Target:
public void executeCommand(UICommand command) { super.executeCommand(command); if (command == getRemoveCommand()) { remove(); } else if ("OnRemove".equals(command.getName())) { onRemove(); } else if ("Upload".equals(command.getName())) { upload(); } else if ("CancelUpload".equals(command.getName())) { cancelUpload(); } else if ("OnCancelUpload".equals(command.getName())) { onCancelUpload(); } else if ("PauseUpload".equals(command.getName())) { pauseUpload(); } else if ("ResumeUpload".equals(command.getName())) { resumeUpload(); } else if ("Cancel".equals(command.getName())) { cancel(); } else if (command == getDownloadCommand()) { download(); } else if (MoveDiskModel.Move.equals(getMoveCommand().getName())) { diskOperationsHelper.move(this, getSelectedItems()); } else if (CopyDiskModel.Copy.equals(getCopyCommand().getName())) { diskOperationsHelper.copy(this, getSelectedItems()); } }
Source:
void onJoinGame() { GameInfoBean gameInfoBean = gameService.getByUid(playerInfoBean.getGameUID()); gameService.joinGame(gameInfoBean,null,new Callback<Void>() { @Override public void success(Void result) { } @Override public void error(Throwable e) { logger.warn("Game could not be joined", e); } }); }

Target:
void onJoinGame() { GameInfoBean gameInfoBean = gameService.getByUid(playerInfoBean.getGameUid()); gameService.joinGame(gameInfoBean, null) .exceptionally(throwable -> { logger.warn("Game could not be joined", throwable); return null; }); }