auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public <T extends Event> void offerPaymentStateTransition( String externalId, ChargeStatus fromChargeState, ChargeStatus targetChargeState, ChargeEventEntity chargeEventEntity, Class<T> eventClass) { PaymentStateTransition transition = new PaymentStateTransition(chargeEventEntity.getId(), eventClass); stateTransitionQueue.offer(transition); var logMessage = format("Offered payment state transition to emitter queue [from=%s] [to=%s] [chargeEventId=%s] [chargeId=%s]", fromChargeState, targetChargeState, chargeEventEntity.getId(), externalId); metricRegistry.counter(String.format( <START> "gateway-operations.%s.%s.%s.payment-state-transition-to.%s", <END> chargeEventEntity.getChargeEntity().getGatewayAccount().getGatewayName(), chargeEventEntity.getChargeEntity().getGatewayAccount().getType(), chargeEventEntity.getChargeEntity().getGatewayAccount().getId(), targetChargeState)).inc(); Object[] structuredArgs = ArrayUtils.addAll( chargeEventEntity.getChargeEntity().getStructuredLoggingArgs(), kv("from_state", fromChargeState), kv("to_state", targetChargeState)); logger.info(logMessage, structuredArgs); eventService.recordOfferedEvent(ResourceType.PAYMENT, externalId, Event.eventTypeForClass(eventClass), chargeEventEntity.getUpdated()); }</code><technical_language>This generate: "connector.gateway-operations.worldpay.live.1234.payment-state-transition-to.AUTH_SUCCESS" suggest: "connector.state-transition.worldpay.live.1234.to.AUTH_SUCCESS" ie. move a top-level consistent existing structure consider: "connector.state-transition.live.worldpay.1234.AUTH_SUCCESS" ie. flipping live worldpay parts live tree test (and sandbox) another tree. I a more logical ordering is a progression of "larger bucket" "smaller bucket". Open pushback if others disagree</technical_language>

Target:
public <T extends Event> void offerPaymentStateTransition( String externalId, ChargeStatus fromChargeState, ChargeStatus targetChargeState, ChargeEventEntity chargeEventEntity, Class<T> eventClass) { PaymentStateTransition transition = new PaymentStateTransition(chargeEventEntity.getId(), eventClass); stateTransitionQueue.offer(transition); var logMessage = format("Offered payment state transition to emitter queue [from=%s] [to=%s] [chargeEventId=%s] [chargeId=%s]", fromChargeState, targetChargeState, chargeEventEntity.getId(), externalId); metricRegistry.counter(String.format( "state-transition.%s.%s.%s.to.%s", chargeEventEntity.getChargeEntity().getGatewayAccount().getType(), chargeEventEntity.getChargeEntity().getGatewayAccount().getGatewayName(), chargeEventEntity.getChargeEntity().getGatewayAccount().getId(), targetChargeState)).inc(); Object[] structuredArgs = ArrayUtils.addAll( chargeEventEntity.getChargeEntity().getStructuredLoggingArgs(), kv("from_state", fromChargeState), kv("to_state", targetChargeState)); logger.info(logMessage, structuredArgs); eventService.recordOfferedEvent(ResourceType.PAYMENT, externalId, Event.eventTypeForClass(eventClass), chargeEventEntity.getUpdated()); }
Source:
<code>private void addReviewers(ChangeResource rsrc, PostResult result, Map<Account.Id, ChangeControl> reviewers) throws OrmException, EmailException, IOException { ReviewDb db = dbProvider.get(); ChangeUpdate update = updateFactory.create(rsrc.getChange()); List<PatchSetApproval> added; db.changes().beginTransaction(rsrc.getChange().getId()); try { ChangeUtil.bumpRowVersionNotLastUpdatedOn(rsrc.getChange().getId(), db); added = approvalsUtil.addReviewers(db, rsrc.getNotes(), update, rsrc.getControl().getLabelTypes(), rsrc.getChange(), reviewers.keySet()); db.commit(); } finally { db.rollback(); } <START> CheckedFuture<?, IOException> indexFuture = indexer.indexAsync(rsrc.getChange().getId()); update.commit(); <END> result.reviewers = Lists.newArrayListWithCapacity(added.size()); for (PatchSetApproval psa : added) { result.reviewers.add(json.format( new ReviewerInfo(psa.getAccountId()), rsrc.getNotes(), reviewers.get(psa.getAccountId()), ImmutableList.of(psa))); } accountLoaderFactory.create(true).fill(result.reviewers); postAdd(rsrc.getChange(), added); indexFuture.checkedGet(); }</code><technical_language>Index build stale data</technical_language>

Target:
private void addReviewers(ChangeResource rsrc, PostResult result, Map<Account.Id, ChangeControl> reviewers) throws OrmException, EmailException, IOException { ReviewDb db = dbProvider.get(); ChangeUpdate update = updateFactory.create(rsrc.getChange()); List<PatchSetApproval> added; db.changes().beginTransaction(rsrc.getChange().getId()); try { ChangeUtil.bumpRowVersionNotLastUpdatedOn(rsrc.getChange().getId(), db); added = approvalsUtil.addReviewers(db, rsrc.getNotes(), update, rsrc.getControl().getLabelTypes(), rsrc.getChange(), reviewers.keySet()); db.commit(); } finally { db.rollback(); } update.commit(); CheckedFuture<?, IOException> indexFuture = indexer.indexAsync(rsrc.getChange().getId()); result.reviewers = Lists.newArrayListWithCapacity(added.size()); for (PatchSetApproval psa : added) { result.reviewers.add(json.format( new ReviewerInfo(psa.getAccountId()), rsrc.getNotes(), reviewers.get(psa.getAccountId()), ImmutableList.of(psa))); } accountLoaderFactory.create(true).fill(result.reviewers); postAdd(rsrc.getChange(), added); indexFuture.checkedGet(); }
Source:
<code>private SortQueryOperation validateAndGetChildSort(QueryOperation child, PostResolverFactory postResolverFactory) { final SortQueryOperation previousSort; if (child instanceof SortQueryOperation) { previousSort = (SortQueryOperation) child; } else { <START> previousSort = (SortQueryOperation) createSort(Collections.emptyList(), child, postResolverFactory); <END> } return previousSort; }</code><technical_language>please revert unrelated changes</technical_language>

Target:
private SortQueryOperation validateAndGetChildSort(QueryOperation child, PostResolverFactory postResolverFactory) { final SortQueryOperation previousSort; if (child instanceof SortQueryOperation) { previousSort = (SortQueryOperation) child; } else { previousSort = (SortQueryOperation) createSort(Collections.emptyList(), child, postResolverFactory); } if ((previousSort).getFetch() != -1) { throw new ValidationException("FETCH is already defined."); } return previousSort; }
Source:
<code>public static String regularURL(String url){ String url_regularized = null; if (url.startsWith("https://")){ url_regularized = url.substring(8, url.length()); <START> } else if (url.startsWith("http://")) { <END> url_regularized = url.substring(7, url.length()); } else return url; return url_regularized; }</code><technical_language>create a constant include "http://" string named **HTTP_SCHEME** for instance</technical_language>

Target:
public static String regularURL(String url){ String url_regularized = null; if (url.startsWith(HTTPS_SCHEME)){ url_regularized = url.substring(8, url.length()); } else if (url.startsWith(HTTP_SCHEME)) { url_regularized = url.substring(7, url.length()); } else return url; return url_regularized; }
Source:
<code>public void test4_10CopyExperiment() { SWTBotTreeItem traceItem = SWTBotUtils.getTraceProjectItem(fBot, SWTBotUtils.selectTracesFolder(fBot, TRACE_PROJECT_NAME), TRACE_NAME); createCopy(traceItem, false); SWTBotTreeItem tracesFolder = SWTBotUtils.selectTracesFolder(fBot, TRACE_PROJECT_NAME); tracesFolder.contextMenu().menu("Open As Experiment...", "Generic Experiment").click(); fBot.waitUntil(new ConditionHelpers.ActiveEventsEditor(fBot, <START> "ExampleCustomTxt.log")); <END> SWTBotTreeItem experimentsItem = SWTBotUtils.getTraceProjectItem(fBot, SWTBotUtils.selectProject(fBot, TRACE_PROJECT_NAME), "Experiments"); experimentsItem.expand(); fBot.waitUntil(ConditionHelpers.IsTreeChildNodeAvailable("Experiment [2]", experimentsItem)); SWTBotTreeItem expItem = SWTBotUtils.getTraceProjectItem(fBot, experimentsItem, "Experiment"); createExperimentCopy(expItem, false); SWTBotTreeItem copiedExpItem = SWTBotUtils.getTraceProjectItem(fBot, experimentsItem, RENAMED_EXP_NAME); verifyExperimentCopy(copiedExpItem, false); createExperimentCopy(expItem, true); SWTBotTreeItem deepCopiedExpItem = SWTBotUtils.getTraceProjectItem(fBot, experimentsItem, RENAMED_EXP_DEEP_COPY); verifyExperimentCopy(deepCopiedExpItem, true); assertEquals(3, experimentsItem.getItems().length); }</code><technical_language>waiting for experiment name "Experiment"</technical_language>

Target:
public void test4_10CopyExperiment() { SWTBotTreeItem traceItem = SWTBotUtils.getTraceProjectItem(fBot, SWTBotUtils.selectTracesFolder(fBot, TRACE_PROJECT_NAME), TRACE_NAME); createCopy(traceItem, false); SWTBotTreeItem tracesFolder = SWTBotUtils.selectTracesFolder(fBot, TRACE_PROJECT_NAME); tracesFolder.contextMenu().menu("Open As Experiment...", "Generic Experiment").click(); fBot.waitUntil(new ConditionHelpers.ActiveEventsEditor(fBot, "Experiment")); SWTBotTreeItem experimentsItem = SWTBotUtils.getTraceProjectItem(fBot, SWTBotUtils.selectProject(fBot, TRACE_PROJECT_NAME), "Experiments"); experimentsItem.expand(); fBot.waitUntil(ConditionHelpers.IsTreeChildNodeAvailable("Experiment [2]", experimentsItem)); SWTBotTreeItem expItem = SWTBotUtils.getTraceProjectItem(fBot, experimentsItem, "Experiment"); createExperimentCopy(expItem, false); SWTBotTreeItem copiedExpItem = SWTBotUtils.getTraceProjectItem(fBot, experimentsItem, RENAMED_EXP_NAME); verifyExperimentCopy(copiedExpItem, false); createExperimentCopy(expItem, true); SWTBotTreeItem deepCopiedExpItem = SWTBotUtils.getTraceProjectItem(fBot, experimentsItem, RENAMED_EXP_DEEP_COPY); verifyExperimentCopy(deepCopiedExpItem, true); assertEquals(3, experimentsItem.getItems().length); }
Source:
<code>public void onClick(View arg0) { Geopoint gp = null; if (waypoint != null && waypoint.latitude != null && waypoint.longitude != null) gp = new Geopoint(waypoint.latitude, waypoint.longitude); cgeocoords coordsDialog = new cgeocoords(cgeowaypointadd.this, settings, gp, geo); coordsDialog.setCancelable(true); coordsDialog.setOnCoordinateUpdate(new cgeocoords.CoordinateUpdate() { @Override public void update(Geopoint gp) { <START> ((Button) findViewById(R.id.buttonLatitude)).setText(cgBase.formatLatitude(gp.getLatitude(), true)); <END> ((Button) findViewById(R.id.buttonLongitude)).setText(cgBase.formatLongitude(gp.getLongitude(), true)); if (waypoint != null) { waypoint.latitude = gp.getLatitude(); waypoint.longitude = gp.getLongitude(); } } }); coordsDialog.show(); }</code><technical_language>GeopointFormatter here. ;)</technical_language>

Target:
public void onClick(View arg0) { Geopoint gp = null; if (waypoint != null && waypoint.latitude != null && waypoint.longitude != null) gp = new Geopoint(waypoint.latitude, waypoint.longitude); cgeocoords coordsDialog = new cgeocoords(cgeowaypointadd.this, settings, gp, geo); coordsDialog.setCancelable(true); coordsDialog.setOnCoordinateUpdate(new cgeocoords.CoordinateUpdate() { @Override public void update(Geopoint gp) { ((Button) findViewById(R.id.buttonLatitude)).setText(gp.format(GeopointFormatter.Format.LAT_DECMINUTE)); ((Button) findViewById(R.id.buttonLongitude)).setText(gp.format(GeopointFormatter.Format.LON_DECMINUTE)); if (waypoint != null) { waypoint.latitude = gp.getLatitude(); waypoint.longitude = gp.getLongitude(); } } }); coordsDialog.show(); }
Source:
<code>private void callShutdownOnStrategy() { if (!getRecordsRetrievalStrategy.isShutdown()) { getRecordsRetrievalStrategy.shutdown(); } <START> isShutdown = true; <END> }</code><technical_language>is this changed true trigger shutdown</technical_language>

Target:
private void callShutdownOnStrategy() { if (!getRecordsRetrievalStrategy.isShutdown()) { getRecordsRetrievalStrategy.shutdown(); } }
Source:
<code>public List<String> getUsages() { return Arrays.asList(new String[] { <START> buildCommandUsage(SUBCMD_LIST + " <thingUID>", "lists the available firmwares for a thing with specified UID"), <END> buildCommandUsage(SUBCMD_STATUS + " <thingUID>", "lists the firmware status for a thing"), buildCommandUsage(SUBCMD_CANCEL + " <thingUID>", "cancels the update for a thing"), buildCommandUsage( SUBCMD_UPDATE + " <thingUID> <firmware version>", "updates the firmware for a thing") }); }</code><technical_language>~~with UID~~ (Keep consistent below)</technical_language>

Target:
public List<String> getUsages() { return Arrays.asList(new String[] { buildCommandUsage(SUBCMD_LIST + " <thingUID>", "lists the available firmwares for a thing"), buildCommandUsage(SUBCMD_STATUS + " <thingUID>", "lists the firmware status for a thing"), buildCommandUsage(SUBCMD_CANCEL + " <thingUID>", "cancels the update for a thing"), buildCommandUsage( SUBCMD_UPDATE + " <thingUID> <firmware version>", "updates the firmware for a thing") }); }
Source:
<code>public DefaultIndexBuilder fillDrlIndexBuilder( final Path path, final String drl ) throws Exception { final DrlParser drlParser = new DrlParser(); final PackageDescr packageDescr = drlParser.parse( true, drl ); if ( drlParser.hasErrors() ) { final List<DroolsError> errors = drlParser.getErrors(); logger.warn( ErrorMessageUtilities.makeErrorMessage( path, errors.toArray( new DroolsError[ errors.size() ] ) ) ); <START> return null; <END> } if ( packageDescr == null ) { logger.warn( ErrorMessageUtilities.makeErrorMessage( path ) ); return null; } final ProjectDataModelOracle dmo = getProjectDataModelOracle( path ); final DefaultIndexBuilder builder = getIndexBuilder(path); if( builder == null ) { return null; } final PackageDescrIndexVisitor visitor = new PackageDescrIndexVisitor( dmo, builder, packageDescr ); visitor.visit(); addReferencedResourcesToIndexBuilder(builder, visitor); return builder; }</code><technical_language>Is null a "Null Object Pattern" implementation</technical_language>

Target:
public DefaultIndexBuilder fillDrlIndexBuilder( final Path path, final String drl ) throws Exception { final DrlParser drlParser = new DrlParser(); final PackageDescr packageDescr = drlParser.parse( true, drl ); if ( drlParser.hasErrors() ) { final List<DroolsError> errors = drlParser.getErrors(); logger.warn( ErrorMessageUtilities.makeErrorMessage( path, errors.toArray( new DroolsError[ errors.size() ] ) ) ); return null; } if ( packageDescr == null ) { logger.warn( ErrorMessageUtilities.makeErrorMessage( path ) ); return null; } final ProjectDataModelOracle dmo = getProjectDataModelOracle( path ); final DefaultIndexBuilder builder = getIndexBuilder(path); if( builder == null ) { return null; } builder.setPackageName(packageDescr.getName()); final PackageDescrIndexVisitor visitor = new PackageDescrIndexVisitor( dmo, builder, packageDescr ); visitor.visit(); addReferencedResourcesToIndexBuilder(builder, visitor); return builder; }
Source:
<code>public void wait(long timeout, TimeUnit timeUnit) throws InterruptedException, InfrastructureException { try { completionFuture.get(timeout, timeUnit); } catch (ExecutionException e) { throw new InfrastructureException( "Error occured while executing command in pod: " + e.getMessage(), e); <START> } catch (TimeoutException ignored) { <END> throw new InfrastructureException("Timeout reached while execution of command"); } }</code><technical_language>This exception is ignored, fix variable name</technical_language>

Target:
public void wait(long timeout, TimeUnit timeUnit) throws InterruptedException, InfrastructureException { try { completionFuture.get(timeout, timeUnit); } catch (ExecutionException e) { throw new InfrastructureException( "Error occured while executing command in pod: " + e.getMessage(), e); } catch (TimeoutException e) { throw new InfrastructureException("Timeout reached while execution of command"); } }
Source:
<code>public TraversalControl visitFragmentSpread(FragmentSpread fragmentSpread, TraverserContext<Node> context) { if (!conditionalNodes.shouldInclude(variables, fragmentSpread.getDirectives())) { return TraversalControl.ABORT; } FragmentDefinition fragmentDefinition = fragmentsByName.get(fragmentSpread.getName()); if (!conditionalNodes.shouldInclude(variables, fragmentDefinition.getDirectives())) { return TraversalControl.ABORT; } QueryVisitorFragmentSpreadEnvironment fragmentSpreadEnvironment = new QueryVisitorFragmentSpreadEnvironmentImpl(fragmentSpread, fragmentDefinition, context); if (context.getVar(LeaveOrEnter.class) == LEAVE) { postOrderCallback.visitFragmentSpread(fragmentSpreadEnvironment); return TraversalControl.CONTINUE; } preOrderCallback.visitFragmentSpread(fragmentSpreadEnvironment); QueryTraversalContext parentEnv = context.getVarFromParents(QueryTraversalContext.class); GraphQLCompositeType typeCondition = (GraphQLCompositeType) schema.getType(fragmentDefinition.getTypeCondition().getName()); <START> Assert.assertTrue(typeCondition != null, "Invalid type condition '%s' in fragment '%s'", fragmentDefinition.getTypeCondition().getName(), <END> fragmentDefinition.getName()); context .setVar(QueryTraversalContext.class, new QueryTraversalContext(typeCondition, typeCondition, parentEnv.getEnvironment(), fragmentDefinition)); return TraversalControl.CONTINUE; }</code><technical_language>Assert.assertNonNull</technical_language>

Target:
public TraversalControl visitFragmentSpread(FragmentSpread fragmentSpread, TraverserContext<Node> context) { if (!conditionalNodes.shouldInclude(variables, fragmentSpread.getDirectives())) { return TraversalControl.ABORT; } FragmentDefinition fragmentDefinition = fragmentsByName.get(fragmentSpread.getName()); if (!conditionalNodes.shouldInclude(variables, fragmentDefinition.getDirectives())) { return TraversalControl.ABORT; } QueryVisitorFragmentSpreadEnvironment fragmentSpreadEnvironment = new QueryVisitorFragmentSpreadEnvironmentImpl(fragmentSpread, fragmentDefinition, context); if (context.getVar(LeaveOrEnter.class) == LEAVE) { postOrderCallback.visitFragmentSpread(fragmentSpreadEnvironment); return TraversalControl.CONTINUE; } preOrderCallback.visitFragmentSpread(fragmentSpreadEnvironment); QueryTraversalContext parentEnv = context.getVarFromParents(QueryTraversalContext.class); GraphQLCompositeType typeCondition = (GraphQLCompositeType) schema.getType(fragmentDefinition.getTypeCondition().getName()); assertNotNull(typeCondition, "Invalid type condition '%s' in fragment '%s'", fragmentDefinition.getTypeCondition().getName(), fragmentDefinition.getName()); context .setVar(QueryTraversalContext.class, new QueryTraversalContext(typeCondition, typeCondition, parentEnv.getEnvironment(), fragmentDefinition)); return TraversalControl.CONTINUE; }
Source:
<code>private void renumberMediaUnits(Workpiece workpiece) { <START> int mininum = 1; <END> for (MediaUnit mediaUnit : workpiece.getMediaUnits()) { if (mediaUnit.getOrder() > mininum) { mininum = mediaUnit.getOrder() + 1; } else { mediaUnit.setOrder(mininum); mininum++; } } }</code><technical_language>Typo. afraid mine. minimum</technical_language>

Target:
private void renumberMediaUnits(Workpiece workpiece) { int minimum = 1; for (MediaUnit mediaUnit : workpiece.getMediaUnits()) { if (mediaUnit.getOrder() > minimum) { minimum = mediaUnit.getOrder() + 1; } else { mediaUnit.setOrder(minimum); minimum++; } } }
Source:
<code>public void releaseServerStoreProxy(ServerStoreProxy storeProxy, boolean isReconnect) { connectionState.removeClusterTierClientEntity(storeProxy.getCacheId()); if (!isReconnect) { storeProxy.close(); } else { <START> LOGGER.info("Adding to reconnect set"); <END> reconnectSet.add(storeProxy.getCacheId()); } }</code><technical_language>this log a user</technical_language>

Target:
public void releaseServerStoreProxy(ServerStoreProxy storeProxy, boolean isReconnect) { connectionState.removeClusterTierClientEntity(storeProxy.getCacheId()); if (!isReconnect) { storeProxy.close(); } else { reconnectSet.add(storeProxy.getCacheId()); } }
Source:
<code>public boolean areRemindersActive() { ArrayList<Date> activeAlarmsDates = new ArrayList<>(); RealmResults<Reminder> activeRemindersList = realm.where(Reminder.class) .equalTo("active", true) .findAll(); for (int i=0; i<activeRemindersList.size(); i++){ activeAlarmsDates.add(activeRemindersList.get(i).getAlarmTime()); } <START> return activeAlarmsDates.size() > 0; <END> }</code><technical_language>do need add dates list? do reminders list size? Realm count function</technical_language>

Target:
public boolean areRemindersActive() { RealmResults<Reminder> activeRemindersList = realm.where(Reminder.class) .equalTo("active", true) .findAll(); return activeRemindersList.size() > 0; }
Source:
<code><START> public static String buildMessage(String userInput){ <END> String domain = ReportProblemActivity.getDomain(); String postURL = ReportProblemActivity.getPostURL(); String version= ReportProblemActivity.getVersion(); String username = ReportProblemActivity.getUser(); return "Problem reported via CommCareODK. " + "\n User: " + username + "\n Domain: " + domain + "\n PostURL: " + postURL + "\n CCODK version: " + version + "\n Device Model: " + Build.MODEL + "\n Manufacturer: " + Build.MANUFACTURER + "\n Android Version: " + Build.VERSION.RELEASE + "\n Message: " + userInput; }</code><technical_language>This method private</technical_language>

Target:
private static String buildMessage(String userInput){ String domain = ReportProblemActivity.getDomain(); String postURL = ReportProblemActivity.getPostURL(); String version= ReportProblemActivity.getVersion(); String username = ReportProblemActivity.getUser(); return "Problem reported via CommCareODK. " + "\n User: " + username + "\n Domain: " + domain + "\n PostURL: " + postURL + "\n CCODK version: " + version + "\n Device Model: " + Build.MODEL + "\n Manufacturer: " + Build.MANUFACTURER + "\n Android Version: " + Build.VERSION.RELEASE + "\n Message: " + userInput; }
Source:
<code><START> public OmCalendar update(OmCalendar c){ <END> if(c.getId() == null){ em.persist(c); } else c = em.merge(c); return c; }</code><technical_language>please update formatting: if (c.getId() == null) { em.persist(c); } else { c = em.merge(c); } tabs instead of spaces missing curly braces additional spaces braces code</technical_language>

Target:
public OmCalendar update(OmCalendar c) { if (c.getId() == null) { em.persist(c); } else { c = em.merge(c); } return c; }
Source:
<code>public VideobridgeStatistics() { BundleContext bundleContext = StatsManagerBundleActivator.getBundleContext(); <START> region = Config.region(); <END> unlockedSetStat(BITRATE_DOWNLOAD, 0); unlockedSetStat(BITRATE_UPLOAD, 0); unlockedSetStat(CONFERENCES, 0); unlockedSetStat(PARTICIPANTS, 0); unlockedSetStat(THREADS, 0); unlockedSetStat(RTP_LOSS, 0d); unlockedSetStat(VIDEO_CHANNELS, 0); unlockedSetStat(VIDEO_STREAMS, 0); unlockedSetStat(LOSS_RATE_DOWNLOAD, 0d); unlockedSetStat(LOSS_RATE_UPLOAD, 0d); unlockedSetStat(JITTER_AGGREGATE, 0d); unlockedSetStat(RTT_AGGREGATE, 0d); unlockedSetStat(LARGEST_CONFERENCE, 0); unlockedSetStat(CONFERENCE_SIZES, "[]"); unlockedSetStat(TIMESTAMP, currentTimeMillis()); }</code><technical_language>I suggest accessing OctoConfig.Config.region() this config is specific VideobridgeStatistics</technical_language>

Target:
public VideobridgeStatistics() { BundleContext bundleContext = StatsManagerBundleActivator.getBundleContext(); unlockedSetStat(BITRATE_DOWNLOAD, 0); unlockedSetStat(BITRATE_UPLOAD, 0); unlockedSetStat(CONFERENCES, 0); unlockedSetStat(PARTICIPANTS, 0); unlockedSetStat(THREADS, 0); unlockedSetStat(RTP_LOSS, 0d); unlockedSetStat(VIDEO_CHANNELS, 0); unlockedSetStat(VIDEO_STREAMS, 0); unlockedSetStat(LOSS_RATE_DOWNLOAD, 0d); unlockedSetStat(LOSS_RATE_UPLOAD, 0d); unlockedSetStat(JITTER_AGGREGATE, 0d); unlockedSetStat(RTT_AGGREGATE, 0d); unlockedSetStat(LARGEST_CONFERENCE, 0); unlockedSetStat(CONFERENCE_SIZES, "[]"); unlockedSetStat(TIMESTAMP, currentTimeMillis()); }
Source:
<code>protected Object[] getSortedChildren(Object parentElementOrTreePath) { Object[] result = super.getSortedChildren(parentElementOrTreePath); if (parentElementOrTreePath instanceof Adapter && ((Adapter)parentElementOrTreePath).getTarget() instanceof Conflict) { Iterable<Object> leftSide = Iterables.filter(Lists.newArrayList(result), fromSide(DifferenceSource.LEFT)); Iterable<Object> rightSide = Iterables.filter(Lists.newArrayList(result), fromSide(DifferenceSource.RIGHT)); <START> result = Iterables.toArray(Iterables.concat(leftSide, rightSide), Object.class); <END> } return result; }</code><technical_language>a sorting algorithm instead of conversions/iterations/filterings. this do: Collections.sort(Arrays.asList(result), new Comparator<Object>() { public int compare(Object o1, Object o2) { return getValue(o1) - getValue(o2); } public int getValue(Object o) { int = 0; if (o instanceof Adapter && ((Adapter)o).getTarget() instanc eof Diff) { if (((Diff)((Adapter)o).getTarget()).getSource() == DifferenceSource.LEFT) { = 1; } else { = 2; } } return value; } });</technical_language>

Target:
protected Object[] getSortedChildren(Object parentElementOrTreePath) { Object[] result = super.getSortedChildren(parentElementOrTreePath); if (parentElementOrTreePath instanceof Adapter && ((Adapter)parentElementOrTreePath).getTarget() instanceof Conflict) { Collections.sort(Arrays.asList(result), new Comparator<Object>() { public int compare(Object o1, Object o2) { return getValue(o1) - getValue(o2); } public int getValue(Object o) { int value = 0; if (o instanceof Adapter && ((Adapter)o).getTarget() instanceof Diff) { if (((Diff)((Adapter)o).getTarget()).getSource() == DifferenceSource.LEFT) { value = 1; } else { value = 2; } } return value; } }); } return result; }
Source:
<code>public void setFirstParent(boolean enable) { assertNotStarted(); queue = new DateRevQueue(firstParent = <START> enable); <END> pending = new StartGenerator(this); }</code><technical_language>this form in JGit code, move assignment line</technical_language>

Target:
public void setFirstParent(boolean enable) { assertNotStarted(); assertNoCommitsMarkedStart(); firstParent = enable; queue = new DateRevQueue(firstParent); pending = new StartGenerator(this); }
Source:
<code>public String convertSingleParameterToTemplateKey( final String xlsTemplate, final ParameterizedValueBuilder.Part part ) { final StringBuffer result = new StringBuffer(); final Matcher matcherSingleParameter = patternSingleParameter.matcher( xlsTemplate ); while ( matcherSingleParameter.find() ) { matcherSingleParameter.appendReplacement( result, "@{" + PARAMETER_PREFIX + parameterCounter + "}" ); } parameterCounter++; matcherSingleParameter.appendTail( result ); <START> if ( part == ParameterizedValueBuilder.Part.LHS ) { <END> final String expression = addQuotesToTemplateKeys( result ).toString(); final ViabilityVisitor visitor = new ViabilityVisitor( expression ); if ( visitor.isViable() ) { return expression; } } return result.toString(); }</code><technical_language>This block in convertIndexedParametersToTemplateKeys convertSingleParameterToTemplateKey. Prob. create a method reuse</technical_language>

Target:
public String convertSingleParameterToTemplateKey( final String xlsTemplate, final ParameterizedValueBuilder.Part part ) { final StringBuffer result = new StringBuffer(); final Matcher matcherSingleParameter = patternSingleParameter.matcher( xlsTemplate ); while ( matcherSingleParameter.find() ) { matcherSingleParameter.appendReplacement( result, "@{" + PARAMETER_PREFIX + parameterCounter + "}" ); } parameterCounter++; matcherSingleParameter.appendTail( result ); return assertTemplateKeyConversion( result, part ); }
Source:
<code>public static Iterable<Object[]> constructorFeeder() throws IOException { final GroupByQueryConfig defaultConfig = new GroupByQueryConfig(); final GroupByQueryConfig singleThreadedConfig = new GroupByQueryConfig() { @Override public boolean isSingleThreaded() { return true; } }; final GroupByQueryConfig epinephelinaeConfig = new GroupByQueryConfig() { @Override public String getDefaultStrategy() { <START> return "epinephelinae"; <END> } }; defaultConfig.setMaxIntermediateRows(10000); singleThreadedConfig.setMaxIntermediateRows(10000); final List<Object[]> constructors = Lists.newArrayList(); final List<GroupByQueryConfig> configs = ImmutableList.of( defaultConfig, singleThreadedConfig, epinephelinaeConfig ); for (GroupByQueryConfig config : configs) { final GroupByQueryRunnerFactory factory = GroupByQueryRunnerTest.makeQueryRunnerFactory(config); for (QueryRunner<Row> runner : QueryRunnerTestHelper.makeQueryRunners(factory)) { constructors.add(new Object[]{factory, runner}); } } return constructors; }</code><technical_language>lol +1. is scary ass fish</technical_language>

Target:
public static Iterable<Object[]> constructorFeeder() throws IOException { final GroupByQueryConfig defaultConfig = new GroupByQueryConfig(); final GroupByQueryConfig singleThreadedConfig = new GroupByQueryConfig() { @Override public boolean isSingleThreaded() { return true; } }; final GroupByQueryConfig v2Config = new GroupByQueryConfig() { @Override public String getDefaultStrategy() { return GroupByStrategySelector.STRATEGY_V2; } }; defaultConfig.setMaxIntermediateRows(10000); singleThreadedConfig.setMaxIntermediateRows(10000); final List<Object[]> constructors = Lists.newArrayList(); final List<GroupByQueryConfig> configs = ImmutableList.of( defaultConfig, singleThreadedConfig, v2Config ); for (GroupByQueryConfig config : configs) { final GroupByQueryRunnerFactory factory = GroupByQueryRunnerTest.makeQueryRunnerFactory(config); for (QueryRunner<Row> runner : QueryRunnerTestHelper.makeQueryRunners(factory)) { constructors.add(new Object[]{factory, runner}); } } return constructors; }
Source:
<code>protected void init(final ImmutableMap<String, Object> execEnvVars) throws DbException { if (connectionInfo == null && execEnvVars != null) { connectionInfo = (ConnectionInfo) execEnvVars.get(MyriaConstants.EXEC_ENV_VAR_DATABASE_CONN_INFO); } accessMethod = AccessMethod.of(connectionInfo.getDbms(), connectionInfo, false); <START> accessMethod.createViewIfNotExists(viewName, viewQuery); <END> }</code><technical_language>I thought agreed preserve idempotence local operator overwrite existing view definition</technical_language>

Target:
protected void init(final ImmutableMap<String, Object> execEnvVars) throws DbException { if (connectionInfo == null && execEnvVars != null) { connectionInfo = (ConnectionInfo) execEnvVars.get(MyriaConstants.EXEC_ENV_VAR_DATABASE_CONN_INFO); } accessMethod = AccessMethod.of(connectionInfo.getDbms(), connectionInfo, false); accessMethod.createView(viewName, viewQuery); }
Source:
<code>public boolean getInclusionExists(final String path) { if (UNCPathConverter.isUNC(path)) { <START> final boolean[] exists = new boolean[1]; <END> Job checkJob = new Job(NLS.bind(CCorePlugin.getResourceString("InternalFileContentProvider.checkExistsJob"), path)){ @Override protected IStatus run(IProgressMonitor monitor) { try { IFileStore store = EFS.getStore(UNCPathConverter.getInstance().toURI(path)); exists[0] = store.fetchInfo(EFS.NONE, monitor).exists(); if (monitor.isCanceled()) { return Status.CANCEL_STATUS; } } catch (CoreException e) { return e.getStatus(); } return Status.OK_STATUS; } }; checkJob.schedule(); try { checkJob.join(); } catch (InterruptedException e) { return false; } return checkJob.getResult().isOK(); } return new File(path).exists(); }</code><technical_language>exists[0] is read from</technical_language>

Target:
public boolean getInclusionExists(final String path) { if (UNCPathConverter.isUNC(path)) { final boolean[] exists = new boolean[1]; Job checkJob = new Job(NLS.bind(CCorePlugin.getResourceString("InternalFileContentProvider.checkExistsJob"), path)){ @Override protected IStatus run(IProgressMonitor monitor) { try { IFileStore store = EFS.getStore(UNCPathConverter.getInstance().toURI(path)); exists[0] = store.fetchInfo(EFS.NONE, monitor).exists(); if (monitor.isCanceled()) { return Status.CANCEL_STATUS; } } catch (CoreException e) { return e.getStatus(); } return Status.OK_STATUS; } }; checkJob.setSystem(true); checkJob.schedule(); try { checkJob.join(); } catch (InterruptedException e) { return false; } return exists[0]; } return new File(path).exists(); }
Source:
<code>public boolean synchronize(DocumentFile event) throws Exception { if (event == null) { throw new NullArgumentException("Incoming object is null"); } if (config == null) { throw new IllegalStateException("Unable to load configuration"); } else if (!ReadOnlyConfiguration.isReadOnly(config)) { try { GeoServerResourceLoader loader = GeoServerExtensions.bean(GeoServerResourceLoader.class); final String fileName = File.separator + "styles" <START> + File.separator + event.getPath().name(); <END> Resource file = loader.get(fileName); if ( !Resources.exists(file) ) { final String styleAbsolutePath = event.getPath().path(); if ( styleAbsolutePath.indexOf("workspaces") > 0 ) { final String styleFileName = File.separator + styleAbsolutePath.substring(styleAbsolutePath.indexOf("workspaces")); file = loader.get(styleFileName); } } event.writeTo(file); return true; } catch (Exception e) { if (LOGGER.isLoggable(java.util.logging.Level.SEVERE)) LOGGER.severe(this.getClass() + " is unable to synchronize the incoming event: " + event); throw e; } } return true; }</code><technical_language>Please convert tabs spaces</technical_language>

Target:
public boolean synchronize(DocumentFile event) throws Exception { if (event == null) { throw new NullArgumentException("Incoming object is null"); } if (config == null) { throw new IllegalStateException("Unable to load configuration"); } else if (!ReadOnlyConfiguration.isReadOnly(config)) { try { GeoServerResourceLoader loader = GeoServerExtensions.bean(GeoServerResourceLoader.class); Resource file = loader.get("styles").get(event.getPath().name()); if ( !Resources.exists(file) ) { final String styleAbsolutePath = event.getPath().path(); if ( styleAbsolutePath.indexOf("workspaces") > 0 ) { file = loader.get(styleAbsolutePath.substring(styleAbsolutePath.indexOf("workspaces"))); } } event.writeTo(file); return true; } catch (Exception e) { if (LOGGER.isLoggable(java.util.logging.Level.SEVERE)) LOGGER.severe(this.getClass() + " is unable to synchronize the incoming event: " + event); throw e; } } return true; }
Source:
<code><START> public List<ClusterNode> mapPartitionToPrimaryAndBackupsList(int part) { <END> ctx.gateway().readLock(); try { return cache().assignment().get(part); } catch (IgniteCheckedException e) { throw new IgniteException(e); } finally { ctx.gateway().readUnlock(); } }</code><technical_language>reason copy-paste implementation mapPartitionToPrimaryAndBackups</technical_language>

Target:
@Override public List<ClusterNode> mapPartitionToPrimaryAndBackupsList(int part) { ctx.gateway().readLock(); try { return cache().assignment().get(part); } catch (IgniteCheckedException e) { throw new IgniteException(e); } finally { ctx.gateway().readUnlock(); } }
Source:
<code>@Override public DeriveMode getDeriveMode() { if (joinType == JoinRelType.FULL || joinType == JoinRelType.RIGHT) { return DeriveMode.PROHIBITED; } <START> return DeriveMode.BOTH; <END> }</code><technical_language>want support distribution, otherwise, LEFT_FIRST choice</technical_language>

Target:
@Override public DeriveMode getDeriveMode() { if (joinType == JoinRelType.FULL || joinType == JoinRelType.RIGHT) { return DeriveMode.PROHIBITED; } return DeriveMode.LEFT_FIRST; }
Source:
<code><START> public void deleteChannel(Channel channel) { <END> channelMap.remove(channel.getChannelIdentifier()); }</code><technical_language>return code here, return a boolean success/failure. user it, API provide this info. Res: Done, a return type of boolean success</technical_language>

Target:
public boolean deleteChannel(Channel channel) { if (!channelMap.containsKey(channel)){ return false; }else { channelMap.remove(channel.getChannelIdentifier()); return true; } }
Source:
<code>public String submitSearchTransformedNetworkRequest( @ProjectIdentifier @PathVariable("projectUnixName") String projectUnixName, @RequestParam("conceptId") String conceptId, @CheckAccess @InjectProject IProject project, Model model) throws QuadrigaStorageException { String lemma = ""; String searchNodeLabel = ""; IConcept concept = cpCache.getConceptByUri(conceptId); if (concept != null) { searchNodeLabel = concept.getWord(); lemma = concept.getDescription(); } Callable<PublicSearchObject> callable = () -> { PublicSearchObject publicSearchObject = new PublicSearchObject(); ITransformedNetwork transformedNetwork = transformationManager <START> .getSearchTransformedNetwork(project.getProjectId(), conceptId, INetworkStatus.APPROVED); <END> if (transformedNetwork != null) { publicSearchObject.setNodes(jsonCreator.getNodes(transformedNetwork.getNodes())); publicSearchObject.setLinks(jsonCreator.getLinks(transformedNetwork.getLinks())); } if (transformedNetwork == null || transformedNetwork.getNodes().size() == 0) { publicSearchObject.setNetworkEmpty(true); } return publicSearchObject; }; Future<PublicSearchObject> future = executorService.submit(callable); Random randomTokenGenerator = new Random(); Integer randomToken = randomTokenGenerator.nextInt(100); while (searchResultMap.containsKey(randomToken)) { randomToken = randomTokenGenerator.nextInt(100); } searchResultMap.put(randomToken, future); model.addAttribute("token", randomToken); model.addAttribute("unixName", projectUnixName); model.addAttribute("searchNodeLabel", searchNodeLabel); model.addAttribute("description", lemma); model.addAttribute("project",project); return "sites/networks/searchednetwork"; }</code><technical_language>getSearchTransformedNetwork called a asycn method (@async annotation). turning resulting network json done in method checks for results</technical_language>

Target:
public String submitSearchTransformedNetworkRequest( @ProjectIdentifier @PathVariable("projectUnixName") String projectUnixName, @RequestParam("conceptId") String conceptId, @CheckAccess @InjectProject IProject project, Model model) throws QuadrigaStorageException { String lemma = ""; String searchNodeLabel = ""; IConcept concept = cpCache.getConceptByUri(conceptId); if (concept != null) { searchNodeLabel = concept.getWord(); lemma = concept.getDescription(); } String conceptIdToken = asyncNetworkTransformationService.submitNetworkTransformationRequest(conceptId, project); model.addAttribute("unixName", projectUnixName); model.addAttribute("searchNodeLabel", searchNodeLabel); model.addAttribute("description", lemma); model.addAttribute("project",project); model.addAttribute("conceptIdToken", conceptIdToken); return "sites/networks/searchednetwork"; }
Source:
<code>private boolean checkHeader() { try { String[] firstline = m_listReader.getHeader(false); Set<String> firstset = new HashSet<String>(); BiMap<Integer, String> colNames = HashBiMap.create(m_loader.getColumnNames()); headerlen = firstline.length; for (String name : firstline) { if (name != null) { firstset.add(name.toUpperCase()); } else { return false; } } if (headerlen < m_columnCount) { return false; } else { int matchColCount = 0; for (String name : firstset) { if (colNames.containsValue(name)) { matchColCount++; } } if (matchColCount != m_columnCount) { return false; } } order = new Integer[headerlen]; for (int fileCol = 0; fileCol < headerlen; fileCol++) { String name = firstline[fileCol]; if (colNames.inverse().containsKey(name.toUpperCase())) { int tableCol = colNames.inverse().get(name.toUpperCase()); <START> order[fileCol] = tableCol; <END> } } } catch (IOException ex) { m_log.error("Failed to read CSV line from file: " + ex); } return true; }</code><technical_language>check if map contains key check colNames.inverse().get(name.toUpperCase())</technical_language>

Target:
private boolean checkHeader() { try { String[] firstline = m_listReader.getHeader(false); Set<String> firstset = new HashSet<String>(); BiMap<Integer, String> colNames = HashBiMap.create(m_loader.getColumnNames()); headerlen = firstline.length; for (String name : firstline) { if (name != null) { firstset.add(name.toUpperCase()); } else { return false; } } if (headerlen < m_columnCount) { return false; } else { int matchColCount = 0; for (String name : firstset) { if (colNames.containsValue(name)) { matchColCount++; } } if (matchColCount != m_columnCount) { return false; } } order = new Integer[headerlen]; for (int fileCol = 0; fileCol < headerlen; fileCol++) { String name = firstline[fileCol]; Integer tableCol = colNames.inverse().get(name.toUpperCase()); order[fileCol] = tableCol; } } catch (IOException ex) { m_log.error("Failed to read CSV line from file: " + ex); } return true; }
Source:
<code>public String toString() { if (stringRepn == null) { <START> if (sem == null) return "NoSemanticFunction"; <END> String semStr = sem.toString(); int maxLength = 100; if (semStr.length() > maxLength) semStr = semStr.substring(0,maxLength) + "..."; stringRepn = lhs + " -> " + (rhs == null ? "" : Joiner.on(' ').join(rhs)) + " " + semStr; } return stringRepn; }</code><technical_language>NoSemanticFn</technical_language>

Target:
public String toString() { if (stringRepn == null) { String semStr = sem == null? "NullSemanticFn" : sem.toString(); int maxLength = 100; if (semStr.length() > maxLength) semStr = String.format("%s...(%d total)", semStr.substring(0,maxLength), semStr.length()); stringRepn = lhs + " -> " + (rhs == null ? "" : Joiner.on(' ').join(rhs)) + " " + semStr; } return stringRepn; }
Source:
<code>public static Collection<NodeMapping> getAllNodeMappings(ContainerMapping self) { Collection<NodeMapping> allNodeMappings = Stream .concat(new LinkedHashSet<NodeMapping>(self.getSubNodeMappings()).stream(), new <START> LinkedHashSet<NodeMapping>(self.getReusedNodeMappings()).stream()).collect(Collectors.toSet()); <END> return allNodeMappings; }</code><technical_language>implementation a HashSet addAll it. Order lost. Collectors.toCollection(LinkedHashSet::new) Stream.distinct() Collectors.toList. I do newLinkedHAshSet required. remove duplicates concatenation VSM editor allow reuse a mapping is defined submapping of cuirrent mapping</technical_language>

Target:
public static Collection<NodeMapping> getAllNodeMappings(ContainerMapping self) { LinkedHashSet<NodeMapping> result = Stream.concat(self.getSubNodeMappings().stream(), self.getReusedNodeMappings().stream()).collect(Collectors.toCollection(LinkedHashSet::new)); return result; }
Source:
<code>protected void launchService0(final String[] arguments, final ITransformingClassLoader launchClassLoader) throws Exception { <START> final PluginEnvironment launchPluginEnvironment = SpongeLaunch.pluginEnvironment; <END> Class.forName("org.spongepowered.vanilla.launch.ClientLauncher", true, launchClassLoader.getInstance()).getMethod("launch", String.class, Path.class, List.class, Boolean.class, String[].class).invoke(null, launchPluginEnvironment.getBlackboard().get(PluginKeys.VERSION).orElse(null), launchPluginEnvironment.getBlackboard().get(PluginKeys.BASE_DIRECTORY).orElse(null), launchPluginEnvironment.getBlackboard().get(PluginKeys.PLUGIN_DIRECTORIES).orElse(null), Boolean.TRUE, arguments); }</code><technical_language>Good example here, practice OOP pass plugin environment Main launch method of Client/ServerLauncher</technical_language>

Target:
protected void launchService0(final String[] arguments, final ITransformingClassLoader launchClassLoader) throws Exception { Class.forName("org.spongepowered.vanilla.launch.ClientLauncher", true, launchClassLoader.getInstance()) .getMethod("launch", PluginLoader.class, Boolean.class, String[].class) .invoke(null, Main.pluginLoader, Boolean.TRUE, arguments ); }
Source:
<code>public void dataPointFieldsMustBeStatic() { assertThat( testResult(DataPointFieldsMustBeStatic.class), <START> CoreMatchers.<PrintableResult>both(failureCountIs(1)) <END> .and( hasFailureContaining("DataPoint field THREE must be static")) .and( hasFailureContaining("DataPoint field FOURS must be static"))); }</code><technical_language>Verifying failure count sense anymore. I removed. @junit-team/junit-committers do think</technical_language>

Target:
public void dataPointFieldsMustBeStatic() { assertThat( testResult(DataPointFieldsMustBeStatic.class), CoreMatchers.both(hasFailureContaining("DataPoint field THREE must be static")) .and(hasFailureContaining("DataPoint field FOURS must be static"))); }
Source:
<code>public void convertNoteFiles(ZeppelinConfiguration conf, boolean deleteOld) throws IOException { for (int i = 0; i < repos.size(); ++i) { NotebookRepo newNotebookRepo = repos.get(i); OldNotebookRepo oldNotebookRepo = PluginManager.get().loadOldNotebookRepo(newNotebookRepo.getClass().getCanonicalName()); oldNotebookRepo.init(conf); List<OldNoteInfo> oldNotesInfo = oldNotebookRepo.list(AuthenticationInfo.ANONYMOUS); LOGGER.info("Convert old note file to new style, note count: " + oldNotesInfo.size()); <START> LOGGER.info("Delete old note: " + deleteOld); <END> for (OldNoteInfo oldNoteInfo : oldNotesInfo) { Note note = oldNotebookRepo.get(oldNoteInfo.getId(), AuthenticationInfo.ANONYMOUS); note.setPath(note.getName()); note.setVersion(Util.getVersion()); newNotebookRepo.save(note, AuthenticationInfo.ANONYMOUS); if (newNotebookRepo instanceof NotebookRepoWithVersionControl) { ((NotebookRepoWithVersionControl) newNotebookRepo).checkpoint( note.getId(), note.getPath(), "Upgrade note '" + note.getName() + "' from old format to new format", AuthenticationInfo.ANONYMOUS); } if (deleteOld) { oldNotebookRepo.remove(note.getId(), AuthenticationInfo.ANONYMOUS); LOGGER.info("Remote old note: " + note.getId()); } } } }</code><technical_language>I w/ version check if note is "old" format converting</technical_language>

Target:
public void convertNoteFiles(ZeppelinConfiguration conf, boolean deleteOld) throws IOException { for (int i = 0; i < repos.size(); ++i) { NotebookRepo newNotebookRepo = repos.get(i); OldNotebookRepo oldNotebookRepo = PluginManager.get().loadOldNotebookRepo(newNotebookRepo.getClass().getCanonicalName()); oldNotebookRepo.init(conf); List<OldNoteInfo> oldNotesInfo = oldNotebookRepo.list(AuthenticationInfo.ANONYMOUS); LOGGER.info("Convert old note file to new style, note count: " + oldNotesInfo.size()); LOGGER.info("Delete old note: " + deleteOld); for (OldNoteInfo oldNoteInfo : oldNotesInfo) { Note note = oldNotebookRepo.get(oldNoteInfo.getId(), AuthenticationInfo.ANONYMOUS); note.setPath(note.getName()); note.setVersion(Util.getVersion()); newNotebookRepo.save(note, AuthenticationInfo.ANONYMOUS); if (newNotebookRepo instanceof NotebookRepoWithVersionControl) { ((NotebookRepoWithVersionControl) newNotebookRepo).checkpoint( note.getId(), note.getPath(), "Upgrade note '" + note.getName() + "' to " + Util.getVersion(), AuthenticationInfo.ANONYMOUS); } if (deleteOld) { oldNotebookRepo.remove(note.getId(), AuthenticationInfo.ANONYMOUS); LOGGER.info("Remote old note: " + note.getId()); } } } }