auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public KeycloakConfiguration(final PlatformConfiguration platformConfiguration) { Assert.requireNonNull(platformConfiguration, "platformConfiguration"); this.realmName = platformConfiguration.getProperty(REALM_PROPERTY_NAME, REALM_PROPERTY_DEFAULT_VALUE); this.realmNames = platformConfiguration.getListProperty(REALM_PROPERTY_NAME, Collections.emptyList()); if(this.realmNames.isEmpty()){ this.realmNames.add(this.realmName); <START> } <END> this.applicationName = platformConfiguration.getProperty(APPLICATION_PROPERTY_NAME, APPLICATION_PROPERTY_DEFAULT_VALUE) ; this.authEndpoint = platformConfiguration.getProperty(AUTH_ENDPOINT_PROPERTY_NAME, AUTH_ENDPOINT_PROPERTY_DEFAULT_VALUE) + "/auth"; this.secureEndpoints.addAll(platformConfiguration.getListProperty(SECURE_ENDPOINTS_PROPERTY_NAME, Collections.emptyList())); this.securityActive = platformConfiguration.getBooleanProperty(SECURITY_ACTIVE_PROPERTY_NAME, false); this.loginEndpointActive = platformConfiguration.getBooleanProperty(LOGIN_ENDPOINTS_ACTIVE_PROPERTY_NAME, true); this.loginEndpoint = platformConfiguration.getProperty(LOGIN_ENDPOINTS_PROPERTY_NAME, LOGIN_ENDPOINTS_PROPERTY_DEFAULT_VALUE); }</code><technical_language>wrong. name added is defined: if(this.realmName != null && !this.realmName.isEmpty()){ this.realmNames.add(this.realmName); }</technical_language>

Target:
public KeycloakConfiguration(final PlatformConfiguration platformConfiguration) { Assert.requireNonNull(platformConfiguration, "platformConfiguration"); this.realmName = platformConfiguration.getProperty(REALM_PROPERTY_NAME); this.realmNames = platformConfiguration.getListProperty(REALM_PROPERTY_NAME, Collections.emptyList()); if(this.realmName != null && !this.realmName.isEmpty()){ this.realmNames.add(this.realmName); } this.applicationName = platformConfiguration.getProperty(APPLICATION_PROPERTY_NAME, APPLICATION_PROPERTY_DEFAULT_VALUE) ; this.authEndpoint = platformConfiguration.getProperty(AUTH_ENDPOINT_PROPERTY_NAME, AUTH_ENDPOINT_PROPERTY_DEFAULT_VALUE) + "/auth"; this.secureEndpoints.addAll(platformConfiguration.getListProperty(SECURE_ENDPOINTS_PROPERTY_NAME, Collections.emptyList())); this.securityActive = platformConfiguration.getBooleanProperty(SECURITY_ACTIVE_PROPERTY_NAME, false); this.loginEndpointActive = platformConfiguration.getBooleanProperty(LOGIN_ENDPOINTS_ACTIVE_PROPERTY_NAME, true); this.loginEndpoint = platformConfiguration.getProperty(LOGIN_ENDPOINTS_PROPERTY_NAME, LOGIN_ENDPOINTS_PROPERTY_DEFAULT_VALUE); }
Source:
<code><START> public synchronized Long getLogTail() { <END> return logMetadata.getGlobalTail(); }</code><technical_language>please long need wrap unwrap primitive</technical_language>

Target:
public synchronized long getLogTail() { return logMetadata.getGlobalTail(); }
Source:
<code>private CacheEntry getIfPresent(ImmutableBytesPtr cacheId) { CacheEntry entry = getPersistentServerCaches().getIfPresent(cacheId); if (entry != null) { getServerCaches().put(cacheId, entry); <START> }return getServerCaches().getIfPresent(cacheId); <END> }</code><technical_language>nit: formatting</technical_language>

Target:
private CacheEntry getIfPresent(ImmutableBytesPtr cacheId) { CacheEntry entry = getPersistentServerCaches().getIfPresent(cacheId); if (entry != null) { return entry; } return getServerCaches().getIfPresent(cacheId); }
Source:
<code>public HitbtcExchange(String clientKey, String clientSecret, String preferredFiatCurrency) { super(getSpecification(clientKey, clientSecret), preferredFiatCurrency); <START> this.accountId = accountId; <END> }</code><technical_language>unnecessary</technical_language>

Target:
public HitbtcExchange(String clientKey, String clientSecret, String preferredFiatCurrency) { super(getSpecification(clientKey, clientSecret), preferredFiatCurrency); }
Source:
<code>private static JCQueue createQueue(String name, int queueSize) { List<Integer> taskIds = new ArrayList<>(); taskIds.add(1000); <START> return new JCQueue(name, queueSize, 0, 1, new WaitStrategyPark(0), "test", "test", taskIds, 1000, new StormMetricRegistry()); <END> }</code><technical_language>simplified Collections.singletonList(1000)</technical_language>

Target:
private static JCQueue createQueue(String name, int queueSize) { return new JCQueue(name, queueSize, 0, 1, new WaitStrategyPark(0), "test", "test", Collections.singletonList(1000), 1000, new StormMetricRegistry()); }
Source:
<code>public static ExecutionResult executeCommandWithResult( final Logger logger, final String[] command, final File workingDir, final Map<String,String> environmentVars, final String applicationName, final String scopedInstancePath) throws IOException, InterruptedException { logger.fine( "Executing command: " + Arrays.toString( command )); ProcessBuilder pb = new ProcessBuilder( command ); if( workingDir != null ) pb.directory(workingDir); Map<String,String> env = pb.environment(); if( environmentVars != null && env != null ) { for( Map.Entry<String,String> entry : environmentVars.entrySet()) { if( entry.getKey() != null && entry.getValue() != null ) env.put( entry.getKey(), entry.getValue()); } } StringBuilder normalOutput = new StringBuilder(); StringBuilder errorOutput = new StringBuilder(); int exitValue = -1; Process process = pb.start(); logger.fine("Storing process [" + applicationName + "] [" + scopedInstancePath + "]"); ProcessStore.setProcess(applicationName, scopedInstancePath, process); new Thread( new OutputRunnable( process, true, errorOutput, logger )).start(); new Thread( new OutputRunnable( process, false, normalOutput, logger )).start(); exitValue = process.waitFor(); if( exitValue != 0 ) logger.warning( "Command execution returned a non-zero code. Code:" + exitValue ); <START> ProcessStore.clearProcess(applicationName, scopedInstancePath); <END> return new ExecutionResult( normalOutput.toString().trim(), errorOutput.toString().trim(), exitValue ); }</code><technical_language>method throw exceptions, **clearProcess** method invoked in a **finally** block</technical_language>

Target:
public static ExecutionResult executeCommandWithResult( final Logger logger, final String[] command, final File workingDir, final Map<String,String> environmentVars, final String applicationName, final String scopedInstancePath) throws IOException, InterruptedException { logger.fine( "Executing command: " + Arrays.toString( command )); ProcessBuilder pb = new ProcessBuilder( command ); if( workingDir != null ) pb.directory(workingDir); Map<String,String> env = pb.environment(); if( environmentVars != null && env != null ) { for( Map.Entry<String,String> entry : environmentVars.entrySet()) { if( entry.getKey() != null && entry.getValue() != null ) env.put( entry.getKey(), entry.getValue()); } } StringBuilder normalOutput = new StringBuilder(); StringBuilder errorOutput = new StringBuilder(); int exitValue = -1; Process process = pb.start(); logger.fine("Storing process [" + applicationName + "] [" + scopedInstancePath + "]"); ProcessStore.setProcess(applicationName, scopedInstancePath, process); try { new Thread( new OutputRunnable( process, true, errorOutput, logger )).start(); new Thread( new OutputRunnable( process, false, normalOutput, logger )).start(); exitValue = process.waitFor(); if( exitValue != 0 ) logger.warning( "Command execution returned a non-zero code. Code:" + exitValue ); } finally { ProcessStore.clearProcess(applicationName, scopedInstancePath); } return new ExecutionResult( normalOutput.toString().trim(), errorOutput.toString().trim(), exitValue ); }
Source:
<code>public @Nullable Long getDuration() { Number begin = fBegin.getValue(); Number end = fEnd.getValue(); if (begin != null && end != null) { return end.longValue() - begin.longValue(); } <START> return null; <END> }</code><technical_language>pre-compute of duration in constructor, done before, avoid subtraction time this is called. you</technical_language>

Target:
public @Nullable Long getDuration() { return fDuration; }
Source:
<code>private static String toJson(String source) { Map<String, String> queryPairs = new HashMap<>(); Arrays.stream(source.split("&")) .forEach( p -> { int delimiterIndex = p.indexOf("="); queryPairs.put(p.substring(0, delimiterIndex), p.substring(delimiterIndex + 1)); }); <START> return new Gson().toJson(queryPairs); <END> }</code><technical_language>singleton GSON instance in static field</technical_language>

Target:
private static String toJson(String source) { Map<String, String> queryPairs = new HashMap<>(); Arrays.stream(source.split("&")) .forEach( p -> { int delimiterIndex = p.indexOf("="); queryPairs.put(p.substring(0, delimiterIndex), p.substring(delimiterIndex + 1)); }); return gson.toJson(queryPairs); }
Source:
<code>private Block2BlockwiseStatus clearBlock2Status(final KeyUri key) { int size; Block2BlockwiseStatus removedTracker; synchronized (block2Transfers) { removedTracker = block2Transfers.remove(key); size = block2Transfers.size(); } if (removedTracker != null) { LOGGER.debug("removing block2 tracker [{}], block2 transfers still in progress: {}", <START> new Object[] { key, size }); <END> removedTracker.setComplete(true); } return removedTracker; }</code><technical_language>remove new Object[]? longer required</technical_language>

Target:
private Block2BlockwiseStatus clearBlock2Status(final KeyUri key) { int size; Block2BlockwiseStatus removedTracker; synchronized (block2Transfers) { removedTracker = block2Transfers.remove(key); size = block2Transfers.size(); } if (removedTracker != null) { LOGGER.debug("removing block2 tracker [{}], block2 transfers still in progress: {}", key, size); removedTracker.setComplete(true); } return removedTracker; }
Source:
<code>public void startPortForwarding() { if(isPortForwarding(pod)) return; IPortForwardable portForwardable = pod.accept(new CapabilityVisitor<IPortForwardable, IPortForwardable>() { @Override public IPortForwardable visit(final IPortForwardable cap) { final MessageConsole console = ConsoleUtils.findMessageConsole(getMessageConsoleName()); consoleListener.setCapability(cap); ConsoleUtils.registerConsoleListener(consoleListener); MessageConsoleStream stream = console.newMessageStream(); stream.println("Starting port-forwarding..."); for (IPortForwardable.PortPair port : ports) { stream.println(NLS.bind("{0} {1} -> {2}", new Object {port.getName(), port.getLocalPort(), port.getRemotePort()})); } cap.forwardPorts(ports.toArray(new IPortForwardable.PortPair []{})); stream.println("done."); ConsoleUtils.displayConsoleView(console); firePropertyChange(PROPERTY_PORT_FORWARDING, false, getPortForwarding()); return cap; } }, null); if(portForwardable != null) { REGISTRY.put(pod, portForwardable); } <START> firePropertyChange(PROPERTY_PORT_FORWARDING, false, getPortForwarding()); <END> }</code><technical_language>remove line this copied if for us</technical_language>

Target:
public void startPortForwarding() { if(isPortForwarding(pod)) return; IPortForwardable portForwardable = pod.accept(new CapabilityVisitor<IPortForwardable, IPortForwardable>() { @Override public IPortForwardable visit(final IPortForwardable cap) { final MessageConsole console = ConsoleUtils.findMessageConsole(getMessageConsoleName()); consoleListener.setCapability(cap); ConsoleUtils.registerConsoleListener(consoleListener); MessageConsoleStream stream = console.newMessageStream(); stream.println("Starting port-forwarding..."); for (IPortForwardable.PortPair port : ports) { stream.println(NLS.bind("{0} {1} -> {2}", new Object {port.getName(), port.getLocalPort(), port.getRemotePort()})); } cap.forwardPorts(ports.toArray(new IPortForwardable.PortPair []{})); stream.println("done."); ConsoleUtils.displayConsoleView(console); return cap; } }, null); if(portForwardable != null) { REGISTRY.put(pod, portForwardable); } firePropertyChange(PROPERTY_PORT_FORWARDING, false, getPortForwarding()); }
Source:
<code><START> public Int getTotalNumDocuments(){ <END> searcher = new IndexSearcher(reader); return searcher.getIndexReader().maxDoc(); }</code><technical_language>primitive int instead if object Int. I IndexSearcher for read from? line 96</technical_language>

Target:
public int getTotalNumDocuments(){ if (searcher == null) { searcher = new IndexSearcher(reader); } return searcher.getIndexReader().maxDoc(); }
Source:
<code>public void testLoadGlobalMRUObjectsFromCache() throws Exception { final List<SalesforceObject> mruObjects_before = metadataManager.loadMRUObjects(null, MAX_QUERY_LIMIT, CachePolicy.RELOAD_AND_RETURN_CACHE_DATA, REFRESH_INTERVAL, null); Map<String, String> idToSubjects = new HashMap<String, String>(); <START> idToSubjects = createRecordsOnServer(1, Constants.CASE); <END> String[] ids = idToSubjects.keySet().toArray(new String[1]); try { Thread.sleep(2000); final List<SalesforceObject> mruObjects = metadataManager.loadMRUObjects(null, MAX_QUERY_LIMIT, CachePolicy.RETURN_CACHE_DATA_DONT_RELOAD, REFRESH_INTERVAL, null); assertNotNull("MRU list should not be null", mruObjects); assertEquals("MRU list size should not be changed", mruObjects_before.size(), mruObjects.size()); } finally { deleteRecordsOnServer(ids, Constants.CASE); } }</code><technical_language>initialize this line 196</technical_language>

Target:
public void testLoadGlobalMRUObjectsFromCache() throws Exception { final List<SalesforceObject> mruObjects_before = metadataManager.loadMRUObjects(null, MAX_QUERY_LIMIT, CachePolicy.RELOAD_AND_RETURN_CACHE_DATA, REFRESH_INTERVAL, null); Map<String, String> idToSubjects = createRecordsOnServer(1, Constants.CASE); Set<String> ids = idToSubjects.keySet(); try { Thread.sleep(2000); final List<SalesforceObject> mruObjects = metadataManager.loadMRUObjects(null, MAX_QUERY_LIMIT, CachePolicy.RETURN_CACHE_DATA_DONT_RELOAD, REFRESH_INTERVAL, null); assertNotNull("MRU list should not be null", mruObjects); assertEquals("MRU list size should not be changed", mruObjects_before.size(), mruObjects.size()); } finally { deleteRecordsOnServer(ids, Constants.CASE); } }
Source:
<code>public void simpleRedirectTestCase() throws IOException, GeneralSecurityException { TestHttpClient client = new TestHttpClient(); client.setSSLContext(DefaultServer.getClientSSLContext()); try { sendRequest(client, "/foo", null); sendRequest(client, "/foo+bar", null); sendRequest(client, "/foo+bar;aa", null); sendRequest(client, "/foo+bar;aa", "x=y"); <START> sendRequest(client, "/foo+bar:aa", "x=%3Ablah"); <END> } finally { client.getConnectionManager().shutdown(); } }</code><technical_language>this change? this supposed test <LINK_0></technical_language>

Target:
public void simpleRedirectTestCase() throws IOException, GeneralSecurityException { TestHttpClient client = new TestHttpClient(); HttpContext httpContext = new BasicHttpContext() { private final RequestConfig config = RequestConfig.copy(RequestConfig.DEFAULT).setNormalizeUri(false).build(); @Override public void setAttribute(final String id, final Object obj) { if ("http.request-config".equals(id)) return; super.setAttribute(id, obj); } @Override public Object getAttribute(final String id) { if ("http.request-config".equals(id)) return config; return super.getAttribute(id); } }; client.setSSLContext(DefaultServer.getClientSSLContext()); try { sendRequest(client, httpContext,"/foo", null); sendRequest(client, httpContext,"/foo+bar", null); sendRequest(client, httpContext,"/foo+bar;aa", null); sendRequest(client, httpContext,"/foo+bar;aa", "x=y"); sendRequest(client, httpContext,"/foo+bar%3Aaa", "x=%3Ablah"); } finally { client.getConnectionManager().shutdown(); } }
Source:
<code>public void cancelSnapshotSyncInProgressAndRetry() throws Exception { observeSnapshotSync = true; initLogReplicationFSM(ReaderImplementation.TEST); ((TestSnapshotReader)snapshotReader).setBatchSize(BATCH_SIZE); limitSnapshotMessages = 2; writeToStream(); transitionAvailable.acquire(); transition(LogReplicationEventType.SNAPSHOT_SYNC_REQUEST, LogReplicationStateType.IN_SNAPSHOT_SYNC); transitionAvailable.acquire(); fsm.input(new LogReplicationEvent(LogReplicationEventType.REPLICATION_STOP)); while (fsm.getState().getType() != LogReplicationStateType.INITIALIZED) { } assertThat(fsm.getState().getType()).isEqualTo(LogReplicationStateType.INITIALIZED); ((TestDataSender) dataSender).reset(); observeSnapshotSync = false; Queue<LogReplicationEntry> listenerQueue = ((TestDataSender) dataSender).getEntryQueue(); <START> fsm.input(new LogReplicationEvent(LogReplicationEventType.SNAPSHOT_SYNC_REQUEST)); <END> for (int i = 0; i<(NUM_ENTRIES/(BATCH_SIZE * SnapshotSender.DEFAULT_SNAPSHOT_BATCH_SIZE)) + 1; i++) { } while (listenerQueue.size() < NUM_ENTRIES) { } assertThat(listenerQueue.size()).isEqualTo(NUM_ENTRIES); for (int i=0; i<NUM_ENTRIES; i++) { assertThat(listenerQueue.poll().getPayload()) .isEqualTo( String.format(PAYLOAD_FORMAT, i).getBytes()); } }</code><technical_language>this need change</technical_language>

Target:
public void cancelSnapshotSyncInProgressAndRetry() throws Exception { observeSnapshotSync = true; initLogReplicationFSM(ReaderImplementation.TEST); ((TestSnapshotReader)snapshotReader).setBatchSize(BATCH_SIZE); limitSnapshotMessages = 2; writeToStream(); transitionAvailable.acquire(); transition(LogReplicationEventType.SNAPSHOT_SYNC_REQUEST, LogReplicationStateType.IN_SNAPSHOT_SYNC); transitionAvailable.acquire(); fsm.input(new LogReplicationEvent(LogReplicationEventType.REPLICATION_STOP)); while (fsm.getState().getType() != LogReplicationStateType.INITIALIZED) { } assertThat(fsm.getState().getType()).isEqualTo(LogReplicationStateType.INITIALIZED); ((TestDataSender) dataSender).reset(); observeSnapshotSync = false; Queue<LogReplicationEntry> listenerQueue = ((TestDataSender) dataSender).getEntryQueue(); transition(LogReplicationEventType.SNAPSHOT_SYNC_REQUEST, LogReplicationStateType.IN_SNAPSHOT_SYNC, true); for (int i = 0; i<(NUM_ENTRIES/(BATCH_SIZE * SnapshotSender.DEFAULT_SNAPSHOT_BATCH_SIZE)) + 1; i++) { transitionAvailable.acquire(); } while (listenerQueue.size() < NUM_ENTRIES) { } assertThat(listenerQueue.size()).isEqualTo(NUM_ENTRIES); for (int i=0; i<NUM_ENTRIES; i++) { assertThat(listenerQueue.poll().getPayload()) .isEqualTo( String.format(PAYLOAD_FORMAT, i).getBytes()); } }
Source:
<code>protected S3ListResult listObjects(S3ListRequest request) throws IOException { incrementReadOperations(); incrementStatistic(OBJECT_LIST_REQUESTS); validateListArguments(request); return invoker.retryUntranslated( request.toString(), true, () -> { if (useListV1) { <START> Preconditions.checkArgument(request.isV1()); <END> return S3ListResult.v1(s3.listObjects(request.getV1())); } else { Preconditions.checkArgument(!request.isV1()); return S3ListResult.v2(s3.listObjectsV2(request.getV2())); } }); }</code><technical_language>remove this line</technical_language>

Target:
protected S3ListResult listObjects(S3ListRequest request) throws IOException { incrementReadOperations(); incrementStatistic(OBJECT_LIST_REQUESTS); validateListArguments(request); return invoker.retryUntranslated( request.toString(), true, () -> { if (useListV1) { return S3ListResult.v1(s3.listObjects(request.getV1())); } else { return S3ListResult.v2(s3.listObjectsV2(request.getV2())); } }); }
Source:
<code>Cluster constructClusterDTO(final String id) { final String clusterId; if (StringUtils.isBlank(id)) { clusterId = UUID.randomUUID().toString(); } else { clusterId = id; } final Set<String> tags = new HashSet<>(); tags.add("foo"); tags.add("bar"); final Set<String> configList = new HashSet<>(); configList.add("config1"); configList.add("configs2"); <START> final Set<String> dependenciesList = new HashSet<>(); <END> dependenciesList.add("cluster-dep1"); dependenciesList.add("cluster-dep2"); return new Cluster.Builder("name", "user", "1.0", ClusterStatus.UP) .withId(clusterId) .withDescription("client Test") .withSetupFile("path to set up file") .withTags(tags) .withConfigs(configList) .withDependencies(dependenciesList) .build(); }</code><technical_language>a FYI Guava Sets.newHashSet(item1, item2, ...) method shortcut this kind of</technical_language>

Target:
Cluster constructClusterDTO(final String id) { final String clusterId; if (StringUtils.isBlank(id)) { clusterId = UUID.randomUUID().toString(); } else { clusterId = id; } final Set<String> tags = Sets.newHashSet("foo", "bar"); final Set<String> configList = Sets.newHashSet("config1", "configs2"); final Set<String> dependenciesList = Sets.newHashSet("cluster-dep1", "cluster-dep2"); return new Cluster.Builder("name", "user", "1.0", ClusterStatus.UP) .withId(clusterId) .withDescription("client Test") .withSetupFile("path to set up file") .withTags(tags) .withConfigs(configList) .withDependencies(dependenciesList) .build(); }
Source:
<code>ColumnWriteStoreBase( MessageType schema, PageWriteStore pageWriteStore, BloomFilterWriteStore bloomFilterWriteStore, ParquetProperties props) { this.props = props; this.thresholdTolerance = (long) (props.getPageSizeThreshold() * THRESHOLD_TOLERANCE_RATIO); Map<ColumnDescriptor, ColumnWriterBase> mcolumns = new TreeMap<>(); for (ColumnDescriptor path : schema.getColumns()) { PageWriter pageWriter = pageWriteStore.getPageWriter(path); <START> if (props.getBloomFilterColumnExpectedNDVs() != null) { <END> BloomFilterWriter bloomFilterWriter = bloomFilterWriteStore.getBloomFilterWriter(path); mcolumns.put(path, createColumnWriter(path, pageWriter, bloomFilterWriter, props)); } else { mcolumns.put(path, createColumnWriter(path, pageWriter, null, props)); } } this.columns = unmodifiableMap(mcolumns); this.rowCountForNextSizeCheck = props.getMinRowCountForPageSizeCheck(); columnWriterProvider = new ColumnWriterProvider() { @Override public ColumnWriter getColumnWriter(ColumnDescriptor path) { return columns.get(path); } }; }</code><technical_language>related map is initialized</technical_language>

Target:
ColumnWriteStoreBase( MessageType schema, PageWriteStore pageWriteStore, BloomFilterWriteStore bloomFilterWriteStore, ParquetProperties props) { this.props = props; this.thresholdTolerance = (long) (props.getPageSizeThreshold() * THRESHOLD_TOLERANCE_RATIO); Map<ColumnDescriptor, ColumnWriterBase> mcolumns = new TreeMap<>(); for (ColumnDescriptor path : schema.getColumns()) { PageWriter pageWriter = pageWriteStore.getPageWriter(path); if (props.getBloomFilterColumns() != null && props.getBloomFilterColumns().size() > 0) { BloomFilterWriter bloomFilterWriter = bloomFilterWriteStore.getBloomFilterWriter(path); mcolumns.put(path, createColumnWriter(path, pageWriter, bloomFilterWriter, props)); } else { mcolumns.put(path, createColumnWriter(path, pageWriter, null, props)); } } this.columns = unmodifiableMap(mcolumns); this.rowCountForNextSizeCheck = props.getMinRowCountForPageSizeCheck(); columnWriterProvider = new ColumnWriterProvider() { @Override public ColumnWriter getColumnWriter(ColumnDescriptor path) { return columns.get(path); } }; }
Source:
<code>@Override public ICubeGenerator createCubeGenerator(ICubicWorldServer world) { return new BasicCubeGenerator(world) { Perlin perlin = new Perlin(); { perlin.setFrequency(0.180); perlin.setOctaveCount(1); perlin.setSeed((int) world.getSeed()); } @Override public ICubePrimer generateCube(int cubeX, int cubeY, int cubeZ) { ICubePrimer primer = new CubePrimer(); if(cubeY > 30) { return primer; } if(cubeX == 100 && cubeZ == 100) { return primer; } CubeCoords cubePos = new CubeCoords(cubeX, cubeY, cubeZ); for(BlockPos pos : BlockPos.getAllInBoxMutable(cubePos.getMinBlockPos(), cubePos.getMaxBlockPos())) { double currDensity = perlin.getValue(pos.getX(), pos.getY()*0.5, pos.getZ()); double aboveDensity = perlin.getValue(pos.getX(), (pos.getY()+1)*0.5, pos.getZ()); if(cubeY >= 16) { currDensity -= (pos.getY() - 16*16)/100; aboveDensity -= (pos.getY() + 1 - 16*16)/100; } if(currDensity > 0.5) { if(currDensity > 0.5 && aboveDensity <= 0.5) { primer.setBlockState(pos.getX(), pos.getY(), pos.getZ(), Blocks.GRASS.getDefaultState()); } else if(currDensity > aboveDensity && currDensity < 0.7) { primer.setBlockState(pos.getX(), pos.getY(), pos.getZ(), Blocks.DIRT.getDefaultState()); } else { primer.setBlockState(pos.getX(), pos.getY(), pos.getZ(), Blocks.STONE.getDefaultState()); } } } return primer; } @Override public void populate(Cube cube) { } @Override public Vec3i[] getPopRequirment(Cube cube) { <START> return NO_POPULTOR_REQUIRMENT; <END> } }; }</code><technical_language>Spelling (Popul **a** tor, Requir **e** ment)</technical_language>

Target:
@Override public ICubeGenerator createCubeGenerator(ICubicWorldServer world) { return new BasicCubeGenerator(world) { Perlin perlin = new Perlin(); { perlin.setFrequency(0.180); perlin.setOctaveCount(1); perlin.setSeed((int) world.getSeed()); } @Override public ICubePrimer generateCube(int cubeX, int cubeY, int cubeZ) { ICubePrimer primer = new CubePrimer(); if(cubeY > 30) { return primer; } if(cubeX == 100 && cubeZ == 100) { return primer; } CubeCoords cubePos = new CubeCoords(cubeX, cubeY, cubeZ); for(BlockPos pos : BlockPos.getAllInBoxMutable(cubePos.getMinBlockPos(), cubePos.getMaxBlockPos())) { double currDensity = perlin.getValue(pos.getX(), pos.getY()*0.5, pos.getZ()); double aboveDensity = perlin.getValue(pos.getX(), (pos.getY()+1)*0.5, pos.getZ()); if(cubeY >= 16) { currDensity -= (pos.getY() - 16*16)/100; aboveDensity -= (pos.getY() + 1 - 16*16)/100; } if(currDensity > 0.5) { if(currDensity > 0.5 && aboveDensity <= 0.5) { primer.setBlockState(pos.getX(), pos.getY(), pos.getZ(), Blocks.GRASS.getDefaultState()); } else if(currDensity > aboveDensity && currDensity < 0.7) { primer.setBlockState(pos.getX(), pos.getY(), pos.getZ(), Blocks.DIRT.getDefaultState()); } else { primer.setBlockState(pos.getX(), pos.getY(), pos.getZ(), Blocks.STONE.getDefaultState()); } } } return primer; } @Override public void populate(Cube cube) { } @Override public Box getPopulationRequirement(Cube cube) { return NO_POPULATOR_REQUIREMENT; } }; }
Source:
<code>private Integer getMaxBandwidth(MigrationPolicy migrationPolicy) { switch (getCluster().getMigrationBandwidthLimitType()) { case AUTO: return Optional.ofNullable(getAutoMaxBandwidth()) .map(bandwidth -> bandwidth / migrationPolicy.getMaxMigrations()) .orElse(null); case VDSM_CONFIG: return null; case CUSTOM: return getCluster().getCustomMigrationNetworkBandwidth() / migrationPolicy.getMaxMigrations(); default: <START> throw new IllegalStateException("Unexpected enum item."); <END> } }</code><technical_language>please print enum</technical_language>

Target:
private Integer getMaxBandwidth(MigrationPolicy migrationPolicy) { switch (getCluster().getMigrationBandwidthLimitType()) { case AUTO: return Optional.ofNullable(getAutoMaxBandwidth()) .map(bandwidth -> bandwidth / migrationPolicy.getMaxMigrations()) .orElse(null); case VDSM_CONFIG: return null; case CUSTOM: return getCluster().getCustomMigrationNetworkBandwidth() / migrationPolicy.getMaxMigrations(); default: throw new IllegalStateException( "Unexpected enum item: " + getCluster().getMigrationBandwidthLimitType()); } }
Source:
<code>public <START> Pair<VM, FullEntityOvfData> readVmFromOvf(String <END> ovf) throws OvfReaderException { VM vm = new VM(); FullEntityOvfData fullEntityOvfData = new FullEntityOvfData(vm); ovfManager.importVm(ovf, vm, fullEntityOvfData); vm.setImages((ArrayList) fullEntityOvfData.getDiskImages()); vm.setInterfaces(fullEntityOvfData.getInterfaces()); Map<Guid, List<DiskImage>> images = ImagesHandler .getImagesLeaf(fullEntityOvfData.getDiskImages()); for (Map.Entry<Guid, List<DiskImage>> entry : images.entrySet()) { List<DiskImage> list = entry.getValue(); vm.getDiskMap().put(entry.getKey(), list.get(list.size() - 1)); } for (LunDisk lunDisk : fullEntityOvfData.getLunDisks()) { vm.getDiskMap().put(lunDisk.getId(), lunDisk); } return new Pair<>(vm, fullEntityOvfData); }</code><technical_language>I this pair thing, getFirst() getSecond() is confusing. FullEntityOvfData contains template VM anyway, getVmBase() cast create methods getVM() getTemplate()</technical_language>

Target:
public Pair<VM, FullEntityOvfData> readVmFromOvf(String ovf) throws OvfReaderException { VM vm = new VM(); FullEntityOvfData fullEntityOvfData = new FullEntityOvfData(vm); ovfManager.importVm(ovf, vm, fullEntityOvfData); vm.setImages((ArrayList) fullEntityOvfData.getDiskImages()); vm.setInterfaces(fullEntityOvfData.getInterfaces()); Map<Guid, List<DiskImage>> images = ImagesHandler .getImagesLeaf(fullEntityOvfData.getDiskImages()); for (Map.Entry<Guid, List<DiskImage>> entry : images.entrySet()) { List<DiskImage> list = entry.getValue(); vm.getDiskMap().put(entry.getKey(), list.get(list.size() - 1)); } fullEntityOvfData.getLunDisks().forEach(lunDisk -> vm.getDiskMap().put(lunDisk.getId(), lunDisk)); return new Pair<>(vm, fullEntityOvfData); }
Source:
<code>public T get(K key, String[] fields) throws GoraException { String[] avFields = getFieldsToQuery(fields); Object[] keyl = null; if (igniteMapping.getPrimaryKey().size() == 1) { keyl = new Object[]{key}; } else { } List<String> dbFields = new ArrayList<>(); for (String af : avFields) { dbFields.add(igniteMapping.getFields().get(af).getName()); } String selectQuery = IgniteSQLBuilder.selectGet(igniteMapping, dbFields); try (PreparedStatement stmt = connection.prepareStatement(selectQuery)) { IgniteSQLBuilder.fillSelectStatement(stmt, igniteMapping, keyl); ResultSet rs = stmt.executeQuery(); boolean data = rs.next(); T resp = null; if (data) { resp = newInstance(rs, fields); if (rs.next()) { LOG.warn("Multiple results for primary key in the schema {}, ignoring additional rows.", keyl, igniteMapping.getTableName()); } } rs.close(); return resp; } catch (SQLException | IOException ex) { throw new GoraException(ex); } <START> <END> }</code><technical_language>Please remove unnecessary new lines</technical_language>

Target:
public T get(K key, String[] fields) throws GoraException { String[] avFields = getFieldsToQuery(fields); Object[] keyl = null; if (igniteMapping.getPrimaryKey().size() == 1) { keyl = new Object[]{key}; } else { } List<String> dbFields = new ArrayList<>(); for (String af : avFields) { dbFields.add(igniteMapping.getFields().get(af).getName()); } String selectQuery = IgniteSQLBuilder.createSelectQueryGet(igniteMapping, dbFields); try (PreparedStatement stmt = connection.prepareStatement(selectQuery)) { IgniteSQLBuilder.fillSelectQuery(stmt, igniteMapping, keyl); ResultSet rs = stmt.executeQuery(); boolean data = rs.next(); T resp = null; if (data) { resp = newInstance(rs, fields); if (rs.next()) { LOG.warn("Multiple results for primary key in the schema {}, ignoring additional rows.", keyl, igniteMapping.getTableName()); } } rs.close(); return resp; } catch (SQLException | IOException ex) { throw new GoraException(ex); } }
Source:
<code>private void reply(org.jgroups.blocks.Response response, Object retVal, ReplicableCommand command, Message req) { if (response != null) { if (trace) log.tracef("About to send back response %s for command %s", retVal, command); Buffer rsp_buf; boolean is_exception = false; try { rsp_buf = rsp_marshaller.objectToBuffer(retVal); } catch (Throwable t) { try { rsp_buf = rsp_marshaller.objectToBuffer(t); is_exception = true; } catch (Throwable tt) { log.errorMarshallingObject(tt, retVal); return; } } <START> short flags = (short) (req.getFlags() | NO_FC.value() & ~Message.Flag.RSVP.value() & ~Message.Flag.SCOPED.value()); <END> Message rsp = req.makeReply().setFlag(flags).setBuffer(rsp_buf); response.send(rsp, is_exception); } }</code><technical_language>I remove INTERNAL flag set NO_TOTAL_ORDER flag (I a case in ISPN need send reply in :) )</technical_language>

Target:
private void reply(org.jgroups.blocks.Response response, Object retVal, ReplicableCommand command, Message req) { if (response != null) { if (trace) log.tracef("About to send back response %s for command %s", retVal, command); Buffer rsp_buf; boolean is_exception = false; try { rsp_buf = rsp_marshaller.objectToBuffer(retVal); } catch (Throwable t) { try { rsp_buf = rsp_marshaller.objectToBuffer(t); is_exception = true; } catch (Throwable tt) { log.errorMarshallingObject(tt, retVal); return; } } short flags = (short) (req.getFlags() | REPLY_FLAGS_TO_SET & ~REPLY_FLAGS_TO_CLEAR); Message rsp = req.makeReply().setFlag(flags).setBuffer(rsp_buf); response.send(rsp, is_exception); } }
Source:
<code>public void setProgressMonitor(ProgressMonitor monitor) { if (monitor == null) { <START> monitor = <END> NullProgressMonitor.INSTANCE; } this.monitor = monitor; }</code><technical_language>this.monitor avoid confusion parameter of name optional: this block a ternary: this.monitor = monitor != null ? monitor : NullProgressMonitor.INSTANCE;</technical_language>

Target:
public void setProgressMonitor(ProgressMonitor monitor) { this.monitor = monitor != null ? monitor : NullProgressMonitor.INSTANCE; }
Source:
<code>public String getType(String path, long destination, boolean includeVicinityIssues){ String result = null; for (StashDiff diff : diffs) { if (StringUtils.equals(diff.getPath(), path) && (destination == 0)){ result = StashPlugin.CONTEXT_ISSUE_TYPE; break; } else{ <START> if (StringUtils.equals(diff.getPath(), path) && ((diff.getDestination() == destination) || (includeVicinityIssues && Ranges.closed(diff.getSource() - PR_DIFF_COMMENT_OFFSET, diff.getDestination() + PR_DIFF_COMMENT_OFFSET).contains(destination)))) { <END> result = diff.getType(); break; } } } return result; }</code><technical_language>This line is long complex. externalize this check in a dedicated method in order ease readibility</technical_language>

Target:
public String getType(String path, long destination, boolean includeVicinityIssues){ String result = null; for (StashDiff diff : diffs) { if (StringUtils.equals(diff.getPath(), path) && (destination == 0)){ result = StashPlugin.CONTEXT_ISSUE_TYPE; break; } else{ if (StringUtils.equals(diff.getPath(), path) && ((diff.getDestination() == destination) || includeVicinityIssuesForDiff(diff, destination, includeVicinityIssues))) { result = diff.getType(); break; } } } return result; }
Source:
<code>public void testFileBatchInputFormatAvro() throws Exception { <START> File fileAvro = temporaryFolder.newFolder("test2").toPath().resolve(fileName + "-test6.avro").toFile(); <END> String outputDatasetName = "test-filesource-avro"; ApplicationManager appManager = createSourceAndDeployApp(fileAvro, "avro", outputDatasetName); org.apache.avro.Schema avroSchema = new org.apache.avro.Schema.Parser().parse(RECORD_SCHEMA.toString()); GenericRecord record = new GenericRecordBuilder(avroSchema) .set("i", Integer.MAX_VALUE) .set("l", Long.MAX_VALUE) .build(); DataSetManager<TimePartitionedFileSet> inputManager = getDataset("TestFile"); DatumWriter<GenericRecord> datumWriter = new GenericDatumWriter<>(avroSchema); DataFileWriter<GenericRecord> dataFileWriter = new DataFileWriter<>(datumWriter); dataFileWriter.create(avroSchema, fileAvro); dataFileWriter.append(record); dataFileWriter.close(); inputManager.flush(); workflowStartAndWait(appManager); List<StructuredRecord> input = ImmutableList.of( StructuredRecord.builder(RECORD_SCHEMA) .set("i", Integer.MAX_VALUE) .set("l", Long.MAX_VALUE) .build() ); DataSetManager<Table> outputManager = getDataset(outputDatasetName); List<StructuredRecord> output = MockSink.readOutput(outputManager); Assert.assertEquals(input, output); }</code><technical_language>relying a hardcoded filename for uniqueness, pretty brittle requires tests in order name file. Instead, do temporaryFolder.newFolder() create a new, unique folder for test</technical_language>

Target:
public void testFileBatchInputFormatAvro() throws Exception { File fileAvro = new File(temporaryFolder.newFolder(), "test.avro"); String outputDatasetName = "test-filesource-avro"; ApplicationManager appManager = createSourceAndDeployApp(fileAvro, "avro", outputDatasetName, RECORD_SCHEMA); org.apache.avro.Schema avroSchema = new org.apache.avro.Schema.Parser().parse(RECORD_SCHEMA.toString()); GenericRecord record = new GenericRecordBuilder(avroSchema) .set("i", Integer.MAX_VALUE) .set("l", Long.MAX_VALUE) .set("file", fileAvro.getAbsolutePath()) .build(); DataSetManager<TimePartitionedFileSet> inputManager = getDataset("TestFile"); DatumWriter<GenericRecord> datumWriter = new GenericDatumWriter<>(avroSchema); DataFileWriter<GenericRecord> dataFileWriter = new DataFileWriter<>(datumWriter); dataFileWriter.create(avroSchema, fileAvro); dataFileWriter.append(record); dataFileWriter.close(); inputManager.flush(); workflowStartAndWait(appManager); List<StructuredRecord> expected = ImmutableList.of( StructuredRecord.builder(RECORD_SCHEMA) .set("i", Integer.MAX_VALUE) .set("l", Long.MAX_VALUE) .set("file", fileAvro.toURI().toString()) .build() ); DataSetManager<Table> outputManager = getDataset(outputDatasetName); List<StructuredRecord> output = MockSink.readOutput(outputManager); Assert.assertEquals(output, expected); }
Source:
<code>public boolean visit(IResourceDelta delta) { if (delta.getKind() == IResourceDelta.REMOVED || (delta.getFlags() | delta.getKind()) == (IResourceDelta.OPEN | IResourceDelta.CHANGED)) { return false; } IResourceDelta[] removedFiles = delta.getAffectedChildren(IResourceDelta.REMOVED); if (removedFiles.length <= 0) { return false; } <START> boolean RPMsDeleted = false; <END> for (IResourceDelta resourceDelta : removedFiles) { String extension = resourceDelta.getResource().getFileExtension(); if (extension != null && extension.equals(ICreaterepoConstants.RPM_FILE_EXTENSION)) { RPMsDeleted = true; break; } } if (!RPMsDeleted) { return false; } PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() { @Override public void run() { refreshTree(); } }); return false; }</code><technical_language>Please stick java naming conventions - variabls start upper case. rpmsDeleted be</technical_language>

Target:
public boolean visit(IResourceDelta delta) { if (delta.getKind() == IResourceDelta.REMOVED || (delta.getFlags() | delta.getKind()) == (IResourceDelta.OPEN | IResourceDelta.CHANGED)) { return false; } IResourceDelta[] removedFiles = delta.getAffectedChildren(IResourceDelta.REMOVED); if (removedFiles.length <= 0) { return false; } boolean rpmsDeleted = false; for (IResourceDelta resourceDelta : removedFiles) { String extension = resourceDelta.getResource().getFileExtension(); if (extension != null && extension.equals(ICreaterepoConstants.RPM_FILE_EXTENSION)) { rpmsDeleted = true; break; } } if (!rpmsDeleted) { return false; } PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() { @Override public void run() { refreshTree(); } }); return false; }
Source:
<code>public UriSource(@JsonProperty(value = "uri", required = true) final String uri) throws URISyntaxException { <START> URI parsedUri = URI.create(Objects.requireNonNull(uri, "Parameter uri to UriSource may not be null")); <END> if (parsedUri.getScheme().equals("s3")) { parsedUri = new URI("s3a", parsedUri.getUserInfo(), parsedUri.getHost(), parsedUri.getPort(), parsedUri.getPath(), parsedUri.getQuery(), parsedUri.getFragment()); } this.uri = parsedUri.toString(); }</code><technical_language>round-tripping this parsed URI, introduce a transient final instance variable parsedUri set constructor getInputStream()</technical_language>

Target:
public UriSource(@JsonProperty(value = "uri", required = true) final String uri) throws URISyntaxException { parsedUri = URI.create(Objects.requireNonNull(uri, "Parameter uri to UriSource may not be null")); if (parsedUri.getScheme().equals("s3")) { parsedUri = new URI("s3a", parsedUri.getUserInfo(), parsedUri.getHost(), parsedUri.getPort(), parsedUri.getPath(), parsedUri.getQuery(), parsedUri.getFragment()); } }
Source:
<code>private TokenParam extractIdentifierFromOtherResourceTypes(IBaseResource resource) { FhirTerser terser = myFhirContext.newTerser(); <START> Identifier myIdentifier = (Identifier) terser.getSingleValueOrNull(resource, "identifier"); <END> return new TokenParam(myIdentifier.getSystem(), myIdentifier.getValue()); }</code><technical_language>deal null case (and rename "my" variable a field) - happen in case of a URL identifier, safe upload in case</technical_language>

Target:
private TokenParam extractIdentifierFromOtherResourceTypes(IBaseResource resource) { FhirTerser terser = myFhirContext.newTerser(); Identifier identifier = (Identifier) terser.getSingleValueOrNull(resource, "identifier"); if (identifier != null) { return new TokenParam(identifier.getSystem(), identifier.getValue()); } else { throw new UnsupportedOperationException("Resources in a package must have a url or identifier to be loaded by the package installer."); } }
Source:
<code>boolean startBlobStore(PartitionId id) { BlobStore store = stores.get(id); <START> if (store == null || store.isStarted() || !running) { <END> return false; } try { store.start(); } catch (Exception e) { logger.error("Exception while starting store on disk {}", id, disk, e); return false; } return true; }</code><technical_language>If store is started, I return true. for stop (return true if store is stopped try stop again)</technical_language>

Target:
boolean startBlobStore(PartitionId id) { BlobStore store = stores.get(id); if (store == null || !running) { return false; } else if (store.isStarted()) { return true; } else { try { store.start(); } catch (Exception e) { logger.error("Exception while starting store on disk {}", id, disk, e); return false; } return true; } }
Source:
<code>public void copyFile(File file) { File tmp = null; try { tmp = File.createTempFile("jenkins-acceptance-tests", "dir"); ZipUtil.pack(file, tmp); byte[] archive = IOUtils.toByteArray(new FileInputStream(tmp)); if (SystemUtils.IS_OS_WINDOWS) { <START> addBatchStep("xcopy " + file.getAbsolutePath() + " %cd% /E"); <END> } else { addShellStep(String.format( "base64 --decode << ENDOFFILE > archive.zip && unzip -o archive.zip \n%s\nENDOFFILE", new String(Base64.encodeBase64Chunked(archive)) )); } } catch (IOException e) { throw new AssertionError(e); } finally { if (tmp != null) { tmp.delete(); } } }</code><technical_language>bug: IIUC this work for a RemoteJenkinsController-hence complex trick for Unix. If do want implement correctly for Windows now, OK, this method throws a meaningful error a remote controller is in use</technical_language>

Target:
public void copyFile(File file) { File tmp = null; try { tmp = File.createTempFile("jenkins-acceptance-tests", "dir"); ZipUtil.pack(file, tmp); byte[] archive = IOUtils.toByteArray(new FileInputStream(tmp)); if (SystemUtils.IS_OS_WINDOWS) { if (!(controller instanceof LocalController)) { throw new AssumptionViolatedException("Copying files in Windows is only supported if a LocalController is in use. Test will be skipped."); } addBatchStep("xcopy " + file.getAbsolutePath() + " %cd% /E"); } else { addShellStep(String.format( "base64 --decode << ENDOFFILE > archive.zip && unzip -o archive.zip \n%s\nENDOFFILE", new String(Base64.encodeBase64Chunked(archive)) )); } } catch (IOException e) { throw new AssertionError(e); } finally { if (tmp != null) { tmp.delete(); } } }
Source:
<code><START> public ConsumerInstalledProductDTO clone() { <END> return super.clone(); }</code><technical_language>Need clone date objects here</technical_language>

Target:
public ConsumerInstalledProductDTO clone() { ConsumerInstalledProductDTO copy = super.clone(); Date startDate = this.getStartDate(); copy.startDate = startDate != null ? (Date) startDate.clone() : null; Date endDate = this.getEndDate(); copy.endDate = endDate != null ? (Date) endDate.clone() : null; return super.clone(); }
Source:
<code>public StorageManager(StoreConfig storeConfig, DiskManagerConfig diskManagerConfig, ScheduledExecutorService scheduler, MetricRegistry registry, List<? extends ReplicaId> replicas, StoreKeyFactory keyFactory, MessageStoreRecovery recovery, MessageStoreHardDelete hardDelete, ReplicaStatusDelegate replicaStatusDelegate, Time time) throws StoreException { verifyConfigs(storeConfig, diskManagerConfig); metrics = new StorageManagerMetrics(registry); StoreMetrics storeMainMetrics = new StoreMetrics(registry); StoreMetrics storeUnderCompactionMetrics = new StoreMetrics("UnderCompaction", registry); List<String> stoppedReplicas = <START> replicaStatusDelegate == null ? new ArrayList<>() : replicaStatusDelegate.getStoppedReplicas(); <END> this.time = time; Map<DiskId, List<ReplicaId>> diskToReplicaMap = new HashMap<>(); for (ReplicaId replica : replicas) { DiskId disk = replica.getDiskId(); diskToReplicaMap.computeIfAbsent(disk, key -> new ArrayList<>()).add(replica); } for (Map.Entry<DiskId, List<ReplicaId>> entry : diskToReplicaMap.entrySet()) { DiskId disk = entry.getKey(); List<ReplicaId> replicasForDisk = entry.getValue(); DiskManager diskManager = new DiskManager(disk, replicasForDisk, storeConfig, diskManagerConfig, scheduler, metrics, storeMainMetrics, storeUnderCompactionMetrics, keyFactory, recovery, hardDelete, replicaStatusDelegate, stoppedReplicas, time); diskManagers.add(diskManager); for (ReplicaId replica : replicasForDisk) { partitionToDiskManager.put(replica.getPartitionId(), diskManager); } } }</code><technical_language>Collections.emptyList()</technical_language>

Target:
public StorageManager(StoreConfig storeConfig, DiskManagerConfig diskManagerConfig, ScheduledExecutorService scheduler, MetricRegistry registry, List<? extends ReplicaId> replicas, StoreKeyFactory keyFactory, MessageStoreRecovery recovery, MessageStoreHardDelete hardDelete, ReplicaStatusDelegate replicaStatusDelegate, Time time) throws StoreException { verifyConfigs(storeConfig, diskManagerConfig); metrics = new StorageManagerMetrics(registry); StoreMetrics storeMainMetrics = new StoreMetrics(registry); StoreMetrics storeUnderCompactionMetrics = new StoreMetrics("UnderCompaction", registry); List<String> stoppedReplicas = replicaStatusDelegate == null ? Collections.emptyList() : replicaStatusDelegate.getStoppedReplicas(); this.time = time; Map<DiskId, List<ReplicaId>> diskToReplicaMap = new HashMap<>(); for (ReplicaId replica : replicas) { DiskId disk = replica.getDiskId(); diskToReplicaMap.computeIfAbsent(disk, key -> new ArrayList<>()).add(replica); } for (Map.Entry<DiskId, List<ReplicaId>> entry : diskToReplicaMap.entrySet()) { DiskId disk = entry.getKey(); List<ReplicaId> replicasForDisk = entry.getValue(); DiskManager diskManager = new DiskManager(disk, replicasForDisk, storeConfig, diskManagerConfig, scheduler, metrics, storeMainMetrics, storeUnderCompactionMetrics, keyFactory, recovery, hardDelete, replicaStatusDelegate, stoppedReplicas, time); diskManagers.add(diskManager); for (ReplicaId replica : replicasForDisk) { partitionToDiskManager.put(replica.getPartitionId(), diskManager); } } }
Source:
<code>public static com.azure.search.documents.indexes.implementation.models.LimitTokenFilter map(LimitTokenFilter obj) { if (obj == null) { return null; } com.azure.search.documents.indexes.implementation.models.LimitTokenFilter limitTokenFilter = new com.azure.search.documents.indexes.implementation.models.LimitTokenFilter(); String name = obj.getName(); limitTokenFilter.setName(name); Integer maxTokenCount = obj.getMaxTokenCount(); limitTokenFilter.setMaxTokenCount(maxTokenCount); <START> Boolean consumeAllTokens = obj.isAllTokensConsumed(); <END> limitTokenFilter.setConsumeAllTokens(consumeAllTokens); return limitTokenFilter; }</code><technical_language>In plural cases are? areAllTokensConsumed</technical_language>

Target:
public static com.azure.search.documents.indexes.implementation.models.LimitTokenFilter map(LimitTokenFilter obj) { if (obj == null) { return null; } com.azure.search.documents.indexes.implementation.models.LimitTokenFilter limitTokenFilter = new com.azure.search.documents.indexes.implementation.models.LimitTokenFilter(); String name = obj.getName(); limitTokenFilter.setName(name); Integer maxTokenCount = obj.getMaxTokenCount(); limitTokenFilter.setMaxTokenCount(maxTokenCount); Boolean consumeAllTokens = obj.areAllTokensConsumed(); limitTokenFilter.setConsumeAllTokens(consumeAllTokens); return limitTokenFilter; }