auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public boolean respondsTo(RunEvent event) { Run r = event.getEventObject(); <START> if (event.getEventType().equals(MisoEventType.RUN_FAILED) && r.getHealth().equals(HealthType.Failed)) { <END> log.info("Run " + r.getAlias() + ": " + event.getEventMessage()); return true; } return false; }</code><technical_language>== instead of .equals (in instances) this null-safe</technical_language>

Target:
public boolean respondsTo(RunEvent event) { Run r = event.getEventObject(); if (event.getEventType() == MisoEventType.RUN_FAILED && r.getHealth() == HealthType.Failed) { log.info("Run " + r.getAlias() + ": " + event.getEventMessage()); return true; } return false; }
Source:
<code>public NavigationView.OnNavigationItemSelectedListener getNewListener() { return new NavigationView.OnNavigationItemSelectedListener() { @Override public boolean onNavigationItemSelected(MenuItem menuItem) { <START> Intent intent = new Intent(); <END> switch (menuItem.getItemId()) { case R.id.nav_item_today: page.displayMainPage(); break; case R.id.nav_item_history: page.pushFragment(new HistoryFragment()); break; case R.id.nav_item_saved_pages: page.pushFragment(new SavedPagesFragment()); break; case R.id.nav_item_nearby: page.pushFragment(new NearbyFragment()); break; case R.id.nav_item_more: intent.setClass(app, ApiUtil.hasHoneyComb() ? SettingsActivity.class : SettingsActivityGB.class); page.startActivityForResult(intent, SettingsActivity.ACTIVITY_REQUEST_SHOW_SETTINGS); break; case R.id.nav_item_login: intent.setClass(app, LoginActivity.class); intent.putExtra(LoginActivity.LOGIN_REQUEST_SOURCE, LoginFunnel.SOURCE_NAV); page.startActivity(intent); break; case R.id.nav_item_random: page.getRandomHandler().doVisitRandomArticle(); break; default: throw new RuntimeException("Unknown ID clicked!"); } return false; } }; }</code><technical_language>Apologies if this copied previous implementation. odd declare a variable is in a couple cases. methods instead? launchLoginScreen() launchSettingsScreen() something</technical_language>

Target:
public NavigationView.OnNavigationItemSelectedListener getNewListener() { return new NavigationView.OnNavigationItemSelectedListener() { @Override public boolean onNavigationItemSelected(MenuItem menuItem) { switch (menuItem.getItemId()) { case R.id.nav_item_today: page.displayMainPage(); break; case R.id.nav_item_history: page.pushFragment(new HistoryFragment()); break; case R.id.nav_item_saved_pages: page.pushFragment(new SavedPagesFragment()); break; case R.id.nav_item_nearby: page.pushFragment(new NearbyFragment()); break; case R.id.nav_item_more: launchSettingsActivity(); break; case R.id.nav_item_login: launchLoginActivity(); break; case R.id.nav_item_username: break; case R.id.nav_item_random: page.getRandomHandler().doVisitRandomArticle(); break; default: throw new RuntimeException("Unknown ID clicked!"); } return false; } }; }
Source:
<code><START> public ArrayList updateReadyState(boolean state) { <END> ArrayList<Integer> updateList = new ArrayList<Integer>(); if ( state && _lastReady != state ) { for (ADZone tz : _zoneList) { updateList.add(tz.getID()); } clearAll(); } _lastReady = state; return updateList; }</code><technical_language>If this method instead returns ArrayList<Integer>, need Object temp casting in AlarmDecoderBinding.java, line 480, just: java for (Integer i : updates) { ... }</technical_language>

Target:
public ArrayList<Integer> updateReadyState(boolean state) { ArrayList<Integer> updateList = new ArrayList<Integer>(); if (state && _lastReady != state) { for (ADZone tz : _zoneList) { updateList.add(tz.getID()); } clearAll(); } _lastReady = state; return updateList; }
Source:
<code>protected void appendStatementStart(StringBuilder sb, List<ArgumentHolder> argList) { if (joinList == null) { setAddTableName(false); } else { setAddTableName(true); } sb.append("SELECT "); if (databaseType.isLimitAfterSelect()) { appendLimit(sb); } if (distinct) { sb.append("DISTINCT "); } if (countOfQuery == null) { appendSelects(sb); } else { type = StatementType.SELECT_LONG; sb.append("COUNT(").append(countOfQuery).append(") "); } sb.append("FROM "); if (tableInfo.getSchemaName() != null && tableInfo.getSchemaName().length() > 0){ databaseType.appendEscapedEntityName(sb, tableInfo.getSchemaName()); <START> sb.append("."); <END> } databaseType.appendEscapedEntityName(sb, tableName); if (alias != null) { appendAlias(sb); } sb.append(' '); if (joinList != null) { appendJoinSql(sb); } }</code><technical_language>This is pedantic please sb.append('.') characters if adding a character</technical_language>

Target:
protected void appendStatementStart(StringBuilder sb, List<ArgumentHolder> argList) { if (joinList == null) { setAddTableName(false); } else { setAddTableName(true); } sb.append("SELECT "); if (databaseType.isLimitAfterSelect()) { appendLimit(sb); } if (distinct) { sb.append("DISTINCT "); } if (countOfQuery == null) { appendSelects(sb); } else { type = StatementType.SELECT_LONG; sb.append("COUNT(").append(countOfQuery).append(") "); } sb.append("FROM "); if (tableInfo.getSchemaName() != null && tableInfo.getSchemaName().length() > 0){ databaseType.appendEscapedEntityName(sb, tableInfo.getSchemaName()); sb.append('.'); } databaseType.appendEscapedEntityName(sb, tableName); if (alias != null) { appendAlias(sb); } sb.append(' '); if (joinList != null) { appendJoinSql(sb); } }
Source:
<code>public Object create(String parentUniqueId, SimpleObject post, RequestContext context) throws ResponseException { if (post == null) { return null; } IdentifierSourceService service = Context.getService(IdentifierSourceService.class); String identifier = service.generateIdentifier(service.getIdentifierSourceByUuid(parentUniqueId), <START> post.containsKey("comment") ? String.valueOf((String)post.get("comment")) : ""); <END> SimpleObject response = new SimpleObject(); response.add(IDENTIFIER_KEY, identifier); return response; }</code><technical_language>Do need casting this a String</technical_language>

Target:
public Object create(String parentUniqueId, SimpleObject post, RequestContext context) throws ResponseException { if (post == null) { return null; } IdentifierSourceService service = Context.getService(IdentifierSourceService.class); String identifier = service.generateIdentifier(service.getIdentifierSourceByUuid(parentUniqueId), post.containsKey("comment") ? String.valueOf(post.get("comment")) : ""); SimpleObject response = new SimpleObject(); response.add(IDENTIFIER_KEY, identifier); return response; }
Source:
<code>public GridSystemViewManager(GridKernalContext ctx) { <START> super(ctx, ((Supplier<SystemViewExporterSpi[]>)() -> { <END> SystemViewExporterSpi[] spi = ctx.config().getSystemViewExporterSpi(); if (!IgniteComponentType.INDEXING.inClassPath()) return spi; SystemViewExporterSpi[] spiWithSql = new SystemViewExporterSpi[spi != null ? spi.length + 1 : 1]; if (!F.isEmpty(spi)) System.arraycopy(spi, 0, spiWithSql, 0, spi.length); try { spiWithSql[spiWithSql.length - 1] = U.newInstance(SYSTEM_VIEW_SQL_SPI); } catch (IgniteCheckedException e) { throw new IgniteException(e); } return spiWithSql; }).get()); }</code><technical_language>please replace supplier simple method call? is need lambda syntax here</technical_language>

Target:
public GridSystemViewManager(GridKernalContext ctx) { super(ctx, addStandardExporters(ctx.config().getSystemViewExporterSpi())); }
Source:
<code><START> public static boolean isWikimediaHost(String host) { <END> return ( Utilities.patternIsFound(URI_HOST_WIKIMEDIA_DOMAIN_PATTERN, host) || Utilities.patternIsFound(URI_HOST_OTHER_PROJECTS_PATTERN, host) || Utilities.patternIsFound(URI_HOST_PROJECT_DOMAIN_PATTERN, host) ); }</code><technical_language>a length check do apply regexexs too- long referrers</technical_language>

Target:
public static boolean isWikimediaHost(String host) { int MAX_REFERER_LENGTH = 5000; if(host.length() > MAX_REFERER_LENGTH) return false; return ( Utilities.patternIsFound(URI_HOST_WIKIMEDIA_DOMAIN_PATTERN, host) || Utilities.patternIsFound(URI_HOST_OTHER_PROJECTS_PATTERN, host) || Utilities.patternIsFound(URI_HOST_PROJECT_DOMAIN_PATTERN, host) ); }
Source:
<code>public void onActivityResult(int requestCode, int resultCode, Intent data) { if (requestCode == REQUEST_ISSUE) { super.onRefresh(); } else { super.onActivityResult(requestCode, resultCode, data); <START> } <END> }</code><technical_language>this a refresh canceling 'new issue' activity button</technical_language>

Target:
public void onActivityResult(int requestCode, int resultCode, Intent data) { if (requestCode == REQUEST_ISSUE) { if (resultCode == Activity.RESULT_OK) { super.onRefresh(); } } else { super.onActivityResult(requestCode, resultCode, data); } }
Source:
<code>public List<Order> getTableFromView() { List<Order> table = new LinkedList<>(); int quantityOfOrdersPerTable = Integer.parseInt(driver.findElement(OrderingPageLocators.QUANTITY_OF_ROWS).getAttribute("value")); int quantityOfOrdersPerPage = driver.findElements(OrderingPageLocators.QUANTITY_OF_ROWS_PER_PAGE).size(); double iteration = new BigDecimal(quantityOfOrdersPerTable / quantityOfOrdersPerPage).setScale(0, RoundingMode.UP).doubleValue(); for (int i = 1; i <= iteration; i++) { for (int j = 2; j <= quantityOfOrdersPerPage + 1; j++) { if (isElementDisplayed(By.xpath(String.format(OrderingPageLocators.TABLE_ROW_CELL, j)))) { List<WebElement> webElements = driver.findElements(By.xpath(String.format(OrderingPageLocators.TABLE_ROW, j))); <START> table.add(new Order.OrdersStepBuilder().withOrderName(webElements.get(0).getText()).withTotalPrice(webElements.get(1).getText()) <END> .withMaxDiscount(webElements.get(2).getText()).withDeliveryDate(webElements.get(3).getText()) .withStatus(webElements.get(4).getText()).withAssignee(webElements.get(5).getText()) .withRole(webElements.get(6).getText()).build()); } } if (i != iteration) { clickNextButton(); } else { clickFirstButton(); } } return table; }</code><technical_language>this is impossible read, chain method new line</technical_language>

Target:
public List<Order> getTableFromView() { List<Order> table = new LinkedList<>(); int quantityOfOrdersPerTable = Integer.parseInt(driver.findElement(OrderingPageLocators.QUANTITY_OF_ROWS).getAttribute("value")); int quantityOfOrdersPerPage = driver.findElements(OrderingPageLocators.QUANTITY_OF_ROWS_PER_PAGE).size(); double iteration = new BigDecimal(quantityOfOrdersPerTable / quantityOfOrdersPerPage).setScale(0, RoundingMode.UP).doubleValue(); for (int i = 1; i <= iteration; i++) { for (int j = 2; j <= quantityOfOrdersPerPage + 1; j++) { if (isElementDisplayed(By.xpath(String.format(OrderingPageLocators.TABLE_ROW_CELL, j)))) { List<WebElement> ordersFields = driver.findElements(By.xpath(String.format(OrderingPageLocators.TABLE_ROW, j))); table.add(new Order.OrdersBuilder() .withOrderName(ordersFields.get(0).getText()) .withTotalPrice(ordersFields.get(1).getText()) .withMaxDiscount(ordersFields.get(2).getText()) .withDeliveryDate(ordersFields.get(3).getText()) .withStatus(ordersFields.get(4).getText()) .withAssignee(ordersFields.get(5).getText()) .withRole(ordersFields.get(6).getText()) .build()); } } if (i != iteration) { clickNextButton(); } else { clickFirstButton(); } } return table; }
Source:
<code>public static Set<String> identifyTopNodes(Map<String, Set<String>> childMap) { Set<String> candidateTopNodes = new HashSet<>(); Set<String> topNodes = new HashSet<>(); <START> Set<String> children = new HashSet<>(); <END> for (String parent : childMap.keySet()) { if (children.contains(parent) == false) candidateTopNodes.add(parent); children.addAll(childMap.get(parent)); } for (String candidate : candidateTopNodes) { if (children.contains(candidate) == false) topNodes.add(candidate); } return topNodes; }</code><technical_language>curious design choice requires a new object instantiated for basic operation. This potentially inefficient if operations performed times</technical_language>

Target:
public static Set<String> identifyTopNodes(Map<String, Set<String>> childMap) { Set<String> candidateTopNodes = new HashSet<>(); Set<String> topNodes = new HashSet<>(); Set<String> children = new HashSet<>(); for (String parent : childMap.keySet()) { if (!children.contains(parent)) candidateTopNodes.add(parent); children.addAll(childMap.get(parent)); } for (String candidate : candidateTopNodes) { if (!children.contains(candidate)) topNodes.add(candidate); } return topNodes; }
Source:
<code>public FeatureState getFeatureState(Feature feature) { for (StateRepository repository : iterationOrder.getSelected(repositories)) { FeatureState featureState = repository.getFeatureState(feature); if (featureState != null) { <START> return featureState <END> } } return null; }</code><technical_language>is a ; missing..</technical_language>

Target:
public FeatureState getFeatureState(Feature feature) { for (StateRepository repository : iterationOrder.getSelected(repositories)) { FeatureState featureState = repository.getFeatureState(feature); if (featureState != null) { return featureState; } } return null; }
Source:
<code>public static PackExt newPackExt(String ext) { <START> synchronized (lock) { <END> PackExt[] dst = new PackExt[VALUES.length + 1]; for (int i = 0; i < VALUES.length; i++) { PackExt packExt = VALUES[i]; if (packExt.getExtension().equals(ext)) return packExt; dst[i] = packExt; } PackExt value = new PackExt(ext, VALUES.length); dst[VALUES.length] = value; VALUES = dst; return value; } }</code><technical_language>public static synchronized PackExt JVM handle locking for you</technical_language>

Target:
public synchronized static PackExt newPackExt(String ext) { PackExt[] dst = new PackExt[VALUES.length + 1]; for (int i = 0; i < VALUES.length; i++) { PackExt packExt = VALUES[i]; if (packExt.getExtension().equals(ext)) return packExt; dst[i] = packExt; } if (VALUES.length >= 32) throw new IllegalStateException( "maximum number of pack extensions exceeded"); PackExt value = new PackExt(ext, VALUES.length); dst[VALUES.length] = value; VALUES = dst; return value; }
Source:
<code>public void setTest() throws SQLException { String userId = "test"; String classification = "test"; String itemId="test"; final State.Builder state = State.newBuilder(); state.setCompleted(true); state.setStarted(true); state.setGraded(true); IMocksControl control = createControl (); Connection conn = control.createMock (Connection. class); PreparedStatement st = control.createMock (PreparedStatement. class); ResultSet rs = control.createMock (ResultSet. class); final String query = "SELECT * FROM State WHERE UserID=? AND SchoolItemType=? AND SchoolItemID=?;"; expect(conn.prepareStatement(query, ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE)).andReturn(st); st.setString(1, userId); st.setString(2, classification); st.setString(3, itemId); expect(st.executeQuery()).andReturn(rs); expect(rs.next()).andReturn(true); <START> rs.updateBoolean("Completed", state.getCompleted()); <END> rs.updateBoolean("Started", state.getStarted()); rs.updateBoolean("Graded", state.getGraded()); rs.updateRow(); st.close(); rs.close(); control.replay (); String res=""; try { res = SqlStateManager.setState(conn, userId, classification, itemId, state.build()); } catch (DatabaseAccessException e) { } String expected = "SET"; assertEquals (expected, res); control.verify (); }</code><technical_language>constants</technical_language>

Target:
public void setTest() throws SQLException { String userId = "test"; String classification = "test"; String itemId="test"; final State.Builder state = State.newBuilder(); state.setCompleted(true); state.setStarted(true); state.setGraded(true); IMocksControl control = createControl (); Connection conn = control.createMock (Connection. class); PreparedStatement st = control.createMock (PreparedStatement. class); ResultSet rs = control.createMock (ResultSet. class); final String query = "SELECT * FROM State WHERE UserID=? AND SchoolItemType=? AND SchoolItemID=?;"; expect(conn.prepareStatement(query, ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE)).andReturn(st); st.setString(1, userId); st.setString(2, classification); st.setString(3, itemId); expect(st.executeQuery()).andReturn(rs); expect(rs.next()).andReturn(true); rs.updateBoolean(DatabaseStringConstants.STATE_COMPLETED, state.getCompleted()); rs.updateBoolean(DatabaseStringConstants.STATE_STARTED, state.getStarted()); rs.updateBoolean(DatabaseStringConstants.STATE_GRADED, state.getGraded()); rs.updateRow(); st.close(); rs.close(); control.replay (); String res=""; try { res = SqlStateManager.setState(conn, userId, classification, itemId, state.build()); } catch (DatabaseAccessException e) { } String expected = "SET"; assertEquals (expected, res); control.verify (); }
Source:
<code><START> PRED_commit_committer_3(Term a1, Term a2, Term a3, Operation n) { <END> super(a1, a2, a3, n); }</code><technical_language>public</technical_language>

Target:
public PRED_commit_committer_3(Term a1, Term a2, Term a3, Operation n) { super(a1, a2, a3, n); }
Source:
<code>public void update(ActionEvent event) { Selection<?> select = selectionAgent.getSelection(); <START> Selection<Resource> selection = (Selection<Resource>)select; <END> if (selection.getFirstElement().getId() != null && select.getFirstElement() instanceof Resource) { event.getPresentation().setEnabled(true); } else event.getPresentation().setEnabled(false); }</code><technical_language>check (select.getFirstElement() instanceof Resource)</technical_language>

Target:
public void update(ActionEvent event) { Selection<?> select = selectionAgent.getSelection(); if (select != null && select.getFirstElement() != null && select.getFirstElement() instanceof Resource) { Selection<Resource> selection = (Selection<Resource>)select; event.getPresentation().setEnabled(selection.getFirstElement().getId() != null); } else event.getPresentation().setEnabled(false); }
Source:
<code><START> public ResponseEntity<?> disable(@RequestBody List<Long> printerIds) throws IOException { <END> return setState(printerIds, false); }</code><technical_language>@ResponseStatus(HttpStatus.NO_RESPONSE), void return type for /enable</technical_language>

Target:
public void disable(@RequestBody List<Long> printerIds) throws IOException { setState(printerIds, false); }
Source:
<code>public static Block stPoints(@SqlType(GEOMETRY_TYPE_NAME) Slice input) { OGCGeometry geometry = deserialize(input); validateType("ST_Points", geometry, EnumSet.of(LINE_STRING)); if (geometry.isEmpty()) { return null; } MultiPath lines = (MultiPath) geometry.getEsriGeometry(); <START> SpatialReference reference = geometry.getEsriSpatialReference(); <END> BlockBuilder blockBuilder = GEOMETRY.createBlockBuilder(null, lines.getPointCount()); for (int i = 0; i < lines.getPointCount(); i++) { GEOMETRY.writeSlice(blockBuilder, serialize(createFromEsriGeometry(lines.getPoint(i), reference))); } return blockBuilder.build(); }</code><technical_language>Spatial reference is null, hence, drop this variable is null below</technical_language>

Target:
public static Block stPoints(@SqlType(GEOMETRY_TYPE_NAME) Slice input) { OGCGeometry geometry = deserialize(input); validateType("ST_Points", geometry, EnumSet.of(LINE_STRING)); if (geometry.isEmpty()) { return null; } MultiPath lines = (MultiPath) geometry.getEsriGeometry(); BlockBuilder blockBuilder = GEOMETRY.createBlockBuilder(null, lines.getPointCount()); for (int i = 0; i < lines.getPointCount(); i++) { GEOMETRY.writeSlice(blockBuilder, serialize(createFromEsriGeometry(lines.getPoint(i), null))); } return blockBuilder.build(); }
Source:
<code>public void copy(Vector x, Vector y) { int n = y.size(); if (x.size() != n) throw new CardinalityException(x.size(), n); if (y.isArrayBased()) { double[] yData = y.getStorage().data(); if (x.isArrayBased()) System.arraycopy(x.getStorage().data(), 0, y.getStorage().data(), 0, n); <START> else { <END> if (y instanceof SparseLocalVector) { for (int i = 0; i < n; i++) yData[i] = x.getX(i); } } } else throw new IllegalArgumentException("y must be array based in copy"); }</code><technical_language>check style</technical_language>

Target:
public void copy(Vector x, Vector y) { int n = y.size(); if (x.size() != n) throw new CardinalityException(x.size(), n); if (y.isArrayBased()) { double[] yData = y.getStorage().data(); if (x.isArrayBased()) System.arraycopy(x.getStorage().data(), 0, y.getStorage().data(), 0, n); else { if (y instanceof SparseLocalVector) { for (int i = 0; i < n; i++) yData[i] = x.getX(i); } } } else throw new IllegalArgumentException("Vector y must be array based in copy."); }
Source:
<code>public synchronized void onSchoolDataWorkspaceUserDiscoveredEvent(@Observes SchoolDataWorkspaceUserDiscoveredEvent event) { String userIdentifier = event.getUserIdentifier(); String userDataSource = event.getUserDataSource(); SchoolDataIdentifier user = new SchoolDataIdentifier(userIdentifier, userDataSource); String workspaceDataSource = event.getWorkspaceDataSource(); String workspaceIdentifier = event.getWorkspaceIdentifier(); WorkspaceEntity workspace = workspaceEntityController.findWorkspaceByDataSourceAndIdentifier(workspaceDataSource, workspaceIdentifier); WorkspaceChatSettings workspaceChatStatus = chatController.findWorkspaceChatSettings(workspace.getId()); <START> if (workspaceChatStatus.getStatus() == WorkspaceChatStatus.ENABLED) { <END> chatSyncController.syncStudent(user); } }</code><technical_language>workspaceChatStatus null? If can, this null check</technical_language>

Target:
public synchronized void onSchoolDataWorkspaceUserDiscoveredEvent(@Observes SchoolDataWorkspaceUserDiscoveredEvent event) { String userIdentifier = event.getUserIdentifier(); String userDataSource = event.getUserDataSource(); SchoolDataIdentifier user = new SchoolDataIdentifier(userIdentifier, userDataSource); String workspaceDataSource = event.getWorkspaceDataSource(); String workspaceIdentifier = event.getWorkspaceIdentifier(); WorkspaceEntity workspace = workspaceEntityController.findWorkspaceByDataSourceAndIdentifier(workspaceDataSource, workspaceIdentifier); WorkspaceChatSettings workspaceChatStatus = chatController.findWorkspaceChatSettings(workspace.getId()); if (workspaceChatStatus != null && workspaceChatStatus.getStatus() == WorkspaceChatStatus.ENABLED) { chatSyncController.syncWorkspaceUser(workspace, user); } }
Source:
<code>public void testPingWrongServer() { PORT1 = initServerCache(true); initServerCache2(); InternalDistributedMember server2ID = server2.invoke("get ID", () -> cache.getMyId()); pool = (PoolImpl) createClientCache(NetworkUtils.getServerHostName(), PORT1); ClientProxyMembershipID proxyID = server1.invoke( () -> CacheClientNotifier.getInstance().getClientProxies().iterator().next().getProxyID()); logger.info("ProxyID is : " + proxyID); server2.invoke(() -> { assertThat(ClientHealthMonitor.getInstance().getClientHeartbeats().keySet().contains(proxyID)) .isFalse(); assertEquals(0, ClientHealthMonitor.getInstance().getClientHeartbeats().keySet().size()); }); PingOp.execute(pool, new ServerLocation(NetworkUtils.getServerHostName(), PORT1), server2ID); server2.invoke(() -> { <START> await("For heartbeat to be received").timeout(Duration.ofMinutes(1)) <END> .untilAsserted(() -> assertEquals(1, ClientHealthMonitor.getInstance().getClientHeartbeats().keySet().size())); ClientProxyMembershipID proxyIDFound = ClientHealthMonitor.getInstance().getClientHeartbeats().keySet().iterator().next(); logger.info("ProxyID found in clientHealthMonitor: " + proxyIDFound); assertThat( ClientHealthMonitor.getInstance().getClientHeartbeats().keySet().contains(proxyID)) .isTrue(); }); }</code><technical_language>Please default timeout (5 minutes) set GeodeAwaitility instead: await().untilAsserted() (without timeout)</technical_language>

Target:
public void testPingWrongServer() { PORT1 = initServerCache(true); initServerCache2(); InternalDistributedMember server2ID = server2.invoke("get ID", () -> cache.getMyId()); pool = (PoolImpl) createClientCache(NetworkUtils.getServerHostName(), PORT1); ClientProxyMembershipID proxyID = server1.invoke( () -> CacheClientNotifier.getInstance().getClientProxies().iterator().next().getProxyID()); server2.invoke(() -> { assertThat(ClientHealthMonitor.getInstance().getClientHeartbeats().keySet().contains(proxyID)) .isFalse(); assertThat(ClientHealthMonitor.getInstance().getClientHeartbeats().keySet().size()) .isEqualTo(0); }); PingOp.execute(pool, new ServerLocation(NetworkUtils.getServerHostName(), PORT1), server2ID); server2.invoke(() -> { await("For heartbeat to be received").untilAsserted(() -> assertThat( ClientHealthMonitor.getInstance().getClientHeartbeats().keySet().size()) .isEqualTo(1)); ClientProxyMembershipID proxyIDFound = ClientHealthMonitor.getInstance().getClientHeartbeats().keySet().iterator().next(); assertThat( ClientHealthMonitor.getInstance().getClientHeartbeats().keySet().contains(proxyID)) .isTrue(); }); }
Source:
<code>public void updated(Dictionary<String, ?> properties) throws ConfigurationException { { final String serialPort = (String) properties.get("serialPort"); if (StringUtils.isNotBlank(serialPort)) { this.serialPort = serialPort; } } { final String baudRate = (String) properties.get("baudRate"); if (StringUtils.isNotBlank(baudRate)) { this.baudRate = Integer.parseInt(baudRate); } } String canonical = serialPort; try { File device = new File(serialPort); if(device.canRead()) { canonical = device.getCanonicalPath(); } } catch (IOException e1) { <START> logger.info("unable to get canonical path for '" + serialPort + "'"); <END> canonical = serialPort; } xbeeSetupLock.lock(); try { if(xbee != null) { xbee.removePacketListener(this); xbee.close(); xbee = null; } xbee = new XBee(); try { logger.info("opening XBee communication on '" + canonical + "'"); xbee.open(canonical, baudRate); } catch (XBeeException e) { logger.error("failed to open connection to XBee module", e); xbee = null; return; } } finally { xbeeSetupLock.unlock(); } xbee.addPacketListener(this); }</code><technical_language>parameterized logging instead of string concatenation</technical_language>

Target:
public void updated(Dictionary<String, ?> properties) throws ConfigurationException { { final String serialPort = (String) properties.get("serialPort"); if (StringUtils.isNotBlank(serialPort)) { this.serialPort = serialPort; } } { final String baudRate = (String) properties.get("baudRate"); if (StringUtils.isNotBlank(baudRate)) { this.baudRate = Integer.parseInt(baudRate); } } String canonical = serialPort; try { File device = new File(serialPort); if (device.canRead()) { canonical = device.getCanonicalPath(); } } catch (IOException e1) { logger.info("unable to get canonical path for '{}'", serialPort); canonical = serialPort; } xbeeSetupLock.lock(); try { if (xbee != null) { xbee.removePacketListener(this); xbee.close(); xbee = null; } xbee = new XBee(); try { logger.info("opening XBee communication on '{}'", canonical); xbee.open(canonical, baudRate); } catch (XBeeException e) { logger.error("failed to open connection to XBee module", e); xbee = null; return; } } finally { xbeeSetupLock.unlock(); } xbee.addPacketListener(this); }
Source:
<code>private void removeAaHits( final IDelegateBridge bridge, final CasualtyDetails casualties, final String currentTypeAa) { final List<Unit> killed = casualties.getKilled(); if (!killed.isEmpty()) { final IntegerMap<UnitType> costs = TuvUtils.getCostsForTuv(attacker, gameData); final int tuvLostAttacker = TuvUtils.getTuv(killed, attacker, costs, gameData); attackerLostTuv += tuvLostAttacker; removeAttackers(killed, false); <START> new KillUnits(battleSite, killed, "${units} killed by " + currentTypeAa + " in ${territory}") <END> .perform(bridge); } }</code><technical_language>formatting of message pattern a responsibility of caller is me. This creates a coupling data formatting strings internally 'killUnits' caller. caller aware of string type. formatted string implementation detail of KillUnits adding a constructor, eg: new KillUnits(battleSite, killed, currentTypeAa) point recommend add a @Builder constructor meaning of parameters is more clear reading calling context. WDYT</technical_language>

Target:
private void removeAaHits( final IDelegateBridge bridge, final CasualtyDetails casualties, final String currentTypeAa) { final List<Unit> killed = casualties.getKilled(); if (!killed.isEmpty()) { final IntegerMap<UnitType> costs = TuvUtils.getCostsForTuv(attacker, gameData); final int tuvLostAttacker = TuvUtils.getTuv(killed, attacker, costs, gameData); attackerLostTuv += tuvLostAttacker; removeAttackers(killed, false); HistoryChangeFactory.removeUnitsWithAa(battleSite, killed, currentTypeAa).perform(bridge); } }
Source:
<code>private void assertRefundTransactions(Long paymentRequestId, DatabaseFixtures.TestRefund... testRefunds) { List<Map<String, Object>> refundTransactions = databaseTestHelper.getRefundTransaction(paymentRequestId); assertThat(refundTransactions.size(), is(testRefunds.length)); <START> List<String> refundReferences = refundTransactions.stream().map(refund -> (String)refund.get("refund_reference")).collect(toList()); <END> assertThat(refundReferences, containsInAnyOrder(stream(testRefunds).map(DatabaseFixtures.TestRefund::getReference).toArray())); }</code><technical_language>Again, I safer external ID reference</technical_language>

Target:
private void assertRefundTransactions(Long paymentRequestId, DatabaseFixtures.TestRefund... testRefunds) { List<Map<String, Object>> refundTransactions = databaseTestHelper.getRefundTransaction(paymentRequestId); assertThat(refundTransactions.size(), is(testRefunds.length)); List<String> refundReferences = refundTransactions.stream().map(refund -> (String)refund.get("refund_external_id")).collect(toList()); assertThat(refundReferences, containsInAnyOrder(stream(testRefunds).map(DatabaseFixtures.TestRefund::getExternalRefundId).toArray())); }
Source:
<code>protected void sendDirectMessage(final Object[] args, final Actor owner, final SResolver resolver) { CompilerAsserts.compilationConstant(args.length); SFarReference rcvr = (SFarReference) args[0]; Actor target = rcvr.getActor(); for (int i = 0; i < args.length; i++) { args[i] = wrapArgs[i].execute(args[i], target, owner); } assert !(args[0] instanceof SFarReference) : "This should not happen for this specialization, but it is handled in determineTargetAndWrapArguments(.)"; assert !(args[0] instanceof SPromise) : "Should not happen either, but just to be sure"; SteppingType step = getStepping(); DirectMessage msg = new DirectMessage( EventualMessage.getCurrentExecutingMessage(), EventualMessage.getCurrentExecutingMessageId(), target, selector, args, owner, resolver, onReceive, messageReceiverBreakpoint.executeCheckIsSetAndEnabled(), promiseResolverBreakpoint.executeCheckIsSetAndEnabled()); <START> msg.setTriggerStepping(step); <END> target.send(msg); }</code><technical_language>do set step message creation, pass in constructor? Also, I guess field in message object final then</technical_language>

Target:
protected void sendDirectMessage(final Object[] args, final Actor owner, final SResolver resolver) { CompilerAsserts.compilationConstant(args.length); SFarReference rcvr = (SFarReference) args[0]; Actor target = rcvr.getActor(); for (int i = 0; i < args.length; i++) { args[i] = wrapArgs[i].execute(args[i], target, owner); } assert !(args[0] instanceof SFarReference) : "This should not happen for this specialization, but it is handled in determineTargetAndWrapArguments(.)"; assert !(args[0] instanceof SPromise) : "Should not happen either, but just to be sure"; DirectMessage msg = new DirectMessage( EventualMessage.getCurrentExecutingMessageId(), target, selector, args, owner, resolver, onReceive, hasMessageReceiverBreakpoint(resolver), promiseResolverBreakpoint.executeCheckIsSetAndEnabled()); target.send(msg, actorPool); }
Source:
<code>public void makeRecord(DocumentRef docRef) { Document doc = resolveReference(docRef); if (isRecord(docRef)) { return; } checkPermission(doc, CAN_MAKE_RECORD); DocumentModel docModel = readModel(doc); notifyEvent(DocumentEventTypes.BEFORE_MAKE_RECORD, docModel, null, null, null, true, false); doc.makeRecord(); docModel = readModel(doc); notifyEvent(DocumentEventTypes.AFTER_MAKE_RECORD, docModel, null, null, null, true, false); <START> } <END></code><technical_language>do this action in a separate transaction? thinking listener rollbacking action avoid creation of record in system</technical_language>

Target:
public void makeRecord(DocumentRef docRef) { Document doc = resolveReference(docRef); if (isRecord(docRef)) { return; } checkPermission(doc, MAKE_RECORD); DocumentModel docModel = readModel(doc); notifyEvent(DocumentEventTypes.BEFORE_MAKE_RECORD, docModel, null, null, null, true, false); doc.makeRecord(); docModel = readModel(doc); notifyEvent(DocumentEventTypes.AFTER_MAKE_RECORD, docModel, null, null, null, true, false); }
Source:
<code>public void deleteIndex(String indexName, String designDocId) { assertNotEmpty(indexName, "indexName"); assertNotEmpty(designDocId, "designDocId"); <START> URI uri = new DatabaseURIHelper(db.getDBUri()).path("_index/").path(designDocId) <END> .path("/json/").path(indexName).build(); InputStream response = null; try { HttpConnection connection = Http.DELETE(uri); response = client.couchDbClient.executeToInputStream(connection); getResponse(response, Response.class, client.getGson()); } finally { close(response); } }</code><technical_language>Remove trailing "/"</technical_language>

Target:
public void deleteIndex(String indexName, String designDocId) { assertNotEmpty(indexName, "indexName"); assertNotEmpty(designDocId, "designDocId"); URI uri = new DatabaseURIHelper(db.getDBUri()).path("_index").path(designDocId) .path("json").path(indexName).build(); InputStream response = null; try { HttpConnection connection = Http.DELETE(uri); response = client.couchDbClient.executeToInputStream(connection); getResponse(response, Response.class, client.getGson()); } finally { close(response); } }
Source:
<code>private int getMatchingUsersCount(String username) { int count = 0; <START> for (UserKeyRecord record : storage()) { <END> if (record.getUsername().equals(username)) { count++; } } return count; }</code><technical_language>I this opportunity remove storage() storage class field, here. I this a quest remove stupid db close error get resorted random tactics removing unneeded references db objects, try prevent ref leaks..</technical_language>

Target:
private int getMatchingUsersCount(String username) { int count = 0; for (UserKeyRecord record : CommCareApplication._().getAppStorage(UserKeyRecord.class)) { if (record.getUsername().equals(username)) { count++; } } return count; }
Source:
<code>protected synchronized void _dropIndexes(String name) throws MongoException { DBCollection indexColl = fongoDb.getCollection("system.indexes"); indexColl.remove(new BasicDBObject("name", name)); for (Map.Entry<Set<String>, Index> entry : indexes.entrySet()) { if (entry.getValue().getName().equals(name)) { <START> indexes.remove(entry.getKey()); <END> break; } } }</code><technical_language>test this? this ConcurrentModificationException</technical_language>

Target:
protected synchronized void _dropIndexes(String name) throws MongoException { DBCollection indexColl = fongoDb.getCollection("system.indexes"); indexColl.remove(new BasicDBObject("name", name)); ListIterator<Index> iterator = indexes.listIterator(); while (iterator.hasNext()) { Index index = iterator.next(); if (index.getName().equals(name)) { iterator.remove(); break; } } }
Source:
<code><START> protected void onCreate(Bundle savedInstanceState) { <END> super.onCreate(savedInstanceState); ActionBar actionBar = getSupportActionBar(); if (actionBar != null) { actionBar.setHomeButtonEnabled(true); actionBar.setDisplayHomeAsUpEnabled(true); } setContentView(R.layout.people_management_activity); setTitle(R.string.people); int localBlogId = BlogUtils.getBlogLocalId(WordPress.getCurrentBlog()); Blog blog = WordPress.getBlog(localBlogId); if (savedInstanceState == null) { PeopleListFragment peopleListFragment = PeopleListFragment.newInstance(localBlogId); getFragmentManager().beginTransaction() .add(R.id.fragment_container, peopleListFragment, KEY_PEOPLE_LIST_FRAGMENT) .commit(); } if (blog != null) { refreshUsersList(blog.getDotComBlogId(), localBlogId); } }</code><technical_language>Hmm, reason override onCreate protected</technical_language>

Target:
public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); ActionBar actionBar = getSupportActionBar(); if (actionBar != null) { actionBar.setHomeButtonEnabled(true); actionBar.setDisplayHomeAsUpEnabled(true); } setContentView(R.layout.people_management_activity); int localBlogId = BlogUtils.getBlogLocalId(WordPress.getCurrentBlog()); Blog blog = WordPress.getBlog(localBlogId); if (savedInstanceState == null) { PeopleListFragment peopleListFragment = PeopleListFragment.newInstance(localBlogId); getFragmentManager().beginTransaction() .add(R.id.fragment_container, peopleListFragment, KEY_PEOPLE_LIST_FRAGMENT) .commit(); } if (blog != null) { refreshUsersList(blog.getDotComBlogId(), localBlogId); } }
Source:
<code>public McMMOPlayerCatalysisEvent(Player player, double speed) { super(player, SkillType.ALCHEMY); <START> this.setSpeed(speed); <END> cancelled = false; }</code><technical_language>For sake of consistency (and OCD), <code>this.speed = speed</code> setter here</technical_language>

Target:
public McMMOPlayerCatalysisEvent(Player player, double speed) { super(player, SkillType.ALCHEMY); this.speed = speed; cancelled = false; }
Source:
<code>public static JSONArray assembleTags(final JSONObject builddata, final HashMap<String,String> extra) { DatadogBuildListener.DescriptorImpl descriptor = DatadogUtilities.getDatadogDescriptor(); JSONArray tags = new JSONArray(); tags.add("job:" + builddata.get("job")); <START> if ( (builddata.get("node") != null) && descriptor.getTagNode() != null && descriptor.getTagNode() ) { <END> tags.add("node:" + builddata.get("node")); } if ( builddata.get("result") != null ) { tags.add("result:" + builddata.get("result")); } if ( builddata.get("branch") != null && !extra.containsKey("branch") ) { tags.add("branch:" + builddata.get("branch")); } for(Map.Entry entry : extra.entrySet()) { tags.add(String.format("%s:%s", entry.getKey(), entry.getValue())); logger.info(String.format("Emitted tag %s:%s", entry.getKey(), entry.getValue())); } return tags; }</code><technical_language>Thank for pointing this out! I PR #84 set tagNode false default, this get merged soon. this method is rebase #84 is merged</technical_language>

Target:
public static JSONArray assembleTags(final JSONObject builddata, final HashMap<String,String> extra) { JSONArray tags = new JSONArray(); tags.add("job:" + builddata.get("job")); if ( (builddata.get("node") != null) && DatadogUtilities.getDatadogDescriptor().getTagNode() ) { tags.add("node:" + builddata.get("node")); } if ( builddata.get("result") != null ) { tags.add("result:" + builddata.get("result")); } if ( builddata.get("branch") != null && !extra.containsKey("branch") ) { tags.add("branch:" + builddata.get("branch")); } for(Map.Entry entry : extra.entrySet()) { tags.add(String.format("%s:%s", entry.getKey(), entry.getValue())); logger.info(String.format("Emitted tag %s:%s", entry.getKey(), entry.getValue())); } return tags; }
Source:
<code>public void dispose() { <START> this.h.removeCallbacksAndMessages(null); <END> this.parent.dispose(); this.h = null; this.owner = null; this.parent = null; }</code><technical_language>this.h.removeCallbacksAndMessages(null) instead. Done in Patch set 2</technical_language>

Target:
public void dispose() { }
Source:
<code>private void executeScript(File vbDiffScript) throws OseeCoreException { Process process = null; try { String target = vbDiffScript.getName(); String cmd[] = {"cmd", "/s", "/c", "\"" + target + "\""}; ProcessBuilder builder = new ProcessBuilder(cmd); File parentDir = vbDiffScript.getParentFile(); if (parentDir != null) { builder.directory(parentDir); } process = builder.start(); Thread errorCatcher = new StreamLogger(process.getErrorStream()) { @Override protected void log(String message) { OseeLog.log(Activator.class, OseeLevel.SEVERE_POPUP, message); } }; Thread outputCatcher = new StreamLogger(process.getInputStream()) { @Override protected void log(String message) { OseeLog.log(Activator.class, Level.INFO, message); } }; errorCatcher.start(); outputCatcher.start(); String timeout = OseeInfo.getValue("osee.vba.word.diff.timeout"); if <START> (timeout != null) <END> { Long timeoutMs = Long.parseLong(timeout); if (!process.waitFor(timeoutMs, TimeUnit.MILLISECONDS)) { throw new OperationTimedoutException("The View Word Change Report Timed-out"); } } } catch (Exception ex) { OseeCoreException.wrapAndThrow(ex); } finally { if (process != null) { process.destroy(); } } }</code><technical_language>Strings.isValid(timeout) instead of timeout != null. checks if null "" (which is getValue return)</technical_language>

Target:
private void executeScript(File vbDiffScript) throws OseeCoreException { Process process = null; try { String target = vbDiffScript.getName(); String cmd[] = {"cmd", "/s", "/c", "\"" + target + "\""}; ProcessBuilder builder = new ProcessBuilder(cmd); File parentDir = vbDiffScript.getParentFile(); if (parentDir != null) { builder.directory(parentDir); } process = builder.start(); Thread errorCatcher = new StreamLogger(process.getErrorStream()) { @Override protected void log(String message) { OseeLog.log(Activator.class, OseeLevel.SEVERE_POPUP, message); } }; Thread outputCatcher = new StreamLogger(process.getInputStream()) { @Override protected void log(String message) { OseeLog.log(Activator.class, Level.INFO, message); } }; errorCatcher.start(); outputCatcher.start(); Long timeoutMs = Long.MAX_VALUE; String timeout = OseeInfo.getValue("osee.vba.word.diff.timeout"); if (Strings.isValid(timeout)) { timeoutMs = Long.parseLong(timeout); } if (!process.waitFor(timeoutMs, TimeUnit.MILLISECONDS)) { throw new OperationTimedoutException("The View Word Change Report Timed-out"); } } catch (Exception ex) { OseeCoreException.wrapAndThrow(ex); } finally { if (process != null) { process.destroy(); } } }
Source:
<code>public static void main(String... args) throws Exception { RSocketStats stats = RSocketStatsFactory.create(); RSocketFactory <START> .receive(stats) <END> .acceptor(new PingHandler()) .transport(WebsocketServerTransport.create(7878)) .start() .block() .onClose() .block(); }</code><technical_language>I a good sign of this change seamless, is if need change examples care stats</technical_language>

Target:
public static void main(String... args) throws Exception { RSocketFactory .receive() .acceptor(new PingHandler()) .transport(WebsocketServerTransport.create(7878)) .start() .block() .onClose() .block(); }
Source:
<code>public void destroyNode(String id) { <START> waitServerUntilAvailable.apply(getNode(id)); <END> logger.debug("Destroying %s ...", id); api.serverApi().delete(id); logger.debug("Destroyed %s!", id); }</code><technical_language>Is this needed in next state-change methods</technical_language>

Target:
public void destroyNode(String id) { checkState(cleanupResources.cleanupNode(id), "server(%s) and its resources still there after deleting!?", id); }
Source:
<code>public void addKoreRules(Module module, TermContext termContext) { KOREtoBackendKIL transformer = new KOREtoBackendKIL(module, this, termContext, false, termContext.global().krunOptions.experimental.prove != null); List<org.kframework.definition.Rule> koreRules = JavaConversions.setAsJavaSet(module.sentences()).stream() .filter(org.kframework.definition.Rule.class::isInstance) <START> .map(org.kframework.definition.Rule.class::cast) <END> .collect(Collectors.toList()); koreRules.forEach(r -> { if (r.body() instanceof KApply && ((KApply) r.body()).klabel().name().equals("<T>")) { if (!r.att().contains("automaton")) { reverseRuleTable.put(r.hashCode(), reverseRuleTable.size()); } } }); koreRules.forEach(r -> { Rule convertedRule = transformer.convert(Optional.of(module), r); addRule(convertedRule); if (r.body() instanceof KApply && ((KApply) r.body()).klabel().name().equals("<T>")) { if (!r.att().contains("automaton")) { ruleTable.put(reverseRuleTable.get(r.hashCode()), convertedRule); } else { automaton = convertedRule; } } }); }</code><technical_language>Class.cast invoke reflection costs, it</technical_language>

Target:
public void addKoreRules(Module module, TermContext termContext) { KOREtoBackendKIL transformer = new KOREtoBackendKIL(module, this, termContext, false, termContext.global().krunOptions.experimental.prove != null); List<org.kframework.definition.Rule> koreRules = JavaConversions.setAsJavaSet(module.sentences()).stream() .filter(org.kframework.definition.Rule.class::isInstance) .map(org.kframework.definition.Rule.class::cast) .collect(Collectors.toList()); koreRules.forEach(r -> { if (r.att().contains(Att.topRule())) { if (!r.att().contains(AUTOMATON)) { reverseRuleTable.put(r.hashCode(), reverseRuleTable.size()); } } }); koreRules.forEach(r -> { Rule convertedRule = transformer.convert(Optional.of(module), r); addRule(convertedRule); if (r.att().contains(Att.topRule())) { if (!r.att().contains(AUTOMATON)) { ruleTable.put(reverseRuleTable.get(r.hashCode()), convertedRule); } } if (r.att().contains(AUTOMATON)) { automaton = convertedRule; } }); }
Source:
<code>public void initReview(){ <START> int mStackLevel=0; <END> mStackLevel++; if(reviewFragment==null) reviewFragment = ReviewFragment.newInstance(mStackLevel); replaceFragment(R.id.dashboard_details_container, reviewFragment); }</code><technical_language>@idelcano do initialise variable 0 in next line increase one? do need do this? is purpose of this mStackLevel</technical_language>

Target:
public void initReview(){ if(reviewFragment==null) reviewFragment = new ReviewFragment(); replaceFragment(R.id.dashboard_details_container, reviewFragment); }
Source:
<code><START> public int size() { <END> return permissions.size(); }</code><technical_language>IMO synchronized</technical_language>

Target:
public synchronized int size() { return permissions.size(); }
Source:
<code>public <T> T getAdapter(Class<T> adapter) { T result = null; if (adapter == DRepresentationDescriptor.class) { if (linkedRepresentation == null) { <START> EditPartViewer viewer = getTargetEditPart().getViewer(); <END> IEditorPart editor = (IEditorPart) ((DiagramEditDomain)viewer.getEditDomain()).getDiagramEditorPart(); Session session = ((SessionEditorInput) editor.getEditorInput()).getSession(); Shell shell = editor.getSite().getShell(); linkedRepresentation = SingleRepresentationTreeSelectionDialog.openSelectRepresentationDescriptor(shell, session); } result = (T) linkedRepresentation; } else if (adapter == EObject.class) { result = (T) linkedRepresentation; } return result; }</code><technical_language>Session.of((EObject) getTargetEditPart().getModel()) need access shell change code in OpenDRepresentationEditPolicy. This change into: Optional<Session> optionalSession = Session.of((EObject)getTargetEditPart().getModel()); if (linkedRepresentation == null && optionalSession.isPresent()) { EditPartViewer viewer = getTargetEditPart().getViewer(); IEditorPart editor = (IEditorPart) ((DiagramEditDomain)viewer.getEditDomain()).getDiagramEditorPart(); Session session = optionalSession.get(); Shell shell = editor.getSite().getShell(); linkedRepresentation = SingleRepresentationTreeSelectionDialog.openSelectRepresentationDescriptor(shell, session); }</technical_language>

Target:
public <T> T getAdapter(Class<T> adapter) { T result = null; if (adapter == DRepresentationDescriptor.class) { if (linkedRepresentation == null) { Optional<Session> sessionOption = Session.of((EObject) getTargetEditPart().getModel()); if (sessionOption.isPresent()) { Shell shell = LinkNoteTool.this.getCurrentViewer().getControl().getShell(); linkedRepresentation = SingleRepresentationTreeSelectionDialog.openSelectRepresentationDescriptor(shell, sessionOption.get()); } } result = (T) linkedRepresentation; } else if (adapter == EObject.class) { result = (T) linkedRepresentation; } return result; }