auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public static String digest(String script) { try { <START> return new String(MessageDigest.getInstance("MD5").digest(script.getBytes())); <END> } catch (NoSuchAlgorithmException e) { return script; } }</code><technical_language>define a final CONSTANT for MD5</technical_language>

Target:
public static String digest(String script) { try { return new String(MessageDigest.getInstance(MD5).digest(script.getBytes())); } catch (NoSuchAlgorithmException e) { logger.error("No algorithm found, digest will use the script content", e); return script; } }
Source:
<code>public void loadConfiguredFileSystem() throws Exception { abfsConfig.setBoolean(AZURE_CREATE_REMOTE_FILESYSTEM_DURING_INITIALIZATION, false); String[] authorityParts = <START> (new java.net.URI(rawConfig.get(FS_AZURE_CONTRACT_TEST_URI))).getRawAuthority().split( <END> AbfsHttpConstants.AZURE_DISTRIBUTED_FILE_SYSTEM_AUTHORITY_DELIMITER, 2);; this.fileSystemName = authorityParts[0]; final String abfsUrl = this.getFileSystemName() + "@" + this.getAccountName(); URI defaultUri = null; defaultUri = new URI(abfsScheme, abfsUrl, null, null, null); this.testUrl = defaultUri.toString(); abfsConfig.set(CommonConfigurationKeysPublic.FS_DEFAULT_NAME_KEY, defaultUri.toString()); useConfiguredFileSystem = true; }</code><technical_language>URI</technical_language>

Target:
public void loadConfiguredFileSystem() throws Exception { abfsConfig.setBoolean(AZURE_CREATE_REMOTE_FILESYSTEM_DURING_INITIALIZATION, false); String[] authorityParts = (new URI(rawConfig.get(FS_AZURE_CONTRACT_TEST_URI))).getRawAuthority().split( AbfsHttpConstants.AZURE_DISTRIBUTED_FILE_SYSTEM_AUTHORITY_DELIMITER, 2); this.fileSystemName = authorityParts[0]; final String abfsUrl = this.getFileSystemName() + "@" + this.getAccountName(); URI defaultUri = null; defaultUri = new URI(abfsScheme, abfsUrl, null, null, null); this.testUrl = defaultUri.toString(); abfsConfig.set(CommonConfigurationKeysPublic.FS_DEFAULT_NAME_KEY, defaultUri.toString()); useConfiguredFileSystem = true; }
Source:
<code>private int zigzagDecode(int input) { <START> return (input >> 1) ^ (-(input & 1)); <END> }</code><technical_language>I notice in unzigzag method below, unsigned right shift operator (>>>), signed (>>). Is intentional</technical_language>

Target:
private int zigzagDecode(int input) { return (input >>> 1) ^ (-(input & 1)); }
Source:
<code>public void deleteUpdateCacheStorageTest() { CacheStorageImpl cache = new CacheStorageImpl(); <START> final Map<Identifier, OperatorState> queryState1= new HashMap<>(); <END> queryState1.put(oid1, value1); cache.create(qid1, queryState1); Assert.assertEquals(value1, cache.read(qid1, oid1)); Assert.assertEquals(true, cache.delete(qid1)); Assert.assertEquals(false, cache.update(qid1, oid1, value2)); }</code><technical_language>1 =</technical_language>

Target:
public void deleteUpdateCacheStorageTest() { final CacheStorage cache = new CacheStorageImpl(); final Map<Identifier, OperatorState> queryState1 = new HashMap<>(); queryState1.put(oid1, value1); cache.create(qid1, queryState1); Assert.assertEquals(value1, cache.read(qid1, oid1)); Assert.assertTrue(cache.delete(qid1)); Assert.assertFalse(cache.update(qid1, oid1, value2)); }
Source:
<code>protected String doInBackground(String... url) { url[0] = url[0].replaceAll("https://", "").replaceAll("http://", ""); try { if (isHttpsWebsite(url[0])) return ("https://" + url[0]); else if (isHttpWebsite(url[0])) return ("http://" + url[0]); else return (null); } catch (IOException e) { <START> e.printStackTrace(); <END> return (null); } }</code><technical_language>Log.e</technical_language>

Target:
protected String doInBackground(String... url) { String newUrl = url[0].replaceAll("https://", "").replaceAll("http://", ""); try { if (isHttpsWebsite(newUrl)) return ("https://" + newUrl); else if (isHttpWebsite(newUrl)) return ("http://" + newUrl); else return ("https://" + newUrl); } catch (IOException e) { e.printStackTrace(); return ("https://" + newUrl); } }
Source:
<code>public void filteredMessage(HttpMessage msg, String reason) { try { <START> filterMessageTableModel.addScanResult(SessionStructure.getNodeName(msg), reason); <END> } catch (URIException e) { log.error( "Error while adding message information to filter message table model: " + e.getMessage(), e); } }</code><technical_language>URI message instead of node name</technical_language>

Target:
public void filteredMessage(HttpMessage msg, String reason) { filterMessageTableModel.addResult(msg.getRequestHeader().getURI().toString(), reason); }
Source:
<code><START> public static boolean isSlightTurn(int type) { <END> return !isLeftTurn(type) && !isRightTurn(type) && type != TU && type != TRU && type != OFFR; }</code><technical_language>This evaluates stays isLeftTurn return true, in case is slight left turn</technical_language>

Target:
public static boolean isSlightTurn(int type) { return type == TSLL || type == TSLR || type == C || type == KL || type == KR; }
Source:
<code>public void validate() { Matcher matcher = pattern.matcher(name); <START> if (!matcher.find()) { <END> throw new MalformedPluginConfigurationException( String.format("Invalid plugin name: %s", name)); } }</code><technical_language>matcher.matches I</technical_language>

Target:
public void validate() { if (!PLUGIN_NAME_PATTERN.matcher(name).matches()) { throw new MalformedPluginConfigurationException( String.format("Invalid plugin name: %s", name)); } }
Source:
<code>public QueryMemoryInfo(QueryId queryId, MemoryPoolId memoryPoolId, long memoryReservation) { <START> this.queryId = queryId; <END> this.memoryPoolId = memoryPoolId; this.memoryReservation = memoryReservation; }</code><technical_language>check null</technical_language>

Target:
public QueryMemoryInfo(QueryId queryId, MemoryPoolId memoryPoolId, long memoryReservation) { this.queryId = requireNonNull(queryId, "queryId is null"); this.memoryPoolId = requireNonNull(memoryPoolId, "memoryPoolId is null"); this.memoryReservation = memoryReservation; }
Source:
<code>protected void onInit() throws ServletException { SubdomainResolver subdomainResolver = new SubdomainResolver(); subdomainResolver.setBaseDomainName(getConfig().get("stormpath.web.application.domain")); DefaultOrganizationNameKeyResolver organizationNameKeyResolver = new DefaultOrganizationNameKeyResolver(); organizationNameKeyResolver.setSubdomainResolver(subdomainResolver); DefaultSamlOrganizationResolver samlOrganizationResolver = new DefaultSamlOrganizationResolver(); samlOrganizationResolver.setOrganizationNameKeyResolver(organizationNameKeyResolver); SamlController controller = new SamlController(); controller.setServerUriResolver(new DefaultServerUriResolver()); controller.setSamlUri("/"); <START> controller.setCallbackUri(getConfig().get("stormpath.web.saml.result.uri")); <END> controller.setAlreadyLoggedInUri(getConfig().getLoginControllerConfig().getNextUri()); controller.setSamlOrganizationResolver(samlOrganizationResolver); controller.init(); setController(controller); super.onInit(); }</code><technical_language>FYI: this property renamed stormpath.web.callback.uri: <LINK_0></technical_language>

Target:
protected void onInit() throws ServletException { super.onInit(); }
Source:
<code>public void createAnonAccessDeniedTest() throws Exception { <START> context.turnOffAuthorisationSystem(); <END> ObjectMapper mapper = new ObjectMapper(); EPersonRest data = new EPersonRest(); EPersonRest dataFull = new EPersonRest(); MetadataRest metadataRest = new MetadataRest(); data.setEmail("createtest@fake-email.com"); data.setCanLogIn(true); MetadataValueRest surname = new MetadataValueRest(); surname.setValue("Doe"); metadataRest.put("eperson.lastname", surname); MetadataValueRest firstname = new MetadataValueRest(); firstname.setValue("John"); metadataRest.put("eperson.firstname", firstname); data.setMetadata(metadataRest); dataFull.setEmail("createtestFull@fake-email.com"); dataFull.setCanLogIn(true); dataFull.setMetadata(metadataRest); getClient().perform(post("/api/eperson/epersons") .content(mapper.writeValueAsBytes(data)) .contentType(contentType) .param("projection", "full")) .andExpect(status().isUnauthorized()); }</code><technical_language>This *must* a context.restoreAuthSystemState(); in this method done creating content</technical_language>

Target:
public void createAnonAccessDeniedTest() throws Exception { context.turnOffAuthorisationSystem(); ObjectMapper mapper = new ObjectMapper(); EPersonRest data = new EPersonRest(); EPersonRest dataFull = new EPersonRest(); MetadataRest metadataRest = new MetadataRest(); data.setEmail("createtest@fake-email.com"); data.setCanLogIn(true); MetadataValueRest surname = new MetadataValueRest(); surname.setValue("Doe"); metadataRest.put("eperson.lastname", surname); MetadataValueRest firstname = new MetadataValueRest(); firstname.setValue("John"); metadataRest.put("eperson.firstname", firstname); data.setMetadata(metadataRest); dataFull.setEmail("createtestFull@fake-email.com"); dataFull.setCanLogIn(true); dataFull.setMetadata(metadataRest); context.restoreAuthSystemState(); getClient().perform(post("/api/eperson/epersons") .content(mapper.writeValueAsBytes(data)) .contentType(contentType) .param("projection", "full")) .andExpect(status().isUnauthorized()); getClient().perform(get("/api/eperson/epersons/search/byEmail") .param("email", data.getEmail())) .andExpect(status().isNoContent()); }
Source:
<code>private void validateDistanceSortField(ExtendedSearchIntegrator extendedIntegrator, SortField sortField) { <START> String field = sortField.getField(); <END> boolean indexedField = false; for ( Class<?> clazz : classesAndSubclasses ) { IndexedTypeDescriptor indexedTypeDescriptor = extendedIntegrator.getIndexedTypeDescriptor( clazz ); FieldDescriptor fieldDescriptor = indexedTypeDescriptor.getIndexedField( field ); if ( fieldDescriptor != null ) { indexedField = true; if ( fieldDescriptor.getType() != Type.SPATIAL ) { throw log.distanceSortRequiresSpatialField( field ); } } } if ( !indexedField ) { throw log.sortRequiresIndexedField( field ); } }</code><technical_language>This null for some sorts (e.g. doc id)</technical_language>

Target:
private void validateDistanceSortField(ExtendedSearchIntegrator extendedIntegrator, SortField sortField) { boolean indexedField = false; String field = sortField.getField(); if ( field != null ) { for ( Class<?> clazz : classesAndSubclasses ) { IndexedTypeDescriptor indexedTypeDescriptor = extendedIntegrator.getIndexedTypeDescriptor( clazz ); FieldDescriptor fieldDescriptor = indexedTypeDescriptor.getIndexedField( field ); if ( fieldDescriptor != null ) { indexedField = true; if ( fieldDescriptor.getType() != Type.SPATIAL ) { throw log.distanceSortRequiresSpatialField( field ); } break; } } } if ( !indexedField ) { throw log.sortRequiresIndexedField( sortField.getClass(), field ); } }
Source:
<code>private void subscribeToAlternate() { <START> ssub.set(alternate.unsafeSubscribe(new AlternateSubscriber<T>(child, arbiter))); <END> }</code><technical_language>Instead: java AlternateSubscriber<T> = new AlternateSubscriber<T>(child, arbiter); ssub.set(as); alternate.unsafeSubscribe(as);</technical_language>

Target:
private void subscribeToAlternate() { AlternateSubscriber<T> as = new AlternateSubscriber<T>(child, arbiter); ssub.set(as); alternate.unsafeSubscribe(as); }
Source:
<code>public void onMessage(final ByteBuffer buffer) { final Request request = AbstractServerWebSocketHandler.Decoder.parseRequest(buffer); if (request.getRequestType() == Request.MessageType.TIME) { final Request rsp = TimeManager.decodeRequest(request); if (rsp != null) { try { this.getParentManager().send(rsp, request.getSessionInfo(), LoginClientWebSocket.class); } catch (ConnectionException e) { LOG.info(LoggingConstants.EXCEPTION_MESSAGE, e); } } return; } if (request.getRequestType() == Request.MessageType.LOGIN) { LoginInformation login = null; try { login = LoginInformation.parseFrom(request.getOtherData()); } catch (InvalidProtocolBufferException e) { LOG.info(LoggingConstants.EXCEPTION_MESSAGE, e); } final LoginConnectionState state = (LoginConnectionState) getStateFromId(request.getSessionInfo()); state.addTry(); if (login == null) { <START> LOG.info("Login failed to get to the client"); <END> final Request result = ProxyConnectionManager.createClientRequest(request); final Request.Builder errorMessage = Request.newBuilder(result); errorMessage.setResponseText(errorMessage.getResponseText() + " : The data sent back from the login server was not the correct format"); this.getParentServer().send(getConnectionFromState(state), result); return; } loginUser(login, request, state); createUser(login, request); } }</code><technical_language>this error please</technical_language>

Target:
public void onMessage(final ByteBuffer buffer) { final Request request = AbstractServerWebSocketHandler.Decoder.parseRequest(buffer); if (request.getRequestType() == Request.MessageType.TIME) { final Request rsp = TimeManager.decodeRequest(request); if (rsp != null) { try { this.getParentManager().send(rsp, request.getSessionInfo(), LoginClientWebSocket.class); } catch (ConnectionException e) { LOG.error(LoggingConstants.EXCEPTION_MESSAGE, e); } } return; } if (request.getRequestType() == Request.MessageType.LOGIN) { LoginInformation login = null; try { login = LoginInformation.parseFrom(request.getOtherData()); } catch (InvalidProtocolBufferException e) { LOG.error(LoggingConstants.EXCEPTION_MESSAGE, e); } final LoginConnectionState state = (LoginConnectionState) getStateFromId(request.getSessionInfo()); state.addTry(); if (login == null) { LOG.error("Login failed to get to the client"); final Request result = ProxyConnectionManager.createClientRequest(request); final Request.Builder errorMessage = Request.newBuilder(result); errorMessage.setResponseText(errorMessage.getResponseText() + " : The data sent back from the login server was not the correct format"); this.getParentServer().send(getConnectionFromState(state), result); return; } loginUser(login, request, state); createUser(login, request); } }
Source:
<code>public double joinSelectivity(Optimizable optTable, ConglomerateDescriptor currentCd, long innerRowCount, long outerRowCount, SelectivityUtil.SelectivityJoinType selectivityJoinType) throws StandardException { double selectivity = 0.0d; switch(selectivityJoinType) { case LEFTOUTER: case FULLOUTER: selectivity = 1.0d/innerRowCount; break; case INNER: <START> case ANTIJOIN: selectivity = (1.0d-.1d)*(1.0d-.1d)/Math.max(innerRowCount,outerRowCount); if ((optTable instanceof FromTable && ((FromTable) optTable).getExistsTable())) { if (outerRowCount >= innerRowCount) { selectivity = (1 - .1d) / outerRowCount; if (selectivityJoinType == SelectivityUtil.SelectivityJoinType.ANTIJOIN) { selectivity = (1 - .1d) / outerRowCount * (outerRowCount - innerRowCount) / innerRowCount; } } else { selectivity = (1 - .1d)/innerRowCount; if (selectivityJoinType == SelectivityUtil.SelectivityJoinType.ANTIJOIN) { selectivity = 0.1 * selectivity; } } } break; } return selectivity; <END> }</code><technical_language>clearer distinguish ANTI, overriding selectivity instead of value. suggestion selectivity = 0.9d * / Math.max(innerRowCount, outerRowCount); if ( !(optTable instanceof FromTable) || !((FromTable) optTable).getExistsTable())) { selectivity *= 0.9d; } break; case ANTIJOIN: if ((optTable instanceof FromTable && ((FromTable) optTable).getExistsTable())) { if (outerRowCount >= innerRowCount) { // output row = left null row - output row estimated for inclusion join selectivity = 0.9d / innerRowCount - 1 / outerRowCount } else { // assumption, row returned, conservative, // assume 10% selectivity left rows selectivity = 0.1 * 0.9d / innerRowCount; } }</technical_language>

Target:
public double joinSelectivity(Optimizable optTable, ConglomerateDescriptor currentCd, long innerRowCount, long outerRowCount, SelectivityUtil.SelectivityJoinType selectivityJoinType) throws StandardException { double selectivity = 0.0d; switch(selectivityJoinType) { case LEFTOUTER: case FULLOUTER: selectivity = 1.0d/innerRowCount; break; case ANTIJOIN: if (outerRowCount >= innerRowCount) { selectivity = (1 - .1d) / outerRowCount * (outerRowCount - innerRowCount) / innerRowCount; } else { selectivity = (1 - .1d)/innerRowCount; selectivity = 0.1 * selectivity; } break; case INNER: selectivity = (1.0d-.1d)*(1.0d-.1d)/Math.max(innerRowCount,outerRowCount); if ((optTable instanceof FromTable && ((FromTable) optTable).getExistsTable())) { if (outerRowCount >= innerRowCount) { selectivity = (1 - .1d) / outerRowCount; } else { selectivity = (1 - .1d)/innerRowCount; } } break; } return selectivity; }
Source:
<code>CompactionDetails getCompactionDetails(BlobStore blobStore) throws StoreException { <START> CompactionPolicyFactory compactionPolicyFactory; <END> try { compactionPolicyFactory = Utils.getObj(storeConfig.storeCompactionPolicyFactory, storeConfig, time); } catch (Exception e) { throw new IllegalStateException("Error creating compaction policy for store " + blobStore.toString()); } return blobStore.getCompactionDetails(compactionPolicyFactory.getCompactionPolicy()); }</code><technical_language>instantiation of CompactionPolicyFactory happen in constructor, right? factory type change while running</technical_language>

Target:
private CompactionDetails getCompactionDetails(BlobStore blobStore) throws StoreException { return blobStore.getCompactionDetails(compactionPolicy); }
Source:
<code>protected List<MergedAnomalyResultDTO> retrieveAnomaliesFromDatabase(List<MergedAnomalyResultDTO> generated) { AnomalySlice effectiveSlice = this.slice.withDetectionId(this.config.getId()) .withStart(this.getStartTime(generated) - this.maxGap - 1) .withEnd(this.getEndTime(generated) + this.maxGap + 1); Collection<MergedAnomalyResultDTO> anomalies = this.provider.fetchAnomalies(Collections.singleton(effectiveSlice)).get(effectiveSlice); <START> return anomalies.stream().filter(anomaly -> !anomaly.isChild()).collect(Collectors.toList()); <END> }</code><technical_language>this merger retrieve handle anomalies SLA type</technical_language>

Target:
protected List<MergedAnomalyResultDTO> retrieveAnomaliesFromDatabase(List<MergedAnomalyResultDTO> generated) { List<MergedAnomalyResultDTO> retrieved = super.retrieveAnomaliesFromDatabase(generated); return new ArrayList<>(Collections2.filter(retrieved, anomaly -> !anomaly.isChild() && anomaly.getAnomalyResultSource().equals(AnomalyResultSource.DATA_QUALITY_DETECTION) )); }
Source:
<code>public void unacknowledgeAlarm(OnmsAlarm alarm, Date now) { LOG.info("Un-Acknowledging alarm with id: @ {}", alarm.getId(), now); final OnmsAlarm alarmInTrans = alarmDao.get(alarm.getId()); if (alarmInTrans == null) { LOG.warn("Alarm disappeared: {}. Skipping un-ack.", alarm); return; } <START> OnmsAcknowledgment ack = new OnmsAcknowledgment(alarm, DEFAULT_USER, now); <END> ack.setAckAction(AckAction.UNACKNOWLEDGE); acknowledgmentDao.processAck(ack); }</code><technical_language>Similarly here: suggestion OnmsAcknowledgment ack = new OnmsAcknowledgment(alarmInTrans, DEFAULT_USER, now);</technical_language>

Target:
public void unacknowledgeAlarm(OnmsAlarm alarm, Date now) { LOG.info("Un-Acknowledging alarm with id: @ {}", alarm.getId(), now); final OnmsAlarm alarmInTrans = alarmDao.get(alarm.getId()); if (alarmInTrans == null) { LOG.warn("Alarm disappeared: {}. Skipping un-ack.", alarm); return; } OnmsAcknowledgment ack = new OnmsAcknowledgment(alarmInTrans, DEFAULT_USER, now); ack.setAckAction(AckAction.UNACKNOWLEDGE); acknowledgmentDao.processAck(ack); }
Source:
<code>@Override public void handle(IgniteBiTuple<WALPointer, WALRecord> record) { initIfRequired(); <START> byte[] writes = (DEFAULT_WAL_RECORD_PREFIX + record.get2() + "\n").getBytes(Charset.forName("utf-8")); <END> int written = 0; try { while ((written += fileToWrite.writeFully(writes, written, writes.length - written)) < writes.length); } catch (IOException ex) { throw new IgniteException(ex); } }</code><technical_language>Please StandardCharsets#UTF_8 constant</technical_language>

Target:
@Override public void handle(IgniteBiTuple<WALPointer, WALRecord> record) { initIfRequired(); byte[] writes = (DEFAULT_WAL_RECORD_PREFIX + record.get2() + "\n").getBytes(StandardCharsets.UTF_8); int written = 0; try { while ((written += fileToWrite.writeFully(writes, written, writes.length - written)) < writes.length); } catch (IOException ex) { throw new IgniteException(ex); } }
Source:
<code>public void testCaseSensitiveIndexNamesInGridCacheQueryManager() throws Exception { inlineSize = 1; String idxName1 = "test_v1_IDX"; String idxName2 = "test_v1_idx"; Ignite ignite = startGrids(1); ignite.cluster().active(true); <START> class TestValue implements Serializable { <END> private TestValue(int v1) { this.v1 = v1; } @QuerySqlField private final int v1; } CacheConfiguration ccfg = new CacheConfiguration() .setName("testIndexesCache") .setSqlSchema("PUBLIC") .setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL) .setIndexedTypes(Integer.class, TestValue.class); IgniteCache cache = ignite.createCache(ccfg); cache.query(new SqlFieldsQuery("CREATE INDEX \""+idxName1+"\" on \"1TESTVALUE\" (v1)")).getAll(); cache.query(new SqlFieldsQuery("CREATE INDEX \""+idxName2+"\" on \"1TESTVALUE\" (v1)")).getAll(); GridCacheQueryManager cmgr = ((IgniteCacheProxy)cache).context().queries(); assertTrue("Index " + idxName1 + " not found in meta", indexExists(cmgr.sqlMetadata(), idxName1)); assertTrue("Index " + idxName2 + " not found in meta", indexExists(cmgr.sqlMetadata(), idxName2)); assertTrue("Index " + idxName1 + " not found in meta v2", indexExists(cmgr.sqlMetadataV2(), idxName1)); assertTrue("Index " + idxName1 + " not found in meta v2", indexExists(cmgr.sqlMetadataV2(), idxName2)); }</code><technical_language>Please org.apache.ignite.client.Person instead of class</technical_language>

Target:
public void testCaseSensitiveIndexNamesInGridCacheQueryManager() throws Exception { inlineSize = 1; String idxName1 = "test_v1_IDX"; String idxName2 = idxName1.toLowerCase(); Ignite ignite = startGrids(1); ignite.cluster().active(true); CacheConfiguration ccfg = new CacheConfiguration("testIndexesCache"); ccfg.setIndexedTypes(Integer.class, Person.class); IgniteCache cache = ignite.createCache(ccfg); cache.query(new SqlFieldsQuery("CREATE INDEX \""+idxName1+"\" on \"PERSON\" (name)")).getAll(); cache.query(new SqlFieldsQuery("CREATE INDEX \""+idxName2+"\" on \"PERSON\" (name)")).getAll(); GridCacheQueryManager cmgr = ((IgniteCacheProxy)cache).context().queries(); assertTrue("Index " + idxName1 + " not found in meta", indexExists(cmgr.sqlMetadata(), idxName1)); assertTrue("Index " + idxName2 + " not found in meta", indexExists(cmgr.sqlMetadata(), idxName2)); assertTrue("Index " + idxName1 + " not found in meta v2", indexExists(cmgr.sqlMetadataV2(), idxName1)); assertTrue("Index " + idxName2 + " not found in meta v2", indexExists(cmgr.sqlMetadataV2(), idxName2)); }
Source:
<code>private void expandInRemoteSystemView( IViewPart remoteSystemView, IFileStore fileStore) { Viewer viewer = getViewer(remoteSystemView); <START> Object input = viewer.getInput(); <END> ArrayList<String> names = createSegmentNames(fileStore); ArrayList<Object> treeSegments = new ArrayList<Object>(); for (String name : names) { if (input != null && input instanceof IAdaptable) { ISystemViewElementAdapter adapter = SystemAdapterHelpers.getViewAdapter(input); if (adapter != null) { for (Object object : adapter.getChildren((IAdaptable)input, null)) { if (object instanceof IAdaptable) { adapter = SystemAdapterHelpers.getViewAdapter(object); if (adapter != null && name.equals(adapter.getText(object))) { input = object; treeSegments.add(input); break; } } } } } else { treeSegments.clear(); break; } } TreePath treePath = new TreePath(treeSegments.toArray()); viewer.setSelection(new StructuredSelection(treePath)); if (viewer instanceof TreeViewer) { ((TreeViewer)viewer).expandToLevel(treePath, 1); } }</code><technical_language>viewer null</technical_language>

Target:
private void expandInRemoteSystemView( IViewPart remoteSystemView, IFileStore fileStore) { Viewer viewer = getViewer(remoteSystemView); if (viewer == null) return; Object input = viewer.getInput(); ArrayList<String> names = createSegmentNames(fileStore); ArrayList<Object> treeSegments = new ArrayList<Object>(); for (String name : names) { if (input instanceof IAdaptable) { ISystemViewElementAdapter adapter = SystemAdapterHelpers.getViewAdapter(input); if (adapter != null) { for (Object object : adapter.getChildren((IAdaptable)input, null)) { if (object instanceof IAdaptable) { adapter = SystemAdapterHelpers.getViewAdapter(object); if (adapter != null && name.equals(adapter.getText(object))) { input = object; treeSegments.add(input); break; } } } } } else { treeSegments.clear(); break; } } TreePath treePath = new TreePath(treeSegments.toArray()); viewer.setSelection(new StructuredSelection(treePath)); if (viewer instanceof TreeViewer) { ((TreeViewer)viewer).expandToLevel(treePath, 1); } }
Source:
<code>protected boolean isTimeoutException(final Exception exception) { <START> return false; <END> }</code><technical_language>JDBC java.sql.SQLTimeoutException method check if exception is instance of that, instead of simply returning "false". Besides, exception MS SQL Server throws timeout</technical_language>

Target:
protected boolean isTimeoutException(final Exception exception) { return (exception instanceof SQLTimeoutException); }
Source:
<code>public List<MediaUnit> getChildren() { return subordinateUnits; <START> } <END></code><technical_language>Getter variable name match</technical_language>

Target:
public List<MediaUnit> getChildren() { return children; }
Source:
<code>public void getObjectCustomParserNoObject_Test() throws IOException{ final String objectName = "doesNotExistObject"; final ByteArrayOutputStream stream = new ByteArrayOutputStream(); final ObjectOutputStreamBuilder builder = new ObjectOutputStreamBuilder() { @Override public OutputStream buildOutputStream(String key) throws IOException { return stream; } }; final GetObjectRequest request = new GetObjectRequest( BUCKET_NAME, objectName, builder.buildChannel(objectName)); try { client.getObject(request, new Function<GetObjectCustomParserParameters, GetObjectResponse>() { @Override <START> public GetObjectResponse apply(GetObjectCustomParserParameters getObjectParserParams) { <END> final WebResponse webResponse = getObjectParserParams.getWebResponse(); if (ResponseParserUtils.validateStatusCode(webResponse.getStatusCode(), 200, 206)) { fail(); } throw new RuntimeException("Could not download object " + getObjectParserParams.getObjectName()); } }); fail(); } catch (final RuntimeException e) { assertThat(e.getMessage(), is("Could not download object " + objectName)); } }</code><technical_language>assumption is call failed this point. If case, GetObjectCustomParser needs handle this</technical_language>

Target:
public void getObjectCustomParserNoObject_Test() throws IOException{ final String objectName = "doesNotExistObject"; final GetObjectRequest request = new GetObjectRequest( BUCKET_NAME, objectName, new NullChannel()); client.getObject(request, new Function<GetObjectCustomParserParameters, GetObjectResponse>() { @Override public GetObjectResponse apply(final GetObjectCustomParserParameters getObjectParserParams) { return null; } }); }
Source:
<code>public BufferView next() { if (buffer == null) { return null; } BufferView currentView = bufferView; currentView.buffer = buffer; currentView.position = position; currentView.length = length; try { advance(); } catch (IOException e) { <START> throw new RuntimeException(e); <END> } return currentView; }</code><technical_language>I throw UncheckedIOException</technical_language>

Target:
public Buffer next() { if (buffer == null) { throw new NoSuchElementException(); } Buffer currentContainer = bufferContainer; currentContainer.setBuffer(isUncompressed ? uncompressedBuffer : buffer); currentContainer.setPosition(isUncompressed ? getOffsetInBuffer() : toIntExact(current.position())); currentContainer.setLength(isUncompressed ? toIntExact(uncompressedBufferOffset + current.length()) : toIntExact(current.length())); try { if (decompressor.isPresent()) { advance(); if (current == null) { currentCompressedBlockOffset = toIntExact(compressedSliceInput.position()); current = EMPTY_SLICE.getInput(); } } } catch (IOException e) { throw new UncheckedIOException(e); } return currentContainer; }
Source:
<code>RetryPolicyFactory createRetryPolicyFactory() { <START> return new RetryPolicyFactory(new RetryPolicyConfig() <END> .setMinWait(Period.seconds(2)) .setMaxWait(Period.seconds(8)) .setMaxRetryCount(5) ); }</code><technical_language>@dclim is original author if numbers, nice</technical_language>

Target:
RetryPolicyFactory createRetryPolicyFactory() { return new RetryPolicyFactory( new RetryPolicyConfig() .setMinWait(Period.seconds(2)) .setMaxWait(Period.seconds(8)) .setMaxRetryCount(8) ); }
Source:
<code>public VM update(VM incoming) { if (incoming.isSetCluster() && (incoming.getCluster().isSetId() || incoming.getCluster().isSetName())) { Guid clusterId = lookupClusterId(incoming); if(!clusterId.toString().equals(get().getCluster().getId())){ performAction(VdcActionType.ChangeVMCluster, new ChangeVMClusterParameters(clusterId, guid)); } } if (incoming.isSetPlacementPolicy() && incoming.getPlacementPolicy().isSetHost() && incoming.getPlacementPolicy().getHost().isSetName() && !incoming.getPlacementPolicy().getHost().isSetId()) { incoming.getPlacementPolicy().getHost().setId(getHostId(incoming.getPlacementPolicy().getHost().getName())); } VM retVal = performUpdate(incoming, new QueryIdResolver(VdcQueryType.GetVmByVmId, GetVmByVmIdParameters.class), VdcActionType.UpdateVm, new UpdateParametersProvider()); <START> return retVal; <END> }</code><technical_language>moved code populate, reason get VM reference. change before</technical_language>

Target:
public VM update(VM incoming) { if (incoming.isSetCluster() && (incoming.getCluster().isSetId() || incoming.getCluster().isSetName())) { Guid clusterId = lookupClusterId(incoming); if(!clusterId.toString().equals(get().getCluster().getId())){ performAction(VdcActionType.ChangeVMCluster, new ChangeVMClusterParameters(clusterId, guid)); } } if (incoming.isSetPlacementPolicy() && incoming.getPlacementPolicy().isSetHost() && incoming.getPlacementPolicy().getHost().isSetName() && !incoming.getPlacementPolicy().getHost().isSetId()) { incoming.getPlacementPolicy().getHost().setId(getHostId(incoming.getPlacementPolicy().getHost().getName())); } return performUpdate(incoming, new QueryIdResolver(VdcQueryType.GetVmByVmId, GetVmByVmIdParameters.class), VdcActionType.UpdateVm, new UpdateParametersProvider()); }
Source:
<code>protected Function<Object, IterableWithMarker<OperatingSystem>> markerToNextForArg0( final Optional<Object> arg) { return new Function<Object, IterableWithMarker<OperatingSystem>>() { @Override public IterableWithMarker<OperatingSystem> apply(Object input) { PaginationOptions paginationOptions = PaginationOptions.class.cast(input); <START> return api.getInfrastructureApi().listOperatingSystems(arg.toString(), paginationOptions); <END> } }; }</code><technical_language>care! arg.get().toString(). passing Optional object</technical_language>

Target:
protected Function<Object, IterableWithMarker<OperatingSystem>> markerToNextForArg0( final Optional<Object> arg) { return new Function<Object, IterableWithMarker<OperatingSystem>>() { @Override public IterableWithMarker<OperatingSystem> apply(Object input) { PaginationOptions paginationOptions = PaginationOptions.class.cast(input); return api.getInfrastructureApi().listOperatingSystems(arg.get().toString(), paginationOptions); } }; }
Source:
<code>public Optional<Git> execute() { try { final org.eclipse.jgit.api.Git _git = org.eclipse.jgit.api.Git.init().setBare(true).setDirectory(repoDir).call(); if (leaders != null) { new WriteConfiguration(_git.getRepository(), cfg -> { cfg.setInt("core", null, "repositoryformatversion", 1); cfg.setString("extensions", null, "refsStorage", "reftree"); }).execute(); } final Repository repo = new FileRepositoryBuilder() .setGitDir(repoDir) .build(); final org.eclipse.jgit.api.Git git = new org.eclipse.jgit.api.Git(repo); <START> String ssl = System.getProperty("org.uberfire.nio.git.http.sslVerify"); <END> if(null != ssl) { boolean sslVerify = Boolean.valueOf(ssl); if(!sslVerify) { StoredConfig config = repo.getConfig(); config.setBoolean( "http", null, "sslVerify", false ); config.save(); } } if (hookDir != null) { final File repoHookDir = new File(repoDir, "hooks"); try { FileUtils.copyDirectory(hookDir, repoHookDir); } catch (final Exception ex) { throw new RuntimeException(ex); } for (final File file : repoHookDir.listFiles()) { if (file != null && file.isFile()) { file.setExecutable(true); } } } return Optional.of(new GitImpl(git, leaders)); } catch (final Exception ex) { throw new IOException(ex); } }</code><technical_language>This property here: <LINK_0></technical_language>

Target:
public Optional<Git> execute() { try { final org.eclipse.jgit.api.Git _git = org.eclipse.jgit.api.Git.init().setBare(true).setDirectory(repoDir).call(); if (leaders != null) { new WriteConfiguration(_git.getRepository(), cfg -> { cfg.setInt("core", null, "repositoryformatversion", 1); cfg.setString("extensions", null, "refsStorage", "reftree"); }).execute(); } final Repository repo = new FileRepositoryBuilder() .setGitDir(repoDir) .build(); final org.eclipse.jgit.api.Git git = new org.eclipse.jgit.api.Git(repo); setSSLVerify(repo); if (hookDir != null) { final File repoHookDir = new File(repoDir, "hooks"); try { FileUtils.copyDirectory(hookDir, repoHookDir); } catch (final Exception ex) { throw new RuntimeException(ex); } for (final File file : repoHookDir.listFiles()) { if (file != null && file.isFile()) { file.setExecutable(true); } } } return Optional.of(new GitImpl(git, leaders)); } catch (final Exception ex) { throw new IOException(ex); } }
Source:
<code>RemoteReadListener(final RemoteConnectionHandler handler, final RemoteConnection connection) { synchronized (connection.getLock()) { connection.getChannel().getCloseSetter().set(new ChannelListener<java.nio.channels.Channel>() { public void handleEvent(final java.nio.channels.Channel channel) { try { connection.getExecutor().execute(new Runnable() { public void run() { handler.handleConnectionClose(); } }); } catch (RejectedExecutionException re) { log.trace("Conenction already closing."); <START> } <END> } }); } this.handler = handler; this.connection = connection; }</code><technical_language>This hides symptom, solve problem. If this exception is thrown, handler's close method is called, potentially leaving threads hanging. proper fix is determine thread pool is shut connections cleaned up</technical_language>

Target:
RemoteReadListener(final RemoteConnectionHandler handler, final RemoteConnection connection) { synchronized (connection.getLock()) { connection.getChannel().getCloseSetter().set(new ChannelListener<java.nio.channels.Channel>() { public void handleEvent(final java.nio.channels.Channel channel) { handler.handleSocketChannelClose(); } }); } this.handler = handler; this.connection = connection; }
Source:
<code>public void testMultiGet() { timestampMappingStore.put(defaultNamespace, KEY, VALUE); timestampMappingStore.put(defaultNamespace, KEY2, VALUE2); assertThat(timestampMappingStore.multiGet(defaultNamespace, ImmutableList.of(KEY, KEY2, "random".getBytes()))) .containsExactlyInAnyOrderEntriesOf(ImmutableMap.of( KEY, VALUE, KEY2, VALUE2) <START> ); <END> }</code><technical_language>This assertion feels fragile. In if I change assertion assertThat(timestampMappingStore.multiGet(defaultNamespace, ImmutableList.of(KEY, KEY2, "random".getBytes()))) .containsExactlyInAnyOrderEntriesOf(ImmutableMap.of( KEY, VALUE, "key2".getBytes(), VALUE2) ); fails. In general I want ByteString for return type of persistent store, sorted maps</technical_language>

Target:
public void testMultiGet() { timestampMappingStore.put(defaultNamespace, KEY, VALUE); timestampMappingStore.put(defaultNamespace, KEY2, VALUE2); assertThat( timestampMappingStore.get(defaultNamespace, ImmutableList.of(KEY, KEY2, ByteString.encodeUtf8("bla")))) .containsExactlyInAnyOrderEntriesOf(ImmutableMap.of( KEY, VALUE, KEY2, VALUE2) ); }
Source:
<code>public long getRetainedSizeInBytes() { <START> return INSTANCE_SIZE + SizeOf.sizeOf(nullVector); <END> }</code><technical_language>static import sizeOf (also in other stream readers)</technical_language>

Target:
public long getRetainedSizeInBytes() { return INSTANCE_SIZE + sizeOf(nullVector); }
Source:
<code>public CommandImpl(String name, String commandLine, String type) { <START> this.name = name; <END> this.commandLine = commandLine; this.type = type; }</code><technical_language>I guess this replaced a public CommandImpl(String name, String commandLine, String type, Map<String, String> attributes) constructor call, do think</technical_language>

Target:
public CommandImpl(String name, String commandLine, String type) { this(name, commandLine, type, Collections.<String, String>emptyMap()); }
Source:
<code>public ValidationResult rngSourcesAllowed() { return ValidationResult.failWith(EngineMessage.ACTION_TYPE_FAILED_RANDOM_RNG_SOURCE_CANT_BE_ADDED_TO_CLUSTER_ADDITIONAL_RNG_SOURCES) <START> .unless(Collections.singleton(VmRngDevice.Source.HWRNG).containsAll(cluster.getAdditionalRngSources())); <END> }</code><technical_language>please extract this a constant named e.g. ALLOWED_ADDITIONAL_RNG_SOURCES more obvious this line of code does</technical_language>

Target:
public ValidationResult rngSourcesAllowed() { return ValidationResult.failWith(EngineMessage.ACTION_TYPE_FAILED_RANDOM_RNG_SOURCE_CANT_BE_ADDED_TO_CLUSTER_ADDITIONAL_RNG_SOURCES) .unless(ALLOWED_ADDITIONAL_RNG_SOURCES.containsAll(cluster.getAdditionalRngSources())); }
Source:
<code>public SeenExchanges visitExchange(ExchangeNode node, Void context) { SeenExchanges seenExchanges = aggregatedSeenExchanges(node.getSources()); if (node.getType().equals(REPARTITION)) { if (node.getScope().equals(REMOTE)) { return new SeenExchanges(false, true); } <START> <END> return new SeenExchanges(true, seenExchanges.remoteRepartitionExchange); } return seenExchanges; }</code><technical_language>add check globalProperties .isNullsAndAnyReplicated()</technical_language>

Target:
public Optional<SeenExchanges> visitExchange(ExchangeNode node, Void context) { Optional<SeenExchanges> seenExchangesOptional = aggregatedSeenExchanges(node.getSources()); if (!seenExchangesOptional.isPresent()) { return Optional.empty(); } if (!node.getType().equals(REPARTITION)) { return seenExchangesOptional; } SeenExchanges seenExchanges = seenExchangesOptional.get(); if (node.getScope().equals(REMOTE)) { return Optional.of(new SeenExchanges(false, true)); } return Optional.of(new SeenExchanges(true, seenExchanges.remoteRepartitionExchange)); }
Source:
<code>public void waitCreateWorkspaceButtonEnabled() { <START> webDriverWaitFactory <END> .get() .until((ExpectedCondition<Boolean>) driver -> isCreateWorkspaceButtonEnabled()); }</code><technical_language>useful operation in seleniumWebDriverHelper class: waitAttributeEqualsTo(By element, attributeName, expectedValue)</technical_language>

Target:
public void waitCreateWorkspaceButtonEnabled() { seleniumWebDriverHelper.waitAttributeEqualsTo( By.xpath(BOTTOM_CREATE_BUTTON_XPATH), "aria-disabled", "false"); }
Source:
<code>TokenCacheItem(final TokenCacheItem tokenCacheItem) { this.mAuthority = tokenCacheItem.getAuthority(); this.mResource = tokenCacheItem.getResource(); this.mClientId = tokenCacheItem.getClientId(); this.mAccessToken = tokenCacheItem.getAccessToken(); this.mRefreshtoken = tokenCacheItem.getRefreshToken(); this.mRawIdToken = tokenCacheItem.getRawIdToken(); this.mUserInfo = tokenCacheItem.getUserInfo(); this.mExpiresOn = tokenCacheItem.getExpiresOn(); this.mIsMultiResourceRefreshToken = tokenCacheItem.getIsMultiResourceRefreshToken(); this.mTenantId = tokenCacheItem.getTenantId(); this.mFamilyClientId = tokenCacheItem.getFamilyClientId(); if (tokenCacheItem.isExtendedLifetimeValid()) { this.mExtendedExpiresOn = tokenCacheItem.getExtendedExpiresOn(); <START> } <END> }</code><technical_language>do assign? responsible for checking if valid</technical_language>

Target:
TokenCacheItem(final TokenCacheItem tokenCacheItem) { this.mAuthority = tokenCacheItem.getAuthority(); this.mResource = tokenCacheItem.getResource(); this.mClientId = tokenCacheItem.getClientId(); this.mAccessToken = tokenCacheItem.getAccessToken(); this.mRefreshtoken = tokenCacheItem.getRefreshToken(); this.mRawIdToken = tokenCacheItem.getRawIdToken(); this.mUserInfo = tokenCacheItem.getUserInfo(); this.mExpiresOn = tokenCacheItem.getExpiresOn(); this.mIsMultiResourceRefreshToken = tokenCacheItem.getIsMultiResourceRefreshToken(); this.mTenantId = tokenCacheItem.getTenantId(); this.mFamilyClientId = tokenCacheItem.getFamilyClientId(); this.mExtendedExpiresOn = tokenCacheItem.getExtendedExpiresOn(); }
Source:
<code>String generateHeaderOnlyOutputFileName(@NonNull Entity entity) { val fname = entity.getFileName(); val extensionPos = fname.toLowerCase().indexOf(".bam"); val left = StringUtils.left(fname, extensionPos); val extension = StringUtils.right(fname, fname.length() - extensionPos); <START> String fullName = String.format("%s.%s%s", left, "header", extension); <END> return addOutputPath(fullName); }</code><technical_language>Same. I appreciate naming variable</technical_language>

Target:
String generateHeaderOnlyOutputFileName(@NonNull Entity entity) { return addOutputPath(injectFileNameModifier(entity, "header")); }
Source:
<code>public void phaseOriginal() { EntitySelectorConfig entitySelectorConfig = new EntitySelectorConfig(); entitySelectorConfig.setCacheType(SelectionCacheType.PHASE); entitySelectorConfig.setSelectionOrder(SelectionOrder.ORIGINAL); EntitySelector entitySelector = entitySelectorConfig.buildEntitySelector( buildHeuristicConfigPolicy(), SelectionCacheType.JUST_IN_TIME, SelectionOrder.RANDOM); <START> assertThat((Object) entitySelector) <END> .isInstanceOf(FromSolutionEntitySelector.class); assertThat((Object) entitySelector) .isNotInstanceOf(ShufflingEntitySelector.class); assertThat(entitySelector.getCacheType()).isEqualTo(SelectionCacheType.PHASE); }</code><technical_language>Redundant cast. this is done automatically IDE. Please check if avoid that</technical_language>

Target:
public void phaseOriginal() { EntitySelectorConfig entitySelectorConfig = new EntitySelectorConfig(); entitySelectorConfig.setCacheType(SelectionCacheType.PHASE); entitySelectorConfig.setSelectionOrder(SelectionOrder.ORIGINAL); EntitySelector entitySelector = entitySelectorConfig.buildEntitySelector( buildHeuristicConfigPolicy(), SelectionCacheType.JUST_IN_TIME, SelectionOrder.RANDOM); assertThat(entitySelector) .isInstanceOf(FromSolutionEntitySelector.class); assertThat(entitySelector) .isNotInstanceOf(ShufflingEntitySelector.class); assertThat(entitySelector.getCacheType()).isEqualTo(SelectionCacheType.PHASE); }
Source:
<code>protected void executeVdsBrokerCommand() { String volumeName = getParameters().getVolumeName(); <START> if (globalVolumeOptionsList.isEmpty()) { <END> globalVolumeOptionsList = getBroker().glusterVolumeGlobalOptionsGet().globalOptionList(); } else { for (String option : globalVolumeOptionsList) { if (option.equalsIgnoreCase(getParameters().getVolumeOption().getKey())) { volumeName = "all"; break; } } } status = getBroker().glusterVolumeSet(volumeName, getParameters().getVolumeOption().getKey(), getParameters().getVolumeOption().getValue()); proceedProxyReturnValue(); }</code><technical_language>this help? this class is a singleton</technical_language>

Target:
protected void executeVdsBrokerCommand() { String volumeName = getParameters().getVolumeName(); VDS vds = vdsDao.get(getParameters().getVdsId()); List<GlusterGlobalVolumeOptionEntity> globalVolumeOptionsList = glusterOptionDao.getGlobalVolumeOptions(vds.getClusterId()); if (!globalVolumeOptionsList.isEmpty()) { for (GlusterGlobalVolumeOptionEntity option : globalVolumeOptionsList) { if (option.getKey().equalsIgnoreCase(getParameters().getVolumeOption().getKey())) { volumeName = "all"; break; } } } status = getBroker().glusterVolumeSet(volumeName, getParameters().getVolumeOption().getKey(), getParameters().getVolumeOption().getValue()); proceedProxyReturnValue(); }
Source:
<code>public void showNfsProfileStats(GlusterVolumeProfileInfo entity) { List<GlusterVolumeProfileStats> nfsProfileDetails = entity.getNfsProfileDetails(); getNfsServers().setItems(nfsProfileDetails); <START> getNfsServers().setSelectedItem(nfsProfileDetails.get(0)); <END> }</code><technical_language>want check size of list</technical_language>

Target:
public void showNfsProfileStats(GlusterVolumeProfileInfo entity) { if(entity != null) { List<GlusterVolumeProfileStats> nfsProfileDetails = entity.getNfsProfileDetails(); getNfsServers().setItems(nfsProfileDetails); if(nfsProfileDetails.size() > 0) { getNfsServers().setSelectedItem(nfsProfileDetails.get(0)); } } }
Source:
<code>public void close() throws Exception { ensureStarted(); LOG.info("Closing SourceCoordinator."); enumerator.close(); <START> coordinatorExecutor.shutdown(); <END> LOG.info("Source coordinator closed."); }</code><technical_language>executor.shutdown() initiates shutdown of executor returns immediately, submitted tasks executed in thread. tasks executed coordinator is closed. Is issue</technical_language>

Target:
public void close() throws Exception { LOG.info("Closing SourceCoordinator for source {}.", operatorName); boolean successfullyClosed = false; try { if (started) { enumerator.close(); } } finally { coordinatorExecutor.shutdownNow(); successfullyClosed = coordinatorExecutor.awaitTermination(10, TimeUnit.SECONDS); } if (!successfullyClosed) { throw new TimeoutException("The source coordinator failed to close before timeout."); } LOG.info("Source coordinator for source closed.", operatorName); }
Source:
<code>public MbusChannelElementsResponseDto execute(final DlmsConnectionHolder conn, final DlmsDevice device, final MbusChannelElementsDto requestDto) throws ProtocolAdapterException, FunctionalException { LOGGER.debug("retrieving mbus info on e-meter"); <START> final MbusChannelElementsResponseDto responseDto = new MbusChannelElementsResponseDto(requestDto); <END> for (int c = FIRST_CHANNEL; c < FIRST_CHANNEL + NR_OF_CHANNELS; c++) { final AttributeAddress[] attrAddresses = this.makeAttributeAddresses(c); conn.getDlmsMessageListener().setDescription("CoupleMBusDevice, retrieve attribute: " + JdlmsObjectToStringUtil.describeAttributes(attrAddresses)); final List<GetResult> resultList = this.dlmsHelper.getWithList(conn, device, attrAddresses); final ChannelElementValues channelValues = this.makeChannelElementValues(c, resultList); responseDto.addChannelElements(channelValues); if (this.mbusChannelMatches(c, channelValues, requestDto)) { responseDto.setChannel(c); break; } } return responseDto; }</code><technical_language>If create this responseDto for loop need extra modification methods this dto. constructor necessary</technical_language>

Target:
public MbusChannelElementsResponseDto execute(final DlmsConnectionHolder conn, final DlmsDevice device, final MbusChannelElementsDto requestDto) throws ProtocolAdapterException { LOGGER.debug("retrieving mbus info on e-meter"); ChannelElementValuesDto bestMatch = null; final List<ChannelElementValuesDto> channelElements = new ArrayList<>(); for (short channel = FIRST_CHANNEL; channel < FIRST_CHANNEL + NR_OF_CHANNELS; channel++) { final List<GetResult> resultList = this.getMBusClientAttributeValues(conn, device, channel); final ChannelElementValuesDto channelValues = this.makeChannelElementValues(channel, resultList); channelElements.add(channelValues); if (FindMatchingChannelHelper.matches(requestDto, channelValues)) { bestMatch = channelValues; break; } } if (bestMatch == null) { bestMatch = FindMatchingChannelHelper.bestMatch(requestDto, channelElements); } return new MbusChannelElementsResponseDto(requestDto, bestMatch == null ? null : bestMatch.getChannel(), channelElements); }