auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public PartitionedLookupSourceFactory(List<Type> types, List<Type> outputTypes, List<Integer> hashChannels, int partitionCount, Map<Symbol, Integer> layout, boolean outer) { this.types = ImmutableList.copyOf(requireNonNull(types, "types is null")); this.outputTypes = ImmutableList.copyOf(requireNonNull(outputTypes, "outputTypes is null")); this.layout = ImmutableMap.copyOf(layout); this.partitions = (Supplier<LookupSource>[]) new Supplier<?>[partitionCount]; this.outer = outer; hashChannelTypes = hashChannels.stream() .map(types::get) .collect(toImmutableList()); spilledLookupSource = new SpilledLookupSource(outputTypes.size()); }

Target:
public PartitionedLookupSourceFactory(List<Type> types, List<Type> outputTypes, List<Integer> hashChannels, int partitionCount, Map<Symbol, Integer> layout, boolean outer) { this.types = ImmutableList.copyOf(requireNonNull(types, "types is null")); this.outputTypes = ImmutableList.copyOf(requireNonNull(outputTypes, "outputTypes is null")); this.layout = ImmutableMap.copyOf(layout); checkArgument(partitionCount > 0); this.partitions = (Supplier<LookupSource>[]) new Supplier<?>[partitionCount]; this.outer = outer; hashChannelTypes = hashChannels.stream() .map(types::get) .collect(toImmutableList()); spilledLookupSource = new SpilledLookupSource(outputTypes.size()); }
Source:
public void bindTo(MeterRegistry registry) { for (WorkspaceStatus s : WorkspaceStatus.values()) { Gauge.builder("che.workspace.status", activityManager, __ -> count(s)) .tag("status", s.name()) .tag("area", "workspace") .description("The number of workspaces in a given status") .register(registry); } }

Target:
public void bindTo(MeterRegistry registry) { for (WorkspaceStatus s : WorkspaceStatus.values()) { Gauge.builder("che.workspace.status", () -> count(s)) .tag("status", s.name()) .tag("area", "workspace") .description("The number of workspaces in a given status") .register(registry); } }
Source:
@Override public Result load(Request request, int networkPolicy) throws IOException { okhttp3.Request downloaderRequest = createRequest(request, networkPolicy); Response response = downloader.load(downloaderRequest); ResponseBody body = response.body(); if (response.code() >= 300) { body.close(); throw new ResponseException(response.code(), request.networkPolicy); } Picasso.LoadedFrom loadedFrom = response.cacheResponse() == null ? NETWORK : DISK; if (loadedFrom == DISK && body.contentLength() == 0) { body.close(); throw new ContentLengthException("Received response with 0 content-length header."); } if (loadedFrom == NETWORK && body.contentLength() > 0) { stats.dispatchDownloadFinished(body.contentLength()); } InputStream is = body.byteStream(); return new Result(is, loadedFrom); }

Target:
@Override public Result load(Request request, int networkPolicy) throws IOException { okhttp3.Request downloaderRequest = createRequest(request, networkPolicy); Response response = downloader.load(downloaderRequest); ResponseBody body = response.body(); if (!response.isSuccessful()) { body.close(); throw new ResponseException(response.code(), request.networkPolicy); } Picasso.LoadedFrom loadedFrom = response.cacheResponse() == null ? NETWORK : DISK; if (loadedFrom == DISK && body.contentLength() == 0) { body.close(); throw new ContentLengthException("Received response with 0 content-length header."); } if (loadedFrom == NETWORK && body.contentLength() > 0) { stats.dispatchDownloadFinished(body.contentLength()); } InputStream is = body.byteStream(); return new Result(is, loadedFrom); }
Source:
public Map<String, R> merge(Map<String, R> result1, Map<String, R> result2) { Aggregation<P, R, T> agg = this.result.values().stream().findAny().orElse(null); if (agg == null) { return null; } return Stream.of(result1, result2).flatMap(m -> m.entrySet().stream()).collect( Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, agg::merge)); }

Target:
public Map<String, R> merge(Map<String, R> result1, Map<String, R> result2) { final Aggregation<P, R, T> agg = this.getHelperAggregation(); return Stream.of(result1, result2).flatMap(m -> m.entrySet().stream()).collect( Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, agg::merge)); }
Source:
@Override public void setCard(@NonNull OnboardingCard card) { super.setCard(card); ColorStateList colorStateList = new ColorStateList( new int[][]{new int[]{}}, new int[]{ContextCompat.getColor(getContext(), R.color.base20)} ); ViewCompat.setBackgroundTintList(headerImageView, colorStateList); headerImageView.setImageResource(card.headerImage()); headerTitleView.setText(card.headerText()); imageView.setImageURI(card.fullImage()); actionViewPositive.setText(card.positiveText()); }

Target:
@Override public void setCard(@NonNull OnboardingCard card) { super.setCard(card); headerImageView.setImageResource(card.headerImage()); headerTitleView.setText(card.headerText()); imageView.setImageURI(card.fullImage()); actionViewPositive.setText(card.positiveText()); }
Source:
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); boolean fileBytesEquality = Arrays.equals(compareFileBytes, dstFileBytes); assertTrue(fileBytesEquality); }

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:
private 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())); } }

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:
public void added(Provider<Rule> provider, Rule element) { Rule ruleWithUID = element; if (element.getUID() == null) { String rUID = ruleEngine.getUniqueId(); ruleWithUID = initRuleId(rUID, element); } postRuleAddedEvent(ruleWithUID); super.added(provider, ruleWithUID); updateRuleByTemplate(provider, ruleWithUID); }

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:
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); } ByteBuf ioBuffer = ioBuffer(buf.readableBytes()); ioBuffer.writeBytes(buf, buf.readerIndex(), buf.readableBytes()); try { return writeBytesDirect(in, ioBuffer); } finally { ioBuffer.release(); } }

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:
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 { String baseUrl = ctxt.systemConfig().getDataCiteRestApiUrlString(); 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); } }

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:
public void testRgb() { E4ThemeColor e4ThemeColor = new E4ThemeColor(); RGB rgb = E4ThemeColor.getRGBFromCssString("rgb(238, 238, 238)"); assertEquals(new RGB(238, 238, 238), rgb); }

Target:
public void testRgb() { RGB rgb = E4ThemeColor.getRGBFromCssString("rgb(238, 238, 238)"); assertEquals(new RGB(238, 238, 238), rgb); }
Source:
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) { ZephyrPlugin.log(e); } return status; }

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:
public void shouldSerializeCalendarLikeXstream() { List<JsonSerializer> adapters = new ArrayList<JsonSerializer>(); adapters.add(new CalendarSerializer()); 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))); }

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:
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(2l, TimeUnit.MINUTES); } catch (TimeoutException e) { future.cancel(true); throw new RuntimeException("Request couldn't be completed because we failed to clone the repo within 2 minutes"); } }

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:
protected boolean canDoAction() { if (getVds() == null) { return failCanDoAction(VdcBllMessages.VDS_CANNOT_ACTIVATE_VDS_NOT_EXIST); } if (true && getVds().getstatus() == VDSStatus.Up) { return failCanDoAction(VdcBllMessages.VDS_CANNOT_ACTIVATE_VDS_ALREADY_UP); } return true; }

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:
public TemplatePage createTemplate(String templateName) { new ArticleContent().push("", "Template:" + templateName); return this; }

Target:
public TemplatePage createTemplate(String templateName) { new TemplateContent().push(templateName); return this; }
Source:
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 { expiryType.setClazz(expiryPolicy.getClass().getName()); } cacheType.withExpiry(expiryType); } EvictionAdvisor<?, ?> evictionAdvisor = cacheConfiguration.getEvictionAdvisor(); if (evictionAdvisor != null) { cacheType.withEvictionAdvisor(evictionAdvisor.getClass().getName()); } return cacheType; }

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:
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); } break; } } else { consumer.rollbackOnExceptionIfNecessary(ex); throw ex; } } } return consumer.commitIfNecessary(isChannelLocallyTransacted()); }

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:
public void updateDependencyWithInheritTest() throws InterruptedException { ide.waitOpenedWorkspaceIsReadyToUse(); createProjectFromUI(PROJECT_NAME1); projectExplorer.waitItem(PROJECT_NAME1); mavenPluginStatusBar.waitClosingInfoPanel(); notificationsPopupPanel.waitProgressPopupPanelClose(); projectExplorer.expandPathInProjectExplorer(PROJECT_NAME1 + PATH_FOR_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_FOR_EXPAND); try { projectExplorer.openItemByPath(PROJECT_NAME2 + PATH_TO_FILE); } catch (TimeoutException ex) { fail("Known issue <LINK_0>"); } editor.waitActive(); editor.waitAllMarkersDisappear(ERROR_MARKER); }

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:
private static List<String> buildDescritpion(BusinessEntity entity) { List<String> descList = new ArrayList<>(); if (null != entity && CollectionUtils.isNotEmpty(entity.getDescription())) { for (Description obj : entity.getDescription()) { descList.add(obj.getValue()); } } return descList; }

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:
private String getSubject(JobEmailStatus jobEmailStatus) { String event = eventType.toString(); if (jobEmailStatus.isWithErrors()) { event = SchedulerEvent.JOB_RUNNING_TO_FINISHED_WITH_ERRORS.toString(); } if (jobEmailStatus.isAborted()) { event = SchedulerEvent.JOB_ABORTED.toString(); } String jobID = jobState.getId().value(); return String.format(SUBJECT_TEMPLATE, jobID, event); }

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:
public static String docsVersion() { if (Version.VERSION.matches("^\\d*\\.\\d*\\.\\d*$")) { return Version.VERSION; } else { return "latest"; } }

Target:
public static String docsVersion() { return "latest"; }
Source:
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); LOG.log(Level.INFO, "deleting..."); 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()); } }

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:
private void indexFiles(Path baseDir) throws IOException { Queue<File> directories = new ArrayDeque<>(); directories.add(baseDir.toFile()); while (!directories.isEmpty()) { FileTreeIterator fileTreeIterator = new FileTreeIterator(directories.poll(), FS.detect(), null); 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); } } }

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:
static Object toCrateObject(Value value, DataType<?> type) { if (value == null) { return null; } switch (type.id()) { case ArrayType.ID: ArrayList<Object> items = new ArrayList<>(); 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); } }

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:
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 ( 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(); } }

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:
public void testReverse() throws StripeException { final Payout resource = getPayoutFixture(); final Payout reverseledPayout = resource.reverse(); assertNotNull(reverseledPayout); verifyRequest( ApiResource.RequestMethod.POST, String.format("/v1/payouts/%s/reverse", resource.getId())); }

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:
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():"???")); if (rsp!=null) { 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(); }

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:
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( storePath.getStoreKey(), 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; }

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:
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 alias; }

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:
protected void onHandleIntent(@NonNull Intent intent) { if (!DeviceUtil.isOnline(this)) { 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); }

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:
public static String addDomainToName(String name, String domainName) { if (name.indexOf("/") < 0 && !"PRIMARY".equalsIgnoreCase(domainName) && domainName != null) { domainName = domainName + "/"; name = domainName + name; } return name; }

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:
public static int hoistcheck() { int i = 0, i2 = 0, i3 = 0, k = 0; short arr[] = new short[100]; for (i = -100000000; i < 20; i++) { i3 = i; while (i2++ < 33) { if (i3 > 0) { k += arr[i3]; } } } return i; }

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:
public static void storeSubTabHeight(ClientStorage clientStorage, IsWidget widget) { clientStorage.setLocalItem(SubTabHelper.SUB_TAB_HEIGHT_KEY, String.valueOf(widget.asWidget().getOffsetHeight())); }

Target:
public static void storeSubTabHeight(ClientStorage clientStorage, IsWidget widget) { clientStorage.setLocalItem(SUB_TAB_HEIGHT_KEY, String.valueOf(widget.asWidget().getOffsetHeight())); }
Source:
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)); if (value == null) continue; builder.put(name, value); } return builder.build(); }

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:
public GPTimeUnitStack() { myPairs = new TimeUnitPair[] { new TimeUnitPair(DAY, HOUR, this, 85), new TimeUnitPair(DAY, HOUR, this, 75), 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), }; }

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:
protected void updateData(final long start, final long end, int nb, @Nullable IProgressMonitor monitor) { Iterable<@NonNull ISegment> data = fDisplayData; final int datasize = (nb == 0) ? Iterables.size(data) : nb; 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(); }

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:
private synchronized void close(Exception cause) { if (!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(); }

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:
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); 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); if (triggerHandler != null && triggerHandler.hasStatementTriggerWithReferencingClause()) triggerRowsEncoder=new PairEncoder(getTriggerKeyEncoder(),getTriggerRowHash(),KVPair.Type.INSERT); }catch(IOException ioe){ throw Exceptions.parseException(ioe); } }

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:
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 parseHistoryDateStringToLong(lastDate); }

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); }