auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void testWriteToSampleDSTFile() throws IOException, URISyntaxException { EmbroideryList stitchpoints = new EmbroideryList(); stitchpoints.add(new PointF(-100, 0)); stitchpoints.add(new PointF(100, 0)); stitchpoints.add(new PointF(100, 100)); stitchpoints.add(new PointF(0, 150)); stitchpoints.add(new PointF(-100, 100)); stitchpoints.add(new PointF(-100, 0)); stitchpoints.add(new PointF(100, 100)); stitchpoints.add(new PointF(-100, 100)); stitchpoints.add(new PointF(100, 0)); if (dstFile.exists()) { dstFile.delete(); } dstFile.createNewFile(); fileGenerator.writeToDSTFile(dstFile, stitchpoints); InputStream inputStream = InstrumentationRegistry.getContext().getResources().openRawResource(org.catrobat .catroid.test.R.raw.sample_dst_file); File compareFile = StorageOperations.copyStreamToDir(inputStream, Constants.CACHE_DIR, "sample_dst_file.dst"); assertEquals(compareFile.length(), dstFile.length()); byte[] compareFileBytes = FileUtils.readFile(compareFile); byte[] dstFileBytes = FileUtils.readFile(dstFile); <START> boolean fileBytesEquality = Arrays.equals(compareFileBytes, dstFileBytes); <END> assertTrue(fileBytesEquality); }</code><technical_language>please assertArrayEquals</technical_language>

Target:
public void testWriteToSampleDSTFile() throws IOException, URISyntaxException { EmbroideryList stitchpoints = new EmbroideryList(); stitchpoints.add(new PointF(-10, 0)); stitchpoints.add(new PointF(10, 0)); stitchpoints.add(new PointF(10, 10)); stitchpoints.add(new PointF(0, 15)); stitchpoints.add(new PointF(-10, 10)); stitchpoints.add(new PointF(-10, 0)); stitchpoints.add(new PointF(10, 10)); stitchpoints.add(new PointF(-10, 10)); stitchpoints.add(new PointF(10, 0)); File dstFile = new File(Constants.CACHE_DIR, projectName + ".dst"); if (dstFile.exists()) { dstFile.delete(); } dstFile.createNewFile(); fileGenerator.writeToDSTFile(dstFile, stitchpoints); InputStream inputStream = InstrumentationRegistry.getContext().getResources().openRawResource(org.catrobat .catroid.test.R.raw.sample_dst_file); File compareFile = StorageOperations.copyStreamToDir(inputStream, Constants.CACHE_DIR, "sample_dst_file.dst"); assertEquals(compareFile.length(), dstFile.length()); byte[] compareFileBytes = FileUtils.readFile(compareFile); byte[] dstFileBytes = FileUtils.readFile(dstFile); assertArrayEquals(compareFileBytes, dstFileBytes); }
Source:
<code><START> private void assertMatches(E entity, FieldMask fieldMask) { <END> final Message state = entity.getState(); final List<String> paths = fieldMask.getPathsList(); for (Descriptors.FieldDescriptor field : state.getDescriptorForType().getFields()) { if (field.isRepeated()) continue; assertEquals(state.hasField(field), paths.contains(field.getFullName())); } }</code><technical_language>static</technical_language>

Target:
private static <E extends Entity<?, ?>> void assertMatches(E entity, FieldMask fieldMask) { final Message state = entity.getState(); final List<String> paths = fieldMask.getPathsList(); for (Descriptors.FieldDescriptor field : state.getDescriptorForType() .getFields()) { if (field.isRepeated()) { continue; } assertEquals(state.hasField(field), paths.contains(field.getFullName())); } }
Source:
<code>public void added(Provider<Rule> provider, Rule element) { Rule ruleWithUID = element; if (element.getUID() == null) { String rUID = ruleEngine.getUniqueId(); ruleWithUID = initRuleId(rUID, element); } <START> postRuleAddedEvent(ruleWithUID); <END> super.added(provider, ruleWithUID); updateRuleByTemplate(provider, ruleWithUID); }</code><technical_language>Is safe change this order? sending event, rule is in registry - is this necessary</technical_language>

Target:
public void added(Provider<Rule> provider, Rule element) { Rule ruleWithUID = element; if (element.getUID() == null) { String rUID = ruleEngine.getUniqueId(); ruleWithUID = initRuleId(rUID, element); } super.added(provider, ruleWithUID); updateRuleByTemplate(provider, ruleWithUID); }
Source:
<code>private int writeBytes(ChannelOutboundBuffer in, ByteBuf buf) throws Exception { int readableBytes = buf.readableBytes(); if (readableBytes == 0) { in.remove(); return 0; } if (buf.isDirect()) { return writeBytesDirect(in, buf); } <START> ByteBuf ioBuffer = ioBuffer(buf.readableBytes()); <END> ioBuffer.writeBytes(buf, buf.readerIndex(), buf.readableBytes()); try { return writeBytesDirect(in, ioBuffer); } finally { ioBuffer.release(); } }</code><technical_language>expensive buf.readableBytes() be, readableBytes is calculated a local</technical_language>

Target:
private int writeBytes(ChannelOutboundBuffer in, ByteBuf buf) throws Exception { int readableBytes = buf.readableBytes(); if (readableBytes == 0) { in.remove(); return 0; } if (buf.isDirect()) { return writeBytesDirect(in, buf); } int readable = buf.readableBytes(); ByteBuf ioBuffer = ioBuffer(readable); ioBuffer.writeBytes(buf, buf.readerIndex(), readable); try { return writeBytesDirect(in, ioBuffer); } finally { ioBuffer.release(); } }
Source:
<code>protected void executeImpl(CommandContext ctxt) throws CommandException { if (!(getUser() instanceof AuthenticatedUser) || !getUser().isSuperuser()) { throw new PermissionException(BundleUtil.getStringFromBundle("admin.api.auth.mustBeSuperUser"), this, Collections.singleton(Permission.EditDataset), dataset); } String nonNullDefaultIfKeyNotFound = ""; String protocol = ctxt.settings().getValueForKey(SettingsServiceBean.Key.Protocol, nonNullDefaultIfKeyNotFound); GlobalIdServiceBean idServiceBean = GlobalIdServiceBean.getBean(protocol, ctxt); try { <START> String baseUrl = ctxt.systemConfig().getDataCiteRestApiUrlString(); <END> String username = System.getProperty("doi.username"); String password = System.getProperty("doi.password"); int result = PidUtil.deleteDoi(dataset.getGlobalId().asString(), baseUrl, username, password); if (result == 204) { dataset.setGlobalIdCreateTime(null); dataset.setIdentifierRegistered(false); ctxt.datasets().merge(dataset); } else { String message = BundleUtil.getStringFromBundle("pids.commands.deletePid.failureExpected", Arrays.asList(dataset.getId().toString(), Integer.toString(result))); throw new IllegalCommandException(message, this); } } catch (IOException ex) { String message = BundleUtil.getStringFromBundle("pids.commands.deletePid.failureOther", Arrays.asList(dataset.getId().toString(), ex.getLocalizedMessage())); logger.info(message); throw new IllegalCommandException(message, this); } }</code><technical_language>Again, surprised this command supports DataCite, this previously</technical_language>

Target:
protected void executeImpl(CommandContext ctxt) throws CommandException { if (!(getUser() instanceof AuthenticatedUser) || !getUser().isSuperuser()) { throw new PermissionException(BundleUtil.getStringFromBundle("admin.api.auth.mustBeSuperUser"), this, Collections.singleton(Permission.EditDataset), dataset); } String nonNullDefaultIfKeyNotFound = ""; String protocol = ctxt.settings().getValueForKey(SettingsServiceBean.Key.Protocol, nonNullDefaultIfKeyNotFound); GlobalIdServiceBean idServiceBean = GlobalIdServiceBean.getBean(protocol, ctxt); try { idServiceBean.deleteIdentifier(dataset); dataset.setGlobalIdCreateTime(null); dataset.setIdentifierRegistered(false); ctxt.datasets().merge(dataset); } catch (HTTPException hex) { String message = BundleUtil.getStringFromBundle("pids.deletePid.failureExpected", Arrays.asList(dataset.getGlobalId().asString(), Integer.toString(hex.getStatusCode()))); logger.info(message); throw new IllegalCommandException(message, this); } catch (Exception ex) { String message = BundleUtil.getStringFromBundle("pids.deletePid.failureOther", Arrays.asList(dataset.getGlobalId().asString(), ex.getLocalizedMessage())); logger.info(message); throw new IllegalCommandException(message, this); } }
Source:
<code>public void testRgb() { <START> E4ThemeColor e4ThemeColor = new E4ThemeColor(); <END> RGB rgb = E4ThemeColor.getRGBFromCssString("rgb(238, 238, 238)"); assertEquals(new RGB(238, 238, 238), rgb); }</code><technical_language>reason instantiate E4ThemeColor. In fact, add a private constructor E4ThemeColor</technical_language>

Target:
public void testRgb() { RGB rgb = E4ThemeColor.getRGBFromCssString("rgb(238, 238, 238)"); assertEquals(new RGB(238, 238, 238), rgb); }
Source:
<code>public boolean validateCredentials() { boolean status = true; final String constructedURL = String.format(URL_GET_USERS, getUrl(), getUserName()); try (final CloseableHttpResponse response = get(constructedURL)) { final int statusCode = response.getStatusLine().getStatusCode(); if (statusCode == 401) { status = false; } } catch (IOException e) { <START> ZephyrPlugin.log(e); <END> } return status; }</code><technical_language>Do suppress fatal errors</technical_language>

Target:
public boolean validateCredentials() { boolean status = true; final String constructedURL = String.format(URL_GET_USERS, getUrl(), getUserName()); try (final CloseableHttpResponse response = get(constructedURL)) { final int statusCode = response.getStatusLine().getStatusCode(); if (statusCode == 401) { status = false; } } catch (IOException e) { throw new IllegalStateException("Failed to get " + constructedURL, e); } return status; }
Source:
<code>public void shouldSerializeCalendarLikeXstream() { List<JsonSerializer> adapters = new ArrayList<JsonSerializer>(); <START> adapters.add(new CalendarSerializer()); <END> GsonJSONSerialization serialization = new GsonJSONSerialization(response, extractor, initializer, createBuilder(adapters), serializee); Client c = new Client("renan"); c.included = new GregorianCalendar(2012, 8, 3); serialization.from(c).serialize(); String result = result(); String expectedResult = "{\"client\":{\"name\":\"renan\",\"included\":{\"time\":\"" + c.included.getTimeInMillis() + "\",\"timezone\":\"" + c.included.getTimeZone().getID() + "\"}}}"; assertThat(result, is(equalTo(expectedResult))); }</code><technical_language>remove 2 lines, createBuilder(new CalendarSerializer())</technical_language>

Target:
public void shouldSerializeCalendarLikeXstream() { GsonJSONSerialization serialization = serializationWithAdapter(new CalendarSerializer()); Client c = new Client("renan"); c.included = new GregorianCalendar(2012, 8, 3); serialization.from(c).serialize(); String result = result(); String expectedResult = "{\"client\":{\"name\":\"renan\",\"included\":{\"time\":\"" + c.included.getTimeInMillis() + "\",\"timezone\":\"" + c.included.getTimeZone().getID() + "\"}}}"; assertThat(result, is(equalTo(expectedResult))); }
Source:
<code>protected void checkoutFromMaterialConfig(MaterialConfig materialConfig, File folder) throws ExecutionException, InterruptedException { Material material = materialConfigConverter.toMaterial(materialConfig); subprocessExecutionContext.setGitShallowClone(true); ExecutorService executor = Executors.newSingleThreadExecutor(); Future future = executor.submit(() -> { List<Modification> modifications = materialService.latestModification(material, folder, subprocessExecutionContext); materialService.checkout(material, folder, Modification.latestRevision(modifications), subprocessExecutionContext); }); try { <START> future.get(2l, TimeUnit.MINUTES); <END> } catch (TimeoutException e) { future.cancel(true); throw new RuntimeException("Request couldn't be completed because we failed to clone the repo within 2 minutes"); } }</code><technical_language>absolutely, 100% correct, suggest add a configuration SystemEnvironment define a default of 120 seconds. changed administrator a specific deployment hard coded here</technical_language>

Target:
protected void checkoutFromMaterialConfig(MaterialConfig materialConfig, File folder) throws ExecutionException, InterruptedException { Material material = materialConfigConverter.toMaterial(materialConfig); subprocessExecutionContext.setGitShallowClone(true); ExecutorService executor = Executors.newSingleThreadExecutor(); Future future = executor.submit(() -> { List<Modification> modifications = materialService.latestModification(material, folder, subprocessExecutionContext); materialService.checkout(material, folder, Modification.latestRevision(modifications), subprocessExecutionContext); }); try { future.get(systemEnvironment.getPacCloneTimeout(), TimeUnit.MILLISECONDS); } catch (TimeoutException e) { future.cancel(true); throw new RuntimeException("Request couldn't be completed because we failed to clone the repo within 2 minutes"); } }
Source:
<code>protected boolean canDoAction() { if (getVds() == null) { return failCanDoAction(VdcBllMessages.VDS_CANNOT_ACTIVATE_VDS_NOT_EXIST); } <START> if (true && getVds().getstatus() == VDSStatus.Up) { <END> return failCanDoAction(VdcBllMessages.VDS_CANNOT_ACTIVATE_VDS_ALREADY_UP); } return true; }</code><technical_language>'true'? check for getVds().getstatus()</technical_language>

Target:
protected boolean canDoAction() { if (getVds() == null) { return failCanDoAction(VdcBllMessages.VDS_CANNOT_ACTIVATE_VDS_NOT_EXIST); } if (getVds().getstatus() == VDSStatus.Up) { return failCanDoAction(VdcBllMessages.VDS_CANNOT_ACTIVATE_VDS_ALREADY_UP); } return true; }
Source:
<code>public TemplatePage createTemplate(String templateName) { <START> new ArticleContent().push("", "Template:" + templateName); <END> return this; }</code><technical_language>Hmm, is a builtin method for generating MW titles</technical_language>

Target:
public TemplatePage createTemplate(String templateName) { new TemplateContent().push(templateName); return this; }
Source:
<code>public CacheType unparseConfiguration(CacheConfiguration<?, ?> cacheConfiguration, CacheType cacheType) { ExpiryPolicy<?, ?> expiryPolicy = cacheConfiguration.getExpiryPolicy(); if (expiryPolicy != null) { ExpiryType expiryType = new ExpiryType(); if (expiryPolicy == ExpiryPolicy.NO_EXPIRY) { expiryType.withNone(new ExpiryType.None()); } else if (expiryPolicy instanceof ExpiryPolicyBuilder.TimeToLiveExpiryPolicy) { Duration ttl = expiryPolicy.getExpiryForCreation(null, null); expiryType.withTtl(new TimeType().withValue(BigInteger.valueOf(ttl.getSeconds())).withUnit(TimeUnit.SECONDS)); } else if (expiryPolicy instanceof ExpiryPolicyBuilder.TimeToIdleExpiryPolicy) { Duration tti = expiryPolicy.getExpiryForCreation(null, null); expiryType.withTti(new TimeType().withValue(BigInteger.valueOf(tti.getSeconds())).withUnit(TimeUnit.SECONDS)); } else { <START> expiryType.setClazz(expiryPolicy.getClass().getName()); <END> } cacheType.withExpiry(expiryType); } EvictionAdvisor<?, ?> evictionAdvisor = cacheConfiguration.getEvictionAdvisor(); if (evictionAdvisor != null) { cacheType.withEvictionAdvisor(evictionAdvisor.getClass().getName()); } return cacheType; }</code><technical_language>This generally true right? this class works if safe instantiate in this way</technical_language>

Target:
public CacheType unparseConfiguration(CacheConfiguration<?, ?> cacheConfiguration, CacheType cacheType) { ExpiryPolicy<?, ?> expiryPolicy = cacheConfiguration.getExpiryPolicy(); if (expiryPolicy != null) { Duration expiry = expiryPolicy.getExpiryForCreation(null, null); ExpiryType expiryType = new ExpiryType(); if (expiryPolicy.equals(ExpiryPolicy.NO_EXPIRY)) { expiryType.withNone(new ExpiryType.None()); } else if (expiryPolicy.equals(ExpiryPolicyBuilder.timeToLiveExpiration(expiry))) { expiryType.withTtl(convertToTimeType(expiry)); } else if (expiryPolicy.equals(ExpiryPolicyBuilder.timeToIdleExpiration(expiry))) { expiryType.withTti(convertToTimeType(expiry)); } else { throw new XmlConfigurationException("XML translation of custom expiry policy is not supported"); } cacheType.withExpiry(expiryType); } EvictionAdvisor<?, ?> evictionAdvisor = cacheConfiguration.getEvictionAdvisor(); if (evictionAdvisor != null) { throw new XmlConfigurationException("XML translation of eviction advisor is not supported"); } return cacheType; }
Source:
<code>private boolean doReceiveAndExecute(BlockingQueueConsumer consumer) throws Throwable { Channel channel = consumer.getChannel(); for (int i = 0; i < this.txSize; i++) { logger.trace("Waiting for message from consumer."); Message message = consumer.nextMessage(this.receiveTimeout); if (message == null) { break; } try { executeListener(channel, message); } catch (ImmediateAcknowledgeAmqpException e) { if (this.logger.isDebugEnabled()) { this.logger.debug("User requested ack for failed delivery"); } break; } catch (Throwable ex) { if (causeChainHasImmediateAcknowledgeAmqpException(ex)) { if (this.logger.isDebugEnabled()) { this.logger.debug("User requested ack for failed delivery"); } break; } if (getTransactionManager() != null) { if (getTransactionAttribute().rollbackOn(ex)) { consumer.rollbackOnExceptionIfNecessary(ex); throw ex; } else { if (this.logger.isDebugEnabled()) { this.logger.debug("No rollback for " + ex); } <START> break; <END> } } else { consumer.rollbackOnExceptionIfNecessary(ex); throw ex; } } } return consumer.commitIfNecessary(isChannelLocallyTransacted()); }</code><technical_language>Well, I this SimpleMessageListenerContainer implementation is a bit different. fallback commitIfNecessary() for ImmediateAcknowledgeAmqpExceptions rollbackOn(). re-throw e in else below. is I expect in DirectMessageListenerContainer. concerns there</technical_language>

Target:
private boolean doReceiveAndExecute(BlockingQueueConsumer consumer) throws Throwable { Channel channel = consumer.getChannel(); for (int i = 0; i < this.txSize; i++) { logger.trace("Waiting for message from consumer."); Message message = consumer.nextMessage(this.receiveTimeout); if (message == null) { break; } try { executeListener(channel, message); } catch (ImmediateAcknowledgeAmqpException e) { if (this.logger.isDebugEnabled()) { this.logger.debug("User requested ack for failed delivery: " + message.getMessageProperties().getDeliveryTag()); } break; } catch (Throwable ex) { if (causeChainHasImmediateAcknowledgeAmqpException(ex)) { if (this.logger.isDebugEnabled()) { this.logger.debug("User requested ack for failed delivery: " + message.getMessageProperties().getDeliveryTag()); } break; } if (getTransactionManager() != null) { if (getTransactionAttribute().rollbackOn(ex)) { consumer.clearDeliveryTags(); throw ex; } else { if (this.logger.isDebugEnabled()) { this.logger.debug("No rollback for " + ex); } break; } } else { consumer.rollbackOnExceptionIfNecessary(ex); throw ex; } } } return consumer.commitIfNecessary(isChannelLocallyTransacted()); }
Source:
<code>public void updateDependencyWithInheritTest() throws InterruptedException { ide.waitOpenedWorkspaceIsReadyToUse(); createProjectFromUI(PROJECT_NAME1); projectExplorer.waitItem(PROJECT_NAME1); mavenPluginStatusBar.waitClosingInfoPanel(); notificationsPopupPanel.waitProgressPopupPanelClose(); <START> projectExplorer.expandPathInProjectExplorer(PROJECT_NAME1 + PATH_FOR_EXPAND); <END> projectExplorer.openItemByPath(PROJECT_NAME1 + PATH_TO_FILE); editor.waitActive(); editor.waitAllMarkersDisappear(ERROR_MARKER); removeProjectFromUI(); createProjectFromUI(PROJECT_NAME2); projectExplorer.waitItem(PROJECT_NAME2); projectExplorer.selectVisibleItem(PROJECT_NAME2); projectExplorer.expandPathInProjectExplorer(PROJECT_NAME2 + PATH_FOR_EXPAND); try { projectExplorer.openItemByPath(PROJECT_NAME2 + PATH_TO_FILE); } catch (TimeoutException ex) { fail("Known issue <LINK_0>"); } editor.waitActive(); editor.waitAllMarkersDisappear(ERROR_MARKER); }</code><technical_language>PATH_FOR_EXPAND > PATH_TO_EXPAND</technical_language>

Target:
public void updateDependencyWithInheritTest() throws InterruptedException { ide.waitOpenedWorkspaceIsReadyToUse(); createProjectFromUI(PROJECT_NAME1); projectExplorer.waitItem(PROJECT_NAME1); mavenPluginStatusBar.waitClosingInfoPanel(); notificationsPopupPanel.waitProgressPopupPanelClose(); projectExplorer.expandPathInProjectExplorer(PROJECT_NAME1 + PATH_TO_EXPAND); projectExplorer.openItemByPath(PROJECT_NAME1 + PATH_TO_FILE); editor.waitActive(); editor.waitAllMarkersDisappear(ERROR_MARKER); removeProjectFromUI(); createProjectFromUI(PROJECT_NAME2); projectExplorer.waitItem(PROJECT_NAME2); projectExplorer.selectVisibleItem(PROJECT_NAME2); projectExplorer.expandPathInProjectExplorer(PROJECT_NAME2 + PATH_TO_EXPAND); try { projectExplorer.openItemByPath(PROJECT_NAME2 + PATH_TO_FILE); } catch (TimeoutException ex) { fail("Known issue <LINK_0>"); } editor.waitActive(); editor.waitAllMarkersDisappear(ERROR_MARKER); }
Source:
<code>private static List<String> buildDescritpion(BusinessEntity entity) { List<String> descList = new ArrayList<>(); <START> if (null != entity && CollectionUtils.isNotEmpty(entity.getDescription())) { <END> for (Description obj : entity.getDescription()) { descList.add(obj.getValue()); } } return descList; }</code><technical_language>I feel isNotEmpty() check is needed here. for loop care of this case</technical_language>

Target:
private static List<String> buildDescritpion(BusinessEntity entity) { List<String> descList = new ArrayList<>(); if (null != entity && null != entity.getDescription()) { for (Description obj : entity.getDescription()) { descList.add(obj.getValue()); } } return descList; }
Source:
<code>private String getSubject(JobEmailStatus jobEmailStatus) { String event = eventType.toString(); if (jobEmailStatus.isWithErrors()) { event = SchedulerEvent.JOB_RUNNING_TO_FINISHED_WITH_ERRORS.toString(); <START> } <END> if (jobEmailStatus.isAborted()) { event = SchedulerEvent.JOB_ABORTED.toString(); } String jobID = jobState.getId().value(); return String.format(SUBJECT_TEMPLATE, jobID, event); }</code><technical_language>else if, prevent double affectation</technical_language>

Target:
private String getSubject(JobEmailStatus jobEmailStatus) { String event = eventType.toString(); if (jobEmailStatus.isAborted()) { event = SchedulerEvent.JOB_ABORTED.toString(); } else if (jobEmailStatus.isWithErrors()) { event = SchedulerEvent.JOB_RUNNING_TO_FINISHED_WITH_ERRORS.toString(); } String jobID = jobState.getId().value(); return String.format(SUBJECT_TEMPLATE, jobID, event); }
Source:
<code>public static String docsVersion() { if (Version.VERSION.matches("^\\d*\\.\\d*\\.\\d*$")) { <START> return Version.VERSION; <END> } else { return "latest"; } }</code><technical_language>build versions match tag names, "v0.2.190" create a "stable" version for release, "latest" pointing current develop branch. safest return "latest" for a broken link in next release though</technical_language>

Target:
public static String docsVersion() { return "latest"; }
Source:
<code>public void execute(final String activeContextId, final EventHandler<AvroElasticMemoryMessage> callback) { final RunningTask runningTask = taskTracker.getRunningTask(activeContextId); if (runningTask == null) { LOG.log(Level.WARNING, "Trying to remove running task on active context {0}. Cannot find running task on it", activeContextId); } else { final int currentSequence = contextToStageSequence.get(runningTask.getActiveContext().getId()); final CommunicationGroupDriverImpl commGroup = (CommunicationGroupDriverImpl) commGroupDriverList.get(currentSequence); <START> LOG.log(Level.INFO, "deleting..."); <END> commGroup.failTask(runningTask.getId()); commGroup.removeTask(runningTask.getId()); closingContexts.add(activeContextId); runningTask.close(); callback.onNext(AvroElasticMemoryMessage.newBuilder() .setType(Type.ResultMsg) .setResultMsg(ResultMsg.newBuilder().setResult(Result.SUCCESS).build()) .setSrcId(activeContextId) .setDestId("") .build()); } }</code><technical_language>This change is completely unrelated this PR. reason for adding it</technical_language>

Target:
public void execute(final String activeContextId, final EventHandler<AvroElasticMemoryMessage> callback) { final RunningTask runningTask = taskTracker.getRunningTask(activeContextId); if (runningTask == null) { LOG.log(Level.WARNING, "Trying to remove running task on active context {0}. Cannot find running task on it", activeContextId); } else { final int currentSequence = contextToStageSequence.get(runningTask.getActiveContext().getId()); final CommunicationGroupDriverImpl commGroup = (CommunicationGroupDriverImpl) commGroupDriverList.get(currentSequence); commGroup.failTask(runningTask.getId()); commGroup.removeTask(runningTask.getId()); closingContexts.add(activeContextId); runningTask.close(); callback.onNext(AvroElasticMemoryMessage.newBuilder() .setType(Type.ResultMsg) .setResultMsg(ResultMsg.newBuilder().setResult(Result.SUCCESS).build()) .setSrcId(activeContextId) .setDestId("") .build()); } }
Source:
<code>private void indexFiles(Path baseDir) throws IOException { Queue<File> directories = new ArrayDeque<>(); directories.add(baseDir.toFile()); while (!directories.isEmpty()) { <START> FileTreeIterator fileTreeIterator = new FileTreeIterator(directories.poll(), FS.detect(), null); <END> while (!fileTreeIterator.eof()) { File entryFile = fileTreeIterator.getEntryFile(); if (!fileTreeIterator.isEntryIgnored()) { if (entryFile.isFile()) { includedFiles.add(entryFile.getAbsolutePath()); } else { directories.add(entryFile); } } else { LOG.debug("Ignoring: {}", entryFile); } fileTreeIterator.next(1); } } }</code><technical_language>extract FS.detect() loop</technical_language>

Target:
private void indexFiles(Path baseDir) throws IOException { try (Repository repo = JGitUtils.buildRepository(baseDir)) { Path workTreeRoot = repo.getWorkTree().toPath(); FileTreeIterator workingTreeIt = new FileTreeIterator(repo); try (TreeWalk treeWalk = new TreeWalk(repo)) { treeWalk.setRecursive(true); if (!baseDir.equals(workTreeRoot)) { Path relativeBaseDir = workTreeRoot.relativize(baseDir); treeWalk.setFilter(PathFilterGroup.createFromStrings(relativeBaseDir.toString().replace('\\', '/'))); } treeWalk.addTree(workingTreeIt); treeWalk.addTree(new DirCacheIterator(repo.readDirCache())); workingTreeIt.setDirCacheIterator(treeWalk, 1); while (treeWalk.next()) { WorkingTreeIterator workingTreeIterator = treeWalk .getTree(0, WorkingTreeIterator.class); if (!workingTreeIterator.isEntryIgnored()) { includedFiles.add(workTreeRoot.resolve(treeWalk.getPathString())); } } } } }
Source:
<code>static Object toCrateObject(Value value, DataType<?> type) { if (value == null) { return null; } switch (type.id()) { case ArrayType.ID: <START> ArrayList<Object> items = new ArrayList<>(); <END> for (int idx = 0; idx < value.getArraySize(); idx++) { var item = toCrateObject(value.getArrayElement(idx), ((ArrayType) type).innerType()); items.add(idx, item); } return type.value(items); case ObjectType.ID: return type.value(value.as(MAP_TYPE_LITERAL)); case GeoPointType.ID: if (value.hasArrayElements()) { return type.value(toCrateObject(value, DataTypes.DOUBLE_ARRAY)); } else { return type.value(value.asString()); } case GeoShapeType.ID: if (value.isString()) { return type.value(value.asString()); } else { return type.value(value.as(MAP_TYPE_LITERAL)); } default: final Object polyglotValue; if (value.isNumber()) { polyglotValue = value.as(NUMBER_TYPE_LITERAL); } else if (value.isString()) { polyglotValue = value.asString(); } else if (value.isBoolean()) { polyglotValue = value.asBoolean(); } else { polyglotValue = value.asString(); } return type.value(polyglotValue); } }</code><technical_language>suggestion ArrayList<Object> items = new ArrayList<>(value.getArraySize());</technical_language>

Target:
static Object toCrateObject(Value value, DataType<?> type) { if (value == null) { return null; } switch (type.id()) { case ArrayType.ID: ArrayList<Object> items = new ArrayList<>((int) value.getArraySize()); for (int idx = 0; idx < value.getArraySize(); idx++) { var item = toCrateObject(value.getArrayElement(idx), ((ArrayType) type).innerType()); items.add(idx, item); } return type.value(items); case ObjectType.ID: return type.value(value.as(MAP_TYPE_LITERAL)); case GeoPointType.ID: if (value.hasArrayElements()) { return type.value(toCrateObject(value, DataTypes.DOUBLE_ARRAY)); } else { return type.value(value.asString()); } case GeoShapeType.ID: if (value.isString()) { return type.value(value.asString()); } else { return type.value(value.as(MAP_TYPE_LITERAL)); } default: final Object polyglotValue; if (value.isNumber()) { polyglotValue = value.as(NUMBER_TYPE_LITERAL); } else if (value.isString()) { polyglotValue = value.asString(); } else if (value.isBoolean()) { polyglotValue = value.asBoolean(); } else { polyglotValue = value.asString(); } return type.value(polyglotValue); } }
Source:
<code>private void processQuery(ScheduledQueryPollResponse q) { SessionState state = null; try { HiveConf conf = new HiveConf(context.conf); conf.setVar(ConfVars.HIVE_QUERY_EXCLUSIVE_LOCK, lockNameFor(q.getScheduleKey())); state = SessionState.start(conf); info = new ScheduledQueryProgressInfo(); info.setScheduledExecutionId(q.getExecutionId()); info.setState(QueryState.EXECUTING); reportQueryProgress(); try ( <START> IDriver driver = DriverFactory.newDriver(DriverFactory.getNewQueryState(conf), q.getUser(), null)) { <END> info.setExecutorQueryId(driver.getQueryState().getQueryId()); driver.run(q.getQuery()); info.setState(QueryState.FINISHED); } } catch (Throwable t) { info.setErrorMessage(getErrorStringForException(t)); info.setState(QueryState.ERRORED); } finally { if (state != null) { try { state.close(); } catch (Throwable e) { } } reportQueryProgress(); } }</code><technical_language>If HIVE_QUERY_EXCLUSIVE_LOCK is moved out of HiveConf file, conf overlay creating a new getNewQueryState(conf, mapWithOverlay) method</technical_language>

Target:
private void processQuery(ScheduledQueryPollResponse q) { SessionState state = null; try { HiveConf conf = new HiveConf(context.conf); conf.set(Constants.HIVE_QUERY_EXCLUSIVE_LOCK, lockNameFor(q.getScheduleKey())); state = SessionState.start(conf); info = new ScheduledQueryProgressInfo(); info.setScheduledExecutionId(q.getExecutionId()); info.setState(QueryState.EXECUTING); reportQueryProgress(); try ( IDriver driver = DriverFactory.newDriver(DriverFactory.getNewQueryState(conf), q.getUser(), null)) { info.setExecutorQueryId(driver.getQueryState().getQueryId()); driver.run(q.getQuery()); info.setState(QueryState.FINISHED); } } catch (Throwable t) { info.setErrorMessage(getErrorStringForException(t)); info.setState(QueryState.ERRORED); } finally { if (state != null) { try { state.close(); } catch (Throwable e) { } } reportQueryProgress(); } }
Source:
<code>public void testReverse() throws StripeException { final Payout resource = getPayoutFixture(); <START> final Payout reverseledPayout = resource.reverse(); <END> assertNotNull(reverseledPayout); verifyRequest( ApiResource.RequestMethod.POST, String.format("/v1/payouts/%s/reverse", resource.getId())); }</code><technical_language>suggestion final Payout reversedPayout = resource.reverse();</technical_language>

Target:
public void testReverse() throws StripeException { final Payout resource = getPayoutFixture(); final Payout reversedPayout = resource.reverse(); assertNotNull(reversedPayout); verifyRequest( ApiResource.RequestMethod.POST, String.format("/v1/payouts/%s/reverse", resource.getId())); }
Source:
<code>public void doExit( StaplerRequest req, StaplerResponse rsp ) throws IOException { checkPermission(ADMINISTER); new Thread("exit thread") { @Override public void run() { try { ACL.impersonate(ACL.SYSTEM); LOGGER.severe(String.format("Shutting down VM as requested by %s from %s", getAuthentication().getName(), req!=null?req.getRemoteAddr():"???")); <START> if (rsp!=null) { <END> rsp.setStatus(HttpServletResponse.SC_OK); rsp.setContentType("text/plain"); try (PrintWriter w = rsp.getWriter()) { w.println("Shutting down"); } } cleanUp(); System.exit(0); } catch (Exception e) { LOGGER.log(Level.WARNING, "Failed to shut down Jenkins", e); } } }.start(); }</code><technical_language>I of stuff modifies response needs happen of thread start is called. Otherwise, method returned, happen if modify response</technical_language>

Target:
public void doExit( StaplerRequest req, StaplerResponse rsp ) throws IOException { checkPermission(ADMINISTER); if (rsp!=null) { rsp.setStatus(HttpServletResponse.SC_OK); rsp.setContentType("text/plain"); try (PrintWriter w = rsp.getWriter()) { w.println("Shutting down"); } } new Thread("exit thread") { @Override public void run() { try { ACL.impersonate(ACL.SYSTEM); LOGGER.info(String.format("Shutting down VM as requested by %s from %s", getAuthentication().getName(), req != null ? req.getRemoteAddr() : "???")); cleanUp(); System.exit(0); } catch (Exception e) { LOGGER.log(Level.WARNING, "Failed to shut down Jenkins", e); } } }.start(); }
Source:
<code>public Transfer getIndexedTransfer( final StoreKey storeKey, final StoreKey topKey, final String path, final TransferOperation op ) throws IndyWorkflowException { logger.trace( "Looking for indexed path: in: (entry point: {})", path, storeKey, topKey ); try { ArtifactStore store = storeDataManager.getArtifactStore( storeKey ); if ( store.isDisabled() ) { logger.debug( "Content not available in index caching layer due to store disabled for in group {}", storeKey, topKey ); return null; } } catch ( IndyDataException e ) { logger.error( String.format( "Failed to lookup store: %s (in membership of: %s). Reason: %s", storeKey, topKey, e.getMessage() ), e ); return null; } IndexedStorePath storePath = indexManager.getIndexedStorePath( storeKey, path ); if ( storePath != null ) { <START> Transfer transfer = delegate.getTransfer( storePath.getStoreKey(), path, op ); <END> if ( transfer == null || !transfer.exists() ) { logger.trace( "Found obsolete index entry: {}. De-indexing from: and {}", storeKey, topKey ); indexManager.deIndexStorePath( storeKey, path ); if ( topKey != null ) { indexManager.deIndexStorePath( topKey, path ); } } else { logger.trace( "Found it!" ); return transfer; } } return null; }</code><technical_language>I right. This "value" object key. this current Indexing decorator work all? time "getIndexed...", try get raw transfer</technical_language>

Target:
public Transfer getIndexedTransfer( final StoreKey storeKey, final StoreKey topKey, final String path, final TransferOperation op ) throws IndyWorkflowException { logger.trace( "Looking for indexed path: in: (entry point: {})", path, storeKey, topKey ); try { ArtifactStore store = storeDataManager.getArtifactStore( storeKey ); if ( store.isDisabled() ) { logger.debug( "Content not available in index caching layer due to store disabled for in group {}", storeKey, topKey ); return null; } } catch ( IndyDataException e ) { logger.error( String.format( "Failed to lookup store: %s (in membership of: %s). Reason: %s", storeKey, topKey, e.getMessage() ), e ); return null; } IndexedStorePath storePath = indexManager.getIndexedStorePath( storeKey, path ); if ( storePath != null ) { Transfer transfer = delegate.getTransfer( storeKey, path, op ); if ( transfer == null || !transfer.exists() ) { logger.trace( "Found obsolete index entry: {}. De-indexing from: and {}", storeKey, topKey ); indexManager.deIndexStorePath( storeKey, path ); if ( topKey != null ) { indexManager.deIndexStorePath( topKey, path ); } } else { logger.trace( "Found it!" ); return transfer; } } return null; }
Source:
<code>protected static String renameDiskAlias(OriginType originType, String alias) { Matcher matcher; if (originType == OriginType.VMWARE) { matcher = VMWARE_DISK_NAME_PATTERN.matcher(alias); } else { matcher = DISK_NAME_PATTERN.matcher(alias); } if (matcher.matches()) { return matcher.group(1).replace(' ', '_'); } return <START> alias; <END> }</code><technical_language>replace spaces in case pattern is expect? safe side.</technical_language>

Target:
protected static String renameDiskAlias(OriginType originType, String alias) { Matcher matcher; if (originType == OriginType.VMWARE) { matcher = VMWARE_DISK_NAME_PATTERN.matcher(alias); } else { matcher = DISK_NAME_PATTERN.matcher(alias); } if (matcher.matches()) { return replaceInvalidDiskAliasChars(matcher.group(1)); } return replaceInvalidDiskAliasChars(alias); }
Source:
<code>protected void onHandleIntent(@NonNull Intent intent) { <START> if (!DeviceUtil.isOnline(this)) { <END> L.i("Device is offline; aborting sync service"); return; } List<ReadingListPageDiskRow> queue = new ArrayList<>(); Collection<ReadingListPageDiskRow> rows = dao.startDiskTransaction(); L.i("Syncing saved rlp pages with saved pages service"); for (final ReadingListPageDiskRow row : rows) { L.v("Found pending tx with status: " + row.status().name()); switch (row.status()) { case UNSAVED: case DELETED: String filename = row.filename(); if (filename != null) { FileUtil.delete(new File(filename), true); dao.completeDiskTransaction(row); L.v("Deleted" + filename); continue; } L.e("Found row with null filename; skipping"); continue; case OUTDATED: queue.add(row); continue; case ONLINE: case SAVED: L.w("Received row with unexpected status " + row.status() + ": " + row.toString()); continue; default: throw new UnsupportedOperationException("Invalid disk row status: " + row.status().name()); } } saveNewEntries(queue); }</code><technical_language>check for isMetered</technical_language>

Target:
protected void onHandleIntent(@NonNull Intent intent) { ConnectivityManager manager = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE); if (!DeviceUtil.isOnline(manager) || DeviceUtil.isNetworkMetered(manager)) { L.i("Device is offline; aborting sync service"); return; } List<ReadingListPageDiskRow> queue = new ArrayList<>(); Collection<ReadingListPageDiskRow> rows = dao.startDiskTransaction(); L.i("Syncing saved rlp pages with saved pages service"); for (final ReadingListPageDiskRow row : rows) { L.v("Found pending tx with status: " + row.status().name()); switch (row.status()) { case UNSAVED: case DELETED: String filename = row.filename(); if (filename != null) { FileUtil.delete(new File(filename), true); dao.completeDiskTransaction(row); L.v("Deleted" + filename); continue; } L.e("Found row with null filename; skipping"); continue; case OUTDATED: queue.add(row); continue; case ONLINE: case SAVED: L.w("Received row with unexpected status " + row.status() + ": " + row.toString()); continue; default: throw new UnsupportedOperationException("Invalid disk row status: " + row.status().name()); } } saveNewEntries(queue); }
Source:
<code>public static String addDomainToName(String name, String domainName) { <START> if (name.indexOf("/") < 0 && !"PRIMARY".equalsIgnoreCase(domainName) && domainName != null) { <END> domainName = domainName + "/"; name = domainName + name; } return name; }</code><technical_language>UserCoreConstants.DOMAIN_SEPARATOR</technical_language>

Target:
public static String addDomainToName(String name, String domainName) { if (name.indexOf(UserCoreConstants.DOMAIN_SEPARATOR) < 0 && !"PRIMARY".equalsIgnoreCase(domainName) && domainName != null) { domainName = domainName + UserCoreConstants.DOMAIN_SEPARATOR; name = domainName + name; } return name; }
Source:
<code>public static int hoistcheck() { int i = 0, i2 = 0, i3 = 0, k = 0; short arr[] = new short[100]; for (i = -100000000; i < 20; <START> i++) { <END> i3 = i; while (i2++ < 33) { if (i3 > 0) { k += arr[i3]; } } } return i; }</code><technical_language>Is important increment 1? If speed-up test in case passes a lot</technical_language>

Target:
public static int hoistcheck() { int i = 0, i2 = 0, i3 = 0, k = 0; short arr[] = new short[100]; for (i = -100000000; i < 20; i+=10000000) { i3 = i; while (i2++ < 33) { if (i3 > 0) { k += arr[i3]; } } } return i; }
Source:
<code>public static void storeSubTabHeight(ClientStorage clientStorage, IsWidget widget) { <START> clientStorage.setLocalItem(SubTabHelper.SUB_TAB_HEIGHT_KEY, <END> String.valueOf(widget.asWidget().getOffsetHeight())); }</code><technical_language>s/SubTabHelper.SUB_TAB_HEIGHT_KEY/SUB_TAB_HEIGHT_KEY/ :-)</technical_language>

Target:
public static void storeSubTabHeight(ClientStorage clientStorage, IsWidget widget) { clientStorage.setLocalItem(SUB_TAB_HEIGHT_KEY, String.valueOf(widget.asWidget().getOffsetHeight())); }
Source:
<code>private ListMultimap<String, String> parseCustomMeta() { List<Node> customMetaNodes = readNodeList(" ImmutableListMultimap.Builder<String, String> builder = ImmutableListMultimap.builder(); for (Node node : customMetaNodes) { String name = readString("child::meta-name", node); String value = sanitize(readString("child::meta-value", node)); <START> if (value == null) continue; <END> builder.put(name, value); } return builder.build(); }</code><technical_language>Apparently, triggering this xml <custom-meta> <meta-name>citation</meta-name> <meta-value/> </custom-meta> In order capture <meta-name> properly, wrap in Strings.nullToEmpty</technical_language>

Target:
private ListMultimap<String, String> parseCustomMeta() { List<Node> customMetaNodes = readNodeList(" ImmutableListMultimap.Builder<String, String> builder = ImmutableListMultimap.builder(); for (Node node : customMetaNodes) { String name = readString("child::meta-name", node); String value = Strings.nullToEmpty(sanitize(readString("child::meta-value", node))); builder.put(name, value); } return builder.build(); }
Source:
<code>public GPTimeUnitStack() { myPairs = new TimeUnitPair[] { <START> new TimeUnitPair(DAY, HOUR, this, 85), new TimeUnitPair(DAY, HOUR, this, 75), <END> new TimeUnitPair(WEEK, DAY, this, 65), new TimeUnitPair(WEEK, DAY, this, 55), new TimeUnitPair(MONTH, DAY, this, 44), new TimeUnitPair(MONTH, DAY, this, 34), new TimeUnitPair(MONTH, WEEK, this, 24), new TimeUnitPair(MONTH, WEEK, this, 21), new TimeUnitPair(YEAR, WEEK, this, 13), new TimeUnitPair(YEAR, WEEK, this, 8), new TimeUnitPair(YEAR, MONTH, this, 5), new TimeUnitPair(YEAR, MONTH, this, 3), }; }</code><technical_language>Is 85 good enough</technical_language>

Target:
public GPTimeUnitStack() { myPairs = new TimeUnitPair[] { new TimeUnitPair(DAY, HOUR, this, 20), new TimeUnitPair(DAY, HOUR, this, 20), new TimeUnitPair(WEEK, DAY, this, 65), new TimeUnitPair(WEEK, DAY, this, 55), new TimeUnitPair(MONTH, DAY, this, 44), new TimeUnitPair(MONTH, DAY, this, 34), new TimeUnitPair(MONTH, WEEK, this, 24), new TimeUnitPair(MONTH, WEEK, this, 21), new TimeUnitPair(YEAR, WEEK, this, 13), new TimeUnitPair(YEAR, WEEK, this, 8), new TimeUnitPair(YEAR, MONTH, this, 5), new TimeUnitPair(YEAR, MONTH, this, 3), }; }
Source:
<code>protected void updateData(final long start, final long end, int nb, @Nullable IProgressMonitor monitor) { Iterable<@NonNull ISegment> data = fDisplayData; <START> final int datasize = (nb == 0) ? Iterables.size(data) : nb; <END> if (end == start) { return; } List<Double> xSeries = new ArrayList<>(datasize); List<Double> ySeries = new ArrayList<>(datasize); Iterator<ISegment> modelIter = data.iterator(); while (modelIter.hasNext()) { ISegment segment = modelIter.next(); xSeries.add((double) (segment.getStart() - start)); ySeries.add((double) segment.getLength()); } setXAxis(Doubles.toArray(xSeries)); setSeries(Messages.SegmentStoreScatterGraphViewer_legend, Doubles.toArray(ySeries)); updateDisplay(); }</code><technical_language>O(n), move fast exit remove, set 0. some equivalent number. 1000, avoid initial resizes</technical_language>

Target:
protected void updateData(final long start, final long end, int nb, @Nullable IProgressMonitor monitor) { if (end == start) { return; } List<Double> xSeries = new ArrayList<>(); List<Double> ySeries = new ArrayList<>(); for (ISegment segment : fDisplayData) { if (monitor != null && monitor.isCanceled()) { return; } xSeries.add((double) (segment.getStart() - start)); ySeries.add((double) segment.getLength()); } setXAxis(Doubles.toArray(xSeries)); setSeries(Messages.SegmentStoreScatterGraphViewer_legend, Doubles.toArray(ySeries)); updateDisplay(); }
Source:
<code>private synchronized void close(Exception cause) { <START> if (!isOpen()) { <END> return; } framedTransport.close(); processorThread.kill(); for (WorkerThread workerThread : workerThreads) { workerThread.kill(); } if (isCleanClose(cause)) { LOGGER.info("transport closed"); } else { LOGGER.info("transport closed with cause: " + cause.getMessage()); } signalClose(cause); registry.close(); }</code><technical_language>happen if underlying framedTransport is closed returns false for isOpen this is called in situations unclean close? this cleanup FMuxTransport in cases - this if(!isOpen() || !isCleanClose(cause)</technical_language>

Target:
protected synchronized void close(Exception cause) { if (isCleanClose(cause) && !isOpen()) { return; } framedTransport.close(); processorThread.kill(); for (WorkerThread workerThread : workerThreads) { workerThread.kill(); } if (isCleanClose(cause)) { LOGGER.info("transport closed"); } else { LOGGER.info("transport closed with cause: " + cause.getMessage()); } signalClose(cause); registry.close(); }
Source:
<code>public void open(TriggerHandler triggerHandler, SpliceOperation operation, boolean loadReplaceMode) throws StandardException { super.open(triggerHandler, operation, loadReplaceMode); try{ WriteConfiguration writeConfiguration = writeCoordinator.defaultWriteConfiguration(); if(rollforward) writeConfiguration = new RollforwardWriteConfiguration(writeConfiguration); <START> writeConfiguration.setLoadReplaceMode(loadReplaceMode); <END> writeBuffer=writeCoordinator.writeBuffer(destinationTable,txn,null, PipelineUtils.noOpFlushHook, writeConfiguration, Metrics.noOpMetricFactory()); encoder=new PairEncoder(getKeyEncoder(),getRowHash(),dataType); flushCallback=triggerHandler==null?null:TriggerHandler.flushCallback(writeBuffer); if (triggerHandler != null && triggerHandler.hasStatementTriggerWithReferencingClause()) triggerRowsEncoder=new PairEncoder(getTriggerKeyEncoder(),getTriggerRowHash(),KVPair.Type.INSERT); }catch(IOException ioe){ throw Exceptions.parseException(ioe); } }</code><technical_language>changing a shared writeConfiguration</technical_language>

Target:
public void open(TriggerHandler triggerHandler, SpliceOperation operation, boolean loadReplaceMode) throws StandardException { super.open(triggerHandler, operation, loadReplaceMode); try{ WriteConfiguration writeConfiguration = writeCoordinator.newDefaultWriteConfiguration(); if(rollforward) writeConfiguration = new RollforwardWriteConfiguration(writeConfiguration); writeConfiguration.setLoadReplaceMode(loadReplaceMode); writeBuffer=writeCoordinator.writeBuffer(destinationTable,txn,null, PipelineUtils.noOpFlushHook, writeConfiguration, Metrics.noOpMetricFactory()); encoder=new PairEncoder(getKeyEncoder(),getRowHash(),dataType); flushCallback=triggerHandler==null?null:TriggerHandler.flushCallback(writeBuffer); }catch(IOException ioe){ throw Exceptions.parseException(ioe); } }
Source:
<code>public long getLastTimeInOfflineHistory() { List<String> offlineHistory = _record.getListField(ConfigProperty.OFFLINE.name()); <START> if (offlineHistory == null || offlineHistory.isEmpty()) { <END> return -1; } String lastDate = offlineHistory.get(offlineHistory.size() - 1); return parseHistoryDateStringToLong(lastDate); }</code><technical_language>is difference this w/ getLastOfflineTime</technical_language>

Target:
public long getLastTimeInOfflineHistory() { List<String> offlineHistory = _record.getListField(ConfigProperty.OFFLINE.name()); if (offlineHistory == null || offlineHistory.isEmpty()) { return -1; } String lastDate = offlineHistory.get(offlineHistory.size() - 1); return historyDateStringToLong(lastDate); }