auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private List<Observation> createObservationGroups() { Concept concept1 = new Concept(); concept1.setUuid("child2Child1Uuid"); Observation child1 = new Observation(); child1.setConcept(concept1); child1.setValue(new Observation.ObservationValue("Yes")); child1.setObsDatetime(DATE); Concept concept2 = new Concept(); concept2.setUuid("child1Child1Uuid"); Observation child2 = new Observation(); child2.setConcept(concept2); child2.setValue(new Observation.ObservationValue("No")); child2.setObsDatetime(DATE); Concept concept3 = new Concept(); concept3.setUuid("child2Uuid"); Observation child3 = new Observation(); child3.setConcept(concept3); child3.setValue(new Observation.ObservationValue("2nd")); child3.setObsDatetime(DATE); Concept concept4 = new Concept(); concept4.setUuid("child3Uuid"); Observation child4 = new Observation(); child4.setConcept(concept4); child4.setValue(new Observation.ObservationValue("Maybe")); child4.setObsDatetime(DATE); Concept concept5 = new Concept(); concept5.setUuid("parentUuid"); Observation parentObservation = new Observation(); parentObservation.setObsDatetime(DATE); parentObservation.setConcept(concept5); <START> parentObservation.setGroupMembers(Arrays.asList(child1, child2, child3, child4)); <END> return Collections.singletonList(parentObservation); }</code><technical_language>4 children 3</technical_language>

Target:
private List<Observation> createObservationGroups() { Concept concept1 = new Concept(); concept1.setUuid("child1Child1Uuid"); Observation childChild1 = new Observation(); childChild1.setConcept(concept1); childChild1.setValue(new Observation.ObservationValue("No")); childChild1.setObsDatetime(DATE); Concept concept2 = new Concept(); concept2.setUuid("child2Child1Uuid"); Observation childChild2 = new Observation(); childChild2.setConcept(concept2); childChild2.setValue(new Observation.ObservationValue("Yes")); childChild2.setObsDatetime(DATE); Concept concept3 = new Concept(); concept3.setUuid("child1Uuid"); Observation child1 = new Observation(); child1.setConcept(concept3); child1.setGroupMembers(Arrays.asList(childChild2, childChild1)); child1.setObsDatetime(DATE); Concept concept4 = new Concept(); concept4.setUuid("child2Uuid"); Observation child2 = new Observation(); child2.setConcept(concept4); child2.setValue(new Observation.ObservationValue("2nd")); child2.setObsDatetime(DATE); Concept concept5 = new Concept(); concept5.setUuid("child3Uuid"); Observation child3 = new Observation(); child3.setConcept(concept5); child3.setValue(new Observation.ObservationValue("Maybe")); child3.setObsDatetime(DATE); Concept concept6 = new Concept(); concept6.setUuid("parentUuid"); Observation parentObservation = new Observation(); parentObservation.setObsDatetime(DATE); parentObservation.setConcept(concept6); parentObservation.setGroupMembers(Arrays.asList(child1, child2, child3)); return Collections.singletonList(parentObservation); }
Source:
<code>public static long currentTime(ConnectorSession session) { <START> long millis = UTC_CHRONOLOGY.millisOfDay().get(session.getStartTime()); <END> return packDateTimeWithZone(millis, session.getTimeZoneKey()); }</code><technical_language>Also, this incrrect, if TIME TZ's mills+tz % 24h</technical_language>

Target:
public static long currentTime(ConnectorSession session) { long millis = UTC_CHRONOLOGY.millisOfDay().get(session.getStartTime()); if (!session.isLegacyTimestamp()) { millis -= valueToSessionTimeZoneOffsetDiff(session.getStartTime(), getDateTimeZone(session.getTimeZoneKey())); } return packDateTimeWithZone(millis, session.getTimeZoneKey()); }
Source:
<code>public void linkAccountSuccess(LinkAccountRequest input, LinkAccountResponse output) { if (output.status == StatusType.StatusTypeSuccess) { mLinkableAccount.resetForm(); PageType.ReadyToStartPageType.show(); } else if (output.error != null) { if (output.error.code == ApiError.InvalidDataAccountCredentials.getCode()) { <START> mLinkableAccount.setUsernameError("AppleConnect account or password entered incorrectly"); <END> mLinkableAccount.setPasswordError("AppleConnect account or password entered incorrectly"); mLinkableAccount.setFormErrors(); } else if (output.error.code == ApiError.InvalidDataAccountVendor.getCode()) { mLinkableAccount.setVendorError("AppleConnect vendor number entered incorrectly"); mLinkableAccount.setFormErrors(); } } preloader.hide(); }</code><technical_language>this username? worth calling iTunes connect instead of AppleConnect</technical_language>

Target:
public void linkAccountSuccess(LinkAccountRequest input, LinkAccountResponse output) { if (output.status == StatusType.StatusTypeSuccess) { mLinkableAccount.resetForm(); PageType.ReadyToStartPageType.show(); } else if (output.error != null) { if (output.error.code == ApiError.InvalidDataAccountCredentials.getCode()) { mLinkableAccount.setUsernameError("iTunes Connect username or password entered incorrectly"); mLinkableAccount.setPasswordError("iTunes Connect username or password entered incorrectly"); mLinkableAccount.setFormErrors(); } else if (output.error.code == ApiError.InvalidDataAccountVendor.getCode()) { mIosMacForm.setVendorError("iTunes Connect vendor number entered incorrectly"); mLinkableAccount.setFormErrors(); } } preloader.hide(); }
Source:
<code>public void cleanup() { if (model != null) { model.cleanup(); model = null; } cleanupModelItems(); <START> for (Pair<T, V> item : items) { T value = item.getFirst(); if (!isGhost(value)) { if (item instanceof HasCleanup) { ((HasCleanup) value).cleanup(); } } } <END> cleanContentPanel(); }</code><technical_language>please consider extracting this piece of code a method - e.g. cleanupNonGhostItems(). top level cleanup() method read cleanupModelItems(); cleanupNonGhostItems(); cleanContentPanel(); deal concerns level of abstraction</technical_language>

Target:
public void cleanup() { if (model != null) { model.cleanup(); model = null; } cleanupModelItems(); cleanupNonGhostItems(); cleanContentPanel(); }
Source:
<code>private InternalCacheEntry<K, V> getNext() { boolean initializedTime = false; long now = 0; while (it.hasNext()) { InternalCacheEntry<K, V> entry = it.next(); if (includeExpired || !entry.canExpire()) { <START> log.tracef("Return next entry %s", entry); <END> return entry; } else { if (!initializedTime) { now = timeService.wallClockTime(); initializedTime = true; } if (!entry.isExpired(now)) { return entry; } else { log.tracef("%s is expired", entry); } } } log.tracef("Return next null"); return null; }</code><technical_language>If committed purpose, guarded if (trace) { ... }</technical_language>

Target:
private InternalCacheEntry<K, V> getNext() { boolean initializedTime = false; long now = 0; while (it.hasNext()) { InternalCacheEntry<K, V> entry = it.next(); if (includeExpired || !entry.canExpire()) { log.tracef("Return next entry %s", entry); return entry; } else { if (!initializedTime) { now = timeService.wallClockTime(); initializedTime = true; } if (!entry.isExpired(now)) { log.tracef("Return next entry %s", entry); return entry; } else { log.tracef("%s is expired", entry); } } } log.tracef("Return next null"); return null; }
Source:
<code>public boolean equals(Object o) { if (this == o) return true; if (o == null) return false; <START> if (getClass() != o.getClass()) <END> return false; TestAutoSerializerObject2 test = (TestAutoSerializerObject2) o; return Objects.equals(data1, test.data1) && Objects.equals(data2, test.data2) && Objects.equals(numData3, test.numData3); }</code><technical_language>merge this if statement returning value</technical_language>

Target:
public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; TestAutoSerializerObject2 test = (TestAutoSerializerObject2) o; return Objects.equals(data1, test.data1) && Objects.equals(data2, test.data2) && Objects.equals(numData, test.numData); }
Source:
<code>public void addAndRemoveMemberInNonSynchronizedGroup() throws Exception { System.out.println(CLASS_NAME + "addAndRemoveMemberInNonSynchronizedGroup"); vo = setUpVo(); setUpGroup(vo); Attribute synchroAttr = new Attribute(perun.getAttributesManager().getAttributeDefinition(sess, "urn:perun:group:attribute-def:def:synchronizationEnabled")); synchroAttr.setValue("false"); perun.getAttributesManager().setAttribute(sess, group, synchroAttr); Member member = setUpMember(vo); groupsManager.addMember(sess, group, member); List<Member> members = groupsManager.getGroupMembers(sess, group); assertTrue("List of members should contain member", members.contains(member)); groupsManager.removeMember(sess, group, member); <START> members.clear(); <END> members = groupsManager.getGroupMembers(sess, group); assertTrue("List of members should be empty", members.isEmpty()); }</code><technical_language>clear() list variable re-assigned next line -> list content is replaced new assignment content is discarded java garbage collector (if referenced else)</technical_language>

Target:
public void addAndRemoveMemberInNonSynchronizedGroup() throws Exception { System.out.println(CLASS_NAME + "addAndRemoveMemberInNonSynchronizedGroup"); vo = setUpVo(); setUpGroup(vo); Attribute synchroAttr = new Attribute(perun.getAttributesManager().getAttributeDefinition(sess, GroupsManager.GROUPSYNCHROENABLED_ATTRNAME)); synchroAttr.setValue("false"); perun.getAttributesManager().setAttribute(sess, group, synchroAttr); Member member = setUpMember(vo); groupsManager.addMember(sess, group, member); List<Member> members = groupsManager.getGroupMembers(sess, group); assertTrue("List of members should contain member", members.contains(member)); groupsManager.removeMember(sess, group, member); members = groupsManager.getGroupMembers(sess, group); assertTrue("List of members should be empty", members.isEmpty()); }
Source:
<code><START> public void verifyWrongBlurryWordValidation() <END> { waitForElementByElement(WrongBlurryWordValidationError); }</code><technical_language>add PageObjectLogging log method</technical_language>

Target:
public void verifyWrongBlurryWordValidation(){ waitForElementByElement(WrongBlurryWordValidationError); PageObjectLogging.log( "verifyWrongBlurryWordValidation ", "wrong blurry word validation verified", true, driver ); }
Source:
<code>static BannerSize chartboostAdSizeFromLocalExtras(Context context, AdSize adSize) { <START> if (context != null && adSize != null) { <END> int LEADERBOARD_HEIGHT = BannerSize.getHeight(BannerSize.LEADERBOARD); int LEADERBOARD_WIDTH = BannerSize.getWidth(BannerSize.LEADERBOARD); int MEDIUM_HEIGHT = BannerSize.getHeight(BannerSize.MEDIUM); int MEDIUM_WIDTH = BannerSize.getWidth(BannerSize.MEDIUM); int STANDARD_HEIGHT = BannerSize.getHeight(BannerSize.STANDARD); int STANDARD_WIDTH = BannerSize.getWidth(BannerSize.STANDARD); ArrayList<AdSize> potentials = new ArrayList<>(); potentials.add(new AdSize(LEADERBOARD_WIDTH, LEADERBOARD_HEIGHT)); potentials.add(new AdSize(MEDIUM_WIDTH, MEDIUM_HEIGHT)); potentials.add(new AdSize(STANDARD_WIDTH, STANDARD_HEIGHT)); AdSize supportedAdSize = MediationUtils.findClosestSize(context, adSize, potentials); if (supportedAdSize == null) { return null; } int adHeight = supportedAdSize.getHeight(); int adWidth = supportedAdSize.getWidth(); if (adHeight >= LEADERBOARD_HEIGHT && adWidth >= LEADERBOARD_WIDTH) { return BannerSize.LEADERBOARD; } else if (adHeight >= MEDIUM_HEIGHT && adWidth >= MEDIUM_WIDTH) { return BannerSize.MEDIUM; } else { return BannerSize.STANDARD; } } return null; }</code><technical_language>Remove nesting. if (context == null || adSize == null) { return; } // int LEADERBOARD_HEIGHT .... Additionally, calling this requestBannerAd() method, context adSize null. I this check removed. If do remove this check, please add Nullability this method</technical_language>

Target:
static BannerSize chartboostAdSizeFromLocalExtras(Context context, AdSize adSize) { int LEADERBOARD_HEIGHT = BannerSize.getHeight(BannerSize.LEADERBOARD); int LEADERBOARD_WIDTH = BannerSize.getWidth(BannerSize.LEADERBOARD); int MEDIUM_HEIGHT = BannerSize.getHeight(BannerSize.MEDIUM); int MEDIUM_WIDTH = BannerSize.getWidth(BannerSize.MEDIUM); int STANDARD_HEIGHT = BannerSize.getHeight(BannerSize.STANDARD); int STANDARD_WIDTH = BannerSize.getWidth(BannerSize.STANDARD); ArrayList<AdSize> potentials = new ArrayList<>(); potentials.add(new AdSize(LEADERBOARD_WIDTH, LEADERBOARD_HEIGHT)); potentials.add(new AdSize(MEDIUM_WIDTH, MEDIUM_HEIGHT)); potentials.add(new AdSize(STANDARD_WIDTH, STANDARD_HEIGHT)); AdSize supportedAdSize = MediationUtils.findClosestSize(context, adSize, potentials); if (supportedAdSize == null) { return null; } int adHeight = supportedAdSize.getHeight(); int adWidth = supportedAdSize.getWidth(); if (adHeight >= LEADERBOARD_HEIGHT && adWidth >= LEADERBOARD_WIDTH) { return BannerSize.LEADERBOARD; } else if (adHeight >= MEDIUM_HEIGHT && adWidth >= MEDIUM_WIDTH) { return BannerSize.MEDIUM; } else { return BannerSize.STANDARD; } }
Source:
<code>public void testCreateUnpartitioned() { String tableName = "test_basic_statistics_unpartitioned_ctas_presto"; onPresto().executeQuery(format("DROP TABLE IF EXISTS %s", tableName)); onPresto().executeQuery(format("CREATE TABLE %s AS SELECT * FROM nation", tableName)); try { BasicStatistics statistics = getBasicStatisticsForTable(onHive(), tableName); <START> assertThatStatisticsArePresent(statistics); <END> assertThatStatisticsAreNonZero(statistics); assertThat(statistics.getNumRows().getAsLong()).isEqualTo(25); assertThat(statistics.getNumPartitions().getAsLong()).isEqualTo(0); } finally { onPresto().executeQuery(format("DROP TABLE IF EXISTS %s", tableName)); } }</code><technical_language>assertThatStatisticsAreNonZero include assertThatStatisticsArePresent (and need call explicitly)</technical_language>

Target:
public void testCreateUnpartitioned() { String tableName = "test_basic_statistics_unpartitioned_ctas_presto"; onPresto().executeQuery(format("DROP TABLE IF EXISTS %s", tableName)); onPresto().executeQuery(format("CREATE TABLE %s AS SELECT * FROM nation", tableName)); try { BasicStatistics statistics = getBasicStatisticsForTable(onHive(), tableName); assertThatStatisticsAreNonZero(statistics); assertThat(statistics.getNumRows().getAsLong()).isEqualTo(25); } finally { onPresto().executeQuery(format("DROP TABLE IF EXISTS %s", tableName)); } }
Source:
<code>private static Path resolveRelativePath(String metadataEntry, Key key) { <START> String prefix = "tables" + "/"; <END> if (metadataEntry.startsWith("..")) { return new Path(prefix + metadataEntry.substring(2)); } else { TableId tableId = KeyExtent.tableIdOfMetadataRow(key.getRow()); return new Path(prefix + tableId.canonical() + metadataEntry); } }</code><technical_language>Is a constant for "tables"</technical_language>

Target:
private static Path resolveRelativePath(String metadataEntry, Key key) { String prefix = ServerConstants.TABLE_DIR + "/"; if (metadataEntry.startsWith("../")) { return new Path(prefix + metadataEntry.substring(3)); } else { TableId tableId = KeyExtent.tableOfMetadataRow(key.getRow()); return new Path(prefix + tableId.canonical() + metadataEntry); } }
Source:
<code><START> public Response restoreAPIRevision(String apiId, String revisionId, MessageContext messageContext) { <END> try { APIProvider apiProvider = RestApiCommonUtil.getLoggedInUserProvider(); apiProvider.restoreAPIRevision(apiId, revisionId); APIDTO apiToReturn = getAPIByID(apiId); return Response.ok().entity(apiToReturn).build(); } catch (APIManagementException e) { String errorMessage = "Error while restoring API Revision for API : " + apiId + ". Error: " + e; RestApiUtil.handleInternalServerError(errorMessage, e, log); } return null; }</code><technical_language>throws APIManagementException</technical_language>

Target:
public Response restoreAPIRevision(String apiId, String revisionId, MessageContext messageContext) throws APIManagementException { APIProvider apiProvider = RestApiCommonUtil.getLoggedInUserProvider(); apiProvider.restoreAPIRevision(apiId, revisionId); APIDTO apiToReturn = getAPIByID(apiId); return Response.ok().entity(apiToReturn).build(); }
Source:
<code>public String toString() { <START> StringBuilder sb = new StringBuilder(); <END> sb.append("AccessToken:").append(accessToken).append(" TokenType:").append(tokenType) .append(" RefreshToken:" + refreshToken).append(" Scope:").append(scope).append(" ExpiresIn:") .append(expiresIn).append(" State:").append(state).append(" Created:").append(created); return sb.toString(); }</code><technical_language>> Objects.toStringHelper() guava</technical_language>

Target:
public String toString() { return "AccessTokenResponse [accessToken=" + accessToken + ", tokenType=" + tokenType + ", expiresIn=" + expiresIn + ", refreshToken=" + refreshToken + ", scope=" + scope + ", state=" + state + ", createdOn=" + createdOn + "]"; }
Source:
<code>public void testNonExistingLocalRepositoryException() throws IOException { <START> String path = "/path/to/non-existing/repository.git"; <END> try { Transport.open(db, path); } catch (Exception e) { assertTrue(e.getMessage().equals(path + " does not exist")); } }</code><technical_language>if this path exists user's workstation</technical_language>

Target:
public void testNonExistingLocalRepositoryException() throws IOException { String path = "/path/to/non-existing/repository.git"; try { Transport.open(db, path); } catch (Exception e) { assertEquals("Cannot find repository at " + path, e.getMessage()); } }
Source:
<code>protected void verifyFindsPerson(int expectedCount, String name) throws Exception { long hitCount = Search.getSearchManager(cache) .search(Person.class) .where(f -> f.match().field("name").matching(name)) .fetchTotalHitCount(); <START> assertEquals(expectedCount, hitCount); <END> }</code><technical_language>Ickle queries supported</technical_language>

Target:
protected void verifyFindsPerson(int expectedCount, String name) throws Exception { QueryFactory queryFactory = Search.getQueryFactory(cache); String q = String.format("FROM %s where name:'%s'", Person.class.getName(), name); Query cacheQuery = queryFactory.create(q); assertEquals(expectedCount, cacheQuery.execute().hitCount().orElse(-1)); }
Source:
<code>public void testChangeHeaderAfterWritingBody() { final File bcfOutputFile = VariantBaseTest.createTempFile("testWriteAndReadVCF.", ".bcf"); Tribble.indexFile(bcfOutputFile).deleteOnExit(); Set<VCFHeaderLine> metaData = new HashSet<VCFHeaderLine>(); Set<String> additionalColumns = new HashSet<String>(); final SAMSequenceDictionary sequenceDict = createArtificialSequenceDictionary(); <START> final VCFHeader header = createFakeHeader(metaData, additionalColumns, sequenceDict); <END> final VariantContextWriter writer3 = new VariantContextWriterBuilder() .setOutputFile(bcfOutputFile).setReferenceDictionary(sequenceDict) .setOptions(EnumSet.of(Options.INDEX_ON_THE_FLY)) .build(); writer3.setVCFHeader(header); writer3.add(createVC(header)); writer3.setVCFHeader(header); writer3.close(); }</code><technical_language>of calls createFakeHeader pass in empty metadata additional columns lists, fake seq dictionary, this simplified removing returning fake header</technical_language>

Target:
public void testChangeHeaderAfterWritingBody() throws IOException { final File bcfOutputFile = File.createTempFile("testWriteAndReadVCF.", ".bcf", tempDir); bcfOutputFile.deleteOnExit(); final VCFHeader header = createFakeHeader(); try (final VariantContextWriter writer = new VariantContextWriterBuilder() .setOutputFile(bcfOutputFile).setReferenceDictionary(header.getSequenceDictionary()) .unsetOption(Options.INDEX_ON_THE_FLY) .build()) { writer.setVCFHeader(header); writer.add(createVC(header)); writer.setVCFHeader(header); } }
Source:
<code>AzureCloudDestination(CloudConfig cloudConfig, AzureCloudConfig azureCloudConfig, String clusterName, VcrMetrics vcrMetrics, AzureMetrics azureMetrics, AzureReplicationFeed.FeedType azureReplicationFeedType, <START> ClusterMap clusterMap) throws Exception { <END> this.azureMetrics = azureMetrics; this.blobLayoutStrategy = new AzureBlobLayoutStrategy(clusterName, azureCloudConfig); this.azureBlobDataAccessor = new AzureBlobDataAccessor(cloudConfig, azureCloudConfig, blobLayoutStrategy, azureMetrics); this.queryBatchSize = azureCloudConfig.cosmosQueryBatchSize; this.cosmosDataAccessor = new CosmosDataAccessor(cloudConfig, azureCloudConfig, vcrMetrics, azureMetrics); this.azureStorageCompactor = new AzureStorageCompactor(azureBlobDataAccessor, cosmosDataAccessor, cloudConfig, vcrMetrics, azureMetrics); this.azureContainerCompactor = new AzureContainerCompactor(azureBlobDataAccessor, cosmosDataAccessor, cloudConfig, vcrMetrics, azureMetrics); this.azureReplicationFeed = getReplicationFeedObj(azureReplicationFeedType, cosmosDataAccessor, azureMetrics, queryBatchSize); this.cloudConfig = cloudConfig; isVcr = cloudConfig.cloudIsVcr; this.clusterMap = clusterMap; logger.info("Created Azure destination"); }</code><technical_language>ReflectiveOperationException is good enough. Exception is used</technical_language>

Target:
AzureCloudDestination(CloudConfig cloudConfig, AzureCloudConfig azureCloudConfig, String clusterName, VcrMetrics vcrMetrics, AzureMetrics azureMetrics, AzureReplicationFeed.FeedType azureReplicationFeedType, ClusterMap clusterMap) throws ReflectiveOperationException { this.azureMetrics = azureMetrics; this.blobLayoutStrategy = new AzureBlobLayoutStrategy(clusterName, azureCloudConfig); this.azureBlobDataAccessor = new AzureBlobDataAccessor(cloudConfig, azureCloudConfig, blobLayoutStrategy, azureMetrics); this.queryBatchSize = azureCloudConfig.cosmosQueryBatchSize; this.cosmosDataAccessor = new CosmosDataAccessor(cloudConfig, azureCloudConfig, vcrMetrics, azureMetrics); this.azureStorageCompactor = new AzureStorageCompactor(azureBlobDataAccessor, cosmosDataAccessor, cloudConfig, vcrMetrics, azureMetrics); this.azureContainerCompactor = new AzureContainerCompactor(azureBlobDataAccessor, cosmosDataAccessor, cloudConfig, vcrMetrics, azureMetrics); this.azureReplicationFeed = getReplicationFeedObj(azureReplicationFeedType, cosmosDataAccessor, azureMetrics, queryBatchSize); this.cloudConfig = cloudConfig; isVcr = cloudConfig.cloudIsVcr; this.clusterMap = clusterMap; logger.info("Created Azure destination"); }
Source:
<code>public static byte[] encodeLength(int length) { if (length < 128) { return new byte[] {(byte) length}; } <START> int numberOfBits = Integer.SIZE - Integer.numberOfLeadingZeros(length); <END> int numberOfBytes = (numberOfBits + 7) / 8; byte[] encoded = new byte[1 + numberOfBytes]; encoded[0] = (byte) (numberOfBytes | 0x80); for (int i = 0; i < numberOfBytes; i++) { int byteToEncode = (numberOfBytes - i); int shiftSize = (byteToEncode - 1) * 8; encoded[i + 1] = (byte) (length >>> shiftSize); } return encoded; }</code><technical_language>I find Integer.SIZE confusing I need lookup if 32 4</technical_language>

Target:
public static byte[] encodeLength(int length) { if (length < 128) { return new byte[] {(byte) length}; } int numberOfBits = 32 - Integer.numberOfLeadingZeros(length); int numberOfBytes = (numberOfBits + 7) / 8; byte[] encoded = new byte[1 + numberOfBytes]; encoded[0] = (byte) (numberOfBytes | 0x80); for (int i = 0; i < numberOfBytes; i++) { int byteToEncode = (numberOfBytes - i); int shiftSize = (byteToEncode - 1) * 8; encoded[i + 1] = (byte) (length >>> shiftSize); } return encoded; }
Source:
<code>public void run() { for (int i=0 ; i<workers ; i++) { executor.submit(new Runnable() { public void run() { boolean empty; ByteBuffer sendBuffer; try { sendBuffer = bufferPool.borrow(); } catch(final InterruptedException e) { handler.handle(e); return; } while (!((empty = messages.isEmpty()) && shutdown)) { try { if (empty) { Thread.sleep(WAIT_SLEEP_MS); continue; } if (Thread.interrupted()) { return; } final String message = messages.poll(); if (message != null) { qSize.decrementAndGet(); final byte[] data = message.getBytes(MESSAGE_CHARSET); if (sendBuffer.capacity() < data.length) { throw new InvalidMessageException(MESSAGE_TOO_LONG, message); } if (sendBuffer.remaining() < (data.length + 1)) { outboundQueue.put(sendBuffer); sendBuffer = bufferPool.borrow(); } if (sendBuffer.position() > 0) { sendBuffer.put((byte) '\n'); } sendBuffer.put(data); if (null == messages.peek()) { outboundQueue.put(sendBuffer); sendBuffer = bufferPool.borrow(); } } } catch (final InterruptedException e) { if (shutdown) { <START> return; <END> } } catch (final Exception e) { handler.handle(e); } } endSignal.countDown(); } }); } boolean done = false; while(!done) { try { endSignal.await(); done = true; } catch (final InterruptedException e) { } } }</code><technical_language>Do need endSignal.countDown(); for <LINK_0></technical_language>

Target:
public void run() { for (int i = 0 ; i < workers ; i++) { executor.submit(new Runnable() { public void run() { boolean empty; ByteBuffer sendBuffer; try { sendBuffer = bufferPool.borrow(); } catch (final InterruptedException e) { handler.handle(e); return; } while (!((empty = messages.isEmpty()) && shutdown)) { try { if (empty) { Thread.sleep(WAIT_SLEEP_MS); continue; } if (Thread.interrupted()) { return; } final String message = messages.poll(); if (message != null) { qsize.decrementAndGet(); final byte[] data = message.getBytes(MESSAGE_CHARSET); if (sendBuffer.capacity() < data.length) { throw new InvalidMessageException(MESSAGE_TOO_LONG, message); } if (sendBuffer.remaining() < (data.length + 1)) { outboundQueue.put(sendBuffer); sendBuffer = bufferPool.borrow(); } if (sendBuffer.position() > 0) { sendBuffer.put((byte) '\n'); } sendBuffer.put(data); if (null == messages.peek()) { outboundQueue.put(sendBuffer); sendBuffer = bufferPool.borrow(); } } } catch (final InterruptedException e) { if (shutdown) { endSignal.countDown(); return; } } catch (final Exception e) { handler.handle(e); } } endSignal.countDown(); } }); } boolean done = false; while (!done) { try { endSignal.await(); done = true; } catch (final InterruptedException e) { } } }
Source:
<code>public void finishCell() { Preconditions.checkState( <START> nextValueIndex == -1 || nextValueIndex == value.length, "Inconsistent value found"); <END> if (!Objects.equals(this.family, this.previousFamily)) { previousFamily = this.family; currentFamilyCells = new ArrayList<>(); cells.put(this.family, this.currentFamilyCells); } RowCell rowCell = new RowCell( ByteStringer.extract(this.currentKey), this.family.getBytes(), this.qualifier, TimestampConverter.bigtable2hbase(this.timestamp), this.value, this.labels); this.currentFamilyCells.add(rowCell); }</code><technical_language>nextValueIndex -1. error message is helpful reconditions.checkState(nextValueIndex == value.length, "Cell short");</technical_language>

Target:
public void finishCell() { Preconditions.checkNotNull(currentKey, "row key cannot be null"); Preconditions.checkState(nextValueIndex == value.length, "Cell value too short"); if (!Objects.equals(this.family, this.previousFamily)) { previousFamily = this.family; currentFamilyCells = new ArrayList<>(); cells.put(this.family, this.currentFamilyCells); } RowCell rowCell = new RowCell( ByteStringer.extract(this.currentKey), this.family.getBytes(), this.qualifier, TimestampConverter.bigtable2hbase(this.timestamp), this.value, this.labels); this.currentFamilyCells.add(rowCell); }
Source:
<code>public void startSchemaCompactor() throws SQLException { if ( this.config.maxSchemaDeltas == null ) return; MysqlSchemaCompactor compactor = new MysqlSchemaCompactor( this.config.maxSchemaDeltas, this.getMaxwellConnectionPool(), this.config.clientID, this.getServerID(), this.getCaseSensitivity() ); Thread compactorThread = new Thread(() -> { try { compactor.runLoop(); } catch (Exception e) { <START> e.printStackTrace(); <END> } }, "maxwell-schema-compactor"); compactorThread.start(); this.addTask(compactor); }</code><technical_language>this terminate maxwell? a priority not, failures Do Some Metrics</technical_language>

Target:
public void startSchemaCompactor() throws SQLException { if ( this.config.maxSchemaDeltas == null ) return; MysqlSchemaCompactor compactor = new MysqlSchemaCompactor( this.config.maxSchemaDeltas, this.getMaxwellConnectionPool(), this.config.clientID, this.getServerID(), this.getCaseSensitivity() ); this.startTask(compactor, "maxwell-schema-compactor"); }
Source:
<code>private void checkMisssingQueuesFatal() { if (this.missingQueuesFatal == null) { try { ApplicationContext applicationContext = getApplicationContext(); if (applicationContext != null) { Properties properties = applicationContext.getBean("spring.amqp.global.properties", Properties.class); String missingQueuesFatal = properties.getProperty("smlc.missing.queues.fatal"); if (StringUtils.hasText(missingQueuesFatal)) { this.missingQueuesFatal = Boolean.parseBoolean(missingQueuesFatal); } <START> } <END> } catch (BeansException be) { if (logger.isDebugEnabled()) { logger.debug("No global properties bean"); } } } if (this.missingQueuesFatal == null) { this.missingQueuesFatal = Boolean.TRUE; } }</code><technical_language>I understand want achieve, fetched Container initialization</technical_language>

Target:
private void checkMisssingQueuesFatal() { if (!this.missingQueuesFatalSet) { try { ApplicationContext applicationContext = getApplicationContext(); if (applicationContext != null) { Properties properties = applicationContext.getBean("spring.amqp.global.properties", Properties.class); String missingQueuesFatal = properties.getProperty("smlc.missing.queues.fatal"); if (StringUtils.hasText(missingQueuesFatal)) { this.missingQueuesFatal = Boolean.parseBoolean(missingQueuesFatal); } } } catch (BeansException be) { if (logger.isDebugEnabled()) { logger.debug("No global properties bean"); } } } }
Source:
<code>private int compareNestedRecords(String key, String value, StructuredRecord structuredRecord1, StructuredRecord structuredRecord2) { if (key.contains(FIELD_DELIMITER)) { String[] nestedRecord = key.split(FIELD_DELIMITER); Schema.Field field = structuredRecord1.getSchema().getField(nestedRecord[0].trim()); Schema.Type type = field.getSchema().getType(); <START> if (type.equals(Schema.Type.RECORD)) { <END> structuredRecord1 = structuredRecord1.get(nestedRecord[0].trim()); structuredRecord2 = structuredRecord2.get(nestedRecord[0].trim()); nestedRecord = (String[]) ArrayUtils.removeElement(nestedRecord, nestedRecord[0].trim()); return compareNestedRecords(Joiner.on(FIELD_DELIMITER).join(nestedRecord), value, structuredRecord1, structuredRecord2); } else { throw new IllegalArgumentException("Nested structured defined by -> should be of type RECORD"); } } else { return compareRecords(key, value, structuredRecord1, structuredRecord2); } }</code><technical_language>want handle UNION</technical_language>

Target:
private int compareNestedRecords(String key, String value, StructuredRecord structuredRecord1, StructuredRecord structuredRecord2) { if (key.contains(FIELD_DELIMITER)) { String[] nestedRecord = key.split(FIELD_DELIMITER); Schema.Field field = structuredRecord1.getSchema().getField(nestedRecord[0].trim()); Schema schema = field.getSchema(); Schema.Type type = schema.isNullableSimple() ? schema.getNonNullable().getType() : schema.getType(); if (type.equals(Schema.Type.RECORD)) { structuredRecord1 = structuredRecord1.get(nestedRecord[0].trim()); structuredRecord2 = structuredRecord2.get(nestedRecord[0].trim()); nestedRecord = (String[]) ArrayUtils.removeElement(nestedRecord, nestedRecord[0].trim()); key = Joiner.on(FIELD_DELIMITER).join(nestedRecord); int res = compareNull(key, structuredRecord1, structuredRecord2); if (res != DEFAULT_COMP_VALUE) { return res; } else { return compareNestedRecords(key, value, structuredRecord1, structuredRecord2); } } else { throw new IllegalArgumentException("Nested structured defined by \":\" should be of type RECORD"); } } else { return compareRecords(key, value, structuredRecord1, structuredRecord2); } }
Source:
<code><START> public List<String> handleRequest(WebrequestData webrequest){ <END> List<String> tags = new ArrayList(0); assert webrequest.getUriHost()!=null: webrequest; assert webrequest.getHttpStatus() != null: webrequest; assert webrequest.getUserAgent() != null: webrequest; if(Constants.PAGEVIEW_WORTHTY_HTTP_CODES.contains(webrequest.getHttpStatus()) && Constants.CONTENT_TYPES.contains(webrequest.getContentType())) { for (Tagger t : this.chain) { String tag = t.getTag(webrequest); if (!tag.equals(Tagger.EMPTY)) { tags.add(tag); } } } return tags; }</code><technical_language>call this other handleRequest. Sounds handling active webrequset of some kind. call this getTags</technical_language>

Target:
public List<String> handleRequest(WebrequestData webrequest){ List<String> tags = new ArrayList(0); assert webrequest.getUriHost()!=null: webrequest; assert webrequest.getHttpStatus() != null: webrequest; assert webrequest.getUserAgent() != null: webrequest; if(Webrequest.SUCCESS_HTTP_STATUSES.contains(webrequest.getHttpStatus()) && Webrequest.TEXT_HTML_CONTENT_TYPES.contains(webrequest.getContentType())) { for (Tagger t : this.chain) { String tag = t.getTag(webrequest); if (!tag.equals(Tagger.EMPTY)) { tags.add(tag); } } } return tags; }
Source:
<code>public void setNode(Node selectedNode) { if (selectedNode == null) { <START> return; <END> } AbstractFile file = selectedNode.getLookup().lookup(AbstractFile.class); if (file == null) { return; } String mimeType = file.getMIMEType(); if (Strings.isNullOrEmpty(mimeType)) { LOGGER.log(Level.INFO, "Mimetype not known for file: {0}", file.getName()); try { FileTypeDetector fileTypeDetector = new FileTypeDetector(); mimeType = fileTypeDetector.detectFileType(file); } catch (FileTypeDetector.FileTypeDetectorInitException ex) { LOGGER.log(Level.SEVERE, "Failed to initialize FileTypeDetector.", ex); return; } catch (TskCoreException ex) { LOGGER.log(Level.SEVERE, String.format("Could not detect format using fileTypeDetector for file: %s", file), ex); return; } } if (mimeType.equalsIgnoreCase("application/octet-stream")) { return; } else { ContentViewer viewer = getSupportingViewer(mimeType); if (viewer != null) { lastViewer = viewer; viewer.setFile(file); this.removeAll(); this.add(viewer.getComponent()); this.repaint(); } } }</code><technical_language>reset called in this situation</technical_language>

Target:
public void setNode(Node selectedNode) { resetComponent(); if (selectedNode == null) { return; } AbstractFile file = selectedNode.getLookup().lookup(AbstractFile.class); if (file == null) { return; } String mimeType = file.getMIMEType(); if (Strings.isNullOrEmpty(mimeType)) { LOGGER.log(Level.INFO, "Mimetype not known for file: {0}", file.getName()); try { FileTypeDetector fileTypeDetector = new FileTypeDetector(); mimeType = fileTypeDetector.detectMIMEType(file); }catch (FileTypeDetector.FileTypeDetectorInitException ex) { LOGGER.log(Level.SEVERE, "Failed to initialize FileTypeDetector.", ex); return; } } if (mimeType.equalsIgnoreCase("application/octet-stream")) { return; } else { ContentViewer viewer = getSupportingViewer(mimeType); if (viewer != null) { lastViewer = viewer; viewer.setFile(file); this.removeAll(); this.add(viewer.getComponent()); this.repaint(); } } }
Source:
<code>public String getServerURI() { if (getEmail().equals("iago@zulip.com")) { return "<LINK_0>"; } <START> return settings.getString("server_url", "<LINK_1>"); <END> }</code><technical_language>this is line-wrapping right? LGTM commit message clear</technical_language>

Target:
public String getServerURI() { if (getEmail().equals("iago@zulip.com")) { return "<LINK_0>"; } return settings.getString("server_url", DEFAULT_SERVER_URL); }
Source:
<code><START> public String getProperty(String propertyName) { <END> String value = System.getProperty(propertyName); if (value != null && value.startsWith("\"") && value.endsWith("\"")) { value = value.substring(1, value.length() - 1); } return value; }</code><technical_language>Is this needed removing download stuff</technical_language>

Target:
protected String getProperty(String propertyName) { String value = System.getProperty(propertyName); if (value != null && value.startsWith("\"") && value.endsWith("\"")) { value = value.substring(1, value.length() - 1); } return value; }
Source:
<code><START> public void setPlayerState(PlayerState state) throws IllegalArgumentException { <END> if (!this.state.isAllowedTransistionTo(state)) { throw new IllegalArgumentException( "The player is not allowed to switch from the current state (" + this.state.name() + ") to the specified state (" + state.name() + ")"); } this.state = state; }</code><technical_language>player state setter mag niet public --> zie branch #145 (clear DB als player gewonnen is en removeCurrentPlayerFromDB als player verloren is)</technical_language>

Target:
void setPlayerState(PlayerState state) throws IllegalArgumentException { if (!this.state.isAllowedTransistionTo(state)) { throw new IllegalArgumentException( "The player is not allowed to switch from the current state (" + this.state.name() + ") to the specified state (" + state.name() + ")"); } this.state = state; }
Source:
<code>protected void shutDown() throws Exception { LOG.info("Stopping service on address {}...", bindAddress); try { bootstrap.shutdown(); if (!channelGroup.close().await(CLOSE_CHANNEL_TIMEOUT, TimeUnit.SECONDS)) { LOG.warn("Timeout when closing all channels."); } } finally { resourceHandler.destroy(handlerContext); bootstrap.releaseExternalResources(); if (executionHandler != null) { executionHandler.releaseExternalResources(); Executor executor = executionHandler.getExecutor(); if (executor instanceof ExecutorService) { <START> ((ExecutorService) executor).awaitTermination(CLOSE_CHANNEL_TIMEOUT, TimeUnit.SECONDS); <END> } } } LOG.info("Done stopping service on address {}", bindAddress); }</code><technical_language>need wait for termination of bossExecutor workerExecutor pools</technical_language>

Target:
protected void shutDown() throws Exception { LOG.info("Stopping service on address {}...", bindAddress); try { bootstrap.shutdown(); if (!channelGroup.close().await(CLOSE_CHANNEL_TIMEOUT, TimeUnit.SECONDS)) { LOG.warn("Timeout when closing all channels."); } } finally { resourceHandler.destroy(handlerContext); bootstrap.releaseExternalResources(); if (executionHandler != null) { executionHandler.releaseExternalResources(); ExecutorUtil.terminate(executionHandler.getExecutor()); } } LOG.info("Done stopping service on address {}", bindAddress); }
Source:
<code>private void _next() throws IOException { if (!hasTop) throw new IllegalStateException(); if (entriesLeft == 0) { currBlock.close(); if (metricsGatherer != null) metricsGatherer.startBlock(); if (iiter.hasNext()) { IndexEntry indexEntry = iiter.next(); entriesLeft = indexEntry.getNumEntries(); currBlock = getDataBlock(indexEntry); checkRange = range.afterEndKey(indexEntry.getKey()); if (!checkRange) hasTop = true; } else { rk = null; val = null; hasTop = false; return; } } prevKey = rk.getKey(); rk.readFields(currBlock); val.readFields(currBlock); if (metricsGatherer != null) <START> metricsGatherer.addMetric(rk.getKey()); <END> entriesLeft--; if (checkRange) hasTop = !range.afterEndKey(rk.getKey()); }</code><technical_language>above. gatherer it</technical_language>

Target:
private void _next() throws IOException { if (!hasTop) throw new IllegalStateException(); if (entriesLeft == 0) { currBlock.close(); if (metricsGatherer != null) metricsGatherer.startBlock(); if (iiter.hasNext()) { IndexEntry indexEntry = iiter.next(); entriesLeft = indexEntry.getNumEntries(); currBlock = getDataBlock(indexEntry); checkRange = range.afterEndKey(indexEntry.getKey()); if (!checkRange) hasTop = true; } else { rk = null; val = null; hasTop = false; return; } } prevKey = rk.getKey(); rk.readFields(currBlock); val.readFields(currBlock); if (metricsGatherer != null) metricsGatherer.addMetric(rk.getKey(), val); entriesLeft--; if (checkRange) hasTop = !range.afterEndKey(rk.getKey()); }
Source:
<code>protected <T> T getOrCreateComponent(Class<T> componentClass, String name) { <START> return getOrCreateComponent(componentClass, name, true); <END> }</code><technical_language>I matters, strictly speaking if passing a name explicitly I isFQCN parameter false</technical_language>

Target:
protected <T> T getOrCreateComponent(Class<T> componentClass, String name) { return getOrCreateComponent(componentClass, name, false); }
Source:
<code>InternalErrorCause getCause() { <START> return null; <END> }</code><technical_language>pretty sketchy return null assume non-null pretty widely in code base. add another variant enum</technical_language>

Target:
ErrorCause getCause() { return ErrorCause.UNKNOWN; }
Source:
<code>private boolean shouldReconnect(URL url) { boolean reconnect = url.getParameter(Constants.SEND_RECONNECT_KEY, false); if (!reconnect) { String param = url.getParameter(Constants.RECONNECT_KEY, "true"); <START> if ("false".equalsIgnoreCase(param)) { <END> reconnect = false; } else if ("true".equalsIgnoreCase(param)) { reconnect = true; } else { int value; try { value = Integer.parseInt(param); } catch (Exception e) { throw new IllegalArgumentException("reconnect param must be non-negative integer or false/true, " + "input is:" + param); } if (value < 0) { throw new IllegalArgumentException("reconnect param must be non-negative integer or false/true, " + "input is:" + param); } reconnect = true; } } return reconnect; }</code><technical_language>RECONNECT_KEY Is RECONNECT_KEY a boolean type string? I a confused. <LINK_0></technical_language>

Target:
private boolean shouldReconnect(URL url) { return url.getParameter(Constants.RECONNECT_KEY, true); }
Source:
<code>public AbstractApplicationRunner(Config config) { super(config); <START> systemAdmins = new SystemAdmins(config); <END> this.streamManager = new StreamManager(systemAdmins); }</code><technical_language>Minor: this. consistently in class</technical_language>

Target:
public AbstractApplicationRunner(Config config) { super(config); this.systemAdmins = new SystemAdmins(config); this.streamManager = new StreamManager(systemAdmins); }
Source:
<code>public void updatePlanetarySystem(PlanetarySystem s) { this.system = s; <START> selectedPlanet = system.getPrimaryPlanetPosition(); <END> mapPanel.repaint(); }</code><technical_language>Do need a null check s</technical_language>

Target:
public void updatePlanetarySystem(PlanetarySystem s) { if(null == s) { return; } this.system = s; selectedPlanet = system.getPrimaryPlanetPosition(); mapPanel.repaint(); }
Source:
<code>public void testNestedMaps() throws Exception { <START> Iterable<String> keys = transform(intsBetween(0, 100_000), Object::toString); <END> Iterable<Integer> valueMapKeys = intsBetween(0, 100_000); Iterable<String> valueMapValues = limit(cycle(Arrays.asList(null, "value2", "value3", null, null, "value6", "value7")), 100_000); List<Map<Integer, String>> valueMaps = createTestMap(valueMapKeys, valueMapValues); List<Map<String, Map<Integer, String>>> values = createTestMap(keys, valueMaps); tester.testRoundTrip( getStandardMapObjectInspector( javaStringObjectInspector, getStandardMapObjectInspector(javaIntObjectInspector, javaStringObjectInspector)), values, values, mapType(VARCHAR, mapType(INTEGER, VARCHAR))); }</code><technical_language>Iterable<Integer> keys = intsBetween(0, 100_000); Iterable<String> stringKeys = transform(keys, Object::toString); Iterable<String> values = limit(cycle(Arrays.asList(null, "value2", "value3", null, null, "value6", "value7")), 100_000);</technical_language>

Target:
public void testNestedMaps() throws Exception { int nestingLevel = ThreadLocalRandom.current().nextInt(1, 15); Iterable<Integer> keys = intsBetween(0, 3_210); Iterable maps = limit(cycle(asList(null, "value2", "value3", null, null, "value6", "value7")), 3_210); ObjectInspector objectInspector = getStandardMapObjectInspector(javaIntObjectInspector, javaStringObjectInspector); Type type = mapType(INTEGER, VARCHAR); for (int i = 0; i < nestingLevel; i++) { maps = createNullableTestMaps(keys, maps); objectInspector = getStandardMapObjectInspector(javaIntObjectInspector, objectInspector); type = mapType(INTEGER, type); } maps = createTestMaps(keys, maps); tester.testRoundTrip(objectInspector, maps, maps, type); }
Source:
<code>public void resetDeviceToFactoryFW(@Scope(OAuthScope.ADMINISTRATION_WRITE) final AccessToken accessToken, @PathParam("device_id") final String deviceId, @QueryParam("fw_version") final Integer fwVersion) { if(deviceId == null) { LOGGER.error("Missing device_id parameter"); throw new WebApplicationException(Response.Status.BAD_REQUEST); } if(fwVersion == null) { LOGGER.error("Missing fw_version parameter"); throw new WebApplicationException(Response.Status.BAD_REQUEST); } LOGGER.info("Resetting device: on FW Version: {}", deviceId, fwVersion); final Map<String, Object> issuedCommands = new HashMap<>(); <START> issuedCommands.put("reset_mcu", true); <END> responseCommandsDAODynamoDB.insertResponseCommands(deviceId, fwVersion, issuedCommands); }</code><technical_language>some point move this final public static String RESET_MCU_CMD = "reset_mcu" avoid typos Enum</technical_language>

Target:
public void resetDeviceToFactoryFW(@Scope(OAuthScope.ADMINISTRATION_WRITE) final AccessToken accessToken, @PathParam("device_id") final String deviceId, @QueryParam("fw_version") final Integer fwVersion) { if(deviceId == null) { LOGGER.error("Missing device_id parameter"); throw new WebApplicationException(Response.Status.BAD_REQUEST); } if(fwVersion == null) { LOGGER.error("Missing fw_version parameter"); throw new WebApplicationException(Response.Status.BAD_REQUEST); } LOGGER.info("Resetting device: on FW Version: {}", deviceId, fwVersion); final Map<ResponseCommand, String> issuedCommands = new HashMap<>(); issuedCommands.put(ResponseCommand.RESET_MCU, "true"); responseCommandsDAODynamoDB.insertResponseCommands(deviceId, fwVersion, issuedCommands); }
Source:
<code>private ThingHandler replaceThing(Thing oldThing, Thing newThing) { final ThingHandler thingHandler = thingHandlers.get(newThing.getUID()); <START> if (oldThing.equals(newThing)) { <END> this.things.remove(oldThing); this.things.add(newThing); } return thingHandler; }</code><technical_language>Nope, intention! currently create copies equals UID - definition change</technical_language>

Target:
private ThingHandler replaceThing(Thing oldThing, Thing newThing) { final ThingHandler thingHandler = thingHandlers.get(newThing.getUID()); if (oldThing != newThing) { this.things.remove(oldThing); this.things.add(newThing); } return thingHandler; }
Source:
<code>protected String getShellName() { <START> return "infoBundle"; <END> }</code><technical_language>rename infoBundle</technical_language>

Target:
protected String getShellName() { return "collectInfo"; }
Source:
<code>private GeoAreaPoints getPointsList(Map<BlackboardAttribute.ATTRIBUTE_TYPE, BlackboardAttribute> attributeMap) throws GeoLocationDataException { BlackboardAttribute attribute = attributeMap.get(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_GEO_AREAPOINTS); if (attribute == null) { <START> LOGGER.log(Level.SEVERE, "No TSK_GEO_AREAPOINTS attribute was present on the artifact."); <END> throw new GeoLocationDataException("No TSK_GEO_AREAPOINTS attribute present in attribute map to parse."); } try { return BlackboardJsonAttrUtil.fromAttribute(attribute, GeoAreaPoints.class); } catch (InvalidJsonException ex) { LOGGER.log(Level.SEVERE, "TSK_GEO_AREAPOINTS could not be properly parsed from TSK_GEO_AREAPOINTS attribute."); throw new GeoLocationDataException("Unable to parse area points in TSK_GEO_AREAPOINTS attribute", ex); } }</code><technical_language>Do need log error throw exception? calling code write error too</technical_language>

Target:
private GeoAreaPoints getPointsList(Map<BlackboardAttribute.ATTRIBUTE_TYPE, BlackboardAttribute> attributeMap) throws GeoLocationDataException { BlackboardAttribute attribute = attributeMap.get(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_GEO_AREAPOINTS); if (attribute == null) { throw new GeoLocationDataException("No TSK_GEO_AREAPOINTS attribute present in attribute map to parse."); } try { return BlackboardJsonAttrUtil.fromAttribute(attribute, GeoAreaPoints.class); } catch (InvalidJsonException ex) { throw new GeoLocationDataException("Unable to parse area points in TSK_GEO_AREAPOINTS attribute", ex); } }