auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void onLocationChanged(Location location) { if (location != null) { if (target != null) { String result = GeoUtils.locationToString(location); TreeReference qualifiedReference = mContextRef == null ? target : target.contextualize(mContextRef); EvaluationContext context = new EvaluationContext(mModel.getEvaluationContext(), qualifiedReference); AbstractTreeElement node = context.resolveReference(qualifiedReference); if(node == null) { Context applicationContext = CommCareApplication._(); Intent xpathErrorIntent = new Intent(XPATH_ERROR_ACTION); xpathErrorIntent.putExtra(KEY_UNRESOLVED_XPATH, qualifiedReference.toString(true)); applicationContext.sendStickyBroadcast(xpathErrorIntent); } else { int dataType = node.getDataType(); IAnswerData val = Recalculate.wrapData(result, dataType); mModel.setValue(val == null ? null: AnswerDataFactory.templateByDataType(dataType).cast(val.uncast()), qualifiedReference); } } Context context = CommCareApplication._().getApplicationContext(); if (location.getAccuracy() <= GeoUtils.GOOD_ACCURACY <START> && (ContextCompat.checkSelfPermission(context, Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED || <END> ContextCompat.checkSelfPermission(context, Manifest.permission.ACCESS_COARSE_LOCATION) == PackageManager.PERMISSION_GRANTED)) { mLocationManager.removeUpdates(this); } } }</code><technical_language>This is repeated a bunch of times in this file moved a method</technical_language>

Target:
public void onLocationChanged(Location location) { if (location != null) { if (target != null) { String result = GeoUtils.locationToString(location); TreeReference qualifiedReference = mContextRef == null ? target : target.contextualize(mContextRef); EvaluationContext context = new EvaluationContext(mModel.getEvaluationContext(), qualifiedReference); AbstractTreeElement node = context.resolveReference(qualifiedReference); if(node == null) { Context applicationContext = CommCareApplication._(); Intent xpathErrorIntent = new Intent(XPATH_ERROR_ACTION); xpathErrorIntent.putExtra(KEY_UNRESOLVED_XPATH, qualifiedReference.toString(true)); applicationContext.sendStickyBroadcast(xpathErrorIntent); } else { int dataType = node.getDataType(); IAnswerData val = Recalculate.wrapData(result, dataType); mModel.setValue(val == null ? null: AnswerDataFactory.templateByDataType(dataType).cast(val.uncast()), qualifiedReference); } } if (location.getAccuracy() <= GeoUtils.GOOD_ACCURACY && hasLocationPerms()) { mLocationManager.removeUpdates(this); } } }
Source:
<code>public Iterator<Path> iterator() { List<Path> result = new ArrayList<>(); <START> virtualFile.children(FileSearch.iterateAll(child -> result.add(new BridgePath(child, fs)))); <END> return result.iterator(); }</code><technical_language>suggestion virtualFile.children(FileSearch.iterateAll(child -> result.add(new BridgePath(child, fileSystem))));</technical_language>

Target:
public Iterator<Path> iterator() { List<Path> result = new ArrayList<>(); virtualFile.children(FileSearch.iterateAll(child -> result.add(new BridgePath(child, fileSystem)))); return result.iterator(); }
Source:
<code>public byte[] encode(final List<Vector> list) { int totalLength = 0; Vector e; for (Iterator baos = list.iterator(); baos.hasNext();) { e = (Vector)baos.next(); totalLength += 32 + 64 * e.length(); } <START> final ByteArrayOutputStream var20 = new ByteArrayOutputStream(32 + totalLength); <END> try { final DataOutputStream var21 = new DataOutputStream(var20); Throwable var5 = null; try { var21.writeInt(list.size()); final Iterator var6 = list.iterator(); while (var6.hasNext()) { final Vector vector = (Vector)var6.next(); final int length = vector.length(); var21.writeInt(length); for (int i = 0; i < length; ++i) { var21.writeDouble(vector.get(i)); } } } catch (Throwable var17) { var5 = var17; throw var17; } finally { if (var21 != null) { if (var5 != null) { try { var21.close(); } catch (Throwable var16) { var5.addSuppressed(var16); } } else { var21.close(); } } } } catch (IOException var19) { throw new RuntimeException(var19.getCause()); } return var20.toByteArray(); }</code><technical_language>numbers variable names (e.g., var20)? rename more meaningful ones</technical_language>

Target:
public byte[] encode(final List<Vector> list) { int vectorLength = 0; for (final Vector vector : list) { vectorLength = vector.length(); } try (ByteArrayOutputStream baos = new ByteArrayOutputStream(Integer.SIZE + Integer.SIZE + Double.SIZE * vectorLength * list.size())) { try (DataOutputStream dos = new DataOutputStream(baos)) { dos.writeInt(list.size()); dos.writeInt(vectorLength); for (final Vector vector : list) { for (int i = 0; i < vectorLength; ++i) { dos.writeDouble(vector.get(i)); } } } return baos.toByteArray(); } catch (final IOException e) { throw new RuntimeException(e); } }
Source:
<code>public Class<? extends ColumnHandle> getColumnHandleClass() { <START> return TestingMetadata.TestingColumnHandle.class; <END> }</code><technical_language>static import</technical_language>

Target:
public Class<? extends ColumnHandle> getColumnHandleClass() { return TestingColumnHandle.class; }
Source:
<code>private void createSchema() { Connection conn = null; try { conn = provider.getConnection(); conn.setAutoCommit(false); Statement stmt = conn.createStatement(); stmt.addBatch("create table if not exists rp(id varchar(36) primary key, data varchar(65534))"); <START> stmt.addBatch("create table if not exists expired_objects( key varchar(50), value varchar(50), type varchar(5), iat TIMESTAMP, exp TIMESTAMP)"); <END> stmt.executeBatch(); stmt.close(); conn.commit(); LOG.debug("Schema created successfully."); } catch (Exception e) { LOG.error("Failed to create schema. Error: " + e.getMessage(), e); rollbackSilently(conn); throw new RuntimeException(e); } finally { IOUtils.closeSilently(conn); } }</code><technical_language>varchar(65534), type varchar(20)</technical_language>

Target:
private void createSchema() { Connection conn = null; try { conn = provider.getConnection(); conn.setAutoCommit(false); Statement stmt = conn.createStatement(); stmt.addBatch("create table if not exists rp(id varchar(36) primary key, data varchar(65534))"); stmt.addBatch("create table if not exists expired_objects( key varchar(50), value varchar(65534), type varchar(20), iat TIMESTAMP, exp TIMESTAMP)"); stmt.executeBatch(); stmt.close(); conn.commit(); LOG.debug("Schema created successfully."); } catch (Exception e) { LOG.error("Failed to create schema. Error: " + e.getMessage(), e); rollbackSilently(conn); throw new RuntimeException(e); } finally { IOUtils.closeSilently(conn); } }
Source:
<code>protected void executeCommand() { setGlusterVolumeId(option.getVolumeId()); setGlusterVolumeName(getGlusterVolume().getName()); executeVdsCommand(VDSCommandType.SetGlusterVolumeOption, new GlusterVolumeOptionVDSParameters(getUpServer().getId(), <START> getGlusterVolumeName(), getParameters().getVolumeOption())); <END> if (getSucceeded()) { updateOptionInDb(getParameters().getVolumeOption()); } }</code><technical_language>do need pass this if save option a field in command</technical_language>

Target:
protected void executeCommand() { setGlusterVolumeId(option.getVolumeId()); setGlusterVolumeName(getGlusterVolume().getName()); VDSReturnValue returnValue = runVdsCommand(VDSCommandType.SetGlusterVolumeOption, new GlusterVolumeOptionVDSParameters(getUpServer().getId(), getGlusterVolumeName(), getParameters().getVolumeOption())); setSucceeded(returnValue.getSucceeded()); if (getSucceeded()) { updateOptionInDb(getParameters().getVolumeOption()); } }
Source:
<code>public static BluetoothGattDescriptor getCharacteristicUserDescriptionDescriptor(String defaultValue) { BluetoothGattDescriptor descriptor = new BluetoothGattDescriptor( CHARACTERISTIC_USER_DESCRIPTION_UUID, (BluetoothGattDescriptor.PERMISSION_READ | BluetoothGattDescriptor.PERMISSION_WRITE)); <START> try { <END> descriptor.setValue(defaultValue.getBytes("UTF-8")); } finally { return descriptor; } }</code><technical_language>do need try</technical_language>

Target:
public static BluetoothGattDescriptor getCharacteristicUserDescriptionDescriptor(String defaultValue) { BluetoothGattDescriptor descriptor = new BluetoothGattDescriptor( CHARACTERISTIC_USER_DESCRIPTION_UUID, (BluetoothGattDescriptor.PERMISSION_READ)); try { descriptor.setValue(defaultValue.getBytes("UTF-8")); } finally { return descriptor; } }
Source:
<code>public String create(final String path, byte data[], List<ACL> acl, CreateMode createMode) throws KeeperException, InterruptedException { final String clientPath = path; PathUtils.validatePath(clientPath, createMode.isSequential()); EphemeralType.validateTTL(createMode, -1); final String serverPath = prependChroot(clientPath); RequestHeader h = new RequestHeader(); h.setType(createMode.isContainer() ? ZooDefs.OpCode.createContainer : ZooDefs.OpCode.create); CreateRequest request = new CreateRequest(); CreateResponse response = new CreateResponse(); request.setData(data); request.setFlags(createMode.toFlag()); request.setPath(serverPath); <START> if (acl == null || acl.size() == 0) { <END> throw new KeeperException.InvalidACLException(); } request.setAcl(acl); ReplyHeader r = cnxn.submitRequest(h, request, response, null); if (r.getErr() != 0) { throw KeeperException.create(KeeperException.Code.get(r.getErr()), clientPath); } if (cnxn.chrootPath == null) { return response.getPath(); } else { return response.getPath().substring(cnxn.chrootPath.length()); } }</code><technical_language>account for null entries in acl List below? if (acl == null || acl.size() == 0 || acl.contains(null)) { applies other changes in this file</technical_language>

Target:
public String create(final String path, byte data[], List<ACL> acl, CreateMode createMode) throws KeeperException, InterruptedException { final String clientPath = path; PathUtils.validatePath(clientPath, createMode.isSequential()); EphemeralType.validateTTL(createMode, -1); validateACL(acl); final String serverPath = prependChroot(clientPath); RequestHeader h = new RequestHeader(); h.setType(createMode.isContainer() ? ZooDefs.OpCode.createContainer : ZooDefs.OpCode.create); CreateRequest request = new CreateRequest(); CreateResponse response = new CreateResponse(); request.setData(data); request.setFlags(createMode.toFlag()); request.setPath(serverPath); request.setAcl(acl); ReplyHeader r = cnxn.submitRequest(h, request, response, null); if (r.getErr() != 0) { throw KeeperException.create(KeeperException.Code.get(r.getErr()), clientPath); } if (cnxn.chrootPath == null) { return response.getPath(); } else { return response.getPath().substring(cnxn.chrootPath.length()); } }
Source:
<code>public int hashCode() { final int prime = 31; int result = 1; <START> result = prime * result + ((date == null) ? 0 : date.hashCode()); <END> result = prime * result + desc.hashCode(); result = prime * result + ((type == null) ? 0 : type.hashCode()); return result; }</code><technical_language>Consider Objects.hashCode(object) instead of ternary (but consider, do consider this a normative statement)</technical_language>

Target:
public int hashCode() { return Objects.hash(date, desc, type); }
Source:
<code>public PartBuilder part( String name, @Nullable String filename, Object part, @Nullable MediaType contentType) { Assert.hasLength(name, "'name' must not be empty"); Assert.notNull(part, "'part' must not be null"); if (part instanceof Publisher) { throw new IllegalArgumentException("Use publisher(String, Publisher, Class) or " + "publisher(String, Publisher, ParameterizedTypeReference) for adding Publisher parts"); } if (part instanceof PublisherEntity<?,?>) { PublisherPartBuilder<?, ?> builder = new PublisherPartBuilder<>((PublisherEntity<?, ?>) part); this.parts.add(name, builder); return builder; } Object partBody; HttpHeaders partHeaders = new HttpHeaders(); <START> if (filename != null) { <END> partHeaders.setContentDispositionFormData(name, filename); } if (part instanceof HttpEntity) { HttpEntity<?> httpEntity = (HttpEntity<?>) part; partBody = httpEntity.getBody(); partHeaders.addAll(httpEntity.getHeaders()); } else { partBody = part; } if (contentType != null) { partHeaders.setContentType(contentType); } DefaultPartBuilder builder = new DefaultPartBuilder(partHeaders, partBody); this.parts.add(name, builder); return builder; }</code><technical_language>check filename length. if (StringUtils.hasLength(filename))</technical_language>

Target:
public PartBuilder part( String name, @Nullable String filename, Object part, @Nullable MediaType contentType) { Assert.hasLength(name, "'name' must not be empty"); Assert.notNull(part, "'part' must not be null"); if (part instanceof Publisher) { throw new IllegalArgumentException("Use publisher(String, Publisher, Class) or " + "publisher(String, Publisher, ParameterizedTypeReference) for adding Publisher parts"); } if (part instanceof PublisherEntity<?,?>) { PublisherPartBuilder<?, ?> builder = new PublisherPartBuilder<>((PublisherEntity<?, ?>) part); this.parts.add(name, builder); return builder; } Object partBody; HttpHeaders partHeaders = new HttpHeaders(); if (StringUtils.hasLength(filename)) { partHeaders.setContentDispositionFormData(name, filename); } if (part instanceof HttpEntity) { HttpEntity<?> httpEntity = (HttpEntity<?>) part; partBody = httpEntity.getBody(); partHeaders.addAll(httpEntity.getHeaders()); } else { partBody = part; } if (contentType != null) { partHeaders.setContentType(contentType); } DefaultPartBuilder builder = new DefaultPartBuilder(partHeaders, partBody); this.parts.add(name, builder); return builder; }
Source:
<code>public NamedComponentsSearchingTestCDI11() { <START> CDIVersion = "1.1"; <END> }</code><technical_language>1.2</technical_language>

Target:
public NamedComponentsSearchingTestCDI11() { CDIVersion = "1.2"; }
Source:
<code>private List<Map<String, Object>> getListActions(Metacard workspaceMetacard) { final String host = <START> SystemBaseUrl.getProtocol() + SystemBaseUrl.getHost() + ":" + SystemBaseUrl.getPort(); <END> return actionRegistry .list(workspaceMetacard) .stream() .filter(action -> action.getId().startsWith(LIST_ACTION_PREFIX)) .map( action -> { final String url = action.getUrl().toString().replaceFirst(host, ""); final Map<String, Object> actionMap = new HashMap<>(); actionMap.put("id", action.getId()); actionMap.put("url", url); actionMap.put("title", action.getTitle()); actionMap.put("description", action.getDescription()); return actionMap; }) .collect(toList()); }</code><technical_language>call SystemBaseUrl.getBaseUrl() instead</technical_language>

Target:
private List<Map<String, Object>> getListActions(Metacard workspaceMetacard) { final String host = SystemBaseUrl.getBaseUrl(); return actionRegistry .list(workspaceMetacard) .stream() .filter(action -> action.getId().startsWith(LIST_ACTION_PREFIX)) .map( action -> { final String url = action.getUrl().toString().replaceFirst(host, ""); final Map<String, Object> actionMap = new HashMap<>(); actionMap.put("id", action.getId()); actionMap.put("url", url); actionMap.put("title", action.getTitle()); actionMap.put("description", action.getDescription()); return actionMap; }) .collect(toList()); }
Source:
<code>private void assertRegionBucketsConsistency() throws ForceReattemptException { List<BucketDump> bucketDumps; PartitionedRegion region = (PartitionedRegion) cacheRule.getCache().getRegion(REGION_NAME); int expectedCopies = region.getRedundantCopies() + 1; for (int bucketId = 0; bucketId < BUCKETS; bucketId++) { bucketDumps = region.getAllBucketEntries(bucketId); assertThat(bucketDumps.size()) .as("Bucket " + bucketId + " should have " + expectedCopies + " copies, but has " + bucketDumps.size()) .isEqualTo(expectedCopies); if (bucketDumps.size() > 1) { BucketDump firstDump = bucketDumps.get(0); for (int j = 1; j < bucketDumps.size(); j++) { BucketDump otherDump = bucketDumps.get(j); <START> assertThat(otherDump.getRvv()) <END> .as("RegionVersionVector for bucket " + bucketId + " on member " + otherDump.getMember() + " is not consistent with member " + firstDump.getMember()) .isEqualTo(firstDump.getRvv()); assertThat(otherDump.getValues()) .as("Values for bucket " + bucketId + " on member " + otherDump.getMember() + " are not consistent with member " + firstDump.getMember()) .isEqualTo(firstDump.getValues()); assertThat(otherDump.getVersions()) .as("Versions for bucket " + bucketId + " on member " + otherDump.getMember() + " are not consistent with member " + firstDump.getMember()) .isEqualTo(firstDump.getVersions()); } } } }</code><technical_language>This validation needs changed....The RVV's maintained local-rvv (local node/member) array of remote-rvvs (all other members). RVVs for member dumps compared</technical_language>

Target:
private void assertRegionBucketsConsistency() throws ForceReattemptException { List<BucketDump> bucketDumps; PartitionedRegion region = (PartitionedRegion) cacheRule.getCache().getRegion(REGION_NAME); int expectedCopies = region.getRedundantCopies() + 1; for (int bId = 0; bId < BUCKETS; bId++) { final int bucketId = bId; bucketDumps = region.getAllBucketEntries(bucketId); assertThat(bucketDumps.size()) .as("Bucket " + bucketId + " should have " + expectedCopies + " copies, but has " + bucketDumps.size()) .isEqualTo(expectedCopies); if (bucketDumps.size() > 1) { BucketDump firstDump = bucketDumps.get(0); for (int j = 1; j < bucketDumps.size(); j++) { BucketDump otherDump = bucketDumps.get(j); assertRegionVersionVectorsConsistency(bucketId, firstDump, otherDump); await().untilAsserted(() -> assertThat(otherDump.getValues()) .as("Values for bucket " + bucketId + " on member " + otherDump.getMember() + " are not consistent with member " + firstDump.getMember()) .isEqualTo(firstDump.getValues())); await().untilAsserted(() -> assertThat(otherDump.getVersions()) .as("Versions for bucket " + bucketId + " on member " + otherDump.getMember() + " are not consistent with member " + firstDump.getMember()) .isEqualTo(firstDump.getVersions())); } } } }
Source:
<code>protected void minify(BufferedReader in, BufferedWriter out, String filename, String type) throws IOException { try { if (JS_TYPE.equals(type)) { jsMinificationService.minifyJs(filename, in, out); } else if (CSS_TYPE.equals(type)) { cssMinificationService.minifyCss(filename, in, out); } else { throw new ResourceMinificationException("Minification is not supported for file: " + filename); } } catch (ResourceMinificationException e) { <START> throw new RuntimeException(e); <END> } }</code><technical_language>throw IOException(e) instead, else check</technical_language>

Target:
protected void minify(BufferedReader in, BufferedWriter out, String filename, String type) throws IOException { try { if (JS_TYPE.equals(type)) { jsMinificationService.minifyJs(filename, in, out); } else if (CSS_TYPE.equals(type)) { cssMinificationService.minifyCss(filename, in, out); } else { throw new ResourceMinificationException("Minification is not supported for file: " + filename); } } catch (ResourceMinificationException e) { throw new IOException(e); } }
Source:
<code>private Optional<CertificationResult> getF3Criterion(CertifiedProductSearchDetails listing) { return listing.getCertificationResults().stream() <START> .filter(crit -> crit.getCriterion().getNumber().equals(certificationCriterionService.get(Criteria2015.F_3).getNumber())) <END> .findAny(); }</code><technical_language>ran trouble Cures updates criterion number identify it... change this compare IDs</technical_language>

Target:
private Optional<CertificationResult> getF3Criterion(CertifiedProductSearchDetails listing) { return listing.getCertificationResults().stream() .filter(crit -> crit.getCriterion().getId().equals(certificationCriterionService.get(Criteria2015.F_3).getId())) .findAny(); }
Source:
<code>public void testNoExceptionEmptyPayload() { utils.logger = mock(Logger.class); utils.logger.warn(anyObject(Throwable.class), anyString()); expectLastCall().andThrow(new IllegalStateException("log spam")); replay(utils.logger); HttpResponse response = HttpResponse.builder().statusCode(NOT_FOUND.getStatusCode()).payload(new StringPayload("")).build(); response.getPayload().getContentMetadata().setContentType("application/unknown"); assertNull(utils.parseAWSErrorFromContent(command.getCurrentRequest(), response)); <START> } <END></code><technical_language>Is test this? purpose of change _not send logs_, avoid parsing a body is empty. Instead of mocking logger, for example mock response.getPayload is called more once? similar helps verify code reached desired execution paths, mess logger</technical_language>

Target:
public void testNoExceptionEmptyPayload() { RequestSigner requestSigner = createMock(RequestSigner.class); ParseSax.Factory factory = createMock(ParseSax.Factory.class); Provider provider = createMock(Provider.class); replay(requestSigner, factory, provider); AWSUtils riggedUtil = new AWSUtils( "ignore", requestSigner, factory, provider ); HttpResponse response = HttpResponse.builder().statusCode(NOT_FOUND.getStatusCode()).payload(new StringPayload("")).build(); response.getPayload().getContentMetadata().setContentType("application/unknown"); assertNull(riggedUtil.parseAWSErrorFromContent(command.getCurrentRequest(), response)); }
Source:
<code>public void doProcessBatch(CoreSession session, List<String> ids, Map<String, Serializable> properties) { ids.forEach(id -> { <START> properties.forEach((e, s) -> session.setDocumentSystemProp(new IdRef(id), e, s)); <END> }); session.save(); }</code><technical_language>rename (e, s) (k, v) for clarity? top of head I e s mean</technical_language>

Target:
public void doProcessBatch(CoreSession session, List<String> ids, Map<String, Serializable> properties) { ids.forEach(id -> properties.forEach((k, v) -> session.setDocumentSystemProp(new IdRef(id), k, v))); session.save(); }
Source:
<code>public <START> static void <END> removeReactorsMap(String vmId){ reactorsMap.remove(vmId); }</code><technical_language>static</technical_language>

Target:
public void removeReactorsMap(String vmId){ clientMap.remove(vmId); }
Source:
<code>public RealmResults<DynamicRealmObject> linkingObjects(String srcClassName, String srcFieldName) { final DynamicRealm realm = (DynamicRealm) proxyState.getRealm$realm(); realm.checkIfValid(); proxyState.getRow$realm().checkIfAttached(); final RealmSchema schema = realm.getSchema(); final RealmObjectSchema realmObjectSchema = schema.get(srcClassName); if (realmObjectSchema == null) { throw new IllegalArgumentException("Class not found: " + srcClassName); } if (srcFieldName != null && srcFieldName.contains(".")) { <START> throw new IllegalArgumentException(MSG_LINK_QUERY_NOT_SUPPORTED); <END> } final RealmFieldType fieldType = realmObjectSchema.getFieldType(srcFieldName); if (fieldType != RealmFieldType.OBJECT && fieldType != RealmFieldType.LIST) { throw new IllegalArgumentException(String.format(Locale.ENGLISH, "Unexpected field type: %1$s. Field type should be either %2$s.%3$s or %2$s.%4$s.", fieldType.name(), RealmFieldType.class.getSimpleName(), RealmFieldType.OBJECT.name(), RealmFieldType.LIST.name())); } return RealmResults.createBacklinkResults(realm, proxyState.getRow$realm(), realmObjectSchema.getTable(), srcFieldName); }</code><technical_language>There, really, is need for defining constants for strings, this. interned compile..</technical_language>

Target:
public RealmResults<DynamicRealmObject> linkingObjects(String srcClassName, String srcFieldName) { final DynamicRealm realm = (DynamicRealm) proxyState.getRealm$realm(); realm.checkIfValid(); proxyState.getRow$realm().checkIfAttached(); final RealmSchema schema = realm.getSchema(); final RealmObjectSchema realmObjectSchema = schema.get(srcClassName); if (realmObjectSchema == null) { throw new IllegalArgumentException("Class not found: " + srcClassName); } if (srcFieldName == null) { throw new IllegalArgumentException("Non-null 'srcFieldName' required."); } if (srcFieldName.contains(".")) { throw new IllegalArgumentException(MSG_LINK_QUERY_NOT_SUPPORTED); } final RealmFieldType fieldType = realmObjectSchema.getFieldType(srcFieldName); if (fieldType != RealmFieldType.OBJECT && fieldType != RealmFieldType.LIST) { throw new IllegalArgumentException(String.format(Locale.ENGLISH, "Unexpected field type: %1$s. Field type should be either %2$s.%3$s or %2$s.%4$s.", fieldType.name(), RealmFieldType.class.getSimpleName(), RealmFieldType.OBJECT.name(), RealmFieldType.LIST.name())); } return RealmResults.createBacklinkResults(realm, (CheckedRow) proxyState.getRow$realm(), realmObjectSchema.getTable(), srcFieldName); }
Source:
<code>void ReplayFormOrientation() { Log.d(LOG_TAG, "ReplayFormOrientation()"); LinkedHashMap<Integer, PercentStorageRecord> temp = (LinkedHashMap<Integer, PercentStorageRecord>) dimChanges.clone(); dimChanges.clear(); <START> for (Integer key : temp.keySet()) { <END> PercentStorageRecord r = temp.get(key); if (r.dim == PercentStorageRecord.Dim.HEIGHT) { r.component.Height(r.length); } else { r.component.Width(r.length); } } }</code><technical_language>iterate keySet(), iterate values(). save do get next line</technical_language>

Target:
void ReplayFormOrientation() { Log.d(LOG_TAG, "ReplayFormOrientation()"); LinkedHashMap<Integer, PercentStorageRecord> temp = (LinkedHashMap<Integer, PercentStorageRecord>) dimChanges.clone(); dimChanges.clear(); for (PercentStorageRecord r : temp.values()) { if (r.dim == PercentStorageRecord.Dim.HEIGHT) { r.component.Height(r.length); } else { r.component.Width(r.length); } } }
Source:
<code>public QueueAsyncClient buildAsyncClient() { <START> Objects.requireNonNull(queueName, "'queueName' cannot be null."); <END> QueueServiceVersion serviceVersion = version != null ? version : QueueServiceVersion.getLatest(); HttpPipeline pipeline = (httpPipeline != null) ? httpPipeline : BuilderHelper.buildPipeline(() -> { if (storageSharedKeyCredential != null) { return new StorageSharedKeyCredentialPolicy(storageSharedKeyCredential); } else if (tokenCredential != null) { return new BearerTokenAuthenticationPolicy(tokenCredential, String.format("%s/.default", endpoint)); } else if (sasTokenCredential != null) { return new SasTokenCredentialPolicy(sasTokenCredential); } else { return null; } }, retryOptions, logOptions, httpClient, additionalPolicies, configuration, serviceVersion); AzureQueueStorageImpl azureQueueStorage = new AzureQueueStorageBuilder() .url(endpoint) .pipeline(pipeline) .version(serviceVersion.getVersion()) .build(); return new QueueAsyncClient(azureQueueStorage, queueName, accountName, serviceVersion); }</code><technical_language>iirc, Utility.assertNotNull</technical_language>

Target:
public QueueAsyncClient buildAsyncClient() { Utility.assertNotNull("queueName", queueName); QueueServiceVersion serviceVersion = version != null ? version : QueueServiceVersion.getLatest(); HttpPipeline pipeline = (httpPipeline != null) ? httpPipeline : BuilderHelper.buildPipeline(() -> { if (storageSharedKeyCredential != null) { return new StorageSharedKeyCredentialPolicy(storageSharedKeyCredential); } else if (tokenCredential != null) { return new BearerTokenAuthenticationPolicy(tokenCredential, String.format("%s/.default", endpoint)); } else if (sasTokenCredential != null) { return new SasTokenCredentialPolicy(sasTokenCredential); } else { return null; } }, retryOptions, logOptions, httpClient, additionalPolicies, configuration, serviceVersion); AzureQueueStorageImpl azureQueueStorage = new AzureQueueStorageBuilder() .url(endpoint) .pipeline(pipeline) .version(serviceVersion.getVersion()) .build(); return new QueueAsyncClient(azureQueueStorage, queueName, accountName, serviceVersion); }
Source:
<code>private int[] calculatePartitions(int[] explicitParts, PartitionResult derivedParts, Object[] args) { if (!F.isEmpty(explicitParts)) return explicitParts; else if (derivedParts != null) { try { Collection<Integer> realParts = derivedParts.tree().apply(args); if (F.isEmpty(realParts)) <START> return new int[0]; <END> else { int[] realParts0 = new int[realParts.size()]; int i = 0; for (Integer realPart : realParts) realParts0[i++] = realPart; return realParts0; } } catch (IgniteCheckedException e) { throw new CacheException("Failed to calculate derived partitions for query.", e); } } return null; }</code><technical_language>IgniteUtils.EMPTY_INTS here</technical_language>

Target:
private int[] calculatePartitions(int[] explicitParts, PartitionResult derivedParts, Object[] args) { if (!F.isEmpty(explicitParts)) return explicitParts; else if (derivedParts != null) { try { Collection<Integer> realParts = derivedParts.tree().apply(args); if (F.isEmpty(realParts)) return IgniteUtils.EMPTY_INTS; else { int[] realParts0 = new int[realParts.size()]; int i = 0; for (Integer realPart : realParts) realParts0[i++] = realPart; return realParts0; } } catch (IgniteCheckedException e) { throw new CacheException("Failed to calculate derived partitions for query.", e); } } return null; }
Source:
<code>public static HostInfo fromBytes(byte[] bytes) throws JSONException { final JSONObject obj = new JSONObject(new String(bytes, StandardCharsets.UTF_8)); <START> return new HostInfo(obj.getString(HOST_IP), obj.getString(GROUP), (int)obj.getLong(LOCAL_SITES_COUNT)); <END> }</code><technical_language>is a getInt variant</technical_language>

Target:
public static HostInfo fromBytes(byte[] bytes) throws JSONException { final JSONObject obj = new JSONObject(new String(bytes, StandardCharsets.UTF_8)); return new HostInfo(obj.getString(HOST_IP), obj.getString(GROUP), obj.getInt(LOCAL_SITES_COUNT)); }
Source:
<code>public CharSequence getPageTitle(int position) { switch (position) { case 0: <START> return "ALL"; <END> case 1: return "FINAL EXAM"; case 2: return "L&S"; default: return "ALL"; } }</code><technical_language>practice: values belong Lombok utility class</technical_language>

Target:
public CharSequence getPageTitle(int position) { switch (position) { case 0: return CalendarTypes.ALL; case 1: return CalendarTypes.FINAL_EXAM; case 2: return CalendarTypes.LS; default: return CalendarTypes.ALL; } }
Source:
<code>public byte[] toBytes(JobId jobId) { String prefix = jobId.getJobPrefix(); <START> if ((StringUtils.isNotBlank(prefix) && (JobId.JOB_PREFIX.equalsIgnoreCase(prefix))) <END> || (StringUtils.isBlank(prefix))) { return Bytes.add(Bytes.toBytes(jobId.getJobEpoch()), Bytes.toBytes(jobId.getJobSequence())); } else { return Bytes.add(Bytes.toBytes(jobId.getJobPrefix()), Bytes.toBytes(jobId.getJobEpoch()), Bytes.toBytes(jobId.getJobSequence())); } }</code><technical_language>I thought JobId.JOB_PREFIX.equalsIgnoreCase(prefix) is needed</technical_language>

Target:
public byte[] toBytes(JobId jobId) { String prefix = jobId.getJobPrefix(); if (StringUtils.isBlank(prefix)) { return Bytes.add(Bytes.toBytes(jobId.getJobEpoch()), Bytes.toBytes(jobId.getJobSequence())); } else { return Bytes.add(Bytes.toBytes(jobId.getJobPrefix()), Bytes.toBytes(jobId.getJobEpoch()), Bytes.toBytes(jobId.getJobSequence())); } }
Source:
<code>private void mergeExternalStreamStatesToZK(JSONObject jsonObj, VoltLogger log) throws JSONException { JSONObject jsonStates; if (jsonObj.has(EXTERNAL_STREAMS_STATES)) { jsonStates = jsonObj.getJSONObject(EXTERNAL_STREAMS_STATES); } else { jsonStates = new JSONObject(); jsonObj.put(EXTERNAL_STREAMS_STATES, jsonStates); } for (Map.Entry<Integer, Boolean> tableEntry : m_partitionExternalStreamsEnabled.entrySet()) { final String partitionStr = tableEntry.getKey().toString(); if (!jsonStates.has(partitionStr)) { jsonStates.put(partitionStr, tableEntry.getValue()); } else { boolean existing = jsonStates.getBoolean(partitionStr); if (log.isDebugEnabled() && existing != tableEntry.getValue()) { log.debug("Found different external stream states on different hosts for partition " + partitionStr + ". This host has " + tableEntry.getValue()); } <START> jsonStates.put(partitionStr, tableEntry.getValue() & existing); <END> } } }</code><technical_language>Minor want logical && bitwise &? In this case roughly matter much</technical_language>

Target:
private void mergeExternalStreamStatesToZK(JSONObject jsonObj, VoltLogger log) throws JSONException { JSONArray jsonPartitions; Set<Integer> disabledStreamsInJson = new HashSet<>(); if (jsonObj.has(DISABLED_EXTERNAL_STREAMS)) { jsonPartitions = jsonObj.getJSONArray(DISABLED_EXTERNAL_STREAMS); for (int i=0; i<jsonPartitions.length(); i++) { disabledStreamsInJson.add(jsonPartitions.getInt(i)); } } else { jsonPartitions = new JSONArray(); jsonObj.put(DISABLED_EXTERNAL_STREAMS, jsonPartitions); } for (Integer partition : m_disabledExternalStreams) { if (!disabledStreamsInJson.contains(partition)) { jsonPartitions.put(partition); } } }
Source:
<code>public ScaledNumberIndexFieldTypeContext<?, BigDecimal> asBigDecimal() { <START> return new StubScaledNumberIndexFieldTypeContext( BigDecimal.class, defaultsProvider ); <END> }</code><technical_language>Missing <>, this is a raw type</technical_language>

Target:
public ScaledNumberIndexFieldTypeContext<?, BigDecimal> asBigDecimal() { return new StubScaledNumberIndexFieldTypeContext<>( BigDecimal.class, defaultsProvider ); }
Source:
<code>private AsyncTaskManager() { _tasks = new ConcurrentHashMap<Guid, SPMAsyncTask>(); SchedulerUtil scheduler = SchedulerUtilQuartzImpl.getInstance(); scheduler.scheduleAFixedDelayJob(this, "_timer_Elapsed", new Class[] {}, new Object[] {}, Config.<Integer> GetValue(ConfigValues.AsyncTaskPollingRate), Config.<Integer> GetValue(ConfigValues.AsyncTaskPollingRate), TimeUnit.SECONDS); scheduler.scheduleAFixedDelayJob(this, "_cacheTimer_Elapsed", new Class[] {}, new Object[] {}, Config.<Integer> GetValue(ConfigValues.AsyncTaskStatusCacheRefreshRateInSeconds), Config.<Integer> GetValue(ConfigValues.AsyncTaskStatusCacheRefreshRateInSeconds), TimeUnit.SECONDS); _cacheTimeInMinutes = Config.<Integer> GetValue(ConfigValues.AsyncTaskStatusCachingTimeInMinutes); tasksInDbAfterRestart = new ConcurrentHashMap<Guid, List<AsyncTasks>>(); for (AsyncTasks task: DbFacade.getInstance().getAsyncTaskDao().getAll()) { <START> if (NGuid.Empty.equals(task.getVdsmTaskId())) { <END> log.infoFormat("Failing task {0} as it does not have a vdsm id.", task.getTaskId()); failTaskWithoutVdsmId(task); continue; } tasksInDbAfterRestart.putIfAbsent(task.getStoragePoolId(), new ArrayList<AsyncTasks>()); List<AsyncTasks> tasksPerStoragePool = tasksInDbAfterRestart.get(task.getStoragePoolId()); tasksInDbAfterRestart.put(task.getStoragePoolId(), tasksPerStoragePool); tasksPerStoragePool.add(task); } }</code><technical_language>Guid.isNullOrEmpty</technical_language>

Target:
private AsyncTaskManager() { _tasks = new ConcurrentHashMap<Guid, SPMAsyncTask>(); SchedulerUtil scheduler = SchedulerUtilQuartzImpl.getInstance(); scheduler.scheduleAFixedDelayJob(this, "_timer_Elapsed", new Class[] {}, new Object[] {}, Config.<Integer> GetValue(ConfigValues.AsyncTaskPollingRate), Config.<Integer> GetValue(ConfigValues.AsyncTaskPollingRate), TimeUnit.SECONDS); scheduler.scheduleAFixedDelayJob(this, "_cacheTimer_Elapsed", new Class[] {}, new Object[] {}, Config.<Integer> GetValue(ConfigValues.AsyncTaskStatusCacheRefreshRateInSeconds), Config.<Integer> GetValue(ConfigValues.AsyncTaskStatusCacheRefreshRateInSeconds), TimeUnit.SECONDS); _cacheTimeInMinutes = Config.<Integer> GetValue(ConfigValues.AsyncTaskStatusCachingTimeInMinutes); tasksInDbAfterRestart = new ConcurrentHashMap<Guid, List<AsyncTasks>>(); for (AsyncTasks task: DbFacade.getInstance().getAsyncTaskDao().getAll()) { if (Guid.isNullOrEmpty(task.getVdsmTaskId())) { log.infoFormat("Failing task {0} as it does not have a vdsm id.", task.getTaskId()); failTaskWithoutVdsmId(task); continue; } tasksInDbAfterRestart.putIfAbsent(task.getStoragePoolId(), new ArrayList<AsyncTasks>()); List<AsyncTasks> tasksPerStoragePool = tasksInDbAfterRestart.get(task.getStoragePoolId()); tasksInDbAfterRestart.put(task.getStoragePoolId(), tasksPerStoragePool); tasksPerStoragePool.add(task); } }
Source:
<code>public RetryHandler(ForkliftConnectorI connector, File dir) { this.dir = dir; this.connector = connector; this.mapper = new ObjectMapper().registerModule(new JavaTimeModule()) .configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false) <START> .configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false); <END> this.executor = Executors.newScheduledThreadPool(1); cleanup = new Callback<RetryMessage>() { @Override public void handle(RetryMessage msg) { log.info("Cleaning up persistent file {}", msg.getPersistedPath()); final File f = new File(msg.getPersistedPath()); if (f.exists()) f.delete(); } }; new FileScanner(dir).scan().stream() .filter(result -> result.getFilename().startsWith("retry") && result.getFilename().endsWith(".msg")) .forEach(result -> { try { final RetryMessage retryMessage = mapper.readValue(new File(dir, result.getFilename()), RetryMessage.class); executor.schedule(new RetryRunnable(retryMessage, connector, cleanup), Long.parseLong(Integer.toString((int)retryMessage.getProperties().get("forklift-retry-timeout"))), TimeUnit.SECONDS); } catch (Exception e) { log.error("Unable to read file {}", result.getFilename()); } }); }</code><technical_language>fence this one. idea retries is a message re-executed a time time. If bean converted in full lose some data affect message processing</technical_language>

Target:
public RetryHandler(ForkliftConnectorI connector, File dir) { this.dir = dir; this.connector = connector; this.mapper = new ObjectMapper().registerModule(new JavaTimeModule()) .configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false); this.executor = Executors.newScheduledThreadPool(1); cleanup = new Callback<RetryMessage>() { @Override public void handle(RetryMessage msg) { log.info("Cleaning up persistent file {}", msg.getPersistedPath()); final File f = new File(msg.getPersistedPath()); if (f.exists()) f.delete(); } }; new FileScanner(dir).scan().stream() .filter(result -> result.getFilename().startsWith("retry") && result.getFilename().endsWith(".msg")) .forEach(result -> { try { final RetryMessage retryMessage = mapper.readValue(new File(dir, result.getFilename()), RetryMessage.class); executor.schedule(new RetryRunnable(retryMessage, connector, cleanup), Long.parseLong(Integer.toString((int)retryMessage.getProperties().get("forklift-retry-timeout"))), TimeUnit.SECONDS); } catch (Exception e) { log.error("Unable to read file {}", result.getFilename()); } }); }
Source:
<code>public void testStaticMapping() throws IOException, InvalidRoutingDataException { String newRealm = "newRealm"; _testRawRoutingData.put(newRealm, ImmutableSet.of("/newKey")); _msdsServer.stopServer(); _msdsServer = new MockMetadataStoreDirectoryServer(_host, _port, _namespace, _testRawRoutingData); _msdsServer.startServer(); Map<String, List<String>> rawRoutingData = HttpRoutingDataReader.getRawRoutingData(); <START> Assert.assertFalse(rawRoutingData.containsKey(newRealm)); <END> MetadataStoreRoutingData data = HttpRoutingDataReader.getMetadataStoreRoutingData(); Map<String, String> allMappings = data.getAllMappingUnderPath("/"); Map<String, Set<String>> groupedMappings = allMappings.entrySet().stream().collect(Collectors .groupingBy(Map.Entry::getValue, Collectors.mapping(Map.Entry::getKey, Collectors.toSet()))); Assert.assertFalse(groupedMappings.containsKey(newRealm)); }</code><technical_language>If "should return data static", I is important check check data is returned. assert rawRoutingData equals _rawRoutingData</technical_language>

Target:
public void testStaticMapping() throws IOException, InvalidRoutingDataException { String newRealm = "newRealm"; _testRawRoutingData.put(newRealm, ImmutableSet.of("/newKey")); _msdsServer.stopServer(); _msdsServer = new MockMetadataStoreDirectoryServer(_host, _port, _namespace, _testRawRoutingData); _msdsServer.startServer(); Map<String, List<String>> rawRoutingData = HttpRoutingDataReader.getRawRoutingData(); Assert.assertFalse(rawRoutingData.containsKey(newRealm)); _testRawRoutingData.remove(newRealm); Assert.assertEquals(rawRoutingData.keySet(), _testRawRoutingData.keySet()); _testRawRoutingData.forEach((realm, keys) -> Assert .assertEquals(new HashSet(rawRoutingData.get(realm)), new HashSet(keys))); MetadataStoreRoutingData data = HttpRoutingDataReader.getMetadataStoreRoutingData(); Map<String, String> allMappings = data.getAllMappingUnderPath("/"); Map<String, Set<String>> groupedMappings = allMappings.entrySet().stream().collect(Collectors .groupingBy(Map.Entry::getValue, Collectors.mapping(Map.Entry::getKey, Collectors.toSet()))); Assert.assertFalse(groupedMappings.containsKey(newRealm)); }
Source:
<code>private String getDefaultAlbumList() { try { return new String(Files.readAllBytes(Paths.get(getClass().getClassLoader().getResource("fallback-album-list.json").toURI()))); } catch (Exception e) { <START> e.printStackTrace(); <END> } return null; }</code><technical_language>log this instead of printStackTrace</technical_language>

Target:
private String getDefaultAlbumList() { try { return new String(Files.readAllBytes(Paths.get(getClass().getClassLoader().getResource("fallback-album-list.json").toURI()))); } catch (Exception e) { LOGGER.error("error occurred while reading the file", e); } return null; }
Source:
<code>public static boolean eventsMatch(final Event e1, final Event e2) { if (e1 == e2) { return true; } if (e1 == null || e2 == null) { return false; } if (e1.getUei() != e2.getUei() && (e1.getUei() == null || e2.getUei() == null || !e1.getUei().equals(e2.getUei()))) { return false; } <START> if (!e1.getNodeid().equals(e2.getNodeid())) { <END> return false; } if (e1.getInterface() != e2.getInterface() && (e1.getInterface() == null || e2.getInterface() == null || !e1.getInterface().equals(e2.getInterface()))) { return false; } if (e1.getService() != e2.getService() && (e1.getService() == null || e2.getService() == null || !e1.getService().equals(e2.getService()))) { return false; } return true; }</code><technical_language>if/when e1.getNodeid() is null</technical_language>

Target:
public static boolean eventsMatch(final Event e1, final Event e2) { if (e1 == e2) { return true; } if (e1 == null || e2 == null) { return false; } if (e1.getUei() != e2.getUei() && (e1.getUei() == null || e2.getUei() == null || !e1.getUei().equals(e2.getUei()))) { return false; } if ((long)e1.getNodeid() != (long)e2.getNodeid()) { return false; } if (e1.getInterface() != e2.getInterface() && (e1.getInterface() == null || e2.getInterface() == null || !e1.getInterface().equals(e2.getInterface()))) { return false; } if (e1.getService() != e2.getService() && (e1.getService() == null || e2.getService() == null || !e1.getService().equals(e2.getService()))) { return false; } return true; }
Source:
<code><START> public JsonArray getTsnePlotMetaData(String experimentAccession) { <END> JsonObject result = new JsonObject(); result.add("metadata", getMetadata(experimentAccession)); return result.getAsJsonArray("metadata"); }</code><technical_language>is this method doing? do need a create JSON object, add it, retrieve immediately afterwards? is purpose of this intermediate step</technical_language>

Target:
public JsonArray getTsnePlotMetaData(String experimentAccession) { return getMetadata(experimentAccession); }
Source:
<code>void validateSuccess() { <START> setupHosts(true, true); setupNics(true, false); <END> ValidateTestUtils.runAndAssertValidateSuccess(command); }</code><technical_language>readable. good candidates for parametrization</technical_language>

Target:
void validateSuccess() { setupHosts(HostValid.VALID, HostValid.VALID); setupNics(VdsInterfaceType.MANAGEMENT, VdsInterfaceType.NONE); ValidateTestUtils.runAndAssertValidateSuccess(command); }
Source:
<code>static <T> int lastIndexOfSlice(IndexedSeq<T> t, IndexedSeq<T> slice, int end) { if (end < 0) { return -1; } if (t.isEmpty()) { return slice.isEmpty() ? 0 : -1; } if (slice.isEmpty()) { int len = t.length(); return len < end ? len : end; } int p = 0; int result = -1; <START> while (t.length() >= p + slice.length()) { <END> int r = findSlice(t, p, slice); if (r < 0) { return result; } if (r <= end) { result = r; p = r + 1; } else { return result; } } return result; }</code><technical_language>Store java final int length = t.length() - slice.length(); java while (p < length) { ... }</technical_language>

Target:
static <T> int lastIndexOfSlice(IndexedSeq<T> t, IndexedSeq<T> slice, int end) { if (end < 0) { return -1; } if (t.isEmpty()) { return slice.isEmpty() ? 0 : -1; } if (slice.isEmpty()) { int len = t.length(); return len < end ? len : end; } int p = 0; int result = -1; final int maxPtr = t.length() - slice.length(); while (p <= maxPtr) { int r = findSlice(t, p, maxPtr, slice); if (r < 0) { return result; } if (r <= end) { result = r; p = r + 1; } else { return result; } } return result; }
Source:
<code>public KijiCell<T> next() { KeyValue kv = mKVs.next(); mNumVersions += 1; KijiCell<T> cell = null; try { <START> cell = new KijiCell<T>(mFamily, mQualifier, <END> kv.getTimestamp(), mDecoder.decodeCell(kv.getValue())); } catch (IOException ex) { throw new RuntimeException(ex.getMessage()); } return cell; }</code><technical_language>return new KijiCell() directly, need variable cell</technical_language>

Target:
public KijiCell<T> next() { KeyValue kv = mKVs.next(); mNumVersions += 1; try { return new KijiCell<T>(mFamily, mQualifier, kv.getTimestamp(), mDecoder.decodeCell(kv.getValue())); } catch (IOException ex) { throw new KijiIOException(ex); } }
Source:
<code>void onNext(ClickEvent event) { <START> GQuery.console.info("next"); <END> next(); }</code><technical_language>debug</technical_language>

Target:
void onNext(ClickEvent event) { next(); }
Source:
<code>public void testAuthorDeleteRelationshipCopyToRightItem() throws Exception { initPublicationAuthor(); getClient(adminAuthToken).perform( delete("/api/core/relationships/" + relationship.getID() + "?copyVirtualMetadata=right")) .andExpect(status().isNoContent()); <START> leftItem = itemService.find(context, leftItem.getID()); <END> List<MetadataValue> authorList = itemService.getMetadata(leftItem, "dc", "contributor", "author", Item.ANY); assertThat(authorList.size(), equalTo(0)); List<MetadataValue> relationshipMetadataList = itemService .getMetadata(leftItem, "relation", "isAuthorOfPublication", null, Item.ANY); assertThat(relationshipMetadataList.size(), equalTo(0)); }</code><technical_language>This testing wrong Item? test Right item, testing leftItem</technical_language>

Target:
public void testAuthorDeleteRelationshipCopyToRightItem() throws Exception { initPublicationAuthor(); getClient(adminAuthToken).perform( delete("/api/core/relationships/" + relationship.getID() + "?copyVirtualMetadata=right")) .andExpect(status().isNoContent()); leftItem = itemService.find(context, leftItem.getID()); List<MetadataValue> authorList = itemService.getMetadata(leftItem, "dc", "contributor", "author", Item.ANY); assertThat(authorList.size(), equalTo(0)); List<MetadataValue> relationshipMetadataList = itemService .getMetadata(leftItem, "relation", "isAuthorOfPublication", null, Item.ANY); assertThat(relationshipMetadataList.size(), equalTo(0)); relationshipMetadataList = itemService .getMetadata(rightItem, "relation", "isPublicationOfAuthor", null, Item.ANY); assertThat(relationshipMetadataList.size(), equalTo(0)); }
Source:
<code><START> public int getItemViewType(int position) <END> { Object currentObject = notifications.get(position); if(currentObject instanceof Notification) { return VIEW_TYPE_NOTIFICAITON; } return 0; }</code><technical_language>FIXME: This returns 0</technical_language>

Target:
public int getItemViewType(int position) { return VIEW_TYPE_NOTIFICAITON; }