auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private boolean modifyOne(Change.Id changeId) throws Exception { changeControlFactory.validateFor(changeId); ReviewerResult result; boolean ok = true; result = removeReviewerFactory.create(changeId, toRemove).call(); ok &= result.getErrors().isEmpty(); for (ReviewerResult.Error resultError : result.getErrors()) { String message; switch (resultError.getType()) { case REMOVE_NOT_PERMITTED: message = "not permitted to remove {0} from {1}"; break; case COULD_NOT_REMOVE: message = "could not remove {0} from {1}"; break; default: message = "could not remove {0}: {2}"; } writeError("error", MessageFormat.format(message, resultError.getName(), changeId, resultError.getType())); } result = addReviewerFactory.create(changeId, stringSet(toAdd), false).call(); ok &= result.getErrors().isEmpty(); for (ReviewerResult.Error resultError : result.getErrors()) { String message; switch (resultError.getType()) { case ACCOUNT_OR_GROUP_NOT_FOUND: <START> message = "account {0} not found"; <END> break; case ACCOUNT_INACTIVE: message = "account {0} inactive"; break; case CHANGE_NOT_VISIBLE: message = "change {1} not visible to {0}"; break; default: message = "could not add {0}: {2}"; } writeError("error", MessageFormat.format(message, resultError.getName(), changeId, resultError.getType())); } return ok; }</code><technical_language>Message accurate</technical_language>

Target:
private boolean modifyOne(Change.Id changeId) throws Exception { changeControlFactory.validateFor(changeId); ReviewerResult result; boolean ok = true; result = removeReviewerFactory.create(changeId, toRemove).call(); ok &= result.getErrors().isEmpty(); for (ReviewerResult.Error resultError : result.getErrors()) { String message; switch (resultError.getType()) { case REMOVE_NOT_PERMITTED: message = "not permitted to remove {0} from {1}"; break; case COULD_NOT_REMOVE: message = "could not remove {0} from {1}"; break; default: message = "could not remove {0}: {2}"; } writeError("error", MessageFormat.format(message, resultError.getName(), changeId, resultError.getType())); } result = addReviewerFactory.create(changeId, stringSet(toAdd), false).call(); ok &= result.getErrors().isEmpty(); for (ReviewerResult.Error resultError : result.getErrors()) { String message; switch (resultError.getType()) { case REVIEWER_NOT_FOUND: message = "account {0} not found"; break; case ACCOUNT_INACTIVE: message = "account {0} inactive"; break; case CHANGE_NOT_VISIBLE: message = "change {1} not visible to {0}"; break; default: message = "could not add {0}: {2}"; } writeError("error", MessageFormat.format(message, resultError.getName(), changeId, resultError.getType())); } return ok; }
Source:
<code>public void cancelSnapshotSyncInProgressAndRetry() throws Exception { observeSnapshotSync = true; initLogReplicationFSM(ReaderImplementation.TEST); ((TestSnapshotReader)snapshotReader).setBatchSize(BATCH_SIZE); limitSnapshotMessages = 2; writeToStream(); transitionAvailable.acquire(); transition(LogReplicationEventType.SNAPSHOT_SYNC_REQUEST, LogReplicationStateType.IN_SNAPSHOT_SYNC); transitionAvailable.acquire(); fsm.input(new LogReplicationEvent(LogReplicationEventType.REPLICATION_STOP)); while (fsm.getState().getType() != LogReplicationStateType.INITIALIZED) { } assertThat(fsm.getState().getType()).isEqualTo(LogReplicationStateType.INITIALIZED); ((TestDataSender) dataSender).reset(); observeSnapshotSync = false; Queue<LogReplicationEntry> listenerQueue = ((TestDataSender) dataSender).getEntryQueue(); fsm.input(new LogReplicationEvent(LogReplicationEventType.SNAPSHOT_SYNC_REQUEST)); for (int i = 0; i<(NUM_ENTRIES/(BATCH_SIZE * SnapshotSender.SNAPSHOT_BATCH_SIZE)) + 1; i++) { } while (listenerQueue.size() < NUM_ENTRIES) { <START> int i = listenerQueue.size(); <END> } assertThat(listenerQueue.size()).isEqualTo(NUM_ENTRIES); for (int i=0; i<NUM_ENTRIES; i++) { assertThat(listenerQueue.poll().getPayload()) .isEqualTo( String.format(PAYLOAD_FORMAT, i).getBytes()); } }</code><technical_language>is I for</technical_language>

Target:
public void cancelSnapshotSyncInProgressAndRetry() throws Exception { observeSnapshotSync = true; initLogReplicationFSM(ReaderImplementation.TEST); ((TestSnapshotReader)snapshotReader).setBatchSize(BATCH_SIZE); limitSnapshotMessages = 2; writeToStream(); transitionAvailable.acquire(); transition(LogReplicationEventType.SNAPSHOT_SYNC_REQUEST, LogReplicationStateType.IN_SNAPSHOT_SYNC); transitionAvailable.acquire(); fsm.input(new LogReplicationEvent(LogReplicationEventType.REPLICATION_STOP)); while (fsm.getState().getType() != LogReplicationStateType.INITIALIZED) { } assertThat(fsm.getState().getType()).isEqualTo(LogReplicationStateType.INITIALIZED); ((TestDataSender) dataSender).reset(); observeSnapshotSync = false; Queue<LogReplicationEntry> listenerQueue = ((TestDataSender) dataSender).getEntryQueue(); fsm.input(new LogReplicationEvent(LogReplicationEventType.SNAPSHOT_SYNC_REQUEST)); for (int i = 0; i<(NUM_ENTRIES/(BATCH_SIZE * SnapshotSender.DEFAULT_SNAPSHOT_BATCH_SIZE)) + 1; i++) { } while (listenerQueue.size() < NUM_ENTRIES) { } assertThat(listenerQueue.size()).isEqualTo(NUM_ENTRIES); for (int i=0; i<NUM_ENTRIES; i++) { assertThat(listenerQueue.poll().getPayload()) .isEqualTo( String.format(PAYLOAD_FORMAT, i).getBytes()); } }
Source:
<code>public ConditionEvaluationResult evaluateExecutionCondition(ExtensionContext context) { Optional<AnnotatedElement> element = context.getElement(); Optional<LongRunning> longRunning = AnnotationUtils.findAnnotation(element, LongRunning.class); if (longRunning.isPresent()) { String property = longRunning.get().value(); if (!StringUtils.hasText(property)) { property = LongRunningIntegrationTest.RUN_LONG_INTEGRATION_TESTS; } LongRunningIntegrationTest lrit = new LongRunningIntegrationTest(property); <START> return lrit.isShouldRun() ? ConditionEvaluationResult.enabled("Long running tests required") <END> : ConditionEvaluationResult.disabled("Long running tests skipped"); } return ENABLED; }</code><technical_language>requested sounds better? next sentence is skipped</technical_language>

Target:
public ConditionEvaluationResult evaluateExecutionCondition(ExtensionContext context) { Optional<AnnotatedElement> element = context.getElement(); Optional<LongRunning> longRunning = AnnotationUtils.findAnnotation(element, LongRunning.class); if (longRunning.isPresent()) { String property = longRunning.get().value(); if (!StringUtils.hasText(property)) { property = LongRunningIntegrationTest.RUN_LONG_INTEGRATION_TESTS; } LongRunningIntegrationTest lrit = new LongRunningIntegrationTest(property); return lrit.isShouldRun() ? ConditionEvaluationResult.enabled("Long running tests must run") : ConditionEvaluationResult.disabled("Long running tests are skipped"); } return ENABLED; }
Source:
<code>private IsWidget createRxColumn(VdsNetworkInterface hostInterface) { Column rxCol = new Column(ColumnSize.SM_3); DListElement dl = Document.get().createDLElement(); addDetailItem(templates.sub(constants.rxRate(), constants.mbps()), SafeHtmlUtils.fromString(rateRenderer.render(new Double[] { hostInterface.getStatistics().getReceiveRate(), hostInterface.hasSpeed() ? hostInterface.getSpeed().doubleValue() <START> : 0 <END> })), dl); dl.addClassName(Styles.PULL_LEFT); rxCol.getElement().appendChild(dl); FlowPanel divider = new FlowPanel(); divider.addStyleName(RATE_DIVIDER); rxCol.add(divider); dl = Document.get().createDLElement(); addDetailItem(templates.sub(constants.rxTotal(), constants.bytes()), SafeHtmlUtils.fromString(totalRenderer.render(hostInterface.getStatistics().getReceivedBytes())), dl); dl.addClassName(Styles.PULL_LEFT); rxCol.getElement().appendChild(dl); return rxCol; }</code><technical_language>"0.0" save a cast int double</technical_language>

Target:
private IsWidget createRxColumn(VdsNetworkInterface hostInterface) { Column rxCol = new Column(ColumnSize.SM_3); DListElement dl = Document.get().createDLElement(); addDetailItem(templates.sub(constants.rxRate(), constants.mbps()), SafeHtmlUtils.fromString(rateRenderer.render(new Double[] { hostInterface.getStatistics().getReceiveRate(), hostInterface.hasSpeed() ? hostInterface.getSpeed().doubleValue() : 0.0 })), dl); dl.addClassName(Styles.PULL_LEFT); rxCol.getElement().appendChild(dl); FlowPanel divider = new FlowPanel(); divider.addStyleName(RATE_DIVIDER); rxCol.add(divider); dl = Document.get().createDLElement(); addDetailItem(templates.sub(constants.rxTotal(), constants.bytes()), SafeHtmlUtils.fromString(totalRenderer.render(hostInterface.getStatistics().getReceivedBytes())), dl); dl.addClassName(Styles.PULL_LEFT); rxCol.getElement().appendChild(dl); return rxCol; }
Source:
<code>public void verifyUndoSucceeded() { driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS); try { String notificationMsg = driver.findElement(By.cssSelector(".global-notification .msg")).getText(); PageObjectLogging.log("verifyUndoSucceeded", "grabbing notification text", true); Assertion.assertEquals(notificationMsg, "This page has been restored."); } catch (NoSuchElementException e) { PageObjectLogging.log("verifyUndoSucceeded", "no notification present", true); driver.quit(); <START> } <END> }</code><technical_language>NoSuchElementException is thrown - is correct behavior not? If correct, catch exception. is a method called checkIfElementOnPage(WebElement element) in BasePageObject checks if element is present page not. this method change implicitWait wait. This method returns true false. is more if exception is thrown setting implicitWait time default value. more thing, if want mark incorrect PageObjectLogging.log() method argument false true</technical_language>

Target:
public void verifyUndoSucceeded() { waitForElementByElement(notification); String notificationMsg = notification.getText(); Assertion.assertEquals(notificationMsg, "This page has been restored."); PageObjectLogging.log("verifyUndoSucceeded", "able to undo a swapped video", true); }
Source:
<code>public int onStartCommand(Intent intent, int flags, int startId) { for (String p : new String[]{"android.permission.ACCESS_FINE_LOCATION"}) { if (getApplicationContext().checkCallingOrSelfPermission(p) != PackageManager.PERMISSION_GRANTED) { Log.e(TAG, String.format("Cannot mock location due to missing permission '%s'", p)); return START_NOT_STICKY; } } if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { <START> Log.w(TAG, "Starting location service"); <END> startService(ForegroundService.getForegroundServiceIntent(LocationService.this)); } handleIntent(intent); return START_STICKY; }</code><technical_language>change logging level info debug</technical_language>

Target:
public int onStartCommand(Intent intent, int flags, int startId) { for (String p : new String[]{"android.permission.ACCESS_FINE_LOCATION"}) { if (getApplicationContext().checkCallingOrSelfPermission(p) != PackageManager.PERMISSION_GRANTED) { Log.e(TAG, String.format("Cannot mock location due to missing permission '%s'", p)); return START_NOT_STICKY; } } if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { Log.i(TAG, "Starting location service"); startService(ForegroundService.getForegroundServiceIntent(LocationService.this)); } handleIntent(intent); return START_STICKY; }
Source:
<code><START> private void assertColumnList(List<Column> actual, List<com.amazonaws.services.glue.model.Column> expected) <END> { if (expected == null) { assertNull(actual); } assertEquals(actual.size(), expected.size()); for (int i = 0; i < expected.size(); i++) { assertColumn(actual.get(i), expected.get(i)); } }</code><technical_language>here, if static</technical_language>

Target:
private static void assertColumnList(List<Column> actual, List<com.amazonaws.services.glue.model.Column> expected) { if (expected == null) { assertNull(actual); } assertEquals(actual.size(), expected.size()); for (int i = 0; i < expected.size(); i++) { assertColumn(actual.get(i), expected.get(i)); } }
Source:
<code><START> public WinePrefix create(String version) throws CancelException, ScriptFailureException { <END> try { return this.create(version, Architecture.fetchCurrentArchitecture().name()); } catch (PlayOnLinuxException e) { throw new ScriptFailureException(e); } }</code><technical_language>ScriptFailureException is a CancelException. need put</technical_language>

Target:
public WinePrefix create(String version) throws ScriptFailureException { try { return this.create(version, Architecture.fetchCurrentArchitecture().name()); } catch (PlayOnLinuxException e) { throw new ScriptFailureException(e); } }
Source:
<code>private static void processCannon(Tank tank, World world) { if (Gdx.input.isKeyPressed(Keys.SPACE) && tank.isCannonReady()) { float tankCenterX = tank.getX() + 16; float tankCenterY = tank.getY() + 16; <START> <END> Bullet bullet = tank.fireCannon(world, tankCenterX + 18 * (float)Math.cos(tank.getRotation()), tankCenterY + 18 * (float)Math.sin(tank.getRotation())); Network net = NetworkSystem.getInstance(); net.send(new CreateEntity(Bullet.class, bullet.getId(), bullet.getX(), bullet.getY(), bullet.getRotation())); } }</code><technical_language>tankCenterX Y need constants anymore, getX() getY() returning center. Placing bullet simpler now, a slight offset tank center. I noticed spawning in wrong spot shifted textures, this is why. I forgot fix -- bad</technical_language>

Target:
private static void processCannon(Tank tank, World world) { if (Gdx.input.isKeyPressed(Keys.SPACE) && tank.isCannonReady()) { float tankCenterX = tank.getX(); float tankCenterY = tank.getY(); Bullet bullet = tank.fireCannon(world, tankCenterX + 18 * (float)Math.cos(tank.getRotation()), tankCenterY + 18 * (float)Math.sin(tank.getRotation())); Network net = NetworkSystem.getInstance(); net.send(new CreateEntity(Bullet.class, bullet.getId(), bullet.getX(), bullet.getY(), bullet.getRotation())); } }
Source:
<code>private MediaType getStorageMediaType(Configuration configuration, boolean embeddedMode, boolean internalCache, PersistenceMarshaller persistenceMarshaller) { EncodingConfiguration encodingConfiguration = configuration.encoding(); ContentTypeConfiguration contentTypeConfiguration = isKey ? encodingConfiguration.keyDataType() : encodingConfiguration.valueDataType(); Marshaller userMarshaller = persistenceMarshaller.getUserMarshaller(); MediaType mediaType = userMarshaller.mediaType(); boolean heap = !configuration.memory().offHeap(); if (contentTypeConfiguration.isMediaTypeChanged()) { <START> MediaType configuredMediaType = contentTypeConfiguration.mediaType(); <END> return configuredMediaType != null ? configuredMediaType : mediaType; } if (!embeddedMode && configuration.indexing().enabled() && contentTypeConfiguration.mediaType() == null) { return MediaType.APPLICATION_PROTOSTREAM; } if (internalCache) return MediaType.APPLICATION_OBJECT; if (embeddedMode) { return heap ? MediaType.APPLICATION_OBJECT : mediaType; } return MediaType.APPLICATION_UNKNOWN; }</code><technical_language>changed a null media type</technical_language>

Target:
private MediaType getStorageMediaType(Configuration configuration, boolean embeddedMode, boolean internalCache, PersistenceMarshaller persistenceMarshaller) { EncodingConfiguration encodingConfiguration = configuration.encoding(); ContentTypeConfiguration contentTypeConfiguration = isKey ? encodingConfiguration.keyDataType() : encodingConfiguration.valueDataType(); Marshaller userMarshaller = persistenceMarshaller.getUserMarshaller(); MediaType mediaType = userMarshaller.mediaType(); boolean heap = configuration.memory().storageType() == StorageType.OBJECT; if (contentTypeConfiguration.isMediaTypeChanged()) { return contentTypeConfiguration.mediaType(); } if (!embeddedMode && configuration.indexing().enabled() && contentTypeConfiguration.mediaType() == null) { return MediaType.APPLICATION_PROTOSTREAM; } if (internalCache) return MediaType.APPLICATION_OBJECT; if (embeddedMode) { return heap ? MediaType.APPLICATION_OBJECT : mediaType; } return MediaType.APPLICATION_UNKNOWN; }
Source:
<code>public boolean isAvailable(Tenantable tenantable) { <START> if (!contextInstance.isLoaded()) { if (!tenantable.requiresTenantContext() || tenantNotRequired(tenantable)) { return true; } lock.lock(); try { String componentId = contextInstance.getInstanceComponentId(); int unavailableCount = blockedCounts.compute(componentId, (k, v) -> v == null ? 0 : ++v); log.log(unavailableCount > 100 ? Level.INFO : Level.FINEST, String.format("BLOCKED: tenant not available: %s, module %s, Operation: %s", componentId, moduleName, tenantable.getClass().getName())); if (unavailableCount > 100) { blockedCounts.remove(componentId); } condition.await(100, TimeUnit.MILLISECONDS); } catch (InterruptedException ex) { } finally { lock.unlock(); } return false; } return true; <END> }</code><technical_language>suggestion if (!contextInstance.isLoaded()) { return true; } if (!tenantable.requiresTenantContext() || tenantNotRequired(tenantable)) { return true; } lock.lock(); try { String componentId = contextInstance.getInstanceComponentId(); int unavailableCount = blockedCounts.compute(componentId, (k, v) -> v == null ? 0 : ++v); log.log(unavailableCount > 100 ? Level.INFO : Level.FINEST, String.format("BLOCKED: tenant available: %s, module %s, Operation: %s", componentId, moduleName, tenantable.getClass().getName())); if (unavailableCount > 100) { blockedCounts.remove(componentId); } condition.await(100, TimeUnit.MILLISECONDS); } catch (InterruptedException ex) { } finally { lock.unlock(); } return false;</technical_language>

Target:
public boolean isAvailable(Tenantable tenantable) { if (contextInstance.isLoaded()) { return true; } if (!tenantable.requiresTenantContext() || tenantNotRequired(tenantable)) { return true; } lock.lock(); try { String componentId = contextInstance.getInstanceComponentId(); int unavailableCount = blockedCounts.compute(componentId, (k, v) -> v == null ? 0 : ++v); log.log(unavailableCount > 100 ? Level.INFO : Level.FINEST, String.format("BLOCKED: tenant not available: %s, module %s, Operation: %s", componentId, moduleName, tenantable.getClass().getName())); if (unavailableCount > 100) { blockedCounts.remove(componentId); } condition.await(100, TimeUnit.MILLISECONDS); } catch (InterruptedException ex) { } finally { lock.unlock(); } return false; }
Source:
<code>public static void pingService(InetSocketAddress address, alluxio.grpc.ServiceType serviceType, AlluxioConfiguration conf, UserState userState) throws AlluxioStatusException { Preconditions.checkNotNull(address, "address"); Preconditions.checkNotNull(serviceType, "serviceType"); GrpcChannel channel = GrpcChannelBuilder.newBuilder(GrpcServerAddress.create(address), conf) .setClientType("PingService").disableAuthentication().setSubject(userState.getSubject()) .build(); try { ServiceVersionClientServiceGrpc.ServiceVersionClientServiceBlockingStub versionClient = ServiceVersionClientServiceGrpc.newBlockingStub(channel) <START> .withDeadlineAfter(conf.getMs(PropertyKey.WORKER_MASTER_PERIODICAL_CONNECT_TIMEOUT), <END> TimeUnit.MILLISECONDS); versionClient.getServiceVersion( GetServiceVersionPRequest.newBuilder().setServiceType(serviceType).build()); } catch (Throwable t) { throw AlluxioStatusException.fromThrowable(t); } finally { channel.shutdown(); } }</code><technical_language>pingService is in a bunch of places including client job services. want a configuration property. reuse USER_MASTER_POLLING_TIMEOUT more generic</technical_language>

Target:
public static void pingService(InetSocketAddress address, alluxio.grpc.ServiceType serviceType, AlluxioConfiguration conf, UserState userState) throws AlluxioStatusException { Preconditions.checkNotNull(address, "address"); Preconditions.checkNotNull(serviceType, "serviceType"); GrpcChannel channel = GrpcChannelBuilder.newBuilder(GrpcServerAddress.create(address), conf) .setClientType("PingService").disableAuthentication().setSubject(userState.getSubject()) .build(); try { ServiceVersionClientServiceGrpc.ServiceVersionClientServiceBlockingStub versionClient = ServiceVersionClientServiceGrpc.newBlockingStub(channel) .withDeadlineAfter(conf.getMs(PropertyKey.USER_MASTER_POLLING_TIMEOUT), TimeUnit.MILLISECONDS); versionClient.getServiceVersion( GetServiceVersionPRequest.newBuilder().setServiceType(serviceType).build()); } catch (Throwable t) { throw AlluxioStatusException.fromThrowable(t); } finally { channel.shutdown(); } }
Source:
<code>public void testLeaveConstructor() { final String groupId = "group_id"; final String memberId = "member_id"; final int throttleTimeMs = 10; final LeaveGroupRequestData expectedData = new LeaveGroupRequestData() .setGroupId(groupId) .setMemberId(memberId); final LeaveGroupRequest.Builder builder = new LeaveGroupRequest.Builder(new LeaveGroupRequestData() .setGroupId(groupId) .setMemberId(memberId)); <START> for (short version = 0; version < LeaveGroupRequestData.SCHEMAS.length; version++) { <END> LeaveGroupRequest request = builder.build(version); assertEquals(expectedData, request.data()); int expectedThrottleTime = version >= 1 ? throttleTimeMs : AbstractResponse.DEFAULT_THROTTLE_TIME; LeaveGroupResponse expectedResponse = new LeaveGroupResponse( new LeaveGroupResponseData() .setErrorCode(Errors.NOT_CONTROLLER.code()) .setThrottleTimeMs(expectedThrottleTime) ); assertEquals(expectedResponse, request.getErrorResponse(throttleTimeMs, Errors.NOT_CONTROLLER.exception())); } }</code><technical_language>nit: clearer ApiKeys.LEAVE_GROUP.latestVersion()</technical_language>

Target:
public void testLeaveConstructor() { final String groupId = "group_id"; final String memberId = "member_id"; final int throttleTimeMs = 10; final LeaveGroupRequestData expectedData = new LeaveGroupRequestData() .setGroupId(groupId) .setMemberId(memberId); final LeaveGroupRequest.Builder builder = new LeaveGroupRequest.Builder(new LeaveGroupRequestData() .setGroupId(groupId) .setMemberId(memberId)); for (short version = 0; version <= ApiKeys.LEAVE_GROUP.latestVersion(); version++) { LeaveGroupRequest request = builder.build(version); assertEquals(expectedData, request.data()); int expectedThrottleTime = version >= 1 ? throttleTimeMs : AbstractResponse.DEFAULT_THROTTLE_TIME; LeaveGroupResponse expectedResponse = new LeaveGroupResponse( new LeaveGroupResponseData() .setErrorCode(Errors.NOT_CONTROLLER.code()) .setThrottleTimeMs(expectedThrottleTime) ); assertEquals(expectedResponse, request.getErrorResponse(throttleTimeMs, Errors.NOT_CONTROLLER.exception())); } }
Source:
<code>protected List<Disk> getOtherVmDisks() { if (otherVmDisks == null) { otherVmDisks = getDiskDao().getAllForVm(getVmId()); otherVmDisks.removeAll(LinqUtils.filter(otherVmDisks, new Predicate<Disk>() { @Override public boolean eval(Disk o) { return o.getId().equals(oldDisk.getId()); } <START> })); <END> } return otherVmDisks; }</code><technical_language>add if id is 'oldDisk'</technical_language>

Target:
protected List<Disk> getOtherVmDisks() { if (otherVmDisks == null) { otherVmDisks = getDiskDao().getAllForVm(getVmId()); Iterator<Disk> iter = otherVmDisks.iterator(); while (iter.hasNext()) { Disk evalDisk = iter.next(); if (evalDisk.getId().equals(oldDisk.getId())) { iter.remove(); } break; } } return otherVmDisks; }
Source:
<code>public Object get(Object key) { Object field = record.get(key.toString()); if (fromPigAvroStorage && field instanceof GenericData.Array) { <START> return Lists.transform((List) field, PIG_AVRO_STORAGE_ARRAY_TO_STRING_INCLUDING_NULL::apply); <END> } if (field instanceof ByteBuffer) { if (binaryAsString) { return new String(((ByteBuffer) field).array()); } else { return Arrays.toString(((ByteBuffer) field).array()); } } if (field instanceof Utf8) { return field.toString(); } return field; }</code><technical_language>this change better</technical_language>

Target:
public Object get(Object key) { Object field = record.get(key.toString()); if (fromPigAvroStorage && field instanceof GenericData.Array) { return Lists.transform((List) field, PIG_AVRO_STORAGE_ARRAY_TO_STRING_INCLUDING_NULL); } if (field instanceof ByteBuffer) { if (binaryAsString) { return new String(((ByteBuffer) field).array()); } else { return Arrays.toString(((ByteBuffer) field).array()); } } if (field instanceof Utf8) { return field.toString(); } return field; }
Source:
<code>public GetPartitionsResponse getPartitionsByAlgebra(RpcController controller, PartitionsByAlgebraProto request) throws ServiceException { String dbName = request.getDatabaseName(); String tbName = request.getTableName(); try { if (linkedMetadataManager.existsDatabase(dbName)) { return GetPartitionsResponse.newBuilder().setState(errUndefinedPartitionMethod(tbName)).build(); } } catch (Throwable t) { printStackTraceIfError(LOG, t); return GetPartitionsResponse.newBuilder() .setState(returnError(t)) .build(); } if (metaDictionary.isSystemDatabase(dbName)) { return GetPartitionsResponse.newBuilder().setState(errUndefinedPartitionMethod(tbName)).build(); } rlock.lock(); try { boolean contain; contain = store.existDatabase(dbName); <START> if (contain) { <END> contain = store.existTable(dbName, tbName); if (contain) { if (store.existPartitionMethod(dbName, tbName)) { GetPartitionsResponse.Builder builder = GetPartitionsResponse.newBuilder(); List<PartitionDescProto> partitions = store.getPartitionsByAlgebra(request); builder.addAllPartition(partitions); builder.setState(OK); return builder.build(); } else { return GetPartitionsResponse.newBuilder() .setState(errUndefinedPartitionMethod(tbName)) .build(); } } else { return GetPartitionsResponse.newBuilder() .setState(errUndefinedTable(tbName)) .build(); } } else { return GetPartitionsResponse.newBuilder() .setState(errUndefinedDatabase(dbName)) .build(); } } catch (Throwable t) { printStackTraceIfError(LOG, t); return GetPartitionsResponse.newBuilder() .setState(returnError(t)) .build(); } finally { rlock.unlock(); } }</code><technical_language>tests improved other methods. Please refer existsDatabase() method</technical_language>

Target:
public GetPartitionsResponse getPartitionsByAlgebra(RpcController controller, PartitionsByAlgebraProto request) throws ServiceException { String dbName = request.getDatabaseName(); String tbName = request.getTableName(); try { if (linkedMetadataManager.existsDatabase(dbName)) { return GetPartitionsResponse.newBuilder().setState(errUndefinedPartitionMethod(tbName)).build(); } } catch (Throwable t) { printStackTraceIfError(LOG, t); return GetPartitionsResponse.newBuilder() .setState(returnError(t)) .build(); } if (metaDictionary.isSystemDatabase(dbName)) { return GetPartitionsResponse.newBuilder().setState(errUndefinedPartitionMethod(tbName)).build(); } rlock.lock(); try { GetPartitionsResponse.Builder builder = GetPartitionsResponse.newBuilder(); List<PartitionDescProto> partitions = store.getPartitionsByAlgebra(request); builder.addAllPartition(partitions); builder.setState(OK); return builder.build(); } catch (Throwable t) { printStackTraceIfError(LOG, t); return GetPartitionsResponse.newBuilder() .setState(returnError(t)) .build(); } finally { rlock.unlock(); } }
Source:
<code>public boolean cancel(boolean interruptThread) { boolean canceled; <START> synchronized (resultLock) { <END> if (! done) { this.canceled = true; if (interruptThread) { Thread runningThread = this.runningThread; if (runningThread != null) { runningThread.interrupt(); } } setDone(); canceled = true; } else { canceled = false; } } if (canceled) { listenerHelper.callListeners(); } return canceled; }</code><technical_language>Do need this lock if future is done canceled</technical_language>

Target:
public boolean cancel(boolean interruptThread) { if (done) { return false; } boolean canceled; synchronized (resultLock) { if (! done) { this.canceled = true; if (interruptThread) { Thread runningThread = this.runningThread; if (runningThread != null) { runningThread.interrupt(); } } setDone(); canceled = true; } else { canceled = false; } } if (canceled) { listenerHelper.callListeners(); } return canceled; }
Source:
<code>public void fillContext(Context context, HttpServletRequest request) { ViewToolContext vtc = (ViewToolContext)context; vtc.put("variable", "happiness"); <START> M_log.info("fillContext() called"); <END> }</code><technical_language>this starting of method. is this info instead of debug</technical_language>

Target:
public void fillContext(Context context, HttpServletRequest request) { M_log.debug("fillContext() called"); ViewToolContext vtc = (ViewToolContext)context; }
Source:
<code>public Result getResultThresholdNumber(XUnitLog log, int testCount, int newTestCount) { String errorMessage = "The total number of tests for this category exceeds the specified '%s' threshold value."; if (isValid(getFailureThreshold()) && (convertToInteger(getFailureThreshold()) < testCount)) { log.infoConsoleLogger(String.format(errorMessage, "failure")); return Result.FAILURE; } if (isValid(getFailureNewThreshold()) <START> && (convertToInteger(getFailureNewThreshold()) < newTestCount)) { <END> log.infoConsoleLogger(String.format(errorMessage, "new failure")); return Result.FAILURE; } if (isValid(getUnstableThreshold()) && (convertToInteger(getUnstableThreshold()) < testCount)) { log.infoConsoleLogger(String.format(errorMessage, "unstable")); return Result.UNSTABLE; } if (isValid(getUnstableNewThreshold()) && (convertToInteger(getUnstableNewThreshold()) < newTestCount)) { log.infoConsoleLogger(String.format(errorMessage, "new unstable")); return Result.UNSTABLE; } return Result.SUCCESS; }</code><technical_language>I this cosmetic change affect some people if console log output parsed in order do else, for instances if groovy post build action. worth add information part of release notes</technical_language>

Target:
public Result getResultThresholdNumber(XUnitLog log, int testCount, int newTestCount) { String thresholdErrorMessage = "The %s number of tests for this category exceeds the specified '%s' threshold value."; if (isValid(getFailureThreshold()) && (convertToInteger(getFailureThreshold()) < testCount)) { log.infoConsoleLogger(String.format(thresholdErrorMessage, "total", "failure")); return Result.FAILURE; } if (isValid(getFailureNewThreshold()) && (convertToInteger(getFailureNewThreshold()) < newTestCount)) { log.infoConsoleLogger(String.format(thresholdErrorMessage, "new", "new failure")); return Result.FAILURE; } if (isValid(getUnstableThreshold()) && (convertToInteger(getUnstableThreshold()) < testCount)) { log.infoConsoleLogger(String.format(thresholdErrorMessage, "total", "unstable")); return Result.UNSTABLE; } if (isValid(getUnstableNewThreshold()) && (convertToInteger(getUnstableNewThreshold()) < newTestCount)) { log.infoConsoleLogger(String.format(thresholdErrorMessage, "new", "new unstable")); return Result.UNSTABLE; } return Result.SUCCESS; }
Source:
<code>public static HashMap<Long, ArtifactId> findExcludedArtifactsByView(ArtifactId viewId, BranchId branch) { <START> HashMap<Long, ArtifactId> excludedArtifactIdMap = new HashMap<>(); <END> if (!viewId.equals(ArtifactId.SENTINEL)) { Object[] objs = {branch, viewId, branch}; List<ArtifactId> excludedArtifacts = ArtifactLoader.selectArtifactIds(OseeSql.LOAD_EXCLUDED_ARTIFACT_IDS.getSql(), objs, 300); for (ArtifactId artId : excludedArtifacts) { excludedArtifactIdMap.put(artId.getId(), artId); } } return excludedArtifactIdMap; }</code><technical_language>Is a reason this a Set<ArtifactId> instead of a HashMap</technical_language>

Target:
public static Set<ArtifactId> findExcludedArtifactsByView(ArtifactId viewId, BranchId branch) { Set<ArtifactId> excludedArtifactIdMap = new HashSet<>(); if (!viewId.equals(ArtifactId.SENTINEL)) { Object[] objs = {branch, viewId, branch}; List<ArtifactId> excludedArtifacts = ArtifactLoader.selectArtifactIds(OseeSql.LOAD_EXCLUDED_ARTIFACT_IDS.getSql(), objs, 300); for (ArtifactId artId : excludedArtifacts) { excludedArtifactIdMap.add(artId); } } return excludedArtifactIdMap; }
Source:
<code>public static int determineHttpStatusCode(MessageContext msgContext) { int httpStatus = HttpStatus.SC_OK; if (msgContext.isPropertyTrue(PassThroughConstants.SC_ACCEPTED)) { httpStatus = HttpStatus.SC_ACCEPTED; } else { boolean handleFault = msgContext.getEnvelope() != null ? (msgContext.getEnvelope().getBody().hasFault() || msgContext.isProcessingFault()):false; try { <START> boolean faultsAsHttp200 = <END> PassThroughConstants.TRUE.equals( msgContext.getProperty(PassThroughConstants.FAULTS_AS_HTTP_200).toString().toUpperCase()); if (handleFault && !faultsAsHttp200) { httpStatus = HttpStatus.SC_INTERNAL_SERVER_ERROR; } } catch (NullPointerException e) { if (handleFault) { httpStatus = HttpStatus.SC_INTERNAL_SERVER_ERROR; } log.warn("FAULTS_AS_HTTP_200 Property is missing in the proxy service configuration."); } Object statusCode = msgContext.getProperty(PassThroughConstants.HTTP_SC); if (statusCode != null) { try { httpStatus = Integer.parseInt( msgContext.getProperty(PassThroughConstants.HTTP_SC).toString()); } catch (NumberFormatException e) { log.warn("Unable to set the HTTP status code from the property " + PassThroughConstants.HTTP_SC + " with value: " + statusCode); } } } return httpStatus; }</code><technical_language>this line nullapointer exception. Need check scenarios sending pull request</technical_language>

Target:
public static int determineHttpStatusCode(MessageContext msgContext) { int httpStatus = HttpStatus.SC_OK; if (msgContext.isPropertyTrue(PassThroughConstants.SC_ACCEPTED)) { httpStatus = HttpStatus.SC_ACCEPTED; } else { boolean handleFault = msgContext.getEnvelope() != null ? (msgContext.getEnvelope().getBody().hasFault() || msgContext.isProcessingFault()):false; if(handleFault && msgContext.getProperty(PassThroughConstants.FAULTS_AS_HTTP_200) != null) { boolean faultsAsHttp200 = PassThroughConstants.TRUE.equals( msgContext.getProperty(PassThroughConstants.FAULTS_AS_HTTP_200).toString().toUpperCase()); if (!faultsAsHttp200) { httpStatus = HttpStatus.SC_INTERNAL_SERVER_ERROR; } }else if(handleFault && msgContext.getProperty(PassThroughConstants.FAULTS_AS_HTTP_200) == null){ httpStatus = HttpStatus.SC_INTERNAL_SERVER_ERROR; } Object statusCode = msgContext.getProperty(PassThroughConstants.HTTP_SC); if (statusCode != null) { try { httpStatus = Integer.parseInt( msgContext.getProperty(PassThroughConstants.HTTP_SC).toString()); } catch (NumberFormatException e) { log.warn("Unable to set the HTTP status code from the property " + PassThroughConstants.HTTP_SC + " with value: " + statusCode); } } } return httpStatus; }
Source:
<code>protected List<String> getExtensibleChannelTypeIds(Map<String, String> attributes) { String extensible = attributes.get("extensible"); if (extensible == null) { return Collections.emptyList(); } <START> return Arrays.asList(extensible.split(",")); <END> }</code><technical_language>trim strings? in mind poor human beings ~~forced~~ taught in school waste paper spaces this extensible="alarm, brightness, foo, bar"</technical_language>

Target:
protected List<String> getExtensibleChannelTypeIds(Map<String, String> attributes) { String extensible = attributes.get("extensible"); if (extensible == null) { return Collections.emptyList(); } return Arrays.stream(extensible.split(",")).map(String::trim).collect(toList()); }
Source:
<code>public void deleteAllTexts(@Nonnull Mapping field) { <START> for (MongoTranslation translation : fetchAllTranslations(field)) { <END> mango.delete(translation); } if (owner instanceof Journaled) { JournalData.addJournalEntry(owner, "Deleted all translated texts for " + field.getName()); } }</code><technical_language>s.a</technical_language>

Target:
public void deleteAllTexts(@Nonnull Mapping field) { mongo.delete() .where(Translation.TRANSLATION_DATA.inner(TranslationData.OWNER), owner.getUniqueName()) .where(Translation.TRANSLATION_DATA.inner(TranslationData.FIELD), field.getName()) .manyFrom(MongoTranslation.class); if (owner instanceof Journaled) { JournalData.addJournalEntry(owner, "Deleted all translated texts for " + field.getName()); } }
Source:
<code>private void setupGroupsForVariableContext(VariableContext vctx, String user) throws IOException { if (groups == null) { LOG.warn( "Group provider hasn't been set, cannot query groups for user {}", user); return; } Set<String> groupsSet = groups.getGroupsSet(user); if (groupsSet.isEmpty()) { LOG.warn("There are no groups for user {}", user); <START> return; <END> } String secondaryGroup = null; Iterator<String> it = groupsSet.iterator(); String primaryGroup = it.next(); while (it.hasNext()) { String group = it.next(); if (this.queueManager.getQueue(group) != null) { secondaryGroup = group; break; } } if (secondaryGroup == null && LOG.isDebugEnabled()) { LOG.debug("User is not associated with any Secondary " + "Group. Hence it may use the 'default' queue", user); } vctx.put("%primary_group", primaryGroup); vctx.put("%secondary_group", secondaryGroup); vctx.putExtraDataset("groups", groupsSet); }</code><technical_language>variable context is consistent possible, please add a vctx.putExtraDataset("groups", groupsSet); return, empty set is a valid groups, matchers, match, leaving blank. for primary secondary groups is do</technical_language>

Target:
private void setupGroupsForVariableContext(VariableContext vctx, String user) throws IOException { if (groups == null) { LOG.warn( "Group provider hasn't been set, cannot query groups for user {}", user); return; } Set<String> groupsSet = groups.getGroupsSet(user); if (groupsSet.isEmpty()) { LOG.warn("There are no groups for user {}", user); vctx.putExtraDataset("groups", groupsSet); return; } String secondaryGroup = null; Iterator<String> it = groupsSet.iterator(); String primaryGroup = it.next(); while (it.hasNext()) { String group = it.next(); if (this.queueManager.getQueue(group) != null) { secondaryGroup = group; break; } } if (secondaryGroup == null && LOG.isDebugEnabled()) { LOG.debug("User is not associated with any Secondary " + "Group. Hence it may use the 'default' queue", user); } vctx.put("%primary_group", primaryGroup); vctx.put("%secondary_group", secondaryGroup); vctx.putExtraDataset("groups", groupsSet); }
Source:
<code>private void copyToClipboard() { EditorFrame editorFrame = EditorFrame.getInstance(); <START> if(editorFrame != null) <END> { editorFrame.copyToClipboard(); } }</code><technical_language>Obtaining graph if EditorFrame is a JPanel</technical_language>

Target:
private void copyToClipboard() { Container parent = getParent(); while( parent.getClass() != EditorFrame.class ) { parent = parent.getParent(); } ((EditorFrame)parent).copyToClipboard(); }
Source:
<code>public void setReview(@NotNull Review review) { try { log.debug("Set review in Gerrit: {}", review); boolean commentOnlyChangedLines = parseBoolean(configuration.getProperty(GeneralOption.COMMENT_ONLY_CHANGED_LINES)); <START> CommentFilter filter = commentOnlyChangedLines ? new JGitCommentFilter(gerritPatchset.getRevisionId()).init() <END> : CommentFilter.EMPTY_FILTER; ReviewInput reviewInput = new ReviewInputBuilder(filter).toReviewInput(review); gerritApi.changes().id(gerritPatchset.getChangeId()).revision(gerritPatchset.getRevisionId()).review(reviewInput); } catch (RestApiException e) { throw new GerritException("Error when setting review", e); } }</code><technical_language>filter is a good candidate for a field, a local variable. do think</technical_language>

Target:
public void setReview(@NotNull Review review) { try { log.debug("Set review in Gerrit: {}", review); ReviewInput reviewInput = new ReviewInputBuilder(commentFilter.init()).toReviewInput(review); gerritApi.changes().id(gerritPatchset.getChangeId()).revision(gerritPatchset.getRevisionId()).review(reviewInput); } catch (RestApiException e) { throw new GerritException("Error when setting review", e); } }
Source:
<code>public void actionPerformed(ActionEvent e) { if (okayButton.equals(e.getSource())) { bombPanel.applyChoice(); <START> newLoadout = bombPanel.getChoice(); <END> for (int type = 0; type < BombType.B_NUM; type++) { if(bombChoices[type] != newLoadout[type]) { newLoadout[type] = bombChoices[type] - newLoadout[type]; } else newLoadout[type] = 0; } for (int type = 0; type < BombType.B_NUM; type++) { if(newLoadout[type] != 0 && bombCatalog[type] > 0) { AmmoStorage storedBombs = (AmmoStorage) campaign.getPart(bombCatalog[type]); storedBombs.changeShots(newLoadout[type]); if(storedBombs.getShots() == 0) campaign.removePart(storedBombs); } } setVisible(false); } else if (cancelButton.equals(e.getSource())) { setVisible(false); } }</code><technical_language>noted above, this a local variable</technical_language>

Target:
public void actionPerformed(ActionEvent e) { if (okayButton.equals(e.getSource())) { bombPanel.applyChoice(); int[] newLoadout = bombPanel.getChoice(); for (int type = 0; type < BombType.B_NUM; type++) { if(bombChoices[type] != newLoadout[type]) { newLoadout[type] = bombChoices[type] - newLoadout[type]; } else { newLoadout[type] = 0; } } for (int type = 0; type < BombType.B_NUM; type++) { if(newLoadout[type] != 0 && bombCatalog[type] > 0) { AmmoStorage storedBombs = (AmmoStorage) campaign.getPart(bombCatalog[type]); storedBombs.changeShots(newLoadout[type]); if(storedBombs.getShots() == 0) { campaign.removePart(storedBombs); } } } setVisible(false); } else if (cancelButton.equals(e.getSource())) { setVisible(false); } }
Source:
<code>public void onPostExecute(@NonNull Boolean result) { if (result) { <START> mainActivityWeakReference.get().getDrawer().refreshDrawer(); <END> } }</code><technical_language>This NPE</technical_language>

Target:
public void onPostExecute(@NonNull Boolean result) { if (result) { final MainActivity mainActivity = this.mainActivity.get(); if (mainActivity != null) { mainActivity.getDrawer().refreshDrawer(); } } }
Source:
<code>private static RateCurveId createRateCurveId(CurveGroupName curveGroup, String curveTypeStr, String referenceStr) { <START> if ("forward".equals(curveTypeStr.toLowerCase())) { <END> RateIndex index = (RateIndex) LoaderUtils.findIndex(referenceStr); return RateIndexCurveId.of(index, curveGroup); } else if ("discount".equals(curveTypeStr.toLowerCase())) { Currency ccy = Currency.of(referenceStr); return DiscountCurveId.of(ccy, curveGroup); } else { throw new IllegalArgumentException(Messages.format("Unsupported curve type: {}", curveTypeStr)); } }</code><technical_language>discount constants</technical_language>

Target:
private static RateCurveId createRateCurveId(CurveGroupName curveGroup, String curveTypeStr, String referenceStr) { if (FORWARD.equals(curveTypeStr.toLowerCase())) { RateIndex index = (RateIndex) LoaderUtils.findIndex(referenceStr); return RateIndexCurveId.of(index, curveGroup); } else if (DISCOUNT.equals(curveTypeStr.toLowerCase())) { Currency ccy = Currency.of(referenceStr); return DiscountCurveId.of(ccy, curveGroup); } else { throw new IllegalArgumentException(Messages.format("Unsupported curve type: {}", curveTypeStr)); } }
Source:
<code>private FeatureVector createdFeatureVector(Terms terms, IndexReader reader, boolean tweetsearch) { FeatureVector f = new FeatureVector(); try { int numDocs = reader.numDocs(); TermsEnum termsEnum = terms.iterator(); BytesRef text; while ((text = termsEnum.next()) != null) { String term = text.utf8ToString(); if (term.length() < 2 || term.length() > 20) continue; if (!term.matches("[a-z0-9]+")) continue; if (tweetsearch) { <START> int df = reader.docFreq(new Term(FIELD_BODY, term)); <END> if (numDocs > 100000000) { if (((float) df / numDocs) > 0.007f) continue; } else { if (((float) df / numDocs) > 0.01f) continue; } } else { int df = reader.docFreq(new Term(FIELD_BODY, term)); if (((float) df / numDocs) > 0.1f) continue; } int freq = (int) termsEnum.totalTermFreq(); f.addFeatureWeight(term, (float) freq); } } catch (Exception e) { e.printStackTrace(); return f; } return f; }</code><technical_language>put this out of if-else branch</technical_language>

Target:
private FeatureVector createdFeatureVector(Terms terms, IndexReader reader, boolean tweetsearch) { FeatureVector f = new FeatureVector(); try { int numDocs = reader.numDocs(); TermsEnum termsEnum = terms.iterator(); BytesRef text; while ((text = termsEnum.next()) != null) { String term = text.utf8ToString(); if (term.length() < 2 || term.length() > 20) continue; if (!term.matches("[a-z0-9]+")) continue; int df = reader.docFreq(new Term(FIELD_BODY, term)); float ratio = (float) df / numDocs; if (tweetsearch) { if (numDocs > 100000000) { if (ratio > 0.007f) continue; } else { if (ratio > 0.01f) continue; } } else if (ratio > 0.1f) continue; int freq = (int) termsEnum.totalTermFreq(); f.addFeatureWeight(term, (float) freq); } } catch (Exception e) { e.printStackTrace(); return f; } return f; }
Source:
<code>public void initTrace(IResource resource, String path, Class<? extends ITmfEvent> type) throws TmfTraceException { super.initTrace(resource, path, type); String dir = TmfTraceManager.getSupplementaryFileDir(this); fFile = new File(dir + new File(path).getName()); if (!fFile.exists()) { Job sortJob = new SortingJob(this, path); sortJob.schedule(); <START> while(sortJob.getResult() == null) { <END> try { sortJob.join(); } catch (InterruptedException e) { throw new TmfTraceException(e.getMessage(), e); } } IStatus result = sortJob.getResult(); if (!result.isOK()) { throw new TmfTraceException("Job failed " + result.getMessage()); } } try { fFileInput = new BufferedRandomAccessFile(fFile, "r"); } catch (IOException e) { throw new TmfTraceException(e.getMessage(), e); } }</code><technical_language>white space :p</technical_language>

Target:
public void initTrace(IResource resource, String path, Class<? extends ITmfEvent> type) throws TmfTraceException { super.initTrace(resource, path, type); fProperties.put("Type", "Trace-Event"); String dir = TmfTraceManager.getSupplementaryFileDir(this); fFile = new File(dir + new File(path).getName()); if (!fFile.exists()) { Job sortJob = new SortingJob(this, path); sortJob.schedule(); while (sortJob.getResult() == null) { try { sortJob.join(); } catch (InterruptedException e) { throw new TmfTraceException(e.getMessage(), e); } } IStatus result = sortJob.getResult(); if (!result.isOK()) { throw new TmfTraceException("Job failed " + result.getMessage()); } } try { fFileInput = new BufferedRandomAccessFile(fFile, "r"); goToCorrectStart(fFileInput); } catch (IOException e) { throw new TmfTraceException(e.getMessage(), e); } }
Source:
<code>protected void onPostExecute(Void aVoid) { SyncthingService syncthingService = refSyncthingService.get(); if (syncthingService != null) { syncthingService.onStartupTaskCompleteListener(); } <START> return; <END> }</code><technical_language>point of this return</technical_language>

Target:
protected void onPostExecute(Void aVoid) { SyncthingService syncthingService = refSyncthingService.get(); if (syncthingService != null) { syncthingService.onStartupTaskCompleteListener(); } }
Source:
<code>public void writeTo(ObjectOutput output) throws IOException { output.writeObject(ackTarget); if (ackTarget != null) { output.writeLong(id); } output.writeInt(topologyId); <START> if (keys != null) { <END> MarshallUtil.marshallCollection(keys, output); } else { assert segments != null; MarshallUtil.marshallIntCollection(segments, output); } }</code><technical_language>marshallCollection handles null</technical_language>

Target:
public void writeTo(ObjectOutput output) throws IOException { output.writeObject(ackTarget); if (ackTarget != null) { output.writeLong(id); } output.writeInt(topologyId); MarshallUtil.marshallCollection(keys, output); }