auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public RestClientFactory(String elasticSearchURL, String esusername, String espassword ) throws MalformedURLException { final List<String> targetHosts = Arrays.asList(elasticSearchURL.split(",")); final HttpClientConfig.Builder configBuilder = new HttpClientConfig.Builder(targetHosts).multiThreaded(true); if (!Strings.isNullOrEmpty(esusername) && !Strings.isNullOrEmpty(espassword)) { final URL targetUrl = new URL(targetHosts.get(0)); if (targetHosts.size() > 1) { LOG.warn("Username/Password have been defined, but multiple target hosts were found. Each host will use the same credentials."); LOG.warn("Username/Password have been defined, but multiple target hosts were found. Preemptive auth is only enabled for host {}", targetHosts.get(0)); } configBuilder.defaultCredentials(esusername, espassword); configBuilder.setPreemptiveAuth(new HttpHost(targetUrl.getHost(), targetUrl.getPort(), targetUrl.getProtocol())); } config = configBuilder.build(); factory = new JestClientFactory(); factory.setHttpClientConfig(config); }

Target:
public RestClientFactory(String elasticSearchURL, String esusername, String espassword ) throws MalformedURLException { final List<String> targetHosts = Arrays.asList(elasticSearchURL.split(",")); final HttpClientConfig.Builder configBuilder = new HttpClientConfig.Builder(targetHosts).multiThreaded(true); if (!Strings.isNullOrEmpty(esusername) && !Strings.isNullOrEmpty(espassword)) { final URL targetUrl = new URL(targetHosts.get(0)); if (targetHosts.size() > 1) { LOG.warn("Credentials have been defined, but multiple target hosts were found. " + "Each host will use the same credentials. Preemptive auth is only enabled for host {}", targetHosts.get(0)); } configBuilder.defaultCredentials(esusername, espassword); configBuilder.setPreemptiveAuth(new HttpHost(targetUrl.getHost(), targetUrl.getPort(), targetUrl.getProtocol())); } config = configBuilder.build(); factory = new JestClientFactory(); factory.setHttpClientConfig(config); }
Source:
public boolean isHeaderVisible() { try { wait.forElementVisible(h1Header); return true; } catch (NoSuchElementException e) { PageObjectLogging.log("verifyElementsOnPage", "verify that H1 is present", true); return false; } }

Target:
public boolean isHeaderVisible() { try { wait.forElementVisible(h1Header); return true; } catch (TimeoutException e) { PageObjectLogging.logInfo("Header is not visible", e); return false; } }
Source:
protected void onSaveMenuItem() { if (mValidator.validate(mEmailField.getText())) { mActivityHelper.getCurrentUser().updateEmail(mEmailField.getText().toString()) .addOnFailureListener( new TaskFailureLogger(TAG, "failure updating email")) .addOnFailureListener(new OnFailureListener() { @Override public void onFailure(@NonNull Exception e) { mEmailInputLayout.setError(e.getLocalizedMessage()); } }) .addOnSuccessListener(new OnSuccessListener<Void>() { @Override public void onSuccess(Void aVoid) { finish(); } }); } }

Target:
protected void onSaveMenuItem() { if (mValidator.validate(mEmailField.getText())) { mActivityHelper.getCurrentUser().updateEmail(mEmailField.getText().toString()) .addOnFailureListener( new TaskFailureLogger(TAG, "failure updating email")) .addOnFailureListener(new OnFailureListener() { @Override public void onFailure(@NonNull Exception e) { if (e instanceof FirebaseAuthUserCollisionException) { mEmailInputLayout.setError( getResources().getString(R.string.error_user_collision)); } else { mEmailInputLayout.setError( getResources().getString(R.string.general_error)); } } }) .addOnSuccessListener(new OnSuccessListener<Void>() { @Override public void onSuccess(Void aVoid) { finish(); } }); } }
Source:
public static Tier getTier(TierConfig tierConfig, HelixManager helixManager) { TierSegmentSelector segmentSelector; TierStorage storageSelector; String segmentSelectorType = tierConfig.getSegmentSelectorType(); if (segmentSelectorType.equalsIgnoreCase(TierSegmentSelectorType.TIME.toString())) { segmentSelector = new TimeBasedTierSegmentSelector(helixManager, tierConfig.getSegmentAge()); } else { throw new IllegalStateException("Unsupported segmentSelectorType: " + segmentSelectorType); } String storageSelectorType = tierConfig.getStorageType(); if (storageSelectorType.equalsIgnoreCase(TierStorageType.PINOT_SERVER.toString())) { storageSelector = new PinotServerTierStorage(tierConfig.getServerTag()); } else { throw new IllegalStateException("Unsupported storageType: " + storageSelectorType); } return new Tier(tierConfig.getName(), segmentSelector, storageSelector); }

Target:
public static Tier getTier(TierConfig tierConfig, HelixManager helixManager) { TierSegmentSelector segmentSelector; TierStorage storageSelector; String segmentSelectorType = tierConfig.getSegmentSelectorType(); if (segmentSelectorType.equalsIgnoreCase(TierFactory.TIME_SEGMENT_SELECTOR_TYPE)) { segmentSelector = new TimeBasedTierSegmentSelector(helixManager, tierConfig.getSegmentAge()); } else { throw new IllegalStateException("Unsupported segmentSelectorType: " + segmentSelectorType); } String storageSelectorType = tierConfig.getStorageType(); if (storageSelectorType.equalsIgnoreCase(TierFactory.PINOT_SERVER_STORAGE_TYPE)) { storageSelector = new PinotServerTierStorage(tierConfig.getServerTag()); } else { throw new IllegalStateException("Unsupported storageType: " + storageSelectorType); } return new Tier(tierConfig.getName(), segmentSelector, storageSelector); }
Source:
public String getKModuleText(final String path) { return loadKieTextFromJar(path, META_INF, "kmodule.xml"); }

Target:
public String getKModuleText(final String path) { return loadKieTextFromJar(path, META_INF, KMODULE_XML); }
Source:
protected void eventHandle(@NonNull ITmfEvent event) { ITmfStateSystemBuilder ss = getStateSystemBuilder(); if (ss == null) { return; } for (CounterAspect aspect : fCounterAspects) { boolean isGrouped = aspect.getGroupIds().length > 0; int rootQuark = isGrouped ? ss.getQuarkAbsoluteAndAdd(CounterAnalysis.GROUPED_COUNTER_ASPECTS_ATTRIB) : ss.getQuarkAbsoluteAndAdd(CounterAnalysis.UNGROUPED_COUNTER_ASPECTS_ATTRIB); if (isGrouped) { handleGroupedCounterAspect(event, ss, aspect, rootQuark); } else { handleCounterAspect(event, ss, aspect, rootQuark); } } }

Target:
protected void eventHandle(@NonNull ITmfEvent event) { ITmfStateSystemBuilder ss = getStateSystemBuilder(); if (ss == null) { return; } for (ITmfEventAspect<?> aspect : fCounterAspects) { if (aspect instanceof CounterAspect) { CounterAspect counterAspect = (CounterAspect) aspect; if (counterAspect.getGroupIds().length > 0) { int rootQuark = ss.getQuarkAbsoluteAndAdd(CounterAnalysis.GROUPED_COUNTER_ASPECTS_ATTRIB); handleGroupedCounterAspect(event, ss, counterAspect, rootQuark); } else { int rootQuark = ss.getQuarkAbsoluteAndAdd(CounterAnalysis.UNGROUPED_COUNTER_ASPECTS_ATTRIB); handleCounterAspect(event, ss, counterAspect, rootQuark); } } } }
Source:
public void onBackPressed() { if (doubleBackToExitPressedOnce) { super.onBackPressed(); return; } this.doubleBackToExitPressedOnce = true; Toast.makeText(this, "Please press back again to exit", Toast.LENGTH_SHORT).show(); new Handler().postDelayed(new Runnable() { @Override public void run() { doubleBackToExitPressedOnce=false; } }, 2000); }

Target:
public void onBackPressed() { if (doubleBackToExitPressedOnce) { super.onBackPressed(); return; } this.doubleBackToExitPressedOnce = true; Toast.makeText(this, this.getString(R.string.app_exit_toast_message), Toast.LENGTH_SHORT).show(); new Handler().postDelayed(new Runnable() { @Override public void run() { doubleBackToExitPressedOnce=false; } }, 2000); }
Source:
private void removeImages() { List<CinderDisk> cinderDisks = new ArrayList<>(); for (final DiskImage source : getSourceImages()) { if (source.getDiskStorageType() == DiskStorageType.CINDER) { cinderDisks.add((CinderDisk) source); continue; } List<DiskImage> images = diskImageDao.getAllSnapshotsForParent(source.getImageId()); DiskImage dest = null; if (!images.isEmpty()) { dest = images.get(0); } if (getSnapshotActionType() == VdcActionType.RemoveSnapshotSingleDiskLive) { CommandCoordinatorUtil.executeAsyncCommand( getSnapshotActionType(), buildRemoveSnapshotSingleDiskParameters(source, dest, getSnapshotActionType()), cloneContextAndDetachFromParent()); } else { RemoveSnapshotSingleDiskParameters parameters = buildRemoveSnapshotSingleDiskParameters( source, dest, getSnapshotActionType()); VdcReturnValueBase vdcReturnValue = runInternalActionWithTasksContext( getSnapshotActionType(), parameters); if (getSnapshotActionType() == VdcActionType.RemoveSnapshotSingleDisk && vdcReturnValue != null && vdcReturnValue.getInternalVdsmTaskIdList() != null) { getReturnValue().getVdsmTaskIdList().addAll(vdcReturnValue.getInternalVdsmTaskIdList()); } } List<Guid> quotasToRemoveFromCache = new ArrayList<>(); quotasToRemoveFromCache.add(source.getQuotaId()); if (dest != null) { quotasToRemoveFromCache.add(dest.getQuotaId()); } getQuotaManager().removeQuotaFromCache(getStoragePoolId(), quotasToRemoveFromCache); } if (!cinderDisks.isEmpty()) { handleCinderSnapshotDisks(cinderDisks); } }

Target:
private void removeImages() { List<CinderDisk> cinderDisks = new ArrayList<>(); for (final DiskImage source : getSourceImages()) { if (source.getDiskStorageType() == DiskStorageType.CINDER) { cinderDisks.add((CinderDisk) source); continue; } List<DiskImage> images = diskImageDao.getAllSnapshotsForParent(source.getImageId()); DiskImage dest = null; if (!images.isEmpty()) { dest = images.get(0); } if (getSnapshotActionType() == VdcActionType.RemoveSnapshotSingleDiskLive) { CommandCoordinatorUtil.executeAsyncCommand( getSnapshotActionType(), buildRemoveSnapshotSingleDiskParameters(source, dest, getSnapshotActionType()), cloneContextAndDetachFromParent()); } else { RemoveSnapshotSingleDiskParameters parameters = buildRemoveSnapshotSingleDiskParameters( source, dest, getSnapshotActionType()); VdcReturnValueBase vdcReturnValue = runInternalActionWithTasksContext( getSnapshotActionType(), parameters); if (getSnapshotActionType() == VdcActionType.RemoveSnapshotSingleDisk) { getTaskIdList().addAll(vdcReturnValue.getInternalVdsmTaskIdList()); } } List<Guid> quotasToRemoveFromCache = new ArrayList<>(); quotasToRemoveFromCache.add(source.getQuotaId()); if (dest != null) { quotasToRemoveFromCache.add(dest.getQuotaId()); } getQuotaManager().removeQuotaFromCache(getStoragePoolId(), quotasToRemoveFromCache); } if (!cinderDisks.isEmpty()) { handleCinderSnapshotDisks(cinderDisks); } }
Source:
private String encode(String user, String password) { try { byte[] message = (user + ":" + password).getBytes("UTF-8"); String encoded = javax.xml.bind.DatatypeConverter.printBase64Binary(message); return String.format("Basic %s", encoded); } catch (UnsupportedEncodingException e) { throw new IllegalArgumentException(e); } }

Target:
private String encode(String user, String password) { try { byte[] credentialsBytes = (user + ":" + password).getBytes("UTF-8"); String encoded = DatatypeConverter.printBase64Binary(credentialsBytes); return String.format("Basic %s", encoded); } catch (UnsupportedEncodingException e) { throw new IllegalArgumentException(e); } }
Source:
private TableDescriptor getTableDescriptor(String tableName) throws UndefinedTableException { TableDescriptor tableDescriptor = null; if (tableName == null || tableName.isEmpty()) { throw new UndefinedTableException(tableName); } tableName = tableName.toUpperCase(); for (int idx = 0; idx < schemaInfoTableDescriptors.size(); idx++) { TableDescriptor testDescriptor = schemaInfoTableDescriptors.get(idx); if (testDescriptor.getTableNameString().equalsIgnoreCase(tableName)) { tableDescriptor = testDescriptor; break; } } return tableDescriptor; }

Target:
private TableDescriptor getTableDescriptor(String tableName) throws UndefinedTableException { TableDescriptor tableDescriptor = null; if (tableName == null || tableName.isEmpty()) { throw new UndefinedTableException(tableName); } tableName = tableName.toUpperCase(); for (int idx = 0; idx < schemaInfoTableDescriptors.size(); idx++) { TableDescriptor testDescriptor = schemaInfoTableDescriptors.get(idx); if (testDescriptor.getTableNameString().equalsIgnoreCase(tableName)) { tableDescriptor = testDescriptor; break; } } if (tableDescriptor == null) { throw new UndefinedTableException(tableName); } return tableDescriptor; }
Source:
public AsyncFuture<LimitedSet<T>> transform(final SearchResponse response) throws Exception { final SearchHit[] hits = response.getHits().getHits(); for (final SearchHit hit : hits) { if (!results.add(converter.apply(hit))) { duplicates += 1; } else { size += 1; } if (limit.isGreater(size)) { results.remove(converter.apply(hit)); return async.resolved(new LimitedSet<>(limit.limitSet(results), true)); } } if (hits.length == 0) { return async.resolved(new LimitedSet<>(results, false)); } return scroller.get().lazyTransform(this); }

Target:
public AsyncFuture<LimitedSet<T>> transform(final SearchResponse response) throws Exception { final SearchHit[] hits = response.getHits().getHits(); for (final SearchHit hit : hits) { final T convertedHit = converter.apply(hit); if (!results.add(convertedHit)) { duplicates += 1; } else { size += 1; } if (limit.isGreater(size)) { results.remove(convertedHit); return async.resolved(new LimitedSet<>(limit.limitSet(results), true)); } } if (hits.length == 0) { return async.resolved(new LimitedSet<>(results, false)); } return scroller.get().lazyTransform(this); }
Source:
private void saveToFile() { synchronized (authInfo) { NotebookAuthorizationInfoSaving info = new NotebookAuthorizationInfoSaving(); info.authInfo = authInfo; try { configStorage.save(info); } catch (IOException e) { LOG.error("Error saving notebook authorization file: " + e.getMessage()); } } }

Target:
private void saveToFile() { synchronized (authInfo) { NotebookAuthorizationInfoSaving info = new NotebookAuthorizationInfoSaving(); info.authInfo = authInfo; try { configStorage.save(info); } catch (IOException e) { LOG.error("Error saving notebook authorization file", e); } } }
Source:
public void enableDocumentValidation() { for (final MappedClass mc : mapper.getMappedClasses()) { Validation validation = (Validation) mc.getAnnotation(Validation.class); if (validation != null) { String collectionName = mc.getCollectionName(); CommandResult result = getDB() .command(new BasicDBObject("collMod", collectionName) .append("validator", Document.parse(validation.value())) .append("validationLevel", validation.level().getValue()) .append("validationAction", validation.action().getValue()) ); if (!result.ok()) { if (result.getInt("code") == 26) { try { ValidationOptions options = new ValidationOptions() .validator(Document.parse(validation.value())) .validationLevel(validation.level()) .validationAction(validation.action()); getDatabase().createCollection(collectionName, new CreateCollectionOptions() .validationOptions(options)); } catch (JsonParseException e) { LOG.warning(format("Could not parse validator for '%s:' %s", collectionName, e.getMessage())); } } else { LOG.warning(format("Could not add document validation on '%s:' %s", collectionName, result.getErrorMessage())); } } } } }

Target:
public void enableDocumentValidation() { for (final MappedClass mc : mapper.getMappedClasses()) { process(mc, (Validation) mc.getAnnotation(Validation.class)); } }
Source:
public boolean segmentsAreFromSamePartitionSet( final Set<DataSegment> segments ) { Preconditions.checkArgument(!segments.isEmpty(), "segments nonempty"); final DataSegment firstSegment = segments.iterator().next(); for (final DataSegment segment : segments) { if (!segment.getDataSource().equals(firstSegment.getDataSource())) { return false; } if (!segment.getInterval().equals(firstSegment.getInterval())) { return false; } if (!segment.getVersion().equals(firstSegment.getVersion())) { return false; } } return true; }

Target:
public boolean segmentsAreFromSamePartitionSet( final Set<DataSegment> segments ) { Preconditions.checkArgument(!segments.isEmpty(), "segments nonempty"); final DataSegment firstSegment = segments.iterator().next(); for (final DataSegment segment : segments) { if (!segment.getDataSource().equals(firstSegment.getDataSource()) || !segment.getInterval().equals(firstSegment.getInterval()) || !segment.getVersion().equals(firstSegment.getVersion())) { return false; } } return true; }
Source:
public void fetchData(final String resourceClass) { fFetchingContent = true; notifyUI(); final DsfExecutor executor = fSession.getExecutor(); executor.submit(new DsfRunnable() { @Override public void run() { fHardwareOs.getResourcesInformation(fContext, resourceClass, new DataRequestMonitor<IGDBHardwareAndOS.IResourcesInformation>(executor, null) { @Override @ConfinedToDsfExecutor("fExecutor") protected void handleCompleted() { fFetchingContent = false; if (isSuccess()) { OSData data = new OSData(resourceClass, getData()); fExistingData.put(resourceClass, data); fTimestamp.put(resourceClass, new Date()); } else { StatusManager.getManager().handle(getStatus(), StatusManager.BLOCK); } notifyUI(); } }); } }); }

Target:
public void fetchData(final String resourceClass) { fFetchingContent = true; notifyUI(); final DsfExecutor executor = fSession.getExecutor(); executor.submit(new DsfRunnable() { @Override public void run() { fHardwareOs.getResourcesInformation(fContext, resourceClass, new DataRequestMonitor<IGDBHardwareAndOS2.IResourcesInformation>(executor, null) { @Override @ConfinedToDsfExecutor("fExecutor") protected void handleCompleted() { fFetchingContent = false; if (isSuccess()) { OSData data = new OSData(resourceClass, getData()); fExistingData.put(resourceClass, data); fTimestamp.put(resourceClass, new Date()); } else { StatusManager.getManager().handle(getStatus(), StatusManager.BLOCK); } notifyUI(); } }); } }); }
Source:
private void testColumnsSort(String listTarget) { ListPage page = getList(listTarget); DataTable table = page.getTable(); List<String> headings = table.getColumnHeadings(); headings.forEach(heading -> { page.sortByColumn(heading); assertTrue("sort once on column '" + heading + "' without errors", LimsUtils.isStringEmptyOrNull(page.getErrors().getText())); page.sortByColumn(heading); assertTrue("sort twice on column '" + heading + "' without errors", LimsUtils.isStringEmptyOrNull(page.getErrors().getText())); }); }

Target:
private void testColumnsSort(String listTarget) { ListPage page = getList(listTarget); sortColumns(page.getTable(), page); }
Source:
public OnThisDayPagesViewHolder onCreateViewHolder(@NonNull ViewGroup viewGroup, int i) { View itemView = LayoutInflater. from(viewGroup.getContext()). inflate(R.layout.item_on_this_day_pages, viewGroup, false); return new OnThisDayPagesViewHolder((Activity) viewGroup.getContext(), fragmentManager, (MaterialCardView) itemView, wiki); }

Target:
public OnThisDayPagesViewHolder onCreateViewHolder(@NonNull ViewGroup viewGroup, int i) { View itemView = LayoutInflater. from(viewGroup.getContext()). inflate(R.layout.item_on_this_day_pages, viewGroup, false); return new OnThisDayPagesViewHolder((Activity) viewGroup.getContext(), fragmentManager, itemView, wiki); }
Source:
private static String getSqlScriptsDir() throws IOException { final String dummyResourcePath = getUserManagerXmlFile(); Path resources = Paths.get(dummyResourcePath).getParent(); Path azkabanRoot = resources.getParent().getParent().getParent().getParent(); File sqlScriptDir = Paths.get(azkabanRoot.toString(), AZKABAN_DB_SQL_PATH).toFile(); return props.getString(AzkabanDatabaseSetup.DATABASE_SQL_SCRIPT_DIR, sqlScriptDir.getCanonicalPath()); }

Target:
private static String getSqlScriptsDir() throws IOException { final String dummyResourcePath = getUserManagerXmlFile(); Path resources = Paths.get(dummyResourcePath).getParent(); Path azkabanRoot = resources.getParent().getParent().getParent().getParent(); File sqlScriptDir = Paths.get(azkabanRoot.toString(), AZKABAN_DB_SQL_PATH).toFile(); return sqlScriptDir.getCanonicalPath(); }
Source:
protected void createUniqueConstraints(DatastoreProvider provider, Database database) { List<UniqueConstraintDetails> constraints = new ArrayList<>(); for ( Namespace namespace : database.getNamespaces() ) { for ( Table table : namespace.getTables() ) { if ( table.isPhysicalTable() ) { Label label = label( table.getName() ); PrimaryKey primaryKey = table.getPrimaryKey(); createConstraint( constraints, table, label, primaryKey ); @SuppressWarnings("unchecked") Iterator<Column> columnIterator = table.getColumnIterator(); while ( columnIterator.hasNext() ) { Column column = columnIterator.next(); if ( column.isUnique() ) { constraints.add( new UniqueConstraintDetails( label, column.getName() ) ); } } Iterator<UniqueKey> uniqueKeyIterator = table.getUniqueKeyIterator(); while ( uniqueKeyIterator.hasNext() ) { createConstraint( constraints, table, label, uniqueKeyIterator.next() ); } } } } createUniqueConstraintsIfMissing( provider, constraints ); }

Target:
protected void createUniqueConstraints(DatastoreProvider provider, Database database) { List<UniqueConstraintDetails> constraints = new ArrayList<>(); for ( Namespace namespace : database.getNamespaces() ) { for ( Table table : namespace.getTables() ) { if ( table.isPhysicalTable() ) { Label label = label( table.getName() ); PrimaryKey primaryKey = table.getPrimaryKey(); addConstraint( constraints, table, label, primaryKey ); @SuppressWarnings("unchecked") Iterator<Column> columnIterator = table.getColumnIterator(); while ( columnIterator.hasNext() ) { Column column = columnIterator.next(); if ( column.isUnique() ) { constraints.add( new UniqueConstraintDetails( label, column.getName() ) ); } } Iterator<UniqueKey> uniqueKeyIterator = table.getUniqueKeyIterator(); while ( uniqueKeyIterator.hasNext() ) { addConstraint( constraints, table, label, uniqueKeyIterator.next() ); } } } } createUniqueConstraintsIfMissing( provider, constraints ); }
Source:
public void start(StartContext context) throws StartException { if (getSecurityDomainFutures != null) { Runnable task = () -> { try { getSecurityDomainFutures.forEach(FutureTask::run); List<Supplier<SecurityDomain>> domains = getSecurityDomainFutures.stream().map(f -> (Supplier<SecurityDomain>) (() -> toSecurityDomain(f))).collect(Collectors.toList()); securityIdentitySupplier.setConfiguredSecurityDomainSupplier(domains.get(0)); domains.remove(0); if (domains.size() > 0) { securityIdentitySupplier.setInflowSecurityDomainSuppliers(domains); } context.complete(); } catch (RuntimeException t) { context.failed(DomainManagementLogger.SECURITY_LOGGER.unableToConfigureManagementSecurityDomain(t)); } }; try { task.run(); } finally { context.asynchronous(); } } }

Target:
public void start(StartContext context) throws StartException { securityIdentitySupplier.setConfiguredSecurityDomainSupplier(configuredSecurityDomain::getValue); }
Source:
public void enableDefaultSlf4jLoggingOfOutputData() { addSlf4jLogMessageConsumer((logMessage, ctx) -> { if (ctx.level().equals(DEBUG)) { ctx.logger().debug(logMessage); } else { ctx.logger().info(logMessage); } }); }

Target:
public void enableDefaultSlf4jLoggingOfOutputData() { addSlf4jLogMessageConsumer((logMessage, ctx) -> { if (ctx.getLevel().equals(DEBUG)) { ctx.getLogger().debug(logMessage); } else { ctx.getLogger().info(logMessage); } }); }
Source:
public void registerSupplyMessage(final UUID nodeId, final GridDhtPartitionSupplyMessage supplyMsg, final Runnable r) { final RebalanceFuture fut = rebalanceFut; if (fut.isActual(supplyMsg.rebalanceId())) { boolean historical = false; for (Integer p : supplyMsg.infos().keySet()) { fut.queued.get(p).increment(); if (fut.histRebalancingParts.get(nodeId).contains(p)) historical = true; } if (historical) ctx.kernalContext().getStripedRebalanceExecutorService().execute(r, Math.abs(nodeId.hashCode())); else ctx.kernalContext().getRebalanceExecutorService().execute(r); } }

Target:
public void registerSupplyMessage(final UUID nodeId, final GridDhtPartitionSupplyMessage supplyMsg, final Runnable r) { final RebalanceFuture fut = rebalanceFut; if (fut.isActual(supplyMsg.rebalanceId())) { boolean historical = false; for (Integer p : supplyMsg.infos().keySet()) { fut.queued.get(p).increment(); if (fut.historical.contains(p)) historical = true; } if (historical) ctx.kernalContext().getStripedRebalanceExecutorService().execute(r, Math.abs(nodeId.hashCode())); else ctx.kernalContext().getRebalanceExecutorService().execute(r); } }
Source:
private boolean isStatusChangeValid(final Long previousStatusTypeId, final Long newStatusTypeId) { try { crStatusTypeDAO.getChangeRequestStatusTypeById(newStatusTypeId); } catch (EntityRetrievalException e) { return false; } if (previousStatusTypeId == this.cancelledByRequesterStatus) { return false; } return true; }

Target:
private boolean isStatusChangeValid(final Long previousStatusTypeId, final Long newStatusTypeId) { try { crStatusTypeDAO.getChangeRequestStatusTypeById(newStatusTypeId); } catch (EntityRetrievalException e) { return false; } if (previousStatusTypeId.equals(this.cancelledByRequesterStatus)) { return false; } return true; }
Source:
public static Session signIn(SignInCredentials signIn) { checkNotNull(signIn, "SignInCredentials required."); checkArgument(isNotBlank(signIn.getStudyIdentifier()), "Study identifier cannot be blank/null"); checkArgument(isNotBlank(signIn.getUsername()), "Username cannot be blank/null"); checkArgument(isNotBlank(signIn.getPassword()), "Password cannot be blank/null"); UserSession session = new BaseApiCaller(null).post(config.getAuthSignInApi(), signIn, UserSession.class); return new BridgeSession(session); }

Target:
public static Session signIn(SignInCredentials signIn) { checkNotNull(signIn, "SignInCredentials required."); UserSession session = new BaseApiCaller(null).post(config.getAuthSignInApi(), signIn, UserSession.class); return new BridgeSession(session); }
Source:
public PieceCount getPieceCount() { PieceCount ret = new PieceCount(0); for (AbstractPiece<I, V, E, M, WV, WM, S> innerPiece : innerPieces) { ret.add(innerPiece.getPieceCount()); } return ret; }

Target:
public PieceCount getPieceCount() { return new PieceCount(1); }
Source:
protected JDBCDataStore createDataStoreInternal(JDBCDataStore dataStore, Map params) throws IOException { PostGISDialect dialect = (PostGISDialect) dataStore.getSQLDialect(); Boolean loose = (Boolean) LOOSEBBOX.lookUp(params); dialect.setLooseBBOXEnabled(loose == null || Boolean.TRUE.equals(loose)); Boolean estimated = (Boolean) ESTIMATED_EXTENTS.lookUp(params); dialect.setEstimatedExtentsEnabled(estimated == null || Boolean.TRUE.equals(estimated)); Boolean encodeFunctions = (Boolean) ENCODE_FUNCTIONS.lookUp(params); dialect.setFunctionEncodingEnabled(encodeFunctions != null && encodeFunctions); Boolean usePs = (Boolean) PREPARED_STATEMENTS.lookUp(params); if(Boolean.TRUE.equals(usePs)) { dataStore.setSQLDialect(new PostGISPSDialect(dataStore, dialect)); } Boolean simplify = (Boolean) SIMPLIFY.lookUp(params); dialect.setSimplifyEnabled(simplify == null || simplify); Boolean encodeBBOXAsEnvelope = (Boolean) ENCODE_BBOX_FILTER_USING_ENVELOPE.lookUp(params); dialect.setEncodeBBOXFilterAsEnvelope(encodeBBOXAsEnvelope != null && Boolean.TRUE.equals(encodeBBOXAsEnvelope)); return dataStore; }

Target:
protected JDBCDataStore createDataStoreInternal(JDBCDataStore dataStore, Map params) throws IOException { PostGISDialect dialect = (PostGISDialect) dataStore.getSQLDialect(); Boolean loose = (Boolean) LOOSEBBOX.lookUp(params); dialect.setLooseBBOXEnabled(loose == null || Boolean.TRUE.equals(loose)); Boolean estimated = (Boolean) ESTIMATED_EXTENTS.lookUp(params); dialect.setEstimatedExtentsEnabled(estimated == null || Boolean.TRUE.equals(estimated)); Boolean encodeFunctions = (Boolean) ENCODE_FUNCTIONS.lookUp(params); dialect.setFunctionEncodingEnabled(encodeFunctions != null && encodeFunctions); Boolean usePs = (Boolean) PREPARED_STATEMENTS.lookUp(params); if(Boolean.TRUE.equals(usePs)) { dataStore.setSQLDialect(new PostGISPSDialect(dataStore, dialect)); } Boolean simplify = (Boolean) SIMPLIFY.lookUp(params); dialect.setSimplifyEnabled(simplify == null || simplify); Boolean encodeBBOXAsEnvelope = true; String largeGeometriesOptimized = System.getProperty("org.geotools.data.postgis.largeGeometriesOptimize"); if(largeGeometriesOptimized != null) { encodeBBOXAsEnvelope = largeGeometriesOptimized.toLowerCase().equals("true"); } dialect.setEncodeBBOXFilterAsEnvelope(encodeBBOXAsEnvelope != null && Boolean.TRUE.equals(encodeBBOXAsEnvelope)); return dataStore; }
Source:
protected void setConnector(AbstractRepositoryConnector connector) { this.connector = connector; }

Target:
private void setConnector(AbstractRepositoryConnector connector) { this.connector = connector; }
Source:
private List<ServiceInfo> prepareServiceInfo(Map<String, Object> statusInfo) { List<ServiceInfo> serviceInfoList = new ArrayList<ServiceInfo>(); if (statusInfo.containsKey(NFS)) { Object[] nfsServiceInfo = (Object[]) statusInfo.get(NFS); for (Object nfsObj : nfsServiceInfo) { Map<String, Object> nfsMap = (Map<String, Object>) nfsObj; ServiceInfo nfsInfo = parseServiceInfo(nfsMap); nfsInfo.setNfsServices(true); serviceInfoList.add(nfsInfo); } } if (statusInfo.containsKey(SHD)) { Object[] shdServiceInfo = (Object[]) statusInfo.get(SHD); for (Object shdObj : shdServiceInfo) { Map<String, Object> shdMap = (Map<String, Object>) shdObj; ServiceInfo shdInfo = parseServiceInfo(shdMap); shdInfo.setShdServices(true); serviceInfoList.add(shdInfo); } } return serviceInfoList; }

Target:
private List<ServiceInfo> prepareServiceInfo(Map<String, Object> statusInfo) { List<ServiceInfo> serviceInfoList = new ArrayList<ServiceInfo>(); getServiceInfo(statusInfo, serviceInfoList, ServiceType.NFS); getServiceInfo(statusInfo, serviceInfoList, ServiceType.SHD); return serviceInfoList; }
Source:
private void gracefulShutdownCrate(ExecutorDriver driver) { driver.sendStatusUpdate(TaskStatus.newBuilder() .setTaskId(currentTaskId) .setState(TaskState.TASK_KILLING) .build()); boolean success = task.gracefulStop(); if (success) { driver.sendStatusUpdate(TaskStatus.newBuilder() .setTaskId(currentTaskId) .setState(TaskState.TASK_KILLED) .build()); driver.stop(); } else { driver.sendStatusUpdate(TaskStatus.newBuilder() .setTaskId(currentTaskId) .setState(TaskState.TASK_RUNNING) .build()); } }

Target:
private void gracefulShutdownCrate(ExecutorDriver driver) { sendTaskStatus(driver, TaskState.TASK_KILLING); boolean success = task.gracefulStop(); if (success) { sendTaskStatus(driver, TaskState.TASK_KILLED); driver.stop(); } else { sendTaskStatus(driver, TaskState.TASK_RUNNING); } }
Source:
private void loadUDDIConnectionInfo() throws ConnectionManagerException { BusinessDetail businessDetail = null; try { businessDetail = getUddiConnectionManagerDAO().loadBusinessDetail(); } catch (Exception ex) { LOG.error("Could not load UDDI business details: " + ex.getLocalizedMessage(), ex); } if (businessDetail != null) { synchronized (m_hUDDIConnectInfo) { m_hUDDIConnectInfo.clear(); if (businessDetail.getBusinessEntity() != null && !businessDetail.getBusinessEntity().isEmpty()) { for (BusinessEntity oEntity : businessDetail.getBusinessEntity()) { ConnectionManagerCacheHelper helper = new ConnectionManagerCacheHelper(); String sHomeCommunityId = helper.getCommunityId(oEntity); if (sHomeCommunityId != null && sHomeCommunityId.length() > 0) { m_hUDDIConnectInfo.put(sHomeCommunityId, oEntity); } } } m_bUDDILoaded = true; m_lUDDIFileLastModified = getUddiConnectionManagerDAO().getLastModified(); } } else { LOG.warn("No UDDI information was found"); } }

Target:
private void loadUDDIConnectionInfo() throws ConnectionManagerException { BusinessDetail businessDetail = null; try { businessDetail = getUddiConnectionManagerDAO().loadBusinessDetail(); } catch (Exception ex) { LOG.error("Could not load UDDI business details: " + ex.getLocalizedMessage(), ex); } if (businessDetail != null) { synchronized (m_hUDDIConnectInfo) { m_hUDDIConnectInfo.clear(); if (businessDetail.getBusinessEntity() != null && !businessDetail.getBusinessEntity().isEmpty()) { for (BusinessEntity oEntity : businessDetail.getBusinessEntity()) { ConnectionManagerCacheHelper helper = new ConnectionManagerCacheHelper(); String sHomeCommunityId = helper.getCommunityId(oEntity); if (StringUtils.isNotEmpty(sHomeCommunityId)) { m_hUDDIConnectInfo.put(sHomeCommunityId, oEntity); } } } m_bUDDILoaded = true; m_lUDDIFileLastModified = getUddiConnectionManagerDAO().getLastModified(); } } else { LOG.warn("No UDDI information was found"); } }
Source:
@Override void runSynchronousPart() { if (column != null) { column.setLastSaveTime(this.colInfo.world.getTotalWorldTime()); } }

Target:
@Override void runSynchronousPart() { if (column != null) { column.setLastSaveTime(this.colInfo.world.getTotalWorldTime()); } runCallbacks(); }
Source:
public boolean isJobAlreadyProcessed(byte[] row) { Get get = new Get(row); get.addColumn(Constants.INFO_FAM_BYTES, Constants.JOB_PROCESSED_SUCCESS_COL_BYTES); boolean success = false; Result result = null; try { result = rawTable.get(get); } catch (IOException e) { return success; } try { if (result != null && !result.isEmpty()) { byte[] successBytes = result.getValue(Constants.INFO_FAM_BYTES, Constants.JOB_PROCESSED_SUCCESS_COL_BYTES); if (successBytes != null) { success = Bytes.toBoolean(successBytes); } } } catch (Exception e) { return success; } return success; }

Target:
public boolean isJobAlreadyProcessed(byte[] row) throws ProcessingException { if (row == null) { throw new ProcessingException("Row key can't be null"); } Get get = new Get(row); get.addColumn(Constants.INFO_FAM_BYTES, Constants.JOB_PROCESSED_SUCCESS_COL_BYTES); Result result = null; try { result = rawTable.get(get); } catch (IOException e) { return false; } if (result != null && !result.isEmpty()) { byte[] processedSuccessBytes = result.getValue(Constants.INFO_FAM_BYTES, Constants.JOB_PROCESSED_SUCCESS_COL_BYTES); if (processedSuccessBytes != null) { return Bytes.toBoolean(processedSuccessBytes); } } return false; }
Source:
public MutateRowRequest adapt(Put put) { Mutation mutation = Mutation.create(); mutationAdapters.putAdapter.adapt(put, mutation); return toMutateRowRequest(put.getRow(), mutation); }

Target:
public MutateRowRequest adapt(Put put) { RowMutation rowMutation = newRowMutationModel(put.getRow()); adapt(put, rowMutation); return rowMutation.toProto(requestContext); }
Source:
private void updateList() { if (mLinear) { mList.setLayoutManager(mLinearManager); } else { mList.setLayoutManager(mGridManager); } mList.setAdapter(null); mAdapter.notifyDataSetChanged(); mAdapter.setLinear(mLinear); mList.setAdapter(mAdapter); if (mSwitch != null) { boolean isLight = ThemeHelper.isLightThemeSelected(mContext); int icon; if (mLinear) icon = R.drawable.ic_apps_white_24dp; else icon = R.drawable.ic_list_white_24dp; mSwitch.setIcon(icon); mSwitch.setTitle(mLinear ? R.string.grid : R.string.list); mPrefs.edit().putBoolean("linear", mLinear).apply(); } }

Target:
private void updateList() { if (mLinear) { mList.setLayoutManager(mLinearManager); } else { mList.setLayoutManager(mGridManager); } mList.setAdapter(null); mAdapter.notifyDataSetChanged(); mAdapter.setLinear(mLinear); mList.setAdapter(mAdapter); if (mSwitch != null) { mSwitch.setIcon(mLinear ? R.drawable.ic_apps_white_24dp : R.drawable.ic_list_white_24dp); mSwitch.setTitle(mLinear ? R.string.grid : R.string.list); mPrefs.edit().putBoolean("linear", mLinear).apply(); } }
Source:
public void onSuggestedEditsCardClick(@NotNull PageTitle pageTitle, @NotNull String sourceDescription, @NotNull String sourceLangCode, @NotNull SuggestedEditsCardView view) { suggestedEditsCardView = view; descriptionEditPageTitle = pageTitle; FeedFragment.this.sourceDescription = sourceDescription; FeedFragment.this.sourceLangCode = sourceLangCode; if (Prefs.showEditTaskOnboarding()) { startActivityForResult(SuggestedEditsOnboardingActivity.Companion.newIntent(requireContext(), Constants.InvokeSource.FEED), ACTIVITY_REQUEST_SUGGESTED_EDITS_ONBOARDING); } else { startDescriptionEditScreen(); } }

Target:
public void onSuggestedEditsCardClick(@NotNull PageTitle pageTitle, @NotNull String sourceDescription, @NotNull String sourceLangCode, @NotNull SuggestedEditsCardView view) { suggestedEditsCardView = view; descriptionEditPageTitle = pageTitle; FeedFragment.this.sourceDescription = sourceDescription; FeedFragment.this.sourceLangCode = sourceLangCode; if (Prefs.showEditTaskOnboarding()) { startActivityForResult(SuggestedEditsOnboardingActivity.Companion.newIntent(requireContext(), FEED_CARD_SUGGESTED_EDITS_ADD_DESC), ACTIVITY_REQUEST_SUGGESTED_EDITS_ONBOARDING); } else { startDescriptionEditScreen(); } }
Source:
public void setShipping(final Shipping shipping) { this.shipping = shipping; addUnsavedProperty("shipping"); }

Target:
public void setShipping(final Shipping shipping) { this.shipping = shipping; }
Source:
public void callPrivateMethodWithCalendarParam() { Assert.assertNull(controller.getModel().getCalendarValue()); Calendar value = Calendar.getInstance(); controller.invoke(PUBLIC_WITH_CALENDER_PARAM_ACTION, new Param(PARAM_NAME, value)); Assert.assertEquals(controller.getModel().getCalendarValue().getTime(), value.getTime()); }

Target:
public void callPrivateMethodWithCalendarParam() { Assert.assertNull(controller.getModel().getCalendarValue()); final Calendar value = Calendar.getInstance(); controller.invoke(PUBLIC_WITH_CALENDER_PARAM_ACTION, new Param(PARAM_NAME, value)); Assert.assertEquals(controller.getModel().getCalendarValue().getTime(), value.getTime()); }
Source:
public ModelAndView viewServiceRecord(@PathVariable(value = "recordId") Long recordId, ModelMap model) throws IOException { SequencerServiceRecord sr = requestManager.getSequencerServiceRecordById(recordId); if (sr != null) { model.put("serviceRecord", sr); model.put("serviceRecordFiles", populateServiceRecordFiles(sr)); } else { throw new IOException("Cannot retrieve the requested Service Record"); } return new ModelAndView("/pages/editServiceRecord.jsp", model); }

Target:
public ModelAndView viewServiceRecord(@PathVariable(value = "recordId") Long recordId, ModelMap model) throws IOException { SequencerServiceRecord sr = requestManager.getSequencerServiceRecordById(recordId); if (sr != null) { model.put(ModelKeys.RECORD.getKey(), sr); model.put(ModelKeys.FILES.getKey(), populateServiceRecordFiles(sr)); } else { throw new IOException("No such Service Record"); } return new ModelAndView("/pages/editServiceRecord.jsp", model); }
Source:
public void invariant() { super.invariant(); Assert.assertTrue(currentPathStartsWith("/courses/ti1705/TI1705/groups/")); }

Target:
public void invariant() { super.invariant(); Assert.assertTrue(currentPathContains("deliveries")); }
Source:
public void initialize(ConfigurableApplicationContext applicationContext) { applicationContext.getBeanFactory().addBeanPostProcessor(new BeanPostProcessor() { @Override public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException { return bean; } @Override public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException { if (beanName.equals("secretManager")) { MutablePropertySources src = applicationContext.getEnvironment().getPropertySources(); List<EnumerablePropertySource> sources = new ArrayList<>(); for (Iterator<PropertySource<?>> it = src.iterator(); it.hasNext(); ) { PropertySource ps = it.next(); if (ps instanceof EnumerablePropertySource) { sources.add((EnumerablePropertySource) ps); } } for (EnumerablePropertySource s : sources) { src.replace(s.getName(), new SecretAwarePropertySource(s, (SecretManager) bean)); } } return bean; } }); }

Target:
public void initialize(ConfigurableApplicationContext applicationContext) { applicationContext.getBeanFactory().addBeanPostProcessor(new SecretBeanPostProcessor(applicationContext)); }
Source:
public Command getNewRepoCommand() { return newRepoCommand; }

Target:
Command getNewRepoCommand() { return newRepoCommand; }
Source:
private void fetchNestedTemplate(PresenterOptions presenterOptions) throws Exception { NestedPresenterOptions nestedPresenterOptions = new NestedPresenterOptions(); nestedPresenterOptions.setPlace(presenterConfigModel.isUsePlace()); nestedPresenterOptions.setNameToken(presenterConfigModel.getNameToken()); nestedPresenterOptions.setCrawlable(presenterConfigModel.isUseCrawlable()); nestedPresenterOptions.setCodeSplit(presenterConfigModel.isUseCodesplit()); nestedPresenterOptions.setNameToken(presenterConfigModel.getNameTokenWithClass()); nestedPresenterOptions.setNameTokenImport(presenterConfigModel.getNameTokenUnitImport()); nestedPresenterOptions.setContentSlotImport(presenterConfigModel.getContentSlotImport()); if (presenterConfigModel.getRevealInRoot()) { nestedPresenterOptions.setRevealType("Root"); } else if (presenterConfigModel.getRevealInRootLayout()) { nestedPresenterOptions.setRevealType("RootLayout"); } else if (presenterConfigModel.getPopupPresenter()) { nestedPresenterOptions.setRevealType("RootPopup"); } else if (presenterConfigModel.getRevealInSlot()) { nestedPresenterOptions.setRevealType(presenterConfigModel.getContentSlot()); } try { createdNestedPresenterTemplates = CreateNestedPresenter.run(presenterOptions, nestedPresenterOptions, true); } catch (Exception e) { throw e; } }

Target:
private void fetchNestedTemplate(PresenterOptions presenterOptions) throws Exception { NestedPresenterOptions nestedPresenterOptions = new NestedPresenterOptions(); nestedPresenterOptions.setPlace(presenterConfigModel.isUsePlace()); nestedPresenterOptions.setNameToken(presenterConfigModel.getNameToken()); nestedPresenterOptions.setCrawlable(presenterConfigModel.isUseCrawlable()); nestedPresenterOptions.setCodeSplit(presenterConfigModel.isUseCodesplit()); nestedPresenterOptions.setNameToken(presenterConfigModel.getNameTokenWithClass()); nestedPresenterOptions.setNameTokenImport(presenterConfigModel.getNameTokenUnitImport()); nestedPresenterOptions.setContentSlotImport(presenterConfigModel.getContentSlotImport()); if (presenterConfigModel.getRevealInRoot()) { nestedPresenterOptions.setRevealType("Root"); } else if (presenterConfigModel.getRevealInRootLayout()) { nestedPresenterOptions.setRevealType("RootLayout"); } else if (presenterConfigModel.getPopupPresenter()) { nestedPresenterOptions.setRevealType("RootPopup"); } else if (presenterConfigModel.getRevealInSlot()) { nestedPresenterOptions.setRevealType(presenterConfigModel.getContentSlot()); } createdNestedPresenterTemplates = CreateNestedPresenter.run(presenterOptions, nestedPresenterOptions, true); }
Source:
private void markCommon(final RevObject obj, final AckNackResult anr) throws IOException { if (statelessRPC && anr == AckNackResult.ACK_COMMON && !obj.has(COMMON)) pckState.writeString("have " + obj.name() + "\n"); obj.add(COMMON); if (obj instanceof RevCommit) ((RevCommit) obj).carry(COMMON); }

Target:
private void markCommon(final RevObject obj, final AckNackResult anr) throws IOException { if (statelessRPC && anr == AckNackResult.ACK_COMMON && !obj.has(COMMON)) { StringBuilder s; s = new StringBuilder(6 + Constants.OBJECT_ID_STRING_LENGTH); s.append("have "); s.append(obj.name()); s.append('\n'); pckState.writeString(s.toString()); } obj.add(COMMON); if (obj instanceof RevCommit) ((RevCommit) obj).carry(COMMON); }
Source:
private void initialiseAsync() { runAsync.accept(() -> { while (uninitialised()) { try { initialise(); } catch (Throwable th) { log.warn("Async initialisation failed, retrying in 30 seconds.", th); Uninterruptibles.sleepUninterruptibly(30, TimeUnit.SECONDS); } } }); }

Target:
private void initialiseAsync() { runAsync.accept(() -> { while (!isInitialized()) { try { initialise(); } catch (IllegalArgumentException ex) { log.info("Async initialisation failed, the service is in a state which will require " + "manual intervention to start.", ex); break; } catch (Throwable th) { log.info("Async initialisation failed, retrying in seconds.", RETRY_AFTER_SECONDS, th); Uninterruptibles.sleepUninterruptibly(RETRY_AFTER_SECONDS, TimeUnit.SECONDS); } } }); }
Source:
public static ConcurrentHistogram createHdrHistogram( long highestTrackableValue ) { return new ConcurrentHistogram( highestTrackableValue, 3 ); }

Target:
public static ConcurrentHistogram createHdrHistogram( long highestTrackableValue ) { return new ConcurrentHistogram( highestTrackableValue, DEFAULT_NUMBER_OF_SIGNIFICANT_VALUE_DIGITS ); }
Source:
public int getConnectionId() { return this.channel != null ? this.channel.hashCode() : 0; }

Target:
public int getConnectionId() { return Objects.hashCode(this.channel); }
Source:
public long getScheduledTime() { Date date = instance.getScheduledDate(); if (date != null) { return date.getTime(); } return -1; }

Target:
private long getScheduledTime() { Date date = instance.getScheduledDate(); if (date != null) { return date.getTime(); } return -1; }
Source:
public void insertPastState(long stateStartTime, long stateEndTime, int quark, ITmfStateValue value) throws TimeRangeException { @SuppressWarnings("restriction") final int nbAttributes = fPartialSS.getNbAttributes(); if (!fInitialized) { fCheckpointQuark = fPartialSS.getQuarkAbsoluteAndAdd(CHECKPOINT_NAME); fQuarksAdded.clear(); rebuildQuarks(nbAttributes, Boolean.TRUE); fCheckpoints.add(fPartialInput.getStartTime()); fInitialized = true; } if (quark == fCheckpointQuark) { fQuarksAdded.clear(); rebuildQuarks(nbAttributes, Boolean.TRUE); fCheckpoints.add(stateEndTime); return; } if (stateEndTime > fLatestTime) { fLatestTime = stateEndTime; } boolean insert = false; if (quark >= fQuarksAdded.size()) { rebuildQuarks(nbAttributes, Boolean.FALSE); insert = true; } if (fQuarksAdded.get(quark)) { fQuarksAdded.set(quark, Boolean.FALSE); insert = true; } if (insert) { fInnerHistory.insertPastState(stateStartTime, stateEndTime, quark, value); } }

Target:
public void insertPastState(long stateStartTime, long stateEndTime, int quark, ITmfStateValue value) throws TimeRangeException { final int nbAttributes = ((ITmfStateSystem) fPartialSS).getNbAttributes(); if (!fInitialized) { fCheckpointQuark = fPartialSS.getQuarkAbsoluteAndAdd(CHECKPOINT_NAME); fQuarksAdded.clear(); rebuildQuarks(nbAttributes, Boolean.TRUE); fCheckpoints.add(fPartialInput.getStartTime()); fInitialized = true; } if (quark == fCheckpointQuark) { fQuarksAdded.clear(); rebuildQuarks(nbAttributes, Boolean.TRUE); fCheckpoints.add(stateEndTime); return; } if (stateEndTime > fLatestTime) { fLatestTime = stateEndTime; } boolean insert = false; if (quark >= fQuarksAdded.size()) { rebuildQuarks(nbAttributes, Boolean.FALSE); insert = true; } if (fQuarksAdded.get(quark)) { fQuarksAdded.set(quark, Boolean.FALSE); insert = true; } if (insert) { fInnerHistory.insertPastState(stateStartTime, stateEndTime, quark, value); } }