auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public <R, X extends Exception> R inTransaction(Handle handle, TransactionCallback<R, X> callback) throws X { <START> didTxnRollback.set(false); <END> final R returnValue; try { handle.begin(); returnValue = callback.inTransaction(handle); if (!didTxnRollback.get()) { handle.commit(); } } catch (Exception e) { try { handle.rollback(); } catch (Exception rollback) { e.addSuppressed(rollback); } throw (X) e; } didTxnRollback.remove(); return returnValue; }</code><technical_language>sanity check handle is in a transaction throw exception, changing state of didTxnRollback</technical_language>

Target:
public <R, X extends Exception> R inTransaction(Handle handle, TransactionCallback<R, X> callback) throws X { if (isInTransaction(handle)) { throw new IllegalStateException("Already in transaction"); } didTxnRollback.set(false); final R returnValue; try { handle.begin(); returnValue = callback.inTransaction(handle); if (!didTxnRollback.get()) { handle.commit(); } } catch (Exception e) { try { handle.rollback(); } catch (Exception rollback) { e.addSuppressed(rollback); } throw (X) e; } didTxnRollback.remove(); return returnValue; }
Source:
<code><START> public void testOneFail() throws IOException { <END> final List<Pass> list = new ArrayList<Pass>(1); list.add(new PsFake(false)); final Opt<Identity> identity = new PsAll(list, 0).enter(new RqFake()); MatcherAssert.assertThat( identity.has(), Matchers.is(false) ); }</code><technical_language>@lautarobock too, declare throws Exception</technical_language>

Target:
public void testOneFail() throws Exception { final List<Pass> list = new ArrayList<Pass>(1); list.add(new PsFake(false)); final Opt<Identity> identity = new PsAll(list, 0).enter(new RqFake()); MatcherAssert.assertThat( identity.has(), Matchers.is(false) ); }
Source:
<code>Flux<BlobChangefeedEventWrapper> getEvents() { return validateChangefeed() <START> .flatMap(ignore -> populateLastConsumable()) .flatMapMany(ignore -> listYears()) <END> .concatMap(this::listSegmentsForYear) .concatMap(this::getEventsForSegment); }</code><technical_language>values ignored, thenMany</technical_language>

Target:
Flux<BlobChangefeedEventWrapper> getEvents() { return validateChangefeed() .then(populateLastConsumable()) .thenMany(listYears()) .concatMap(this::listSegmentsForYear) .concatMap(this::getEventsForSegment); }
Source:
<code><START> private void testJob(final String jobName, final Map<String, String[]> expectedResultSets) throws Exception { <END> final InputStream resultInputStream = new ByteArrayInputStream(runJob(jobName).getBytes()); final InputStreamReader resultInputStreamReader = new InputStreamReader(resultInputStream); final BufferedReader resultReader = new BufferedReader(resultInputStreamReader); try { String resultLine; while ((resultLine = resultReader.readLine()) != null && !resultLine.equals("SUCCESS!")) { } while ((resultLine = resultReader.readLine()) != null) { final String resultKey = resultLine.trim(); if (!"".equals(resultKey)) { String[] expectedResultSet = expectedResultSets.get(resultKey); assertNotNull(expectedResultSet); for (String expectedResult : expectedResultSet) { assertThat(resultReader.readLine(), containsString(expectedResult)); } expectedResultSets.remove(resultKey); } } assertEquals(0, expectedResultSets.size()); } finally { resultReader.close(); resultInputStreamReader.close(); resultInputStream.close(); } }</code><technical_language>I guess this in a common class somewhere, for commercial edition extension developers</technical_language>

Target:
private static void testJob(final String jobName, final Map<String, String[]> expectedResultSets) throws Exception { JobTestHelper.testJob(URLDecoder.decode(new File("src/main/resources/datacleaner-home/jobs/" + jobName + ".analysis.xml").getPath(), "UTF-8"), expectedResultSets); }
Source:
<code>public void stopContainer() throws Exception { deployer.undeploy(APP_CONTEXT); final ModelControllerClient client = TestSuiteEnvironment.getModelControllerClient(); final ManagementClient managementClient = new ManagementClient(client, TestSuiteEnvironment.getServerAddress(), TestSuiteEnvironment.getServerPort(), "remote+http"); <START> LOGGER.info("*** reseting test configuration"); <END> serverTearDown(managementClient); LOGGER.trace("*** stopping container"); containerController.stop(CONTAINER); }</code><technical_language>a reason change this info instead of trace</technical_language>

Target:
public void stopContainer() throws Exception { deployer.undeploy(APP_CONTEXT); final ModelControllerClient client = TestSuiteEnvironment.getModelControllerClient(); final ManagementClient managementClient = new ManagementClient(client, TestSuiteEnvironment.getServerAddress(), TestSuiteEnvironment.getServerPort(), "remote+http"); LOGGER.trace("*** reseting test configuration"); serverTearDown(managementClient); LOGGER.trace("*** stopping container"); containerController.stop(CONTAINER); }
Source:
<code>private static long getMinimumTimeout(List<Map<String, String>> connectorData) { return connectorData.stream() .map(connectorDatum -> connectorDatum.get(IDLE_TIMEOUT)) .map(idleTimeout -> Duration.parse(idleTimeout).toMilliseconds()) .min(Long::compareTo) <START> .orElse(DEFAULT_IDLE_TIMEOUT); <END> }</code><technical_language>Isnt this figure out idle timeout configuration. assume this DEFAULT_IDLE_TIMEOUT ms</technical_language>

Target:
private static long getMinimumTimeout(List<Map<String, String>> connectorData) { Optional<Long> minimum = connectorData.stream() .map(connectorDatum -> connectorDatum.get(IDLE_TIMEOUT)) .map(idleTimeout -> Duration.parse(idleTimeout).toMilliseconds()) .min(Long::compareTo); if (minimum.isPresent()) { return minimum.get(); } return logAndGetDefault(); }
Source:
<code>public static InetSocketAddress retrieveAddress(AsynchronousSocketChannel channel) { SocketAddress a = null; try { a = channel.getRemoteAddress(); } catch (IOException e) { <START> } <END> if (a != null && (a instanceof InetSocketAddress)) { return ((InetSocketAddress) a); } return null; }</code><technical_language>Need handle this exception</technical_language>

Target:
public static InetSocketAddress retrieveAddress(AsynchronousSocketChannel channel) { SocketAddress a = null; try { a = channel.getRemoteAddress(); } catch (IOException e) { logger.error("retrieveAddress channel exception: {}", e.getMessage()); } if (a != null && (a instanceof InetSocketAddress)) { return ((InetSocketAddress) a); } return null; }
Source:
<code>public static DryRunFormatType dryRunFormatType() { <START> return ConfigDefaults.getDryRunFormatType("DRYRUN_FORMAT_TYPE"); <END> }</code><technical_language>In Context Keys DRY_RUN_FORMAT_TYPE. change this consistent</technical_language>

Target:
public static DryRunFormatType dryRunFormatType() { return ConfigDefaults.getDryRunFormatType("DRY_RUN_FORMAT_TYPE"); }
Source:
<code>public AuthenticationInfo authenticate( @RequestBody AuthenticationCredentials authenticationCredentials) throws ApiException { ApiUtils.methodInvocationLog("authenticate", authenticationCredentials.getUsername()); restApiBusiness.getApiContext(httpServletRequest, false); <START> try(Connection connection = PlatformConnection.getInstance().getConnection()) { <END> return restApiBusiness .authenticate(authenticationCredentials, connection); } catch (SQLException ex) { throw new ApiException(ex); } }</code><technical_language>connection provider</technical_language>

Target:
public AuthenticationInfo authenticate( @RequestBody AuthenticationCredentials authenticationCredentials) throws ApiException { ApiUtils.methodInvocationLog("authenticate", authenticationCredentials.getUsername()); restApiBusiness.getApiContext(httpServletRequest, false); try(Connection connection = connectionSupplier.get()) { return restApiBusiness .authenticate(authenticationCredentials, connection); } catch (SQLException | SQLRuntimeException ex) { throw new ApiException(ex); } }
Source:
<code>public void testBuilder() { String prefix = "rya_"; String auth = "U"; String visibility = "U"; String user = "user"; String password = "password"; String instance = "instance"; String zookeeper = "zookeeper"; boolean useMock = true; boolean useComposite = true; boolean usePrefixHash = true; boolean useInference = true; boolean displayPlan = false; <START> AccumuloRdfConfiguration conf = new AccumuloRdfConfiguration().getBuilder() END> .auths(auth) .visibilities(visibility) .setRyaPrefix(prefix) .useInference(useInference) .useCompositeCardinality(useComposite) .displayQueryPlan(displayPlan) .setAccumuloInstance(instance) .setAccumuloPassword(password) .setAccumuloUser(user) .setAccumuloZooKeepers(zookeeper) .useMockAccumulo(useMock) .useAccumuloPrefixHashing(usePrefixHash) .build(); org.junit.Assert.assertEquals(conf.getTablePrefix(), prefix); org.junit.Assert.assertEquals(conf.getCv(), visibility); org.junit.Assert.assertEquals(conf.getAuthorizations(), new Authorizations(auth)); org.junit.Assert.assertEquals(conf.isInfer(), useInference); org.junit.Assert.assertEquals(conf.isUseCompositeCardinality(), useComposite); org.junit.Assert.assertEquals(conf.isDisplayQueryPlan(), displayPlan); org.junit.Assert.assertEquals(conf.getAccumuloInstance(), instance); org.junit.Assert.assertEquals(conf.getAccumuloPassword(), password); org.junit.Assert.assertEquals(conf.getAccumuloUser(), user); org.junit.Assert.assertEquals(conf.getAccumuloZookeepers(), zookeeper); org.junit.Assert.assertEquals(conf.getUseMockAccumulo(), useMock); org.junit.Assert.assertEquals(conf.isPrefixRowsWithHash(), usePrefixHash); }</code><technical_language>need "//" end of lines</technical_language>

Target:
public void testBuilder() { String prefix = "rya_"; String auth = "U"; String visibility = "U"; String user = "user"; String password = "password"; String instance = "instance"; String zookeeper = "zookeeper"; boolean useMock = false; boolean useComposite = true; boolean usePrefixHash = true; boolean useInference = true; boolean displayPlan = false; AccumuloRdfConfiguration conf = new AccumuloRdfConfiguration().getBuilder() .setAuths(auth) .setVisibilities(visibility) .setRyaPrefix(prefix) .setUseInference(useInference) .setUseCompositeCardinality(useComposite) .setDisplayQueryPlan(displayPlan) .setAccumuloInstance(instance) .setAccumuloPassword(password) .setAccumuloUser(user) .setAccumuloZooKeepers(zookeeper) .setUseMockAccumulo(useMock) .setUseAccumuloPrefixHashing(usePrefixHash) .build(); assertEquals(conf.getTablePrefix(), prefix); assertEquals(conf.getCv(), visibility); assertEquals(conf.getAuthorizations(), new Authorizations(auth)); assertEquals(conf.isInfer(), useInference); assertEquals(conf.isUseCompositeCardinality(), useComposite); assertEquals(conf.isDisplayQueryPlan(), displayPlan); assertEquals(conf.getAccumuloInstance(), instance); assertEquals(conf.getAccumuloPassword(), password); assertEquals(conf.getAccumuloUser(), user); assertEquals(conf.getAccumuloZookeepers(), zookeeper); assertEquals(conf.getUseMockAccumulo(), useMock); assertEquals(conf.isPrefixRowsWithHash(), usePrefixHash); }
Source:
<code>private String filterPropertiesAndGetGithubPrimaryEmail(List<Map<String, String>> properties) { List<Map<String, String>> primaryPublicGithubEmails = properties .stream() .filter( map -> map.get("primary").equals("true") && map.get("visibility").equals("public")) .collect(toList()); <START> return primaryPublicGithubEmails.get(0).get("email"); <END> }</code><technical_language>Check primaryPublicGithubEmails.size() > 0 avoid **NullPointerException**</technical_language>

Target:
private String filterPropertiesAndGetGithubPrimaryEmail(List<Map<String, String>> properties) { List<Map<String, String>> primaryPublicGithubEmails = properties .stream() .filter( map -> map.get("primary").equals("true") && map.get("visibility").equals("public")) .collect(toList()); if (primaryPublicGithubEmails.isEmpty()) { throw new NoSuchElementException("The list with github primary, public emails is empty"); } return primaryPublicGithubEmails.get(0).get("email"); }
Source:
<code>public static void main(String... args) throws Exception { String boltUrl = "%%BOLT_URL_PLACEHOLDER%%"; String user = "<Username for Neo4j Aura database>"; String password = "<Password for Neo4j Aura database>"; <START> Config config = Config.builder().withEncryption().build(); <END> try (DriverIntroductionExample app = new DriverIntroductionExample(boltUrl, user, password, config)) { app.createFriendship("Alice", "David"); app.findPerson("Alice"); } }</code><technical_language>a thought dropping this config in favor of neo4j+s scheme</technical_language>

Target:
public static void main(String... args) throws Exception { String boltUrl = "%%BOLT_URL_PLACEHOLDER%%"; String user = "<Username for Neo4j Aura database>"; String password = "<Password for Neo4j Aura database>"; Config config = Config.builder().withEncryption().build(); try (DriverIntroductionExample app = new DriverIntroductionExample(boltUrl, user, password, Config.defaultConfig())) { app.createFriendship("Alice", "David"); app.findPerson("Alice"); } }
Source:
<code>@Override public void getBindings(Map<String, Binding<?>> bindings) { for (Class<?> c = moduleClass; c != Object.class; c = c.getSuperclass()) { for (Method method : c.getDeclaredMethods()) { Provides provides = method.getAnnotation(Provides.class); if (provides != null) { Type genericReturnType = method.getGenericReturnType(); <START> if (genericReturnType instanceof ParameterizedType) { <END> Type rawType = ((ParameterizedType) genericReturnType).getRawType(); if (Provider.class.equals(rawType)) { throw new IllegalStateException("@Provides method must not return Provider directly: " + c.getName() + "." + method.getName()); } if (Lazy.class.equals(rawType)) { throw new IllegalStateException("@Provides method must not return Lazy directly: " + c.getName() + "." + method.getName()); } } String key = Keys.get(genericReturnType, method.getAnnotations(), method); switch (provides.type()) { case UNIQUE: handleBindings(bindings, method, key); break; case SET: handleSetBindings(bindings, method, key); break; default: throw new AssertionError("Unknown @Provides type " + provides.type()); } } } } }</code><technical_language>raw types? fail later</technical_language>

Target:
@Override public void getBindings(Map<String, Binding<?>> bindings) { for (Class<?> c = moduleClass; c != Object.class; c = c.getSuperclass()) { for (Method method : c.getDeclaredMethods()) { Provides provides = method.getAnnotation(Provides.class); if (provides != null) { Type genericReturnType = method.getGenericReturnType(); Type typeToCheck = genericReturnType; if (genericReturnType instanceof ParameterizedType) { typeToCheck = ((ParameterizedType) genericReturnType).getRawType(); } if (Provider.class.equals(typeToCheck)) { throw new IllegalStateException("@Provides method must not return Provider directly: " + c.getName() + "." + method.getName()); } if (Lazy.class.equals(typeToCheck)) { throw new IllegalStateException("@Provides method must not return Lazy directly: " + c.getName() + "." + method.getName()); } String key = Keys.get(genericReturnType, method.getAnnotations(), method); switch (provides.type()) { case UNIQUE: handleBindings(bindings, method, key); break; case SET: handleSetBindings(bindings, method, key); break; default: throw new AssertionError("Unknown @Provides type " + provides.type()); } } } } }
Source:
<code>public void nonVmWithSameMTUAddedToNic() { <START> Network net = createNetwork("VLanVmMtu9000"); <END> net.setvlan_id(100); net.setMtu(9000); Network newNet = createNetwork("nonVmMtu5000"); newNet.setVmNetwork(false); newNet.setMtu(9000); mockExistingNetworks(net, newNet); VdsNetworkInterface nic = createNic("nic0", null); VdsNetworkInterface nicWithVlan = createVlan(nic.getName(), net.getvlan_id(), net.getName()); nicWithVlan.setMtu(net.getMtu()); mockExistingIfaces(nic, nicWithVlan); nic.setNetworkName(newNet.getName()); SetupNetworksHelper helper = createHelper(createParametersForNics(nic, nicWithVlan)); validateAndExpectNoViolations(helper); }</code><technical_language>camel case: vlanVm - for entire patch</technical_language>

Target:
public void nonVmWithSameMTUAddedToNic() { Network net = createNetwork("vlanVmMtu9000"); net.setvlan_id(100); net.setMtu(9000); Network newNet = createNetwork("nonVmMtu9000"); newNet.setVmNetwork(false); newNet.setMtu(9000); mockExistingNetworks(net, newNet); VdsNetworkInterface nic = createNic("nic0", null); VdsNetworkInterface nicWithVlan = createVlan(nic.getName(), net.getvlan_id(), net.getName()); nicWithVlan.setMtu(net.getMtu()); mockExistingIfaces(nic, nicWithVlan); nic.setNetworkName(newNet.getName()); SetupNetworksHelper helper = createHelper(createParametersForNics(nic, nicWithVlan)); validateAndExpectNoViolations(helper); }
Source:
<code>protected void onInitUI() { super.onInitUI(); prev = new Hyperlink(Util.C.pagedChangeListPrev(), true, ""); prev.setVisible(false); next = new Hyperlink(Util.C.pagedChangeListNext(), true, ""); next.setVisible(false); table = new ChangeTable2() { { keysNavigation.add(new DoLinkCommand(0, 'p', Util.C .changeTablePagePrev(), prev)); keysNavigation.add(new DoLinkCommand(0, 'n', Util.C .changeTablePageNext(), next)); keysNavigation.add(new DoLinkCommand(0, '[', Util.C .changeTablePagePrev(), prev)); keysNavigation.add(new DoLinkCommand(0, ']', Util.C .changeTablePageNext(), next)); keysNavigation.add(new KeyCommand(0, 'R', Util.C.keyReloadSearch()) { @Override public void onKeyPress(final KeyPressEvent event) { Gerrit.display(getToken()); } }); } }; section = new ChangeTable2.Section(); table.addSection(section); table.setSavePointerId(anchorPrefix); <START> HorizontalPanel copySearchResultPanel = new HorizontalPanel(); copySearchResultPanel.add(new Label(Util.C.pagedCopySearchResults())); copySearchResultPanel.add(copySearchResult = new CopyableLabel("", false)); <END> setTitleFarEast(copySearchResultPanel); add(table); final HorizontalPanel buttons = new HorizontalPanel(); buttons.setStyleName(Gerrit.RESOURCES.css().changeTablePrevNextLinks()); buttons.add(prev); buttons.add(next); add(buttons); }</code><technical_language>If flash copy widgets disabled in user's preferences show text "Copy Search Results" for user do that. flash movie is created copyable label other widget focus on</technical_language>

Target:
protected void onInitUI() { super.onInitUI(); prev = new Hyperlink(Util.C.pagedChangeListPrev(), true, ""); prev.setVisible(false); next = new Hyperlink(Util.C.pagedChangeListNext(), true, ""); next.setVisible(false); table = new ChangeTable2() { { keysNavigation.add( new DoLinkCommand(0, 'p', Util.C.changeTablePagePrev(), prev), new DoLinkCommand(0, 'n', Util.C.changeTablePageNext(), next)); keysNavigation.add( new DoLinkCommand(0, '[', Util.C.changeTablePagePrev(), prev), new DoLinkCommand(0, ']', Util.C.changeTablePageNext(), next)); keysNavigation.add(new KeyCommand(0, 'R', Util.C.keyReloadSearch()) { @Override public void onKeyPress(final KeyPressEvent event) { Gerrit.display(getToken()); } }); } }; section = new ChangeTable2.Section(); table.addSection(section); table.setSavePointerId(anchorPrefix); if (CopyableLabel.isFlashEnabled()) { HorizontalPanel copySearchResultPanel = new HorizontalPanel(); copySearchResultPanel.add(new Label(Util.C.pagedCopySearchResults())); copySearchResultPanel.add(copySearchResult = new CopyableLabel("", false)); setTitleFarEast(copySearchResultPanel); } add(table); final HorizontalPanel buttons = new HorizontalPanel(); buttons.setStyleName(Gerrit.RESOURCES.css().changeTablePrevNextLinks()); buttons.add(prev); buttons.add(next); add(buttons); }
Source:
<code>JavaFile brewJava(int sdk, boolean debuggable, boolean useAndroidX) { <START> return JavaFile.builder(bindingClassName.packageName(), createType( <END> sdk, debuggable, useAndroidX)) .addFileComment("Generated code from Butter Knife. Do not modify!") .build(); }</code><technical_language>nit: pull createType call a local. I wrapping here</technical_language>

Target:
JavaFile brewJava(int sdk, boolean debuggable, boolean useAndroidX) { TypeSpec bindingConfiguration = createType(sdk, debuggable, useAndroidX); return JavaFile.builder(bindingClassName.packageName(), bindingConfiguration) .addFileComment("Generated code from Butter Knife. Do not modify!") .build(); }
Source:
<code>public TaskInstance findTaskById(Long taskId, boolean withSLA) { if( config.isRest() ) { Map<String, Object> valuesMap = new HashMap<String, Object>(); valuesMap.put(TASK_INSTANCE_ID, taskId); <START> String queryString = ""; <END> if(withSLA) { queryString = "?includeSLA=true"; } return makeHttpGetRequestAndCreateCustomResponse( build(loadBalancer.getUrl(), QUERY_URI + "/" + TASK_GET_URI + queryString, valuesMap), TaskInstance.class); } else { CommandScript script =new CommandScript( Collections.singletonList( (KieServerCommand) new DescriptorCommand( "QueryService", "getTaskById", new Object[]{taskId, withSLA}) ) ); ServiceResponse<TaskInstance> response = (ServiceResponse<TaskInstance>) executeJmsCommand( script, DescriptorCommand.class.getName(), "BPM" ).getResponses().get(0); throwExceptionOnFailure(response); if (shouldReturnWithNullResponse(response)) { return null; } return response.getResult(); } }</code><technical_language>dont need this, send of _withSLA_ always</technical_language>

Target:
public TaskInstance findTaskById(Long taskId, boolean withSLA) { if( config.isRest() ) { Map<String, Object> valuesMap = new HashMap<String, Object>(); valuesMap.put(TASK_INSTANCE_ID, taskId); return makeHttpGetRequestAndCreateCustomResponse( build(loadBalancer.getUrl(), QUERY_URI + "/" + TASK_GET_URI + "?withSLA=" + withSLA, valuesMap), TaskInstance.class); } else { CommandScript script = new CommandScript( Collections.singletonList( (KieServerCommand) new DescriptorCommand( "QueryService", "getTaskById", new Object[]{taskId, withSLA}) ) ); ServiceResponse<TaskInstance> response = (ServiceResponse<TaskInstance>) executeJmsCommand( script, DescriptorCommand.class.getName(), "BPM" ).getResponses().get(0); throwExceptionOnFailure(response); if (shouldReturnWithNullResponse(response)) { return null; } return response.getResult(); } }
Source:
<code>private static Credential refreshToken(Credential credential) throws IOException { try { credential.refreshToken(); return credential; } catch (NullPointerException e) { throw new IllegalStateException( "Couldn't refresh the OAuth token. Are you using a different client secrets file? If you " <START> + "want to use a different file, first clear your stored credentials: http://google-g" <END> + "enomics.readthedocs.org/en/latest/api-client-java/resetting_auth.html", e); } }</code><technical_language>change this message reflect actual stored credentials (cause link wont hold true) assuming String cacheDir = // stuff line 81 "Couldn't refresh OAuth token. client secrets? If so, need clear stored credentials removing file " + userDir</technical_language>

Target:
private Credential refreshToken(Credential credential) throws IOException { try { credential.refreshToken(); return credential; } catch (NullPointerException e) { throw new IllegalStateException( "Couldn't refresh the OAuth token. Are you using different client secrets? If so, you " + "need to first clear the stored credentials by removing the file at " + userDir.getPath(), e); } }
Source:
<code>public DestroyImageVDSCommandParameters createDestroyImageParameters() { StorageDomain storageDomain = storageDomainDao.get(getParameters().getStorageDomainId()); return new DestroyImageVDSCommandParameters(getStoragePoolId(), getParameters().getStorageDomainId(), getParameters().getImageGroupID(), Collections.singletonList(getParameters().getImageId()), getDiskImage().isWipeAfterDelete(), <START> storageDomain.getSupportsDiscard(), <END> true); }</code><technical_language>storageDomain.getDiscardAfterDelete() used</technical_language>

Target:
public DestroyImageVDSCommandParameters createDestroyImageParameters() { StorageDomain storageDomain = storageDomainDao.get(getParameters().getStorageDomainId()); return new DestroyImageVDSCommandParameters(getStoragePoolId(), getParameters().getStorageDomainId(), getParameters().getImageGroupID(), Collections.singletonList(getParameters().getImageId()), getDiskImage().isWipeAfterDelete(), storageDomain.getDiscardAfterDelete(), true); }
Source:
<code>public StreamAppenderMetrics(String prefix, MetricsRegistry registry) { super(prefix + "-", registry); bufferFillPct = newGauge("buffer-fill-percent", 0); recursiveCalls = newCounter("recursive-calls"); logMessagesDropped = newCounter("log-messages-dropped"); <START> logMessagesBytes = newCounter("log-messages-bytes"); <END> logMessagesCount = newCounter("log-messages-count"); logMessagesErrors = newCounter("log-messages-errors"); }</code><technical_language>log-messages-bytes-sent</technical_language>

Target:
public StreamAppenderMetrics(String prefix, MetricsRegistry registry) { super(prefix + "-", registry); bufferFillPct = newGauge("buffer-fill-percent", 0); recursiveCalls = newCounter("recursive-calls"); logMessagesDropped = newCounter("log-messages-dropped"); logMessagesErrors = newCounter("log-messages-errors"); logMessagesBytesSent = newCounter("log-messages-bytes-sent"); logMessagesCountSent = newCounter("log-messages-count-sent"); }
Source:
<code>private void onAckMessage( AffinityTopologyVersion topVer, ClusterNode node, DistributedMetaStorageUpdateAckMessage msg ) { GridFutureAdapter<Boolean> fut; updateFutsStopLock.readLock().lock(); try { fut = updateFuts.remove(msg.requestId()); } finally { <START> updateFutsStopLock.readLock().unlock(); <END> } if (fut != null) { String errorMsg = msg.errorMessage(); if (errorMsg == null) { Boolean res = msg instanceof DistributedMetaStorageCasAckMessage ? ((DistributedMetaStorageCasAckMessage)msg).updated() : null; fut.onDone(res); } else fut.onDone(new IllegalStateException(errorMsg)); } }</code><technical_language>Readlock useless here. Anyway, finish future in lines below</technical_language>

Target:
private void onAckMessage( AffinityTopologyVersion topVer, ClusterNode node, DistributedMetaStorageUpdateAckMessage msg ) { GridFutureAdapter<Boolean> fut = updateFuts.remove(msg.requestId()); if (fut != null) { String errorMsg = msg.errorMessage(); if (errorMsg == null) { Boolean res = msg instanceof DistributedMetaStorageCasAckMessage ? ((DistributedMetaStorageCasAckMessage)msg).updated() : null; fut.onDone(res); } else fut.onDone(new IllegalStateException(errorMsg)); } }
Source:
<code>public String getDisplayName() { <START> return "SetEnvBuildWrapper"; <END> }</code><technical_language>If put a name, wrappers start appearing in lists IIRC</technical_language>

Target:
public String getDisplayName() { return ""; }
Source:
<code>private void saveCommandCooldowns() { List<Object> serialized = new ArrayList<>(); for (Entry<Pattern, Long> entry : this.commandCooldowns.entrySet()) { if (entry.getValue() < System.currentTimeMillis()) { continue; } <START> HashMap<Object, Object> map = new HashMap<>(); <END> map.put("pattern", entry.getKey().pattern()); map.put("expiry", entry.getValue()); serialized.add(map); } config.setProperty("timestamps.command-cooldowns", serialized); save(); }</code><technical_language>Nitpick, this ImmutableMap (or coded interface). Super nitpick, other similar snippets coded interface well</technical_language>

Target:
private void saveCommandCooldowns() { List<Object> serialized = new ArrayList<>(); for (Entry<Pattern, Long> entry : this.commandCooldowns.entrySet()) { if (entry.getValue() < System.currentTimeMillis()) { continue; } Map<?, ?> map = ImmutableMap.builder() .put("pattern", entry.getKey().pattern()) .put("expiry", entry.getValue()) .build(); serialized.add(map); } config.setProperty("timestamps.command-cooldowns", serialized); save(); }
Source:
<code>private void zipFolder(String srcFolder, String destZipFile) { try { FileOutputStream fileWriter = new FileOutputStream(destZipFile); ZipOutputStream zip = new ZipOutputStream(fileWriter); addFolderContentsToZip(srcFolder, zip); zip.flush(); <START> zip.close(); <END> } catch (Exception ex) { getLog().error("Error occurred while creating CAR file. " + ex); } }</code><technical_language>move this finally block</technical_language>

Target:
private void zipFolder(String srcFolder, String destZipFile) throws ArchiveException { try (FileOutputStream fileWriter = new FileOutputStream(destZipFile); ZipOutputStream zip = new ZipOutputStream(fileWriter)) { addFolderContentsToZip(srcFolder, zip); zip.flush(); } catch (IOException ex) { throw new ArchiveException(Constants.ARCHIVE_EXCEPTION_MSG, ex); } }
Source:
<code>private void printStats(final int threadId, final long elapsedTime) { final Statistics pullStat = pullStats[threadId]; final Statistics pushStat = pushStats[threadId]; final Statistics requestStat = requestStats[threadId]; final Statistics pushWaitStat = pushWaitStats[threadId]; final Statistics pullWaitStat = pullWaitStats[threadId]; <START> LOG.log(Level.INFO, "PS Elapsed Time: {0}, PS Sum Pull: {1}, PS Avg Pull: {2}, PS Pull Count: {3}, " + <END> "PS Sum Push: {4}, PS Avg Push: {5}, PS Push Count: {6}, " + "PS Avg Request: {7}, PS Sum Request: {8}, PS Request Count: {9}, " + "PS Avg Push Wait: {10}, PS Sum Push Wait: {11}, " + "PS Avg Pull Wait: {12}, PS Sum Pull Wait: {13}", new Object[]{elapsedTime / 1e9D, Double.toString(pullStat.sum()), Double.toString(pullStat.avg()), pullStat.count(), Double.toString(pushStat.sum()), Double.toString(pushStat.avg()), pushStat.count(), Double.toString(requestStat.avg()), Double.toString(requestStat.sum()), requestStat.count(), Double.toString(pushWaitStat.avg()), Double.toString(pushWaitStat.sum()), Double.toString(pullWaitStat.avg()), Double.toString(pullWaitStat.sum())}); pushStat.reset(); pullStat.reset(); requestStat.reset(); pushWaitStat.reset(); pullWaitStat.reset(); startTimes[threadId] = ticker.read(); }</code><technical_language>append unit for metric? PS Elapsed Time: {0} s</technical_language>

Target:
private void printStats(final int threadId, final long elapsedTime) { final Statistics pullStat = pullStats[threadId]; final Statistics pushStat = pushStats[threadId]; final Statistics requestStat = requestStats[threadId]; final Statistics pushWaitStat = pushWaitStats[threadId]; final Statistics pullWaitStat = pullWaitStats[threadId]; LOG.log(Level.INFO, "PS Elapsed Time (sec): {0}, PS Sum Pull (sec): {1}, PS Avg Pull (sec): {2}, " + "PS Pull Count: {3}, PS Sum Push (sec): {4}, PS Avg Push (sec): {5}, PS Push Count: {6}, " + "PS Avg Request (sec): {7}, PS Sum Request (sec): {8}, PS Request Count: {9}, " + "PS Avg Push Wait (sec): {10}, PS Sum Push Wait (sec): {11}, " + "PS Avg Pull Wait (sec): {12}, PS Sum Pull Wait (sec): {13}", new Object[]{elapsedTime / 1e9D, Double.toString(pullStat.sum()), Double.toString(pullStat.avg()), pullStat.count(), Double.toString(pushStat.sum()), Double.toString(pushStat.avg()), pushStat.count(), Double.toString(requestStat.avg()), Double.toString(requestStat.sum()), requestStat.count(), Double.toString(pushWaitStat.avg()), Double.toString(pushWaitStat.sum()), Double.toString(pullWaitStat.avg()), Double.toString(pullWaitStat.sum())}); pushStat.reset(); pullStat.reset(); requestStat.reset(); pushWaitStat.reset(); pullWaitStat.reset(); startTimes[threadId] = ticker.read(); }
Source:
<code>private void initialize() { graphLoadService = new GraphLoadService(); <START> newickLoadService = new NewickLoadService(); <END> graphLoadService.setOnFailed(e -> new ExceptionDialog(root, graphLoadService.getException(), "Error loading file!")); graphLoadService.setOnRunning(e -> progressDialog.show()); graphLoadService.setOnSucceeded(e -> progressDialog.close()); graphLoadService.setOnCancelled(e -> Neo4jSingleton.getInstance().deleteDatabase()); }</code><technical_language>ExceptionDialog thrown fails loading in newick file</technical_language>

Target:
private void initialize() { graphLoadService = new GraphLoadService(); graphLoadService.setOnFailed(e -> new ExceptionDialog(root, graphLoadService.getException(), "Error loading graph files!")); graphLoadService.setOnRunning(e -> progressDialog.show()); graphLoadService.setOnSucceeded(e -> progressDialog.close()); newickLoadService = new NewickLoadService(); newickLoadService.setOnFailed(e -> new ExceptionDialog(root, newickLoadService.getException(), "Error loading newick file!")); }
Source:
<code>public Resource syncAsset(Resource resource) { try { this.session.refresh(true); Resource localRes = this.resourceResolver.getResource(resource.getPath()); Node node = localRes.adaptTo(Node.class); Asset asset = localRes.getParent().adaptTo(Asset.class); URI pathUi = new URI(null, null, asset.getPath(), null); String baseUrl = this.remoteAssetsConfig.getServer().concat(pathUi.toString()).concat("/_jcr_content/renditions/"); Iterator<? extends Rendition> renditions = asset.listRenditions(); while (renditions.hasNext()) { Rendition assetRendition = renditions.next(); if (StringUtils.isEmpty(assetRendition.getMimeType())) { continue; } String renditionName = assetRendition.getName(); URL url = new URL(String.format("%s%s", baseUrl, renditionName)); <START> HttpURLConnection connection = (HttpURLConnection) url.openConnection(); <END> connection.setRequestMethod("GET"); connection.setRequestProperty("Authorization", String.format("Basic %s", RemoteAssets.encodeForBasicAuth(this.remoteAssetsConfig))); if (LOG.isDebugEnabled()) { LOG.debug("syncing from remote asset url {}", url); } setRenditionOnAsset(connection, assetRendition, asset, renditionName); } node.setProperty("isRemoteAsset", (Value)null); node.setProperty("remoteSyncFailed", (Value)null); this.session.save(); return localRes; } catch (Exception e) { LOG.error("Error transferring remote asset '{}' to local server {}", resource.getPath(), e); try { this.session.refresh(false); } catch (RepositoryException re) { LOG.error("Failed to rollback asset changes", re); } return flagAssetAsFailedSync(resource); } }</code><technical_language>HTTPClient allow of AEM-configured proxy</technical_language>

Target:
public boolean syncAsset(Resource resource) { ResourceResolver remoteAssetsResolver = null; try { remoteAssetsResolver = this.remoteAssetsConfig.getResourceResolver(); Resource localRes = remoteAssetsResolver.getResource(resource.getPath()); Asset asset = DamUtil.resolveToAsset(localRes); URI pathUri = new URI(null, null, asset.getPath(), null); String baseUrl = this.remoteAssetsConfig.getServer().concat(pathUri.toString()).concat("/_jcr_content/renditions/"); Iterator<? extends Rendition> renditions = asset.listRenditions(); while (renditions.hasNext()) { Rendition assetRendition = renditions.next(); if (StringUtils.isEmpty(assetRendition.getMimeType())) { continue; } String renditionName = assetRendition.getName(); String remoteUrl = String.format("%s%s", baseUrl, renditionName); setRenditionOnAsset(remoteUrl, assetRendition, asset, renditionName); } ModifiableValueMap localResProps = localRes.adaptTo(ModifiableValueMap.class); localResProps.remove(RemoteAssets.IS_REMOTE_ASSET); localResProps.remove(RemoteAssets.REMOTE_SYNC_FAILED); remoteAssetsResolver.commit(); return true; } catch (Exception e) { LOG.error("Error transferring remote asset '{}' to local server", resource.getPath(), e); try { remoteAssetsResolver.revert(); } catch (Exception re) { LOG.error("Failed to rollback asset changes", re); } flagAssetAsFailedSync(remoteAssetsResolver, resource); } finally { this.remoteAssetsConfig.closeResourceResolver(remoteAssetsResolver); } return false; }
Source:
<code>private void checkAndResetGameOnScore(ActivateEvent event, EntityRef entity) { LASTeamComponent baseTeamComponent = entity.getComponent(LASTeamComponent.class); EntityRef player = event.getInstigator(); if (player.hasComponent(HasFlagComponent.class)) { if (player.getComponent(LASTeamComponent.class).team.equals(LASUtils.RED_TEAM)) { flag = LASUtils.BLACK_FLAG_URI; } if (player.getComponent(LASTeamComponent.class).team.equals(LASUtils.BLACK_TEAM)) { flag = LASUtils.RED_FLAG_URI; } EntityRef heldFlag = getHeldFlag(player); if (checkIfTeamScores(baseTeamComponent, heldFlag)) { incrementScore(baseTeamComponent); resetRound(baseTeamComponent, heldFlag); if (redScore == LASUtils.GOAL_SCORE) { <START> logger.info("sending red won"); <END> sendEventToClients(new GameoverEvent(LASUtils.RED_TEAM)); } if (blackScore == LASUtils.GOAL_SCORE) { logger.info("sending black won"); sendEventToClients(new GameoverEvent(LASUtils.BLACK_TEAM)); } } } }</code><technical_language>ready consider PR final want remove set debug logging debug level :-)</technical_language>

Target:
private void checkAndResetGameOnScore(ActivateEvent event, EntityRef entity) { LASTeamComponent baseTeamComponent = entity.getComponent(LASTeamComponent.class); EntityRef player = event.getInstigator(); if (player.hasComponent(HasFlagComponent.class)) { if (player.getComponent(LASTeamComponent.class).team.equals(LASUtils.RED_TEAM)) { flag = LASUtils.BLACK_FLAG_URI; } if (player.getComponent(LASTeamComponent.class).team.equals(LASUtils.BLACK_TEAM)) { flag = LASUtils.RED_FLAG_URI; } EntityRef heldFlag = getHeldFlag(player); if (checkIfTeamScores(baseTeamComponent, heldFlag)) { incrementScore(baseTeamComponent); resetRound(baseTeamComponent, heldFlag); if (redScore >= LASUtils.GOAL_SCORE) { sendEventToClients(new GameOverEvent(LASUtils.RED_TEAM)); } if (blackScore >= LASUtils.GOAL_SCORE) { sendEventToClients(new GameOverEvent(LASUtils.BLACK_TEAM)); } } } }
Source:
<code>public double getfreeDiskPercent() { <START> Integer usedDiskSize = getused_disk_size() == null ? 0 : getused_disk_size(); <END> Integer availableDiskSize = getavailable_disk_size() == null ? 0 : getavailable_disk_size(); double totalSize = usedDiskSize + availableDiskSize; return totalSize != 0 ? (availableDiskSize / totalSize) * (double) 100 : 0; }</code><technical_language>int</technical_language>

Target:
public double getfreeDiskPercent() { int usedDiskSize = getused_disk_size() == null ? 0 : getused_disk_size(); int availableDiskSize = getavailable_disk_size() == null ? 0 : getavailable_disk_size(); double totalSize = usedDiskSize + availableDiskSize; return totalSize != 0 ? (availableDiskSize / totalSize) * 100 : 0; }
Source:
<code>public List<ICompletionProposal> getCompletionProposals(AnnotationInfo info) { ArrayList<String> proposalNames = new ArrayList<String>(); <START> proposalNames.add("Surround with new element"); <END> ArrayList<ICompletionProposal> proposals = new ArrayList<ICompletionProposal>(); for(Annotation annotation : info.getAnnotations()){ if(annotation instanceof SimpleMarkerAnnotation){ for (ICompletionProposal proposal : getMarkerProposals((SimpleMarkerAnnotation)annotation, info.getPosition())) { if(!proposalNames.contains(proposal.getDisplayString())){ proposals.add(proposal); proposalNames.add(proposal.getDisplayString()); } } } else if(annotation instanceof TemporaryAnnotation){ for (ICompletionProposal proposal : getProposals((TemporaryAnnotation)annotation, info.getPosition())) { if(!proposalNames.contains(proposal.getDisplayString())){ proposals.add(proposal); proposalNames.add(proposal.getDisplayString()); } } } } return proposals; }</code><technical_language>avoid hardcoding proposal text here? reference original WTP proposal text if possible</technical_language>

Target:
public List<ICompletionProposal> getCompletionProposals(AnnotationInfo info) { ArrayList<String> proposalNames = new ArrayList<String>(); proposalNames.add(XMLUIMessages.SurroundWithNewElementQuickAssistProposal_1); ArrayList<ICompletionProposal> proposals = new ArrayList<ICompletionProposal>(); for(Annotation annotation : info.getAnnotations()){ if(annotation instanceof SimpleMarkerAnnotation){ for (ICompletionProposal proposal : getMarkerProposals((SimpleMarkerAnnotation)annotation, info.getPosition())) { if(!proposalNames.contains(proposal.getDisplayString())){ proposals.add(proposal); proposalNames.add(proposal.getDisplayString()); } } } else if(annotation instanceof TemporaryAnnotation){ for (ICompletionProposal proposal : getProposals((TemporaryAnnotation)annotation, info.getPosition())) { if(!proposalNames.contains(proposal.getDisplayString())){ proposals.add(proposal); proposalNames.add(proposal.getDisplayString()); } } } } return proposals; }
Source:
<code><START> public MetadataTermMapping(MetadataSource metadataSource, String metadataTermCode, OpenmrsMetadata referredObject) { <END> this(); ArgUtil.notNull(metadataSource, "metadataSource"); ArgUtil.notNull(metadataTermCode, "metadataTermCode"); setMetadataSource(metadataSource); setCode(metadataTermCode); if (referredObject != null) { setMappedObject(referredObject); } }</code><technical_language>chance add a constructor takes metadatsource metadataTermCode</technical_language>

Target:
public MetadataTermMapping(MetadataSource metadataSource, String metadataTermCode, OpenmrsMetadata referredObject) { this(); ArgUtil.notNull(metadataSource, "metadataSource"); ArgUtil.notNull(metadataTermCode, "metadataTermCode"); setMetadataSource(metadataSource); setCode(metadataTermCode); setMappedObject(referredObject); }
Source:
<code>public String toString() { <START> return subscribedPattern != null ? subscribedPattern.toString() : String.join(",", subscription); <END> }</code><technical_language>this is a general toString(), handle manual assignment well</technical_language>

Target:
public String toString() { return "SubscriptionState{" + "type=" + subscriptionType + ", subscribedPattern=" + subscribedPattern + ", subscription=" + String.join(",", subscription) + ", groupSubscription=" + String.join(",", groupSubscription) + ", defaultResetStrategy=" + defaultResetStrategy + ", assignment=" + assignment.partitionStateValues() + " (id=" + assignmentId + ")}"; }
Source:
<code>public Metric(Class<?> tableClass, String fieldName, AggregationDictionary dictionary) { super(tableClass, fieldName, dictionary); com.yahoo.elide.datastores.aggregation.annotation.Metric metric = dictionary.getAttributeOrRelationAnnotation( tableClass, com.yahoo.elide.datastores.aggregation.annotation.Metric.class, fieldName); if (metric == null) { throw new IllegalArgumentException(getId() + " is not a metric field"); } else { try { this.metricFunction = metric.function().newInstance(); <START> metricFunction.setName(getId() + "[" + metricFunction.getName() + "]"); <END> metricFunction.setExpression(String.format( metricFunction.getExpression(), dictionary.getColumnName(tableClass, fieldName))); } catch (InstantiationException | IllegalAccessException e) { throw new IllegalArgumentException("Can't initialize function for metric " + getId()); } } }</code><technical_language>remove else clause (but code block) remove level of nesting</technical_language>

Target:
public Metric(Class<?> tableClass, String fieldName, AggregationDictionary dictionary) { super(tableClass, fieldName, dictionary); com.yahoo.elide.datastores.aggregation.annotation.Metric metric = dictionary.getAttributeOrRelationAnnotation( tableClass, com.yahoo.elide.datastores.aggregation.annotation.Metric.class, fieldName); try { this.metricFunction = metric.function().newInstance(); metricFunction.setName(getId() + "[" + metricFunction.getName() + "]"); metricFunction.setExpression(String.format( metricFunction.getExpression(), dictionary.getColumnName(tableClass, fieldName))); } catch (InstantiationException | IllegalAccessException e) { throw new IllegalArgumentException("Can't initialize function for metric " + getId()); } }
Source:
<code>public File getSegmentFiles(DataSegment segment) throws SegmentLoadingException { Map<String, Object> loadSpec = segment.getLoadSpec(); Path location = Paths.get( MapUtils.getString(loadSpec, "locationsDir"), segment.getDataSource(), loadSpec.get("interval").toString(), <START> MapUtils.getString(loadSpec, "version")); <END> return location.toFile(); }</code><technical_language>); next line</technical_language>

Target:
public File getSegmentFiles(DataSegment segment) throws SegmentLoadingException { File segmentFile = new File(locations.get(segment.getVersion().hashCode() % locations.size()), DataSegmentPusher.getDefaultStorageDir(segment)); segmentFile.mkdirs(); return segmentFile; }
Source:
<code>void bindModels() { bind(AdElementListModel.class).to(UserPortalAdElementListModel.class); bind(UserPortalBasicListModel.class).in(Singleton.class); bind(VmBasicDiskListModel.class).in(Singleton.class); bind(UserPortalListModel.class).in(Singleton.class); bind(VmGeneralModel.class).in(Singleton.class); bind(PoolGeneralModel.class).in(Singleton.class); bind(VmInterfaceListModel.class).in(Singleton.class); bind(VmDiskListModel.class).in(Singleton.class); bind(PoolDiskListModel.class).in(Singleton.class); bind(UserPortalVmSnapshotListModel.class).in(Singleton.class); bind(new TypeLiteral<UserPortalPermissionListModel<UserPortalListModel>>(){}).in(Singleton.class); bind(UserPortalVmEventListModel.class).in(Singleton.class); bind(new TypeLiteral<VmAppListModel<VM>>() {}).in(Singleton.class); <START> bind(new TypeLiteral<VmGuestContainerListModel>() {}).in(Singleton.class); <END> bind(VmMonitorModel.class).in(Singleton.class); bind(PoolInterfaceListModel.class).in(Singleton.class); bind(VmGuestInfoModel.class).in(Singleton.class); bind(UserPortalTemplateListModel.class).in(Singleton.class); bind(TemplateGeneralModel.class).in(Singleton.class); bind(TemplateInterfaceListModel.class).in(Singleton.class); bind(new TypeLiteral<UserPortalPermissionListModel<VmTemplate>>(){}).in(Singleton.class); bind(UserPortalTemplateDiskListModel.class).in(Singleton.class); bind(UserPortalTemplateEventListModel.class).in(Singleton.class); bind(ResourcesModel.class).in(Singleton.class); }</code><technical_language>VmGuestContainerListModel is longer generic need TypeLiteral anymore. A simple bind(VmGuestContainerListModel.class).in(Singleton.class) is sufficient</technical_language>

Target:
void bindModels() { bind(AdElementListModel.class).to(UserPortalAdElementListModel.class); bind(UserPortalBasicListModel.class).in(Singleton.class); bind(VmBasicDiskListModel.class).in(Singleton.class); bind(UserPortalListModel.class).in(Singleton.class); bind(VmGeneralModel.class).in(Singleton.class); bind(PoolGeneralModel.class).in(Singleton.class); bind(VmInterfaceListModel.class).in(Singleton.class); bind(VmDiskListModel.class).in(Singleton.class); bind(PoolDiskListModel.class).in(Singleton.class); bind(UserPortalVmSnapshotListModel.class).in(Singleton.class); bind(new TypeLiteral<UserPortalPermissionListModel<UserPortalListModel>>(){}).in(Singleton.class); bind(UserPortalVmEventListModel.class).in(Singleton.class); bind(new TypeLiteral<VmAppListModel<VM>>() {}).in(Singleton.class); bind(VmGuestContainerListModel.class).in(Singleton.class); bind(VmMonitorModel.class).in(Singleton.class); bind(PoolInterfaceListModel.class).in(Singleton.class); bind(VmGuestInfoModel.class).in(Singleton.class); bind(UserPortalTemplateListModel.class).in(Singleton.class); bind(TemplateGeneralModel.class).in(Singleton.class); bind(TemplateInterfaceListModel.class).in(Singleton.class); bind(new TypeLiteral<UserPortalPermissionListModel<VmTemplate>>(){}).in(Singleton.class); bind(UserPortalTemplateDiskListModel.class).in(Singleton.class); bind(UserPortalTemplateEventListModel.class).in(Singleton.class); bind(ResourcesModel.class).in(Singleton.class); }
Source:
<code>@Override public Pair<RelTraitSet, List<RelTraitSet>> deriveTraits( final RelTraitSet childTraits, final int childId) { assert childId == 0; final RelCollation collation = childTraits.getCollation(); if (collation == null || collation == RelCollations.EMPTY) { return null; } final RelTraitSet traits = traitSet.replace(collation); <START> return Pair.of(traits, ImmutableList.of(traits)); <END> }</code><technical_language>list right child's desired traitset</technical_language>

Target:
@Override public Pair<RelTraitSet, List<RelTraitSet>> deriveTraits( final RelTraitSet childTraits, final int childId) { assert childId == 0; final RelCollation collation = childTraits.getCollation(); if (collation == null || collation == RelCollations.EMPTY) { return null; } final RelTraitSet traits = traitSet.replace(collation); return Pair.of(traits, ImmutableList.of(traits, right.getTraitSet())); }