auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public boolean containsAll(List<Media> images){ if (images == null || images.isEmpty()) { return false; } if (data == null) { data = new ArrayList<>(); return false; } if (data.size() <= 0) { return false; } String fileName = data.get(0).getFilename(); String imageName = images.get(0).getFilename(); return imageName.equals(fileName); }

Target:
public boolean containsAll(List<Media> images){ if (images == null || images.isEmpty()) { return false; } if (data == null) { data = new ArrayList<>(); return false; } if (data.size() == 0) { return false; } String fileName = data.get(0).getFilename(); String imageName = images.get(0).getFilename(); return imageName.equals(fileName); }
Source:
private boolean registerJob(JobDetail jobDetail, Trigger trigger) throws SchedulerException { if (!jobStoreSupportsPersistence) { return true; }else{ persistedJobKeyList.remove(jobDetail.getKey()); } JobDetail existingJob = scheduler_.getJobDetail(jobDetail.getKey()); Trigger existingTrigger = scheduler_.getTrigger(trigger.getKey()); if (existingJob == null) return true; if (equals(existingJob, jobDetail) && equals(existingTrigger, trigger)) { return false; }else{ scheduler_.deleteJob(jobDetail.getKey()); return true; } }

Target:
private boolean registerJob(JobDetail jobDetail, Trigger trigger) throws SchedulerException { if (!jobStoreSupportsPersistence) { return true; } persistedJobKeyList.remove(jobDetail.getKey()); JobDetail existingJob = scheduler_.getJobDetail(jobDetail.getKey()); Trigger existingTrigger = scheduler_.getTrigger(trigger.getKey()); if (existingJob == null) { return true; } if (equals(existingJob, jobDetail) && equals(existingTrigger, trigger)) { return false; } if(equals(existingJob, jobDetail) && !equals(existingTrigger, trigger)){ scheduler_.rescheduleJob(trigger.getKey(), trigger); return false; } scheduler_.deleteJob(jobDetail.getKey()); return true; }
Source:
public ConnectivityReceiver() { MerlinsBeardCreator merlinsBeardCreator = new MerlinsBeardCreator() { @Override public MerlinsBeard createMerlinsBeard(Context context) { return MerlinsBeard.from(context); } }; MerlinBinderRetriever merlinBinderRetriever = new MerlinBinderRetriever() { @Override public MerlinService.ConnectivityChangesNotifier retrieveConnectivityChangesNotifierIfAvailable(Context context) { IBinder iBinder = peekService(context, new Intent(context, MerlinService.class)); if (iBinder != null && iBinder instanceof MerlinService.ConnectivityChangesNotifier) { return (MerlinService.ConnectivityChangesNotifier) iBinder; } return null; } }; ConnectivityChangeEventCreator creator = new ConnectivityChangeEventCreator(); connectivityReceiverConnectivityChangeNotifier = new ConnectivityReceiverConnectivityChangeNotifier(merlinsBeardCreator, merlinBinderRetriever, creator); }

Target:
public ConnectivityReceiver() { MerlinsBeardCreator merlinsBeardCreator = new MerlinsBeardCreator() { @Override public MerlinsBeard createMerlinsBeard(Context context) { return MerlinsBeard.from(context); } }; MerlinBinderRetriever merlinBinderRetriever = new MerlinBinderRetriever() { @Override public MerlinService.ConnectivityChangesNotifier retrieveConnectivityChangesNotifier(Context context) { IBinder iBinder = peekService(context, new Intent(context, MerlinService.class)); if (iBinder instanceof MerlinService.ConnectivityChangesNotifier) { return (MerlinService.ConnectivityChangesNotifier) iBinder; } return null; } }; ConnectivityChangeEventCreator creator = new ConnectivityChangeEventCreator(); connectivityReceiverConnectivityChangeNotifier = new ConnectivityReceiverConnectivityChangeNotifier(merlinsBeardCreator, merlinBinderRetriever, creator); }
Source:
protected void connectSensors() { super.connectSensors(); connectServiceUpIsRunning(); HostAndPort hp = BrooklynAccessUtils.getBrooklynAccessibleAddress(this, getAttribute(HTTP_PORT)); ambariUri = String.format("http://%s:%d", hp.getHostText(), hp.getPort()); setAttribute(Attributes.MAIN_URI, URI.create(ambariUri)); sensors().set(AmbariServer.USERNAME, USERNAME); usernamePasswordCredentials = new UsernamePasswordCredentials( USERNAME, getAttribute(AmbariServer.PASSWORD) == null ? INITIAL_PASSWORD : getAttribute(AmbariServer.PASSWORD)); restAdapter = new RestAdapter.Builder() .setEndpoint(ambariUri) .setRequestInterceptor(new AmbariRequestInterceptor(usernamePasswordCredentials)) .setLogLevel(RestAdapter.LogLevel.FULL) .build(); serviceUpHttpFeed = HttpFeed.builder() .entity(this) .period(500, TimeUnit.MILLISECONDS) .baseUri(ambariUri) .poll(new HttpPollConfig<Boolean>(URL_REACHABLE) .onSuccess(HttpValueFunctions.responseCodeEquals(200)) .onFailureOrException(Functions.constant(false))) .build(); enrichers().add(Enrichers.builder().updatingMap(Attributes.SERVICE_NOT_UP_INDICATORS) .from(URL_REACHABLE) .computing(Functionals.ifNotEquals(true).value("URL not reachable")) .build()); connectSensorsHelper(); }

Target:
protected void connectSensors() { super.connectSensors(); connectServiceUpIsRunning(); HostAndPort hp = BrooklynAccessUtils.getBrooklynAccessibleAddress(this, getAttribute(HTTP_PORT)); ambariUri = String.format("http://%s:%d", hp.getHostText(), hp.getPort()); setAttribute(Attributes.MAIN_URI, URI.create(ambariUri)); sensors().set(AmbariServer.USERNAME, USERNAME); usernamePasswordCredentials = new UsernamePasswordCredentials( USERNAME, getAttribute(AmbariServer.PASSWORD) == null ? INITIAL_PASSWORD : getAttribute(AmbariServer.PASSWORD)); restAdapter = new RestAdapter.Builder() .setEndpoint(ambariUri) .setRequestInterceptor(new AmbariRequestInterceptor(usernamePasswordCredentials)) .setLogLevel(RestAdapter.LogLevel.FULL) .build(); serviceUpHttpFeed = HttpFeed.builder() .entity(this) .period(500, TimeUnit.MILLISECONDS) .baseUri(ambariUri) .poll(new HttpPollConfig<Boolean>(URL_REACHABLE) .onSuccess(HttpValueFunctions.responseCodeEquals(200)) .onFailureOrException(Functions.constant(false))) .build(); enrichers().add(Enrichers.builder().updatingMap(Attributes.SERVICE_NOT_UP_INDICATORS) .from(URL_REACHABLE) .computing(Functionals.ifNotEquals(true).value("URL not reachable")) .build()); connectAuthenticatedSensors(); }
Source:
public void testUpdateResourceUnit() { ResourcePoolsBuilder existingPoolsBuilder = ResourcePoolsBuilder.newResourcePoolsBuilder(); existingPoolsBuilder = existingPoolsBuilder.heap(20L, EntryUnit.ENTRIES).disk(500, MemoryUnit.MB); ResourcePools existing = existingPoolsBuilder.build(); ResourcePoolsBuilder toBeUpdatedPoolsBuilder = ResourcePoolsBuilder.newResourcePoolsBuilder(); toBeUpdatedPoolsBuilder = toBeUpdatedPoolsBuilder.disk(2, MemoryUnit.GB); ResourcePools toBeUpdated = toBeUpdatedPoolsBuilder.build(); ResourcePoolMerger merger = new ResourcePoolMerger(); try { existing = merger.validateAndMerge(existing, toBeUpdated); } catch (UnsupportedOperationException uoe) { assertThat(uoe.getMessage(), is("Updating resources with MemoryUnit as unit of measure is not supported")); } assertThat(existing.getPoolForResource(ResourceType.Core.DISK).getSize(), is(500L)); assertThat(existing.getPoolForResource(ResourceType.Core.DISK).getUnit(), Matchers.<ResourceUnit>is(MemoryUnit.MB)); }

Target:
public void testUpdateResourceUnit() { ResourcePoolsBuilder existingPoolsBuilder = ResourcePoolsBuilder.newResourcePoolsBuilder(); existingPoolsBuilder = existingPoolsBuilder.heap(20L, EntryUnit.ENTRIES).disk(500L, EntryUnit.ENTRIES); ResourcePools existing = existingPoolsBuilder.build(); ResourcePoolsBuilder toBeUpdatedPoolsBuilder = ResourcePoolsBuilder.newResourcePoolsBuilder(); toBeUpdatedPoolsBuilder = toBeUpdatedPoolsBuilder.disk(2, MemoryUnit.GB); ResourcePools toBeUpdated = toBeUpdatedPoolsBuilder.build(); ResourcePoolMerger merger = new ResourcePoolMerger(); try { existing = merger.validateAndMerge(existing, toBeUpdated); } catch (UnsupportedOperationException uoe) { assertThat(uoe.getMessage(), is("Updating ResourceUnit is not supported")); } assertThat(existing.getPoolForResource(ResourceType.Core.DISK).getSize(), is(500L)); assertThat(existing.getPoolForResource(ResourceType.Core.DISK).getUnit(), Matchers.<ResourceUnit>is(EntryUnit.ENTRIES)); }
Source:
public void setMessage(Message msg) { Message oldMessage = this.message; this.message = msg; for (Entry<String, HttpPanelComponentInterface> stringHttpPanelComponentInterfaceEntry : components.entrySet()) { HttpPanelComponentInterface component = stringHttpPanelComponentInterfaceEntry.getValue(); if (!component.isEnabled(message)) { if (enabledComponents.contains(component)) { disableComponent(component); } } else if (!enabledComponents.contains(component)) { enableComponent(component); } } if (enabledComponents.size() == 0) { currentComponent = null; switchEmptyComponent(); notifyDisplayedMessageChangedListeners(oldMessage, message); return; } boolean switchView = true; if (currentComponent != null && enabledComponents.contains(components.get(currentComponent.getName()))) { switchView = false; } this.validate(); if (switchView) { switchComponent(enabledComponents.get(0).getName()); } else { updateContent(); } notifyDisplayedMessageChangedListeners(oldMessage, message); }

Target:
public void setMessage(Message msg) { Message oldMessage = this.message; this.message = msg; for (HttpPanelComponentInterface component : components.values()) { if (!component.isEnabled(message)) { if (enabledComponents.contains(component)) { disableComponent(component); } } else if (!enabledComponents.contains(component)) { enableComponent(component); } } if (enabledComponents.size() == 0) { currentComponent = null; switchEmptyComponent(); notifyDisplayedMessageChangedListeners(oldMessage, message); return; } boolean switchView = true; if (currentComponent != null && enabledComponents.contains(components.get(currentComponent.getName()))) { switchView = false; } this.validate(); if (switchView) { switchComponent(enabledComponents.get(0).getName()); } else { updateContent(); } notifyDisplayedMessageChangedListeners(oldMessage, message); }
Source:
public static InsightType fromString(final String text) { if (text != null) { for (final InsightType insightType : InsightType.values()) { if (text.equalsIgnoreCase(insightType.toString())) return insightType; } } throw new IllegalArgumentException("Illegal InsightType string"); }

Target:
public static Category fromString(final String text) { if (text != null) { for (final Category category : Category.values()) { if (text.equalsIgnoreCase(category.toString())) return category; } } throw new IllegalArgumentException("Invalid Category string"); }
Source:
void shouldBeBreakpointIfIgnoreRulesMatchButNotEnable(boolean request) { Message message = mock(Message.class); given(message.isInScope()).willReturn(true); given(breakpointManagementInterface.isBreakRequest()).willReturn(true); given(breakpointManagementInterface.isBreakResponse()).willReturn(true); BreakpointMessageInterface skipBreakpoint = mock(BreakpointMessageInterface.class); given(skipBreakpoint.isEnabled()).willReturn(false); given(skipBreakpoint.match(message, request, false)).willReturn(true); List<BreakpointMessageInterface> x = new ArrayList<>(); x.add(skipBreakpoint); breakpointMessageHandler.setEnabledIgnoreRules(x); boolean breakpoint = breakpointMessageHandler.isBreakpoint(message, request, false); assertThat(breakpoint, is(equalTo(true))); }

Target:
void shouldBeBreakpointIfIgnoreRulesMatchButNotEnable(boolean request) { Message message = mock(Message.class); given(message.isInScope()).willReturn(true); given(breakpointManagementInterface.isBreakRequest()).willReturn(true); given(breakpointManagementInterface.isBreakResponse()).willReturn(true); BreakpointMessageInterface skipBreakpoint = mock(BreakpointMessageInterface.class); given(skipBreakpoint.isEnabled()).willReturn(false); given(skipBreakpoint.match(message, request, false)).willReturn(true); List<BreakpointMessageInterface> ignoreRules = Arrays.asList(skipBreakpoint); breakpointMessageHandler.setEnabledIgnoreRules(ignoreRules); boolean breakpoint = breakpointMessageHandler.isBreakpoint(message, request, false); assertThat(breakpoint, is(equalTo(true))); }
Source:
public static void main(String[] args) throws Exception { String projectId = requiredProperty("bigtable.projectID"); String instanceId = requiredProperty("bigtable.instanceID"); String table = System.getProperty("bigtable.table", "ManyThreadDriver"); recordCount = Long.parseLong(System.getProperty("recordCount", "100000")); valueSize = Integer.parseInt(System.getProperty("valueSize", "1024")); runtimeInHour = Integer.parseInt(System.getProperty("runtimeInHour", "1")); numThreads = Integer.parseInt(System.getProperty("numThreads", "1000")); runTest(projectId, instanceId, table); }

Target:
public static void main(String[] args) throws Exception { String projectId = requiredProperty("bigtable.projectID"); String instanceId = requiredProperty("bigtable.instanceID"); String table = System.getProperty("bigtable.table", "ManyThreadDriver"); recordCount = Long.parseLong(System.getProperty("recordCount", "100000")); valueSize = Integer.parseInt(System.getProperty("valueSize", "1024")); runtimeHours = Integer.parseInt(System.getProperty("runtimeHours", "1")); numThreads = Integer.parseInt(System.getProperty("numThreads", "1000")); runTest(projectId, instanceId, table); }
Source:
<F extends BaseBean> JSONArray addObjectRelation(List<F> objects) { JSONArray jsonArray = new JSONArray(); if (objects != null && objects.size() > 0) { for (F property : objects) { jsonArray.add(addIdForRelation(property.getId())); } } return jsonArray; }

Target:
<F extends BaseBean> JSONArray addObjectRelation(List<F> objects) { JSONArray jsonArray = new JSONArray(); if (objects != null) { for (F property : objects) { jsonArray.add(addIdForRelation(property.getId())); } } return jsonArray; }
Source:
private IndexValue markAsUndeleted(StoreKey id, FileSpan fileSpan, MessageInfo info, long operationTimeMs, short lifeVersion) throws StoreException { boolean hasLifeVersion = lifeVersion > (short) -1; validateFileSpan(fileSpan, true); IndexValue value = findKey(id); if (value == null) { throw new StoreException("Id " + id + " not present in index " + dataDir, StoreErrorCodes.ID_Not_Found); } else if (value != null) { if (hasLifeVersion) { if (value.getLifeVersion() >= lifeVersion) { throw new StoreException("LifeVersion conflict in index. Id " + id + " LifeVersion: " + value.getLifeVersion() + " Undelete LifeVersion: " + lifeVersion, StoreErrorCodes.Life_Version_Conflict); } } else { lifeVersion = (short) (value.getLifeVersion() + 1); if (!value.isFlagSet(IndexValue.Flags.Delete_Index)) { throw new StoreException("Id " + id + " not deleted in index " + dataDir, StoreErrorCodes.ID_Not_Deleted); } } } long size = fileSpan.getEndOffset().getOffset() - fileSpan.getStartOffset().getOffset(); IndexValue newValue; newValue = new IndexValue(value.getSize(), value.getOffset(), value.getFlags(), value.getExpiresAtMs(), operationTimeMs, value.getAccountId(), value.getContainerId(), lifeVersion); newValue.setNewOffset(fileSpan.getStartOffset()); newValue.setNewSize(size); newValue.setFlag(IndexValue.Flags.Undelete_Index); addToIndex(new IndexEntry(id, newValue, null), fileSpan); return newValue; }

Target:
private IndexValue markAsUndeleted(StoreKey id, FileSpan fileSpan, MessageInfo info, long operationTimeMs, short lifeVersion) throws StoreException { boolean hasLifeVersion = lifeVersion > (short) -1; validateFileSpan(fileSpan, true); IndexValue value = findKey(id); if (value == null) { throw new StoreException("Id " + id + " not present in index " + dataDir, StoreErrorCodes.ID_Not_Found); } else if (value != null) { if (hasLifeVersion) { if (value.getLifeVersion() >= lifeVersion) { throw new StoreException("LifeVersion conflict in index. Id " + id + " LifeVersion: " + value.getLifeVersion() + " Undelete LifeVersion: " + lifeVersion, StoreErrorCodes.Life_Version_Conflict); } } else { lifeVersion = (short) (value.getLifeVersion() + 1); if (!value.isFlagSet(IndexValue.Flags.Delete_Index)) { throw new StoreException("Id " + id + " not deleted in index " + dataDir, StoreErrorCodes.ID_Not_Deleted); } } } long size = fileSpan.getEndOffset().getOffset() - fileSpan.getStartOffset().getOffset(); IndexValue newValue; newValue = new IndexValue(value.getSize(), value.getOffset(), value.getFlags(), value.getExpiresAtMs(), operationTimeMs, value.getAccountId(), value.getContainerId(), lifeVersion); newValue.setNewOffset(fileSpan.getStartOffset()); newValue.setNewSize(size); newValue.setFlag(IndexValue.Flags.Undelete_Index); newValue.clearFlag(IndexValue.Flags.Delete_Index); addToIndex(new IndexEntry(id, newValue, null), fileSpan); return newValue; }
Source:
public String getMethodName() { return "put"; }

Target:
public String getMethodName() { return "putTransient"; }
Source:
protected ActionResult execute() throws EntityDoesNotExistException { String courseId = getRequestParamValue(Const.ParamsNames.COURSE_ID); Assumption.assertNotNull(courseId); String feedbackSessionName = getRequestParamValue(Const.ParamsNames.FEEDBACK_SESSION_NAME); Assumption.assertNotNull(feedbackSessionName); FeedbackSessionStatsPageData data = new FeedbackSessionStatsPageData(account); FeedbackSessionAttributes fsa = logic.getFeedbackSession(feedbackSessionName, courseId); InstructorAttributes instructor = logic.getInstructorForGoogleId(courseId, account.googleId); new GateKeeper().verifyAccessible( instructor, fsa, false); data.sessionDetails = logic.getFeedbackSessionDetails(feedbackSessionName, courseId); statusToAdmin = "Load feedback session details:<br>" + "Session name: " + feedbackSessionName; return createAjaxResult(data); }

Target:
protected ActionResult execute() throws EntityDoesNotExistException { String courseId = getRequestParamValue(Const.ParamsNames.COURSE_ID); Assumption.assertNotNull(courseId); String feedbackSessionName = getRequestParamValue(Const.ParamsNames.FEEDBACK_SESSION_NAME); Assumption.assertNotNull(feedbackSessionName); FeedbackSessionStatsPageData data = new FeedbackSessionStatsPageData(account); FeedbackSessionAttributes fsa = logic.getFeedbackSession(feedbackSessionName, courseId); InstructorAttributes instructor = logic.getInstructorForGoogleId(courseId, account.googleId); new GateKeeper().verifyAccessible( instructor, fsa, false); data.sessionDetails = logic.getFeedbackSessionDetails(feedbackSessionName, courseId); return createAjaxResult(data); }
Source:
public String getError() { return "The entry's parent tombstoned"; }

Target:
public String getError() { return "The entry in the metastore database has a parent entry " + "which is a tombstone marker"; }
Source:
public boolean isMaskFormatValid(String mask) { return mask != null && mask.matches(ValidationUtils.NETMASK_PATTERN); }

Target:
public boolean isMaskFormatValid(String mask) { return mask != null && mask.matches(ValidationUtils.NETMASK_PATTERN + "|" + ValidationUtils.SUBNET_PATTERN_AS_NETMASK_WITH_OPTIONAL_PREFIX_SLASH); }
Source:
public final int getRefCount() { return refs == null ? 0 : refs.length; }

Target:
public final int getRefCount() { return refs.length; }
Source:
public void optInMercury() { MercuryContent.turnOnMercurySkin(driver, MercuryContent.MERCURY_WIKI); }

Target:
public void optInMercury() { MercuryContent.turnOnMercurySkin(driver, wikiURL); }
Source:
protected void clientInit() { configuration.setApi(getApi()); configuration.setProfileDefinition(new TwitterProfileDefinition()); configuration.setHasBeenCancelledFactory(ctx -> { final Optional<String> denied = ctx.getRequestParameter("denied"); if (CommonHelper.isNotBlank(denied.orElse(null))) { return true; } else { return false; } }); defaultLogoutActionBuilder((ctx, profile, targetUrl) -> Optional.of(RedirectAction.redirect("<LINK_0>"))); super.clientInit(); }

Target:
protected void clientInit() { configuration.setApi(getApi()); configuration.setProfileDefinition(new TwitterProfileDefinition()); configuration.setHasBeenCancelledFactory(ctx -> { final Optional<String> denied = ctx.getRequestParameter("denied"); return denied.map(d -> CommonHelper.isNotBlank(d)).orElse(false); }); defaultLogoutActionBuilder((ctx, profile, targetUrl) -> Optional.of(RedirectAction.redirect("<LINK_0>"))); super.clientInit(); }
Source:
public boolean canHandle(Resource resource, ResourceStrategyType resourceStrategyType) { boolean canHandle = false; switch (resourceStrategyType) { case UNLOAD_AT_RESOURCESET_DISPOSE: if (resource != null) { canHandle = resource.getResourceSet().getPackageRegistry().getEPackage(resource.getURI().toString()) != null; } break; default: break; } return canHandle; }

Target:
public boolean canHandle(Resource resource, ResourceStrategyType resourceStrategyType) { boolean canHandle = false; switch (resourceStrategyType) { case UNLOAD_AT_RESOURCESET_DISPOSE: if (resource != null) { List<EObject> contents = resource.getContents(); if (contents.size() > 0 && contents.get(0) instanceof EPackage) { EPackage pack = (EPackage) contents.get(0); canHandle = resource.getResourceSet().getPackageRegistry().getEPackage(pack.getNsURI()) != null; } } break; default: break; } return canHandle; }
Source:
protected void executeVmCommand() { Guid createdSnapshotId = getSnapshotDao().getId(getVmId(), SnapshotType.ACTIVE); getParameters().setSnapshotType(determineSnapshotType()); getSnapshotDao().updateId(createdSnapshotId, newActiveSnapshotId); setActionReturnValue(createdSnapshotId); MemoryImageBuilder memoryImageBuilder = getMemoryImageBuilder(); addSnapshotToDB(createdSnapshotId, memoryImageBuilder); createSnapshotsForDisks(); fastForwardDisksToActiveSnapshot(); memoryImageBuilder.build(); boolean pendingAsyncTasks = !getReturnValue().getVdsmTaskIdList().isEmpty() || !CommandCoordinatorUtil.getChildCommandIds(getCommandId()).isEmpty(); if (!pendingAsyncTasks) { getParameters().setTaskGroupSuccess(true); incrementVmGeneration(); } setSucceeded(true); }

Target:
protected void executeVmCommand() { Guid createdSnapshotId = getSnapshotDao().getId(getVmId(), SnapshotType.ACTIVE); getParameters().setSnapshotType(determineSnapshotType()); getSnapshotDao().updateId(createdSnapshotId, newActiveSnapshotId); setActionReturnValue(createdSnapshotId); MemoryImageBuilder memoryImageBuilder = getMemoryImageBuilder(); addSnapshotToDB(createdSnapshotId, memoryImageBuilder); createSnapshotsForDisks(); fastForwardDisksToActiveSnapshot(); memoryImageBuilder.build(); boolean pendingAsyncTasks = !getTaskIdList().isEmpty() || !CommandCoordinatorUtil.getChildCommandIds(getCommandId()).isEmpty(); if (!pendingAsyncTasks) { getParameters().setTaskGroupSuccess(true); incrementVmGeneration(); } setSucceeded(true); }
Source:
public void registerChannelListener(final Map<String, Object> channelConfig, final ChannelListener listener) throws ConnectionException { try { TiSensorTag sensorTag = getSensorTag(SensorTagChannelDescriptor.getSensorTagAddress(channelConfig)); if (sensorTag.isConnected()) { SensorListener sensorListener = getSensorListener(sensorTag, SensorTagChannelDescriptor.getSensorName(channelConfig).toString().split("_")[0], SensorTagChannelDescriptor.getNotificationPeriod(channelConfig)); sensorListener.addChannelName((String) channelConfig.get("+name")); sensorListener.addDataType(DataType.getDataType((String) channelConfig.get("+value.type"))); sensorListener.addListener(listener); sensorListener.addSensorName(SensorTagChannelDescriptor.getSensorName(channelConfig)); registerNotification(sensorListener); } else { logger.info("Listener registration failed: TiSensorTag not connected"); } } catch (KuraBluetoothIOException | KuraBluetoothConnectionException e) { logger.error("Listener registration failed", e); } }

Target:
public void registerChannelListener(final Map<String, Object> channelConfig, final ChannelListener listener) throws ConnectionException { try { TiSensorTag sensorTag = getSensorTag(SensorTagChannelDescriptor.getSensorTagAddress(channelConfig)); if (sensorTag.isConnected()) { SensorListener sensorListener = getSensorListener(sensorTag, SensorTagChannelDescriptor.getSensorName(channelConfig).toString().split("_")[0], SensorTagChannelDescriptor.getNotificationPeriod(channelConfig)); sensorListener.addChannelName((String) channelConfig.get("+name")); sensorListener.addDataType(DataType.getDataType((String) channelConfig.get("+value.type"))); sensorListener.addListener(listener); sensorListener.addSensorName(SensorTagChannelDescriptor.getSensorName(channelConfig)); registerNotification(sensorListener); } else { logger.warn("Listener registration failed: TiSensorTag not connected"); } } catch (KuraBluetoothIOException | ConnectionException e) { logger.error("Listener registration failed", e); } }
Source:
public void createOrUpdateUser() throws Exception { createClientWithTokenOrPassword(); String name = "testCreateOrUpdateUser"; String externalId = "testCreateOrUpdateUser"; for (User u : instance.getUsers()) { if (externalId.equals(u.getExternalId())) { instance.deleteUser(u.getId()); } } String phoneAtCreation = "5555551234"; User user = new User(true, name); user.setExternalId(externalId); user.setPhone(phoneAtCreation); User createResult = instance.createOrUpdateUser(user); assertNotNull(createResult); assertNotNull(createResult.getId()); assertEquals(name, createResult.getName()); assertEquals(externalId, createResult.getExternalId()); assertEquals(phoneAtCreation, createResult.getPhone()); String phoneAtUpdate = "5555551235"; User updateUser = new User(true, name); updateUser.setId(createResult.getId()); updateUser.setExternalId(externalId); updateUser.setPhone(phoneAtUpdate); User updateResult = instance.createOrUpdateUser(updateUser); assertNotNull(updateResult); assertEquals(createResult.getId(), updateResult.getId()); assertEquals(name, updateResult.getName()); assertEquals(externalId, updateResult.getExternalId()); assertEquals(phoneAtUpdate, updateResult.getPhone()); instance.deleteUser(updateResult); }

Target:
public void createOrUpdateUser() throws Exception { createClientWithTokenOrPassword(); String name = "testCreateOrUpdateUser"; String externalId = "testCreateOrUpdateUser"; for (User u: instance.lookupUserByExternalId(externalId)){ instance.deleteUser(u.getId()); } String phoneAtCreation = "5555551234"; User user = new User(true, name); user.setExternalId(externalId); user.setPhone(phoneAtCreation); User createResult = instance.createOrUpdateUser(user); assertNotNull(createResult); assertNotNull(createResult.getId()); assertEquals(name, createResult.getName()); assertEquals(externalId, createResult.getExternalId()); assertEquals(phoneAtCreation, createResult.getPhone()); String phoneAtUpdate = "5555551235"; User updateUser = new User(true, name); updateUser.setId(createResult.getId()); updateUser.setExternalId(externalId); updateUser.setPhone(phoneAtUpdate); User updateResult = instance.createOrUpdateUser(updateUser); assertNotNull(updateResult); assertEquals(createResult.getId(), updateResult.getId()); assertEquals(name, updateResult.getName()); assertEquals(externalId, updateResult.getExternalId()); assertEquals(phoneAtUpdate, updateResult.getPhone()); instance.deleteUser(updateResult); }
Source:
public boolean checkAndNotify() { AsyncFileAlterationListener listenerCopy; synchronized (processingLock) { if (processing.get() != 0) { LOGGER.debug( "{} files are still processing. Waiting until the list is empty", processing.get()); return false; } else if (isProcessing) { LOGGER.debug("Another thread is currently running, returning until next poll"); return false; } isProcessing = true; synchronized (listenerLock) { if (listener == null) { isProcessing = false; return false; } listenerCopy = listener; } } if (rootFile.checkNetwork()) { checkAndNotify(rootFile, rootFile.getChildren(), listFiles(rootFile.getFile()), listenerCopy); } else { LOGGER.debug( "The monitored file does not exist. No file fileLocks will be done through the CDM", rootFile.getName()); } isProcessing = false; return true; }

Target:
public boolean checkAndNotify() { AsyncFileAlterationListener listenerCopy; synchronized (processingLock) { if (processing.get() != 0) { LOGGER.debug( "{} files are still processing. Waiting until the list is empty", processing.get()); return false; } else if (isProcessing) { LOGGER.debug("Another thread is currently running, returning until next poll"); return false; } isProcessing = true; synchronized (listenerLock) { if (listener == null) { isProcessing = false; return false; } listenerCopy = listener; } } if (rootFile.checkNetwork()) { checkAndNotify(rootFile, rootFile.getChildren(), listFiles(rootFile.getFile()), listenerCopy); } else { LOGGER.debug( "The monitored file does not exist. No file fileLocks will be done through the CDM", rootFile.getName()); } synchronized (processingLock) { isProcessing = false; } return true; }
Source:
public void initTrace(final IResource resource, final String path, final Class<? extends ITmfEvent> eventType) throws TmfTraceException { setCacheSize(); super.initTrace(resource, path, eventType); try { this.fTrace = new CTFTrace(path); CtfIteratorManager.addTrace(this); CtfTmfContext ctx; ctx = (CtfTmfContext) seekEvent(0L); CtfTmfEvent event = getNext(ctx); if ((ctx.getLocation().equals(CtfIterator.NULL_LOCATION)) || (ctx.getCurrentEvent() == null)) { this.setStartTime(TmfTimestamp.BIG_BANG); } else { final ITmfTimestamp curTime = event.getTimestamp(); this.setStartTime(curTime); this.setEndTime(curTime); } CtfIterator iter = CtfIteratorManager.getIterator(this, ctx); for (IEventDeclaration ied : iter.getEventDeclarations()) { CtfTmfEventType ctfTmfEventType = CtfTmfEventType.get(this, ied.getName()); if (ctfTmfEventType == null) { List<ITmfEventField> content = new ArrayList<>(); for (String fieldName : ied.getFields().getFieldsList()) { content.add(new TmfEventField(fieldName, null, null)); } ITmfEventField contentTree = new TmfEventField(ITmfEventField.ROOT_FIELD_ID, null, content.toArray(new ITmfEventField[content.size()])); ctfTmfEventType = new CtfTmfEventType(ied.getName(), this, contentTree); } } } catch (final CTFReaderException e) { throw new TmfTraceException(e.getMessage(), e); } }

Target:
public void initTrace(final IResource resource, final String path, final Class<? extends ITmfEvent> eventType) throws TmfTraceException { setCacheSize(); super.initTrace(resource, path, eventType); try { this.fTrace = new CTFTrace(path); CtfIteratorManager.addTrace(this); CtfTmfContext ctx; ctx = (CtfTmfContext) seekEvent(0L); CtfTmfEvent event = getNext(ctx); if ((ctx.getLocation().equals(CtfIterator.NULL_LOCATION)) || (ctx.getCurrentEvent() == null)) { this.setStartTime(TmfTimestamp.BIG_BANG); } else { final ITmfTimestamp curTime = event.getTimestamp(); this.setStartTime(curTime); this.setEndTime(curTime); } try (CtfIterator iter = CtfIteratorManager.getIterator(this, ctx)) { for (IEventDeclaration ied : iter.getEventDeclarations()) { CtfTmfEventType ctfTmfEventType = CtfTmfEventType.get(this, ied.getName()); if (ctfTmfEventType == null) { List<ITmfEventField> content = new ArrayList<>(); for (String fieldName : ied.getFields().getFieldsList()) { content.add(new TmfEventField(fieldName, null, null)); } ITmfEventField contentTree = new TmfEventField( ITmfEventField.ROOT_FIELD_ID, null, content.toArray(new ITmfEventField[content.size()]) ); ctfTmfEventType = new CtfTmfEventType(ied.getName(), this, contentTree); } } } } catch (final CTFReaderException e) { throw new TmfTraceException(e.getMessage(), e); } }
Source:
public void testCreateOrReplaceGenericResource() { ConfigMap configMap = new ConfigMapBuilder() .withNewMetadata().withName("resource-cm-1").endMetadata() .addToData("a1", "A1") .addToData("a2", "A2") .build(); ConfigMap createdResource = client.resource(configMap).inNamespace(session.getNamespace()).createOrReplace(); configMap.setData(Collections.singletonMap("b1", "B1")); ConfigMap replacedResource = client.resource(configMap).inNamespace(session.getNamespace()).createOrReplace(); assertNotNull(createdResource); assertEquals(2, createdResource.getData().size()); assertEquals("A1", createdResource.getData().get("a1")); assertEquals("A2", createdResource.getData().get("a2")); assertNotNull(replacedResource); assertEquals(1, replacedResource.getData().size()); assertEquals("B1", replacedResource.getData().get("b1")); client.resource(configMap).inNamespace(session.getNamespace()).delete(); }

Target:
public void testCreateOrReplaceGenericResource() { ConfigMap configMap = new ConfigMapBuilder() .withNewMetadata().withName("resource-cm-1").endMetadata() .addToData("a1", "A1") .addToData("a2", "A2") .build(); ConfigMap createdResource = client.resource(configMap).inNamespace(session.getNamespace()).createOrReplace(); configMap.setData(Collections.singletonMap("b1", "B1")); this.resource = client.resource(configMap).inNamespace(session.getNamespace()).createOrReplace(); assertNotNull(createdResource); assertEquals(2, createdResource.getData().size()); assertEquals("A1", createdResource.getData().get("a1")); assertEquals("A2", createdResource.getData().get("a2")); ConfigMap replacedResource = (ConfigMap) this.resource; assertNotNull(replacedResource); assertEquals(1, replacedResource.getData().size()); assertEquals("B1", replacedResource.getData().get("b1")); }
Source:
public SQLiteDatabase getReadableDatabase() { SQLiteDatabase db = readableDatabase; if (db == null) { synchronized (databaseLock) { db = readableDatabase; if (db == null) { if (logging) log("Creating readable database"); db = readableDatabase = helper.getReadableDatabase(); } } } return db; }

Target:
public SQLiteDatabase getReadableDatabase() { return helper.getReadableDatabase(); }
Source:
protected void connect() throws IOException { mbeanServerConn = null; jmxc = null; ssProxy = StorageService.instance; msProxy = MessagingService.instance(); streamProxy = StreamManager.instance; compactionProxy = CompactionManager.instance; fdProxy = (FailureDetectorMBean) FailureDetector.instance; cacheService = CacheService.instance; spProxy = StorageProxy.instance; hhProxy = HintedHandOffManager.instance; gcProxy = new GCInspector(); gossProxy = Gossiper.instance; memProxy = ManagementFactory.getMemoryMXBean(); runtimeProxy = ManagementFactory.getRuntimeMXBean(); }

Target:
protected void connect() { mbeanServerConn = null; jmxc = null; ssProxy = StorageService.instance; msProxy = MessagingService.instance(); streamProxy = StreamManager.instance; compactionProxy = CompactionManager.instance; fdProxy = (FailureDetectorMBean) FailureDetector.instance; cacheService = CacheService.instance; spProxy = StorageProxy.instance; hhProxy = HintedHandOffManager.instance; gcProxy = new GCInspector(); gossProxy = Gossiper.instance; memProxy = ManagementFactory.getMemoryMXBean(); runtimeProxy = ManagementFactory.getRuntimeMXBean(); }
Source:
protected ListenableFuture<Empty> deleteTableAsyncInternal(TableName tableName) throws IOException { Builder deleteBuilder = DeleteTableRequest.newBuilder(); deleteBuilder.setName(toBigtableName(tableName)); try { return bigtableTableAdminClient.deleteTableAsync(deleteBuilder.build()); } catch (Throwable throwable) { throw new IOException(String.format("Failed to delete table '%s'", tableName.getNameAsString()), throwable); } }

Target:
protected CompletableFuture<Void> deleteTableAsyncInternal(TableName tableName) { DeleteTableRequest deleteTableRequest = DeleteTableRequest.newBuilder() .setName(toBigtableName(tableName)) .build(); return FutureUtils.toCompletableFuture( bigtableTableAdminClient.deleteTableAsync(deleteTableRequest)) .thenApply(r -> null); }
Source:
private String pendingQueueKey(SingularityPendingRequest pendingRequest) { SingularityDeployKey deployKey = new SingularityDeployKey(pendingRequest.getRequestId(), pendingRequest.getDeployId()); return String.format("%s%s", deployKey.toString(), pendingRequest.getTimestamp()); }

Target:
private String pendingQueueKey(SingularityPendingRequest pendingRequest) { SingularityDeployKey deployKey = new SingularityDeployKey(pendingRequest.getRequestId(), pendingRequest.getDeployId()); if (pendingRequest.getPendingType() == PendingType.ONEOFF || pendingRequest.getPendingType() == PendingType.IMMEDIATE) { return String.format("%s%s", deployKey.toString(), pendingRequest.getTimestamp()); } else { return deployKey.toString(); } }
Source:
public IOseeBranch adapt(Attribute<?> attribute, Identity<String> identity) throws OseeCoreException { String uuid = identity.getGuid(); return uuid.matches("^\\d+$") ? BranchManager.getBranchByUuid(Long.valueOf(uuid)) : null; }

Target:
public IOseeBranch adapt(Attribute<?> attribute, Identity<String> identity) throws OseeCoreException { String uuid = identity.getGuid(); return Strings.isNumeric(uuid) ? BranchManager.getBranchByUuid(Long.valueOf(uuid)) : null; }
Source:
private void startReconstruct() { StorageDomainStatic masterDomain = null; List<StorageDomainStatic> storageDomainStaticList = DbFacade.getInstance() .getStorageDomainStaticDao().getAllForStoragePool(getParameters().getStoragePoolId()); for (StorageDomainStatic storageDomainStatic : storageDomainStaticList) { if (storageDomainStatic.getStorageDomainType() == StorageDomainType.Master) { masterDomain = storageDomainStatic; break; } } if (masterDomain != null) { final Guid masterDomainId = masterDomain.getId(); eventQueue.submitEventAsync(new Event(getParameters().getStoragePoolId(), masterDomainId, null, EventType.RECONSTRUCT, "IrsBrokerCommand.startReconstruct()"), () -> resourceManager.getEventListener().masterDomainNotOperational( masterDomainId, getParameters().getStoragePoolId(), true, getVDSReturnValue().getVdsError() != null && getVDSReturnValue().getVdsError().getCode() == EngineError.StoragePoolWrongMaster)); } else { log.error( "IrsBroker::IRSNoMasterDomainException:: Could not find master domain for pool '{}'", getParameters().getStoragePoolId()); } }

Target:
private void startReconstruct() { StorageDomainStatic masterDomain = null; List<StorageDomainStatic> storageDomainStaticList = DbFacade.getInstance() .getStorageDomainStaticDao().getAllForStoragePool(getParameters().getStoragePoolId()); for (StorageDomainStatic storageDomainStatic : storageDomainStaticList) { if (storageDomainStatic.getStorageDomainType() == StorageDomainType.Master) { masterDomain = storageDomainStatic; break; } } if (masterDomain != null) { final Guid masterDomainId = masterDomain.getId(); eventQueue.submitEventAsync(new Event(getParameters().getStoragePoolId(), masterDomainId, null, EventType.RECONSTRUCT, "IrsBrokerCommand.startReconstruct()"), () -> eventListener.masterDomainNotOperational( masterDomainId, getParameters().getStoragePoolId(), true, getVDSReturnValue().getVdsError() != null && getVDSReturnValue().getVdsError().getCode() == EngineError.StoragePoolWrongMaster)); } else { log.error( "IrsBroker::IRSNoMasterDomainException:: Could not find master domain for pool '{}'", getParameters().getStoragePoolId()); } }
Source:
public LinkedFileViewModel(LinkedFile linkedFile, BibEntry entry, BibDatabaseContext databaseContext, TaskExecutor taskExecutor, DialogService dialogService, XmpPreferences xmpPreferences, FilePreferences filePreferences, ExternalFileTypes externalFileTypes) { this.linkedFile = linkedFile; this.filePreferences = filePreferences; this.linkedFileHandler = new LinkedFileHandler(linkedFile, entry, databaseContext, filePreferences); this.databaseContext = databaseContext; this.entry = entry; this.dialogService = dialogService; this.taskExecutor = taskExecutor; this.externalFileTypes = externalFileTypes; this.xmpPreferences = xmpPreferences; fileExistsValidator = new FunctionBasedValidator<>( linkedFile.linkProperty(), link -> { Optional<Path> path = FileHelper.expandFilename(databaseContext, link, filePreferences); return path.isPresent() && Files.exists(path.get()); }, ValidationMessage.warning(Localization.lang("Could not find file '%0'.", linkedFile.getLink()))); downloadOngoing.bind(downloadProgress.greaterThanOrEqualTo(0).and(downloadProgress.lessThan(1))); canWriteXMPMetadata.setValue(!linkedFile.isOnlineLink() && linkedFile.getFileType().equalsIgnoreCase("pdf")); }

Target:
public LinkedFileViewModel(LinkedFile linkedFile, BibEntry entry, BibDatabaseContext databaseContext, TaskExecutor taskExecutor, DialogService dialogService, XmpPreferences xmpPreferences, FilePreferences filePreferences, ExternalFileTypes externalFileTypes) { this.linkedFile = linkedFile; this.filePreferences = filePreferences; this.linkedFileHandler = new LinkedFileHandler(linkedFile, entry, databaseContext, filePreferences); this.databaseContext = databaseContext; this.entry = entry; this.dialogService = dialogService; this.taskExecutor = taskExecutor; this.externalFileTypes = externalFileTypes; this.xmpPreferences = xmpPreferences; fileExistsValidator = new FunctionBasedValidator<>( linkedFile.linkProperty(), link -> { if (linkedFile.isOnlineLink()) { return true; } else { Optional<Path> path = FileHelper.expandFilename(databaseContext, link, filePreferences); return path.isPresent() && Files.exists(path.get()); } }, ValidationMessage.warning(Localization.lang("Could not find file '%0'.", linkedFile.getLink()))); downloadOngoing.bind(downloadProgress.greaterThanOrEqualTo(0).and(downloadProgress.lessThan(1))); canWriteXMPMetadata.setValue(!linkedFile.isOnlineLink() && linkedFile.getFileType().equalsIgnoreCase("pdf")); }
Source:
private void remove() { if (getWindow() != null) { return; } RemoveStorageModel model = new RemoveStorageModel(); setWindow(model); model.setTitle(ConstantsManager.getInstance().getConstants().removeStoragesTitle()); model.setHelpTag(HelpTag.remove_storage); model.setHashName("remove_storage"); StorageDomain storage = getSelectedItem(); boolean localFsOnly = storage.getStorageType() == StorageType.LOCALFS; AsyncDataProvider.getInstance().getHostsForStorageOperation(new AsyncQuery(new Object[]{this, model}, new INewAsyncCallback() { @Override public void onSuccess(Object target, Object returnValue) { Object[] array = (Object[]) target; StorageListModel storageListModel = (StorageListModel) array[0]; RemoveStorageModel removeStorageModel = (RemoveStorageModel) array[1]; List<VDS> hosts = (List<VDS>) returnValue; removeStorageModel.getHostList().setItems(hosts); removeStorageModel.getHostList().setSelectedItem(Linq.firstOrDefault(hosts)); removeStorageModel.getFormat().setEntity(false); if (hosts.isEmpty()) { UICommand tempVar = createCancelCommand("Cancel"); tempVar.setIsDefault(true); removeStorageModel.getCommands().add(tempVar); } else { UICommand command; command = UICommand.createDefaultOkUiCommand("OnRemove", StorageListModel.this); removeStorageModel.getCommands().add(command); command = createCancelCommand("Cancel"); removeStorageModel.getCommands().add(command); } } }), null, localFsOnly); }

Target:
private void remove() { if (getWindow() != null) { return; } RemoveStorageModel model = new RemoveStorageModel(); setWindow(model); model.setTitle(ConstantsManager.getInstance().getConstants().removeStoragesTitle()); model.setHelpTag(HelpTag.remove_storage); model.setHashName("remove_storage"); StorageDomain storage = getSelectedItem(); boolean localFsOnly = storage.getStorageType() == StorageType.LOCALFS; AsyncDataProvider.getInstance().getHostsForStorageOperation(new AsyncQuery(new Object[]{this, model}, new INewAsyncCallback() { @Override public void onSuccess(Object target, Object returnValue) { Object[] array = (Object[]) target; RemoveStorageModel removeStorageModel = (RemoveStorageModel) array[1]; List<VDS> hosts = (List<VDS>) returnValue; removeStorageModel.getHostList().setItems(hosts); removeStorageModel.getHostList().setSelectedItem(Linq.firstOrDefault(hosts)); if (hosts.isEmpty()) { UICommand tempVar = createCancelCommand("Cancel"); tempVar.setIsDefault(true); removeStorageModel.getCommands().add(tempVar); } else { UICommand command; command = UICommand.createDefaultOkUiCommand("OnRemove", StorageListModel.this); removeStorageModel.getCommands().add(command); command = createCancelCommand("Cancel"); removeStorageModel.getCommands().add(command); } } }), null, localFsOnly); }
Source:
@Override public Object fromJson(JsonReader reader) throws IOException { Object result = delegate.fromJson(reader); if (result == null) { result = defaultIfNull; } return result; }

Target:
@Override public Object fromJson(JsonReader reader) throws IOException { Object result = delegate.fromJson(reader); if (result == null) { result = defaultIfNull(); } return result; }
Source:
public void run() { taskExecutor.execute(new Runnable() { @Override public void run() { int count = 0; while (initialized && (maxMessagesPerPoll <= 0 || count < maxMessagesPerPoll)) { try { if (!pollingTask.call()) { break; } count++; } catch (Exception e) { if (!Thread.interrupted()) { if (e instanceof RuntimeException) { throw (RuntimeException) e; } else { throw new MessageHandlingException(new ErrorMessage(e), e); } } else { if (logger.isDebugEnabled()) { logger.debug("The interruption error occurred during stop: " + e.getMessage()); } } } } } }); }

Target:
public void run() { taskExecutor.execute(new Runnable() { @Override public void run() { int count = 0; while (initialized && (maxMessagesPerPoll <= 0 || count < maxMessagesPerPoll)) { try { if (!pollingTask.call()) { break; } count++; } catch (Exception e) { if (e instanceof RuntimeException) { throw (RuntimeException) e; } else { throw new MessageHandlingException(new ErrorMessage(e), e); } } } } }); }
Source:
private void popAndRedirectMessageToStore(MessageProducer messageProducer, MessageConsumer messageConsumer) throws AxisFault { try { MessageContext messageContext = messageConsumer.receive(); messageProducer.storeMessage(messageContext); messageConsumer.ack(); } catch (SynapseException e) { handleException(log, "Failed to redirect the message : ", e); } }

Target:
private void popAndRedirectMessageToStore(MessageProducer messageProducer, MessageConsumer messageConsumer) throws AxisFault { try { MessageContext messageContext = messageConsumer.receive(); messageProducer.storeMessage(messageContext); messageConsumer.ack(); } catch (SynapseException e) { handleException(log, "Failed to redirect message. ", e); } }
Source:
private Long findFreeId(){ while(personRepository.findOne(lastId) != null){ lastId++; } return lastId; }

Target:
private Long findFreeId(){ while(personRepository.exists(lastId)){ lastId++; } return lastId; }
Source:
public void onResume() { super.onResume(); Helper.setOrientationAndOn(this); Intent intent = new Intent(this, StorageService.class); getApplicationContext().bindService(intent, mConnection, Context.BIND_AUTO_CREATE); mWebView.requestFocus(); mWebView.resumeTimers(); }

Target:
public void onResume() { super.onResume(); Helper.setOrientationAndOn(this); Intent intent = new Intent(this, StorageService.class); getApplicationContext().bindService(intent, mConnection, Context.BIND_AUTO_CREATE); mWebView.requestFocus(); }
Source:
public void test() { connect(); waitResponse(); click(jq(".z-groupbox-title")); waitResponse(); Assert.assertTrue(jq("@div").height() > 300); }

Target:
public void test() { connect(); waitResponse(); click(jq(".z-groupbox-title")); waitResponse(); Assert.assertEquals(jq(".z-groupbox-content").height(), jq("@div").height(), 3); }
Source:
public void addStitchPoint(float x, float y) { DSTStitchPoint point = new DSTStitchPoint(x, y); point.setColorChange(colorChangeBitSet); point.setJump(jumpBitSet); colorChangeBitSet = false; jumpBitSet = false; if (firstPoint) { firstPoint = false; header.initialize(x, y); point.setRelativeCoordinatesToPreviousPoint(x, y); } else { addInterpolatedPoints(x, y); header.update(x, y); PointF previousPoint = points.get(points.size() - 1).getPoint(); point.setRelativeCoordinatesToPreviousPoint(previousPoint.x, previousPoint.y); } points.add(point); }

Target:
public void addStitchPoint(float x, float y) { DSTStitchPoint point = new DSTStitchPoint(x, y); point.setColorChange(colorChangeBitSet); point.setJump(jumpBitSet); colorChangeBitSet = false; jumpBitSet = false; if (points.isEmpty()) { header.initialize(x, y); point.setRelativeCoordinatesToPreviousPoint(x, y); } else { addInterpolatedPoints(x, y); header.update(x, y); StitchPoint previousPoint = points.get(points.size() - 1); point.setRelativeCoordinatesToPreviousPoint(previousPoint.getX(), previousPoint.getY()); } points.add(point); }