auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private static Predicate<Expression> isListAnyMatch(Predicate<Expression> pred) { return expr -> Optional.ofNullable(expr) <START> .filter(ListLiteral.class::isInstance) <END> .flatMap(lst -> ((ListLiteral) lst).elements().expressions().stream().filter(pred).findFirst()) .isPresent(); }</code><technical_language>I .filter(l -> l.is(Tree.Kind.LIST_LITERAL)) instead</technical_language>

Target:
private static Predicate<Expression> isListAnyMatch(Predicate<Expression> pred) { return expr -> Optional.ofNullable(expr) .filter(e -> e.is(Tree.Kind.LIST_LITERAL)) .flatMap(lst -> ((ListLiteral) lst).elements().expressions().stream().filter(pred).findFirst()) .isPresent(); }
Source:
<code>public IndexConfig getConfig() { <START> return delegate.getConfig(); <END> }</code><technical_language>throw exception here, done in getName. index config is defining decorated index</technical_language>

Target:
public IndexConfig getConfig() { throw newUnsupportedException(); }
Source:
<code>public void start() { if (started.compareAndSet(false, true)) { refreshExecutor.scheduleWithFixedDelay(() -> { try { refreshAndStartQueries(); } catch (Throwable t) { log.error(t, "Error while executing refreshAndStartQueries"); throw t; } <START> <END> lastSchedulingCycleRunTimeMs.getAndSet(System.currentTimeMillis()); }, 1, 1, TimeUnit.MILLISECONDS); } }</code><technical_language>suppress this Exception docs: <LINK_0> Logging sufficient</technical_language>

Target:
public void start() { if (started.compareAndSet(false, true)) { refreshExecutor.scheduleWithFixedDelay(() -> { try { refreshAndStartQueries(); lastSchedulingCycleRunTimeMs.getAndSet(currentTimeMillis()); } catch (Throwable t) { log.error(t, "Error while executing refreshAndStartQueries"); throw t; } }, 1, 1, MILLISECONDS); } }
Source:
<code>protected void connectSensors() { super.connectSensors(); serviceUp = FunctionFeed.builder() .entity(this) .poll(new FunctionPollConfig<Boolean, Boolean>(SERVICE_UP) .period(5, TimeUnit.SECONDS) .callable(new Callable<Boolean>() { @Override public Boolean call() throws Exception { MongoDBClientSupport clientSupport = MongoDBClientSupport.forServer(MongoDBRouterImpl.this); <START> return clientSupport.getServerStatus().get("ok").equals(1.0); <END> } }) .onException(Functions.<Boolean>constant(false))) .poll(new FunctionPollConfig<Integer, Integer>(SHARD_COUNT) .period(5, TimeUnit.SECONDS) .callable(new Callable<Integer>() { public Integer call() throws Exception { MongoDBClientSupport clientSupport = MongoDBClientSupport.forServer(MongoDBRouterImpl.this); return (int) clientSupport.getShardCount(); } }) .onException(Functions.<Integer>constant(0))) .build(); }</code><technical_language>This is in AbstractMongoDBSshDriver.isRunning. This feels right place. feels more consistent MongoDB types FunctionFeed</technical_language>

Target:
protected void connectSensors() { super.connectSensors(); serviceUp = FunctionFeed.builder() .entity(this) .poll(new FunctionPollConfig<Boolean, Boolean>(RUNNING) .period(5, TimeUnit.SECONDS) .callable(new Callable<Boolean>() { @Override public Boolean call() throws Exception { MongoDBClientSupport clientSupport = MongoDBClientSupport.forServer(MongoDBRouterImpl.this); return clientSupport.ping(); } }) .onException(Functions.<Boolean>constant(false))) .poll(new FunctionPollConfig<Boolean, Boolean>(SERVICE_UP) .period(5, TimeUnit.SECONDS) .callable(new Callable<Boolean>() { @Override public Boolean call() throws Exception { MongoDBClientSupport clientSupport = MongoDBClientSupport.forServer(MongoDBRouterImpl.this); return clientSupport.ping() && MongoDBRouterImpl.this.getAttribute(SHARD_COUNT) > 0; } }) .onException(Functions.<Boolean>constant(false))) .poll(new FunctionPollConfig<Integer, Integer>(SHARD_COUNT) .period(5, TimeUnit.SECONDS) .callable(new Callable<Integer>() { public Integer call() throws Exception { MongoDBClientSupport clientSupport = MongoDBClientSupport.forServer(MongoDBRouterImpl.this); return (int) clientSupport.getShardCount(); } }) .onException(Functions.<Integer>constant(-1))) .build(); }
Source:
<code>public void testGroupingSetMixedExpressionAndColumn() { <START> featuresToTest(DATE_TYPE); <END> assertQuery("SELECT suppkey, month(shipdate), SUM(CAST(quantity AS BIGINT)) FROM lineitem GROUP BY month(shipdate), ROLLUP(suppkey)", "SELECT suppkey, month(shipdate), SUM(CAST(quantity AS BIGINT)) FROM lineitem GROUP BY month(shipdate), suppkey UNION ALL " + "SELECT NULL, month(shipdate), SUM(CAST(quantity AS BIGINT)) FROM lineitem GROUP BY month(shipdate)"); }</code><technical_language>hard assume testGroupingSetMixedExpressionAndColumn tests ... "date data type". not. tests "grouping set ...." "date data type" is technical requirement for a test. separate aspects for clarity. For example annotations: @TestedFeatures(GROUPING_SET) @RequiredFeatures(DATE_TYPE) ideally, refactor tests @RequiredFeatures is needed. Of course, do now, keeping separate identify depart this ideal state, improve</technical_language>

Target:
public void testGroupingSetMixedExpressionAndColumn() { requiredFeatures(DATE_TYPE); assertQuery("SELECT suppkey, month(shipdate), SUM(CAST(quantity AS BIGINT)) FROM lineitem GROUP BY month(shipdate), ROLLUP(suppkey)", "SELECT suppkey, month(shipdate), SUM(CAST(quantity AS BIGINT)) FROM lineitem GROUP BY month(shipdate), suppkey UNION ALL " + "SELECT NULL, month(shipdate), SUM(CAST(quantity AS BIGINT)) FROM lineitem GROUP BY month(shipdate)"); }
Source:
<code>public void addQc(Sample sample, SampleQC qc) throws IOException { Sample managed = get(sample.getId()); authorizationManager.throwIfNotWritable(managed); qc.setQcCreator(authorizationManager.getCurrentUsername()); <START> if ("Qubit".equals(qc.getQcType().getName()) && managed instanceof DetailedSample) { <END> ((DetailedSample) managed).setConcentration(qc.getResults()); } if ("Volume Check".equals(qc.getQcType().getName())) { managed.setVolume(qc.getResults()); } managed.addQc(qc); sampleDao.save(managed); }</code><technical_language>need a do this, fine for now</technical_language>

Target:
public void addQc(Sample sample, SampleQC qc) throws IOException { Sample managed = get(sample.getId()); authorizationManager.throwIfNotWritable(managed); qc.setQcCreator(authorizationManager.getCurrentUsername()); managed.addQc(qc); sampleDao.save(managed); }
Source:
<code>void recordMetric(TableReference tableRef, long value) { <START> String tableSpecificMetric = getTableSpecificName(name, tableRef); <END> metricRegistry.histogram(tableSpecificMetric).update(value); metricRegistry.histogram(aggregateMetric()).update(value); }</code><technical_language>reason this is inlined</technical_language>

Target:
void recordMetric(TableReference tableRef, long value) { metricRegistry.histogram(getTableSpecificName(name, tableRef)).update(value); metricRegistry.histogram(aggregateMetric()).update(value); }
Source:
<code>protected String getSubnetBadFormatMessage() { <START> return isPrefixSupported ? getBadMaskFormatMessage() : getBadNetmaskFormatMessage(); <END> }</code><technical_language>This "Done"</technical_language>

Target:
protected String getSubnetBadFormatMessage() { return isPrefixAllowed ? getBadPrefixFormatMessage() : getBadNetmaskFormatMessage(); }
Source:
<code>public void uploadProjectFile(Project project, int version, String filetype, String filename, File localFile, String uploader) throws ProjectManagerException { long startMs = System.currentTimeMillis(); logger.info("Uploading to " + project.getName() + " version:" + version + " file:" + filename); <START> Connection connection = getConnection(); <END> try { uploadProjectFile(connection, project, version, filetype, filename, localFile, uploader); connection.commit(); logger.info("project " + project.getName() + " commiting upload " + localFile.getName() + " takes " + ((System.currentTimeMillis() - startMs) / 1000) + " seconds."); } catch (SQLException e) { logger.error(e); throw new ProjectManagerException("Error getting DB connection.", e); } finally { DbUtils.closeQuietly(connection); } }</code><technical_language>do need profile time getConnection()</technical_language>

Target:
public void uploadProjectFile(Project project, int version, String filetype, String filename, File localFile, String uploader) throws ProjectManagerException { long startMs = System.currentTimeMillis(); logger.info("Uploading to " + project.getName() + " version:" + version + " file:" + filename); Connection connection = getConnection(); try { uploadProjectFile(connection, project, version, filetype, filename, localFile, uploader); connection.commit(); logger.info("project " + project.getName() + " commiting upload " + localFile.getName() + " took " + ((System.currentTimeMillis() - startMs) / 1000) + " seconds."); } catch (SQLException e) { logger.error(e); throw new ProjectManagerException("Error getting DB connection.", e); } finally { DbUtils.closeQuietly(connection); } }
Source:
<code><START> OptionalLong lastAckedOffset(TopicPartition topicPartition) { <END> TopicPartitionEntry entry = topicPartitions.get(topicPartition); if (entry != null && entry.lastAckedOffset != ProduceResponse.INVALID_OFFSET) return OptionalLong.of(entry.lastAckedOffset); else return OptionalLong.empty(); }</code><technical_language>nit: functions private if do intention accessed other classes</technical_language>

Target:
private OptionalLong lastAckedOffset(TopicPartition topicPartition) { TopicPartitionEntry entry = topicPartitions.get(topicPartition); if (entry != null && entry.lastAckedOffset != ProduceResponse.INVALID_OFFSET) return OptionalLong.of(entry.lastAckedOffset); else return OptionalLong.empty(); }
Source:
<code>public void policyCacheEntryGetsEvictedOnFlowDisposal() throws Exception { <START> Thread.sleep(2000); <END> ((Flow) getFlowConstruct("main")).dispose(); check(5000, 1000, () -> processorWasDisposed.get()); }</code><technical_language>if need wait for flow kicked in some times, a latch instead of sleep</technical_language>

Target:
public void policyCacheEntryGetsEvictedOnFlowDisposal() throws Exception { messageSentTimer.await(2, SECONDS); ((Flow) getFlowConstruct("main")).dispose(); check(5000, 1000, () -> processorWasDisposed.get()); }
Source:
<code>public Collection<CraftingRecipe> getRecipes() { <START> return Streams.stream(CraftingManager.REGISTRY.iterator()).map(CraftingRecipe.class::cast).collect(Collectors.toList()); <END> }</code><technical_language>collect(ImmutableList.toImmutableList())</technical_language>

Target:
public Collection<CraftingRecipe> getRecipes() { return Streams.stream(CraftingManager.REGISTRY.iterator()).map(CraftingRecipe.class::cast).collect(ImmutableList.toImmutableList()); }
Source:
<code>private synchronized void completeWithError(Throwable error) { if (error instanceof InterpreterException && null != error.getCause()) { error = error.getCause(); } <START> setResult(new InterpreterResult(Code.ERROR, getStack(error))); <END> setException(error); dateFinished = new Date(); }</code><technical_language>do need return stack result? a bit user. message log exception</technical_language>

Target:
private synchronized void completeWithError(Throwable error) { setResult(new InterpreterResult(Code.ERROR, getStack(error))); setException(error); dateFinished = new Date(); }
Source:
<code>public void testWriteAndReadJoinConsistency() throws Exception { for (Locator locator : locatorToMetrics.keySet()) { List<IMetric> metrics = locatorToMetrics.get(locator); for (IMetric metric : metrics) { ResultSetFuture future = dEnumIO.putAsync(locator, metric.getCollectionTime(), (Rollup) metric.getMetricValue(), Granularity.FULL, metric.getTtlInSeconds()); future.getUninterruptibly(); } } Range range = getRangeFromMinAgoToNow(5); for ( Locator locator : locatorToMetrics.keySet() ) { List<ResultSetFuture> results = dEnumIO.selectForLocatorAndRange(CassandraModel.CF_METRICS_PREAGGREGATED_FULL_NAME, locator, range); Assert.assertEquals("ResultSetFuture list size", 2, results.size()); Table<Locator, Long, Object> locatorRollup = dEnumIO.toLocatorTimestampValue( results, locator, Granularity.FULL ); <START> Map<Long, Object> resultMap = locatorRollup.row(locator); <END> List<IMetric> expectedMetrics = locatorToMetrics.get(locator); Assert.assertEquals("rollup size", expectedMetrics.size(), resultMap.size()); IMetric expectedMetric = expectedMetrics.get(0); Rollup resultRollup = (Rollup)resultMap.get(expectedMetric.getCollectionTime()); Assert.assertEquals("rollup object for locator " + locator, expectedMetric.getMetricValue(), resultRollup); } }</code><technical_language>need stay Map<Long, Object></technical_language>

Target:
public void testWriteAndReadJoinConsistency() throws Exception { for (Locator locator : locatorToMetrics.keySet()) { List<IMetric> metrics = locatorToMetrics.get(locator); for (IMetric metric : metrics) { ResultSetFuture future = dEnumIO.putAsync(locator, metric.getCollectionTime(), (Rollup) metric.getMetricValue(), Granularity.FULL, metric.getTtlInSeconds()); future.getUninterruptibly(); } } Range range = getRangeFromMinAgoToNow(5); for ( Locator locator : locatorToMetrics.keySet() ) { List<ResultSetFuture> results = dEnumIO.selectForLocatorAndRange(CassandraModel.CF_METRICS_PREAGGREGATED_FULL_NAME, locator, range); Assert.assertEquals("ResultSetFuture list size", 2, results.size()); Table<Locator, Long, Rollup> locatorRollup = dEnumIO.toLocatorTimestampValue( results, locator, Granularity.FULL ); Map<Long, Rollup> resultMap = locatorRollup.row(locator); List<IMetric> expectedMetrics = locatorToMetrics.get(locator); Assert.assertEquals("rollup size", expectedMetrics.size(), resultMap.size()); IMetric expectedMetric = expectedMetrics.get(0); Rollup resultRollup = resultMap.get(expectedMetric.getCollectionTime()); Assert.assertEquals("rollup object for locator " + locator, expectedMetric.getMetricValue(), resultRollup); } }
Source:
<code>private boolean isOverrideType(String type) { <START> return Arrays.asList(OVERRIDE_TYPES).contains(type); <END> }</code><technical_language>set in class variable directly</technical_language>

Target:
private boolean isOverrideType(String type) { return OVERRIDE_TYPES.contains(type); }
Source:
<code>public long getMaxTotalMpResponseSize() { <START> return MpTransactionState.MP_MAX_TOTAL_RESP_SIZE / 3; <END> }</code><technical_language>Max POOL size for MpRoSite is current 20, 3 good enough</technical_language>

Target:
public long getMaxTotalMpResponseSize() { return MpTransactionState.MP_MAX_TOTAL_RESP_SIZE / MpRoSitePool.MAX_POOL_SIZE; }
Source:
<code>public Future<Long> readInto(AsyncWritableChannel asyncWritableChannel, Callback<Long> callback) { ReadIntoCallbackWrapper callbackWrapper = new ReadIntoCallbackWrapper(callback); <START> contentLock.lock(); <END> try { if (!channelOpen.get()) { callbackWrapper.invokeCallback(new ClosedChannelException()); } else if (!channelEmptied.compareAndSet(false, true)) { throw new IllegalStateException("ReadableStreamChannel cannot be read more than once"); } Iterator<ByteBuffer> bufferIterator = buffers.iterator(); while (bufferIterator.hasNext()) { ByteBuffer buffer = bufferIterator.next(); writeContent(asyncWritableChannel, callbackWrapper, buffer); bufferIterator.remove(); } } finally { contentLock.unlock(); } return callbackWrapper.futureResult; }</code><technical_language>need a lock if addContent(). AtomicBoolean compareAndSet method do</technical_language>

Target:
public Future<Long> readInto(AsyncWritableChannel asyncWritableChannel, Callback<Long> callback) { ReadIntoCallbackWrapper callbackWrapper = new ReadIntoCallbackWrapper(callback); if (!channelOpen.get()) { callbackWrapper.invokeCallback(new ClosedChannelException()); } else if (!channelEmptied.compareAndSet(false, true)) { throw new IllegalStateException("ReadableStreamChannel cannot be read more than once"); } int bufferListSize = buffers.size(); for (int i = 0; i < bufferListSize; i++) { writeContent(asyncWritableChannel, callbackWrapper, buffers.get(i), i + 1 == bufferListSize); } return callbackWrapper.futureResult; }
Source:
<code>public void writeTo(StreamOutput out) throws IOException { out.writeVInt(entries.size()); for (Entry entry : entries) { entry.snapshot().writeTo(out); out.writeBoolean(entry.includeGlobalState()); out.writeBoolean(entry.partial()); out.writeByte(entry.state().value()); out.writeVInt(entry.indices().size()); for (IndexId index : entry.indices()) { index.writeTo(out); } out.writeLong(entry.startTime()); out.writeVInt(entry.shards().size()); for (ObjectObjectCursor<ShardId, ShardSnapshotStatus> shardEntry : entry.shards()) { shardEntry.key.writeTo(out); shardEntry.value.writeTo(out); } out.writeLong(entry.repositoryStateId); out.writeOptionalString(entry.failure); out.writeMap(entry.userMetadata); if (out.getVersion().onOrAfter(VERSION_IN_SNAPSHOT_VERSION)) { Version.writeVersion(entry.version, out); } else { out.writeBoolean(SnapshotsService.useShardGenerations(entry.version)); } if (out.getVersion().onOrAfter(DATA_STREAMS_IN_SNAPSHOT)) { <START> out.writeStringArray(entry.dataStreams.toArray(new String[0])); <END> } } }</code><technical_language>writeStringCollection need array trip</technical_language>

Target:
public void writeTo(StreamOutput out) throws IOException { out.writeVInt(entries.size()); for (Entry entry : entries) { entry.snapshot().writeTo(out); out.writeBoolean(entry.includeGlobalState()); out.writeBoolean(entry.partial()); out.writeByte(entry.state().value()); out.writeVInt(entry.indices().size()); for (IndexId index : entry.indices()) { index.writeTo(out); } out.writeLong(entry.startTime()); out.writeVInt(entry.shards().size()); for (ObjectObjectCursor<ShardId, ShardSnapshotStatus> shardEntry : entry.shards()) { shardEntry.key.writeTo(out); shardEntry.value.writeTo(out); } out.writeLong(entry.repositoryStateId); out.writeOptionalString(entry.failure); out.writeMap(entry.userMetadata); if (out.getVersion().onOrAfter(VERSION_IN_SNAPSHOT_VERSION)) { Version.writeVersion(entry.version, out); } else { out.writeBoolean(SnapshotsService.useShardGenerations(entry.version)); } } }
Source:
<code>private void loadUuidsByKey() { Branch branch = analysisMetadataHolder.getBranch().get(); <START> if (branch.getType() != BranchType.LONG) { <END> uuidsByKey = Collections.emptyMap(); return; } uuidsByKey = new HashMap<>(); try (DbSession dbSession = dbClient.openSession(false)) { List<ComponentDto> components = dbClient.componentDao().selectComponentKeysHavingIssuesToMerge(dbSession, analysisMetadataHolder.getUuid()); for (ComponentDto dto : components) { uuidsByKey.computeIfAbsent(removeBranchFromKey(dto.getKey()), s -> new HashSet<>()).add(dto.uuid()); } } }</code><technical_language>I assume class is sense (up caller!)</technical_language>

Target:
private void loadUuidsByKey() { uuidsByKey = new HashMap<>(); try (DbSession dbSession = dbClient.openSession(false)) { List<KeyWithUuidDto> components = dbClient.componentDao().selectComponentKeysHavingIssuesToMerge(dbSession, uuid); for (KeyWithUuidDto dto : components) { uuidsByKey.computeIfAbsent(removeBranchFromKey(dto.key()), s -> new HashSet<>()).add(dto.uuid()); } } }
Source:
<code><START> public void testJdkVersionDetection() throws NoSuchMethodException, InvocationTargetException, IllegalAccessException { <END> assertEquals(1, Constants.getMajorVersion("1.1.2")); assertEquals(8, Constants.getMajorVersion("1.8.2")); assertEquals(9, Constants.getMajorVersion("9.1.1")); assertEquals(11, Constants.getMajorVersion("11.1.1")); }</code><technical_language>nit: need declare exception types calling getMajorVersion directly</technical_language>

Target:
public void testJdkVersionDetection() { assertEquals(1, Constants.getMajorVersion("1.1.2")); assertEquals(8, Constants.getMajorVersion("1.8.2")); assertEquals(9, Constants.getMajorVersion("9.1.1")); assertEquals(11, Constants.getMajorVersion("11.1.1")); }
Source:
<code>ServiceCacheImpl(ServiceDiscoveryImpl<T> discovery, String name, ExecutorService executorService) { Preconditions.checkNotNull(discovery, "discovery cannot be null"); Preconditions.checkNotNull(name, "name cannot be null"); this.discovery = discovery; <START> path = discovery.pathForName(name); <END> cache = CuratorCache.bridgeBuilder(discovery.getClient(), path) .withExecutorService(executorService) .withDataNotCached() .build(); CuratorCacheListener listener = CuratorCacheListener.builder() .forPathChildrenCache(discovery.getClient(), this) .forInitialized(this::initialized) .build(); cache.listenable().addListener(listener); ensureContainers = new EnsureContainers(discovery.getClient(), path); }</code><technical_language>bug in forPathChildrenCache() of CuratorCacheListener. filter root out. I PathChildrenCache report root forPathChildrenCache emulate behavior</technical_language>

Target:
ServiceCacheImpl(ServiceDiscoveryImpl<T> discovery, String name, ExecutorService executorService) { Preconditions.checkNotNull(discovery, "discovery cannot be null"); Preconditions.checkNotNull(name, "name cannot be null"); this.discovery = discovery; String path = discovery.pathForName(name); cache = CuratorCache.bridgeBuilder(discovery.getClient(), path) .withExecutorService(executorService) .withDataNotCached() .build(); CuratorCacheListener listener = CuratorCacheListener.builder() .forPathChildrenCache(path, discovery.getClient(), this) .forInitialized(this::initialized) .build(); cache.listenable().addListener(listener); ensureContainers = new EnsureContainers(discovery.getClient(), path); }
Source:
<code>public URL findResource(String name) { URL url = super.findResource(name); final Channel channel = channel(); if (url != null || channel == null || !channel.isRemoteClassLoadingAllowed()) { return url; } boolean interrupted = false; try { for (int tries = 0; tries < MAX_RETRIES; tries++) { try { if (resourceMap.containsKey(name)) { URLish f = resourceMap.get(name); if (f == null) { return null; } URL u = f.toURL(); if (u != null) { return u; } } invokeResourceLoadTestingHookIfNeeded(); long startTime = System.nanoTime(); ResourceFile r = proxy.getResource2(name); ResourceImageRef image = null; if (r != null) { image = r.image; } channel.resourceLoadingTime.addAndGet(System.nanoTime() - startTime); channel.resourceLoadingCount.incrementAndGet(); if (image == null) { resourceMap.put(name, null); return null; } URLish res = image.resolveURL(channel, name).get(); resourceMap.put(name, res); return res.toURL(); <START> } catch (IOException | InterruptedException | ExecutionException e) { <END> throw new Error("Unable to load resource " + name, e); } catch (RemotingSystemException x) { if (shouldRetry(x)) { interrupted = true; try { Thread.sleep(RETRY_SLEEP_DURATION_MILLISECONDS); } catch (InterruptedException e) { } LOGGER.finer("Handling interrupt while finding resource. Current retry count = " + tries + ", maximum = " + MAX_RETRIES); continue; } throw x; } } } finally { if (interrupted) { Thread.currentThread().interrupt(); } } throw new RuntimeException("Could not load resource " + name + " after " + MAX_RETRIES + " tries."); }</code><technical_language>move InterruptedException next catch statement, is handled retry logic</technical_language>

Target:
public URL findResource(String name) { URL url = super.findResource(name); final Channel channel = channel(); if (url != null || channel == null || !channel.isRemoteClassLoadingAllowed()) { return url; } int tries = 0; while (true) { try { if (resourceMap.containsKey(name)) { URLish f = resourceMap.get(name); if (f == null) { return null; } URL u = f.toURL(); if (u != null) { return u; } } invokeResourceLoadTestingHookIfNeeded(); long startTime = System.nanoTime(); ResourceFile r = proxy.getResource2(name); ResourceImageRef image = null; if (r != null) { image = r.image; } channel.resourceLoadingTime.addAndGet(System.nanoTime() - startTime); channel.resourceLoadingCount.incrementAndGet(); if (image == null) { resourceMap.put(name, null); return null; } URLish res = image.resolveURL(channel, name).get(); resourceMap.put(name, res); return res.toURL(); } catch (IOException | ExecutionException e) { throw new Error("Unable to load resource " + name, e); } catch (InterruptedException | RemotingSystemException x) { tries++; if (shouldRetry(x, tries)) { sleepForRetry(); LOGGER.finer("Handling interrupt while finding resource. Current retry count = " + tries + ", maximum = " + MAX_RETRIES); continue; } throw determineRemotingSystemException(x); } } }
Source:
<code>private boolean matchSourceType(Type sourceType, Type candidateSourceType, Map<TypeVariable, TypeMirror> genericTypesMap) { if ( !isJavaLangObject( candidateSourceType.getTypeMirror() ) ) { TypeMatcher parameterMatcher = new TypeMatcher( Assignability.VISITED_ASSIGNABLE_FROM, genericTypesMap ); if ( !parameterMatcher.visit( candidateSourceType.getTypeMirror(), sourceType.getTypeMirror() ) ) { if ( sourceType.isPrimitive() ) { TypeMirror boxedType = typeUtils.boxedClass( (PrimitiveType) sourceType.getTypeMirror() ).asType(); <START> return parameterMatcher.visit( candidateSourceType.getTypeMirror(), boxedType ); <END> } else { return false; } } } return true; }</code><technical_language>I logically changes in this method correct due return true. However, method is complex big more complex follow changes it. in case default some logic changes</technical_language>

Target:
private boolean matchSourceType(Type sourceType, Type candidateSourceType, Map<TypeVariable, TypeMirror> genericTypesMap) { if ( !isJavaLangObject( candidateSourceType.getTypeMirror() ) ) { TypeMatcher parameterMatcher = new TypeMatcher( Assignability.VISITED_ASSIGNABLE_FROM, genericTypesMap ); if ( !parameterMatcher.visit( candidateSourceType.getTypeMirror(), sourceType.getTypeMirror() ) ) { if ( sourceType.isPrimitive() ) { TypeMirror boxedType = typeUtils.boxedClass( (PrimitiveType) sourceType.getTypeMirror() ).asType(); if ( !parameterMatcher.visit( candidateSourceType.getTypeMirror(), boxedType ) ) { return false; } } else { return false; } } } return true; }
Source:
<code>protected void updateAndPublishWhitelist( final MavenRepository mavenRepository, final boolean notify ) throws IOException { getLogger().debug( "Updating WL of {}.", RepositoryStringUtils.getHumanizedNameString( mavenRepository ) ); try { final PrefixSource prefixSource; if ( mavenRepository.getRepositoryKind().isFacetAvailable( MavenGroupRepository.class ) ) { prefixSource = updateGroupWhitelist( mavenRepository.adaptToFacet( MavenGroupRepository.class ) ); } else if ( mavenRepository.getRepositoryKind().isFacetAvailable( MavenProxyRepository.class ) ) { prefixSource = updateProxyWhitelist( mavenRepository.adaptToFacet( MavenProxyRepository.class ), null ); } else if ( mavenRepository.getRepositoryKind().isFacetAvailable( MavenHostedRepository.class ) ) { prefixSource = updateHostedWhitelist( mavenRepository.adaptToFacet( MavenHostedRepository.class ) ); } else { getLogger().info( "Repository not supported by white-list feature, not updating it.", <START> RepositoryStringUtils.getFullHumanizedNameString( mavenRepository ) ); <END> return; } if ( prefixSource != null ) { if ( notify ) { getLogger().info( "Updated and published white-list of {}.", RepositoryStringUtils.getHumanizedNameString( mavenRepository ) ); } publish( mavenRepository, prefixSource ); } else { if ( notify ) { getLogger().info( "Unpublished white-list of (and is marked for noscrape).", RepositoryStringUtils.getHumanizedNameString( mavenRepository ) ); } unpublish( mavenRepository ); } } catch ( IllegalStateException e ) { getLogger().info( e.getMessage() ); return; } }</code><technical_language>Please stop</technical_language>

Target:
protected void updateAndPublishWhitelist( final MavenRepository mavenRepository, final boolean notify ) throws IOException { getLogger().debug( "Updating white-list of {}", RepositoryStringUtils.getHumanizedNameString( mavenRepository ) ); try { final PrefixSource prefixSource; if ( mavenRepository.getRepositoryKind().isFacetAvailable( MavenGroupRepository.class ) ) { prefixSource = updateGroupWhitelist( mavenRepository.adaptToFacet( MavenGroupRepository.class ) ); } else if ( mavenRepository.getRepositoryKind().isFacetAvailable( MavenProxyRepository.class ) ) { prefixSource = updateProxyWhitelist( mavenRepository.adaptToFacet( MavenProxyRepository.class ), null ); } else if ( mavenRepository.getRepositoryKind().isFacetAvailable( MavenHostedRepository.class ) ) { prefixSource = updateHostedWhitelist( mavenRepository.adaptToFacet( MavenHostedRepository.class ) ); } else { getLogger().info( "Repository unsupported by white-list feature", RepositoryStringUtils.getFullHumanizedNameString( mavenRepository ) ); return; } if ( prefixSource != null ) { if ( notify ) { getLogger().info( "Updated and published white-list of {}", RepositoryStringUtils.getHumanizedNameString( mavenRepository ) ); } publish( mavenRepository, prefixSource ); } else { if ( notify ) { getLogger().info( "Unpublished white-list of (and is marked for noscrape)", RepositoryStringUtils.getHumanizedNameString( mavenRepository ) ); } unpublish( mavenRepository ); } } catch ( IllegalStateException e ) { getLogger().info( e.getMessage() ); return; } }
Source:
<code>public void checkTimeoutNotExhausted() { <START> if (((System.nanoTime() - startTimeInNanos) / 1_000_000) >= timeoutInMilliseconds) { <END> throw new PrestoException(OPTIMIZER_TIMEOUT, format("The optimizer exhausted the time limit of %d ms", timeoutInMilliseconds)); } }</code><technical_language>TimeUnit.NANOSECONDS.toMillis()</technical_language>

Target:
public void checkTimeoutNotExhausted() { if ((NANOSECONDS.toMillis(System.nanoTime() - startTimeInNanos)) >= timeoutInMilliseconds) { throw new PrestoException(OPTIMIZER_TIMEOUT, format("The optimizer exhausted the time limit of %d ms", timeoutInMilliseconds)); } }
Source:
<code>public Observable<ByteBuf> call(Observable<ByteBuf> upstream) { return upstream .collect( new Func0<CountingCollector>() { @Override public CountingCollector call() { return new CountingCollector(); } }, new Action2<CountingCollector, ByteBuf>() { @Override public void call(CountingCollector collector, ByteBuf buf) { collector.count += buf.readableBytes(); if (collector.count <= maxBytes) { int i = buf.readableBytes(); collector.byteBuf.addComponent(buf); <START> collector.byteBuf.writerIndex(collector.byteBuf.writerIndex() + i); <END> } else { collector.byteBuf.release(); buf.release(); throw new TooMuchDataException(); } } } ) .map(new Func1<CountingCollector, ByteBuf>() { @Override public ByteBuf call(CountingCollector collector) { return collector.byteBuf; } }); }</code><technical_language>I CompositeByteBuf overload for addComponent takes a increaseWriterIndex flag, use</technical_language>

Target:
public Observable<ByteBuf> call(Observable<ByteBuf> upstream) { return upstream .collect( new Func0<CompositeByteBuf>() { @Override public CompositeByteBuf call() { return Unpooled.compositeBuffer(); } }, new Action2<CompositeByteBuf, ByteBuf>() { @Override public void call(CompositeByteBuf collector, ByteBuf buf) { long newLength = collector.readableBytes() + buf.readableBytes(); if (newLength <= maxBytes) { collector.addComponent(true, buf); } else { collector.release(); buf.release(); throw new TooMuchDataException("More than " + maxBytes + "B received"); } } } ) .cast(ByteBuf.class); }
Source:
<code>public SchemaBuilder addSingleValueDimension(String dimensionName, DataType dataType, int maxLength, <START> Object defaultNullValue) { <END> _schema.addField(new DimensionFieldSpec(dimensionName, dataType, true, maxLength, defaultNullValue)); return this; }</code><technical_language>Please reformat this</technical_language>

Target:
public SchemaBuilder addSingleValueDimension(String dimensionName, DataType dataType, int maxLength, Object defaultNullValue) { Preconditions.checkArgument(dataType == STRING, "The maxLength field only applies to STRING field right now"); _schema.addField(new DimensionFieldSpec(dimensionName, dataType, true, maxLength, defaultNullValue)); return this; }
Source:
<code>public Call<MwQueryResponse<QueryResult>> request(@NonNull WikiSite wiki, @NonNull PageTitle title, @NonNull Callback cb) { <START> List<PageTitle> titles = new ArrayList<>(); titles.add(title); <END> return request(wiki, cachedService.service(wiki), titles, cb); }</code><technical_language>this client is for a single title, is shared image. skip converting a List pass PageTitle straight though. call service.request(title.toString()) TextUtils.join well. (The PageTitle class overrides toString() return namespace-prefixed title string.)</technical_language>

Target:
public Call<MwQueryResponse<QueryResult>> request(@NonNull WikiSite wiki, @NonNull PageTitle title, @NonNull Callback cb) { return request(wiki, cachedService.service(wiki), title, cb); }
Source:
<code>public static String get() { <START> RequestConfig requestConfig = RequestConfig.custom().setConnectTimeout(1000).build(); <END> HttpClient client = HttpClientBuilder.create().setDefaultRequestConfig(requestConfig) .build(); HttpGet request = new HttpGet(URL); try { HttpResponse response = client.execute(request); JsonNode object = MAPPER.readTree(response.getEntity().getContent()); return object.get(INSTANCE_ID).asText() + "_" + object.get(REGION).asText() + "_" + object.get(ACCOUNT_ID).asText(); } catch (Exception e) { log.trace("Exception trying to execute {}, Exception: ", request, e); } return null; }</code><technical_language>Configure connection timeout? Guess hard if static. Thoughts</technical_language>

Target:
public static String get() { return get(1000); }
Source:
<code>public RemoteFormDefinition(String formName, String formId, String versionString, String downloadUrl, String manifestUrl) { <START> this.formName = formName == null ? null : formName.replaceAll(BasicConsts.INVALID_CHARS, BasicConsts.EMPTY_STRING); <END> this.formId = formId; this.versionString = versionString; this.downloadUrl = downloadUrl; this.manifestUrl = manifestUrl; }</code><technical_language>a this one. I strip needed. form title a period else (e.g., Collect, Aggregate) making consistent</technical_language>

Target:
public RemoteFormDefinition(String formName, String formId, String versionString, String downloadUrl, String manifestUrl) { this.formName = formName; this.formId = formId; this.versionString = versionString; this.downloadUrl = downloadUrl; this.manifestUrl = manifestUrl; }
Source:
<code>public void testRestAccessLog() throws Exception { client.newRequest(String.format("http://localhost:%d/rest/default/key", restServer.getPort())) .content(new StringContentProvider("value")) .header("Content-type", "text/plain; charset=utf-8") .method(HttpMethod.PUT) .send(); String logline = logAppender.getLog(0).toString(); assertTrue(logline, logline.matches("^127\\.0\\.0\\.1 - \\[\\d+/\\w+/\\d+:\\d+:\\d+:\\d+ [+-]\\d+\\] \"PUT /rest/default/key HTTP/1\\.1\" 404 5 65 \\d+ ms$")); <START> logAppender.uninstall(); <END> }</code><technical_language>Unneeded is in teardown</technical_language>

Target:
public void testRestAccessLog() throws Exception { client.newRequest(String.format("http://localhost:%d/rest/default/key", restServer.getPort())) .content(new StringContentProvider("value")) .header("Content-type", "text/plain; charset=utf-8") .method(HttpMethod.PUT) .send(); restServer.stop(); String logline = logAppender.getLog(0).toString(); assertTrue(logline, logline.matches("^127\\.0\\.0\\.1 - \\[\\d+/\\w+/\\d+:\\d+:\\d+:\\d+ [+-]?\\w+\\] \"PUT /rest/default/key HTTP/1\\.1\" 404 \\d+ \\d+ \\d+$")); }
Source:
<code>public void testCreate() { <START> PluginDescriptor pluginDescriptor = mock(DefaultPluginDescriptor.class); <END> when(pluginDescriptor.getPluginClass()).thenReturn(TestPlugin.class.getName()); PluginWrapper pluginWrapper = mock(PluginWrapper.class); when(pluginWrapper.getDescriptor()).thenReturn(pluginDescriptor); when(pluginWrapper.getPluginClassLoader()).thenReturn(getClass().getClassLoader()); DefaultPluginFactory instance = new DefaultPluginFactory(); Plugin result = instance.create(pluginWrapper); assertNotNull(result); assertThat(result, instanceOf(TestPlugin.class)); }</code><technical_language>need change. I feel refactoring action</technical_language>

Target:
public void testCreate() { PluginDescriptor pluginDescriptor = mock(PluginDescriptor.class); when(pluginDescriptor.getPluginClass()).thenReturn(TestPlugin.class.getName()); PluginWrapper pluginWrapper = mock(PluginWrapper.class); when(pluginWrapper.getDescriptor()).thenReturn(pluginDescriptor); when(pluginWrapper.getPluginClassLoader()).thenReturn(getClass().getClassLoader()); DefaultPluginFactory instance = new DefaultPluginFactory(); Plugin result = instance.create(pluginWrapper); assertNotNull(result); assertThat(result, instanceOf(TestPlugin.class)); }
Source:
<code>public boolean isStrict() { <START> return value == STRICT.value ? true : false; <END> }</code><technical_language>sed 's/value == STRICT.value ? true : false/value == STRICT.value/' (Redundant inline if)</technical_language>

Target:
public boolean isStrict() { return value == STRICT.value; }
Source:
<code>public void loadWebPage(String url, Context context) throws Exception { url = "<LINK_0>"; WebView webview = new WebView(context); webview.setBackgroundColor(0x99FFFFFF); final Dialog d = new Dialog(context) { public boolean onKeyDown(int keyCode, KeyEvent event) { if (keyCode == KeyEvent.KEYCODE_BACK) this.dismiss(); return true; } }; webview.setWebViewClient(new WebViewClient() { public boolean shouldOverrideUrlLoading(WebView view, String url) { view.loadUrl(url); return true; } @Override public void onPageFinished(WebView view, String url) { <START> if (url.contains("return")) { <END> d.dismiss(); mixView.repaint(); } else { super.onPageFinished(view, url); } } }); d.requestWindowFeature(Window.FEATURE_NO_TITLE); d.getWindow().setGravity(Gravity.BOTTOM); d.addContentView(webview, new FrameLayout.LayoutParams( LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT, Gravity.BOTTOM)); if(!processUrl(url, mixView)){ d.show(); webview.loadUrl(url); } }</code><technical_language>url.contentEquals("return"); in general some more strict comparison? I safer</technical_language>

Target:
public void loadWebPage(String url, Context context) throws Exception { WebView webview = new WebView(context); webview.setBackgroundColor(0x99FFFFFF); final Dialog d = new Dialog(context) { public boolean onKeyDown(int keyCode, KeyEvent event) { if (keyCode == KeyEvent.KEYCODE_BACK) this.dismiss(); return true; } }; webview.setWebViewClient(new WebViewClient() { public boolean shouldOverrideUrlLoading(WebView view, String url) { view.loadUrl(url); return true; } @Override public void onPageFinished(WebView view, String url) { if (url.endsWith("return")) { d.dismiss(); mixView.repaint(); } else { super.onPageFinished(view, url); } } }); d.requestWindowFeature(Window.FEATURE_NO_TITLE); d.getWindow().setGravity(Gravity.BOTTOM); d.addContentView(webview, new FrameLayout.LayoutParams( LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT, Gravity.BOTTOM)); if(!processUrl(url, mixView)){ d.show(); webview.loadUrl(url); } }
Source:
<code>public DataDrivenRuntimeFsm getRuntimeForFsm(DataDrivenFsm fsm) { <START> return fFsmRuntime.computeIfAbsent(fsm, k -> new DataDrivenRuntimeFsm()); <END> }</code><technical_language>method reference</technical_language>

Target:
public DataDrivenRuntimeFsm getRuntimeForFsm(DataDrivenFsm fsm) { return fFsmRuntime.computeIfAbsent(fsm, dataDrivenRuntimeFsm -> new DataDrivenRuntimeFsm()); }
Source:
<code>public boolean onPreferenceChange(Preference preference, Object newValue) { String key = preference.getKey(); if (key.equals(getString(R.string.preference_key_upload_switch))) { boolean isUploadEnabled = (boolean) newValue; if (isUploadEnabled) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { boolean b = checkReadPermissions(); <START> Log.d("UploadPer","value = " + b); <END> return b; } } toggleUploadSettings(isUploadEnabled); preference.setTitle(getAutoUploadTitle(isUploadEnabled)); } else if (key.equals(getString(R.string.preference_key_upload_hda))) { String session = String.valueOf(newValue); setUpServer(session); if(!session.equals(getHdaPreference().getValue())){ getSharePreference().setSummary(null); getSharePreference().setValue(null); getHdaPreference().setSummary(getHdaPreference().getEntries()[getHdaPreference().findIndexOfValue(session)]); } } else if (key.equals(getString(R.string.preference_key_upload_share))) { getSharePreference().setSummary(String.valueOf(newValue)); getPathPreference().setEnabled(true); getAllowOnDataPreference().setEnabled(true); }else if (key.equals(getString(R.string.preference_key_upload_path))){ String path = String.valueOf(newValue); if(path.isEmpty()){ getPathPreference().setSummary("Select Path"); }else { setUploadPathSummary(String.valueOf(newValue)); } } return true; }</code><technical_language>Remove unnecessary logs</technical_language>

Target:
public boolean onPreferenceChange(Preference preference, Object newValue) { String key = preference.getKey(); if (key.equals(getString(R.string.preference_key_upload_switch))) { boolean isUploadEnabled = (boolean) newValue; if (isUploadEnabled) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { return checkReadPermissions() && areSettingsValid(); } } preference.setTitle(getAutoUploadTitle(isUploadEnabled)); } else if (key.equals(getString(R.string.preference_key_upload_server))) { String session = String.valueOf(newValue); setUpServer(getServer(session)); if (!session.equals(getHdaPreference().getValue())) { getSharePreference().setSummary(getString(R.string.preference_summary_share)); getAutoUploadSwitchPreference().setChecked(false); getAutoUploadSwitchPreference().setTitle(getAutoUploadTitle(isUploadEnabled())); getSharePreference().setValue(null); getHdaPreference().setSummary(getHdaPreference().getEntries()[getHdaPreference().findIndexOfValue(session)]); getSharePreference().setEnabled(false); } } else if (key.equals(getString(R.string.preference_key_upload_share))) { getSharePreference().setSummary(String.valueOf(newValue)); } else if (key.equals(getString(R.string.preference_key_upload_location))) { String location = String.valueOf(newValue); if (location.isEmpty()) { getLocationPreference().setSummary(getString(R.string.preference_summary_location)); } else { setUploadLocationSummary(String.valueOf(newValue)); } } return true; }
Source:
<code>public void connectionChanged(IConnection connection, String property, Object oldValue, Object newValue) { if (!(connection instanceof IOpenShiftConnection)) { return; } if (ConnectionProperties.PROPERTY_PROJECTS.equals(property) && (oldValue instanceof List) && (newValue instanceof List)) { IOpenShiftConnection openshiftConnection = (IOpenShiftConnection) connection; <START> Set<IProjectAdapter> adapters = getCacheFor(openshiftConnection); <END> if(adapters == null) { adapters = createEntry(openshiftConnection); } addAndRemoveAdaptersFor((List<IProject>) newValue, (List<IProject>) oldValue, openshiftConnection, adapters); } }</code><technical_language>i a race-condition 2 threads concurrently query cache create entries #getCacheFor is locking cache #createEntry isnt</technical_language>

Target:
public void connectionChanged(IConnection connection, String property, Object oldValue, Object newValue) { if (!(connection instanceof IOpenShiftConnection)) { return; } if (ConnectionProperties.PROPERTY_PROJECTS.equals(property) && (oldValue instanceof List) && (newValue instanceof List)) { IOpenShiftConnection openshiftConnection = (IOpenShiftConnection) connection; Set<IProjectAdapter> adapters; synchronized (cache) { adapters = getCacheFor(openshiftConnection); if(adapters == null) { adapters = createEntry(openshiftConnection); } } addAndRemoveAdaptersFor((List<IProject>) newValue, (List<IProject>) oldValue, openshiftConnection, adapters); } }
Source:
<code><START> public CallLogWrapper readCallLog() { <END> return new Gson().fromJson((String)execute("readCallLog").getValue(), CallLogWrapper.class); }</code><technical_language>signature List<CallLogEntry> CallLogWrapper / get renamed CallLogUtil static methods in list of call log entries</technical_language>

Target:
public List<CallLogEntry> readCallLog() { return new Gson().fromJson((String)execute("readCallLog").getValue(), new TypeToken<List<CallLogEntry>>(){}.getType()); }
Source:
<code>public JWK rsa(Key key, KeyUse keyUse) { JWK k = rsa(key); String keyUseString = DEFAULT_PUBLIC_KEY_USE; <START> if (KeyUse.ENC == keyUse) keyUseString = "enc"; <END> k.setPublicKeyUse(keyUseString); return k; }</code><technical_language>small suggestion: I this simplified "String keyUseString = keyUse == null ? DEFAULT_PUBLIC_KEY_USE : keyUse.toString();"</technical_language>

Target:
public JWK rsa(Key key, KeyUse keyUse) { JWK k = rsa(key); String keyUseString = keyUse == null ? DEFAULT_PUBLIC_KEY_USE : keyUse.getSpecName(); if (KeyUse.ENC == keyUse) keyUseString = "enc"; k.setPublicKeyUse(keyUseString); return k; }
Source:
<code>protected Map<String, ClientDMNType> getDMNTypesMap(final List<JSITItemDefinition> jsitItemDefinitions, final String nameSpace) { Map<String, ClientDMNType> toReturn = new HashMap<>(); for (BuiltInType type : BuiltInType.values()) { for (String name : type.getNames()) { ClientDMNType feelPrimitiveType; if (type == BuiltInType.CONTEXT) { feelPrimitiveType = new ClientDMNType(URI_FEEL, name, null, false, true, Collections.emptyMap(), type); } else { feelPrimitiveType = new ClientDMNType(URI_FEEL, name, null, false, false, null, type); } toReturn.put(name, feelPrimitiveType); } } final Map<String, JSITItemDefinition> indexed = indexDefinitionsByName(jsitItemDefinitions); for (int i = 0; i < jsitItemDefinitions.size(); i++) { final JSITItemDefinition jsitItemDefinition = Js.uncheckedCast(jsitItemDefinitions.get(i)); toReturn.put(jsitItemDefinition.getName(), getDMNType(indexed, jsitItemDefinition, nameSpace, toReturn)); } <START> toReturn.values().forEach((v) -> { <END> if (indexed.containsKey(v.getName())) { populateItemFields(indexed, Js.uncheckedCast(indexed.get(v.getName())), nameSpace, toReturn); } }); return toReturn; }</code><technical_language>@danielzhe Here, a ConcurrentModificationException thrown, iterates toReturn list modified insidepopulateItemFields(...) method. I dmn file posted @dupliaka <LINK_0></technical_language>

Target:
protected Map<String, ClientDMNType> getDMNTypesMap(final List<JSITItemDefinition> jsitItemDefinitions, final String nameSpace) { Map<String, ClientDMNType> toReturn = new HashMap<>(); for (BuiltInType type : BuiltInType.values()) { for (String name : type.getNames()) { ClientDMNType feelPrimitiveType; if (type == BuiltInType.CONTEXT) { feelPrimitiveType = new ClientDMNType(URI_FEEL, name, null, false, true, Collections.emptyMap(), type); } else { feelPrimitiveType = new ClientDMNType(URI_FEEL, name, null, false, false, null, type); } toReturn.put(name, feelPrimitiveType); } } final Map<String, JSITItemDefinition> indexed = indexDefinitionsByName(jsitItemDefinitions); for (int i = 0; i < jsitItemDefinitions.size(); i++) { final JSITItemDefinition jsitItemDefinition = Js.uncheckedCast(jsitItemDefinitions.get(i)); toReturn.put(jsitItemDefinition.getName(), getDMNType(indexed, jsitItemDefinition, nameSpace, toReturn)); } final Collection<ClientDMNType> values = new ArrayList<>(toReturn.values()); values.forEach((v) -> { if (indexed.containsKey(v.getName())) { populateItemFields(indexed, Js.uncheckedCast(indexed.get(v.getName())), nameSpace, toReturn); } }); return toReturn; }
Source:
<code>void setUp() { <START> fixture = new AggregateTestFixture<>(AggregateA.class).registerSubtype(AggregateB.class) <END> .registerSubtype(AggregateC.class); }</code><technical_language>Class<? extends T>..., exact ;-)</technical_language>

Target:
void setUp() { fixture = new AggregateTestFixture<>(AggregateA.class).withSubtypes(AggregateB.class, AggregateC.class); }
Source:
<code>public AuditLogType getAuditLogTypeValue() { <START> if (getSucceeded()) { <END> return AuditLogType.SYNC_STORAGE_DEVICES_IN_HOST; } else { return AuditLogType.SYNC_STORAGE_DEVICES_IN_HOST_FAILED; } }</code><technical_language>a matter of styling, this written as: return getSucceeded() ? AuditLogType.SYNC_STORAGE_DEVICES_IN_HOST : AuditLogType.SYNC_STORAGE_DEVICES_IN_HOST_FAILED;</technical_language>

Target:
public AuditLogType getAuditLogTypeValue() { return getSucceeded() ? AuditLogType.SYNC_STORAGE_DEVICES_IN_HOST : AuditLogType.SYNC_STORAGE_DEVICES_IN_HOST_FAILED; }