auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public MetadataValueList getPermissionFilteredMetadata(Context context, Item obj) { List<MetadataValue> fullList = itemService.getMetadata(obj, Item.ANY, Item.ANY, Item.ANY, Item.ANY, true); List<MetadataValue> returnList = new LinkedList<>(); try { if (context != null && authorizeService.isAdmin(context)) { return new MetadataValueList(fullList); } for (MetadataValue mv : fullList) { MetadataField metadataField = mv.getMetadataField(); if (!metadataExposureService .isHidden(context, metadataField.getMetadataSchema().getName(), metadataField.getElement(), metadataField.getQualifier())) { returnList.add(mv); } } } catch (SQLException e) { <START> log.error(e); <END> } return new MetadataValueList(returnList); }</code><technical_language>Similar above, this a more useful error message</technical_language>

Target:
public MetadataValueList getPermissionFilteredMetadata(Context context, Item obj) { List<MetadataValue> fullList = itemService.getMetadata(obj, Item.ANY, Item.ANY, Item.ANY, Item.ANY, true); List<MetadataValue> returnList = new LinkedList<>(); try { if (context != null && authorizeService.isAdmin(context)) { return new MetadataValueList(fullList); } for (MetadataValue mv : fullList) { MetadataField metadataField = mv.getMetadataField(); if (!metadataExposureService .isHidden(context, metadataField.getMetadataSchema().getName(), metadataField.getElement(), metadataField.getQualifier())) { returnList.add(mv); } } } catch (SQLException e) { log.error("Error filtering item metadata based on permissions", e); } return new MetadataValueList(returnList); }
Source:
<code>ListenableFuture<PreparedStatement> getPreparedQueryAsync(QueryType type, Set<ColumnMapper<?>> columns, EnumMap<Option.Type, Option> options) { final MapperQueryKey pqk = new MapperQueryKey(type, columns, options); PreparedStatement stmt = preparedQueries.get(pqk); if (stmt == null) { String queryString = type.makePreparedQueryString(tableMetadata, mapper, manager, columns, options.values()); logger.debug("Preparing query {}", queryString); final SettableFuture<PreparedStatement> future = SettableFuture.create(); <START> Futures.addCallback(session().prepareAsync(queryString), new FutureCallback<PreparedStatement>() { <END> @Override public void onSuccess(PreparedStatement stmt) { PreparedStatement old = preparedQueries.putIfAbsent(pqk, stmt); if (old != null) stmt = old; future.set(stmt); } @Override public void onFailure(Throwable t) { future.setException(t); } }); return future; } else { return Futures.immediateFuture(stmt); } }</code><technical_language>for threads prepare statement concurrently. bad, prints a warning log. avoid a couple of changes: java // store futures instead of plain statements private final ConcurrentMap<MapperQueryKey, ListenableFuture<PreparedStatement>> preparedQueries ... SettableFuture<PreparedStatement> future = SettableFuture.create(); ListenableFuture<PreparedStatment> = preparedQueries.putIfAbsent(pqk, future); if (old != null) return old; else { // call prepareAsync, complete future in callback }</technical_language>

Target:
ListenableFuture<PreparedStatement> getPreparedQueryAsync(QueryType type, Set<ColumnMapper<?>> columns, EnumMap<Option.Type, Option> options) { final MapperQueryKey pqk = new MapperQueryKey(type, columns, options); ListenableFuture<PreparedStatement> existingFuture = preparedQueries.get(pqk); if (existingFuture == null) { final SettableFuture<PreparedStatement> future = SettableFuture.create(); ListenableFuture<PreparedStatement> old = preparedQueries.putIfAbsent(pqk, future); if (old != null) { return old; } else { String queryString = type.makePreparedQueryString(tableMetadata, mapper, manager, columns, options.values()); logger.debug("Preparing query {}", queryString); SimpleStatement s = new SimpleStatement(queryString); s.setIdempotent(true); Futures.addCallback(session().prepareAsync(s), new FutureCallback<PreparedStatement>() { @Override public void onSuccess(PreparedStatement stmt) { future.set(stmt); } @Override public void onFailure(Throwable t) { future.setException(t); } }); return future; } } else { return existingFuture; } }
Source:
<code>public void initializeFrameworks() { NotificationUtils.createNotificationChannel(context); try { <START> JobManager <END> .create(context) .addJobCreator(collectJobCreator); } catch (JobManagerCreateException e) { Timber.e(e); } JodaTimeAndroid.init(context); if (BuildConfig.BUILD_TYPE.equals("odkCollectRelease")) { Timber.plant(new CrashReportingTree()); } else { Timber.plant(new Timber.DebugTree()); } AppCompatDelegate.setCompatVectorFromResourcesEnabled(true); }</code><technical_language>I good factor out more methods initializeTimber/initializeJobManager etc. strange create separate methods for line initializations ok in method</technical_language>

Target:
public void initializeFrameworks() { NotificationUtils.createNotificationChannel(context); initializeJobManager(); JodaTimeAndroid.init(context); initializeLogging(); AppCompatDelegate.setCompatVectorFromResourcesEnabled(true); initializeMapFrameworks(); }
Source:
<code>public void writeCherryPickHead(ObjectId head) throws IOException { <START> List<ObjectId> heads = (head == null) ? null : Arrays.asList(head); <END> writeHeadsFile(heads, Constants.CHERRY_PICK_HEAD); }</code><technical_language>style prefer: List<ObjectId> heads = head != null ? Collections.singletonList(head) : null; removes need import java.util.Arrays here</technical_language>

Target:
public void writeCherryPickHead(ObjectId head) throws IOException { List<ObjectId> heads = (head != null) ? Collections.singletonList(head) : null; writeHeadsFile(heads, Constants.CHERRY_PICK_HEAD); }
Source:
<code>public void addJWTAuthentication(UserEntity userEntity, String key, boolean persist) throws AmbariException { addAuthentication(userEntity, UserAuthenticationType.JWT, key, <START> new Validator() { <END> @Override public void validate(UserEntity userEntity, String key) throws AmbariException { List<UserAuthenticationEntity> authenticationEntities = userEntity.getAuthenticationEntities(); for (UserAuthenticationEntity entity : authenticationEntities) { if ((entity.getAuthenticationType() == UserAuthenticationType.JWT) && ((key == null) ? (entity.getAuthenticationKey() == null) : key.equals(entity.getAuthenticationKey()))) { throw new AmbariException("The authentication type already exists for this user"); } } } }, persist); }</code><technical_language>do lambda approach</technical_language>

Target:
public void addJWTAuthentication(UserEntity userEntity, String key, boolean persist) throws AmbariException { addAuthentication(userEntity, UserAuthenticationType.JWT, key, (user, authKey) -> { List<UserAuthenticationEntity> authenticationEntities = user.getAuthenticationEntities(); for (UserAuthenticationEntity entity : authenticationEntities) { if ((entity.getAuthenticationType() == UserAuthenticationType.JWT) && ((authKey == null) ? (entity.getAuthenticationKey() == null) : authKey.equals(entity.getAuthenticationKey()))) { throw new AmbariException("The authentication type already exists for this user"); } } }, persist); }
Source:
<code>protected static ILaunchConfiguration findLaunchConfiguration(String name) throws CoreException { ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager(); ILaunchConfiguration[] launchConfigurations = launchManager.getLaunchConfigurations(); for (ILaunchConfiguration <START> lConf : <END> launchConfigurations) { if (lConf.getName().equals(name)) { return lConf; } } return null; }</code><technical_language>rename conf/config</technical_language>

Target:
protected static ILaunchConfiguration findLaunchConfiguration(String name) throws CoreException { ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager(); ILaunchConfiguration[] launchConfigurations = launchManager.getLaunchConfigurations(); for (ILaunchConfiguration config : launchConfigurations) { if (config.getName().equals(name)) { return config; } } return null; }
Source:
<code>public String toString() { <START> return element.getSimpleName().toString() + "( . )"; <END> }</code><technical_language>element.toString() instead? If want specific in printing of messager pass in arguments, do in toString. For debugging easier element.toString() here</technical_language>

Target:
public String toString() { return element.toString(); }
Source:
<code>public void errorDelayedSubscriptionDisposeBeforeTime() { TestScheduler scheduler = new TestScheduler(); Completable result = Completable.complete() .delaySubscription(100, TimeUnit.MILLISECONDS, scheduler); Observer<Void> o = TestHelper.mockObserver(); TestObserver<Void> to = new TestObserver<Void>(o); result.subscribe(to); to.assertEmpty(); scheduler.advanceTimeBy(90, TimeUnit.MILLISECONDS); to.dispose(); scheduler.advanceTimeBy(15, TimeUnit.MILLISECONDS); to.assertEmpty(); <START> verify(o, never()).onComplete(); <END> verify(o, never()).onError(any(Throwable.class)); }</code><technical_language>need talk a mocked observer, TestObserver.assertEmpty() verifies these</technical_language>

Target:
public void errorDelayedSubscriptionDisposeBeforeTime() { TestScheduler scheduler = new TestScheduler(); Completable result = Completable.complete() .delaySubscription(100, TimeUnit.MILLISECONDS, scheduler); TestObserver<Void> to = result.test(); to.assertEmpty(); scheduler.advanceTimeBy(90, TimeUnit.MILLISECONDS); to.dispose(); scheduler.advanceTimeBy(15, TimeUnit.MILLISECONDS); to.assertEmpty(); }
Source:
<code>public void getUploadById() throws Exception { TestUtils.mockPlayContext(); doReturn(researcherSession).when(controller).getAuthenticatedSession(RESEARCHER, ADMIN); <START> DynamoHealthDataRecord record = new DynamoHealthDataRecord(); <END> record.setHealthCode("healthCode"); DynamoUpload2 upload = new DynamoUpload2(); upload.setStudyId("researcher-study-id"); upload.setCompletedBy(UploadCompletionClient.S3_WORKER); UploadView uploadView = new UploadView.Builder().withUpload(upload).withHealthDataRecord(record).build(); when(uploadService.getUploadView(UPLOAD_ID)).thenReturn(uploadView); Result result = controller.getUpload(UPLOAD_ID); assertEquals(200, result.status()); JsonNode node = TestUtils.getJson(result); assertEquals("s3_worker", node.get("completedBy").textValue()); assertEquals("Upload", node.get("type").textValue()); }</code><technical_language>Minor: HealthDataRecord.create()</technical_language>

Target:
public void getUploadById() throws Exception { TestUtils.mockPlayContext(); doReturn(researcherSession).when(controller).getAuthenticatedSession(ADMIN); HealthDataRecord record = HealthDataRecord.create(); record.setHealthCode(HEALTH_CODE); DynamoUpload2 upload = new DynamoUpload2(); upload.setStudyId("researcher-study-id"); upload.setCompletedBy(UploadCompletionClient.S3_WORKER); UploadView uploadView = new UploadView.Builder().withUpload(upload).withHealthDataRecord(record).build(); when(uploadService.getUploadView(UPLOAD_ID)).thenReturn(uploadView); Result result = controller.getUpload(UPLOAD_ID); assertEquals(200, result.status()); JsonNode node = TestUtils.getJson(result); assertEquals("s3_worker", node.get("completedBy").textValue()); assertEquals("Upload", node.get("type").textValue()); assertEquals(HEALTH_CODE, node.get("healthData").get("healthCode").textValue()); }
Source:
<code>private void readHeader() { version = ""; this.lastReadEntry = "ovf:Envelope"; XmlNode node = _document.SelectSingleNode(" if (node != null) { <START> this.lastReadEntry = "Envelope['versio']"; <END> version = node.attributes.get("ovf:version").getValue(); } }</code><technical_language>is a typo here. 'version' of a duplicate strings, this maintenance hard time. OvfProperties, create helper methods for selectNode getAttribute encapsulate this</technical_language>

Target:
private void readHeader() { version = ""; XmlNode node = selectSingleNode(_document, " if (node != null) { version = node.attributes.get("ovf:version").getValue(); } }
Source:
<code>public Object execute(ExecutionEvent event) throws ExecutionException { Repository repository = getRepository(event); if (repository == null) { Shell shell = getShell(event); RepositoryCache repositoryCache = Activator.getDefault() .getRepositoryCache(); <START> Repository[] repositories = repositoryCache.getAllRepositories(); <END> ElementListSelectionDialog repositorySelectionDialog = new ElementListSelectionDialog( shell, new NoRepositorySelectedLabelProvider()); repositorySelectionDialog.setElements(repositories); repositorySelectionDialog.setTitle( UIText.FetchChangeFromGerritCommand_noRepositorySelectedTitle); if (repositorySelectionDialog.open() != Window.OK) { return null; } else { repository = (Repository) repositorySelectionDialog .getResult()[0]; } } FetchGerritChangeWizard wiz = new FetchGerritChangeWizard(repository); NonBlockingWizardDialog dlg = new NonBlockingWizardDialog( HandlerUtil.getActiveShellChecked(event), wiz); dlg.setHelpAvailable(false); dlg.open(); return null; }</code><technical_language>carefully this. This include submodule repos. fine, sure. I suggest for simply RepositoryUtil.getConfiguredRepositories(). is a list of strings, RepositoriesViewContentProvider handle that. RepositoryUtil EGit UI Activator</technical_language>

Target:
public Object execute(ExecutionEvent event) throws ExecutionException { Repository repository = getRepository(event); if (repository == null) { Shell shell = getShell(event); GerritSelectRepositoryPage page = new GerritSelectRepositoryPage(); Wizard wizard = new Wizard() { @Override public boolean performFinish() { return true; } }; wizard.addPage(page); WizardDialog wizardDialog = new WizardDialog(shell, wizard); int result = wizardDialog.open(); if (result != Window.OK) { return null; } repository = page.getRepository(); } FetchGerritChangeWizard wiz = new FetchGerritChangeWizard(repository); NonBlockingWizardDialog dlg = new NonBlockingWizardDialog( HandlerUtil.getActiveShellChecked(event), wiz); dlg.setHelpAvailable(false); dlg.open(); return null; }
Source:
<code>protected CognitoUserSession getCachedSession() { synchronized (GET_CACHED_SESSION_LOCK) { if (userId == null) { throw new CognitoNotAuthorizedException("User-ID is null"); } if (cipSession != null) { if (cipSession.isValidForThreshold()) { return cipSession; } } final CognitoUserSession cachedTokens = readCachedTokens(); if (cachedTokens.isValidForThreshold()) { cipSession = cachedTokens; return cipSession; } if (cachedTokens.getRefreshToken() != null) { try { cipSession = refreshSession(cachedTokens); cacheTokens(cipSession); return cipSession; } catch (final NotAuthorizedException nae) { clearCachedTokens(); throw new CognitoNotAuthorizedException("User is not authenticated", nae); } catch (final Exception e) { <START> clearCachedTokens(); <END> throw new CognitoInternalErrorException("Failed to authenticate user", e); } } throw new CognitoNotAuthorizedException("User is not authenticated"); } }</code><technical_language>scenario hitting requires tokens cleared</technical_language>

Target:
protected CognitoUserSession getCachedSession() { synchronized (GET_CACHED_SESSION_LOCK) { if (userId == null) { throw new CognitoNotAuthorizedException("User-ID is null"); } if (cipSession != null) { if (cipSession.isValidForThreshold()) { return cipSession; } } final CognitoUserSession cachedTokens = readCachedTokens(); if (cachedTokens.isValidForThreshold()) { cipSession = cachedTokens; return cipSession; } if (cachedTokens.getRefreshToken() != null) { try { cipSession = refreshSession(cachedTokens); cacheTokens(cipSession); return cipSession; } catch (final NotAuthorizedException nae) { clearCachedTokens(); throw new CognitoNotAuthorizedException("User is not authenticated", nae); } catch (final UserNotFoundException unfe) { clearCachedTokens(); throw new CognitoNotAuthorizedException("User does not exist", unfe); }catch (final Exception e) { throw new CognitoInternalErrorException("Failed to authenticate user", e); } } throw new CognitoNotAuthorizedException("User is not authenticated"); } }
Source:
<code>public void testMaxAllocation() throws Exception { int maxAllocation = 1024; EmbeddedChannel chDecoder = new EmbeddedChannel(createDecoder(ZlibWrapper.NONE, maxAllocation)); TestByteBufAllocator alloc = new TestByteBufAllocator(chDecoder.alloc()); chDecoder.config().setAllocator(alloc); try { chDecoder.writeInbound(Unpooled.copiedBuffer(BYTES_LARGE)); fail("decompressed size > maxAllocation, so should have thrown exception"); } catch (DecompressionException e) { assertEquals(maxAllocation, alloc.getMaxAllocation()); <START> } <END> }</code><technical_language>call chDecoder.finish() assert return</technical_language>

Target:
public void testMaxAllocation() throws Exception { int maxAllocation = 1024; ZlibDecoder decoder = createDecoder(ZlibWrapper.ZLIB, maxAllocation); EmbeddedChannel chDecoder = new EmbeddedChannel(decoder); TestByteBufAllocator alloc = new TestByteBufAllocator(chDecoder.alloc()); chDecoder.config().setAllocator(alloc); try { chDecoder.writeInbound(Unpooled.wrappedBuffer(deflate(BYTES_LARGE))); fail("decompressed size > maxAllocation, so should have thrown exception"); } catch (DecompressionException e) { assertTrue(e.getMessage().startsWith("Decompression buffer has reached maximum size")); assertEquals(maxAllocation, alloc.getMaxAllocation()); assertTrue(decoder.isClosed()); assertFalse(chDecoder.finish()); } }
Source:
<code>public IntervalStatistics(IntervalManager intervalManager, StatisticsInterval selectedInterval) { <START> this.selectedInterval = selectedInterval; <END> intervalPersister = intervalManager.getIntervalsStatisticsPersister(); addIntervals(intervalManager); filterIntervals(); calculateStatistics(); }</code><technical_language>Please retain assignment order</technical_language>

Target:
public IntervalStatistics(IntervalManager intervalManager, StatisticsInterval selectedInterval) { intervalPersister = intervalManager.getIntervalsStatisticsPersister(); this.selectedInterval = selectedInterval; addIntervals(intervalManager); filterIntervals(); calculateStatistics(); }
Source:
<code>public Take route(final Request req) throws IOException { final String file; final Href href = new RqHref(req).href(); final String key = "file"; final Iterator<String> param = href.param(key).iterator(); <START> if (param.hasNext()) { <END> file = param.next(); } else { final String disposition = new RqHeaders( new RqMultipart(req).part(key).iterator().next() ).header("Content-Disposition").iterator().next(); file = StringUtils.substringBefore( StringUtils.substringAfter(disposition, "filename=\""), "\"" ); } final Doc doc = this.base.user( new RqAuth(req).identity().urn() ).docs().doc(file); return new TsFork( new FkRegex("/doc/read", new TkRead(doc)), new FkRegex("/doc/delete", new TkDelete(doc)), new FkRegex( "/doc/write", new Takes() { @Override public Take route(final Request request) { return new TkWrite(doc, req); } } ), new FkRegex( "/doc/add-friend", new Takes() { @Override public Take route(final Request request) { return new TkAddFriend( doc, href.param("friend").iterator().next() ); } } ) ).route(req); }</code><technical_language>Do need this if/else? filename is passed part of multipart request</technical_language>

Target:
public Take route(final Request req) throws IOException { final String file; final Href href = new RqHref(req).href(); final String key = "file"; final Iterator<String> param = href.param(key).iterator(); if (param.hasNext()) { file = param.next(); } else { final String disposition = new RqHeaders( new RqMultipart(req).part(key).iterator().next() ).header("Content-Disposition").iterator().next(); file = StringUtils.substringBefore( StringUtils.substringAfter(disposition, "filename=\""), "\"" ); } final Doc doc = this.base.user( new RqAuth(req).identity().urn() ).docs().doc(file); return new TsFork( new FkRegex("/doc/read", new TkRead(doc)), new FkRegex("/doc/delete", new TkDelete(doc)), new FkRegex( "/doc/write", new Takes() { @Override public Take route(final Request request) { return new TkWrite(doc, req); } } ), new FkRegex( "/doc/add-friend", new Takes() { @Override public Take route(final Request rst) throws IOException { return new TkAddFriend( doc, new RqForm(rst).param("friend").iterator().next() ); } } ), new FkRegex( "/doc/eject-friend", new Takes() { @Override public Take route(final Request rst) { return new TkEjectFriend( doc, href.param("friend").iterator().next() ); } } ) ).route(req); }
Source:
<code>public NetCDFFileImportMethod(@Nonnull File sourceFile, Predicate<MsScan> msScanPredicate) { this.sourceFile = sourceFile; <START> this.msScanPredicate = msScanPredicate != null ? msScanPredicate : s -> true; <END> }</code><technical_language>avoid explicitly passing in a null value? initializing msScanPredicate s -> true (line 68) Predicate.and() method</technical_language>

Target:
public NetCDFFileImportMethod(@Nonnull File sourceFile, Predicate<MsScan> msScanPredicate) { this.sourceFile = sourceFile; this.msScanPredicate = this.msScanPredicate.and(msScanPredicate); }
Source:
<code>protected void run() throws Failure { if (all && projectNames.size() > 0) { throw new UnloggedFailure(1, "error: cannot combine --all and PROJECT"); } ReplicationState state = new ReplicationState(this, ReplicationType.COMMAND); Future<?> future = null; if (all) { future = pushAllFactory.create(urlMatch, state).schedule(0, TimeUnit.SECONDS); } else { for (String name : projectNames) { Project.NameKey key = new Project.NameKey(name); if (projectCache.get(key) != null) { replication.scheduleFullSync(key, urlMatch, state); } else { writeStdErrSync("error: '" + name + "': not a Gerrit project"); } } state.allTaskScheduled(); } if (wait) { if (future != null) { try { future.get(); } catch (InterruptedException e) { log.warn("Thread was interrupted while waiting for PushAll operation to finish", e); } catch (ExecutionException e) { log.warn("An exception was thrown in PushAll operation", e); } } if (state.hasPushTask()) { <START> state.waitForReplication(); <END> } else { writeStdOutSync("Everything is up-to-date. No need to replicate."); } } }</code><technical_language>deadlock is tricky. Typically, completed replication lowers state's latch. However, if "all" is true, replications finished PushAll call allTaskScheduled, extra condition in waitForReplication's locked statement trick. latch stays 1 for this setting. This is unnecessarily complicated. decrease latch in settings? waitForReplication simpler</technical_language>

Target:
protected void run() throws Failure { if (all && projectNames.size() > 0) { throw new UnloggedFailure(1, "error: cannot combine --all and PROJECT"); } ReplicationState state = new ReplicationState(ReplicationType.COMMAND, this); Future<?> future = null; if (all) { future = pushAllFactory.create(urlMatch, state).schedule(0, TimeUnit.SECONDS); } else { for (String name : projectNames) { Project.NameKey key = new Project.NameKey(name); if (projectCache.get(key) != null) { replication.scheduleFullSync(key, urlMatch, state); } else { writeStdErrSync("error: '" + name + "': not a Gerrit project"); } } state.markAllPushTasksScheduled(); } if (wait) { if (future != null) { try { future.get(); } catch (InterruptedException e) { log.warn("Thread was interrupted while waiting for PushAll operation to finish", e); } catch (ExecutionException e) { log.warn("An exception was thrown in PushAll operation", e); } } if (state.hasPushTask()) { state.waitForReplication(); } else { writeStdOutSync("Nothing to replicate"); } } }
Source:
<code>protected boolean canDoAction() { boolean retValue = isVmExist(); if (retValue) { List<VM> listVms = getVmDAO().getForDisk(_oldDisk.getId()).get(Boolean.TRUE); sharedLockMap = listVms.isEmpty() ? null : new HashMap<Guid, String>(); <START> for (VM vm : listVms) { <END> sharedLockMap.put(vm.getId(), LockingGroup.VM.name()); if (vm.getstatus() != VMStatus.Down) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_VM_STATUS_ILLEGAL); return false; } } ImagesHandler.setDiskAlias(getParameters().getDiskInfo(), getVm()); retValue = isDiskExist(_oldDisk) && checkCanPerformRegularUpdate(); } return retValue; }</code><technical_language>I u inserted , a lock code, file couple of patches wtf..., code that: buildSharedLockMap(); retValue = acquireLockInternal(); for(vm : listVms) { if (vm.getstatus() != VMStatus.Down) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_VM_STATUS_ILLEGAL); } } }</technical_language>

Target:
protected boolean canDoAction() { boolean retValue = isVmExist(); if (retValue) { List<VM> listVms = getVmDAO().getForDisk(_oldDisk.getId()).get(Boolean.TRUE); sharedLockMap = listVms.isEmpty() ? null : new HashMap<Guid, String>(); for (VM vm : listVms) { sharedLockMap.put(vm.getId(), LockingGroup.VM.name()); if (vm.getstatus() != VMStatus.Down) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_VM_STATUS_ILLEGAL); return false; } } retValue = acquireLockInternal() && isDiskExist(_oldDisk) && checkCanPerformRegularUpdate(); } return retValue; }
Source:
<code>@Test public void testCastToTimestamp() { final String sql = "select cast(\"timestamp\" as timestamp) from \"foodmart\""; final String druidQuery = "{\"queryType\":\"scan\",\"dataSource\":\"foodmart\"," + "\"intervals\":[\"1900-01-09T00:00:00.000Z/2992-01-10T00:00:00.000Z\"]," + "\"virtualColumns\":[{\"type\":\"expression\",\"name\":\"vc\"," + "\"expression\":\"timestamp_parse(" + "timestamp_format(\\\"__time\\\",'yyyy-MM-dd\\\\u0027T\\\\u0027HH:mm:ss.SSS\\\\u0027Z\\\\u0027'," + "'America/New_York'),'yyyy-MM-dd\\\\u0027T\\\\u0027HH:mm:ss.SSS\\\\u0027Z\\\\u0027','UTC')\"," + "\"outputType\":\"LONG\"}]," + "\"columns\":[\"vc\"]," + "\"resultFormat\":\"compactedList\"}"; CalciteAssert.that() <START> .enable(enabled()) <END> .withModel(FOODMART) .with(CalciteConnectionProperty.TIME_ZONE.camelName(), "America/New_York") .query(sql) .runs() .queryContains(list -> { assertThat(list.size(), is(1)); DruidQuery.QuerySpec querySpec = (DruidQuery.QuerySpec) list.get(0); assertThat(querySpec.getQueryString(null, -1), containsString(druidQuery)); }); }</code><technical_language>5 spaces :(, 4 spaces for continuous indention</technical_language>

Target:
@Test public void testCastToTimestamp() { final String sql = "select cast(\"timestamp\" as timestamp) from \"foodmart\""; final String druidQuery = "timestamp_format(\\\"__time\\\"," + "'yyyy-MM-dd\\\\u0027T\\\\u0027HH:mm:ss.SSS\\\\u0027Z\\\\u0027'," + "'America/New_York'),'yyyy-MM-dd\\\\u0027T\\\\u0027HH:mm:ss.SSS\\\\u0027Z\\\\u0027','UTC')\""; CalciteAssert.that() .enable(enabled()) .withModel(FOODMART) .with(CalciteConnectionProperty.TIME_ZONE.camelName(), "America/New_York") .query(sql) .runs() .queryContains(list -> { assertThat(list.size(), is(1)); DruidQuery.QuerySpec querySpec = (DruidQuery.QuerySpec) list.get(0); assertThat(querySpec.getQueryString(null, -1), containsString(druidQuery)); }); }
Source:
<code><START> public synchronized void init(ByteBuffer buffer, int position) <END> { MergingDigest emptyDigest = new MergingDigest(compression); putSketch(buffer, position, emptyDigest); }</code><technical_language>BufferAggregator synchronized in incremental index</technical_language>

Target:
public void init(ByteBuffer buffer, int position) { MergingDigest emptyDigest = new MergingDigest(compression); addToCache(buffer, position, emptyDigest); }
Source:
<code>public int readActiveCache() { if (!cacheActiveEnabled) { return 0; } int index = 0; synchronized (cacheActiveFile) { if (!cacheActiveFile.exists()) { return 0; } try (RandomAccessFile raf = new RandomAccessFile(cacheActiveFile, "rw"); FileChannel fc = raf.getChannel(); FileLock lock = fc.tryLock()) { if (lock != null) { index = Integer.parseInt(raf.readLine()) % proxies.size(); } } catch (Throwable e) { <START> LOG.warn("Filed to read active index from cache file " <END> + cacheActiveFile, e); } } return index; }</code><technical_language>"Failed"</technical_language>

Target:
private int readActiveCache() { if (!cacheActiveEnabled) { return 0; } int index = 0; synchronized (cacheActiveFile) { if (!cacheActiveFile.exists()) { return 0; } try (RandomAccessFile raf = new RandomAccessFile(cacheActiveFile, "rw"); FileChannel fc = raf.getChannel(); FileLock lock = fc.tryLock(0, Long.MAX_VALUE, true)) { if (lock != null) { index = Integer.parseInt(raf.readLine()) % proxies.size(); if (index < 0) { return 0; } } } catch (Throwable e) { LOG.warn("Failed to read active index from cache file " + cacheActiveFile + ", It may be due to permission issues, the " + "dfs.client.failover.cache-active.dir must be properly " + "configured! Now we will begin from index 0.", e); } } return index; }
Source:
<code>public DataCenter get() { StoragePoolQueryParametersBase params = new StoragePoolQueryParametersBase(guid); <START> params.setFiltered(SessionUtils.isFiltered()); <END> return performGet(VdcQueryType.GetStoragePoolById, params); }</code><technical_language>this is in performGet()? solve this in generic way..</technical_language>

Target:
public DataCenter get() { return performGet(VdcQueryType.GetStoragePoolById, new StoragePoolQueryParametersBase(guid)); }
Source:
<code>public String getSlaveAgentHostAddress() throws IOException { <START> return new InetSocketAddress(0).getAddress().getHostAddress(); <END> }</code><technical_language>Surely this wrapped in a Callable runs slave master? (It produce 0.0.0.0 I try Linux machine, if is guaranteed hardcode string with.)</technical_language>

Target:
public String getSlaveAgentHostAddress() throws IOException, InterruptedException { return channel.call(new GetWildcardAddress()); }
Source:
<code>public void should_support_db_key() { ComponentDto project = db.components().insertMainBranch(); ComponentDto mergeBranch = db.components().insertProjectBranch(project, b -> b.setKey("mergeBranch")); ComponentDto branch1 = db.components().insertProjectBranch(project, b -> b.setKey("branch1")); ComponentDto mergeBranchFile = ComponentTesting.newFileDto(mergeBranch, null, "file").setUuid("mergeFile"); <START> ComponentDto file = ComponentTesting.newFileDto(branch1, null, "file").setUuid("file1"); <END> db.components().insertComponents(mergeBranchFile, file); when(branch.getMergeBranchUuid()).thenReturn(Optional.of(mergeBranch.uuid())); assertThat(underTest.getUuid(file.getDbKey())).isEqualTo(mergeBranchFile.uuid()); }</code><technical_language>5 variables duplicated in test cases. fields. Also, mergeBranch in analysisMetadataHolder.setBranch(...), when(...) necessary, branch field neither. Finally, branch1 file renamed branch branchFile, consistent mirror mergeBranch mergeBranchFile</technical_language>

Target:
public void should_support_db_key() { when(branch.getMergeBranchUuid()).thenReturn(Optional.of(mergeBranch.uuid())); assertThat(underTest.getUuid(branchFile.getDbKey())).isEqualTo(mergeBranchFile.uuid()); }
Source:
<code>public Signature build() { return new Signature( name, kind, <START> typeVariableConstraints, <END> argumentTypes, returnType, variableArityGroup, variableArity); }</code><technical_language>add some assertions required properties set? (name, kind, argument types..)</technical_language>

Target:
public Signature build() { assert name != null : "Signature requires the 'name' to be set"; assert kind != null : "Signature requires the 'kind' to be set"; assert returnType != null : "Signature requires the 'returnType' to be set"; return new Signature( name, kind, typeVariableConstraints, argumentTypes, returnType, variableArityGroup, variableArity); }
Source:
<code><START> public void testGetValue() { <END> dateSelector.getValue(); verify(view).getValue(); }</code><technical_language>coverage is important in a unit test. Notice getValue method is **100%** covered, however, I change this: java @Override public String getValue() { view.getValue(); return "Wrong value!!!"; } ..and test testGetValue pass. need **really** test logic of method. unit test (now, tests method breaks logic changes): java @Test public void testGetValue() { final String expectedValue = "value"; when(view.getValue()).thenReturn(expectedValue); final String actualValue = dateSelector.getValue(); assertEquals(expectedValue, actualValue); }</technical_language>

Target:
public void testGetValue() { final String expectedValue = "value"; when(view.getValue()).thenReturn(expectedValue); final String actualValue = dateSelector.getValue(); assertEquals(expectedValue, actualValue); }
Source:
<code>private void proposeLeadershipOrWaitForBackoff(LeadershipState currentState) throws InterruptedException { if (!leaderEligible.get()) { if (leaderEligibilityLoggingRateLimiter.tryAcquire()) { log.debug("Not eligible for leadership"); } return; } <START> if (isSuccessfulPing(pingLeader(currentState.greatestLearnedValue()))) { <END> Thread.sleep(updatePollingRate.toMillis()); return; } boolean learnedNewState = updateLearnedStateFromPeers(currentState.greatestLearnedValue()); if (learnedNewState) { return; } long backoffTime = (long) (randomWaitBeforeProposingLeadership.toMillis() * Math.random()); log.debug("Waiting for ms before proposing leadership", SafeArg.of("waitTimeMs", backoffTime)); Thread.sleep(backoffTime); proposeLeadershipAfter(currentState.greatestLearnedValue()); }</code><technical_language>I this name is misleading, "isSuccessfulPing" suggests checking some invariant, in fact caching result of lookup. I caching in pingLeader is more appropriate</technical_language>

Target:
private void proposeLeadershipOrWaitForBackoff(LeadershipState currentState) throws InterruptedException { if (!leaderEligible.get()) { if (leaderEligibilityLoggingRateLimiter.tryAcquire()) { log.debug("Not eligible for leadership"); } throw new InterruptedException("leader no longer eligible"); } if (pingLeader(currentState.greatestLearnedValue()).isSuccessful()) { Thread.sleep(updatePollingRate.toMillis()); return; } boolean learnedNewState = updateLearnedStateFromPeers(currentState.greatestLearnedValue()); if (learnedNewState) { return; } long backoffTime = (long) (randomWaitBeforeProposingLeadership.toMillis() * Math.random()); log.debug("Waiting for ms before proposing leadership", SafeArg.of("waitTimeMs", backoffTime)); Thread.sleep(backoffTime); proposeLeadershipAfter(currentState.greatestLearnedValue()); }
Source:
<code>public void testDoesNotOverRead() { class ReadInterceptingHandler extends ChannelDuplexHandler { private int readsTriggered; @Override public void read(ChannelHandlerContext ctx) throws Exception { readsTriggered++; super.read(ctx); } } ReadInterceptingHandler interceptor = new ReadInterceptingHandler(); EmbeddedChannel channel = new EmbeddedChannel(); channel.config().setAutoRead(false); channel.pipeline().addLast(interceptor, new FixedLengthFrameDecoder(3)); assertEquals(0, interceptor.readsTriggered); channel.writeInbound(wrappedBuffer(new byte[] { 0, 1 })); assertEquals(1, interceptor.readsTriggered); channel.writeInbound(wrappedBuffer(new byte[] { 2 }), wrappedBuffer(new byte[] { 3, 4, 5 })); assertEquals(1, interceptor.readsTriggered); channel.writeInbound(wrappedBuffer(new byte[] { 6, 7, 8 }), wrappedBuffer(new byte[] { 9 })); assertEquals(1, interceptor.readsTriggered); channel.writeInbound(wrappedBuffer(new byte[] { 10, 11 }), wrappedBuffer(new byte[] { 12 })); assertEquals(1, interceptor.readsTriggered); channel.writeInbound(wrappedBuffer(new byte[] { 13 })); assertEquals(2, interceptor.readsTriggered); channel.writeInbound(wrappedBuffer(new byte[] { 14 })); assertEquals(2, interceptor.readsTriggered); for (int i = 0; i < 5; i++) { ByteBuf read = channel.readInbound(); assertEquals(i * 3 + 0, read.getByte(0)); assertEquals(i * 3 + 1, read.getByte(1)); <START> assertEquals(i * 3 + 2, read.getByte(2)); <END> } assertFalse(channel.finish()); }</code><technical_language>read.release() is missing</technical_language>

Target:
public void testDoesNotOverRead() { class ReadInterceptingHandler extends ChannelOutboundHandlerAdapter { private int readsTriggered; @Override public void read(ChannelHandlerContext ctx) throws Exception { readsTriggered++; super.read(ctx); } } ReadInterceptingHandler interceptor = new ReadInterceptingHandler(); EmbeddedChannel channel = new EmbeddedChannel(); channel.config().setAutoRead(false); channel.pipeline().addLast(interceptor, new FixedLengthFrameDecoder(3)); assertEquals(0, interceptor.readsTriggered); channel.writeInbound(wrappedBuffer(new byte[] { 0, 1 })); assertEquals(1, interceptor.readsTriggered); channel.writeInbound(wrappedBuffer(new byte[] { 2 }), wrappedBuffer(new byte[] { 3, 4, 5 })); assertEquals(1, interceptor.readsTriggered); channel.writeInbound(wrappedBuffer(new byte[] { 6, 7, 8 }), wrappedBuffer(new byte[] { 9 })); assertEquals(1, interceptor.readsTriggered); channel.writeInbound(wrappedBuffer(new byte[] { 10, 11 }), wrappedBuffer(new byte[] { 12 })); assertEquals(1, interceptor.readsTriggered); channel.writeInbound(wrappedBuffer(new byte[] { 13 })); assertEquals(2, interceptor.readsTriggered); channel.writeInbound(wrappedBuffer(new byte[] { 14 })); assertEquals(2, interceptor.readsTriggered); for (int i = 0; i < 5; i++) { ByteBuf read = channel.readInbound(); assertEquals(i * 3 + 0, read.getByte(0)); assertEquals(i * 3 + 1, read.getByte(1)); assertEquals(i * 3 + 2, read.getByte(2)); read.release(); } assertFalse(channel.finish()); }
Source:
<code>public boolean hasUnionPlan() throws Exception { boolean result = false; ExecutionBlock terminalBlock = plan.getTerminalBlock(); <START> terminalBlock.setPlan(terminalBlock.getPlan()); <END> if (plan.getChilds(terminalBlock.getId()).size() >= 2) { result = true; } return result; }</code><technical_language>terminal block plan, this line affect anything. I is intention</technical_language>

Target:
public boolean hasUnionPlan() throws Exception { boolean result = false; ExecutionBlock terminalBlock = plan.getTerminalBlock(); if (plan.getChilds(terminalBlock.getId()).size() >= 2) { result = true; } return result; }
Source:
<code>private static int getIntOffset(WindowFrameBound bound, Value[] values, Session session) { Value v = bound.isVariable() ? values[bound.getExpressionIndex()] : bound.getValue().getValue(session); int value = v.getInt(); if (v == ValueNull.INSTANCE || value < 0) { <START> throw DbException.getInvalidValueException("unsigned range", v.getTraceSQL()); <END> } return value; }</code><technical_language>"unsigned range" -> "range null negative"</technical_language>

Target:
private static int getIntOffset(WindowFrameBound bound, Value[] values, Session session) { Value v = bound.isVariable() ? values[bound.getExpressionIndex()] : bound.getValue().getValue(session); int value = v.getInt(); if (v == ValueNull.INSTANCE || value < 0) { throw DbException.get(ErrorCode.INVALID_PRECEDING_OR_FOLLOWING_1, v.getTraceSQL()); } return value; }
Source:
<code>public void testInt3139JsonPathFilter() { this.filterInput1.send(testMessage); Message<?> receive = this.output.receive(1000); assertNotNull(receive); assertEquals(JSON, receive.getPayload()); this.filterInput2.send(testMessage); receive = this.output.receive(1000); assertNotNull(receive); Message<String> message = MessageBuilder.withPayload(JSON) .setHeader("price", 10) .build(); this.filterInput3.send(message); receive = this.output.receive(1000); assertNotNull(receive); this.filterInput4.send(testMessage); receive = this.output.receive(1000); assertNotNull(receive); <START> <END> }</code><technical_language>of tests verify message passes filter; message **is** filtered receive = this.output.receive(0); assertNull(receive)</technical_language>

Target:
public void testInt3139JsonPathFilter() { this.filterInput1.send(testMessage); Message<?> receive = this.output.receive(1000); assertNotNull(receive); assertEquals(JSON, receive.getPayload()); this.filterInput2.send(testMessage); receive = this.output.receive(1000); assertNotNull(receive); Message<String> message = MessageBuilder.withPayload(JSON) .setHeader("price", 10) .build(); this.filterInput3.send(message); receive = this.output.receive(1000); assertNotNull(receive); this.filterInput4.send(testMessage); receive = this.output.receive(1000); assertNotNull(receive); try { this.filterInput1.send(new GenericMessage<String>("{foo:{}}")); fail("MessageRejectedException is expected."); } catch (Exception e) { assertThat(e, Matchers.instanceOf(MessageRejectedException.class)); } receive = this.output.receive(0); assertNull(receive); receive = this.discardChannel.receive(1000); assertNotNull(receive); }
Source:
<code>public void write(Image entity, FieldWriter writer, OutputContext ctxt) throws IOException { writer.writeField("uri", entity.getCanonicalUri()); writer.writeField("mime_type", entity.getMimeType()); Image.Type type = entity.getType(); <START> writer.writeField("type", (type != null || type != Image.Type.GENERIC) ? entity.getType().getName() : null); <END> Image.Color color = entity.getColor(); writer.writeField("color", color != null ? entity.getColor().getName() : null); Image.Theme theme = entity.getTheme(); writer.writeField("theme", theme != null ? entity.getTheme().getName() : null); Image.AspectRatio aspectRatio = entity.getAspectRatio(); writer.writeField("aspect_ratio", aspectRatio != null ? entity.getAspectRatio().getName() : null); writer.writeField("availability_start", entity.getAvailabilityStart()); writer.writeField("availability_end", entity.getAvailabilityEnd()); writer.writeField("width", entity.getWidth()); writer.writeField("height", entity.getHeight()); writer.writeField("hasTitleArt", entity.hasTitleArt()); writer.writeObject(sourceWriter, entity.getSource(), ctxt); }</code><technical_language>do need special-case Image.Type.GENERIC here? another in enum it</technical_language>

Target:
public void write(Image entity, FieldWriter writer, OutputContext ctxt) throws IOException { writer.writeField("uri", entity.getCanonicalUri()); writer.writeField("mime_type", entity.getMimeType()); Image.Type type = entity.getType(); writer.writeField("type", type != null ? entity.getType().getName() : null); Image.Color color = entity.getColor(); writer.writeField("color", color != null ? entity.getColor().getName() : null); Image.Theme theme = entity.getTheme(); writer.writeField("theme", theme != null ? entity.getTheme().getName() : null); Image.AspectRatio aspectRatio = entity.getAspectRatio(); writer.writeField("aspect_ratio", aspectRatio != null ? entity.getAspectRatio().getName() : null); writer.writeField("availability_start", entity.getAvailabilityStart()); writer.writeField("availability_end", entity.getAvailabilityEnd()); writer.writeField("width", entity.getWidth()); writer.writeField("height", entity.getHeight()); writer.writeField("hasTitleArt", entity.hasTitleArt()); writer.writeObject(sourceWriter, entity.getSource(), ctxt); }
Source:
<code><START> public static boolean check(String blob, String password) throws IOException, GeneralSecurityException { <END> final Map<String, String> map; try { map = getEncryptionMap(blob); } catch (JsonParseException e) { LOG.warn("Invalid format of previous password. Cannot check equality of previous and new password."); return false; } if (!ARTIFACT.equals(map.get(ARTIFACT_KEY))) { throw new IllegalArgumentException(String.format("Invalid artifact '%s'", map.get(ARTIFACT_KEY))); } if (!VERSION.equals(map.get(VERSION_KEY))) { throw new IllegalArgumentException(String.format("Invalid version '%s'", map.get(VERSION_KEY))); } byte[] salt = Base64.decodeBase64(map.get(SALT_KEY)); return Arrays.equals( Base64.decodeBase64(map.get(SECRET_KEY)), SecretKeyFactory.getInstance(map.get(ALGORITHM_KEY)).generateSecret( new PBEKeySpec( password.toCharArray(), salt, Integer.parseInt(map.get(ITERATIONS_KEY)), salt.length * 8 ) ).getEncoded() ); }</code><technical_language>correctFormat() method reused here</technical_language>

Target:
public static boolean check(String blob, String password) throws IOException, GeneralSecurityException { final Map<String, String> map = getEncryptionMap(blob); if (map.isEmpty()) { LOG.warn("Invalid format of previous password. Cannot check equality of previous and new password."); return false; } if (!ARTIFACT.equals(map.get(ARTIFACT_KEY))) { throw new IllegalArgumentException(String.format("Invalid artifact '%s'", map.get(ARTIFACT_KEY))); } if (!VERSION.equals(map.get(VERSION_KEY))) { throw new IllegalArgumentException(String.format("Invalid version '%s'", map.get(VERSION_KEY))); } byte[] salt = Base64.decodeBase64(map.get(SALT_KEY)); return Arrays.equals( Base64.decodeBase64(map.get(SECRET_KEY)), SecretKeyFactory.getInstance(map.get(ALGORITHM_KEY)).generateSecret( new PBEKeySpec( password.toCharArray(), salt, Integer.parseInt(map.get(ITERATIONS_KEY)), salt.length * 8 ) ).getEncoded() ); }
Source:
<code>public void close(String namespace) { <START> final byte[] pattern = redisKey(prefix, hash(namespace), "*"); <END> try (final Jedis client = pool.getResource()) { final Set<byte[]> keys = client.keys(pattern); if (keys.size() == 0) { return; } client.del(keys.toArray(new byte[keys.size()][])); } catch (JedisConnectionException ex) { Throwables.propagate(ex); } catch (JedisException ex) { log.warn(ex, "Error cleaning cache items"); } }</code><technical_language>experience redis, is listing keys pattern a long time. This a problem, want operations lock query side. Is a issue asynchronous operations jedis, want create a separate threadpool queue operations</technical_language>

Target:
public void close(String namespace) { try (ResourceHolder<ShardedJedis> clientHolder = supplier.get()) { final ShardedJedis jedis = clientHolder.get(); final byte[] setKey = CacheImplUtils.computeNamespaceHash(prefix, namespace).getBytes(); final Set<byte[]> keys = jedis.smembers(setKey); if (keys.size() == 0) { return; } keys.add(setKey); for (byte[] key : keys) { final String itemKey = CacheImplUtils.computeKeyHash(prefix, namespace, key); jedis.del(itemKey); } } catch (JedisConnectionException | IOException ex) { Throwables.propagate(ex); } catch (JedisException ex) { log.warn(ex, "Error cleaning cache items"); } }
Source:
<code><START> public void areUniqueAndOrderedLong() { <END> final int iterations = 1000; CorfuRuntime r = getDefaultRuntime(); OrderedGUIDGenerator guidGenerator = r.getGuidGenerator(); long lastValue = 0; HashSet<Long> uniq = new HashSet<>(iterations); for (int i = 0; i < iterations; i++) { long current = guidGenerator.nextLong(); assertThat(current).isGreaterThan(lastValue); lastValue = current; assertThat(uniq).doesNotContain(current); uniq.add(current); } }</code><technical_language>create instance of CorfuRuntime. need extend AbstractViewTest</technical_language>

Target:
public void areUniqueAndOrderedLong() { final int iterations = 1000; CorfuRuntime r = getDefaultRuntime(); OrderedGuidGenerator guidGenerator = r.getGuidGenerator(); long lastValue = 0; HashSet<Long> uniq = new HashSet<>(iterations); for (int i = 0; i < iterations; i++) { long current = guidGenerator.nextLong(); assertThat(current).isGreaterThan(lastValue); lastValue = current; assertThat(uniq).doesNotContain(current); uniq.add(current); } }
Source:
<code>static String chomp(String line) { <START> if (line.charAt(line.length() - 1) == '\n') { <END> return line.substring(0, line.length() - 1); } return line; }</code><technical_language>consider paranoid prefix "line.length() > 0"</technical_language>

Target:
static String chomp(String line) { if (line != null && !line.isEmpty() && line.charAt(line.length() - 1) == '\n') { return line.substring(0, line.length() - 1); } return line; }
Source:
<code><START> public void start() { <END> LOG.info("Starting Replication Monitor Thread."); running = true; replicationMonitor.start(); }</code><technical_language>Addressed</technical_language>

Target:
public synchronized void start() { if (!running) { LOG.info("Starting Replication Monitor Thread."); running = true; replicationMonitor.start(); } else { LOG.info("Replication Monitor Thread is already running."); } }
Source:
<code>public int compareTo(UInt128 other) { if (this.equals(other)) { return 0; } <START> if ((this.high < this.high) || ((this.high == other.high) && (this.low < other.low))) { <END> return -1; } return 1; }</code><technical_language>I this is a typo -> this.high < this.high -> -> this.high < other.high ?</technical_language>

Target:
public int compareTo(UInt128 other) { if (this.equals(other)) { return 0; } if ((this.high < other.high) || ((this.high == other.high) && (this.low < other.low))) { return -1; } return 1; }