auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private void updateBatchCountIfNeeded(Date roundedStartDate) { boolean isNewBatchPeriod = isNewBatchPeriod(roundedStartDate); if (isNewBatchPeriod) { <START> SessionCount prev = batchCount.getAndSet(new SessionCount(roundedStartDate)); <END> if (prev != null && prev.getSessionsStarted() > 0) { enqueuedSessionCounts.add(prev); } } }</code><technical_language>is a race condition of SessionCount objects created for roundedStartDate enqueued</technical_language>

Target:
private void updateBatchCountIfNeeded(Date roundedStartDate) { if (isNewBatchPeriod(roundedStartDate)) { synchronized (batchCount) { if (isNewBatchPeriod(roundedStartDate)) { SessionCount newCount = new SessionCount(roundedStartDate); SessionCount prevCount = batchCount.getAndSet(newCount); if (prevCount != null && prevCount.getSessionsStarted() > 0) { enqueuedSessionCounts.add(prevCount); } } } } }
Source:
<code>ColorConsoleAnnotator(String colorMapName, List<AnsiAttributeElement> openTags) { this.colorMapName = colorMapName; this.openTags = openTags; <START> LOGGER.log(Level.FINE, "creating annotator with colorMapName={0} openTags={2}", new Object[] { colorMapName, openTags }); <END> }</code><technical_language>{1} {2}</technical_language>

Target:
ColorConsoleAnnotator(String colorMapName, List<AnsiAttributeElement> openTags) { this.colorMapName = colorMapName; this.openTags = openTags; LOGGER.log(Level.FINE, "creating annotator with colorMapName={0} openTags={1}", new Object[] { colorMapName, openTags }); }
Source:
<code>private void updateDriverBlockedFuture(ListenableFuture<?> sourceBlockedFuture) { checkState(initialized.get(), "Driver is not initialized"); checkState(Thread.holdsLock(driverBlockedFutureLock), "driverBlockedFutureLock must be held to call updateDriverBlockedFuture"); driverBlockedFuture = SettableFuture.create(); <START> sourceBlockedFuture.addListener(this::completeDriverBlockedFuture, newDirectExecutorService()); <END> }</code><technical_language>need completeDriverBlockedFuture here, is any? I intention is "when sourceBlockedFuture completes, this new driverBlockedFuture complete", new driverBlockedFuture a variable complete that, locks</technical_language>

Target:
private ListenableFuture<?> updateDriverBlockedFuture(ListenableFuture<?> sourceBlockedFuture) { checkState(initialized.get(), "Driver is not initialized"); SettableFuture<?> newDriverBlockedFuture = SettableFuture.create(); driverBlockedFuture.set(newDriverBlockedFuture); sourceBlockedFuture.addListener(() -> newDriverBlockedFuture.set(null), newDirectExecutorService()); return newDriverBlockedFuture; }
Source:
<code>private static Personname formatPatientName(String nameString, EnExplicitFamily lastname, EnExplicitGiven firstname, EnExplicitGiven middlename, EnExplicitPrefix prefix, EnExplicitSuffix suffix) { boolean namefound; Personname personNameDBModel = new Personname(); namefound = checkNameContents(lastname, firstname, middlename, prefix, suffix, personNameDBModel); <START> if (!namefound && !nameString.trim().contentEquals("")) { <END> LOG.info("setting name by nameString " + nameString); personNameDBModel.setLastName(nameString); } return personNameDBModel; }</code><technical_language>StringUtils.isNotEmpty instead</technical_language>

Target:
private static Personname formatPatientName(String nameString, EnExplicitFamily lastname, EnExplicitGiven firstname, EnExplicitGiven middlename, EnExplicitPrefix prefix, EnExplicitSuffix suffix) { boolean namefound; Personname personNameDBModel = new Personname(); namefound = checkNameContents(lastname, firstname, middlename, prefix, suffix, personNameDBModel); if (!namefound && StringUtils.isNotEmpty(nameString)) { LOG.info("setting name by nameString ", nameString); personNameDBModel.setLastName(nameString); } return personNameDBModel; }
Source:
<code>public void instantiationTest() throws IOException { VerifiableProperties verifiableProperties = getVProps(new Properties()); ClusterMap clusterMap = new MockClusterMap(); Coordinator coordinator = new MockCoordinator(verifiableProperties, clusterMap); try { new CoordinatorBackedRouter(null, clusterMap.getMetricRegistry(), coordinator); } catch (IllegalArgumentException e) { } try { new CoordinatorBackedRouter(verifiableProperties, null, coordinator); } catch (IllegalArgumentException e) { } try { new CoordinatorBackedRouter(verifiableProperties, clusterMap.getMetricRegistry(), null); } catch (IllegalArgumentException e) { } Properties properties = new Properties(); <START> properties.setProperty("coordinator.backed.router.operation.pool.size", "0"); <END> verifiableProperties = getVProps(properties); try { new CoordinatorBackedRouter(verifiableProperties, clusterMap.getMetricRegistry(), coordinator); } catch (IllegalArgumentException e) { } try { new CoordinatorOperation(coordinator, new FutureRouterResult<String>(), "@@blobid@@", null, CoordinatorOperationType.PutBlob); } catch (IllegalArgumentException e) { } }</code><technical_language>change other change</technical_language>

Target:
public void instantiationTest() throws IOException { VerifiableProperties verifiableProperties = getVProps(new Properties()); ClusterMap clusterMap = new MockClusterMap(); Coordinator coordinator = new MockCoordinator(verifiableProperties, clusterMap); try { new CoordinatorBackedRouter(null, clusterMap.getMetricRegistry(), coordinator); } catch (IllegalArgumentException e) { } try { new CoordinatorBackedRouter(verifiableProperties, null, coordinator); } catch (IllegalArgumentException e) { } try { new CoordinatorBackedRouter(verifiableProperties, clusterMap.getMetricRegistry(), null); } catch (IllegalArgumentException e) { } Properties properties = new Properties(); properties.setProperty("router.coordinator.backed.router.operation.pool.size", "0"); verifiableProperties = getVProps(properties); try { new CoordinatorBackedRouter(verifiableProperties, clusterMap.getMetricRegistry(), coordinator); } catch (IllegalArgumentException e) { } try { new CoordinatorOperation(coordinator, new FutureRouterResult<String>(), "@@blobid@@", null, CoordinatorOperationType.PutBlob); } catch (IllegalArgumentException e) { } }
Source:
<code>public void dgeqrf(int M, int N, INDArray A, INDArray R, INDArray INFO) { INDArray tau = Nd4j.create( N ) ; int status = LAPACKE_dgeqrf(getColumnOrder(A), M, N, A.data().asNioDouble(), getLda(A), tau.data().asNioDouble() ); if( status != 0 ) { throw new Error( "Failed to execute dgeqrf, code:" + status ) ; } if( R != null ) { for( int ro=0 ; ro<M ; ro++ ) { for( int c=ro ; c<N ; c++ ) { R.putScalar( ro, c, A.getDouble(ro,c) ) ; } } } <START> status = LAPACKE_dorgqr( getColumnOrder(A), M, N, N, <END> A.data().asNioDouble(), getLda(A), tau.data().asNioDouble() ) ; if( status != 0 ) { throw new Error( "Failed to execute dorgqr, code:" + status ) ; } }</code><technical_language>wondering if continue NIO buffers? @saudet a reason for this</technical_language>

Target:
public void dgeqrf(int M, int N, INDArray A, INDArray R, INDArray INFO) { INDArray tau = Nd4j.create( N ) ; int status = LAPACKE_dgeqrf(getColumnOrder(A), M, N, (DoublePointer)A.data().addressPointer(), getLda(A), (DoublePointer)tau.data().addressPointer() ); if( status != 0 ) { throw new BlasException( "Failed to execute dgeqrf", status ) ; } if( R != null ) { R.assign( A.get( NDArrayIndex.interval( 0, A.columns() ), NDArrayIndex.all() ) ) ; INDArrayIndex ix[] = new INDArrayIndex[ 2 ] ; for( int i=1 ; i<Math.min( A.rows(), A.columns() ) ; i++ ) { ix[0] = NDArrayIndex.point( i ) ; ix[1] = NDArrayIndex.interval( 0, i ) ; R.put(ix, 0) ; } } status = LAPACKE_dorgqr( getColumnOrder(A), M, N, N, (DoublePointer)A.data().addressPointer(), getLda(A), (DoublePointer)tau.data().addressPointer() ); if( status != 0 ) { throw new BlasException( "Failed to execute dorgqr", status ) ; } }
Source:
<code>public void close() { Closeables.closeQuietly(ioPool); <START> Closeables.closeQuietly(httpClient); <END> }</code><technical_language>I want do this in reverse order</technical_language>

Target:
public void close() { Closeables.closeQuietly(httpClient); Closeables.closeQuietly(ioPool); }
Source:
<code>URI toIntermediaryDataServerURI(String supervisorTaskId) { return URI.create( StringUtils.format( <START> "http://%s:%d/druid/worker/v1/shuffle/task/%s/%s/partition?startTime=%s&endTime=%s&partitionId=%d", <END> host, port, StringUtils.urlEncode(supervisorTaskId), StringUtils.urlEncode(subTaskId), interval.getStart(), interval.getEnd(), partitionId ) ); }</code><technical_language>if TLS is enabled plaintext port is disabled data server</technical_language>

Target:
URI toIntermediaryDataServerURI(String supervisorTaskId) { return URI.create( StringUtils.format( "%s://%s:%d/druid/worker/v1/shuffle/task/%s/%s/partition?startTime=%s&endTime=%s&partitionId=%d", useHttps ? "https" : "http", host, port, StringUtils.urlEncode(supervisorTaskId), StringUtils.urlEncode(subTaskId), interval.getStart(), interval.getEnd(), partitionId ) ); }
Source:
<code>public StatsManagerMetrics(MetricRegistry registry) { <START> this.registry = registry; <END> statsPublishFailureCount = registry.counter(MetricRegistry.name(StatsManager.class, "StatsPublishFailureCount")); totalFetchAndAggregateTime = registry.histogram(MetricRegistry.name(StatsManager.class, "TotalFetchAndAggregateTime")); fetchAndAggregateTimePerStore = registry.histogram(MetricRegistry.name(StatsManager.class, "FetchAndAggregateTimePerStore")); }</code><technical_language>this need a class member</technical_language>

Target:
public StatsManagerMetrics(MetricRegistry registry) { statsPublishFailureCount = registry.counter(MetricRegistry.name(StatsManager.class, "StatsPublishFailureCount")); totalFetchAndAggregateTime = registry.histogram(MetricRegistry.name(StatsManager.class, "TotalFetchAndAggregateTime")); fetchAndAggregateTimePerStore = registry.histogram(MetricRegistry.name(StatsManager.class, "FetchAndAggregateTimePerStore")); }
Source:
<code>private static boolean hasOnlyInitialization(DetailAST objBlock) { final boolean hasInitBlock = objBlock.findFirstToken(TokenTypes.INSTANCE_INIT) != null; <START> final Predicate<DetailAST> hasMembers = token -> !IGNORED_TYPES.contains(token.getType()); <END> return hasInitBlock && !TokenUtil.findFirstTokenByPredicate(objBlock, hasMembers).isPresent(); }</code><technical_language>sense move this lambda field method method reference ? do methods in class, good lambda, .... need instantiate time</technical_language>

Target:
private static boolean hasOnlyInitialization(DetailAST objBlock) { final boolean hasInitBlock = objBlock.findFirstToken(TokenTypes.INSTANCE_INIT) != null; return hasInitBlock && !TokenUtil.findFirstTokenByPredicate(objBlock, HAS_MEMBERS).isPresent(); }
Source:
<code>public boolean equals(Object o) { if (!(o instanceof DefaultHttp2UnknownFrame)) { return false; } DefaultHttp2UnknownFrame other = (DefaultHttp2UnknownFrame) o; <START> return (stream == other.stream() || stream != null && stream.equals(other.stream())) <END> && flags.equals(other.flags()) && frameType == other.frameType() && super.equals(other); }</code><technical_language>nit: read other.stream() a var</technical_language>

Target:
public boolean equals(Object o) { if (!(o instanceof DefaultHttp2UnknownFrame)) { return false; } DefaultHttp2UnknownFrame other = (DefaultHttp2UnknownFrame) o; Http2FrameStream otherStream = other.stream(); return (stream == otherStream || otherStream != null && otherStream.equals(stream)) && flags.equals(other.flags()) && frameType == other.frameType() && super.equals(other); }
Source:
<code><START> private void unLockIfNecessary(final Contentlet content, final User user) { <END> try { if (content.isLocked()) { ContentletVersionInfo contentletVersionInfo = APILocator.getVersionableAPI().getContentletVersionInfo(content.getIdentifier(), content.getLanguageId()); if (user.getUserId().equals(contentletVersionInfo.getLockedBy())) { conAPI.unlock(content, user, false); } } } catch (DotDataException|DotSecurityException e) { new DotRuntimeException(e); } }</code><technical_language>this in util class</technical_language>

Target:
private void unLockIfNecessary(final Contentlet content, final User user) { try { if (content.isLocked()) { ContentletVersionInfo contentletVersionInfo = APILocator.getVersionableAPI().getContentletVersionInfo(content.getIdentifier(), content.getLanguageId()); if (user.getUserId().equals(contentletVersionInfo.getLockedBy())) { conAPI.unlock(content, user, false); } } } catch (DotDataException|DotSecurityException e) { Logger.error(EditContentletAction.class, e.getMessage(), e); new DotRuntimeException(e); } }
Source:
<code>public void testAddDependencies() { TestableReferenceCollection refColl = new TestableReferenceCollection(null, null, null); String[] array = new String[] {"a.b.c.D"}; refColl.addDependencies(array); char[][][] qualifiedNameReferences = refColl.getQualifiedNameReferences(); assertTrue(Arrays.deepEquals(new char[][][] { CharOperation.splitOn('.', "a.b.c.D".toCharArray()), CharOperation.splitOn('.', "a.b.c".toCharArray()), CharOperation.splitOn('.', "a.b".toCharArray()), CharOperation.splitOn('.', "a".toCharArray()) }, qualifiedNameReferences)); char[][] simpleNameReferences = refColl.getSimpleNameReferences(); <START> assertTrue(Arrays.deepEquals(new <END> char[][] { "D".toCharArray(), "a".toCharArray(), "b".toCharArray(), "c".toCharArray() }, simpleNameReferences)); char[][] rootReferences = refColl.getRootReferences(); assertTrue(Arrays.deepEquals(new char[][] { "a".toCharArray() }, rootReferences)); }</code><technical_language>fail is hard interpret, I improve String arrays instead. indentation is weird in entire file</technical_language>

Target:
public void testAddDependencies() { TestableReferenceCollection refColl = new TestableReferenceCollection(null, null, null); String[] array = new String[] {"a.b.c.D"}; refColl.addDependencies(array); char[][][] qualifiedNameReferences = refColl.getQualifiedNameReferences(); String strings = toStringArray(qualifiedNameReferences); assertArrayEquals(new String[] { "a.b.c.D", "a.b.c", "a.b", "a" }, strings); char[][] simpleNameReferences = refColl.getSimpleNameReferences(); assertArrayEquals(new String[] { "D", "a", "b", "c" }, CharOperation.toStrings(simpleNameReferences)); char[][] rootReferences = refColl.getRootReferences(); assertArrayEquals(new String[] { "a" }, CharOperation.toStrings(rootReferences)); }
Source:
<code>private Set<Integer> calcCacheGroupIds() { Set<Integer> grpIds = new HashSet<>(); Set<String> missingCacheGroups = new HashSet<>(); if (!F.isEmpty(grpNames)) { for (String grpName : grpNames) { CacheGroupContext groupContext = ignite.context().cache().cacheGroup(CU.cacheId(grpName)); if (groupContext == null) { missingCacheGroups.add(grpName); continue; } if (groupContext.sharedGroup()) grpIds.add(groupContext.groupId()); else <START> log.warning("Group[name=" + grpName + "] is not shared one, it couldn't contains garbage from destroyed caches."); <END> } if (!missingCacheGroups.isEmpty()) { StringBuilder strBuilder = new StringBuilder("The following cache groups do not exist: "); for (String name : missingCacheGroups) strBuilder.append(name).append(", "); strBuilder.delete(strBuilder.length() - 2, strBuilder.length()); throw new IgniteException(strBuilder.toString()); } } else { Collection<CacheGroupContext> groups = ignite.context().cache().cacheGroups(); for (CacheGroupContext grp : groups) { if (!grp.systemCache() && !grp.isLocal()) grpIds.add(grp.groupId()); } } return grpIds; }</code><technical_language>"couldn't contain" is correct</technical_language>

Target:
private Set<Integer> calcCacheGroupIds() { Set<Integer> grpIds = new HashSet<>(); Set<String> missingCacheGroups = new HashSet<>(); if (!F.isEmpty(grpNames)) { for (String grpName : grpNames) { CacheGroupContext groupContext = ignite.context().cache().cacheGroup(CU.cacheId(grpName)); if (groupContext == null) { missingCacheGroups.add(grpName); continue; } if (groupContext.sharedGroup()) grpIds.add(groupContext.groupId()); else log.warning("Group[name=" + grpName + "] is not shared one, it couldn't contain garbage from destroyed caches."); } if (!missingCacheGroups.isEmpty()) { StringBuilder strBuilder = new StringBuilder("The following cache groups do not exist: "); for (String name : missingCacheGroups) strBuilder.append(name).append(", "); strBuilder.delete(strBuilder.length() - 2, strBuilder.length()); throw new IgniteException(strBuilder.toString()); } } else { Collection<CacheGroupContext> groups = ignite.context().cache().cacheGroups(); for (CacheGroupContext grp : groups) { if (!grp.systemCache() && !grp.isLocal()) grpIds.add(grp.groupId()); } } return grpIds; }
Source:
<code>public void onEvent(AppendColumnEvent event) { <START> getCurrentContext().getStatus().setColumnId(String.valueOf(new Date().getTime())); <END> getCurrentContext().getStatus().setColumnGroup(event.getColumnGroup()); commonExecution(getCurrentContext(), new AppendColumnCommand(), true); }</code><technical_language>@yesamer Hard demonstrate calls, general rule performances (and I readability) if - instead of invoking multiple times _getter_ - is invoked storing result a method variable (in this case I call _getCurrentContext()_ store result in a _context_ variable). a side note - in this cases, number of lines change (and detected changed git) lesser, impact</technical_language>

Target:
public void onEvent(AppendColumnEvent event) { ScenarioSimulationContext context = getFocusedContext(); context.getStatus().setColumnId(String.valueOf(new Date().getTime())); context.getStatus().setColumnGroup(event.getColumnGroup()); commonExecution(context, new AppendColumnCommand(), true); }
Source:
<code>public void testCacheMetricsNotRemovedOnStop() throws Exception { String cachePrefix = cacheMetricsRegistryName("other-cache", false); checkMetricsEmpty(cachePrefix); createCache("persisted", "other-cache"); grid("client").cache("other-cache").put(1L, 1L); checkMetricsNotEmpty(cachePrefix); grid("client").cluster().state(ClusterState.INACTIVE); checkMetricsNotEmpty(cachePrefix); grid("client").cluster().state(ClusterState.ACTIVE); assertEquals(1L, grid("client").cache("other-cache").get(1L)); checkMetricsNotEmpty(cachePrefix); <START> destroyCache(); <END> }</code><technical_language>cache destroying asserted metric configuration is removed</technical_language>

Target:
public void testCacheMetricsNotRemovedOnStop() throws Exception { String cachePrefix = cacheMetricsRegistryName("other-cache", false); checkMetricsEmpty(cachePrefix); createCache("persisted", "other-cache"); grid("client").cache("other-cache").put(1L, 1L); checkMetricsNotEmpty(cachePrefix); grid("client").cluster().state(ClusterState.INACTIVE); checkMetricsNotEmpty(cachePrefix); grid("client").cluster().state(ClusterState.ACTIVE); assertEquals(1L, grid("client").cache("other-cache").get(1L)); checkMetricsNotEmpty(cachePrefix); destroyCache(); checkMetricsEmpty(cachePrefix); }
Source:
<code>protected void deliverInternal(VoltMessage message) { assert(lockingVows()); logRxMessage(message); boolean canDeliver = m_scheduler.sequenceForReplay(message); if (message instanceof Iv2InitiateTaskMessage) { if (checkMisroutedIv2IntiateTaskMessage((Iv2InitiateTaskMessage)message)) { return; } initiateSPIMigrationIfRequested((Iv2InitiateTaskMessage)message); } else if (message instanceof FragmentTaskMessage) { if (checkMisroutedFragmentTaskMessage((FragmentTaskMessage)message)) { return; } } else if (message instanceof DumpMessage) { hostLog.warn("Received DumpMessage at " + CoreUtils.hsIdToString(m_hsId)); try { m_scheduler.dump(); } catch (Throwable ignore) { hostLog.warn("Failed to dump the content of the scheduler", ignore); } } else if (message instanceof Iv2RepairLogRequestMessage) { handleLogRequest(message); return; } else if (message instanceof Iv2RepairLogResponseMessage) { m_algo.deliver(message); return; } else if (message instanceof RejoinMessage) { m_joinProducer.deliver((RejoinMessage) message); return; } else if (message instanceof RepairLogTruncationMessage) { <START> m_repairLog.deliver(message); <END> if (message.m_sourceHSId != m_hsId) { RepairLogTruncationMessage msg = (RepairLogTruncationMessage)message; ((SpScheduler)m_scheduler).updateRepairLogTruncationHandle(msg.getHandle()); } return; } else if (message instanceof MigratePartitionLeaderMessage) { setMigratePartitionLeaderStatus((MigratePartitionLeaderMessage)message); return; } if (canDeliver) { m_scheduler.deliver(message); } else { m_repairLog.deliver(message); } }</code><technical_language>This protect a replica generating a truncation message</technical_language>

Target:
protected void deliverInternal(VoltMessage message) { assert(lockingVows()); logRxMessage(message); boolean canDeliver = m_scheduler.sequenceForReplay(message); if (message instanceof Iv2InitiateTaskMessage) { if (checkMisroutedIv2IntiateTaskMessage((Iv2InitiateTaskMessage)message)) { return; } initiateSPIMigrationIfRequested((Iv2InitiateTaskMessage)message); } else if (message instanceof FragmentTaskMessage) { if (checkMisroutedFragmentTaskMessage((FragmentTaskMessage)message)) { return; } } else if (message instanceof DumpMessage) { hostLog.warn("Received DumpMessage at " + CoreUtils.hsIdToString(m_hsId)); try { m_scheduler.dump(); } catch (Throwable ignore) { hostLog.warn("Failed to dump the content of the scheduler", ignore); } } else if (message instanceof Iv2RepairLogRequestMessage) { handleLogRequest(message); return; } else if (message instanceof Iv2RepairLogResponseMessage) { m_algo.deliver(message); return; } else if (message instanceof RejoinMessage) { m_joinProducer.deliver((RejoinMessage) message); return; } else if (message instanceof RepairLogTruncationMessage) { m_repairLog.deliver(message); return; } else if (message instanceof MigratePartitionLeaderMessage) { setMigratePartitionLeaderStatus((MigratePartitionLeaderMessage)message); return; } if (canDeliver) { m_scheduler.deliver(message); } else { m_repairLog.deliver(message); } }
Source:
<code>public String toHex(DiscreteElement<?> element) { String hexString; long rawData = ((NumericElement<?>)element).getNumericBitValue(); <START> hexString = Long.toHexString(rawData).toUpperCase(); <END> return hexString; }</code><technical_language>small change running. Add "0x" beginning drive home people hex values</technical_language>

Target:
public String toHex(DiscreteElement<?> element) { String hexString; long rawData = ((NumericElement<?>)element).getNumericBitValue(); hexString = "0x"; hexString += Long.toHexString(rawData).toUpperCase(); return hexString; }
Source:
<code>private static DeploymentInfoResult callCommand(CLIWrapper cli, String command, String serverGroup) { if (cli == null) { throw new IllegalStateException("Cli is not connected! Call connectCli method first!"); } cli.sendLine(command); <START> log.info("Called command: '" + command + "'"); <END> return new DeploymentInfoResult(command, serverGroup, cli.readOutput()); }</code><technical_language>trace</technical_language>

Target:
private static DeploymentInfoResult callCommand(CLIWrapper cli, String command, String serverGroup) { if (cli == null) { throw new IllegalStateException("Cli is not connected! Call connectCli method first!"); } cli.sendLine(command); log.trace("Called command: '" + command + "'"); return new DeploymentInfoResult(command, serverGroup, cli.readOutput()); }
Source:
<code>protected void renderTile(Tile tile, Graphics2D g2d, double[] points) { BufferedImage img = getTileImage(tile); if (img == null) { if (LOGGER.isLoggable(Level.INFO)) LOGGER.info("couldn't draw " + tile.getId()); return; } g2d.drawImage( img, <START> (int) Math.round(points[0]), <END> (int) Math.round(points[1]), (int) Math.round(points[2] - points[0]), (int) Math.round(points[3] - points[1]), null); }</code><technical_language>expect floor ceil - clip needed pixels</technical_language>

Target:
protected void renderTile(Tile tile, Graphics2D g2d, double[] points) { BufferedImage img = getTileImage(tile); if (img == null) { if (LOGGER.isLoggable(Level.INFO)) LOGGER.info("couldn't draw " + tile.getId()); return; } int width = (int) Math.round(points[2] - points[0]); int height = (int) Math.round(points[3] - points[1]); if (width < 1) width = 1; if (height < 1) height = 1; g2d.drawImage( img, (int) Math.round(points[0]), (int) Math.round(points[1]), width, height, null); }
Source:
<code>static public void assertNotEquals(String message, long unexpected, long actual) { if (unexpected == actual) { <START> failEquals(message, actual); <END> } }</code><technical_language>I strongly prefer: failEquals(message, Long.valueOf(actual)) a lot of methods in this class, clear reading this line autoboxing is happening. I knowing autoboxing is happening increases readability. more clear if check</technical_language>

Target:
static public void assertNotEquals(String message, long unexpected, long actual) { if (unexpected == actual) { failEquals(message, Long.valueOf(actual)); } }
Source:
<code>public void testServiceDetailsAll() { <START> String serviceDetailsConfigStr = "serviceDetails = {name = \"" + name + "\", version = \"" + version + "\", instanceId = \"" + instanceId + "\"}"; <END> Config config = ConfigFactory.parseString(serviceDetailsConfigStr); ServiceDetails serviceDetails = new ServiceDetails.Builder(config.getConfig("serviceDetails")).build(); assertEquals("expect \"" + name + "\" as a name value", name, serviceDetails.getName()); assertEquals("expect \"" + version + "\" as a vesrion value", version, serviceDetails.getVersion()); assertEquals("expect \"" + instanceId + "\" as an instanceId value", instanceId, serviceDetails.getInstanceId()); assertNotNull("expect Hostname is not null", serviceDetails.getHostname()); assertNotNull("expect Ip is not null", serviceDetails.getIp()); assertNotNull("expect Pid is not null", serviceDetails.getPid()); }</code><technical_language>I suggest String.format instead of string concatenation for readability reasons</technical_language>

Target:
public void testServiceDetailsAll() { String serviceDetailsConfigStr = String.format("serviceDetails = {name = \"%s\", version = \"%s\", instanceId = \"%s\"}", name, version, instanceId); Config config = ConfigFactory.parseString(serviceDetailsConfigStr); ServiceDetails serviceDetails = new ServiceDetails.Builder(config.getConfig("serviceDetails")).build(); assertEquals("expect \"" + name + "\" as a name value", name, serviceDetails.getName()); assertEquals("expect \"" + version + "\" as a vesrion value", version, serviceDetails.getVersion()); assertEquals("expect \"" + instanceId + "\" as an instanceId value", instanceId, serviceDetails.getInstanceId()); assertNotNull("expect Hostname is not null", serviceDetails.getHostname()); assertNotNull("expect Ip is not null", serviceDetails.getIp()); assertNotNull("expect Pid is not null", serviceDetails.getPid()); }
Source:
<code>public List<PermissionSubject> getPermissionCheckSubjects() { final List<PermissionSubject> permissionList = super.getPermissionCheckSubjects(); if (!StringUtils.isEmpty(getParameters().getCustomProperties())) { permissionList.add(new PermissionSubject(getParameters().getVmId(), VdcObjectType.VM, ActionGroup.CHANGE_VM_CUSTOM_PROPERTIES)); } <START> if (getVm() != null) { <END> final Guid destinationVdsId = getParameters().getDestinationVdsId(); if (destinationVdsId != null && !destinationVdsId.equals(getVm().getDedicatedVmForVds())) { permissionList.add(new PermissionSubject(getParameters().getVmId(), VdcObjectType.VM, ActionGroup.EDIT_VM_PROPERTIES)); } } return permissionList; }</code><technical_language>safe side, I add permission, if getVm() == null (same action group, lines 862-866)</technical_language>

Target:
public List<PermissionSubject> getPermissionCheckSubjects() { final List<PermissionSubject> permissionList = super.getPermissionCheckSubjects(); if (!StringUtils.isEmpty(getParameters().getCustomProperties())) { permissionList.add(new PermissionSubject(getParameters().getVmId(), VdcObjectType.VM, ActionGroup.CHANGE_VM_CUSTOM_PROPERTIES)); } if (getVm() != null) { final Guid destinationVdsId = getParameters().getDestinationVdsId(); if (destinationVdsId != null && !destinationVdsId.equals(getVm().getDedicatedVmForVds())) { permissionList.add(new PermissionSubject(getParameters().getVmId(), VdcObjectType.VM, ActionGroup.EDIT_ADMIN_VM_PROPERTIES)); } } return permissionList; }
Source:
<code>public void setRuleConfigValue(String key, String value) { if (ruleConfigs.containsKey(key)) { ruleConfigs.get(key).setValue(value); this.getConfig().setProperty(key, value); } else { <START> throw new InvalidParameterException("No such key"); <END> } }</code><technical_language>throw IllegalArgumentException instead</technical_language>

Target:
public void setRuleConfigValue(String key, String value) { if (ruleConfigs.containsKey(key)) { ruleConfigs.get(key).setValue(value); this.getConfig().setProperty(key, value); } else { throw new IllegalArgumentException("No such key"); } }
Source:
<code>getXcodeBuildConfigurationsForTargetNode( TargetNode<?> targetNode, ImmutableMap<String, String> appendedConfig) { Optional<ImmutableSortedMap<String, ImmutableMap<String, String>>> configs = Optional.absent(); Optional<TargetNode<AppleNativeTargetDescriptionArg>> appleTargetNode = targetNode.castArg(AppleNativeTargetDescriptionArg.class); Optional<TargetNode<HalideLibraryDescription.Arg>> halideTargetNode = targetNode.castArg(HalideLibraryDescription.Arg.class); if (appleTargetNode.isPresent()) { configs = appleTargetNode.get().getConstructorArg().configs; } else if (halideTargetNode.isPresent()) { configs = halideTargetNode.get().getConstructorArg().configs; } if (!configs.isPresent() || (configs.isPresent() && configs.get().isEmpty()) || targetNode.getType().equals(CxxLibraryDescription.TYPE)) { ImmutableMap<String, ImmutableMap<String, String>> defaultConfig = CxxPlatformXcodeConfigGenerator.getDefaultXcodeBuildConfigurationsFromCxxPlatform( defaultCxxPlatform, appendedConfig); if (isFrameworkTarget(targetNode)) { ImmutableMap.Builder<String, ImmutableMap<String, String>> configBuilder = ImmutableMap.builder(); for (Map.Entry<String, ImmutableMap<String, String>> entry : defaultConfig.entrySet()) { ImmutableMap.Builder<String, String> frameworkConfigs = ImmutableMap.builder(); frameworkConfigs.putAll(entry.getValue()); frameworkConfigs.put("DYLIB_INSTALL_NAME_BASE", "@rpath"); frameworkConfigs.put("SKIP_INSTALL", "YES"); frameworkConfigs.put( "LD_RUNPATH_SEARCH_PATHS", "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"); frameworkConfigs.put("DEFINES_MODULE", "YES"); configBuilder.put(entry.getKey(), frameworkConfigs.build()); } <START> configs = Optional.of(ImmutableSortedMap.copyOf(configBuilder.build())); <END> } else { configs = Optional.of(ImmutableSortedMap.copyOf(defaultConfig)); } } return configs; }</code><technical_language>This means configs ends defaultConfig in them, is intentional</technical_language>

Target:
getXcodeBuildConfigurationsForTargetNode( TargetNode<?> targetNode, ImmutableMap<String, String> appendedConfig) { Optional<ImmutableSortedMap<String, ImmutableMap<String, String>>> configs = Optional.absent(); Optional<TargetNode<AppleNativeTargetDescriptionArg>> appleTargetNode = targetNode.castArg(AppleNativeTargetDescriptionArg.class); Optional<TargetNode<HalideLibraryDescription.Arg>> halideTargetNode = targetNode.castArg(HalideLibraryDescription.Arg.class); if (appleTargetNode.isPresent()) { configs = appleTargetNode.get().getConstructorArg().configs; if (isFrameworkTarget(targetNode)) { configs = appendFrameworkBuildConfigs(configs); } } else if (halideTargetNode.isPresent()) { configs = halideTargetNode.get().getConstructorArg().configs; } if (!configs.isPresent() || (configs.isPresent() && configs.get().isEmpty()) || targetNode.getType().equals(CxxLibraryDescription.TYPE)) { ImmutableMap<String, ImmutableMap<String, String>> defaultConfig = CxxPlatformXcodeConfigGenerator.getDefaultXcodeBuildConfigurationsFromCxxPlatform( defaultCxxPlatform, appendedConfig); configs = Optional.of(ImmutableSortedMap.copyOf(defaultConfig)); } return configs; }
Source:
<code>@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { IgniteConfiguration res = super.getConfiguration(igniteInstanceName); res.setConsistentId(igniteInstanceName); DataStorageConfiguration dsCfg = new DataStorageConfiguration(); dsCfg.setDefaultDataRegionConfiguration( new DataRegionConfiguration() <START> .setMaxSize(1024 * 1024 * 1024) <END> .setPersistenceEnabled(true) ); res.setDataStorageConfiguration(dsCfg); return res; }</code><technical_language>do need this line</technical_language>

Target:
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName); DataStorageConfiguration dsCfg = new DataStorageConfiguration(); dsCfg.setDefaultDataRegionConfiguration( new DataRegionConfiguration() .setPersistenceEnabled(true) ); cfg.setDataStorageConfiguration(dsCfg); cfg.setCacheConfiguration(getCacheConfiguration()); cfg.setClassLoader(withFactory ? getExternalClassLoader() : U.gridClassLoader()); return cfg; }
Source:
<code>public Map getParameterValues() { IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); IProject[] projects = root.getProjects(); Map<String, String> paramValues = new HashMap<String, String>(); for (IProject project : projects) { final boolean notAlreadyShared = RepositoryProvider .getProvider(project) == null; <START> if (project.isAccessible() && notAlreadyShared) { <END> paramValues.put(project.getName(), project.getName()); } } return paramValues; }</code><technical_language>style nit: put braces single line blocks</technical_language>

Target:
public Map getParameterValues() { IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); IProject[] projects = root.getProjects(); Map<String, String> paramValues = new HashMap<String, String>(); for (IProject project : projects) { final boolean notAlreadyShared = RepositoryProvider .getProvider(project) == null; if (project.isAccessible() && notAlreadyShared) paramValues.put(project.getName(), project.getName()); } return paramValues; }
Source:
<code>public void runBeforeAllTests() { test_study1 = new Study(); <START> test_study1.setStudyInstanceUid(null); <END> }</code><technical_language>remove this method. dont reuse variables anyway</technical_language>

Target:
public void runBeforeAllTests() { when(radiologyProperties.getDicomViewerUrl()).thenReturn("http://localhost:8081/weasis-pacs-connector/viewer?"); }
Source:
<code>public void shouldContainErrorMessageAndContainErrorCode128() throws OpenShiftException { <START> IDomain domain; <END> try { domain = DomainTestUtils.ensureHasDomain(user); ApplicationTestUtils.getOrCreateApplication(domain); assertThat(domain.getApplications()).isNotEmpty(); domain.destroy(); fail("OpenShiftEndpointException did not occur"); } catch (OpenShiftEndpointException e) { assertThat(e.getRestResponseMessages().size()).isEqualTo(1); List<Message> messages = e.getRestResponseMessage(IField.DEFAULT); new MessageAssert(messages.get(0)) .hasExitCode(128) .hasSeverity(ISeverity.ERROR) .hasText(); } }</code><technical_language>please dont remove explicit initialization</technical_language>

Target:
public void shouldContainErrorMessageAndContainErrorCode128() throws OpenShiftException { IDomain domain = null; try { domain = DomainTestUtils.ensureHasDomain(user); ApplicationTestUtils.getOrCreateApplication(domain); assertThat(domain.getApplications()).isNotEmpty(); domain.destroy(); fail("OpenShiftEndpointException did not occur"); } catch (OpenShiftEndpointException e) { assertThat(e.getRestResponseMessages().size()).isEqualTo(1); List<Message> messages = e.getRestResponseMessage(IField.DEFAULT); new MessageAssert(messages.get(0)) .hasExitCode(128) .hasSeverity(ISeverity.ERROR) .hasText(); } }
Source:
<code>protected void startCropActivity(Uri uri) { <START> final Context context = new ContextThemeWrapper(getActivity(), R.style.WordPress_NoActionBar); <END> UCrop.Options options = new UCrop.Options(); options.setShowCropGrid(false); options.setStatusBarColor(ContextExtensionsKt.getColorFromAttribute(context, android.R.attr.statusBarColor)); options.setToolbarColor(ContextExtensionsKt.getColorFromAttribute(context, R.attr.wpColorAppBar)); options.setToolbarWidgetColor(ContextExtensionsKt.getColorFromAttribute(context, R.attr.colorOnPrimarySurface)); options.setAllowedGestures(UCropActivity.SCALE, UCropActivity.NONE, UCropActivity.NONE); options.setHideBottomControls(true); UCrop.of(uri, Uri.fromFile(new File(context.getCacheDir(), "cropped.jpg"))) .withAspectRatio(1, 1) .withOptions(options) .start(context, this); }</code><technical_language>removing getActivity() != null check. Is a problem</technical_language>

Target:
protected void startCropActivity(Uri uri) { final Context baseContext = getActivity(); if (baseContext != null) { final Context context = new ContextThemeWrapper(baseContext, R.style.WordPress_NoActionBar); UCrop.Options options = new UCrop.Options(); options.setShowCropGrid(false); options.setStatusBarColor(ContextExtensionsKt.getColorFromAttribute( context, android.R.attr.statusBarColor )); options.setToolbarColor(ContextExtensionsKt.getColorFromAttribute(context, R.attr.wpColorAppBar)); options.setToolbarWidgetColor(ContextExtensionsKt.getColorFromAttribute( context, R.attr.colorOnPrimarySurface )); options.setAllowedGestures(UCropActivity.SCALE, UCropActivity.NONE, UCropActivity.NONE); options.setHideBottomControls(true); UCrop.of(uri, Uri.fromFile(new File(context.getCacheDir(), "cropped.jpg"))) .withAspectRatio(1, 1) .withOptions(options) .start(context, this); } }
Source:
<code>public boolean equals(Object obj) { if (this == obj) { return true; } if (!super.equals(obj)) { return false; } <START> if (!(obj instanceof ModemInterfaceAddressConfigImpl)) { <END> return false; } ModemInterfaceAddressConfigImpl other = (ModemInterfaceAddressConfigImpl) obj; if (m_configs == null) { if (other.m_configs != null) { return false; } } else if (!m_configs.equals(other.m_configs)) { return false; } return true; }</code><technical_language>This checked earlier I</technical_language>

Target:
public boolean equals(Object obj) { if (this == obj) { return true; } if (!(obj instanceof ModemInterfaceAddressConfigImpl)) { return false; } if (!super.equals(obj)) { return false; } ModemInterfaceAddressConfigImpl other = (ModemInterfaceAddressConfigImpl) obj; if (m_configs == null) { if (other.m_configs != null) { return false; } } else if (!m_configs.equals(other.m_configs)) { return false; } return true; }
Source:
<code>public boolean addPotionEffect(PotionEffect effect, boolean force) { if (potionEffects.containsKey(effect.getType())) { if (force) { removePotionEffect(effect.getType()); } else { return false; } } potionEffects.put(effect.getType(), effect); <START> updatePotionEffectsMetadata(); <END> EntityEffectMessage msg = new EntityEffectMessage(getEntityId(), effect.getType().getId(), effect.getAmplifier(), effect.getDuration(), effect.hasParticles(), effect.isAmbient()); for (GlowPlayer player : world.getRawPlayers()) { if (player.canSeeEntity(this) || player == this) { player.getSession().send(msg); } } return true; }</code><technical_language>update calls done in pulse messages held anyway, instead of in addPotionEffect removePotionEffect</technical_language>

Target:
public boolean addPotionEffect(PotionEffect effect, boolean force) { if (potionEffects.containsKey(effect.getType())) { if (force) { removePotionEffect(effect.getType()); } else { return false; } } potionEffects.put(effect.getType(), effect); potionEffectsChanged = true; EntityEffectMessage msg = new EntityEffectMessage(getEntityId(), effect.getType().getId(), effect.getAmplifier(), effect.getDuration(), effect.hasParticles(), effect.isAmbient()); for (GlowPlayer player : world.getRawPlayers()) { if (player.canSeeEntity(this) || player == this) { player.getSession().send(msg); } } return true; }
Source:
<code>public void insertLine(final int line, final String text) { log.info("Insert text to editor at line " + line); try { String delimiter = TextEditorHandler.getInstance() .getDocument((ITextEditor)getEditorPart()).getLineDelimiter(line); <START> delimiter = delimiter == null ? "" : delimiter; <END> insertText(line, 0, text + delimiter); } catch (BadLocationException e) { throw new WorkbenchLayerException("Line provided is invalid for this editor", e); } }</code><technical_language>Maybe, nice consider adding os dependent line separator in cases, code is insert line, is separator. Instead of empty string I System.getProperty("line.separator") consider purpose of getLineDelimiter(), @rawagner wdyt, Is case dont want insert os dependent line separator in text editors</technical_language>

Target:
public void insertLine(final int line, final String text) { log.info("Insert text to editor at line " + line); try { String delimiter = TextEditorHandler.getInstance() .getDocument((ITextEditor)getEditorPart()).getLineDelimiter(line); delimiter = delimiter == null ? System.lineSeparator() : delimiter; insertText(line, 0, text + delimiter); } catch (BadLocationException e) { throw new WorkbenchLayerException("Line provided is invalid for this editor", e); } }
Source:
<code>protected void getProjectDetails(IProgressMonitor monitor, GerritConfig gerritConfig, List<Project> result) throws GerritException { <START> List<ProjectDetailX> projectDetails = restClient.execute(monitor, new Operation<List<ProjectDetailX>>(client) { <END> @Override public void execute(IProgressMonitor monitor) throws GerritException { getProjectAdminService(monitor).visibleProjectDetails(this); } }); for (ProjectDetailX projectDetail : projectDetails) { if (!GerritUtil.isPermissionOnlyProject(projectDetail, gerritConfig)) { result.add(projectDetail.project); } } }</code><technical_language>this method simply return this list</technical_language>

Target:
protected List<ProjectDetailX> getProjectDetails(IProgressMonitor monitor, GerritConfig gerritConfig, List<Project> result) throws GerritException { List<ProjectDetailX> projectDetails = restClient.execute(monitor, new Operation<List<ProjectDetailX>>(client) { @Override public void execute(IProgressMonitor monitor) throws GerritException { getProjectAdminService(monitor).visibleProjectDetails(this); } }); return projectDetails; }
Source:
<code>public Field extract(Element element) throws InvalidElementException { DataField fieldInfo = element.getAnnotation(DataField.class); if (fieldInfo == null) { throw new InvalidElementException( "DataField annotation not found on element." ); } <START> return Field.builder() .name(extractFieldName(element)) .type(extractFieldType(element)) .defaultValue(extractDefaultValue(element)) .docString(extractDocComment(element)) .annotations(extractAnnotations(element)) .modifiersToString(extractModifiers(element)) .getter(fieldInfo.getter()) .setter(fieldInfo.setter()) .match(fieldInfo.match()) .unique(fieldInfo.unique()) .searchable(fieldInfo.searchable()) .nullable(fieldInfo.nullable()) .build(); <END> }</code><technical_language>previous statement returning line</technical_language>

Target:
public Field extract(Element element) throws InvalidElementException { DataField fieldInfo = element.getAnnotation(DataField.class); if (fieldInfo == null) { throw new InvalidElementException( "DataField annotation not found on element." ); } Field field = Field.builder() .name(extractFieldName(element)) .type(extractFieldType(element)) .defaultValue(extractDefaultValue(element)) .docString(extractDocComment(element)) .annotations(extractAnnotations(element)) .modifiersToString(extractModifiers(element)) .getter(fieldInfo.getter()) .setter(fieldInfo.setter()) .match(fieldInfo.match()) .unique(fieldInfo.unique()) .searchable(fieldInfo.searchable()) .nullable(fieldInfo.nullable()) .build(); return field; }
Source:
<code>public void updateCapability(Capability capability) { synchronized (expectedCapabilityList) { if (capability.getState() == Capability.CapabilityState.EXPECTED) { Optional<Capability> optCapability = expectedCapabilityList.stream() <START> .filter(cap -> cap.getName().equals(capability.getName())) <END> .filter(cap -> cap.getState() == Capability.CapabilityState.AVAILABLE) .filter(cap -> !cap.isSecondCheck()) .findFirst(); if (optCapability.isPresent()) { optCapability.get().setSecondCheck(true); } else { expectedCapabilityList.add(capability); } } else { Optional<Capability> optCapability = expectedCapabilityList.stream() .filter(cap -> cap.getName().equals(capability.getName())) .filter(cap -> cap.getState() == Capability.CapabilityState.EXPECTED) .findFirst(); if (optCapability.isPresent()) { optCapability.get().setState(Capability.CapabilityState.AVAILABLE); optCapability.get().setSecondCheck(true); } else { expectedCapabilityList.add(capability); } } } }</code><technical_language>Lets "capability" instead of "cap" for readability</technical_language>

Target:
public void updateCapability(Capability capability) { synchronized (expectedCapabilityList) { if (capability.getState() == Capability.CapabilityState.EXPECTED) { Optional<Capability> optCapability = expectedCapabilityList.stream() .filter(expCapability -> expCapability.getName().equals(capability.getName())) .filter(expCapability -> expCapability.getState() == Capability.CapabilityState.AVAILABLE) .filter(expCapability -> !expCapability.isSecondCheck()) .findFirst(); if (optCapability.isPresent()) { optCapability.get().setSecondCheck(true); } else { expectedCapabilityList.add(capability); } } else { Optional<Capability> optCapability = expectedCapabilityList.stream() .filter(expCapability -> expCapability.getName().equals(capability.getName())) .filter(expCapability -> expCapability.getState() == Capability.CapabilityState.EXPECTED) .findFirst(); if (optCapability.isPresent()) { optCapability.get().setState(Capability.CapabilityState.AVAILABLE); optCapability.get().setSecondCheck(true); } else { expectedCapabilityList.add(capability); } } } }
Source:
<code>public void addLink(String patientId) { int maxExistingPedigreeID = 0; JSONArray members = (JSONArray) this.data.opt(PEDIGREE_JSON_MEMBERS_KEY); for (Object nodeObj : members) { JSONObject node = (JSONObject) nodeObj; <START> maxExistingPedigreeID = Math.max(maxExistingPedigreeID, node.optInt(PATIENT_NODEID_JSON_KEY, 0) + 1); <END> JSONObject properties = (JSONObject) node.opt(PATIENT_DATA_JSON_KEY); if (properties == null || properties.length() == 0) { continue; } Object id = properties.opt(DefaultPedigree.PATIENT_DATA_PHENOTIPSID_KEY); if (id == null || StringUtils.isBlank(id.toString())) { continue; } if (patientId.equals(id.toString())) { return; } } JSONObject ptProperties = new JSONObject(); ptProperties.put(PATIENT_DATA_PHENOTIPSID_KEY, patientId); JSONObject patientData = new JSONObject(); patientData.put(PATIENT_NODEID_JSON_KEY, maxExistingPedigreeID); patientData.put(PATIENT_DATA_JSON_KEY, ptProperties); patientData.put(PATIENT_NOTINPEDIGREE_KEY, true); members.put(patientData); this.data.put(PEDIGREE_JSON_MEMBERS_KEY, members); }</code><technical_language>+1? If supposed new id for next patient, name is wrong, if supposed existing id, incrementing is wrong</technical_language>

Target:
public void addLink(String patientId) { int maxExistingPedigreeID = 0; JSONArray members = this.data.optJSONArray(PEDIGREE_JSON_MEMBERS_KEY); if (members == null) { return; } for (Object nodeObj : members) { JSONObject node = (JSONObject) nodeObj; maxExistingPedigreeID = Math.max(maxExistingPedigreeID, node.optInt(PATIENT_NODEID_JSON_KEY, 0)); JSONObject properties = node.optJSONObject(PATIENT_DATA_JSON_KEY); if (properties == null || properties.length() == 0) { continue; } String id = properties.optString(DefaultPedigree.PATIENT_DATA_PHENOTIPSID_KEY); if (StringUtils.isBlank(id)) { continue; } if (patientId.equals(id)) { return; } } JSONObject ptProperties = new JSONObject(); ptProperties.put(PATIENT_DATA_PHENOTIPSID_KEY, patientId); JSONObject patientData = new JSONObject(); patientData.put(PATIENT_NODEID_JSON_KEY, maxExistingPedigreeID + 1); patientData.put(PATIENT_DATA_JSON_KEY, ptProperties); patientData.put(PATIENT_NOTINPEDIGREE_KEY, true); members.put(patientData); this.data.put(PEDIGREE_JSON_MEMBERS_KEY, members); }
Source:
<code>public PageCursor openArrayPageCursor( long reference ) { <START> return propertyStore.getArrayStore().openPageCursorForReading( reference ); <END> }</code><technical_language>sort of sense propertyStore.getArrayStore() a field too</technical_language>

Target:
public PageCursor openArrayPageCursor( long reference ) { return propertyArrayStore.openPageCursorForReading( reference ); }