auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void theDeviceSendsARegisterDeviceRequestToThePlatform(final String protocol, final Map<String, String> settings) throws IOException, DeviceSimulatorException { try { final OslpEnvelope request = this .createEnvelopeBuilder(getString(settings, PlatformPubliclightingKeys.KEY_DEVICE_UID, PlatformPubliclightingDefaults.DEVICE_UID), this.oslpMockServer.getSequenceNumber()) .withPayloadMessage( Message.newBuilder() .setRegisterDeviceRequest(Oslp.RegisterDeviceRequest.newBuilder() .setDeviceIdentification(getString(settings, PlatformPubliclightingKeys.KEY_DEVICE_IDENTIFICATION, PlatformPubliclightingDefaults.DEFAULT_DEVICE_IDENTIFICATION)) .setIpAddress(ByteString.copyFrom(InetAddress .getByName( getString(settings, PlatformPubliclightingKeys.IP_ADDRESS, PlatformPubliclightingDefaults.LOCALHOST)) .getAddress())) .setDeviceType(getEnum(settings, PlatformPubliclightingKeys.KEY_DEVICE_TYPE, DeviceType.class, DeviceType.PSLD)) .setHasSchedule( getBoolean(settings, PlatformPubliclightingKeys.KEY_HAS_SCHEDULE, PlatformPubliclightingDefaults.DEFAULT_HASSCHEDULE)) .setRandomDevice( getInteger(settings, PlatformPubliclightingKeys.RANDOM_DEVICE, PlatformPubliclightingDefaults.RANDOM_DEVICE))) .build()) .build(); this.send(request, settings); <START> } catch (final IOException | IllegalArgumentException ioe) { <END> ScenarioContext.current().put("Error", ioe); } }</code><technical_language>Rename "ioe" "e"</technical_language>

Target:
public void theDeviceSendsARegisterDeviceRequestToThePlatform(final String protocol, final Map<String, String> settings) throws IOException, DeviceSimulatorException { try { final OslpEnvelope request = this .createEnvelopeBuilder(getString(settings, PlatformPubliclightingKeys.KEY_DEVICE_UID, PlatformPubliclightingDefaults.DEVICE_UID), this.oslpMockServer.getSequenceNumber()) .withPayloadMessage( Message.newBuilder() .setRegisterDeviceRequest(Oslp.RegisterDeviceRequest.newBuilder() .setDeviceIdentification(getString(settings, PlatformPubliclightingKeys.KEY_DEVICE_IDENTIFICATION, PlatformPubliclightingDefaults.DEFAULT_DEVICE_IDENTIFICATION)) .setIpAddress(ByteString.copyFrom(InetAddress .getByName( getString(settings, PlatformPubliclightingKeys.IP_ADDRESS, PlatformPubliclightingDefaults.LOCALHOST)) .getAddress())) .setDeviceType(getEnum(settings, PlatformPubliclightingKeys.KEY_DEVICE_TYPE, DeviceType.class, DeviceType.PSLD)) .setHasSchedule( getBoolean(settings, PlatformPubliclightingKeys.KEY_HAS_SCHEDULE, PlatformPubliclightingDefaults.DEFAULT_HASSCHEDULE)) .setRandomDevice( getInteger(settings, PlatformPubliclightingKeys.RANDOM_DEVICE, PlatformPubliclightingDefaults.RANDOM_DEVICE))) .build()) .build(); this.send(request, settings); } catch (final IOException | IllegalArgumentException e) { ScenarioContext.current().put("Error", e); } }
Source:
<code>protected void configure() { bind(PersonIdent.class).annotatedWith(GerritPersonIdent.class).toProvider( GerritPersonIdentProvider.class); bind(Gson.class).toInstance(new Gson()); bind(DegradedManager.class).in(Scopes.SINGLETON); bind(Peer.class).annotatedWith(Self.class).toInstance(new Peer()); bindConstant().annotatedWith(OutdatedThreshold.class).to(60000L); bind(AllProjectsName.class).toProvider(AllProjectsNameProvider.class).in( Scopes.SINGLETON); bind(String.class).annotatedWith(RefNameBase.class).toProvider( RefNameBaseProvider.class); bind(GitRefManager.class).in(Scopes.SINGLETON); bind(PeerRegistry.class).to(GitRefPeerRegistry.class).in(Scopes.SINGLETON); bindConstant().annotatedWith(MaxSenders.class).to(4); <START> bindConstant().annotatedWith(MaxMessageSize.class).to(2048); <END> bindConstant().annotatedWith(MaxTimeout.class).to(10000L); bindConstant().annotatedWith(BaseRetryTime.class).to(500L); bind(ReceivePortProvider.class); bind(String.class).annotatedWith(ReceiveHost.class).toProvider( ReceiveHostProvider.class); bind(Integer.class).annotatedWith(ReceivePort.class).toProvider( ReceivePortProvider.class); bind(UDPMessageSender.class).in(Scopes.SINGLETON); bind(UDPMessageReceiver.class); bind(Evictor.class).to(UDPEvictor.class).in(Scopes.SINGLETON); bind(CacheManager.class); bind(CacheRemovalListenerImpl.class); DynamicSet.bind(binder(), CacheRemovalListener.class).to( CacheRemovalListenerImpl.class); bind(DataAggregator.class).in(Scopes.SINGLETON); bind(StateMachine.class).in(Scopes.SINGLETON); bind(LifecycleListener.class).annotatedWith(UniqueAnnotations.create()).to( OnStartStop.class); }</code><technical_language>I currently handle messages larger MTU, this set that</technical_language>

Target:
protected void configure() { bind(ConfigProvider.class).in(Scopes.SINGLETON); bind(Config.class).annotatedWith(MultiMasterConfig.class).toProvider( ConfigProvider.class); install(new GitRefModule()); install(new UDPModule()); bind(PersonIdent.class).annotatedWith(GerritPersonIdent.class).toProvider( GerritPersonIdentProvider.class); bind(Gson.class).toInstance(new Gson()); bind(DegradedManager.class).in(Scopes.SINGLETON); bind(Peer.class).annotatedWith(Self.class).toInstance(new Peer()); bind(CacheManager.class); bind(CacheRemovalListenerImpl.class); DynamicSet.bind(binder(), CacheRemovalListener.class).to( CacheRemovalListenerImpl.class); bind(StateMachine.class).in(Scopes.SINGLETON); bind(LifecycleListener.class).annotatedWith(UniqueAnnotations.create()).to( OnStartStop.class); }
Source:
<code>protected Pair<Boolean, EngineFault> runConnectionStorageToDomain(StorageDomain storageDomain, Guid vdsId, int type, LUNs lun, Guid storagePoolId) { <START> Guid poolId = storagePoolId; <END> if (storageDomain != null && storageDomain.getStoragePoolId() != null) { poolId = storageDomain.getStoragePoolId(); } if (FeatureSupported.refreshLunSupported(DbFacade.getInstance().getStoragePoolDao().get(poolId).getCompatibilityVersion())) { boolean isSuccess = true; VDSReturnValue returnValue = null; List<StorageServerConnections> list = new ArrayList<>(); list.add(getFCPConnection()); returnValue = Backend .getInstance() .getResourceManager() .RunVdsCommand( VDSCommandType.forValue(type), new StorageServerConnectionManagementVDSParameters(vdsId, poolId, StorageType.FCP, list)); isSuccess = returnValue.getSucceeded(); EngineFault engineFault = null; if (!isSuccess && returnValue.getVdsError() != null) { engineFault = new EngineFault(); engineFault.setError(returnValue.getVdsError().getCode()); } return new Pair<>(isSuccess, engineFault); } else { return new Pair<>(true, null); } }</code><technical_language>assugning this storagePoolId</technical_language>

Target:
protected Pair<Boolean, EngineFault> runConnectionStorageToDomain(StorageDomain storageDomain, Guid vdsId, int type, LUNs lun, Guid storagePoolId) { if (FeatureSupported.refreshLunSupported(DbFacade.getInstance() .getStoragePoolDao() .get(storagePoolId) .getCompatibilityVersion())) { List<StorageServerConnections> list = new ArrayList<>(); list.add(getFCPConnection()); VDSReturnValue returnValue = Backend .getInstance() .getResourceManager() .RunVdsCommand( VDSCommandType.forValue(type), new StorageServerConnectionManagementVDSParameters(vdsId, storagePoolId, StorageType.FCP, list)); boolean isSuccess = returnValue.getSucceeded(); EngineFault engineFault = null; if (!isSuccess && returnValue.getVdsError() != null) { engineFault = new EngineFault(); engineFault.setError(returnValue.getVdsError().getCode()); } return new Pair<>(isSuccess, engineFault); } else { return new Pair<>(true, null); } }
Source:
<code>public void initialise() { <START> pomWizardPage.setPom( new POMBuilder() <END> .build() ); }</code><technical_language>do longer set GroupID version for new Projects? I POMBuilder sets default version; find (so far) sets GroupID</technical_language>

Target:
public void initialise() { pomWizardPage.setPom( new POMBuilder() .setGroupId( context.getActiveOrganizationalUnit().getDefaultGroupId() ) .build() ); }
Source:
<code>public void testSpecialVariables() throws Exception { <START> List<Integer> primes = new ArrayList<>(Arrays.asList(2, 3, 5, 7, 11, 13, 17)); <END> ExpressionParser parser = new SpelExpressionParser(); StandardEvaluationContext context = new StandardEvaluationContext(); context.setVariable("primes",primes); List<Integer> primesGreaterThanTen = (List<Integer>) parser.parseExpression("#primes.?[#this>10]").getValue(context); assertThat(primesGreaterThanTen.toString()).isEqualTo("[11, 13, 17]"); }</code><technical_language>above. suggestion List<Integer> primes = Arrays.asList(2, 3, 5, 7, 11, 13, 17);</technical_language>

Target:
public void testSpecialVariables() throws Exception { List<Integer> primes = Arrays.asList(2, 3, 5, 7, 11, 13, 17); ExpressionParser parser = new SpelExpressionParser(); StandardEvaluationContext context = new StandardEvaluationContext(); context.setVariable("primes",primes); List<Integer> primesGreaterThanTen = (List<Integer>) parser.parseExpression("#primes.?[#this>10]").getValue(context); assertThat(primesGreaterThanTen.toString()).isEqualTo("[11, 13, 17]"); }
Source:
<code>public void createControl(final Composite parent) { final Composite panel = new Composite(parent, SWT.NULL); final GridLayout layout = new GridLayout(); layout.numColumns = 1; panel.setLayout(layout); createDestinationGroup(panel); createConfigGroup(panel); importProjectsButton = new Button(panel, SWT.CHECK); importProjectsButton <START> .setText("Import all projects after clone finishes"); END> Dialog.applyDialogFont(panel); setControl(panel); checkPage(); }</code><technical_language>text needs externalized</technical_language>

Target:
public void createControl(final Composite parent) { final Composite panel = new Composite(parent, SWT.NULL); final GridLayout layout = new GridLayout(); layout.numColumns = 1; panel.setLayout(layout); createDestinationGroup(panel); createConfigGroup(panel); importProjectsButton = new Button(panel, SWT.CHECK); importProjectsButton.setText(UIText.CloneDestinationPage_importButton); Dialog.applyDialogFont(panel); setControl(panel); checkPage(); }
Source:
<code>public boolean lock(long timeout, TimeUnit unit) { long startTime = System.currentTimeMillis(); long lockTimeout = TimeUnit.MILLISECONDS.convert(timeout, unit); Random random = new Random(); while ((System.currentTimeMillis() - startTime) < lockTimeout) { try { leaseId.getAndSet(leaseBlobManager.acquireLease(LEASE_TIME_IN_SEC, leaseId.get())); } catch (AzureException e) { return false; } if (leaseId.get() != null) { LOG.info("Acquired lock!"); <START> hasLock.set(true); <END> return true; } else { try { Thread.sleep(random.nextInt(1000)); } catch (InterruptedException e) { Thread.interrupted(); } LOG.info("Trying to acquire lock again..."); } } return false; }</code><technical_language>Instead of #set(boolean), #getAndSet(boolean) atomically sets value</technical_language>

Target:
public boolean lock(long timeout, TimeUnit unit) { long startTime = System.currentTimeMillis(); long lockTimeout = TimeUnit.MILLISECONDS.convert(timeout, unit); Random random = new Random(); while ((System.currentTimeMillis() - startTime) < lockTimeout) { try { leaseId.getAndSet(leaseBlobManager.acquireLease(LEASE_TIME_IN_SEC, leaseId.get())); } catch (AzureException e) { return false; } if (leaseId.get() != null) { LOG.info("Acquired lock!"); hasLock.getAndSet(true); return true; } else { try { Thread.sleep(random.nextInt(1000)); } catch (InterruptedException e) { Thread.interrupted(); } LOG.info("Trying to acquire lock again..."); } } return false; }
Source:
<code>private void logChange(ArtifactReadable artifact, IAttributeType attrType, String currValue, String newValue) { <START> System.err.println( <END> String.format("Attr Values not same; Current [%s], new [%s] for attr type [%s] and artifact %s", currValue, newValue, attrType, artifact.toStringWithId())); }</code><technical_language>log this instead of printing it</technical_language>

Target:
private void logChange(ArtifactReadable artifact, IAttributeType attrType, String currValue, String newValue) { results.logWithFormat("Attr Values not same; Current [%s], new [%s] for attr type [%s] and artifact %s", currValue, newValue, attrType, artifact.toStringWithId()); }
Source:
<code>public void testCreateWithSsh() throws InterruptedException { server.enqueue( new MockResponse().setBody(stringFromResource("/volume/get.json")) ); List<String> sshKeys = new ArrayList<String>(); <START> sshKeys.add("hQGOEJeFL91EG3+l9TtRbWNjzhDVHeLuL3NWee6bekA="); <END> Volume volume = volumeApi().createVolume( Volume.Request.creatingBuilder() .dataCenterId("datacenter-id") .name("jclouds-volume") .size(3) .type("HDD") .licenceType(LicenceType.LINUX) .sshKeys(sshKeys) .build()); assertNotNull(volume); assertNotNull(volume.id()); assertEquals(server.getRequestCount(), 1); assertSent(server, "POST", "/rest/datacenters/datacenter-id/volumes", "{\"properties\": {\"name\": \"jclouds-volume\", \"size\": 3, \"licenceType\": \"LINUX\", \"sshKeys\":[\"hQGOEJeFL91EG3+l9TtRbWNjzhDVHeLuL3NWee6bekA=\"], \"type\":\"HDD\"}}" ); }</code><technical_language>Is this meant contents of ssh public key? Is this a real value, a real here</technical_language>

Target:
public void testCreateWithSsh() throws InterruptedException { server.enqueue( new MockResponse().setBody(stringFromResource("/volume/get.json")) ); HashSet<String> sshKeys = new HashSet<String>(); sshKeys.add("hQGOEJeFL91EG3+l9TtRbWNjzhDVHeLuL3NWee6bekA="); Volume volume = volumeApi().createVolume( Volume.Request.creatingBuilder() .dataCenterId("datacenter-id") .name("jclouds-volume") .size(3) .type(VolumeType.HDD) .licenceType(LicenceType.LINUX) .sshKeys(sshKeys) .build()); assertNotNull(volume); assertNotNull(volume.id()); assertEquals(server.getRequestCount(), 1); assertSent(server, "POST", "/datacenters/datacenter-id/volumes", "{\"properties\": {\"name\": \"jclouds-volume\", \"size\": 3, \"licenceType\": \"LINUX\", \"sshKeys\":[\"hQGOEJeFL91EG3+l9TtRbWNjzhDVHeLuL3NWee6bekA=\"], \"type\":\"HDD\"}}" ); }
Source:
<code>private void interpolateElevationsOfPillarNodes() { final EdgeIterator edge = storage.getAllEdges(); while (edge.next()) { if (isStructureEdge(edge)) { int firstNodeId = edge.getBaseNode(); int secondNodeId = edge.getAdjNode(); <START> double lat0 = storage.getNodeAccess().getLat(firstNodeId); <END> double lon0 = storage.getNodeAccess().getLon(firstNodeId); double ele0 = storage.getNodeAccess().getEle(firstNodeId); double lat1 = storage.getNodeAccess().getLat(secondNodeId); double lon1 = storage.getNodeAccess().getLon(secondNodeId); double ele1 = storage.getNodeAccess().getEle(secondNodeId); final PointList pointList = edge.fetchWayGeometry(0); final int count = pointList.size(); for (int index = 0; index < count; index++) { double lat = pointList.getLat(index); double lon = pointList.getLon(index); double ele = elevationInterpolator.calculateElevation(lat, lon, lat0, lon0, ele0, lat1, lon1, ele1); pointList.set(index, lat, lon, ele); } edge.setWayGeometry(pointList); } } }</code><technical_language>I assign nodeAccess a local variable of loop. Potentially JVM is this reads a bit faster :)</technical_language>

Target:
private void interpolateElevationsOfPillarNodes() { final EdgeIterator edge = storage.getAllEdges(); final NodeAccess nodeAccess = storage.getNodeAccess(); while (edge.next()) { if (isInterpolatableEdge(edge)) { int firstNodeId = edge.getBaseNode(); int secondNodeId = edge.getAdjNode(); double lat0 = nodeAccess.getLat(firstNodeId); double lon0 = nodeAccess.getLon(firstNodeId); double ele0 = nodeAccess.getEle(firstNodeId); double lat1 = nodeAccess.getLat(secondNodeId); double lon1 = nodeAccess.getLon(secondNodeId); double ele1 = nodeAccess.getEle(secondNodeId); final PointList pointList = edge.fetchWayGeometry(0); final int count = pointList.size(); for (int index = 0; index < count; index++) { double lat = pointList.getLat(index); double lon = pointList.getLon(index); double ele = elevationInterpolator.calculateElevationBasedOnTwoPoints(lat, lon, lat0, lon0, ele0, lat1, lon1, ele1); pointList.set(index, lat, lon, ele); } edge.setWayGeometry(pointList); } } }
Source:
<code>public static void loadBasicInformation(GerritClient gerrit, ChangeInfo toRefresh) { ChangeInfo newChangeInfo = QueryHelpers.queryBasicInformation(gerrit, toRefresh.getId()); <START> mergeNewInformation(toRefresh, newChangeInfo); <END> QueryHelpers.loadRevisionDetails(gerrit, toRefresh.getUserSelectedRevision()); }</code><technical_language>Adding this code pretty reverts attempts of performance improvements. name of method implies, this load basic informations, detail a revision is definitly part of</technical_language>

Target:
public static void loadBasicInformation(GerritClient gerrit, ChangeInfo toRefresh) { ChangeInfo newChangeInfo = QueryHelpers.queryBasicInformation(gerrit, toRefresh.getId()); mergeNewInformation(toRefresh, newChangeInfo); }
Source:
<code>public GenericColumn get() { <START> if (nullValueBitmap.isEmpty()) { <END> return new DoublesColumn(column.get()); } else { return new DoublesColumnWithNulls(column.get(), nullValueBitmap); } }</code><technical_language>I suggest move this logic this place a static factory method in DoublesColumn. DoublesColumn's constructor is private, DoublesColumnWithNulls class is package-private. for Long Float</technical_language>

Target:
public GenericColumn get() { return DoublesColumn.create(column.get(), nullValueBitmap); }
Source:
<code>public PollResult poll(boolean initial, Object checkPoint) throws Exception { Map<String, Object> map = new HashMap<String, Object>(); for(PropertyWithDeploymentContext prop: tableCache.getProperties()){ if(prop.getContextKey() == contextKey && <START> prop.getContextValue().equalsIgnoreCase(cfg.getString(prop.getContextKey().getKey()))){ <END> map.put(prop.getPropertyName(), prop.getPropertyValue()); } } return PollResult.createFull(map); }</code><technical_language>this cfg.getDeploymentContext().getKey(contextKey) do deal property applies deployment context</technical_language>

Target:
public PollResult poll(boolean initial, Object checkPoint) throws Exception { Map<String, Object> map = new HashMap<String, Object>(); for(PropertyWithDeploymentContext prop: tableCache.getProperties()){ if(prop.getContextKey() == contextKey && prop.getContextValue() == null){ map.put(prop.getPropertyName(), prop.getPropertyValue()); } else if(prop.getContextKey() == contextKey && prop.getContextValue().equalsIgnoreCase(deploymentContext.getValue(contextKey))){ map.put(prop.getPropertyName(), prop.getPropertyValue()); } } return PollResult.createFull(map); }
Source:
<code>public AdminMetrics(MetricRegistry metricRegistry) { unknownActionErrorCount = <START> metricRegistry.counter(MetricRegistry.name(AdminBlobStorageService.class, "unknownActionErrorCount")); <END> }</code><technical_language>is this metric need</technical_language>

Target:
public AdminMetrics(MetricRegistry metricRegistry) { }
Source:
<code>public static String getQName(PsiElement[] fileChildren, final String result, boolean searchInSamePackage) { final HaxeImportStatement importStatement = (HaxeImportStatement)Arrays.stream(fileChildren) .filter(element -> element instanceof HaxeImportStatement && ((HaxeImportStatement)element).getModel().exposeByName(result) != null) <START> .findFirst() <END> .orElse(null); final HaxeExpression importStatementExpression = importStatement == null ? null : importStatement.getReferenceExpression(); final String packageName = getPackageName( (HaxePackageStatement)Arrays.stream(fileChildren) .filter(element -> element instanceof HaxePackageStatement) .findFirst() .orElse(null) ); final HaxeClass classForType = (HaxeClass)ContainerUtil.find(fileChildren, new Condition<PsiElement>() { @Override public boolean value(PsiElement element) { return element instanceof HaxeClass && result.equals(((HaxeClass)element).getName()); } }); if (classForType != null) { return classForType.getQualifiedName(); } else if (importStatement != null && importStatementExpression != null) { return importStatementExpression.getText(); } else if (searchInSamePackage && !packageName.isEmpty()) { return packageName + "." + result; } return result; }</code><technical_language>Ditto. (Imports supposed resolve in reverse.)</technical_language>

Target:
public static String getQName(PsiElement[] fileChildren, final String result, boolean searchInSamePackage) { final HaxeImportStatement importStatement = (HaxeImportStatement)(StreamUtil.reverse(Arrays.stream(fileChildren)) .filter(element -> element instanceof HaxeImportStatement && ((HaxeImportStatement)element).getModel().exposeByName(result) != null) .findFirst() .orElse(null)); final HaxeExpression importStatementExpression = importStatement == null ? null : importStatement.getReferenceExpression(); final String packageName = getPackageName( (HaxePackageStatement)Arrays.stream(fileChildren) .filter(element -> element instanceof HaxePackageStatement) .findFirst() .orElse(null) ); final HaxeClass classForType = (HaxeClass)ContainerUtil.find(fileChildren, new Condition<PsiElement>() { @Override public boolean value(PsiElement element) { return element instanceof HaxeClass && result.equals(((HaxeClass)element).getName()); } }); if (classForType != null) { return classForType.getQualifiedName(); } else if (importStatement != null && importStatementExpression != null) { return importStatementExpression.getText(); } else if (searchInSamePackage && !packageName.isEmpty()) { return packageName + "." + result; } return result; }
Source:
<code>private boolean addOncogenicMutations(Alteration exactAlt, Set<Alteration> relevantAlts) { boolean add = false; if (!isKitSpecialVariants(exactAlt)) { if (!exactAlt.getAlteration().trim().equalsIgnoreCase("amplification")) { Set<Oncogenicity> oncogenicities = AlterationUtils.getCuratedOncogenicity(exactAlt); boolean has = AlterationUtils.hasImportantCuratedOncogenicity(oncogenicities); if (has) { Boolean isOncogenic = AlterationUtils.hasOncogenic(oncogenicities); if (isOncogenic != null && isOncogenic) { add = true; } } else { for (Alteration alt : relevantAlts) { Boolean isOncogenic = AlterationUtils.isOncogenicAlteration(alt); <START> if (isOncogenic != null && isOncogenic) { <END> add = true; break; } } } } } return add; }</code><technical_language>need do isKitSpecialVariants check alt? previous check exactAlt</technical_language>

Target:
private boolean addOncogenicMutations(Alteration exactAlt, Set<Alteration> relevantAlts) { boolean add = false; if (!isKitSpecialVariants(exactAlt)) { if (!exactAlt.getAlteration().trim().equalsIgnoreCase("amplification")) { Set<Oncogenicity> oncogenicities = AlterationUtils.getCuratedOncogenicity(exactAlt); boolean has = AlterationUtils.hasImportantCuratedOncogenicity(oncogenicities); if (has) { Boolean isOncogenic = AlterationUtils.hasOncogenic(oncogenicities); if (isOncogenic != null && isOncogenic) { add = true; } } else { for (Alteration alt : relevantAlts) { Boolean isOncogenic = AlterationUtils.isOncogenicAlteration(alt); if (isOncogenic != null && isOncogenic && !isKitSpecialVariants(alt)) { add = true; break; } } } } } return add; }
Source:
<code>public void testCollectionFirstInvalid() throws Throwable { form.setListProperty(Arrays.asList("ああa", "ああ")); Validator validator = Validation.buildDefaultValidatorFactory() .getValidator(); Set<ConstraintViolation<ByteMaxTestForm>> violations = validator .validate(form); assertThat(violations, is(notNullValue())); assertThat(violations.size(), is(1)); assertThat(violations.iterator().next().getPropertyPath().toString(), is("listProperty[0].<list element>")); <START> assertThat(violations.iterator().next().getMessage(), is(String.format( <END> MESSAGE_VALIDATION_ERROR, 6))); }</code><technical_language>[x] create iterator twice...</technical_language>

Target:
public void testCollectionFirstInvalid() { form.setListProperty(Arrays.asList("ああa", "ああ")); Validator validator = Validation.buildDefaultValidatorFactory() .getValidator(); Set<ConstraintViolation<ByteMaxTestForm>> violations = validator .validate(form); assertThat(violations, is(notNullValue())); assertThat(violations.size(), is(1)); ConstraintViolation<ByteMaxTestForm> v = violations.iterator().next(); assertThat(v.getPropertyPath().toString(), is( "listProperty[0].<list element>")); assertThat(v.getMessage(), is(String.format(MESSAGE_VALIDATION_ERROR, 6))); }
Source:
<code>public void addProcessDefinition(String deploymentId, String processId, Object processDescriptor, KieContainer kieContainer) { Map<String, ProcessDescriptor> definitions = null; synchronized (definitionCache) { definitions = definitionCache.get(deploymentId); <START> if (definitions == null) { <END> definitions = new ConcurrentHashMap<String, ProcessDescriptor>(); definitionCache.put(deploymentId, definitions); } ProcessDescriptor descriptor = (ProcessDescriptor) processDescriptor; ProcessAssetDesc definition = descriptor.getProcess(); if( kieContainer != null && descriptor.hasUnresolvedReusableSubProcessNames() ) { descriptor.resolveReusableSubProcessNames(kieContainer.getKieBase().getProcesses()); } definition.setReusableSubProcesses(descriptor.getReusableSubProcesses()); definitions.put(processId, descriptor); } }</code><technical_language>putIfAbsent() instead of a null check? null check lead a race condition</technical_language>

Target:
public void addProcessDefinition(String deploymentId, String processId, Object processDescriptor, KieContainer kieContainer) { Map<String, ProcessDescriptor> definitions = null; synchronized (definitionCache) { Map<String, ProcessDescriptor> newDef = new ConcurrentHashMap<String, ProcessDescriptor>(); definitions = definitionCache.putIfAbsent(deploymentId, newDef); if( definitions == null ) { definitions = newDef; } ProcessDescriptor descriptor = (ProcessDescriptor) processDescriptor; ProcessAssetDesc definition = descriptor.getProcess(); if( kieContainer != null && descriptor.hasUnresolvedReusableSubProcessNames() ) { descriptor.resolveReusableSubProcessNames(kieContainer.getKieBase().getProcesses()); } definition.setReusableSubProcesses(descriptor.getReusableSubProcesses()); definitions.put(processId, descriptor); } }
Source:
<code>void loadClasspathResource(String location) throws IOException { Objects.requireNonNull(location, "location"); InputStream is = getClass().getResourceAsStream(location); if (is == null) { throw new IllegalArgumentException("Resource " + location + " not found in the classpath"); } <START> load(new InputStreamReader(is, Charset.defaultCharset())); <END> }</code><technical_language>please UTF-8 explicitly</technical_language>

Target:
void loadClasspathResource(String location) throws IOException { Objects.requireNonNull(location, "location"); InputStream is = getClass().getResourceAsStream(location); if (is == null) { throw new IllegalArgumentException("Resource " + location + " not found in the classpath"); } load(new InputStreamReader(is, StandardCharsets.UTF_8)); }
Source:
<code>public String getQuestionResultStatisticsCsv( List<FeedbackResponseAttributes> responses, FeedbackQuestionAttributes question, FeedbackSessionResultsBundle bundle) { if(responses.isEmpty()){ return ""; } StringBuilder csv = new StringBuilder(); boolean hasAssignedWeights = hasAssignedWeights(); for (int i = 0; i < rubricChoices.size(); i++) { String header = rubricChoices.get(i); if (hasAssignedWeights) { header += ("(" + rubricWeights.get(i) + ")"); } csv.append("," + Sanitizer.sanitizeForCsv(header)); } if (hasAssignedWeights) { csv.append("," + "Average"); } csv.append(Const.EOL); DecimalFormat df = new DecimalFormat("#"); DecimalFormat dfAverage = new DecimalFormat("0.00"); int[][] responseFrequency = calculateResponseFrequency(responses, this); double[][] rubricStats = calculateRubricStats(responses, question); for (int i = 0; i < rubricSubQuestions.size(); i++) { String alphabeticalIndex = StringHelper.integerToLowerCaseAlphabeticalIndex(i + 1); csv.append(Sanitizer.sanitizeForCsv(alphabeticalIndex + ") " + rubricSubQuestions.get(i))); for (int j = 0; j < rubricChoices.size(); j++) { String percentageFrequency = df.format(rubricStats[i][j] * 100) + "%"; csv.append("," + percentageFrequency + " (" + responseFrequency[i][j] + ")"); } if (hasAssignedWeights) { <START> csv.append("," + dfAverage.format(rubricStats[i][numOfRubricChoices])); <END> } csv.append(Const.EOL); } return csv.toString(); }</code><technical_language>This <code>rubricStats</code> variable more type of statistic</technical_language>

Target:
public String getQuestionResultStatisticsCsv( List<FeedbackResponseAttributes> responses, FeedbackQuestionAttributes question, FeedbackSessionResultsBundle bundle) { if (responses.isEmpty()) { return ""; } StringBuilder csv = new StringBuilder(); DecimalFormat dfWeight = new DecimalFormat("#.##"); for (int i = 0; i < rubricChoices.size(); i++) { String header = rubricChoices.get(i); if (hasAssignedWeights) { header += " (Weight: " + dfWeight.format(rubricWeights.get(i)) + ")"; } csv.append(',').append(Sanitizer.sanitizeForCsv(header)); } if (hasAssignedWeights) { csv.append(",Average"); } csv.append(Const.EOL); DecimalFormat df = new DecimalFormat("#"); DecimalFormat dfAverage = new DecimalFormat("0.00"); int[][] responseFrequency = calculateResponseFrequency(responses, this); float[][] rubricStats = calculateRubricStats(responses, question); for (int i = 0; i < rubricSubQuestions.size(); i++) { String alphabeticalIndex = StringHelper.integerToLowerCaseAlphabeticalIndex(i + 1); csv.append(Sanitizer.sanitizeForCsv(alphabeticalIndex + ") " + rubricSubQuestions.get(i))); for (int j = 0; j < rubricChoices.size(); j++) { String percentageFrequency = df.format(rubricStats[i][j] * 100) + "%"; csv.append("," + percentageFrequency + " (" + responseFrequency[i][j] + ")"); } if (hasAssignedWeights) { csv.append(',').append(dfAverage.format(rubricStats[i][rubricWeights.size()])); } csv.append(Const.EOL); } return csv.toString(); }
Source:
<code>public static Image map(RepoImage entity, Image template) { Image model = template != null ? template : new Image(); model.setId(entity.getRepoImageId()); model.setName(entity.getRepoImageName()); <START> if (entity.getSize() != null) { <END> model.setSize(entity.getSize()); } model.setFileType(map(entity.getFileType(), null)); return model; }</code><technical_language>please rebase patch top of <LINK_0> ? do this, null check redundant</technical_language>

Target:
public static Image map(RepoImage entity, Image template) { Image model = template != null ? template : new Image(); model.setId(entity.getRepoImageId()); model.setName(entity.getRepoImageName()); model.setSize(entity.getSize()); model.setFileType(map(entity.getFileType(), null)); return model; }
Source:
<code>public Map<Variable, Term> patternMatch(Term subject, Term pattern) { substitution = Maps.newHashMapWithExpectedSize(32); tasks.clear(); taskBuffer.clear(); tasks.addFirst(Pair.of(subject, pattern)); failed = false; if (match()) { <START> if (termContext.definition().context().krunOptions != null <END> && termContext.definition().context().krunOptions.experimental.prove() != null) { PatternMatcher.evaluateSubstitution(substitution, termContext); } return substitution; } else { return null; } }</code><technical_language>is related change unnatural check if krunOptions is null</technical_language>

Target:
public Map<Variable, Term> patternMatch(Term subject, Term pattern) { substitution = Maps.newHashMapWithExpectedSize(32); tasks.clear(); taskBuffer.clear(); tasks.addFirst(Pair.of(subject, pattern)); failed = false; if (match()) { if (termContext.definition().context().krunOptions != null && termContext.definition().context().krunOptions.experimental.prove != null) { PatternMatcher.evaluateSubstitution(substitution, termContext); } return substitution; } else { return null; } }
Source:
<code><START> void updateTimeRangeSelectionPieChart() { <END> if (getTimeRangePC() == null) { fTimeRangePC = new PieChart(this, SWT.NONE); getTimeRangePC().getTitle().setText(fTimeRangePCname); getTimeRangePC().getAxisSet().getXAxis(0).getTitle().setText(""); getTimeRangePC().getLegend().setPosition(SWT.BOTTOM); getTimeRangePC().getLegend().setVisible(true); getTimeRangePC().addListener(SWT.MouseMove, fMouseListener); } else if (getTimeRangePC().isDisposed()) { return; } Map<String, Long> totalEventCountForChart = getTotalEventCountForChart(false); if(totalEventCountForChart == null){ return; } updatePieChartWithData(fTimeRangePC, totalEventCountForChart, MIN_PRECENTAGE_TO_SHOW_SLICE, fOthersSliceName); }</code><technical_language>needs synchronized</technical_language>

Target:
synchronized void updateTimeRangeSelectionPieChart() { if (getTimeRangePC() == null) { fTimeRangePC = new PieChart(this, SWT.NONE); getTimeRangePC().getTitle().setText(fTimeRangePCname); getTimeRangePC().getAxisSet().getXAxis(0).getTitle().setText(""); getTimeRangePC().getLegend().setPosition(SWT.BOTTOM); getTimeRangePC().getLegend().setVisible(true); getTimeRangePC().addListener(SWT.MouseMove, fMouseListener); } else if (getTimeRangePC().isDisposed()) { return; } Map<String, Long> totalEventCountForChart = getTotalEventCountForChart(false); if(totalEventCountForChart == null){ return; } updatePieChartWithData(fTimeRangePC, totalEventCountForChart, MIN_PRECENTAGE_TO_SHOW_SLICE, fOthersSliceName); }
Source:
<code>protected void configure() { <START> bind(GsonModule.DateAdapter.class).to(GsonModule.Iso8601DateAdapter.class); <END> }</code><technical_language>reason for import change</technical_language>

Target:
protected void configure() { bind(DateAdapter.class).to(Iso8601DateAdapter.class); }
Source:
<code><START> public ATCommandResponse(ATCommand command, byte[] response, ATCommandStatus status) { <END> this.command = command; this.response = response; this.status = status; }</code><technical_language>command, response status values null? If throw a NullPointerException. If is other invalid for parameter IllegalArgumentException thrown</technical_language>

Target:
public ATCommandResponse(ATCommand command, byte[] response, ATCommandStatus status) { if (command == null) throw new NullPointerException("Command cannot be null."); if (response == null) throw new NullPointerException("Response cannot be null."); if (status == null) throw new NullPointerException("Status cannot be null."); this.command = command; this.response = response; this.status = status; }
Source:
<code>public static boolean isTrivialRebase(Project.NameKey project, Repository git, RevCommit prior, RevCommit next) { if (!next.getFullMessage().equals(prior.getFullMessage())) { return false; } <START> if (next.getTree() == prior.getTree()) { return true; } <END> if (next.getParentCount() != 1) { return false; } try { ThreeWayMerger merger = MergeStrategy.RESOLVE.newMerger(git, true); merger.setBase(prior.getParent(0)); return merger.merge(next.getParent(0), prior) && merger.getResultTreeId().equals(next.getTree()); } catch (IOException err) { log.warn("Cannot check trivial rebase of new patch set " + next.name() + " in " + project.get(), err); return false; } }</code><technical_language>I suggest this in abandoned change? trees identical a trivial rebase. cases delta introduced new parent deleted this new commit, is delta reviewed, is delta git rebase created</technical_language>

Target:
public static boolean isTrivialRebase(Project.NameKey project, Repository git, RevCommit prior, RevCommit next) { if (!next.getFullMessage().equals(prior.getFullMessage())) { return false; } if (prior.getParentCount() != 1 || next.getParentCount() != 1) { return false; } if (next.getTree() == prior.getTree() && prior.getParent(0).equals(next.getParent(0))) { return true; } try { ThreeWayMerger merger = MergeStrategy.RESOLVE.newMerger(git, true); merger.setBase(prior.getParent(0)); return merger.merge(next.getParent(0), prior) && merger.getResultTreeId().equals(next.getTree()); } catch (IOException err) { log.warn("Cannot check trivial rebase of new patch set " + next.name() + " in " + project.get(), err); return false; } }
Source:
<code>public void setValues() { fontOverrideProperty.setValue(preferences.getBoolean(JabRefPreferences.OVERRIDE_DEFAULT_FONT_SIZE)); fontSizeProperty.setValue(String.valueOf(preferences.getInt(JabRefPreferences.MAIN_FONT_SIZE))); fontTweaksLinuxProperty.setValue(preferences.getBoolean(JabRefPreferences.FX_FONT_RENDERING_TWEAK)); switch (preferences.get(JabRefPreferences.FX_THEME)) { case ThemeLoader.MAIN_CSS: themeLightProperty.setValue(true); themeDarkProperty.setValue(false); break; case ThemeLoader.DARK_CSS: themeLightProperty.setValue(false); themeDarkProperty.setValue(true); break; default: <START> themeLightProperty.setValue(false); <END> themeDarkProperty.setValue(false); } }</code><technical_language>I slightly default main theme</technical_language>

Target:
public void setValues() { fontOverrideProperty.setValue(preferences.getBoolean(JabRefPreferences.OVERRIDE_DEFAULT_FONT_SIZE)); fontSizeProperty.setValue(String.valueOf(preferences.getInt(JabRefPreferences.MAIN_FONT_SIZE))); switch (preferences.get(JabRefPreferences.FX_THEME)) { case ThemeLoader.DARK_CSS: themeLightProperty.setValue(false); themeDarkProperty.setValue(true); break; case ThemeLoader.MAIN_CSS: default: themeLightProperty.setValue(true); themeDarkProperty.setValue(false); } }
Source:
<code>public Receive createReceive() { return receiveBuilder() .match(AntiEntropyTick.class, message -> { <START> LOGGER.info() <END> .setMessage("ticking") .addData("organization", _organization) .addData("repositoryType", _repositoryType) .log(); if (_currentlyExecuting) { return; } LOGGER.info() .setMessage("starting anti-entropy") .addData("organization", _organization) .addData("repositoryType", _repositoryType) .log(); getContext().getSystem().scheduler().scheduleOnce( scala.concurrent.duration.Duration.Zero(), () -> { try { runAntiEntropy(); } finally { getSelf().tell(AntiEntropyFinished.INSTANCE, getSelf()); } }, getContext().getSystem().dispatcher()); }) .match(AntiEntropyFinished.class, message -> { _currentlyExecuting = false; }) .build(); }</code><technical_language>debug level</technical_language>

Target:
public Receive createReceive() { return receiveBuilder() .match(AntiEntropyTick.class, message -> { LOGGER.debug() .setMessage("ticking") .addData("repositoryType", _repositoryType) .log(); if (_currentlyExecuting) { return; } getContext().getSystem().scheduler().scheduleOnce( scala.concurrent.duration.Duration.Zero(), createAntiEntropyRunnable(), getContext().dispatcher()); }) .match(AntiEntropyFinished.class, message -> { _currentlyExecuting = false; }) .build(); }
Source:
<code>public boolean equals(Object o) { if (o == null || o.getClass() != getClass()) { return false; } if (o == this) { return true; } AbstractOpenshiftUIElement<?, ?> other= (AbstractOpenshiftUIElement<?, ?>) o; return wrapped.equals(other.getWrapped()) <START> && (getParent() == null && other.getParent() == null || getParent().equals(other.getParent())); <END> }</code><technical_language>if getParent() == null other.getParent() != null, get NPE calling getParent().equals(...)</technical_language>

Target:
public boolean equals(Object o) { if (o == null || o.getClass() != getClass()) { return false; } if (o == this) { return true; } AbstractOpenshiftUIElement<?, ?> other= (AbstractOpenshiftUIElement<?, ?>) o; return wrapped.equals(other.getWrapped()) && ( getParent() != null && getParent().equals(other.getParent()) || getParent() == null && other.getParent() == null ); }
Source:
<code>public Set<Route> getRoutes (String stop_id) { <START> return feed.patterns.values().stream() <END> .filter(p -> p.orderedStops.contains(stop_id)) .map(p -> feed.routes.get(p.route_id)) .collect(Collectors.toSet()); }</code><technical_language>Is this a statistic</technical_language>

Target:
public List<Route> getRoutes (String stop_id) { return feed.patterns.values().stream() .filter(p -> p.orderedStops.contains(stop_id)) .distinct() .map(p -> feed.routes.get(p.route_id)) .collect(Collectors.toList()); }
Source:
<code>public LexicalScope getChild(String name) { if (name.equals(EVENT_HEADER_ID.getName())) { return EVENT_HEADER_ID; } if (name.equals(EVENT_HEADER_V.getName())) { return EVENT_HEADER_V; } <START> return super.getChild(name); <END> }</code><technical_language>If a singleton need call super</technical_language>

Target:
public ILexicalScope getChild(String name) { if (name.equals(EVENT_HEADER_ID.getName())) { return EVENT_HEADER_ID; } if (name.equals(EVENT_HEADER_V.getName())) { return EVENT_HEADER_V; } return super.getChild(name); }
Source:
<code><START> public DetectorTask restoreRedundancy(Layout layout){ <END> return restoreRedundancyAndMergeSegments(layout); }</code><technical_language>point for wrapper method</technical_language>

Target:
public void restoreRedundancy(Layout layout) { restoreRedundancyAndMergeSegments(layout); }
Source:
<code>public Collection<IInstallableUnit> getMandatoryUnits() { <START> return additionalUnits.values(); <END> }</code><technical_language>Returning JRE units getTemporaryAdditions is IMHO enough. This method return empty list. This means a dependency resolution e.g. prefer a bundle providing javax.xml a a.jre.javase unit. IMHO this is okay: care EEs here, care potentially redundant bundles either</technical_language>

Target:
public Collection<IInstallableUnit> getMandatoryUnits() { return Collections.emptyList(); }
Source:
<code><T> List<Invoker<T>> route(List<Invoker<T>> invokers, URL url, Invocation invocation) throws RpcException; <START> Integer getPriority(); <END> @Override default int compareTo(Router o) { if (o == null) { throw new IllegalArgumentException(); } if (this.getPriority().equals(o.getPriority())) { if (o.getUrl() == null) { return -1; } return getUrl().toFullString().compareTo(o.getUrl().toFullString()); } else { return getPriority() > o.getPriority() ? 1 : -1; } }</code><technical_language>I int is better, rely auto-boxing</technical_language>

Target:
<T> List<Invoker<T>> route(List<Invoker<T>> invokers, URL url, Invocation invocation) throws RpcException; int getPriority(); @Override default int compareTo(Router o) { if (o == null) { throw new IllegalArgumentException(); } if (this.getPriority() == o.getPriority()) { if (o.getUrl() == null) { return -1; } return getUrl().toFullString().compareTo(o.getUrl().toFullString()); } else { return getPriority() > o.getPriority() ? 1 : -1; } }
Source:
<code>public List<CycleCourseGroup> getSecondCycleDegreesWithAffinity(final CycleCourseGroup firstCycle) { <START> return firstCycle.getDestinationAffinitiesSet().stream(). <END> sorted(CycleCourseGroup.COMPARATOR_BY_PARENT_DEGREE_PRESENTATION_NAME).collect(Collectors.toList()); }</code><technical_language>Check if Comparator.comparing instead of creating another comparator for this case</technical_language>

Target:
public List<CycleCourseGroup> getSecondCycleDegreesWithAffinity(final CycleCourseGroup firstCycle) { return firstCycle.getDestinationAffinitiesSet().stream(). sorted(Comparator.comparing(CycleCourseGroup::getParentDegreeCurricularPlan, DegreeCurricularPlan.COMPARATOR_BY_PRESENTATION_NAME)).collect(Collectors.toList()); }
Source:
<code>void setServerErrorCode(final String errorCode) { <START> if (null != errorCode && !errorCode.equals("0")) { <END> setProperty(EventStrings.SERVER_ERROR_CODE, errorCode.trim()); } }</code><technical_language>errorCode checking (null != errorCode) is in HttpEvent.java (!StringExtensions.isNullOrBlank(errorCode))</technical_language>

Target:
void setServerErrorCode(final String errorCode) { if (!StringExtensions.isNullOrBlank(errorCode) && !errorCode.equals("0")) { setProperty(EventStrings.SERVER_ERROR_CODE, errorCode.trim()); } }
Source:
<code><START> public void addNotification() throws Exception { <END> for (int i = 0; i < NO_OF_DEVICES; i++) { DeviceIdentifier testDeviceIdentifier = new DeviceIdentifier(DEVICE_ID_PREFIX + i, DEVICE_TYPE); Notification notification = mockNotification.getNotification(i, "CHECKED", testDeviceIdentifier.toString(), DEVICE_ID_PREFIX + i, 1, DEVICE_TYPE); NotificationManagementServiceImpl notificationManagementService = new NotificationManagementServiceImpl(); Assert.assertTrue(notificationManagementService.addNotification(testDeviceIdentifier, notification)); } }</code><technical_language>Add Description</technical_language>

Target:
public void addNotification() throws Exception { for (int i = 0; i < NO_OF_DEVICES; i++) { DeviceIdentifier testDeviceIdentifier = new DeviceIdentifier(DEVICE_ID_PREFIX + i, DEVICE_TYPE); Notification notification = TestDataHolder.getNotification(i, "CHECKED", testDeviceIdentifier.toString(), DEVICE_ID_PREFIX + i, 1, DEVICE_TYPE); NotificationManagementServiceImpl notificationManagementService = new NotificationManagementServiceImpl(); Assert.assertTrue(notificationManagementService.addNotification(testDeviceIdentifier, notification)); } }
Source:
<code>public void run() { try { Long rescheduleAt = handler.tick(false); if (rescheduleAt == null) { scheduledPool.schedule(scheduleRunnable, 10, TimeUnit.MILLISECONDS); } else if (rescheduleAt != 0) { <START> scheduledPool.schedule(scheduleRunnable, rescheduleAt - TimeUnit.NANOSECONDS.toMillis(System.nanoTime()), TimeUnit.MILLISECONDS); <END> } } catch (Exception e) { log.warn(e.getMessage(), e); } }</code><technical_language>This a static logger method a code</technical_language>

Target:
public void run() { Long rescheduleAt = handler.tick(false); if (rescheduleAt == null) { scheduledPool.schedule(scheduleRunnable, 10, TimeUnit.MILLISECONDS); } else if (rescheduleAt != 0) { scheduledPool.schedule(scheduleRunnable, rescheduleAt - TimeUnit.NANOSECONDS.toMillis(System.nanoTime()), TimeUnit.MILLISECONDS); } }
Source:
<code>public CroppingToolPageObject selectCrop() { <START> cropImageButton.click(); <END> return new CroppingToolPageObject(driver); }</code><technical_language>waitAndClick method, element is clickable</technical_language>

Target:
public CroppingToolPageObject selectCrop() { waitAndClick(cropImageButton); return new CroppingToolPageObject(driver); }
Source:
<code>public void run() { NsdClient nsdClientInstance = NsdClient.getInstance(getApplicationContext()); Log.d(TAG, "FriendCreationServiceThread Started"); while (!Thread.currentThread().isInterrupted()) { while (!nsdClientInstance.isEmptyFriendCreationQueue()){ try { TimeUnit.MILLISECONDS.sleep(delayInterval); Friend creatingFriend = nsdClientInstance.dequeueFriendCreationQueue(); Log.d(TAG, "Creating friend " + creatingFriend.getMac().toString()); <START> FriendCreationRequest CreationRequest = new FriendCreationRequest(creatingFriend); <END> ChatManager chatManager = ChatManager.getInstance(getApplicationContext()); chatManager.enqueueOutGoingMessageQueue(CreationRequest.convertMessageToJson()); } catch (InterruptedException e) { e.printStackTrace(); } } } }</code><technical_language>camel case var naming please. (s/CreationRequest/creationRequest/)</technical_language>

Target:
public void run() { FriendCreationQueue friendCreationQueue = FriendCreationQueue.getInstance(); Log.d(TAG, "FriendCreationServiceThread Started"); while (!Thread.currentThread().isInterrupted()) { while (MessageServer.serviceStarted && !friendCreationQueue.isEmptyFriendCreationQueue()){ try { Friend creatingFriend = friendCreationQueue.topFriendCreationQueue(); Log.d(TAG, "Creating friend " + creatingFriend.getIp().toString()); FriendCreationRequest creationRequest = new FriendCreationRequest(creatingFriend,getApplicationContext()); ChatManager chatManager = ChatManager.getInstance(); chatManager.enqueueOutGoingMessageQueue(creationRequest.convertMessageToJson()); TimeUnit.MILLISECONDS.sleep(delayInterval); friendCreationQueue.dequeueFriendCreationQueue(); } catch (InterruptedException e) { e.printStackTrace(); } } } }
Source:
<code>private void prefixTrim(CorfuPayloadMsg<TrimRequest> msg, ChannelHandlerContext ctx, IServerRouter r) { try { TrimRequest req = msg.getPayload(); <START> batchWriter.prefixTrim(req.getAddress(), msg.getEpoch()); <END> r.sendResponse(ctx, msg, CorfuMsgType.ACK.msg()); } catch (TrimmedException ex) { r.sendResponse(ctx, msg, CorfuMsgType.ERROR_TRIMMED.msg()); } }</code><technical_language>check msg.getEpoch() more epoch right</technical_language>

Target:
private void prefixTrim(CorfuPayloadMsg<TrimRequest> msg, ChannelHandlerContext ctx, IServerRouter r) { try { TrimRequest req = msg.getPayload(); batchWriter.prefixTrim(req.getAddress().getSequence(), msg.getEpoch()); r.sendResponse(ctx, msg, CorfuMsgType.ACK.msg()); } catch (TrimmedException ex) { r.sendResponse(ctx, msg, CorfuMsgType.ERROR_TRIMMED.msg()); } }