auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private Object upsertObjects(Environment context) { if(context.ids.isPresent()) { throw new BadRequestException("UPSERT must not include ids"); } if(!context.data.isPresent()) { throw new BadRequestException("UPSERT must include data argument"); } Set<PersistentResource> upsertedObjects = new HashSet<>(); for(Map<String, Object> input : context.data.get()) { EntityDictionary dictionary = context.requestScope.getDictionary(); if(context.isRoot()) { String idFieldName = dictionary.getIdFieldName(dictionary.getEntityClass(context.field.getName())); upsertedObjects.add((PersistentResource) upsertObject(idFieldName, input, context.requestScope, context.field, context.outputType)); } else { String idFieldName = dictionary.getIdFieldName(context.parentResource.getResourceClass()); upsertedObjects.add((PersistentResource) upsertObject(idFieldName, input, dictionary, context.parentResource, context.field, context.outputType, context.requestScope)); } } return upsertedObjects; }

Target:
private Set<PersistentResource> upsertObjects(Environment context) { if(context.ids.isPresent()) { throw new BadRequestException("UPSERT must not include ids"); } if(!context.data.isPresent()) { throw new BadRequestException("UPSERT must include data argument"); } Set<PersistentResource> upsertedObjects = new HashSet(); for(Map<String, Object> input : context.data.get()) { upsertedObjects.addAll(graphWalker(input, this::upsertObject, Optional.ofNullable(context.parentResource), context.requestScope, context.field.getName())); } for(Map<String, Object> input : context.data.get()) { graphWalker(input, this::updateRelationship, Optional.ofNullable(context.parentResource), context.requestScope, context.field.getName()); } if(!context.isRoot()) { for(PersistentResource obj : upsertedObjects) { context.parentResource.addRelation(context.field.getName(), obj); } } return upsertedObjects; }
Source:
private void setTimeStampState(String timeStamp) { logger.debug("setTimeStampState(): Time Stamp: {}", timeStamp); int state = 0; String itemName = ""; itemName = getItemName(DSCAlarmItemType.PANEL_TIME_STAMP, 0, 0); if (StringUtils.isNotEmpty(itemName)) { DSCAlarmBindingConfig config = getItemConfig(itemName); if (config != null) { Item item = getItem(itemName); if (item != null) { State onOffState = item.getState(); if (onOffState instanceof OnOffType) { OnOffType value = (OnOffType) onOffState; if ((timeStamp == "" && value.equals(OnOffType.OFF)) || (timeStamp != "" && value.equals(OnOffType.ON))) { logger.debug("setTimeStampState(): Already Set!", timeStamp); return; } else if (timeStamp != "") { state = 1; } } } } } updateItemByItemType(DSCAlarmItemType.PANEL_TIME_STAMP, 0, 0, state); logger.debug("setTimeStampState(): Changed state to '{}'.", state == 1 ? OnOffType.ON : OnOffType.OFF); }

Target:
private void setTimeStampState(String timeStamp) { logger.debug("setTimeStampState(): Time Stamp: {}", timeStamp); int state = 0; String itemName = ""; itemName = getItemName(DSCAlarmItemType.PANEL_TIME_STAMP, 0, 0); if (StringUtils.isNotEmpty(itemName)) { DSCAlarmBindingConfig config = getItemConfig(itemName); if (config != null) { Item item = getItem(itemName); if (item != null) { State onOffState = item.getState(); if (onOffState instanceof OnOffType) { OnOffType value = (OnOffType) onOffState; if ((StringUtils.isEmpty(timeStamp) && value.equals(OnOffType.OFF)) || (StringUtils.isNotEmpty(timeStamp) && value.equals(OnOffType.ON))) { logger.debug("setTimeStampState(): Already Set!", timeStamp); return; } else if (StringUtils.isNotEmpty(timeStamp)) { state = 1; } } } } } updateItemByItemType(DSCAlarmItemType.PANEL_TIME_STAMP, 0, 0, state); logger.debug("setTimeStampState(): Changed state to '{}'.", state == 1 ? OnOffType.ON : OnOffType.OFF); }
Source:
private JobValidatorRegistry() { jobValidators = new HashMap<>(); Iterator<JobValidatorService> loadedFactories = ServiceRegistry.lookupProviders(JobValidatorService.class); while (loadedFactories.hasNext()) { try { JobValidatorService validator = loadedFactories.next(); String validatorID = validator.getClass().getCanonicalName(); if (!jobValidators.containsKey(validator.getClass().getCanonicalName())) { logger.debug("Job Validator Factory provider <" + validatorID + "> found"); jobValidators.put(validatorID, validator); } } catch (Exception err) { logger.error("Failed to load job validator factory: " + err); } } if (logger.isInfoEnabled()) { logger.info("[JobValidatorRegistry] job validators registered : " + jobValidators.keySet()); } }

Target:
private JobValidatorRegistry() { load(); }
Source:
public void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setStyle(DialogFragment.STYLE_NORMAL, R.style.AppTheme_NoActionBar_Fullscreen); setCancelable(false); }

Target:
public void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setStyle(DialogFragment.STYLE_NORMAL, R.style.AppTheme_NoActionBar); setCancelable(false); }
Source:
public JSONObject toJSON() { JSONObject json = new JSONObject(); try { if (version > MW_VERSION) { json.putOpt("version", version); } json.putOpt("title", getTitle().toJSON()); JSONArray sectionsJSON = new JSONArray(); for (Section section : getSections()) { sectionsJSON.put(section.toJSON()); } json.putOpt("sections", sectionsJSON); json.putOpt("properties", pageProperties.toJSON()); if (galleryCollection != null) { json.put("gallery", galleryCollection.toJSON()); } return json; } catch (JSONException e) { throw new RuntimeException(e); } }

Target:
public JSONObject toJSON() { JSONObject json = new JSONObject(); try { json.putOpt("version", version); json.putOpt("title", getTitle().toJSON()); JSONArray sectionsJSON = new JSONArray(); for (Section section : getSections()) { sectionsJSON.put(section.toJSON()); } json.putOpt("sections", sectionsJSON); json.putOpt("properties", pageProperties.toJSON()); if (galleryCollection != null) { json.put("gallery", galleryCollection.toJSON()); } return json; } catch (JSONException e) { throw new RuntimeException(e); } }
Source:
private Date calculateNextUserFetch() { int diff = HOURS_OF_DAY - Calendar.getInstance().get(Calendar.HOUR_OF_DAY); logger.debug("Still " + diff + " hours until midnight."); diff++; Date nextExecution = Date.from(Instant.now().plusSeconds(diff * 3600)); logger.debug("The next fetch of organization members from github will be at: " + DateFormat.getInstance().format(nextExecution)); return nextExecution; }

Target:
private Date calculateNextUserFetch() { int diff = HOURS_OF_DAY - LocalTime.now().getHour(); logger.debug("Still " + diff + " hours until midnight."); diff++; Date nextExecution = Date.from(Instant.now().plusSeconds(diff * SECONDS_PER_HOUR)); logger.debug("The next fetch of organization members from github will be at: " + DateFormat.getInstance().format(nextExecution)); return nextExecution; }
Source:
protected void onStart() { super.onStart(); if (!AppPrefs.isSwipeToNavigateShown()) { Snackbar.make(mViewPager, getString(R.string.notifications_label_swipe_for_more_snackbar), Snackbar.LENGTH_LONG).show(); } }

Target:
protected void onStart() { super.onStart(); if (!AppPrefs.isSwipeToNavigateShown() && mAllowHorizontalNavigation && (mAdapter.getCount() > 1)) { Snackbar.make(mViewPager, getString(R.string.notifications_label_swipe_for_more_snackbar), Snackbar.LENGTH_LONG).show(); } }
Source:
public void trackWifiInfo(final Map<String, WifiInfo> wifiInfoPerBatch) { final List<WifiInfo> wifiInfoList = Lists.newArrayList(wifiInfoPerBatch.values()); Collections.shuffle(wifiInfoList); if (wifiInfoList.isEmpty()) { return; } wifiInfoDAO.putBatch(wifiInfoList.subList(0, Math.min(WIFI_INFO_BATCH_MAX_SIZE, wifiInfoList.size()))); LOGGER.debug("Tracked wifi info for senses: {}", wifiInfoPerBatch.size(), wifiInfoPerBatch.keySet()); }

Target:
public void trackWifiInfo(final Map<String, WifiInfo> wifiInfoPerBatch) { final List<WifiInfo> wifiInfoList = Lists.newArrayList(wifiInfoPerBatch.values()); Collections.shuffle(wifiInfoList); if (wifiInfoList.isEmpty()) { return; } wifiInfoDAO.putBatch(wifiInfoList.subList(0, Math.min(WIFI_INFO_BATCH_MAX_SIZE, wifiInfoList.size()))); LOGGER.info("Tracked wifi info for senses", wifiInfoPerBatch.size()); LOGGER.trace("Tracked wifi info for senses {}", wifiInfoPerBatch.keySet()); }
Source:
public Responses(Collection<Address> dests, RspList<Response> results) { if (dests != null && dests.size() < results.size()) { int size = dests.size(); this.addresses = new Address[size]; this.responses = new AtomicReferenceArray<>(size); int i = 0; for (Address address : dests) { this.addresses[i] = address; Rsp<Response> rsp = results.get(address); if (rsp == null) { responses.set(i, SUSPECTED_RSP); } else if (rsp.wasReceived() || rsp.wasSuspected() || rsp.wasUnreachable()) { responses.set(i, rsp); } ++i; } } else { int size = results.size(); this.addresses = new Address[size]; this.responses = new AtomicReferenceArray<>(size); int i = 0; for (Map.Entry<Address, Rsp<Response>> e : results.entrySet()) { addresses[i] = e.getKey(); Rsp<Response> rsp = e.getValue(); if (rsp.wasReceived() || rsp.wasSuspected() || rsp.wasUnreachable()) { responses.set(i, rsp); } ++i; } } }

Target:
public Responses(Collection<Address> dests, RspList<Response> results) { if (dests != null && results.size() < dests.size()) { int size = dests.size(); this.addresses = new Address[size]; this.responses = new AtomicReferenceArray<>(size); int i = 0; for (Address address : dests) { this.addresses[i] = address; Rsp<Response> rsp = results.get(address); if (rsp == null) { responses.set(i, SUSPECTED_RSP); } else if (rsp.wasReceived() || rsp.wasSuspected() || rsp.wasUnreachable()) { responses.set(i, rsp); } ++i; } } else { int size = results.size(); this.addresses = new Address[size]; this.responses = new AtomicReferenceArray<>(size); int i = 0; for (Map.Entry<Address, Rsp<Response>> e : results.entrySet()) { addresses[i] = e.getKey(); Rsp<Response> rsp = e.getValue(); if (rsp.wasReceived() || rsp.wasSuspected() || rsp.wasUnreachable()) { responses.set(i, rsp); } ++i; } } }
Source:
protected ICommand getAfterReorientRelationshipCommand(ReorientRelationshipRequest request) { ICommand defaultCommand = super.getAfterReorientRelationshipCommand(request); int reorientDirection = request.getDirection(); View newEndView = RequestParameterUtils.getReconnectedEndView(request); if ((((ISpecializationType) ElementTypeRegistry.getInstance().getType(SysMLServiceTypeUtil.ORG_ECLIPSE_PAPYRUS_SYSML14_ALLOCATE_ABSTRACTION)).getMatcher().matches(request.getRelationship())) || (((ISpecializationType) ElementTypeRegistry.getInstance().getType(SysMLServiceTypeUtil.ORG_ECLIPSE_PAPYRUS_SYSML14_REFINE_ABSTRACTION)).getMatcher().matches(request.getRelationship())) || (((ISpecializationType) ElementTypeRegistry.getInstance().getType(SysMLServiceTypeUtil.ORG_ECLIPSE_PAPYRUS_SYSML14_TRACE_ABSTRACTION)).getMatcher().matches(request.getRelationship()))) { boolean isSource = true; if (ReorientRequest.REORIENT_SOURCE == reorientDirection) { isSource = true; } else { isSource = false; } if (newEndView.getElement() instanceof Property) { SetDirectedRelationshipPropertyPathCommand setPropertyPathCommand = new SetDirectedRelationshipPropertyPathCommand(request.getEditingDomain(), newEndView, isSource); EMFToIEditCommandWrapper editCommandWrapper = new EMFToIEditCommandWrapper(request.getRelationship(), request, setPropertyPathCommand); defaultCommand = CompositeCommand.compose(defaultCommand, editCommandWrapper); } } return defaultCommand; }

Target:
protected ICommand getAfterReorientRelationshipCommand(ReorientRelationshipRequest request) { ICommand defaultCommand = super.getAfterReorientRelationshipCommand(request); int reorientDirection = request.getDirection(); View newEndView = RequestParameterUtils.getReconnectedEndView(request); if ((((ISpecializationType) ElementTypeRegistry.getInstance().getType(SysMLServiceTypeUtil.ORG_ECLIPSE_PAPYRUS_SYSML14_ALLOCATE_ABSTRACTION)).getMatcher().matches(request.getRelationship())) || (((ISpecializationType) ElementTypeRegistry.getInstance().getType(SysMLServiceTypeUtil.ORG_ECLIPSE_PAPYRUS_SYSML14_REFINE_ABSTRACTION)).getMatcher().matches(request.getRelationship())) || (((ISpecializationType) ElementTypeRegistry.getInstance().getType(SysMLServiceTypeUtil.ORG_ECLIPSE_PAPYRUS_SYSML14_TRACE_ABSTRACTION)).getMatcher().matches(request.getRelationship()))) { boolean isSource = true; if (ReorientRequest.REORIENT_SOURCE == reorientDirection) { isSource = true; } else { isSource = false; } if (newEndView.getElement() instanceof Property) { SetDirectedRelationshipPropertyPathCommand setPropertyPathCommand = new SetDirectedRelationshipPropertyPathCommand(request.getEditingDomain(), newEndView, isSource); EMFToIEditCommandWrapper editCommandWrapper = new EMFToReorientRelationshipEditCommandWrapper(request.getRelationship(), request, setPropertyPathCommand); defaultCommand = CompositeCommand.compose(defaultCommand, editCommandWrapper); } } return defaultCommand; }
Source:
public long getMaxSamples() { return maxSamples; }

Target:
public int getMaxSamples() { return samples.length; }
Source:
public void targetPerspective() { String newUrl = Window.Location.createUrlBuilder() .setParameter("perspective", dashboard) .buildString(); DomGlobal.window.history.pushState(null, "Dashbuilder Runtime", newUrl); this.hideLoading(); }

Target:
public void targetPerspective() { String newUrl = Window.Location.createUrlBuilder() .setParameter(PERSPECTIVE_PARAM, dashboard) .buildString(); DomGlobal.window.history.pushState(null, "Dashbuilder Runtime", newUrl); this.hideLoading(); }
Source:
public long get(int length, boolean signed) throws CTFReaderException { if (length > BIT_LONG) { throw new CTFReaderException("Cannot read a long longer than 64 bits. Rquested: " + length); } if (length > BIT_INT) { final int highShift = length - BIT_INT; long a = getInt() & 0x00000000FFFFFFFFL; long b = getInt(highShift, false); long retVal; a &= 0xFFFFFFFFL; b &= ((1L << highShift) - 1L); retVal = (this.byteOrder == ByteOrder.BIG_ENDIAN) ? ((a << highShift) | b) : ((b << BIT_INT) | a); if (signed) { int signExtendBits = BIT_LONG - length; retVal = (retVal << signExtendBits) >> signExtendBits; } return retVal; } return getInt(length, signed); }

Target:
public long get(int length, boolean signed) throws CTFReaderException { if (length > BIT_LONG) { throw new CTFReaderException("Cannot read a long longer than 64 bits. Rquested: " + length); } if (length > BIT_INT) { final int highShift = length - BIT_INT; long a = getInt() & 0x00000000FFFFFFFFL; long b = getInt(highShift, false); long retVal; a &= 0xFFFFFFFFL; b &= ((1L << highShift) - 1L); retVal = (this.byteOrder == ByteOrder.BIG_ENDIAN) ? ((a << highShift) | b) : ((b << BIT_INT) | a); if (signed) { int signExtendBits = BIT_LONG - length; retVal = (retVal << signExtendBits) >> signExtendBits; } return retVal; } long signedRead = getInt(length, false); return (signed ? signedRead : (signedRead & 0xFFFFFFFFL)); }
Source:
public void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); if (requestCode == SEARCH_REQUEST_ADD_A_LANGUAGE) { if (resultCode == Activity.RESULT_OK) { if (app.language().getAppLanguageCodes().size() == 1) { languageScrollView.setVisibility(View.GONE); langButtonContainer.setVisibility(View.VISIBLE); initLangButton(); searchLanguageCode = app.language().getAppLanguageCode(); startSearch(query, true); return; } else { languageScrollView.setVisibility(View.VISIBLE); langButtonContainer.setVisibility(View.GONE); } int position = data.getIntExtra(ACTIVITY_RESULT_LANG_POSITION_DATA, 0); languageScrollView.refreshLanguagesTabLayout(this, position); } } }

Target:
public void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); if (requestCode == SEARCH_REQUEST_ADD_A_LANGUAGE) { if (resultCode == Activity.RESULT_OK) { int position = data.getIntExtra(ACTIVITY_RESULT_LANG_POSITION_DATA, 0); setUpLanguageScroll(position); } } }
Source:
LRESULT wmChar (long hwnd, long wParam, long lParam) { if (ignoreCharacter) return null; LRESULT result = super.wmChar (hwnd, wParam, lParam); if (result != null) return result; switch ((int) wParam) { case SWT.TAB: return LRESULT.ZERO; case SWT.CR: if (!ignoreDefaultSelection) sendSelectionEvent (SWT.DefaultSelection); ignoreDefaultSelection = false; if (getSelectionIndex() == -1) { if ((style & SWT.DROP_DOWN) != 0 && (style & SWT.READ_ONLY) == 0) { if (OS.SendMessage(handle, OS.CB_GETDROPPEDSTATE, 0, 0) != 0) { OS.SendMessage(handle, OS.CB_SHOWDROPDOWN, 0, 0); } return LRESULT.ZERO; } } case SWT.ESC: if ((style & SWT.DROP_DOWN) != 0) { if (OS.SendMessage (handle, OS.CB_GETDROPPEDSTATE, 0, 0) == 0) { return LRESULT.ZERO; } } case SWT.DEL: if (OS.GetKeyState (OS.VK_CONTROL) < 0) { if ((style & SWT.READ_ONLY) != 0) return LRESULT.ZERO; Point selection = getSelection (); String text = getText (); long hwndText = OS.GetDlgItem (handle, CBID_EDIT); int x = selection.x; int y = selection.y; if (x == y) { String actText = text.substring (0, getCaretPosition ()); java.util.regex.Matcher m = Text.CTRL_BS_PATTERN.matcher (actText); if (m.find ()) { x = m.start (); y = m.end (); OS.SendMessage (hwndText, OS.EM_SETSEL, x, y); } } if (x < y) { OS.SendMessage (hwndText, OS.EM_REPLACESEL, 1, 0); } return LRESULT.ZERO; } } return result; }

Target:
LRESULT wmChar (long hwnd, long wParam, long lParam) { if (ignoreCharacter) return null; LRESULT result = super.wmChar (hwnd, wParam, lParam); if (result != null) return result; switch ((int) wParam) { case SWT.TAB: return LRESULT.ZERO; case SWT.CR: if (!ignoreDefaultSelection) sendSelectionEvent (SWT.DefaultSelection); ignoreDefaultSelection = false; if (getSelectionIndex() == -1) { if ((style & SWT.DROP_DOWN) != 0 && (style & SWT.READ_ONLY) == 0) { if (OS.SendMessage(handle, OS.CB_GETDROPPEDSTATE, 0, 0) != 0) { OS.SendMessage(handle, OS.CB_SHOWDROPDOWN, 0, 0); } return LRESULT.ZERO; } } case SWT.ESC: if ((style & SWT.DROP_DOWN) != 0) { if (OS.SendMessage (handle, OS.CB_GETDROPPEDSTATE, 0, 0) == 0) { return LRESULT.ZERO; } } case SWT.DEL: if (OS.GetKeyState (OS.VK_CONTROL) < 0) { if ((style & SWT.READ_ONLY) != 0) return LRESULT.ZERO; Point selection = getSelection (); long hwndText = OS.GetDlgItem (handle, CBID_EDIT); int x = selection.x; int y = selection.y; if (x == y) { String actText = getText ().substring (0, getCaretPosition ()); java.util.regex.Matcher m = Text.CTRL_BS_PATTERN.matcher (actText); if (m.find ()) { x = m.start (); y = m.end (); OS.SendMessage (hwndText, OS.EM_SETSEL, x, y); } } if (x < y) { OS.SendMessage (hwndText, OS.EM_REPLACESEL, 1, 0); } return LRESULT.ZERO; } } return result; }
Source:
public T build(String configurationPath, InputStream inputStream) throws IOException, ConfigurationException { final JsonNode node = mapper.readTree(inputStream); return build(node, configurationPath != null ? configurationPath : "InputStream configuration"); }

Target:
public T build(String configurationPath, InputStream inputStream) throws IOException, ConfigurationException { T configuration = null; try { final JsonNode node = mapper.readTree(inputStream); configuration = build(node, configurationPath != null ? configurationPath : "InputStream configuration"); } finally { inputStream.close(); } return configuration; }
Source:
public List<TopologySummary> getTopologySummaries() throws AuthorizationException, TException { return getNimbus().getTopologySummaries(); }

Target:
public List<TopologySummary> getTopologySummaries() throws TException { return getNimbus().getTopologySummaries(); }
Source:
public static PersonFragment create(String personName) { PersonFragment personFragment = new PersonFragment(); Bundle bundle = new Bundle(); bundle.putString("personName", personName); personFragment.setArguments(bundle); return personFragment; }

Target:
public static PersonFragment create(String personName) { PersonFragment personFragment = new PersonFragment(); Bundle bundle = new Bundle(); bundle.putString(ARG_PERSON_NAME, personName); personFragment.setArguments(bundle); return personFragment; }
Source:
public AccountSettings getAccountSettings() { GetAccountSettingsRequest request = new GetAccountSettingsRequest(); return api.getAccountSettings(request).getAccountSettings(); }

Target:
public AccountSettings getAccountSettings() { try { GetAccountSettingsRequest request = new GetAccountSettingsRequest(); return api.getAccountSettings(request).getAccountSettings(); } catch (NotFoundException e) { return null; } }
Source:
public void test() { connect(); JQuery toggleIndeterminate = findButtonByContent("toggleIndeterminate"); JQuery isIndeterminate = findButtonByContent("isIndeterminate"); JQuery isChecked = findButtonByContent("isChecked"); click(toggleIndeterminate); waitResponse(); clickAndVerifyLog(isIndeterminate, "true"); clickAndVerifyLog(isChecked, "false"); click(jq(".z-checkbox")); waitResponse(); clickAndVerifyLog(isIndeterminate, "false"); clickAndVerifyLog(isChecked, "true"); click(toggleIndeterminate); waitResponse(); clickAndVerifyLog(isIndeterminate, "true"); clickAndVerifyLog(isChecked, "false"); click(toggleIndeterminate); waitResponse(); clickAndVerifyLog(isIndeterminate, "false"); clickAndVerifyLog(isChecked, "false"); }

Target:
public void test() { connect(); isIndeterminate = findButtonByContent("isIndeterminate"); isChecked = findButtonByContent("isChecked"); JQuery toggleIndeterminate = findButtonByContent("toggleIndeterminate"); JQuery checkbox = jq(".z-checkbox"); verifyLogs(TRUE, TRUE); click(toggleIndeterminate); waitResponse(); verifyLogs(FALSE, TRUE); click(toggleIndeterminate); waitResponse(); verifyLogs(TRUE, TRUE); click(checkbox); waitResponse(); verifyLogs(FALSE, FALSE); click(toggleIndeterminate); waitResponse(); verifyLogs(TRUE, FALSE); click(checkbox); waitResponse(); verifyLogs(FALSE, TRUE); }
Source:
private TransientStore getTransientStore() { return Framework.getService(TransientStoreService.class).getStore(STATUS_STORE_NAME); }

Target:
protected TransientStore getTransientStore() { return Framework.getService(TransientStoreService.class).getStore(STATUS_STORE_NAME); }
Source:
public Process exec() throws IOException, InterruptedException { String[] command = { "docker", "run", "-i", "-t", "-v", workDir + ":/kb/module/work", "test/" + moduleName.toLowerCase() + ":latest", "bash" }; ProcessBuilder pb = new ProcessBuilder(command); pb.redirectInput(ProcessBuilder.Redirect.INHERIT); pb.redirectOutput(ProcessBuilder.Redirect.INHERIT); Process proc = pb.start(); proc.waitFor(); return proc; }

Target:
public void exec() throws IOException, InterruptedException { final String[] command = { "docker", "run", "--interactive", "--tty=true", "--volume=" + moduleInfo.workDir + ":/kb/module/work", "test/" + moduleInfo.moduleName.toLowerCase() + ":latest", "bash" }; final ProcessBuilder pb = new ProcessBuilder(command); pb.redirectInput(ProcessBuilder.Redirect.INHERIT); pb.redirectOutput(ProcessBuilder.Redirect.INHERIT); final Process proc = pb.start(); proc.waitFor(); }
Source:
public void testCrossesFilter() throws Exception { FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2(null); GeometryFactory gf = new GeometryFactory(); PackedCoordinateSequenceFactory sf = new PackedCoordinateSequenceFactory(); LineString ls = gf.createLineString(sf.create(new double[] {2, 3, 4, 3}, 2, 0)); Crosses cs = ff.crosses(ff.property(aname("geom")), ff.literal(ls)); FeatureCollection features = dataStore.getFeatureSource(tname("road")).getFeatures(cs); checkSingleResult(features, "r2"); }

Target:
public void testCrossesFilter() throws Exception { FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2(null); GeometryFactory gf = new GeometryFactory(); PackedCoordinateSequenceFactory sf = new PackedCoordinateSequenceFactory(); LineString ls = gf.createLineString(sf.create(new double[] {2, 3, 4, 3}, 2)); Crosses cs = ff.crosses(ff.property(aname("geom")), ff.literal(ls)); FeatureCollection features = dataStore.getFeatureSource(tname("road")).getFeatures(cs); checkSingleResult(features, "r2"); }
Source:
public void cleanUp() throws Exception { if (!isWindows) { ProcessBuilder builder = new ProcessBuilder(); builder.directory(tempProj); String processCommand = "mvn liberty:stop-server"; String os = System.getProperty("os.name"); if (os != null && os.toLowerCase().startsWith("windows")) { builder.command("CMD", "/C", processCommand); } else { builder.command("bash", "-c", processCommand); } Process process = builder.start(); if (tempProj != null && tempProj.exists()) { FileUtils.deleteDirectory(tempProj); } if (logFile != null && logFile.exists()) { logFile.delete(); } } }

Target:
public void cleanUp() throws Exception { if (!isWindows) { ProcessBuilder builder = buildProcess("mvn liberty:stop-server"); Process process = builder.start(); if (tempProj != null && tempProj.exists()) { FileUtils.deleteDirectory(tempProj); } if (logFile != null && logFile.exists()) { logFile.delete(); } } }
Source:
protected void logAuditMessage(final Guid clusterId, final GlusterVolumeEntity volume, final VDS server, final AuditLogType logType, final String entityName, final String entityValue) { AuditLogDirector.log(new AuditLogableBase() { @Override protected VDS getVds() { return server; } @Override public Guid getVdsGroupId() { return clusterId; } @Override protected GlusterVolumeEntity getGlusterVolume() { return volume; } @Override public AuditLogType getAuditLogTypeValue() { return logType; } @Override public Map<String, String> getCustomValues() { Map<String, String> customValues = new HashMap<String, String>(); if (entityName != null && entityValue != null) { customValues.put(entityName, entityValue); } return customValues; } }); }

Target:
protected void logAuditMessage(final Guid clusterId, final GlusterVolumeEntity volume, final VDS server, final AuditLogType logType, final String entityName, final String entityValue) { AuditLogDirector.log(new AuditLogableBase() { @Override protected VDS getVds() { return server; } @Override public Guid getVdsGroupId() { return clusterId; } @Override protected GlusterVolumeEntity getGlusterVolume() { return volume; } @Override public AuditLogType getAuditLogTypeValue() { return logType; } @Override public Map<String, String> getCustomValues() { if (entityName != null && entityValue != null) { return Collections.singletonMap(entityName, entityValue); } else { return new HashMap<String, String>(); } } }); }
Source:
private void sendGapQuery() { if (m_mastershipAccepted.get() && m_gapTracker.getFirstGap() != null) { if (m_gapTracker.isEmpty()) { return; } m_queryResponses.clear(); Pair<Mailbox, ImmutableList<Long>> p = m_ackMailboxRefs.get(); Mailbox mbx = p.getFirst(); m_currentRequestId = System.nanoTime(); if (mbx != null && p.getSecond().size() > 0) { final int msgLen = 1 + 4 + 4 + m_signatureBytes.length + 8 + 8; ByteBuffer buf = ByteBuffer.allocate(msgLen); buf.put(ExportManager.GAP_QUERY); buf.putInt(m_partitionId); buf.putInt(m_signatureBytes.length); buf.put(m_signatureBytes); buf.putLong(m_currentRequestId); buf.putLong(m_gapTracker.getSafePoint() + 1); BinaryPayloadMessage bpm = new BinaryPayloadMessage(new byte[0], buf.array()); for( Long siteId: p.getSecond()) { mbx.send(siteId, bpm); } if (exportLog.isDebugEnabled()) { exportLog.debug("Send GAP_QUERY message(" + m_currentRequestId + "," + (m_gapTracker.getSafePoint() + 1) + ") for partition " + m_partitionId + "source signature " + m_tableName + " from " + CoreUtils.hsIdToString(mbx.getHSId()) + " to " + CoreUtils.hsIdCollectionToString(p.getSecond())); } } else { setStatus(StreamStatus.BLOCKED); Pair<Long, Long> gap = m_gapTracker.getFirstGap(); exportLog.warn(toString() + " is blocked because of data from sequence number " + gap.getFirst() + " to " + gap.getSecond() + " is missing."); } } }

Target:
private void sendGapQuery() { if (m_mastershipAccepted.get() && m_gapTracker.getFirstGap() != null) { m_queryResponses.clear(); Pair<Mailbox, ImmutableList<Long>> p = m_ackMailboxRefs.get(); Mailbox mbx = p.getFirst(); m_currentRequestId = System.nanoTime(); if (mbx != null && p.getSecond().size() > 0) { final int msgLen = 1 + 4 + 4 + m_signatureBytes.length + 8 + 8; ByteBuffer buf = ByteBuffer.allocate(msgLen); buf.put(ExportManager.GAP_QUERY); buf.putInt(m_partitionId); buf.putInt(m_signatureBytes.length); buf.put(m_signatureBytes); buf.putLong(m_currentRequestId); buf.putLong(m_gapTracker.getSafePoint() + 1); BinaryPayloadMessage bpm = new BinaryPayloadMessage(new byte[0], buf.array()); for( Long siteId: p.getSecond()) { mbx.send(siteId, bpm); } if (exportLog.isDebugEnabled()) { exportLog.debug("Send GAP_QUERY message(" + m_currentRequestId + "," + (m_gapTracker.getSafePoint() + 1) + ") from " + CoreUtils.hsIdToString(mbx.getHSId()) + " to " + CoreUtils.hsIdCollectionToString(p.getSecond())); } } else { setStatus(StreamStatus.BLOCKED); Pair<Long, Long> gap = m_gapTracker.getFirstGap(); exportLog.warn("Stream is blocked because of data from sequence number " + gap.getFirst() + " to " + gap.getSecond() + " is missing."); } } }
Source:
protected Map<String, String> build( String localModuleId, Node moduleBody, Set<String> googProvides) { Map<String, String> reexportMap = new HashMap<>(); if (localModuleId == null) { return reexportMap; } if (!isLegacyNamespaceModule(moduleBody)) { return reexportMap; } for (Node statement : moduleBody.children()) { if (isWholeModuleExportAssignment(statement)) { String localVariableName = statement.getFirstChild().getChildAtIndex(1).getString(); reexportMap.put( buildWholeModuleExportSymbolName(localModuleId), buildLocalSymbolName(localModuleId, localVariableName)); } else if (isNamedExportAssignment(statement)) { String localVariableName = statement.getFirstChild().getChildAtIndex(1).getString(); String exportName = statement.getFirstChild().getFirstChild().getChildAtIndex(1).getString(); reexportMap.put( buildNamedExportSymbolName(localModuleId, exportName), buildLocalSymbolName(localModuleId, localVariableName)); } } return reexportMap; }

Target:
protected Map<String, String> build( String localModuleId, Node moduleBody, Set<String> googProvides) { Map<String, String> reexportMap = new HashMap<>(); if (localModuleId == null) { return reexportMap; } if (!isLegacyNamespaceModule(moduleBody)) { return reexportMap; } for (Node statement : moduleBody.children()) { if (isWholeModuleExportAssignment(statement)) { String localVariableName = getExportsAssignmentRHS(statement); reexportMap.put( buildWholeModuleExportSymbolName(localModuleId), buildLocalSymbolName(localModuleId, localVariableName)); } else if (isNamedExportAssignment(statement)) { String localVariableName = getExportsAssignmentRHS(statement); String exportName = getNamedExportName(statement); reexportMap.put( buildNamedExportSymbolName(localModuleId, exportName), buildLocalSymbolName(localModuleId, localVariableName)); } } return reexportMap; }
Source:
private void impl$callSaveChunkEventPost(ChunkPos pos, NBTTagCompound compound, CallbackInfo ci) { if (ShouldFire.SAVE_CHUNK_EVENT || ShouldFire.SAVE_CHUNK_EVENT_POST) { final Cause cause = Cause.of(EventContext.empty(), Collections.singleton(SpongeImpl.getServer())); SpongeImpl.postEvent(SpongeEventFactory.createSaveChunkEventPost(cause, VecHelper.toVec3i(pos))); } }

Target:
private void impl$callSaveChunkEventPost(ChunkPos pos, NBTTagCompound compound, CallbackInfo ci) { if (ShouldFire.SAVE_CHUNK_EVENT_POST) { final Cause cause = Cause.of(EventContext.empty(), Collections.singleton(SpongeImpl.getServer())); SpongeImpl.postEvent(SpongeEventFactory.createSaveChunkEventPost(cause, VecHelper.toVec3i(pos))); } }
Source:
Mono<Response<AreaCodes>> getAllAreaCodesWithResponse( String locationType, String countryCode, String phonePlanId, List<LocationOptionsQuery> locationOptions, Context context) { try { if (locationOptions == null) { Mono.error(new NullPointerException("'locationType' cannot be null.")); } if (countryCode == null) { Mono.error(new NullPointerException("'countryCode' cannot be null.")); } if (phonePlanId == null) { Mono.error(new NullPointerException("'phonePlanId' cannot be null.")); } LocationOptionsQueries locationOptionsQueries = new LocationOptionsQueries(); locationOptionsQueries.setLocationOptions(locationOptions); if (context == null) { return phoneNumberAdministrations.getAllAreaCodesWithResponseAsync( locationType, countryCode, phonePlanId, locationOptionsQueries); } else { return phoneNumberAdministrations.getAllAreaCodesWithResponseAsync( locationType, countryCode, phonePlanId, locationOptionsQueries, context); } } catch (RuntimeException ex) { return monoError(logger, ex); } }

Target:
Mono<Response<AreaCodes>> getAllAreaCodesWithResponse( String locationType, String countryCode, String phonePlanId, List<LocationOptionsQuery> locationOptions, Context context) { if (locationOptions == null) { Mono.error(new NullPointerException("'locationType' cannot be null.")); } if (countryCode == null) { Mono.error(new NullPointerException("'countryCode' cannot be null.")); } if (phonePlanId == null) { Mono.error(new NullPointerException("'phonePlanId' cannot be null.")); } LocationOptionsQueries locationOptionsQueries = new LocationOptionsQueries(); locationOptionsQueries.setLocationOptions(locationOptions); try { if (context == null) { return phoneNumberAdministrations.getAllAreaCodesWithResponseAsync( locationType, countryCode, phonePlanId, locationOptionsQueries); } else { return phoneNumberAdministrations.getAllAreaCodesWithResponseAsync( locationType, countryCode, phonePlanId, locationOptionsQueries, context); } } catch (RuntimeException ex) { return monoError(logger, ex); } }
Source:
public DatasetWriter<E> newWriter() { checkSchemaForWrite(); AbstractDatasetWriter<E> writer; if (dataset.getDescriptor().isPartitioned()) { writer = PartitionedDatasetWriter.newWriter(this); } else { writer = FileSystemWriter.newWriter( fs, root, -1, -1 , dataset.getDescriptor(), this.getSchema()); } writer.initialize(); return writer; }

Target:
public DatasetWriter<E> newWriter() { checkSchemaForWrite(); AbstractDatasetWriter<E> writer; if (dataset.getDescriptor().isPartitioned()) { writer = PartitionedDatasetWriter.newWriter(this); } else { writer = FileSystemWriter.newWriter( fs, root, -1, -1 , dataset.getDescriptor(), this.getAccessor().getWriteSchema()); } writer.initialize(); return writer; }
Source:
public void TopWamWikisWhereIsMyExtension_GeoEdgeFree() { String whereIsExtensionUrl = urlBuilder.getUrlForPath("community", URLsContent.specialWhereIsExtension); whereIsExtensionUrl = urlBuilder.appendQueryStringToURL(whereIsExtensionUrl, extensionURL); WikiBasePageObject wikiPage = new WikiBasePageObject(driver); wikiPage.logInCookie(credentials.userNameStaff, credentials.passwordStaff, wikiURL); wikiPage.getUrl(whereIsExtensionUrl); wikiPage.verifyNumberOfTop1kWikis(numberOfTop1kWikis); }

Target:
public void TopWamWikisWhereIsMyExtension_GeoEdgeFree() { String whereIsExtensionUrl = urlBuilder.getUrlForPath(URLsContent.communityWiki, URLsContent.specialWhereIsExtension); whereIsExtensionUrl = urlBuilder.appendQueryStringToURL(whereIsExtensionUrl, extensionURL); WikiBasePageObject wikiPage = new WikiBasePageObject(driver); wikiPage.logInCookie(credentials.userNameStaff, credentials.passwordStaff, wikiURL); wikiPage.getUrl(whereIsExtensionUrl); wikiPage.verifyNumberOfTop1kWikis(numberOfTop1kWikis); }
Source:
private static void redirectOutput() { File jrLogFile = new File(FileSystemUtils.getBriefcaseFolder(), ".briefcase-javarosa.log"); try { final PrintStream jrOut = new PrintStream(jrLogFile); Std.setOut(jrOut); Std.setErr(jrOut); Runtime.getRuntime().addShutdownHook(new Thread() { public void run() { jrOut.close(); } }); } catch (FileNotFoundException e) { log.warn("failed to redirect javarosa output to " + jrLogFile); } }

Target:
private static void redirectOutput() { File jrLogFile = new File(FileSystemUtils.getBriefcaseFolder(), ".briefcase-javarosa.log"); try { PrintStream jrOut = new PrintStream(jrLogFile); Std.setOut(jrOut); Std.setErr(jrOut); } catch (FileNotFoundException e) { log.warn("failed to redirect javarosa output to " + jrLogFile); } }
Source:
public FormValidation doCheckExtraDockerLabelsString(@QueryParameter String extraDockerLabelsString) { final List<String> extraDockerLabels = splitAndFilterEmptyList(extraDockerLabelsString, "\n"); for (String extraDockerLabel : extraDockerLabels) { if (extraDockerLabel.trim().split("=").length < 2) { return FormValidation.error("Wrong extraDockerLabel {}", extraDockerLabel); } } return FormValidation.ok(); }

Target:
public FormValidation doCheckExtraDockerLabelsString(@QueryParameter String extraDockerLabelsString) { final List<String> extraDockerLabels = splitAndFilterEmptyList(extraDockerLabelsString, "\n"); for (String extraDockerLabel : extraDockerLabels) { if (extraDockerLabel.trim().split("=").length < 2) { return FormValidation.error("Invalid extraDockerLabel \"%s\" will be ignored", extraDockerLabel); } } return FormValidation.ok(); }
Source:
void connect() { synchronized (this) { if (connected) { throw new IllegalStateException("Already connected"); } } eventBus.vertx().getClusterManager().getNodeInfo(remoteNodeId) .flatMap(nodeInfo -> nodeInfo != null ? Future.succeededFuture(nodeInfo) : Future.failedFuture("Not a member of the cluster")) .map(NodeInfo::getAddress) .flatMap(address -> client.connect(address.getPort(), address.getHost())) .onSuccess(this::connected) .onFailure(t -> { log.warn("Connecting to server " + remoteNodeId + " failed", t); close(t); }); }

Target:
void connect() { synchronized (this) { if (connected) { throw new IllegalStateException("Already connected"); } } Promise<NodeInfo> promise = Promise.promise(); eventBus.vertx().getClusterManager().getNodeInfo(remoteNodeId, promise); promise.future() .flatMap(info -> client.connect(info.port(), info.host())) .onComplete(ar -> { if (ar.succeeded()) { connected(ar.result()); } else { log.warn("Connecting to server " + remoteNodeId + " failed", ar.cause()); close(ar.cause()); } }); }
Source:
public static ComponentURI of(CodeSystemURI codeSystemURI, ComponentIdentifier componentIdentifier) { return new ComponentURI(codeSystemURI, componentIdentifier.getTerminologyComponentId(), componentIdentifier.getComponentId()); }

Target:
public static ComponentURI of(CodeSystemURI codeSystemURI, ComponentIdentifier componentIdentifier) { return of(codeSystemURI, componentIdentifier.getTerminologyComponentId(), componentIdentifier.getComponentId()); }
Source:
protected DomainBundle getDomainBundle(){ return new DefaultDomainBundle( Lists.<CommandHandler>newArrayList() , Lists.<QueryHandler>newArrayList(new SomeQueryHandler(), new SomeCollectionQueryHandler()) , Lists.<Repository>newArrayList() , Lists.<EventListener>newArrayList() , new AccountDomain() , "AccountDomain" ); }

Target:
protected DomainBundle getDomainBundle(){ return new DomainBundle.Builder(new AccountDomain()) .with(new SomeQueryHandler()) .with(new SomeCollectionQueryHandler()) .build(); }
Source:
public InfoboxBuilderPage deleteHeaderComponentWithIndex(int index) { wait.forElementVisible(headers.get(index)); headers.get(index).click(); wait.forElementVisible(deleteButton); deleteButton.click(); return this; }

Target:
public InfoboxBuilderPage deleteHeaderComponentWithIndex(int index) { WebElement headerToDelete = headers.get(index); wait.forElementClickable(headerToDelete); headerToDelete.click(); wait.forElementClickable(deleteButton); deleteButton.click(); return this; }
Source:
public String asSummaryString() { return "Kafka universal scan source"; }

Target:
public String asSummaryString() { return "Kafka"; }
Source:
public void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); if (orientation != newConfig.orientation) { orientation = newConfig.orientation; } configureForOrientation(orientation, newConfig); }

Target:
public void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); configureForOrientation(newConfig); }
Source:
private void insertIterTwice(int size, int[] fuzz, String distributionName) { PerformanceMeter pMinsertion1 = perf.createPerformanceMeter(distributionName + " First Insertion: " + fName); PerformanceMeter pMiterate1 = perf.createPerformanceMeter(distributionName + " First Iteration: " + fName); PerformanceMeter pMinsertion2 = perf.createPerformanceMeter(distributionName + " Second Insertion: " + fName); PerformanceMeter pMiterate2 = perf.createPerformanceMeter(distributionName + " Second Iteration: " + fName); for (int i = 0; i < DEFAULT_LOOP_COUNT; i++) { fSegStore.clear(); pMinsertion1.start(); populate(size, fuzz, fSegStore, getSegmentStoreSize()); pMinsertion1.stop(); pMiterate1.start(); iterate(fSegStore); pMiterate1.stop(); pMinsertion2.start(); populate(size, fuzz, fSegStore, getSegmentStoreSize()); pMinsertion2.stop(); pMiterate2.start(); iterate(fSegStore); pMiterate2.stop(); } pMinsertion1.commit(); pMiterate1.commit(); pMinsertion2.commit(); pMiterate2.commit(); }

Target:
private void insertIterTwice(int size, int[] fuzz, String distributionName) { PerformanceMeter pMinsertion1 = fPerf.createPerformanceMeter(distributionName + " First Insertion: " + fName); PerformanceMeter pMiterate1 = fPerf.createPerformanceMeter(distributionName + " First Iteration: " + fName); PerformanceMeter pMinsertion2 = fPerf.createPerformanceMeter(distributionName + " Second Insertion: " + fName); PerformanceMeter pMiterate2 = fPerf.createPerformanceMeter(distributionName + " Second Iteration: " + fName); for (int i = 0; i < DEFAULT_LOOP_COUNT; i++) { fSegStore.clear(); pMinsertion1.start(); populate(size, fuzz, fSegStore, 0, getSegmentStoreSize() / 2); pMinsertion1.stop(); pMiterate1.start(); iterate(fSegStore); pMiterate1.stop(); pMinsertion2.start(); populate(size, fuzz, fSegStore, getSegmentStoreSize() / 2 + 1, getSegmentStoreSize()); pMinsertion2.stop(); pMiterate2.start(); iterate(fSegStore); pMiterate2.stop(); } pMinsertion1.commit(); pMiterate1.commit(); pMinsertion2.commit(); pMiterate2.commit(); }
Source:
public void testEncodeThrowsMeaningfulException() throws IllegalArgumentException { expectedException.expect(IllegalArgumentException.class); expectedException.expectMessage("Error: keyA and alphabet size must be coprime."); AffineCipher affineCipher = new AffineCipher(); affineCipher.encode("This is a test", 6, 17); }

Target:
public void testEncodeThrowsMeaningfulException() throws IllegalArgumentException { expectedException.expect(IllegalArgumentException.class); expectedException.expectMessage("Error: keyA and alphabet size must be coprime."); affineCipher.encode("This is a test", 6, 17); }
Source:
InCoreMerger(final Repository local) { super(local); tw = new NameConflictTreeWalk(local, reader); cache = DirCache.newInCore(); }

Target:
InCoreMerger(final Repository local) { super(local); tw = new NameConflictTreeWalk(reader); cache = DirCache.newInCore(); }
Source:
protected String handleConstraintCreationSection(List<? extends ConstraintElement> constraints, String tableId) { List<String> constraintStatements = new ArrayList<String>(); for (ConstraintElement constraint : constraints) { constraintStatements.add(constraintDataToSQL(constraint, tableId)); } StringBuilder toExecute = new StringBuilder(); toExecute.append((constraintStatements.size() != 0 ? ",\n" : "")); toExecute.append(join(constraintStatements, ",\n")); return toExecute.toString(); }

Target:
protected String handleConstraintCreationSection(List<? extends ConstraintElement> constraints, String tableId) { List<String> constraintStatements = new ArrayList<String>(); for (ConstraintElement constraint : constraints) { constraintStatements.add(constraintDataToSQL(constraint, tableId)); } StringBuilder toExecute = new StringBuilder(); if (constraintStatements.isEmpty()) { toExecute.append(""); } else { toExecute.append(",\n"); } toExecute.append(join(constraintStatements, ",\n")); return toExecute.toString(); }
Source:
public void listDirSyncOnlyTouchingChildren() throws Exception { String dir1 = PathUtils.concatPath(EXISTING_DIR, "dir_should_sync"); String dir2 = PathUtils.concatPath(dir1, "dir_should_not_sync"); new File(ufsPath(dir1)).mkdirs(); new File(ufsPath(dir2)).mkdirs(); ListStatusPOptions optionsAlways = ListStatusPOptions.newBuilder() .setLoadMetadataType(LoadMetadataPType.NEVER).setCommonOptions(PSYNC_ALWAYS).build(); checkListStatus(EXISTING_DIR, optionsAlways, true); ListStatusPOptions optionsNever = ListStatusPOptions.newBuilder() .setLoadMetadataType(LoadMetadataPType.NEVER).setCommonOptions(PSYNC_NEVER).build(); checkListStatus(dir2, optionsNever, false); }

Target:
public void listDirSyncOnlyTouchingChildren() throws Exception { String dir1 = PathUtils.concatPath(EXISTING_DIR, "dir_should_sync"); String dir2 = PathUtils.concatPath(dir1, "dir_should_not_sync"); new File(ufsPath(dir1)).mkdirs(); new File(ufsPath(dir2)).mkdirs(); ListStatusPOptions optionsAlways = ListStatusPOptions.newBuilder() .setLoadMetadataType(LoadMetadataPType.NEVER).setRecursive(false) .setCommonOptions(PSYNC_ALWAYS).build(); checkListStatus(EXISTING_DIR, optionsAlways, true); ListStatusPOptions optionsNever = ListStatusPOptions.newBuilder() .setLoadMetadataType(LoadMetadataPType.NEVER).setCommonOptions(PSYNC_NEVER) .setRecursive(false).build(); checkListStatus(dir2, optionsNever, false); }
Source:
public ChangeControl controlFor(Change change, CurrentUser user) throws NoSuchChangeException { final Project.NameKey projectKey = projectCache.get(change.getProject()).getProject().getNameKey(); try { return projectControl.controlFor(projectKey, user).controlFor(change); } catch (NoSuchProjectException e) { throw new NoSuchChangeException(change.getId(), e); } }

Target:
public ChangeControl controlFor(Change change, CurrentUser user) throws NoSuchChangeException { try { return projectControl.controlFor(change.getProject(), user).controlFor(change); } catch (NoSuchProjectException e) { throw new NoSuchChangeException(change.getId(), e); } }
Source:
private static Set<String> getAllowedOSName() { return new HashSet<>(Arrays.asList( "linux", "windows", "win", "mac", "macos", "macosx", "mac os x", "ubuntu", "debian", "fedora" )); }

Target:
private static Set<String> getAllowedOSName() { return new HashSet<>(Arrays.asList( "linux", "windows", "win", "mac", "macos", "macosx", "mac os x", "ubuntu", "debian", "fedora", "red hat", "sunos", "freebsd" )); }
Source:
public void testNfcSensorVariable() throws InterpretationException { NdefMessage ndefMessage1 = NfcHandler.createMessage(NFC_NDEF_STRING_1, BrickValues.TNF_MIME_MEDIA); NdefMessage ndefMessage2 = NfcHandler.createMessage(NFC_NDEF_STRING_2, BrickValues.TNF_MIME_MEDIA); UiHardwareTestUtils.gotoNfcFragment(nfcBrickPosition); UiHardwareTestUtils.fakeNfcTag(FIRST_TEST_TAG_ID, ndefMessage1, null); onView(withId(R.id.button_play)) .perform(click()); Assert.assertTrue("Timeout while waiting for user variable change - 'tag id'", userVariableEqualsWithinTimeout(readTagId, 0, 2000)); Assert.assertTrue("Timeout while waiting for user variable change - 'tag message' ", userVariableEqualsWithinTimeout(readTagMessage, "0.0", 2000)); UiHardwareTestUtils.fakeNfcTag(SECOND_TEST_TAG_ID, ndefMessage2, null); Assert.assertTrue("Timeout while waiting for user variable change - 'tag id'", userVariableEqualsWithinTimeout(readTagId, Double.parseDouble(TAG_ID_2), 2000)); Assert.assertTrue("Timeout while waiting for user variable change - 'tag message' ", userVariableEqualsWithinTimeout(readTagMessage, NFC_NDEF_STRING_2, 2000)); }

Target:
public void testNfcSensorVariable() throws InterpretationException { UiNFCTestUtils.gotoNfcFragment(nfcBrickPosition); UiNFCTestUtils.fakeNfcTag(UiNFCTestUtils.FIRST_TEST_TAG_ID, ndefMessage1, null, baseActivityTestRule.getActivity()); onView(withId(R.id.button_play)) .perform(click()); Assert.assertTrue(UserVariableTestUtils.userVariableEqualsWithinTimeout(readTagId, 0, 2000)); Assert.assertTrue(UserVariableTestUtils.userVariableEqualsWithinTimeout(readTagMessage, "0.0", 2000)); }