auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void addDollarAmount(KualiDecimal amountToAdd) { <START> this.setDollarAmount(this.getDollarAmount().add(amountToAdd)); <END> }</code><technical_language>dollarAmount = dollarAmount.add(amountToAdd); work</technical_language>

Target:
public void addDollarAmount(KualiDecimal amountToAdd) { dollarAmount = dollarAmount.add(amountToAdd); }
Source:
<code>public void contextInitialized(final ServletContextEvent sce) { <START> configure(METRICS_REGISTRY); <END> super.contextInitialized(sce); initializeServices(); }</code><technical_language>is this do depend ServletContextEvent? moved constructor shutdownHooks unmodifiable</technical_language>

Target:
public void contextInitialized(final ServletContextEvent sce) { super.contextInitialized(sce); initializeServices(); }
Source:
<code><START> public void setKind(int kind) { <END> this.kind = kind; }</code><technical_language>Is necessary Token mutable? instead instantiate a new token need change kind</technical_language>

Target:
void setKind(int kind) { this.kind = kind; }
Source:
<code>private void populatePushNotificationConfig(PushNotificationProvider pushNotificationProvider) { if (pushNotificationProvider != null) { if (pushNotificationProvider.isFileBasedProperties()) { Map<String, String> staticProps = new HashMap<>(); if (pushNotificationProvider.getConfigProperties() != null && pushNotificationProvider.getConfigProperties().getProperty() != null && pushNotificationProvider.getConfigProperties().getProperty().size() > 0) { <START> for (Property property : pushNotificationProvider.getConfigProperties().getProperty()) { <END> staticProps.put(property.getName(), property.getValue()); } } pushNotificationConfig = new PushNotificationConfig(pushNotificationProvider.getType(), pushNotificationProvider.isScheduled(), staticProps); } else { try { PlatformConfiguration deviceTypeConfig = deviceManager.getConfiguration(); if (deviceTypeConfig != null) { List<ConfigurationEntry> configuration = deviceTypeConfig.getConfiguration(); if (configuration.size() > 0) { Map<String, String> properties = this.getConfigProperty(configuration); pushNotificationConfig = new PushNotificationConfig( pushNotificationProvider.getType(), pushNotificationProvider.isScheduled(), properties); } } } catch (DeviceManagementException e) { log.error("Unable to get the " + type + " platform configuration from registry."); } } } }</code><technical_language>move this pushNotificationProvider.getConfigProperties().getProperty() a variable? accessed times</technical_language>

Target:
private void populatePushNotificationConfig(PushNotificationProvider pushNotificationProvider) { if (pushNotificationProvider != null) { if (pushNotificationProvider.isFileBasedProperties()) { Map<String, String> staticProps = new HashMap<>(); ConfigProperties configProperties = pushNotificationProvider.getConfigProperties(); if (configProperties != null) { List<Property> properties = configProperties.getProperty(); if (properties != null && properties.size() > 0) { for (Property property : properties) { staticProps.put(property.getName(), property.getValue()); } } } pushNotificationConfig = new PushNotificationConfig(pushNotificationProvider.getType(), pushNotificationProvider.isScheduled(), staticProps); } else { try { PlatformConfiguration deviceTypeConfig = deviceManager.getConfiguration(); if (deviceTypeConfig != null) { List<ConfigurationEntry> configuration = deviceTypeConfig.getConfiguration(); if (configuration.size() > 0) { Map<String, String> properties = this.getConfigProperty(configuration); pushNotificationConfig = new PushNotificationConfig( pushNotificationProvider.getType(), pushNotificationProvider.isScheduled(), properties); } } } catch (DeviceManagementException e) { log.error("Unable to get the " + type + " platform configuration from registry."); } } } }
Source:
<code>public long getMinAverageValueSizeInBytes() { if (!hasMinAverageValueSizeInBytes()) { return 0L; } if (booleanStatistics != null) { return 1L; } if (integerStatistics != null) { return Integer.BYTES; } if (doubleStatistics != null) { return Double.BYTES; } if (stringStatistics != null) { <START> return stringStatistics.getSum() / numberOfValues; <END> } if (dateStatistics != null) { return Integer.BYTES; } if (decimalStatistics != null) { return 8L; } if (binaryStatistics != null) { return binaryStatistics.getSum() / numberOfValues; } return 0L; }</code><technical_language>I move this calculation caller ORC DWRF readers cases "drop" stats for reasons. This allow caller calculate size based column type, null out stat</technical_language>

Target:
public long getMinAverageValueSizeInBytes() { return minAverageValueSizeInBytes; }
Source:
<code>public void setUp() throws Exception { activity = buildActivity(Activity.class).create().get(); attrs = shadowOf(RuntimeEnvironment.application).createAttributeSet(); group = new TestPreferenceGroup(activity, attrs); <START> shadow = shadowOf(group); <END> shadow.callOnAttachedToHierarchy(new PreferenceManager(activity, 0)); pref1 = new Preference(activity); pref1.setKey("pref1"); pref2 = new Preference(activity); pref2.setKey("pref2"); }</code><technical_language>EmptyResourceLoader is unused... delete class</technical_language>

Target:
public void setUp() throws Exception { activity = buildActivity(Activity.class).create().get(); attrs = ShadowApplication.getInstance().createAttributeSet(); group = new TestPreferenceGroup(activity, attrs); shadow = shadowOf(group); shadow.callOnAttachedToHierarchy(new PreferenceManager(activity, 0)); pref1 = new Preference(activity); pref1.setKey("pref1"); pref2 = new Preference(activity); pref2.setKey("pref2"); }
Source:
<code>private Map<String, Object> joinTwoMapsWithKeys(Map<String, Object> map1, Map<String, Object> map2) { Set<String> keySetStream2 = new HashSet<>(); for (int i = 0; i < keys.length; i = i+2) { String key1=keys[i]; String key2=keys[i+1]; <START> keySetStream2.add(key2); <END> if (!map1.get(key1).equals(map2.get(key2))) { return null; } } for (String field : map2.keySet()) { if (!keySetStream2.contains(field)) { map1.put(field, map2.get(field)); } } return map1; }</code><technical_language>keySetStream2 computed setup</technical_language>

Target:
private Map<String, Object> joinTwoMapsWithKeys(Map<String, Object> map1, Map<String, Object> map2) { for (int i = 0; i < keys.length; i = i + 2) { String key1 = keys[i]; String key2 = keys[i + 1]; if (!map1.get(key1).equals(map2.get(key2))) { return null; } } for (String field : map2.keySet()) { if (!keySetStream2.contains(field)) { map1.put(field, map2.get(field)); } } return map1; }
Source:
<code>public void doImport(Properties migrationProps) { Validate.notNull(migrationProps, "invalid null migration properties"); if (!currentProductBranding.equals(this.productBranding)) { throw new MigrationException( Messages.IMPORT_MISMATCH_PRODUCT_ERROR, this.productBranding, currentProductBranding); } List<String> supportedVersions = getSupportedVersions(migrationProps.getProperty("supported.versions")); <START> if (this.currentProductVersion != this.productVersion <END> && !supportedVersions.contains(this.productVersion)) { throw new MigrationException( Messages.IMPORT_UNSUPPORTED_PRODUCT_VERSION_ERROR, this.productVersion, supportedVersions); } LOGGER.debug( "Importing product from version [{}]...", currentProductBranding, currentProductVersion, version); contexts.values().forEach(c -> c.doImport(migrationProps)); }</code><technical_language>equals() guaranteed string internalized</technical_language>

Target:
public void doImport(Properties migrationProps) { Validate.notNull(migrationProps, "invalid null migration properties"); if (!currentProductBranding.equals(this.productBranding)) { throw new MigrationException( Messages.IMPORT_MISMATCH_PRODUCT_ERROR, this.productBranding, currentProductBranding); } LOGGER.debug( "Importing product from version [{}]...", currentProductBranding, currentProductVersion, version); if (this.currentProductVersion.equals(this.productVersion)) { contexts.values().forEach(ImportMigrationContextImpl::doImport); } else { Set<String> supportedVersions = getSupportedVersions(migrationProps.getProperty("supported.versions")); if (!supportedVersions.contains(this.productVersion)) { throw new MigrationException( Messages.IMPORT_UNSUPPORTED_PRODUCT_VERSION_ERROR, this.productVersion, supportedVersions); } contexts.values().forEach(ImportMigrationContextImpl::doVersionUpgradeImport); } }
Source:
<code>public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } VariantDeclaration other = (VariantDeclaration) obj; if (fDeclarationToPopulate == null) { if (other.fDeclarationToPopulate != null) { return false; } } else if (!fDeclarationToPopulate.equals(other.fDeclarationToPopulate)) { return false; } <START> if (fFields == null) { <END> if (other.fFields != null) { return false; } } else { if (!fFields.equals(other.fFields)) { return false; } } if (!equalsNullable(fTag, other.fTag)) { return false; } return true; }</code><technical_language>need revert of equalsNullable</technical_language>

Target:
public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } VariantDeclaration other = (VariantDeclaration) obj; if (!equalsNullable(fDeclarationToPopulate, other.fDeclarationToPopulate)) { return false; } if (!equalsNullable(fFields, other.fFields)) { return false; } if (!equalsNullable(fTag, other.fTag)) { return false; } return true; }
Source:
<code>public void testCacheEventListener() throws Exception { Configuration configuration = new XmlConfiguration(this.getClass().getResource("/configs/ehcache-cacheEventListener.xml")); assertThat(configuration.getCacheConfigurations().containsKey("bar"), is(true)); final CacheManager cacheManager = CacheManagerBuilder.newCacheManager(configuration); final Cache<Number, String> cache = cacheManager.getCache("bar", Number.class, String.class); cache.put(10, "dog"); assertThat(TestCacheEventListener.FIRED_EVENT.getType(), is(EventType.CREATED)); cache.put(10, "cat"); assertThat(TestCacheEventListener.FIRED_EVENT.getType(), is(EventType.UPDATED)); cache.remove(10); assertThat(TestCacheEventListener.FIRED_EVENT.getType(), is(EventType.REMOVED)); cache.put(10, "dog"); <START> Thread.sleep(5000); <END> cache.get(10); assertThat(TestCacheEventListener.FIRED_EVENT.getType(), is(EventType.EXPIRED)); TestCacheEventListener.FIRED_EVENT = null; assertThat(configuration.getCacheConfigurations().containsKey("template1"), is(true)); final Cache<Number, String> templateCache = cacheManager.getCache("template1", Number.class, String.class); templateCache.put(10,"cat"); assertThat(TestCacheEventListener.FIRED_EVENT, nullValue()); templateCache.put(10, "dog"); assertThat(TestCacheEventListener.FIRED_EVENT.getType(), is(EventType.UPDATED)); }</code><technical_language>Please a custom TimeSource instead of Thread.sleep</technical_language>

Target:
public void testCacheEventListener() throws Exception { Configuration configuration = new XmlConfiguration(this.getClass().getResource("/configs/ehcache-cacheEventListener.xml")); assertThat(configuration.getCacheConfigurations().containsKey("bar"), is(true)); final CacheManager cacheManager = CacheManagerBuilder.newCacheManager(configuration); cacheManager.init(); final Cache<Number, String> cache = cacheManager.getCache("bar", Number.class, String.class); cache.put(10, "dog"); assertThat(TestCacheEventListener.FIRED_EVENT.getType(), is(EventType.CREATED)); cache.put(10, "cat"); assertThat(TestCacheEventListener.FIRED_EVENT.getType(), is(EventType.UPDATED)); cache.remove(10); assertThat(TestCacheEventListener.FIRED_EVENT.getType(), is(EventType.REMOVED)); cache.put(10, "dog"); resetValues(); assertThat(configuration.getCacheConfigurations().containsKey("template1"), is(true)); final Cache<Number, String> templateCache = cacheManager.getCache("template1", Number.class, String.class); templateCache.put(10,"cat"); assertThat(TestCacheEventListener.FIRED_EVENT, nullValue()); templateCache.put(10, "dog"); assertThat(TestCacheEventListener.FIRED_EVENT.getType(), is(EventType.UPDATED)); }
Source:
<code>ASession(final QueryContext qc, final Str id) throws QueryException { this.qc = qc; this.id = id; if(id == null) { final Object ws = qc.getProperty(HTTPText.WEBSOCKET); if(ws != null) { session = ((WsAdapter) ws).httpsession; if(session != null) return; <START> } else { <END> final Object req = qc.getProperty(HTTPText.REQUEST); if(req == null) throw BASEX_HTTP.get(null); session = ((HttpServletRequest) req).getSession(); } } else { session = SessionListener.sessions().get(id.toJava()); if(session == null) throw SESSIONS_NOTFOUND_X.get(null, id); } }</code><technical_language>I guess evaluate code in else branch. ( reason ), session null, error raised</technical_language>

Target:
ASession(final QueryContext qc, final Str id) throws QueryException { this.qc = qc; this.id = id; final Object ws = qc.getProperty(HTTPText.WEBSOCKET); final Object req = qc.getProperty(HTTPText.REQUEST); if(ws == null && req == null) throw BASEX_HTTP.get(null); if(id == null) { if(ws != null) { session = ((WsAdapter) ws).httpsession; } else { session = ((HttpServletRequest) req).getSession(); } } else { session = SessionListener.sessions().get(id.toJava()); } if(session == null) throw SESSIONS_NOTFOUND_X.get(null, id); }
Source:
<code>public List<LunModel> getLunsToRefresh() { List<LunModel> luns = Collections.emptyList(); if (!getIsGrouppedByTarget()) { List<LunModel> items = (List<LunModel>) getItems(); <START> luns.addAll(items.stream() <END> .filter(LunModel::getIsIncluded) .filter(LunModel::isAdditionalAvailableSizeSelected) .distinct() .collect(Collectors.toList())); } else { List<SanTargetModel> sanTargetModels = (List<SanTargetModel>) getItems(); for (SanTargetModel sanTargetModel : sanTargetModels) { luns = sanTargetModel.getLuns().stream() .filter(LunModel::getIsIncluded) .filter(LunModel::isAdditionalAvailableSizeSelected) .distinct() .collect(Collectors.toList()); } } return luns; }</code><technical_language>Collections.emptyList() returns a java.util.Collections$EmptyList instance. Calling add addAll throw UnsupportedOperationException. Instead, drop local variable altogether return if/else clauses</technical_language>

Target:
public Set<String> getLunsToRefresh() { if (!getIsGrouppedByTarget()) { return ((List<LunModel>) getItems()).stream() .filter(LunModel::getIsIncluded) .filter(LunModel::isAdditionalAvailableSizeSelected) .map(LunModel::getLunId) .collect(Collectors.toSet()); } return ((List<SanTargetModel>) getItems()).stream() .map(SanTargetModel::getLuns) .flatMap(List::stream) .filter(LunModel::getIsIncluded) .filter(LunModel::isAdditionalAvailableSizeSelected) .map(LunModel::getLunId) .collect(Collectors.toSet()); }
Source:
<code>private Mono<CosmosUserResponse> createUserInternal(CosmosUserProperties userProperties, Context context) { String spanName = "createUser." + this.getId(); Mono<CosmosUserResponse> responseMono = createUserInternal(userProperties); return this.client.getTracerProvider().traceEnabledCosmosResponsePublisher(responseMono, context, <START> spanName, <END> getId(), getClient().getServiceEndpoint()); }</code><technical_language>need extra variable here, replaced "createUser." + this.getId()</technical_language>

Target:
private Mono<CosmosUserResponse> createUserInternal(CosmosUserProperties userProperties, Context context) { String spanName = "createUser." + this.getId(); Mono<CosmosUserResponse> responseMono = getDocClientWrapper().createUser(this.getLink(), ModelBridgeInternal.getV2User(userProperties), null) .map(response -> ModelBridgeInternal.createCosmosUserResponse(response)).single(); return this.client.getTracerProvider().traceEnabledCosmosResponsePublisher(responseMono, context, spanName, getId(), getClient().getServiceEndpoint()); }
Source:
<code>public void reset(DataSourceMetadata dataSourceMetadata) { if (dataSourceMetadata == null) { DataSourceMetadata oldMetadata = metadataStorageCoordinator.getDataSourceMetadata(dataSource); <START> if (oldMetadata != null && oldMetadata instanceof DerivativeDataSourceMetadata) { <END> if (!((DerivativeDataSourceMetadata) oldMetadata).getBaseDataSource().equals(spec.getBaseDataSource()) || !((DerivativeDataSourceMetadata) oldMetadata).getDimensions().equals(spec.getDimensions()) || !((DerivativeDataSourceMetadata) oldMetadata).getMetrics().equals(spec.getMetrics())) { synchronized (taskLock) { clearTasks(); clearSegments(); } } } commitDataSourceMetadata( new DerivativeDataSourceMetadata(spec.getBaseDataSource(), spec.getDimensions(), spec.getMetrics()) ); } else { throw new IAE("DerivedDataSourceMetadata is not allowed to reset to a new DerivedDataSourceMetadata"); } }</code><technical_language>here. Null check is unnecessary</technical_language>

Target:
public void reset(DataSourceMetadata dataSourceMetadata) { if (dataSourceMetadata == null) { DataSourceMetadata oldMetadata = metadataStorageCoordinator.getDataSourceMetadata(dataSource); if (oldMetadata instanceof DerivativeDataSourceMetadata) { if (!((DerivativeDataSourceMetadata) oldMetadata).getBaseDataSource().equals(spec.getBaseDataSource()) || !((DerivativeDataSourceMetadata) oldMetadata).getDimensions().equals(spec.getDimensions()) || !((DerivativeDataSourceMetadata) oldMetadata).getMetrics().equals(spec.getMetrics())) { synchronized (taskLock) { clearTasks(); clearSegments(); } } } commitDataSourceMetadata( new DerivativeDataSourceMetadata(spec.getBaseDataSource(), spec.getDimensions(), spec.getMetrics()) ); } else { throw new IAE("DerivedDataSourceMetadata is not allowed to reset to a new DerivedDataSourceMetadata"); } }
Source:
<code>public void onActivityCreated(@Nullable Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); if (!(getActivity() instanceof PhoneActivity)) { throw new IllegalStateException("Activity must implement PhoneVerificationHandler"); } mVerifier = (PhoneActivity) getActivity(); if (savedInstanceState != null) { return; } Bundle params = getArguments().getBundle(ExtraConstants.EXTRA_PARAMS); String phone = null; String countryCode = null; String nationalNumber = null; if (params != null) { phone = params.getString(ExtraConstants.EXTRA_PHONE); countryCode = params.getString(ExtraConstants.EXTRA_COUNTRY_CODE); nationalNumber = params.getString(ExtraConstants.EXTRA_NATIONAL_NUMBER); } if (!TextUtils.isEmpty(countryCode) && !TextUtils.isEmpty(nationalNumber)) { PhoneNumber phoneNumber = PhoneNumberUtils.getPhoneNumber(countryCode, nationalNumber); setPhoneNumber(phoneNumber); setCountryCode(phoneNumber); <START> } else if (!TextUtils.isEmpty(countryCode)) { <END> setCountryCode(new PhoneNumber( "", PhoneNumberUtils.getCountryIsoForCountryCode(countryCode), countryCode)); } else if (!TextUtils.isEmpty(phone)) { PhoneNumber phoneNumber = PhoneNumberUtils.getPhoneNumber(phone); setPhoneNumber(phoneNumber); setCountryCode(phoneNumber); } else if (getFlowParams().enableHints) { showPhoneAutoCompleteHint(); } }</code><technical_language>This unrelated change, in a PR</technical_language>

Target:
public void onActivityCreated(@Nullable Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); if (!(getActivity() instanceof PhoneActivity)) { throw new IllegalStateException("Activity must implement PhoneVerificationHandler"); } mVerifier = (PhoneActivity) getActivity(); if (savedInstanceState != null) { return; } Bundle params = getArguments().getBundle(ExtraConstants.EXTRA_PARAMS); String phone = null; String countryIso = null; String nationalNumber = null; if (params != null) { phone = params.getString(ExtraConstants.EXTRA_PHONE); countryIso = params.getString(ExtraConstants.EXTRA_COUNTRY_ISO); nationalNumber = params.getString(ExtraConstants.EXTRA_NATIONAL_NUMBER); } if (!TextUtils.isEmpty(countryIso) && !TextUtils.isEmpty(nationalNumber)) { PhoneNumber phoneNumber = PhoneNumberUtils.getPhoneNumber(countryIso, nationalNumber); setPhoneNumber(phoneNumber); setCountryCode(phoneNumber); } else if (!TextUtils.isEmpty(countryIso)) { setCountryCode(new PhoneNumber( "", countryIso, String.valueOf(PhoneNumberUtils.getCountryCode(countryIso)))); } else if (!TextUtils.isEmpty(phone)) { PhoneNumber phoneNumber = PhoneNumberUtils.getPhoneNumber(phone); setPhoneNumber(phoneNumber); setCountryCode(phoneNumber); } else if (getFlowParams().enableHints) { showPhoneAutoCompleteHint(); } }
Source:
<code><START> public List<String> getJars(Class<?> jarClass, boolean makeJarFromFolder, boolean addJarDependencies) <END> { List<String> list = new LinkedList<>(); String jar = getJar(jarClass, makeJarFromFolder); if (jar != null) { list.add(jar); } if (addJarDependencies) { try { getDependentJarsFromManifest(new JarFile(jar), list); } catch (IOException ex) { logger.warn("Cannot open Jar-file {}", jar); } } return list; }</code><technical_language>a Set? Duplicates allowed</technical_language>

Target:
public Set<String> getJars(Class<?> jarClass, boolean makeJarFromFolder, boolean addJarDependencies) { String jar = getJar(jarClass, makeJarFromFolder); Set<String> set = new HashSet<>(); if (jar != null) { set.add(jar); if (addJarDependencies) { try { getDependentJarsFromManifest(new JarFile(jar), set); } catch (IOException ex) { logger.warn("Cannot open Jar-file {}", jar); } } } return set; }
Source:
<code>private void run() { try { while (running) { try { final long start = Time.monotonicNow(); final Set<ContainerID> containerIds = containerManager.getContainerIDs(); containerIds.forEach(this::processContainer); LOG.info("Replication Monitor Thread took milliseconds for" + " processing containers.", Time.monotonicNow() - start, containerIds.size()); if (!Thread.interrupted()) { Thread.sleep(interval); } } catch (InterruptedException ex) { <START> LOG.debug("Replication Monitor Thread got interrupted."); <END> } } } catch (Throwable t) { LOG.error("Exception in Replication Monitor Thread.", t); ExitUtil.terminate(1, t); } }</code><technical_language>Addressed Object.wait instead of Thread.sleep</technical_language>

Target:
private synchronized void run() { try { while (running) { final long start = Time.monotonicNow(); final Set<ContainerID> containerIds = containerManager.getContainerIDs(); containerIds.forEach(this::processContainer); LOG.info("Replication Monitor Thread took milliseconds for" + " processing containers.", Time.monotonicNow() - start, containerIds.size()); wait(interval); } } catch (Throwable t) { LOG.error("Exception in Replication Monitor Thread.", t); ExitUtil.terminate(1, t); } }
Source:
<code>public Response intercept(Chain chain) throws IOException { long numTries = 0; boolean successful = false; Request request = chain.request(); Response response = null; while (!successful && numTries < maxNumTries) { try { numTries++; response = chain.proceed(request); successful = response.isSuccessful(); } catch (IOException e) { if (numTries >= maxNumTries) { throw e; } } if (!successful) { <START> log.error("Request to url failed on attempt {}", request.url(), SafeArg.of("numTries", numTries)); <END> } } return response; }</code><technical_language>log message get cleaned to: "Failed request url"</technical_language>

Target:
public Response intercept(Chain chain) throws IOException { long numTries = 0; boolean successful = false; Request request = chain.request(); Response response = null; while (!successful && numTries < maxNumTries) { try { numTries++; response = chain.proceed(request); successful = response.isSuccessful(); } catch (IOException e) { if (numTries >= maxNumTries) { throw e; } } if (!successful) { log.error("Request to url failed", SafeArg.of("numTries", numTries)); } } return response; }
Source:
<code>private void changeSchemaByAnotherRealm() { SharedRealm sharedRealm = SharedRealm.getInstance(config); sharedRealm.beginTransaction(); sharedRealm.createTable("NewTable"); sharedRealm.commitTransaction(); <START> } <END></code><technical_language>closed again</technical_language>

Target:
private void changeSchemaByAnotherRealm() { SharedRealm sharedRealm = SharedRealm.getInstance(config); sharedRealm.beginTransaction(); sharedRealm.createTable("NewTable"); sharedRealm.commitTransaction(); sharedRealm.close(); }
Source:
<code>public void setElement( IAdaptable element ) { <START> if (element instanceof ICLineBreakpoint) { <END> fElement = new CBreakpointContext((ICBreakpoint)element, null); } else { fElement = element; } }</code><technical_language>I check for ICBreakpoint instead include other kind of breakpoints this properties page. For example a watchpoint eventBreakpoing trigger this code</technical_language>

Target:
public void setElement( IAdaptable element ) { if (element instanceof ICBreakpoint) { fElement = new CBreakpointContext((ICBreakpoint)element, null); } else { fElement = element; } }
Source:
<code>public MavenProject readProject(final File pomFile, IProgressMonitor monitor) throws CoreException { <START> return context().execute(new ICallable<MavenProject>() { <END> public MavenProject call(IMavenExecutionContext context, IProgressMonitor monitor) throws CoreException { MavenExecutionRequest request = DefaultMavenExecutionRequest.copy(context.getExecutionRequest()); try { lookup(MavenExecutionRequestPopulator.class).populateDefaults(request); ProjectBuildingRequest configuration = request.getProjectBuildingRequest(); configuration.setValidationLevel(ModelBuildingRequest.VALIDATION_LEVEL_MINIMAL); configuration.setRepositorySession(createRepositorySession(request)); return lookup(ProjectBuilder.class).build(pomFile, configuration).getProject(); } catch(ProjectBuildingException ex) { throw new CoreException(new Status(IStatus.ERROR, IMavenConstants.PLUGIN_ID, -1, Messages.MavenImpl_error_read_project, ex)); } catch(MavenExecutionRequestPopulationException ex) { throw new CoreException(new Status(IStatus.ERROR, IMavenConstants.PLUGIN_ID, -1, Messages.MavenImpl_error_read_project, ex)); } } }, monitor); }</code><technical_language>unnecessary change</technical_language>

Target:
public MavenProject readProject(final File pomFile, IProgressMonitor monitor) throws CoreException { return context().execute((context, pm) -> { MavenExecutionRequest request = DefaultMavenExecutionRequest.copy(context.getExecutionRequest()); try { lookup(MavenExecutionRequestPopulator.class).populateDefaults(request); ProjectBuildingRequest configuration = request.getProjectBuildingRequest(); configuration.setValidationLevel(ModelBuildingRequest.VALIDATION_LEVEL_MINIMAL); configuration.setRepositorySession(createRepositorySession(request)); return lookup(ProjectBuilder.class).build(pomFile, configuration).getProject(); } catch(ProjectBuildingException ex) { throw new CoreException(new Status(IStatus.ERROR, IMavenConstants.PLUGIN_ID, -1, Messages.MavenImpl_error_read_project, ex)); } catch(MavenExecutionRequestPopulationException ex) { throw new CoreException(new Status(IStatus.ERROR, IMavenConstants.PLUGIN_ID, -1, Messages.MavenImpl_error_read_project, ex)); } }, monitor); }
Source:
<code>public void testPseudoState() { org.eclipse.uml2.uml.Pseudostate i = UMLFactory.eINSTANCE.createPseudostate(); i.setContainer(region); i.setName("I"); i.setKind(PseudostateKind.INITIAL_LITERAL); org.eclipse.uml2.uml.Pseudostate c = UMLFactory.eINSTANCE.createPseudostate(); c.setContainer(region); c.setName("C"); c.setKind(PseudostateKind.CHOICE_LITERAL); RectangleObject recti = new RectangleObject("package.A.I", new Point(1, 2)); recti.setWidth(3); recti.setHeight(4); RectangleObject rectc = new RectangleObject("package.A.C", new Point(5, 6)); rectc.setWidth(7); rectc.setHeight(8); PseudoState statec = new PseudoState(rectc, c); PseudoState statei = new PseudoState(recti, i); Assert.assertEquals("package.A.I", statei.getId()); Assert.assertEquals("package.A.C", statec.getId()); Assert.assertEquals("I", statei.getName()); Assert.assertEquals("C", statec.getName()); Assert.assertEquals((Integer) 1, statei.getPosition().getX()); Assert.assertEquals((Integer) 5, statec.getPosition().getX()); Assert.assertEquals((Integer) 2, statei.getPosition().getY()); Assert.assertEquals((Integer) 6, statec.getPosition().getY()); Assert.assertEquals((Integer) 3, statei.getWidth()); Assert.assertEquals((Integer) 7, statec.getWidth()); Assert.assertEquals((Integer) 4, statei.getHeight()); Assert.assertEquals((Integer) 8, statec.getHeight()); Assert.assertEquals("initial", statei.getKind()); <START> Assert.assertEquals("choice", statec.getKind()); <END> }</code><technical_language>Change magic strings PseudostateKind literals</technical_language>

Target:
public void testPseudoState() { org.eclipse.uml2.uml.Pseudostate inintialState = UMLFactory.eINSTANCE.createPseudostate(); inintialState.setContainer(region); inintialState.setName("I"); inintialState.setKind(PseudostateKind.INITIAL_LITERAL); org.eclipse.uml2.uml.Pseudostate choiceState = UMLFactory.eINSTANCE.createPseudostate(); choiceState.setContainer(region); choiceState.setName("C"); choiceState.setKind(PseudostateKind.CHOICE_LITERAL); PseudoState statec = new PseudoState(choiceState, "package.A.C"); PseudoState statei = new PseudoState(inintialState, "package.A.I"); statec.setLayout(new Rectangle(1, 2, 3, 4)); Assert.assertEquals("package.A.I", statei.getId()); Assert.assertEquals("package.A.C", statec.getId()); Assert.assertEquals("I", statei.getName()); Assert.assertEquals("C", statec.getName()); Assert.assertEquals(PseudostateKind.INITIAL_LITERAL, statei.getKind()); Assert.assertEquals(PseudostateKind.CHOICE_LITERAL, statec.getKind()); Assert.assertEquals(1, statec.getPosition().getX()); Assert.assertEquals(2, statec.getPosition().getY()); Assert.assertEquals(3, statec.getWidth().intValue()); Assert.assertEquals(4, statec.getHeight().intValue()); }
Source:
<code><START> private AsyncQuery getFilteringCallBack() { <END> AsyncQuery filteringAsyncQuery = new AsyncQuery(); filteringAsyncQuery.setModel(this); filteringAsyncQuery.asyncCallback = new INewAsyncCallback() { @Override public void onSuccess(Object model, Object returnValue) { String searchString = getSearchString(); String domain = getDomain().getSelectedItem().toString(); AdElementListModel adElementListModel = (AdElementListModel) model; HashSet<Guid> excludeUsers = new HashSet<Guid>(); if (getExcludeItems() != null) { for (Object item : getExcludeItems()) { DbUser a = (DbUser) item; excludeUsers.add(a.getuser_id()); } } setusers(new ArrayList<EntityModel>()); for (IVdcQueryable item : (ArrayList<IVdcQueryable>) ((VdcQueryReturnValue) returnValue).getReturnValue()) { DbUser dbUser = (DbUser) item; if (matchesSearchFilter(dbUser, excludeUsers, domain, searchString)) { EntityModel tempVar2 = new EntityModel(); tempVar2.setEntity(dbUser); getusers().add(tempVar2); } } OnUserAndAdGroupsLoaded(adElementListModel); } private boolean matchesSearchFilter(DbUser dbUser, HashSet<Guid> excludeUsers, String domain, String searchString) { return !excludeUsers.contains(dbUser.getuser_id()) && dbUser.getdomain().equals(domain) && (StringHelper.isNullOrEmpty(searchString) || dbUserMatchesSearchFilter(dbUser, searchString.toLowerCase())); } private boolean dbUserMatchesSearchFilter(DbUser dbUser, String searchString) { return matchesSearchFilter(dbUser.getname().toLowerCase(), searchString) || matchesSearchFilter(dbUser.getsurname().toLowerCase(), searchString) || matchesSearchFilter(dbUser.getusername().toLowerCase(), searchString); } private boolean matchesSearchFilter(String name, String searchString) { return name.startsWith(searchString); } }; return filteringAsyncQuery; }</code><technical_language>Consider standard predicates for filtering instead</technical_language>

Target:
private AsyncQuery getFilteringCallBack() { AsyncQuery filteringAsyncQuery = new AsyncQuery(); filteringAsyncQuery.setModel(this); filteringAsyncQuery.asyncCallback = new INewAsyncCallback() { @Override public void onSuccess(Object model, Object returnValue) { AdElementListModel adElementListModel = (AdElementListModel) model; Set<Guid> excludeUsers = getExcludeUsers(); setusers(new ArrayList<EntityModel>()); Iterable<DbUser> filteredUsers = Linq.Where( (ArrayList<DbUser>) ((VdcQueryReturnValue) returnValue).getReturnValue(), new Linq.DbUserPredicate(getTargetDbUser())); for (DbUser dbUser : filteredUsers) { if (!excludeUsers.contains(dbUser.getuser_id())) { EntityModel tempVar2 = new EntityModel(); tempVar2.setEntity(dbUser); getusers().add(tempVar2); } } OnUserAndAdGroupsLoaded(adElementListModel); } private Set<Guid> getExcludeUsers() { Set<Guid> excludeUsers = new HashSet<Guid>(); if (getExcludeItems() != null) { for (Object item : getExcludeItems()) { DbUser a = (DbUser) item; excludeUsers.add(a.getuser_id()); } } return excludeUsers; } private DbUser getTargetDbUser() { DbUser dbUser = new DbUser(); dbUser.setname(getSearchString()); dbUser.setdomain(getDomain().getSelectedItem().toString()); return dbUser; } }; return filteringAsyncQuery; }
Source:
<code>void doCompactEntryLogs(double threshold) throws IOException { LOG.info("Do compaction to compact those files lower than {}", threshold); final int numBuckets = 10; int entryLogUsageBuckets[] = new int[numBuckets]; entryLogMetaMap.forEach((entryLogId, meta) -> { int bucketIndex = Math.min(numBuckets - 1, (int) Math.ceil(meta.getUsage() * numBuckets)); entryLogUsageBuckets[bucketIndex]++; if (meta.getUsage() >= threshold) { return; } if (LOG.isDebugEnabled()) { LOG.debug("Compacting entry log below threshold {}", meta.getEntryLogId(), threshold); } <START> long priorRemainingSize = meta.getRemainingSize(); <END> compactEntryLog(meta); gcStats.getReclaimedSpaceViaCompaction().add(meta.getTotalSize() - priorRemainingSize); if (!running) { return; } }); LOG.info("Compaction: entry log usage buckets[10% 20% 30% 40% 50% 60% 70% 80% 90% 100%] = {}", entryLogUsageBuckets); }</code><technical_language>this is a behaviour change is this needed in this patch</technical_language>

Target:
void doCompactEntryLogs(double threshold) throws EntryLogMetadataMapException { LOG.info("Do compaction to compact those files lower than {}", threshold); final int numBuckets = 10; int entryLogUsageBuckets[] = new int[numBuckets]; entryLogMetaMap.forEach((entryLogId, meta) -> { int bucketIndex = Math.min(numBuckets - 1, (int) Math.ceil(meta.getUsage() * numBuckets)); entryLogUsageBuckets[bucketIndex]++; if (meta.getUsage() >= threshold) { return; } if (LOG.isDebugEnabled()) { LOG.debug("Compacting entry log below threshold {}", meta.getEntryLogId(), threshold); } long priorRemainingSize = meta.getRemainingSize(); compactEntryLog(meta); gcStats.getReclaimedSpaceViaCompaction().add(meta.getTotalSize() - priorRemainingSize); if (!running) { return; } }); LOG.info("Compaction: entry log usage buckets[10% 20% 30% 40% 50% 60% 70% 80% 90% 100%] = {}", entryLogUsageBuckets); }
Source:
<code>public SubTabProviderGeneralView(DetailModelProvider<ProviderListModel, ProviderGeneralModel> modelProvider) { super(modelProvider); formPanel = new GeneralFormPanel(); initWidget(ViewUiBinder.uiBinder.createAndBindUi(this)); driver.initialize(this); generateIds(); formBuilder = new FormBuilder(formPanel, 1, 4); formBuilder.setRelativeColumnWidth(0, 6); formBuilder.addFormItem(new FormItem(constants.nameProvider(), name, 0, 0), <START> 4, 6); <END> formBuilder.addFormItem(new FormItem(constants.typeProvider(), type, 1, 0), 4, 6); formBuilder.addFormItem(new FormItem(constants.descriptionProvider(), description, 2, 0), 4, 6); formBuilder.addFormItem(new FormItem(constants.urlProvider(), url, 3, 0), 4, 6); }</code><technical_language>I this numbers need add 12 satisfy bootstrap's grid system</technical_language>

Target:
public SubTabProviderGeneralView(DetailModelProvider<ProviderListModel, ProviderGeneralModel> modelProvider) { super(modelProvider); formPanel = new GeneralFormPanel(); initWidget(ViewUiBinder.uiBinder.createAndBindUi(this)); driver.initialize(this); generateIds(); formBuilder = new FormBuilder(formPanel, 1, 4); formBuilder.addFormItem(new FormItem(constants.nameProvider(), name, 0, 0), 2, 10); formBuilder.addFormItem(new FormItem(constants.typeProvider(), type, 1, 0), 2, 10); formBuilder.addFormItem(new FormItem(constants.descriptionProvider(), description, 2, 0), 2, 10); formBuilder.addFormItem(new FormItem(constants.urlProvider(), url, 3, 0), 2, 10); }
Source:
<code>private void refreshSnapshotsInCluster(VDSGroup cluster) { if (!supportsGlusterSnapshotFeature(cluster)) { return; } <START> final VDS upServer = getClusterUtils().getRandomUpServer(cluster.getId()); <END> List<GlusterVolumeEntity> volumes = getGlusterVolumeDao().getByClusterId(cluster.getId()); if (volumes != null && volumes.size() > 0) { List<Callable<Pair<GlusterVolumeEntity, VDSReturnValue>>> taskList = new ArrayList<Callable<Pair<GlusterVolumeEntity, VDSReturnValue>>>(); for (final GlusterVolumeEntity volume : volumes) { taskList.add(new Callable<Pair<GlusterVolumeEntity, VDSReturnValue>>() { @Override public Pair<GlusterVolumeEntity, VDSReturnValue> call() throws Exception { VDSReturnValue returnValue = runVdsCommand(VDSCommandType.GetGlusterVolumeSnapshotInfo, new GlusterVolumeSnapshotVDSParameters(upServer.getId(), volume.getName(), volume.getClusterId())); return new Pair<GlusterVolumeEntity, VDSReturnValue>(volume, returnValue); } }); } List<Pair<GlusterVolumeEntity, VDSReturnValue>> pairResults = ThreadPoolUtil.invokeAll(taskList); try { addOrUpdateSnapshots(cluster.getId(), pairResults); } catch (VdcBLLException e) { throw e; } } }</code><technical_language>null if servers</technical_language>

Target:
private void refreshSnapshotsInCluster(VDSGroup cluster) { if (!supportsGlusterSnapshotFeature(cluster)) { return; } final VDS upServer = getClusterUtils().getRandomUpServer(cluster.getId()); if (upServer == null) { return; } List<GlusterVolumeEntity> volumes = getGlusterVolumeDao().getByClusterId(cluster.getId()); if (volumes != null && volumes.size() > 0) { List<Callable<Pair<GlusterVolumeEntity, VDSReturnValue>>> taskList = new ArrayList<Callable<Pair<GlusterVolumeEntity, VDSReturnValue>>>(); for (final GlusterVolumeEntity volume : volumes) { taskList.add(new Callable<Pair<GlusterVolumeEntity, VDSReturnValue>>() { @Override public Pair<GlusterVolumeEntity, VDSReturnValue> call() throws Exception { VDSReturnValue returnValue = runVdsCommand(VDSCommandType.GetGlusterVolumeSnapshotInfo, new GlusterVolumeSnapshotVDSParameters(upServer.getId(), volume.getName(), volume.getClusterId())); return new Pair<GlusterVolumeEntity, VDSReturnValue>(volume, returnValue); } }); } List<Pair<GlusterVolumeEntity, VDSReturnValue>> pairResults = ThreadPoolUtil.invokeAll(taskList); try { addOrUpdateSnapshots(cluster.getId(), pairResults); } catch (VdcBLLException e) { throw e; } } }
Source:
<code>public List<String> getTextsForAllStatusMessagesToUser() { <START> List<WebElement> statusMessages = statusMessage.findElements(By.tagName("div")); <END> List<String> statusMessageTexts = new ArrayList<String>(); for (WebElement status : statusMessages) { statusMessageTexts.add(status.getText()); } return statusMessageTexts; }</code><technical_language>rename statusMessage statusMessagesToUser</technical_language>

Target:
public List<String> getTextsForAllStatusMessagesToUser() { List<WebElement> statusMessagesToUser = statusMessage.findElements(By.tagName("div")); List<String> statusMessageTexts = new ArrayList<String>(); for (WebElement statusMessage : statusMessagesToUser) { statusMessageTexts.add(statusMessage.getText()); } return statusMessageTexts; }
Source:
<code>public void debugClearLocalData() throws MessagingException { <START> if (!K9.DEBUG) { <END> throw new AssertionError("method must only be used in debug build!"); } try { localStore.database.execute(true, new DbCallback<Void>() { @Override public Void doDbWork(final SQLiteDatabase db) throws WrappedException, MessagingException { ContentValues cv = new ContentValues(); cv.putNull("message_part_id"); db.update("messages", cv, "id = ?", new String[] { Long.toString(mId) }); try { ((LocalFolder) mFolder).deleteMessagePartsAndDataFromDisk(messagePartId); } catch (MessagingException e) { throw new WrappedException(e); } setFlag(Flag.X_DOWNLOADED_FULL, false); setFlag(Flag.X_DOWNLOADED_PARTIAL, false); return null; } }); } catch (WrappedException e) { throw (MessagingException) e.getCause(); } localStore.notifyChange(); }</code><technical_language>Sorry, I missed this time. BuildConfig.DEBUG, too</technical_language>

Target:
public void debugClearLocalData() throws MessagingException { if (!BuildConfig.DEBUG) { throw new AssertionError("method must only be used in debug build!"); } try { localStore.database.execute(true, new DbCallback<Void>() { @Override public Void doDbWork(final SQLiteDatabase db) throws WrappedException, MessagingException { ContentValues cv = new ContentValues(); cv.putNull("message_part_id"); db.update("messages", cv, "id = ?", new String[] { Long.toString(mId) }); try { ((LocalFolder) mFolder).deleteMessagePartsAndDataFromDisk(messagePartId); } catch (MessagingException e) { throw new WrappedException(e); } setFlag(Flag.X_DOWNLOADED_FULL, false); setFlag(Flag.X_DOWNLOADED_PARTIAL, false); return null; } }); } catch (WrappedException e) { throw (MessagingException) e.getCause(); } localStore.notifyChange(); }
Source:
<code>public UrlWizardPage(ServerConnectionModel model) { <START> super("server_url_page", "SonarQube ConnectedEngineFacade URL", model, 2); <END> }</code><technical_language>Uh, I :sweat_smile:</technical_language>

Target:
public UrlWizardPage(ServerConnectionModel model) { super("server_url_page", "SonarQube Server URL", model, 2); }
Source:
<code>public void willReturnCommandIgnoreOnPipelineInternalLine() { final MarkupText markupText = new MarkupText("Some internal line"); markupText.addMarkup(0, "<span class=\"pipeline-new-node\">"); <START> System.out.println(markupText.toString(false)); <END> final ColorizedAction colorizedAction = ColorizedAction.parseAction(markupText, buildRun); assertEquals(ColorizedAction.Command.IGNORE, colorizedAction.getCommand()); }</code><technical_language>Debugging? Remove</technical_language>

Target:
public void willReturnCommandIgnoreOnPipelineInternalLine() { final MarkupText markupText = new MarkupText("Some internal line"); markupText.addMarkup(0, "<span class=\"pipeline-new-node\">"); final ColorizedAction colorizedAction = ColorizedAction.parseAction(markupText, buildRun); assertEquals(ColorizedAction.Command.IGNORE, colorizedAction.getCommand()); }
Source:
<code>public T get() { Type providerType = Types.newParameterizedType( ConditionalBinder.class, key.getTypeLiteral().getRawType()); Set<ConditionalBinder<T>> providers = (Set<ConditionalBinder<T>>) injector.getInstance(key.ofType(Types.setOf(providerType))); ConditionalBinder<T> defaultProvider = null; List<ConditionalBinder<T>> matchedBindings = new ArrayList<>(); for (ConditionalBinder<T> provider : providers) { if (provider.matches()) { matchedBindings.add(provider); } else if (provider.isDefault()) { if (defaultProvider != null) { throw new ProvisionException("Only one default provider allowed for " + key.getTypeLiteral()); } defaultProvider = provider; } } if (matchedBindings.size() == 0) { if (defaultProvider != null) { return defaultProvider.get(); } else { throw new ProvisionException("No binding found for " + key.getTypeLiteral()); } } else if (matchedBindings.size() == 1) { <START> return matchedBindings.iterator().next().get(); <END> } else { throw new ProvisionException("Multiple (" + matchedBindings.size() + ") bindings found for " + key + "\n. " + matchedBindings); } }</code><technical_language>matchedBindings.get(0)</technical_language>

Target:
public T get() { return resolveProvider().get(); }
Source:
<code>public void testBasicSendAndPoll() throws IOException { initialize(); List<RequestInfo> requestInfoList = new ArrayList<RequestInfo>(); List<ResponseInfo> responseInfoList; int requestCount; requestInfoList.add(new RequestInfo(host1, port1, new MockSend(1))); requestInfoList.add(new RequestInfo(host1, port1, new MockSend(2))); requestCount = requestInfoList.size(); do { responseInfoList = networkClient.sendAndPoll(requestInfoList); requestInfoList.clear(); for (ResponseInfo responseInfo : responseInfoList) { <START> MockSend send = (MockSend) responseInfo.getRequest(); <END> NetworkClientErrorCode error = responseInfo.getError(); ByteBuffer response = responseInfo.getResponse(); Assert.assertNull("Should not have encountered an error", error); Assert.assertNotNull("Should receive a valid response", response); int correlationIdInRequest = send.getCorrelationId(); int correlationIdInResponse = response.getInt(); Assert.assertEquals("Received response for the wrong request", correlationIdInRequest, correlationIdInResponse); requestCount--; } } while (requestCount > 0); Assert.assertEquals("Should receive only as many responses as there were requests", 0, requestCount); responseInfoList = networkClient.sendAndPoll(requestInfoList); requestInfoList.clear(); Assert.assertEquals("No responses are expected at this time", 0, responseInfoList.size()); }</code><technical_language>is a reason need cast</technical_language>

Target:
public void testBasicSendAndPoll() throws IOException { List<RequestInfo> requestInfoList = new ArrayList<RequestInfo>(); List<ResponseInfo> responseInfoList; requestInfoList.add(new RequestInfo(host1, port1, new MockSend(1))); requestInfoList.add(new RequestInfo(host1, port1, new MockSend(2))); int requestCount = requestInfoList.size(); int responseCount = 0; do { responseInfoList = networkClient.sendAndPoll(requestInfoList); requestInfoList.clear(); for (ResponseInfo responseInfo : responseInfoList) { MockSend send = (MockSend) responseInfo.getRequest(); NetworkClientErrorCode error = responseInfo.getError(); ByteBuffer response = responseInfo.getResponse(); Assert.assertNull("Should not have encountered an error", error); Assert.assertNotNull("Should receive a valid response", response); int correlationIdInRequest = send.getCorrelationId(); int correlationIdInResponse = response.getInt(); Assert.assertEquals("Received response for the wrong request", correlationIdInRequest, correlationIdInResponse); responseCount++; } } while (requestCount > responseCount); Assert.assertEquals("Should receive only as many responses as there were requests", requestCount, responseCount); responseInfoList = networkClient.sendAndPoll(requestInfoList); requestInfoList.clear(); Assert.assertEquals("No responses are expected at this time", 0, responseInfoList.size()); }
Source:
<code>public void runCommand(KDebug session, CompiledDefinition compiledDefinition) { int activeStateId = session.getActiveStateId(); DebuggerState prevState = session.getStates().get(activeStateId); DebuggerState steppedState = session.step(activeStateId, stepCount); int effectiveStepCount = steppedState.getStepNum() - prevState.getStepNum(); if (effectiveStepCount < stepCount) { System.out.println("Attempted " + stepCount + " step(s). " + "Took " + effectiveStepCount + " steps(s)."); <START> System.out.println("KDebug may have encountered a final configuration."); <END> return; } System.out.println(stepCount + " Step(s) Taken."); }</code><technical_language>weak. "Reached a final state."</technical_language>

Target:
public void runCommand(KDebug session, CompiledDefinition compiledDefinition) { int activeStateId = session.getActiveStateId(); DebuggerState prevState = session.getStates().get(activeStateId); DebuggerState steppedState = session.step(activeStateId, stepCount); int effectiveStepCount = steppedState.getStepNum() - prevState.getStepNum(); if (effectiveStepCount < stepCount) { System.out.println("Attempted " + stepCount + " step(s). " + "Took " + effectiveStepCount + " steps(s)."); System.out.println("Final State Reached"); return; } System.out.println(stepCount + " Step(s) Taken."); }