auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private TestDescription getChaoticDescription(Random rand) { final int MAX_NODE_COUNT = 120; <START> final int MAX_SPH = 60; <END> final int MAX_K = 10; TestDescription td = new TestDescription(); List<String> haGroupTags = new ArrayList<>(); haGroupTags.add("0"); int nodeCount = rand.nextInt(MAX_NODE_COUNT) + 1; assert(nodeCount > 0); int[] sph = new int[nodeCount]; for (int i = 0; i < nodeCount; i++) sph[i] = 0; List<PartitionDescription> partitions = new ArrayList<PartitionDescription>(); List<Integer> allHostIndexes = IntStream.range(0, nodeCount).boxed().collect(Collectors.toList()); for (int i = 0; i < nodeCount; i++) { int k = rand.nextInt(Math.min(MAX_K + 1, nodeCount)); Collections.shuffle(allHostIndexes); for (int j = 0; j < k + 1; j++) { sph[allHostIndexes.get(j)] = sph[allHostIndexes.get(j)] + 1; } partitions.add(new PartitionDescription(k)); } td.hosts = new HostDescription[nodeCount]; for (int i = 0; i < nodeCount; i++) { int haIndex = rand.nextInt(haGroupTags.size()); td.hosts[i] = new HostDescription(i, sph[i], haGroupTags.get(haIndex)); } td.partitions = partitions.toArray(new PartitionDescription[0]); td.expectedMaxReplicationPerHAGroup = 0; td.expectedPartitionGroups = Integer.MAX_VALUE; return td; }</code><technical_language>MAX_SPH</technical_language>

Target:
private TestDescription getChaoticDescription(Random rand) { final int MAX_NODE_COUNT = 120; final int MAX_K = 10; TestDescription td = new TestDescription(); List<String> haGroupTags = new ArrayList<>(); haGroupTags.add("0"); int nodeCount = rand.nextInt(MAX_NODE_COUNT) + 1; assert(nodeCount > 0); int[] sph = new int[nodeCount]; for (int i = 0; i < nodeCount; i++) sph[i] = 0; List<PartitionDescription> partitions = new ArrayList<PartitionDescription>(); List<Integer> allHostIndexes = IntStream.range(0, nodeCount).boxed().collect(Collectors.toList()); for (int i = 0; i < nodeCount; i++) { int k = rand.nextInt(Math.min(MAX_K + 1, nodeCount)); Collections.shuffle(allHostIndexes); for (int j = 0; j < k + 1; j++) { sph[allHostIndexes.get(j)] = sph[allHostIndexes.get(j)] + 1; } partitions.add(new PartitionDescription(k)); } td.hosts = new HostDescription[nodeCount]; for (int i = 0; i < nodeCount; i++) { int haIndex = rand.nextInt(haGroupTags.size()); td.hosts[i] = new HostDescription(i, sph[i], haGroupTags.get(haIndex)); } td.partitions = partitions.toArray(new PartitionDescription[0]); td.expectedMaxReplicationPerHAGroup = 0; td.expectedPartitionGroups = Integer.MAX_VALUE; return td; }
Source:
<code>public void verifyDiscussionFollow(String title, boolean isFollowing) { waitForElementByElement(discussionTitle); waitForElementByElement(followButton); waitForTextToBePresentInElementByElement(discussionTitle, title); Assertion.assertEquals( getAttributeValue(followButton, PageContent.followAttributeName).equals(PageContent.followAttributeValue), isFollowing ); <START> PageObjectLogging.log("verifyDiscussionFollow", "thread following checked", true, driver); <END> }</code><technical_language>change: "thread checked" "thread: '"+title"'+, checked</technical_language>

Target:
public void verifyDiscussionFollow(String title, boolean isFollowing) { waitForElementByElement(discussionTitle); waitForElementByElement(followButton); waitForTextToBePresentInElementByElement(discussionTitle, title); Assertion.assertEquals( getAttributeValue(followButton, PageContent.followAttributeName).equals(PageContent.followAttributeValue), isFollowing ); PageObjectLogging.log("verifyDiscussionFollow", "thread: " + title + "following checked", true, driver); }
Source:
<code>public void testConfigurationEntries() throws Exception { filter.clearFilterEntries(); filter.addFilterEntries( Collections.singletonList( new FirstMatchSimpleFilter.FilterEntry("message0", false, "smtp", "dbtest1@redhat.com")) ); filter.processEvent(new E("message0")); filter.processEvent(new E("message1")); AuditLogEvent event = smtp.getEvents().get(0); String address = smtp.getNames().get(0); <START> Assert.assertEquals("message0", event.getName()); <END> Assert.assertEquals("dbtest1@redhat.com", address); }</code><technical_language>omit Assert.</technical_language>

Target:
public void testConfigurationEntries() throws Exception { filter.clearFilterEntries(); filter.addFilterEntries( Collections.singletonList( new FirstMatchSimpleFilter.FilterEntry("message0", false, "smtp", "dbtest1@redhat.com")) ); filter.processEvent(new E("message0")); filter.processEvent(new E("message1")); AuditLogEvent event = smtp.getEvents().get(0); String address = smtp.getNames().get(0); assertEquals("message0", event.getName()); assertEquals("dbtest1@redhat.com", address); }
Source:
<code>public void findV6() throws Exception { <START> final List<IPv6.Availability> availabilities = Lists.newArrayList(Availability.AVAILABLE); <END> List<String> dto = Lists.newArrayList("AVAILABLE"); context.checking(new Expectations() {{ oneOf(v6Catalog).findAll(); will(returnValue(availabilities)); }}); Reply<?> reply = service.findV6(); assertThat(reply, contains(dto)); assertThat(reply, isOk()); }</code><technical_language>path IPv6.Availability.PUBLIC</technical_language>

Target:
public void findV6() throws Exception { final List<IPv6.Availability> availabilities = Lists.newArrayList(IPv6.Availability.AVAILABLE); List<String> dto = Lists.newArrayList("AVAILABLE"); context.checking(new Expectations() {{ oneOf(v6Catalog).findAll(); will(returnValue(availabilities)); }}); Reply<?> reply = service.findV6(); assertThat(reply, contains(dto)); assertThat(reply, isOk()); }
Source:
<code>protected Block computeBlock(BlockType type, Attributes attributes) { switch (type) { case PARAGRAPH: return new ContentBlock(type, "", "", 2, 2); case QUOTE: return new ContentBlock(type, "[quote]\n----\n", "\n----\n", 1, 1); case BULLETED_LIST: case DEFINITION_LIST: case NUMERIC_LIST: if (currentBlock != null) { BlockType currentBlockType = currentBlock.getBlockType(); if (currentBlockType == BlockType.LIST_ITEM || currentBlockType == BlockType.DEFINITION_ITEM || currentBlockType == BlockType.DEFINITION_TERM) { return new ListBlock(type, 1); } } return new ListBlock(type, 2); case LIST_ITEM: if (computeCurrentListType() == BlockType.NUMERIC_LIST) { return new ListItemBlock("1. "); } return new ListItemBlock("* "); case CODE: case PREFORMATTED: return new ContentBlock(type, "[listing]\n----\n", "\n----", 1, 2); case TABLE: return new ContentBlock(type, "|===\n", "|===", 1, 1); case TABLE_ROW: return new ContentBlock(type, "", "", 2, 1); case TABLE_CELL_HEADER: case TABLE_CELL_NORMAL: return new ContentBlock(type, "|", " ", 0, 0); case DIV: return new ContentBlock(type, "", "", 0, 0); case DEFINITION_ITEM: return new <START> ContentBlock(BlockType.DEFINITION_ITEM, ":: <END> ", "", 0, 1); case DEFINITION_TERM: return new ContentBlock(type, "", "", 0, 0); default: Logger.getLogger(getClass().getName()).warning("Unexpected block type: " + type); return new ContentBlock(type, "", "", 2, 2); } }</code><technical_language>for consistency, consider passing type in instead</technical_language>

Target:
protected Block computeBlock(BlockType type, Attributes attributes) { switch (type) { case PARAGRAPH: return new ContentBlock(type, "", "", 2, 2); case QUOTE: return new ContentBlock(type, "[quote]\n----\n", "\n----\n", 1, 1); case BULLETED_LIST: case DEFINITION_LIST: case NUMERIC_LIST: if (currentBlock != null) { BlockType currentBlockType = currentBlock.getBlockType(); if (currentBlockType == BlockType.LIST_ITEM || currentBlockType == BlockType.DEFINITION_ITEM || currentBlockType == BlockType.DEFINITION_TERM) { return new ListBlock(type, 1); } } return new ListBlock(type, 2); case LIST_ITEM: if (computeCurrentListType() == BlockType.NUMERIC_LIST) { return new ListItemBlock("1. "); } return new ListItemBlock("* "); case CODE: case PREFORMATTED: return new ContentBlock(type, "[listing]\n----\n", "\n----", 1, 2); case TABLE: return new ContentBlock(type, "|===\n", "|===", 1, 1); case TABLE_ROW: return new ContentBlock(type, "", "", 2, 1); case TABLE_CELL_HEADER: case TABLE_CELL_NORMAL: return new ContentBlock(type, "|", " ", 0, 0); case DIV: return new ContentBlock(type, "", "", 0, 0); case DEFINITION_ITEM: return new ContentBlock(type, ":: ", "", 0, 1); case DEFINITION_TERM: return new ContentBlock(type, "", "", 0, 0); default: Logger.getLogger(getClass().getName()).warning("Unexpected block type: " + type); return new ContentBlock(type, "", "", 2, 2); } }
Source:
<code>protected int parseIntOrDefault(String valueAsString, int defaultValue) { <START> if (valueAsString == null || valueAsString.isEmpty()) { <END> return defaultValue; } return Integer.parseInt(valueAsString); }</code><technical_language>StringUtils.isEmpty</technical_language>

Target:
protected int parseIntOrDefault(String valueAsString, int defaultValue) { if (StringUtils.isEmpty(valueAsString)) { return defaultValue; } try { return Integer.parseInt(valueAsString); } catch (NumberFormatException e) { log.error("Invalid number for RecordFilter option: " + valueAsString, e); return defaultValue; } }
Source:
<code>public void testCheckWriteSkewWithMultipleModifications() throws Exception { final CountDownLatch latch1 = new CountDownLatch(1); final CountDownLatch latch2 = new CountDownLatch(1); final CountDownLatch latch3 = new CountDownLatch(1); Future<Void> t1 = fork(() -> { latch1.await(); tm.begin(); try { try { cache.get("k1"); cache.put("k1", "v1"); cache.put("k2", "thread 1"); } finally { latch2.countDown(); } latch3.await(); commit(); fail("Commit should have failed!"); } catch (Exception e) { if (tm.getTransaction() != null) { try { tm.rollback(); } catch (SystemException e1) { log.error("Failed to rollback", e1); } } <START> assertTrue(e instanceof RollbackException); <END> } return null; }); Future<Void> t2 = fork(() -> { latch2.await(); tm.begin(); try { try { cache.get("k1"); cache.put("k1", "v2"); cache.put("k3", "thread 2"); commit(); } finally { latch3.countDown(); } } catch (Exception e) { if (tm.getTransaction() != null) { try { tm.rollback(); } catch (SystemException e1) { log.error("Failed to rollback", e1); } } throw e; } return null; }); latch1.countDown(); t1.get(10, SECONDS); t2.get(10, SECONDS); assertTrue("k1 is expected to be in cache.", cache.containsKey("k1")); assertEquals("Wrong value for key k1.", "v2", cache.get("k1")); }</code><technical_language>replace line 140 this: Exceptions.expectException(RollbackException.class, this::commit); } catch (Exception e) { log.error("Unexpected exception in transaction 1", e); tm.rollback(); Rollback exceptions reported main thread, unexpected commit/pre-commit exceptions reported fork thread</technical_language>

Target:
public void testCheckWriteSkewWithMultipleModifications() throws Exception { final CountDownLatch latch1 = new CountDownLatch(1); final CountDownLatch latch2 = new CountDownLatch(1); final CountDownLatch latch3 = new CountDownLatch(1); Future<Void> t1 = fork(() -> { latch1.await(); tm.begin(); try { try { cache.get("k1"); cache.put("k1", "v1"); cache.put("k2", "thread 1"); } finally { latch2.countDown(); } latch3.await(); Exceptions.expectException(RollbackException.class, this::commit); } catch (Exception e) { log.error("Unexpected exception in transaction 1", e); tm.rollback(); } return null; }); Future<Void> t2 = fork(() -> { latch2.await(); tm.begin(); try { try { cache.get("k1"); cache.put("k1", "v2"); cache.put("k3", "thread 2"); commit(); } finally { latch3.countDown(); } } catch (Exception e) { if (tm.getTransaction() != null) { try { tm.rollback(); } catch (SystemException e1) { log.error("Failed to rollback", e1); } } throw e; } return null; }); latch1.countDown(); t1.get(10, SECONDS); t2.get(10, SECONDS); assertTrue("k1 is expected to be in cache.", cache.containsKey("k1")); assertEquals("Wrong value for key k1.", "v2", cache.get("k1")); }
Source:
<code>public void setUp() throws Throwable { <START> Activity activity = mActivityTestRule.getActivity(); TestUtils.setKeepScreenOn(mActivityTestRule, activity); mContext = activity; <END> mReceiver = BlockingReceiver.registerForPendingIntent(mContext); final PendingIntent intent = mReceiver.getPendingIntent(); mTextClassifier = new TextClassifier() { @Override public TextClassification classifyText(@NonNull TextClassification.Request r) { final RemoteActionCompat remoteAction = new RemoteActionCompat(ICON, ITEM, "desc", intent); remoteAction.setShouldShowIcon(false); return new TextClassification.Builder() .addAction(remoteAction) .build(); } }; final Map<String, Float> scores = new ArrayMap<>(); scores.put(TextClassifier.TYPE_EMAIL, 1f); mTextLink = new TextLink(0, ENTITY.length(), scores); }</code><technical_language>nit: setKeepScreenOn(...) return activity: mContext = TestUtils.setKeepScreenOn(mActivityTestRule, mActivityTestRule.getActivity());</technical_language>

Target:
public void setUp() throws Throwable { Activity activity = mActivityTestRule.getActivity(); TestUtils.keepScreenOn(mActivityTestRule, activity); mContext = activity; mReceiver = BlockingReceiver.registerForPendingIntent(mContext); final PendingIntent intent = mReceiver.getPendingIntent(); mTextClassifier = new TextClassifier() { @Override public TextClassification classifyText(@NonNull TextClassification.Request r) { final RemoteActionCompat remoteAction = new RemoteActionCompat(ICON, ITEM, "desc", intent); remoteAction.setShouldShowIcon(false); return new TextClassification.Builder() .addAction(remoteAction) .build(); } }; final Map<String, Float> scores = new ArrayMap<>(); scores.put(TextClassifier.TYPE_EMAIL, 1f); mTextLink = new TextLink(0, ENTITY.length(), scores); }
Source:
<code>public boolean isMemoryBlockAvailable() { <START> return (numberOfInMemBlockPermits.get() > 0) || ((storage == null) && !areSubscribersBehindByMax()); <END> }</code><technical_language>Move check storage == null areSubscribersBehindByMax(). pass a number of blocks publisher is of subscribers a parameter? Currently, reuses max number of blocks, in general include allocated blocks. In future, pressure provide a separate parameter tells blocks publisher ahead. Please consider renaming areSubscribersBehind isPublisherAhead</technical_language>

Target:
public boolean isMemoryBlockAvailable() { return (numberOfInMemBlockPermits.get() > 0); }
Source:
<code>protected String invalidFileNames(U version) { Set<SourceFile> sourceFiles = version.getSourceFiles(); StringBuilder invalidFileNames = new StringBuilder(); sourceFiles.stream().forEach(sourceFile -> { <START> sourceFile.getPath().endsWith("/"); <END> if (sourceFile.getPath().endsWith("/")) { invalidFileNames.append(sourceFile.getPath() + " "); } }); return invalidFileNames.toString(); }</code><technical_language>Unnecessary I -- return value</technical_language>

Target:
protected List<String> invalidFileNames(U version) { Set<SourceFile> sourceFiles = version.getSourceFiles(); List<String> invalidFileNames = new ArrayList<>(); sourceFiles.stream().forEach(sourceFile -> { if (sourceFile.getPath().endsWith("/")) { invalidFileNames.add(sourceFile.getPath()); } }); return invalidFileNames; }
Source:
<code>public void init(Configuration config) { checkArgument(!isNullOrEmpty(config.getString(ACCESS_KEY))); checkArgument(!isNullOrEmpty(config.getString(SECRET_KEY))); String accessKey = config.getString(ACCESS_KEY); String secretKey = config.getString(SECRET_KEY); try { AwsBasicCredentials awsBasicCredentials = AwsBasicCredentials.create(accessKey, secretKey); <START> s3Client = S3Client.builder() <END> .region(Region.AP_SOUTHEAST_1) .credentialsProvider(StaticCredentialsProvider.create(awsBasicCredentials)) .build(); } catch (S3Exception e) { throw new RuntimeException("Could not initialize S3PinotFS", e); } }</code><technical_language>this passed in part of config</technical_language>

Target:
public void init(Configuration config) { Preconditions.checkArgument(!isNullOrEmpty(config.getString(REGION))); String region = config.getString(REGION); AwsCredentialsProvider awsCredentialsProvider; try { if (!isNullOrEmpty(config.getString(ACCESS_KEY)) && !isNullOrEmpty(config.getString(SECRET_KEY))) { String accessKey = config.getString(ACCESS_KEY); String secretKey = config.getString(SECRET_KEY); AwsBasicCredentials awsBasicCredentials = AwsBasicCredentials.create(accessKey, secretKey); awsCredentialsProvider = StaticCredentialsProvider.create(awsBasicCredentials); } else { awsCredentialsProvider = AwsCredentialsProviderChain.builder().addCredentialsProvider(SystemPropertyCredentialsProvider.create()) .addCredentialsProvider(EnvironmentVariableCredentialsProvider.create()).build(); } _s3Client = S3Client.builder().region(Region.of(region)).credentialsProvider(awsCredentialsProvider).build(); } catch (S3Exception e) { throw new RuntimeException("Could not initialize S3PinotFS", e); } }
Source:
<code>public void adminsCanChangeSomeValuesResearchersCannot() { study = TestUtils.getValidStudy(StudyServiceTest.class); study.setStudyIdExcludedInExport(true); study.setEmailVerificationEnabled(true); study.setExternalIdValidationEnabled(false); study.setExternalIdRequiredOnSignup(false); study.setEmailSignInEnabled(false); study.setPhoneSignInEnabled(false); study.setReauthenticationEnabled(false); study.setAccountLimit(0); <START> study.setAutoVerificationPhoneSuppressed(false); <END> study = studyService.createStudy(study); study = studyService.getStudy(study.getIdentifier()); assertStudyDefaults(study); changeStudyDefaults(study); study = studyService.updateStudy(study, false); assertStudyDefaults(study); changeStudyDefaults(study); study = studyService.updateStudy(study, true); assertFalse(study.isStudyIdExcludedInExport()); assertFalse(study.isEmailVerificationEnabled()); assertTrue(study.isAutoVerificationPhoneSuppressed()); assertTrue(study.isExternalIdValidationEnabled()); assertTrue(study.isExternalIdRequiredOnSignup()); assertTrue(study.isEmailSignInEnabled()); assertTrue(study.isPhoneSignInEnabled()); assertTrue(study.isReauthenticationEnabled()); assertEquals(10, study.getAccountLimit()); }</code><technical_language>necessary include autoVerificationPhoneSuppressed in this test (set assert), in changeStudyDefaults()</technical_language>

Target:
public void adminsCanChangeSomeValuesResearchersCannot() { study = TestUtils.getValidStudy(StudyServiceTest.class); study.setStudyIdExcludedInExport(true); study.setEmailVerificationEnabled(true); study.setExternalIdValidationEnabled(false); study.setExternalIdRequiredOnSignup(false); study.setEmailSignInEnabled(false); study.setPhoneSignInEnabled(false); study.setReauthenticationEnabled(false); study.setAccountLimit(0); study = studyService.createStudy(study); study = studyService.getStudy(study.getIdentifier()); assertStudyDefaults(study); changeStudyDefaults(study); study = studyService.updateStudy(study, false); assertStudyDefaults(study); changeStudyDefaults(study); study = studyService.updateStudy(study, true); assertFalse(study.isStudyIdExcludedInExport()); assertFalse(study.isEmailVerificationEnabled()); assertTrue(study.isAutoVerificationPhoneSuppressed()); assertTrue(study.isExternalIdValidationEnabled()); assertTrue(study.isExternalIdRequiredOnSignup()); assertTrue(study.isEmailSignInEnabled()); assertTrue(study.isPhoneSignInEnabled()); assertTrue(study.isReauthenticationEnabled()); assertEquals(10, study.getAccountLimit()); }
Source:
<code>public static CucumberFeature parseResource(Resource resource) { requireNonNull(resource); URI path = resource.getPath(); String source = read(resource); try { Parser<GherkinDocument> parser = new Parser<>(new AstBuilder()); TokenMatcher matcher = new TokenMatcher(); GherkinDocument gherkinDocument = parser.parse(source, matcher); List<PickleEvent> pickleEvents = compilePickles(gherkinDocument, resource); return new CucumberFeature(gherkinDocument, path, source, pickleEvents); } catch (ParserException e) { <START> throw new CucumberException("Failed to parse resourse at: " + path.toString(), e); <END> } }</code><technical_language>suggestion throw new CucumberException("Failed parse resource at: " + path.toString(), e);</technical_language>

Target:
public static CucumberFeature parseResource(Resource resource) { requireNonNull(resource); URI path = resource.getPath(); String source = read(resource); try { Parser<GherkinDocument> parser = new Parser<>(new AstBuilder()); TokenMatcher matcher = new TokenMatcher(); GherkinDocument gherkinDocument = parser.parse(source, matcher); List<PickleEvent> pickleEvents = compilePickles(gherkinDocument, resource); return new CucumberFeature(gherkinDocument, path, source, pickleEvents); } catch (ParserException e) { throw new CucumberException("Failed to parse resource at: " + path.toString(), e); } }
Source:
<code>public void shutdown() throws InterruptedException { synchronized (m_shutdownLock) { <START> m_snapshotCreateSetupBarrier = null; <END> m_snapshotCreateFinishBarrier = null; } if (m_snapshotTargetTerminators != null) { for (Thread t : m_snapshotTargetTerminators) { t.join(); } } }</code><technical_language>this lock prevent a node shutdown longer shutdown</technical_language>

Target:
public void shutdown() throws InterruptedException { m_snapshotCreateSetupBarrier.reset(); m_snapshotCreateFinishBarrier.reset(); if (m_snapshotTargetTerminators != null) { for (Thread t : m_snapshotTargetTerminators) { t.join(); } } }
Source:
<code>public Host getActiveHostByName(String serverName) { <START> final Host host = VdsmManager.getInstance().getHostByName(serverName); <END> return host; }</code><technical_language>return VdsmManager.getInstance().getHostByName(serverName); host is needed</technical_language>

Target:
public Host getActiveHostByName(String serverName) { return VdsmManager.getInstance().getHostByName(serverName); }
Source:
<code>private void updateGraphicsDevice(GraphicsType type) { <START> final GraphicsDevice <END> existingGraphicsDevice = getGraphicsDevOfType(type); final GraphicsDevice paramsGraphicsDevice = getParameters().getGraphicsDevices().get(type); if (existingGraphicsDevice == null) { if (paramsGraphicsDevice != null) { paramsGraphicsDevice.setVmId(getVmId()); getBackend().runInternalAction(VdcActionType.AddGraphicsDevice, new GraphicsParameters(paramsGraphicsDevice)); } } else { if (paramsGraphicsDevice == null) { getBackend().runInternalAction(VdcActionType.RemoveGraphicsDevice, new GraphicsParameters(existingGraphicsDevice)); } else { paramsGraphicsDevice.setVmId(getVmId()); getBackend().runInternalAction(VdcActionType.UpdateGraphicsDevice, new GraphicsParameters(paramsGraphicsDevice)); } } }</code><technical_language>need for 'final'</technical_language>

Target:
private void updateGraphicsDevice(GraphicsType type) { GraphicsDevice existingGraphicsDevice = getGraphicsDevOfType(type); GraphicsDevice paramsGraphicsDevice = getParameters().getGraphicsDevices().get(type); if (existingGraphicsDevice == null) { if (paramsGraphicsDevice != null) { paramsGraphicsDevice.setVmId(getVmId()); getBackend().runInternalAction(VdcActionType.AddGraphicsDevice, new GraphicsParameters(paramsGraphicsDevice)); } } else { if (paramsGraphicsDevice == null) { getBackend().runInternalAction(VdcActionType.RemoveGraphicsDevice, new GraphicsParameters(existingGraphicsDevice)); } else { paramsGraphicsDevice.setVmId(getVmId()); getBackend().runInternalAction(VdcActionType.UpdateGraphicsDevice, new GraphicsParameters(paramsGraphicsDevice)); } } }
Source:
<code>public ServiceMessageCodec( @Nullable HeadersCodec headersCodec, @Nullable Collection<DataCodec> dataCodecs) { this.headersCodec = headersCodec == null ? new BinaryHeadersCodec() : headersCodec; Map<String, DataCodec> defaultCodecs = DataCodec.INSTANCES; if (dataCodecs == null) { this.dataCodecs = defaultCodecs; } else { this.dataCodecs = dataCodecs.stream() .collect( collectingAndThen( toMap(DataCodec::contentType, identity(), (c1, c2) -> c2), usersCodec -> { <START> Map<String, DataCodec> buffer = new HashMap<>(defaultCodecs); <END> buffer.putAll(usersCodec); return Collections.unmodifiableMap(buffer); })); } }</code><technical_language>IMHO this map is redundant</technical_language>

Target:
public ServiceMessageCodec( @Nullable HeadersCodec headersCodec, @Nullable Collection<DataCodec> dataCodecs) { this.headersCodec = headersCodec == null ? new DefaultHeadersCodec() : headersCodec; Map<String, DataCodec> defaultCodecs = DataCodec.INSTANCES; if (dataCodecs == null) { this.dataCodecs = defaultCodecs; } else { this.dataCodecs = dataCodecs.stream() .collect( collectingAndThen( toMap(DataCodec::contentType, identity(), (c1, c2) -> c2), usersCodec -> { Map<String, DataCodec> buffer = new HashMap<>(defaultCodecs); buffer.putAll(usersCodec); return Collections.unmodifiableMap(buffer); })); } }
Source:
<code>public List<Boolean> getDeviceVpnConnectionStatuses() { <START> return Arrays.stream(deviceVpnConnectionStatuses.split(DeviceBase.DEVICE_NAMES_SEPARATOR)).map(Boolean::parseBoolean) <END> .collect(Collectors.toList()); }</code><technical_language>is a bit strange reuse DEVICE_NAMES_SEPARATOR here. is cleaner introduce a new constant</technical_language>

Target:
public List<Boolean> getDeviceVpnConnectionStatuses() { return Arrays.stream(deviceVpnConnectionStatuses.split(SEPARATOR)).map(Boolean::parseBoolean) .collect(Collectors.toList()); }
Source:
<code>public void bind() { $(menuToggle).find("a").on("click", new Function() { @Override public boolean f(Event event) { Window.scrollTo(0,0); $(sidebar).toggleClass(appResources.style().active()); $(menuToggle).removeClass(appResources.style().active()); if($(sidebar).hasClass(appResources.style().active())){ $(menuToggle).toggleClass(appResources.style().active()); } return false; } }); <START> $(sidebar).find("a").on("click", new Function() { <END> @Override public void f() { Window.scrollTo(0,0); $(sidebar).removeClass(appResources.style().active()); $(menuToggle).removeClass(appResources.style().active()); } }); $(content).on("click", new Function() { @Override public void f() { $(sidebar).removeClass(appResources.style().active()); $(menuToggle).removeClass(appResources.style().active()); } }); }</code><technical_language>$(sidebar, "a") done thing, right? also, there' a onclick I (shortcut this)</technical_language>

Target:
public void bind() { $("a", menuToggle).click(new Function() { @Override public boolean f(Event event) { Window.scrollTo(0, 0); $(sidebar).toggleClass(appResources.style().active()); $(menuToggle).removeClass(appResources.style().active()); if($(sidebar).hasClass(appResources.style().active())){ $(menuToggle).toggleClass(appResources.style().active()); } return false; } }); $("a", sidebar).click(new Function() { @Override public void f() { Window.scrollTo(0, 0); $(sidebar).removeClass(appResources.style().active()); $(menuToggle).removeClass(appResources.style().active()); } }); $(content).click(new Function() { @Override public void f() { $(sidebar).removeClass(appResources.style().active()); $(menuToggle).removeClass(appResources.style().active()); } }); }
Source:
<code>} catch (NullPointerException e) { <START> throw new IllegalArgumentException("Unable to find stream with anme " + trigger.getKinesisStream()); <END> }</code><technical_language>please change anme name</technical_language>

Target:
} catch (NullPointerException e) { throw new IllegalArgumentException("Unable to find stream with name " + trigger.getKinesisStream()); }
Source:
<code>private void loadJavaExtensions(Set<String> addedImports) { Map<String, Class> toUnload = Maps.newLinkedHashMap(); Map<String, Class> toLoad = Maps.newLinkedHashMap(); Set<String> notFound = Sets.newLinkedHashSet(); for (String qualifiedName : addedImports) { Class<?> found = null; try { Class<?> serviceClass = <START> Class.forName(qualifiedName); <END> if (JAVA_SERVICES_CLASSES_WHITE_LIST.contains(serviceClass)) { loaded(serviceClass.getName(), serviceClass); found = serviceClass; } } catch (ClassNotFoundException e) { } if (found == null) { found = classLoading.findClass(viewpointProjects, viewpointPlugins, qualifiedName); if (found != null) { this.couldNotBeLoaded.remove(qualifiedName); Class<?> alreadyHere = loadedClasses.get(qualifiedName); if (alreadyHere != null) { toUnload.put(qualifiedName, alreadyHere); } loadedClasses.put(qualifiedName, found); toLoad.put(qualifiedName, found); } else { notFound.add(qualifiedName); this.couldNotBeLoaded.add(qualifiedName); } } } for (Map.Entry<String, Class> classToUnload : toUnload.entrySet()) { unloaded(classToUnload.getKey(), classToUnload.getValue()); } for (Map.Entry<String, Class> classToLoad : toLoad.entrySet()) { loaded(classToLoad.getKey(), classToLoad.getValue()); } for (String qualifiedName : notFound) { notFound(qualifiedName); } }</code><technical_language>-> PCD CBR next week</technical_language>

Target:
private void loadJavaExtensions(Set<String> addedImports) { Map<String, Class> toUnload = Maps.newLinkedHashMap(); Map<String, Class> toLoad = Maps.newLinkedHashMap(); Set<String> notFound = Sets.newLinkedHashSet(); for (String qualifiedName : addedImports) { Class<?> found = classLoading.findClass(viewpointProjects, viewpointPlugins, qualifiedName); if (found == null) { found = classLoading.findClass(Collections.<String> emptySet(), JAVA_SERVICES_BUNDLES_WHITE_LIST, qualifiedName); } if (found != null) { this.couldNotBeLoaded.remove(qualifiedName); Class<?> alreadyHere = loadedClasses.get(qualifiedName); if (alreadyHere != null) { toUnload.put(qualifiedName, alreadyHere); } loadedClasses.put(qualifiedName, found); toLoad.put(qualifiedName, found); } else { notFound.add(qualifiedName); this.couldNotBeLoaded.add(qualifiedName); } } for (Map.Entry<String, Class> classToUnload : toUnload.entrySet()) { unloaded(classToUnload.getKey(), classToUnload.getValue()); } for (Map.Entry<String, Class> classToLoad : toLoad.entrySet()) { loaded(classToLoad.getKey(), classToLoad.getValue()); } for (String qualifiedName : notFound) { notFound(qualifiedName); } }
Source:
<code><START> public boolean hasIncomingChanges() { <END> for (AbstractTaskEditorPart part : subParts) { if (part.hasIncomingChanges()) { return true; } } return false; }</code><technical_language>return true if super.hasIncomingChanges (the parent section attribute editors directly, e.g. bugzilla attribute section attribute editors a subsection called Flags)</technical_language>

Target:
public boolean hasIncomingChanges() { if (super.hasIncomingChanges()) { return true; } for (AbstractTaskEditorPart part : subParts) { if (part.hasIncomingChanges()) { return true; } } return false; }
Source:
<code>public Iterator<String> getAttributeNames() { final List<String> names; synchronized (attributes) { <START> names = new ArrayList<>(attributes.size()); <END> names.addAll(attributes.keySet()); } return names.iterator(); }</code><technical_language>names = new ArrayList<>(attributes.keySet());</technical_language>

Target:
public Iterator<String> getAttributeNames() { return attributes.keySet().iterator(); }
Source:
<code>public void tracing(ResultSet resultSet) { if (isTracingEnabled()) { Logger actualLogger = traceQueryForEntity ? entityLogger : dmlLogger; <START> if(actualLogger.isTraceEnabled()) { <END> for (ExecutionInfo executionInfo : resultSet.getAllExecutionInfo()) { StringBuilder builder = new StringBuilder(); builder.append(format("Query tracing at host %s with achieved consistency level %s \n", executionInfo.getQueriedHost(), executionInfo.getAchievedConsistencyLevel())); builder.append("****************************\n"); builder.append(format("%1$-80s | %2$-16s | %3$-24s | %4$-20s\n", "Description", "Source", "Source elapsed in micros", "Thread name")); try { final QueryTrace queryTrace = executionInfo.getQueryTrace(); if (queryTrace != null) { final List<QueryTrace.Event> events = new ArrayList<>(queryTrace.getEvents()); Collections.sort(events, EVENT_TRACE_COMPARATOR); for (QueryTrace.Event event : events) { builder.append(format("%1$-80s | %2$-16s | %3$-24s | %4$-20s\n", event.getDescription(), event.getSource(), event.getSourceElapsedMicros(), event.getThreadName())); } } } catch (TraceRetrievalException e) { builder.append(format(" ERROR: cannot retrieve trace for query %s because it may not be yet available\n", getQueryString())); } builder.append("****************************\n"); actualLogger.trace(builder.toString()); } } } }</code><technical_language>check for logger level, done 2 lines ..</technical_language>

Target:
public void tracing(ResultSet resultSet) { if (isTracingEnabled()) { Logger actualLogger = traceQueryForEntity ? entityLogger : dmlLogger; for (ExecutionInfo executionInfo : resultSet.getAllExecutionInfo()) { StringBuilder builder = new StringBuilder(); builder.append(format("Query tracing at host %s with achieved consistency level %s \n", executionInfo.getQueriedHost(), executionInfo.getAchievedConsistencyLevel())); builder.append("****************************\n"); builder.append(format("%1$-80s | %2$-16s | %3$-24s | %4$-20s\n", "Description", "Source", "Source elapsed in micros", "Thread name")); try { final QueryTrace queryTrace = executionInfo.getQueryTrace(); if (queryTrace != null) { final List<QueryTrace.Event> events = new ArrayList<>(queryTrace.getEvents()); Collections.sort(events, EVENT_TRACE_COMPARATOR); for (QueryTrace.Event event : events) { builder.append(format("%1$-80s | %2$-16s | %3$-24s | %4$-20s\n", event.getDescription(), event.getSource(), event.getSourceElapsedMicros(), event.getThreadName())); } } } catch (TraceRetrievalException e) { builder.append(format(" ERROR: cannot retrieve trace for query %s because it may not be yet available\n", getQueryString())); } builder.append("****************************\n"); actualLogger.trace(builder.toString()); } } }
Source:
<code>private void processFileAction() throws IOException { fileAction = fileAction.toLowerCase(); try { switch (fileAction) { case "delete": <START> fs.delete(file, true); <END> break; case "move": Path tagetFileMovePath = new Path(targetFolder + file.getName()); fs.rename(file, tagetFileMovePath); break; case "archive": FileOutputStream archivedStream = new FileOutputStream(targetFolder + file.getName() + ".zip"); ZipOutputStream zipArchivedStream = new ZipOutputStream(archivedStream); FSDataInputStream fdDataInputStream = fs.open(file); zipArchivedStream.putNextEntry(new ZipEntry(file.getName())); int length; byte[] buffer = new byte[1024]; while ((length = fdDataInputStream.read(buffer)) > 0) { zipArchivedStream.write(buffer, 0, length); } zipArchivedStream.closeEntry(); fdDataInputStream.close(); zipArchivedStream.close(); fs.delete(file, true); break; default: break; } } catch (IOException ioe) { throw ioe; } }</code><technical_language>this work in secured clusters</technical_language>

Target:
private void processFileAction() throws IOException { switch (fileAction.toLowerCase()) { case "delete": fs.delete(file, true); break; case "move": Path targetFileMovePath = new Path(targetFolder, file.getName()); fs.rename(file, targetFileMovePath); break; case "archive": try (FSDataOutputStream archivedStream = fs.create(new Path(targetFolder, file.getName() + ".zip")); ZipOutputStream zipArchivedStream = new ZipOutputStream(archivedStream); FSDataInputStream fdDataInputStream = fs.open(file)) { zipArchivedStream.putNextEntry(new ZipEntry(file.getName())); int length; byte[] buffer = new byte[1024]; while ((length = fdDataInputStream.read(buffer)) > 0) { zipArchivedStream.write(buffer, 0, length); } zipArchivedStream.closeEntry(); } fs.delete(file, true); break; default: break; } }
Source:
<code>public ASTNode visit(Constant constant, Void _) { Term rez; if (constant.getSort().equals(Sort.KLIST)) { <START> rez = new KLabelConstant(constant.getValue()); <END> } else { rez = Token.kAppOf(constant.getSort(), constant.getValue()); } rez.setLocation(constant.getLocation()); rez.setSource(constant.getSource()); rez.copyAttributesFrom(constant); return this.visitNode(rez); }</code><technical_language>heck is here? klabel constants of sort KList?</technical_language>

Target:
public ASTNode visit(Constant constant, Void _) { Term rez; if (constant.getSort().equals(Sort.KLABEL)) { rez = new KLabelConstant(constant.getValue()); } else { rez = Token.kAppOf(constant.getSort(), constant.getValue()); } rez.setLocation(constant.getLocation()); rez.setSource(constant.getSource()); rez.copyAttributesFrom(constant); return this.visitNode(rez); }
Source:
<code>private void addEntryToJar(JarEntrySupplier entrySupplier, CustomJarOutputStream jar) throws IOException { CustomZipEntry entry = entrySupplier.getEntry(); String entryName = entry.getName(); if (JarFile.MANIFEST_NAME.equals(entryName)) { return; } if (removeEntryPredicate.test(entrySupplier.getEntry())) { return; } mkdirs(getParentDir(entryName), jar); if (!isDuplicateAllowed(entryName) && !alreadyAddedEntries.add(entryName)) { if (!entryName.endsWith("/")) { observer.onDuplicateEntry(String.valueOf(outputFile), entrySupplier); } return; } if (isService(entryName)) { try (InputStream entryInputStream = entrySupplier.getInputStreamSupplier().get()) { if (entryInputStream != null) { <START> Set<String> existingServices = services.getOrDefault(entryName, new LinkedHashSet<>()); <END> existingServices.add( CharStreams.toString(new InputStreamReader(entryInputStream, Charsets.UTF_8))); services.putIfAbsent(entryName, existingServices); } } return; } jar.putNextEntry(entry); try (InputStream entryInputStream = entrySupplier.getInputStreamSupplier().get()) { if (entryInputStream != null) { ByteStreams.copy(entryInputStream, jar); } } jar.closeEntry(); }</code><technical_language>of getOrDefault is create a garbage LinkedHashSet time. computeIfAbsent is better. need putIfAbsent afterwards</technical_language>

Target:
private void addEntryToJar(JarEntrySupplier entrySupplier, CustomJarOutputStream jar) throws IOException { CustomZipEntry entry = entrySupplier.getEntry(); String entryName = entry.getName(); if (JarFile.MANIFEST_NAME.equals(entryName)) { return; } if (removeEntryPredicate.test(entrySupplier.getEntry())) { return; } mkdirs(getParentDir(entryName), jar); if (!isDuplicateAllowed(entryName) && !alreadyAddedEntries.add(entryName)) { if (!entryName.endsWith("/")) { observer.onDuplicateEntry(String.valueOf(outputFile), entrySupplier); } return; } if (isService(entryName)) { try (InputStream entryInputStream = Preconditions.checkNotNull(entrySupplier.getInputStreamSupplier().get())) { Set<String> existingServices = services.computeIfAbsent(entryName, (m) -> new LinkedHashSet<>()); existingServices.add( CharStreams.toString(new InputStreamReader(entryInputStream, Charsets.UTF_8))); } return; } jar.putNextEntry(entry); try (InputStream entryInputStream = entrySupplier.getInputStreamSupplier().get()) { if (entryInputStream != null) { ByteStreams.copy(entryInputStream, jar); } } jar.closeEntry(); }
Source:
<code><START> void validate() { <END> }</code><technical_language>Interesting wrapping style :)</technical_language>

Target:
public void validate() { }
Source:
<code>protected void migrateData(ReviewDb db, UpdateUI ui) throws SQLException { List<String> toCalc = new ArrayList<String>(1000); PreparedStatement selectStmt = ((JdbcSchema) db).getConnection().prepareStatement( "SELECT sort_key FROM changes WHERE sort_key_desc IS NULL" <START> + " OR sort_key_desc='';"); <END> selectStmt.setMaxRows(1000); PreparedStatement updateStmt = ((JdbcSchema) db).getConnection().prepareStatement( "UPDATE changes SET sort_key_desc = ? WHERE sort_key = ?;"); try { while (true) { ResultSet rs = selectStmt.executeQuery(); try { while (rs.next()) { toCalc.add(rs.getString(1)); } } finally { rs.close(); } if (toCalc.isEmpty()) break; for (String s : toCalc) { String sortKeyDesc = Long.toHexString(-1l - Long.parseLong(s, 16)); updateStmt.setString(1, sortKeyDesc); updateStmt.setString(2, s); updateStmt.addBatch(); } updateStmt.executeBatch(); toCalc.clear(); } } finally { updateStmt.close(); selectStmt.close(); } }</code><technical_language>include ";" in JDBC statements this. officially part of SQL standard databases accept in a query submitted APIs</technical_language>

Target:
protected void migrateData(ReviewDb db, UpdateUI ui) throws SQLException { List<ToUpdate> changes = new ArrayList<ToUpdate>(MAX_SCAN_SIZE); PreparedStatement selectStmt = ((JdbcSchema) db).getConnection().prepareStatement( "SELECT change_id, sort_key FROM changes" + " WHERE sort_key_desc IS NULL OR sort_key_desc=''"); selectStmt.setMaxRows(MAX_SCAN_SIZE); PreparedStatement updateStmt = ((JdbcSchema) db).getConnection().prepareStatement( "UPDATE changes SET sort_key_desc = ? WHERE change_id = ?"); try { while (true) { ResultSet rs = selectStmt.executeQuery(); try { while (rs.next() && changes.size() < MAX_SCAN_SIZE) { changes.add(new ToUpdate(rs.getInt(1), rs.getString(2))); } } finally { rs.close(); } if (changes.isEmpty()) { break; } int batchSize = 0; for (ToUpdate u : changes) { String desc = Long.toHexString(-1l - Long.parseLong(u.sortKey, 16)); updateStmt.setString(1, desc); updateStmt.setInt(2, u.id); updateStmt.addBatch(); batchSize++; if (batchSize >= 200) { updateStmt.executeBatch(); batchSize = 0; } } if (batchSize > 0) { updateStmt.executeBatch(); } changes.clear(); } } finally { updateStmt.close(); selectStmt.close(); } }
Source:
<code>private void testGetOnRecoveryNode(Map<BlobId, Integer> blobIdToSizeMap) throws IOException { BlockingChannel channel = ServerTestUtil.getBlockingChannelBasedOnPortType(recoveryNodePort, "localhost", null, null); channel.connect(); AtomicInteger correlationIdGenerator = new AtomicInteger(0); List<PartitionRequestInfo> partitionRequestInfoList = Collections.singletonList(new PartitionRequestInfo(partitionId, blobIds)); GetRequest getRequest = new GetRequest(correlationIdGenerator.incrementAndGet(), GetRequest.Replication_Client_Id_Prefix + recoveryNode.getHostname(), MessageFormatFlags.All, partitionRequestInfoList, new ReplicationConfig(new VerifiableProperties(recoveryProperties)).replicationIncludeAll ? GetOption.Include_All : GetOption.None); channel.send(getRequest); GetResponse getResponse = GetResponse.readFrom(new DataInputStream(channel.receive().getInputStream()), recoveryCluster.getClusterMap()); for (PartitionResponseInfo partitionResponseInfo : getResponse.getPartitionResponseInfoList()) { assertEquals("Error in getting the recovered blobs", ServerErrorCode.No_Error, partitionResponseInfo.getErrorCode()); for (MessageInfo messageInfo : partitionResponseInfo.getMessageInfoList()) { <START> assertEquals(blobIdToSizeMap.get(messageInfo.getStoreKey()) + 270, messageInfo.getSize()); <END> } } }</code><technical_language>nit: cast messageInfo.getStoreKey() BlobId type</technical_language>

Target:
private void testGetOnRecoveryNode(Map<BlobId, Integer> blobIdToSizeMap) throws IOException { BlockingChannel channel = ServerTestUtil.getBlockingChannelBasedOnPortType(recoveryNodePort, "localhost", null, null); channel.connect(); AtomicInteger correlationIdGenerator = new AtomicInteger(0); List<PartitionRequestInfo> partitionRequestInfoList = Collections.singletonList(new PartitionRequestInfo(partitionId, blobIds)); GetRequest getRequest = new GetRequest(correlationIdGenerator.incrementAndGet(), GetRequest.Replication_Client_Id_Prefix + recoveryNode.getHostname(), MessageFormatFlags.All, partitionRequestInfoList, new ReplicationConfig(new VerifiableProperties(recoveryProperties)).replicationIncludeAll ? GetOption.Include_All : GetOption.None); channel.send(getRequest); GetResponse getResponse = GetResponse.readFrom(new DataInputStream(channel.receive().getInputStream()), recoveryCluster.getClusterMap()); for (PartitionResponseInfo partitionResponseInfo : getResponse.getPartitionResponseInfoList()) { assertEquals("Error in getting the recovered blobs", ServerErrorCode.No_Error, partitionResponseInfo.getErrorCode()); for (MessageInfo messageInfo : partitionResponseInfo.getMessageInfoList()) { assertEquals(blobIdToSizeMap.get((BlobId) messageInfo.getStoreKey()) + 270, messageInfo.getSize()); } } }
Source:
<code>public byte[] getCacheKey() { <START> byte[] fieldNameBytes = StringUtils.toUtf8WithNullToEmpty(fieldName); <END> byte[] expressionBytes = StringUtils.toUtf8WithNullToEmpty(expression); return ByteBuffer.allocate(2 + fieldNameBytes.length + expressionBytes.length) .put(AggregatorUtil.DOUBLE_ANY_CACHE_TYPE_ID) .put(fieldNameBytes) .put(AggregatorUtil.STRING_SEPARATOR) .put(expressionBytes) .array(); }</code><technical_language>This method similar CacheKeyBuilder instead</technical_language>

Target:
public byte[] getCacheKey() { return new CacheKeyBuilder(AggregatorUtil.DOUBLE_ANY_CACHE_TYPE_ID) .appendString(fieldName) .appendString(expression) .build(); }
Source:
<code>public void init(OrganizationalUnitsScreen presenter) { this.presenter = presenter; if (!presenter.canCreateOrganizationalUnit()) { createOrganizationalUnit.setHidden(true); } else { createOrganizationalUnit.setTextContent(ts.format(LibraryConstants.CreateOrganizationalUnit, translationUtils.getOrganizationalUnitAliasInSingular())); } title.setTextContent(translationUtils.getOrganizationalUnitAliasInPlural()); filterName.setAttribute("placeholder", ts.getTranslation(LibraryConstants.FilterByName)); <START> cardByOrganizationalUnitIdentifier = new HashMap<>(); <END> }</code><technical_language>I this view, view, "stupid" possible. if in presenter this variable cardByOrganizationalUnitIdentifier. This component presenter functionality tested unit test</technical_language>

Target:
public void init(OrganizationalUnitsScreen presenter) { this.presenter = presenter; createOrganizationalUnit.setTextContent(ts.format(LibraryConstants.CreateOrganizationalUnit, translationUtils.getOrganizationalUnitAliasInSingular())); title.setTextContent(translationUtils.getOrganizationalUnitAliasInPlural()); filterName.setAttribute("placeholder", ts.getTranslation(LibraryConstants.FilterByName)); }
Source:
<code>public void close() throws IOException { <START> socket.close(); <END> }</code><technical_language>socket null if exception thrown in sendToSocket catch clause</technical_language>

Target:
public void close() throws IOException { if (socket == null) return; socket.close(); }
Source:
<code>private void send(final String destId, final AvroElasticMemoryMessage msg) { LOG.entering(ElasticMemoryMsgSenderImpl.class.getSimpleName(), "send", new Object[]{destId, msg}); <START> final Connection conn = emNetworkSetup.getConnectionFactory() <END> .newConnection(identifierFactory.getNewInstance(destId)); try { conn.open(); conn.write(msg); } catch (final NetworkException ex) { throw new RuntimeException("NetworkException", ex); } LOG.exiting(ElasticMemoryMsgSenderImpl.class.getSimpleName(), "send", new Object[] { destId, msg }); }</code><technical_language>IntelliJ is complaining unchecked call (conn.write(msg);). hurt add <AvroElasticMemoryMessage> Connection</technical_language>

Target:
private void send(final String destId, final AvroElasticMemoryMessage msg) { LOG.entering(ElasticMemoryMsgSenderImpl.class.getSimpleName(), "send", new Object[]{destId, msg}); final Connection<AvroElasticMemoryMessage> conn = emNetworkSetup.getConnectionFactory() .newConnection(identifierFactory.getNewInstance(destId)); try { conn.open(); conn.write(msg); } catch (final NetworkException ex) { throw new RuntimeException("NetworkException", ex); } LOG.exiting(ElasticMemoryMsgSenderImpl.class.getSimpleName(), "send", new Object[] { destId, msg }); }