auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static boolean shouldCaptureIncrementalChanges(FileSystem fs,Path rootDir) throws StandardException{ boolean shouldRegister = false; try { boolean enabled = incrementalBackupEnabled(); if (enabled) { RecoverableZooKeeper zooKeeper = ZkUtils.getRecoverableZooKeeper(); String spliceBackupPath = BackupUtils.getBackupPath(); if (zooKeeper.exists(spliceBackupPath, false)==null){ return false; } boolean isRestoreMode = SIDriver.driver().lifecycleManager().isRestoreMode(); if (!isRestoreMode) { List<String> backupJobs = zooKeeper.getChildren(spliceBackupPath, false); if (backupJobs.size() > 0) { for (String backupId : backupJobs) { String path = spliceBackupPath + "/" + backupId; byte[] data = zooKeeper.getData(path, false, null); BackupJobStatus status = BackupJobStatus.parseFrom(data); if (status.getScope() == BackupJobStatus.BackupScope.DATABASE) { if (LOG.isDebugEnabled()) { SpliceLogUtils.debug(LOG, "A database backup is running"); } shouldRegister = true; } } } else if (BackupUtils.existsDatabaseBackup(fs, rootDir)) { if (LOG.isDebugEnabled()) { SpliceLogUtils.debug(LOG, "There exists a successful full or incremental backup in the system"); } shouldRegister = true; } } } return shouldRegister; } catch (Exception e) { e.printStackTrace(); throw StandardException.plainWrapException(e); } }

Target:
public static boolean shouldCaptureIncrementalChanges(FileSystem fs,Path rootDir) throws StandardException{ boolean shouldRegister = false; try { boolean enabled = incrementalBackupEnabled(); if (enabled) { RecoverableZooKeeper zooKeeper = ZkUtils.getRecoverableZooKeeper(); String spliceBackupPath = BackupUtils.getBackupPath(); if (zooKeeper.exists(spliceBackupPath, false)==null){ return false; } boolean isRestoreMode = SIDriver.driver().lifecycleManager().isRestoreMode(); if (!isRestoreMode) { List<String> backupJobs = zooKeeper.getChildren(spliceBackupPath, false); if (backupJobs.size() > 0) { for (String backupId : backupJobs) { String path = spliceBackupPath + "/" + backupId; byte[] data = zooKeeper.getData(path, false, null); BackupJobStatus status = BackupJobStatus.parseFrom(data); if (status.getScope() == BackupJobStatus.BackupScope.DATABASE) { if (LOG.isDebugEnabled()) { SpliceLogUtils.debug(LOG, "A database backup is running"); } shouldRegister = true; } } } if (!shouldRegister && BackupUtils.existsDatabaseBackup(fs, rootDir)) { if (LOG.isDebugEnabled()) { SpliceLogUtils.debug(LOG, "There exists a successful full or incremental backup in the system"); } shouldRegister = true; } } } return shouldRegister; } catch (Exception e) { e.printStackTrace(); throw StandardException.plainWrapException(e); } }
Source:
public void merge(TDigest other) { checkArgument(other != null, "Cannot merge with a null t-digest"); checkArgument(this.publicCompression == other.getCompressionFactor(), format("TDigests must have the same compression, found (%s, %s)", this.publicCompression, other.getCompressionFactor())); List<Centroid> tmp = new ArrayList<>(); for (Centroid centroid : other.centroids()) { tmp.add(centroid); } shuffle(tmp, gen); for (Centroid centroid : tmp) { add(centroid.getMean(), centroid.getWeight()); } }

Target:
public void merge(TDigest other) { checkArgument(other != null, "Cannot merge with a null t-digest"); checkArgument(this.publicCompression == other.getCompressionFactor(), "TDigests must have the same compression, found (%s, %s)", this.publicCompression, other.getCompressionFactor()); List<Centroid> tmp = new ArrayList<>(); for (Centroid centroid : other.centroids()) { tmp.add(centroid); } shuffle(tmp, gen); for (Centroid centroid : tmp) { add(centroid.getMean(), centroid.getWeight()); } }
Source:
public void onCommandSend(final PlayerCommandSendEvent event) { User user = ess.getUser(event.getPlayer()); ArrayList<String> removedCmds = new ArrayList<>(event.getCommands()); event.getCommands().removeIf(str -> shouldHideFromUser(str, user)); removedCmds.removeAll(event.getCommands()); ess.getLogger().info("Removed commands: " + removedCmds.toString()); }

Target:
public void onCommandSend(final PlayerCommandSendEvent event) { User user = ess.getUser(event.getPlayer()); ArrayList<String> removedCmds = new ArrayList<>(event.getCommands()); event.getCommands().removeIf(str -> shouldHideFromUser(str, user)); if (ess.getSettings().isDebug()) { removedCmds.removeAll(event.getCommands()); ess.getLogger().info("Removed commands: " + removedCmds.toString()); } }
Source:
void setEnd(int end) { this.end = end; if (this.end > this.maxSeen) { this.maxSeen = this.end; } }

Target:
void setEnd(int end) { this.end = end; }
Source:
public EventBuilder setEventData(Eventful entity) { if (entity != null) { if (entity instanceof Named && ((Named) entity).getName() != null) { event.setTargetName(((Named) entity).getName()); } if (entity instanceof Owned) { Owner entityOwner = ((Owned) entity).getOwner(); if (entityOwner != null && entityOwner.getId() != null) { event.setOwnerId(entityOwner.getId()); } } if (entity instanceof Entitlement) { event.setReferenceType(Event.ReferenceType.POOL); Pool referencedPool = ((Entitlement) entity).getPool(); if (referencedPool != null && referencedPool.getId() != null) { event.setReferenceId(referencedPool.getId()); } } if ((String) entity.getId() != null) { event.setEntityId((String) entity.getId()); if (entity instanceof ConsumerProperty) { Consumer owningConsumer = ((ConsumerProperty) entity).getConsumer(); if (owningConsumer != null && owningConsumer.getId() != null) { event.setConsumerId(owningConsumer.getId()); } } } if (event.getTarget().equals(Target.POOL) && event.getType().equals(Type.CREATED)) { StringBuilder eventDataBuilder = new StringBuilder() .append("{\"subscriptionId\": \"") .append(((Pool) entity).getSubscriptionId()) .append("\"") .append("}"); event.setEventData(eventDataBuilder.toString()); } } return this; }

Target:
public EventBuilder setEventData(Eventful entity) { if (entity != null) { if (entity instanceof Named && ((Named) entity).getName() != null) { event.setTargetName(((Named) entity).getName()); } if (entity instanceof Owned) { Owner entityOwner = ((Owned) entity).getOwner(); if (entityOwner != null && entityOwner.getId() != null) { event.setOwnerId(entityOwner.getId()); } } if (entity instanceof Entitlement) { event.setReferenceType(Event.ReferenceType.POOL); Pool referencedPool = ((Entitlement) entity).getPool(); if (referencedPool != null && referencedPool.getId() != null) { event.setReferenceId(referencedPool.getId()); } } if (entity.getId() != null) { event.setEntityId((String) entity.getId()); if (entity instanceof ConsumerProperty) { Consumer owningConsumer = ((ConsumerProperty) entity).getConsumer(); if (owningConsumer != null && owningConsumer.getId() != null) { event.setConsumerId(owningConsumer.getId()); } } } if (event.getTarget().equals(Target.POOL) && event.getType().equals(Type.CREATED)) { Map<String, String> eventData = new HashMap<String, String>(); eventData.put("subscriptionId", ((Pool) entity).getSubscriptionId()); try { event.setEventData(mapper.writeValueAsString(eventData)); } catch (JsonProcessingException e) { log.error("Error while building JSON for pool.created event.", e); throw new IseException("Error while building JSON for pool.created event."); } } } return this; }
Source:
public void getProcessData() throws InterruptedException, ExecutionException, TimeoutException { final AsyncCompletionWaitor<IThreadDMData> waitor = new AsyncCompletionWaitor<>(); final DataRequestMonitor<IThreadDMData> rm = new DataRequestMonitor<IThreadDMData>(fSession.getExecutor(), null) { @Override protected void handleCompleted() { if (isSuccess()) { waitor.setReturnInfo(getData()); } waitor.waitFinished(getStatus()); } }; final IProcessDMContext processContext = DMContexts.getAncestorOfType(SyncUtil.getContainerContext(), IProcessDMContext.class); fSession.getExecutor().submit(new Runnable() { @Override public void run() { fProcService.getExecutionData(processContext, rm); } }); waitor.waitUntilDone(TestsPlugin.massageTimeout(2000)); Assert.assertTrue(waitor.getMessage(), waitor.isOK()); IThreadDMData processData = waitor.getReturnInfo(); Assert.assertNotNull("No process data is returned for Process DMC", processData); Assert.assertTrue("Process data should be executable name " + EXEC_NAME + "but we got " + processData.getName(), processData.getName().contains(EXEC_NAME)); }

Target:
public void getProcessData() throws InterruptedException, ExecutionException, TimeoutException { final IProcessDMContext processContext = DMContexts.getAncestorOfType( SyncUtil.getContainerContext(), IProcessDMContext.class); Query<IThreadDMData> query = new Query<IThreadDMData>() { @Override protected void execute(DataRequestMonitor<IThreadDMData> rm) { fProcService.getExecutionData(processContext, rm); } }; fProcService.getExecutor().execute(query); IThreadDMData processData = query.get(TestsPlugin.massageTimeout(2000), TimeUnit.MILLISECONDS); Assert.assertNotNull("No process data is returned for Process DMC", processData); Assert.assertTrue("Process data should be executable name " + EXEC_NAME + "but we got " + processData.getName(), processData.getName().contains(EXEC_NAME)); }
Source:
public boolean add(Tuple ps, int count) { if (count <= 0) { throw new IllegalArgumentException("The count value must be positive!"); } boolean exists = occurrences.containsKey(ps); if (exists) occurrences.put(ps, occurrences.get(ps) + count); else occurrences.put(ps, count); return !exists; }

Target:
public boolean add(Tuple ps, int count) { if (count < 0) { throw new IllegalArgumentException("The count value must be positive!"); } Integer oldCount = occurrences.get(ps); if (oldCount != null) { occurrences.put(ps, oldCount + count); } else { occurrences.put(ps, count); } return oldCount == null; }
Source:
public void stop() { LOG.info("Stop called."); _executor.shutdown(); while (!_executor.isTerminated()) { Thread.yield(); } }

Target:
public void stop() { LOG.info("Stop called."); _executor.shutdownNow(); while (!_executor.isTerminated()) { Thread.yield(); } }
Source:
public void testDruidRequestBodyToJson() { DruidClient.DruidRequestBody requestBody = new DruidClient.DruidRequestBody( "select \"column.1\" from \"table-1\"", "arrayLines", false); assertEquals("{\n" + " \"query\" : \"select \\\"column.1\\\" from \\\"table-1\\\"\",\n" + " \"resultFormat\" : \"arrayLines\",\n" + " \"queryHeader\" : false\n" + "}", requestBody.toJson()); }

Target:
public void testDruidRequestBodyToJson() { DruidClient.DruidRequestBody requestBody = new DruidClient.DruidRequestBody( "select \"city.name\" from \"geo-location\"", "arrayLines", false); assertEquals("{\n" + " \"query\" : \"select \\\"city.name\\\" from \\\"geo-location\\\"\",\n" + " \"resultFormat\" : \"arrayLines\",\n" + " \"queryHeader\" : false\n" + "}", requestBody.toJson()); }
Source:
public HomePresenter(EventBus eventBus, MyView view, MyProxy proxy) { super(eventBus, view, proxy, ApplicationPresenter.SLOT_SetMainContent); }

Target:
HomePresenter(EventBus eventBus, MyView view, MyProxy proxy) { super(eventBus, view, proxy, ApplicationPresenter.SLOT_SetMainContent); }
Source:
private static Set<String> getBoundFields(String enrichmentType) { final Descriptor enrichmentDescriptor = KnownTypes.getDescriptorForType(enrichmentType); final Set<String> result = new HashSet<>(); for (FieldDescriptor field : enrichmentDescriptor.getFields()) { final String extension = field.getOptions() .getExtension(EventAnnotationsProto.by); final String fieldName = extension.substring(WILDCARD_TYPE_UPON_FIELD_INDICATOR.length()); result.add(fieldName); } return result; }

Target:
private static Set<String> getBoundFields(String enrichmentType) { final Descriptor enrichmentDescriptor = KnownTypes.getDescriptorForType(enrichmentType); final Set<String> result = new HashSet<>(); for (FieldDescriptor field : enrichmentDescriptor.getFields()) { final String extension = field.getOptions() .getExtension(EventAnnotationsProto.by); final String fieldName = extension.substring(WILDCARD_TYPE_INDICATOR.length()); result.add(fieldName); } return result; }
Source:
protected void init420() { Builder version = forVersion(VersionEnum.V4_2_0); version.onTable("HFJ_RESOURCE").dropColumn("20200130.1", "FORCED_ID_PID"); version.onTable("HFJ_RES_VER").dropColumn("20200130.2", "FORCED_ID_PID"); version.onTable("HFJ_RES_VER").addForeignKey("20200130.3", "FK_RESOURCE_HISTORY_RESOURCE").toColumn("RES_ID").references("HFJ_RESOURCE", "RES_ID"); }

Target:
protected void init420() { Builder version = forVersion(VersionEnum.V4_2_0); version.onTable("TRM_VALUESET_C_DESIGNATION").dropIndex("20200202.1", "IDX_VALUESET_C_DSGNTN_VAL").failureAllowed(); Builder.BuilderWithTableName searchTable = version.onTable("HFJ_SEARCH"); searchTable.dropIndex("20200203.1", "IDX_SEARCH_LASTRETURNED"); searchTable.dropColumn("20200203.2", "SEARCH_LAST_RETURNED"); searchTable.addIndex("20200203.3", "IDX_SEARCH_CREATED").unique(false).withColumns("CREATED"); }
Source:
public void testMaxTablets() throws Exception { String maxTablets = "0"; try (AccumuloClient client = Accumulo.newClient().from(getClientProps()).build()) { maxTablets = client.instanceOperations().getSystemConfiguration() .get(Property.MASTER_BULK_MAX_TABLETS.getKey()); client.instanceOperations().setProperty(Property.MASTER_BULK_MAX_TABLETS.getKey(), "1"); testBulkFile(false, false); fail("Expected IllegalArgumentException for " + Property.MASTER_BULK_MAX_TABLETS); } catch (IllegalArgumentException e) finally { try (AccumuloClient client = Accumulo.newClient().from(getClientProps()).build()) { client.instanceOperations().setProperty(Property.MASTER_BULK_MAX_TABLETS.getKey(), maxTablets); } } }

Target:
public void testMaxTablets() throws Exception { try (AccumuloClient client = Accumulo.newClient().from(getClientProps()).build()) { tableName = "testMaxTablets_table1"; NewTableConfiguration newTableConf = new NewTableConfiguration(); var props = Map.of(Property.TABLE_BULK_MAX_TABLETS.getKey(), "2"); newTableConf.setProperties(props); client.tableOperations().create(tableName, newTableConf); var thrown = assertThrows(RuntimeException.class, () -> testBulkFileMax(false)); var c = thrown.getCause(); assertTrue("Wrong exception: " + c, c instanceof ExecutionException); assertTrue("Wrong exception: " + c.getCause(), c.getCause() instanceof IllegalArgumentException); var msg = c.getCause().getMessage(); assertTrue("Bad File not in exception: " + msg, msg.contains("bad-file.rf")); c = assertThrows(AccumuloException.class, () -> testBulkFileMax(true)); msg = c.getMessage(); assertTrue("Bad File not in exception: " + msg, msg.contains("bad-file.rf")); } }
Source:
public ArrayInterface setDouble(int index, double value) { return setObject(index, value); }

Target:
public Array setDouble(int index, double value) { return setObject(index, value); }
Source:
public void prepareRun(StageSubmitterContext context) throws Exception { super.prepareRun(context); context.record( TransformLineageRecorderUtils.allInToOneOut(TransformLineageRecorderUtils.getFields(context.getInputSchema()), TransformLineageRecorderUtils.getFields(context.getOutputSchema()) .get(0), "jsonFormat", "Format data as a JSON string.")); }

Target:
public void prepareRun(StageSubmitterContext context) throws Exception { super.prepareRun(context); if (!TransformLineageRecorderUtils.getFields(context.getOutputSchema()).isEmpty()) { context.record(TransformLineageRecorderUtils.generateManyToOne( TransformLineageRecorderUtils.getFields(context.getInputSchema()), TransformLineageRecorderUtils.getFields(context.getOutputSchema()).get(0), "jsonFormat", "Formatted data as a JSON string.")); } }
Source:
public String getName() { if (getTableAlias() == null) { return getAlias(); } else if (getTableAlias().length() == 0) { return getColumnName(); } else { return getTableAlias() + "." + getColumnName(); } }

Target:
public String getName() { if (m_tableAlias == null) { return m_alias; } else if (m_tableAlias.length() == 0) { return m_columnName; } else { return m_tableAlias + "." + m_columnName; } }
Source:
public AbstractDataView( SerializableSupplier<? extends DataProvider<T, ?>> dataProviderSupplier, Component component) { Objects.requireNonNull(dataProviderSupplier, "DataProvider supplier cannot be null"); this.dataProviderSupplier = dataProviderSupplier; this.component = component; final DataProvider<T, ?> dataProvider = dataProviderSupplier.get(); Objects.requireNonNull(dataProvider, "Supplied DataProvider cannot be null"); this.identityProvider = dataProvider::getId; verifyDataProviderType(dataProvider.getClass()); }

Target:
public AbstractDataView( SerializableSupplier<? extends DataProvider<T, ?>> dataProviderSupplier, Component component) { Objects.requireNonNull(dataProviderSupplier, "DataProvider supplier cannot be null"); this.dataProviderSupplier = dataProviderSupplier; this.component = component; verifyDataProviderType(dataProviderSupplier.get().getClass()); }
Source:
public void testAppendNoMappingExists() { ServerStore store = newStore(); store.append(1, getPayload(1)); Chain chain = store.get(1); assertThat(chain.isEmpty(), is(false)); for (Element element : chain) { assertThat(readPayLoad(element.getPayload()), is(Long.valueOf(1))); } }

Target:
public void testAppendNoMappingExists() { ServerStore store = newStore(); store.append(1, createPayload(1)); Chain chain = store.get(1); assertThat(chain.isEmpty(), is(false)); assertChainAndReverseChainOnlyHave(chain, 1); }
Source:
void send( CatchUpRequest request ) throws CatchUpClientException { if ( !nettyChannel.isActive() ) { throw new CatchUpClientException( "Channel is not connected" ); } nettyChannel.write( request.messageType() ); nettyChannel.writeAndFlush( request ); }

Target:
void send( CatchUpRequest request ) throws ConnectException { if ( !isActive() ) { throw new ConnectException( "Channel is not connected" ); } nettyChannel.write( request.messageType() ); nettyChannel.writeAndFlush( request ).addListener( ChannelFutureListener.CLOSE_ON_FAILURE ); }
Source:
public AdministrativeStatusType convertTo( final com.alliander.osgp.dto.valueobjects.smartmetering.AdministrativeStatusType source, final Type<AdministrativeStatusType> destinationType) { if (source == null) { return null; } if (source == com.alliander.osgp.dto.valueobjects.smartmetering.AdministrativeStatusType.OFF) { return AdministrativeStatusType.OFF; } else if (source == com.alliander.osgp.dto.valueobjects.smartmetering.AdministrativeStatusType.ON) { return AdministrativeStatusType.ON; } else { return AdministrativeStatusType.UNDEFINED; } }

Target:
public AdministrativeStatusType convertTo( final com.alliander.osgp.dto.valueobjects.smartmetering.AdministrativeStatusType source, final Type<AdministrativeStatusType> destinationType) { if (source == null) { return null; } return AdministrativeStatusType.fromValue(source.name()); }
Source:
public static void applyWorkspaceOverride(boolean overrideWorkspaceSettings, boolean offlineMode, boolean buildScansEnabled, ILaunchConfigurationWorkingCopy launchConfiguration) { launchConfiguration.setAttribute(OVERRIDE_WORKSPACE_SETTINGS, overrideWorkspaceSettings); if (overrideWorkspaceSettings) { launchConfiguration.setAttribute(OVERRIDDEN_OFFLINE_MODE, offlineMode); launchConfiguration.setAttribute(OVERRIDDEN_BUILD_SCANS_ENABLED, buildScansEnabled); } else { launchConfiguration.removeAttribute(OVERRIDDEN_OFFLINE_MODE); launchConfiguration.removeAttribute(OVERRIDDEN_BUILD_SCANS_ENABLED); } }

Target:
public static void applyWorkspaceOverride(boolean overrideWorkspaceSettings, boolean offlineMode, boolean buildScansEnabled, ILaunchConfigurationWorkingCopy launchConfiguration) { launchConfiguration.setAttribute(OVERRIDE_WORKSPACE_SETTINGS, overrideWorkspaceSettings); if (overrideWorkspaceSettings) { launchConfiguration.setAttribute(OFFLINE_MODE, offlineMode); launchConfiguration.setAttribute(BUILD_SCANS_ENABLED, buildScansEnabled); } else { launchConfiguration.removeAttribute(OFFLINE_MODE); launchConfiguration.removeAttribute(BUILD_SCANS_ENABLED); } }
Source:
private void buildDeltaForFocusChangedEvent(VMDelta parentDelta, int nodeOffset, RequestMonitor rm) { getSession().getExecutor().execute(new Runnable() { @Override public void run() { IDMContext found = null; IGDBSynchronizer fGdbSync = getServicesTracker().getService(IGDBSynchronizer.class); Object[] elems = fGdbSync.getFocus(); for (Object elem : elems) { if (elem instanceof IExecutionDMContext) { found = (IDMContext)elem; break; } } final IDMContext newThread = found; if (newThread != null) { getVMCIndexForDmc( ThreadVMNode.this, newThread, parentDelta, new DataRequestMonitor<Integer>(getExecutor(), rm) { @Override protected void handleCompleted() { if (isSuccess()) { final int threadOffset = getData(); parentDelta.addNode( createVMContext(newThread), nodeOffset + threadOffset, IModelDelta.SELECT | IModelDelta.FORCE ); rm.done(); } } }); } } }); }

Target:
private void buildDeltaForFocusChangedEvent(VMDelta parentDelta, int nodeOffset, RequestMonitor rm) { getSession().getExecutor().execute(new DsfRunnable() { @Override public void run() { IDMContext found = null; IGDBSynchronizer fGdbSync = getServicesTracker().getService(IGDBSynchronizer.class); Object[] elems = fGdbSync.getFocus(); for (Object elem : elems) { if (elem instanceof IExecutionDMContext) { found = (IDMContext)elem; break; } } final IDMContext newThread = found; if (newThread != null) { getVMCIndexForDmc( ThreadVMNode.this, newThread, parentDelta, new DataRequestMonitor<Integer>(getExecutor(), rm) { @Override protected void handleSuccess() { final int threadOffset = getData(); parentDelta.addNode(createVMContext(newThread), nodeOffset + threadOffset, IModelDelta.SELECT | IModelDelta.FORCE); rm.done(); } }); } else { rm.done(new Status(IStatus.ERROR, GdbUIPlugin.PLUGIN_ID, "ThreadVMNode, Unable to resolve thread context for focus changed event ", null)); } } }); }
Source:
public void parseBlockComments(String text) { blockComments = new ArrayList<int[]>(); StringReader buffer = new StringReader(text); int ch; boolean blkComment = false; int cnt = 0; int[] offsets = new int[2]; boolean done = false; try { while (!done) { switch (ch = buffer.read()) { case -1 : { if (blkComment) { offsets[1] = cnt; blockComments.add(offsets); } done = true; break; } case '/' : { ch = buffer.read(); if ((ch == '*') && (!blkComment)) { offsets = new int[2]; offsets[0] = cnt; blkComment = true; cnt++; } else { cnt++; } cnt++; break; } case '*' : { if (blkComment) { ch = buffer.read(); cnt++; if (ch == '/') { blkComment = false; offsets[1] = cnt; blockComments.add(offsets); } } cnt++; break; } default : { cnt++; break; } } } } catch(IOException e) { } }

Target:
public void parseBlockComments(String text) { blockComments = new ArrayList<>(); StringReader buffer = new StringReader(text); int ch; boolean blkComment = false; int cnt = 0; int[] offsets = new int[2]; boolean done = false; try { while (!done) { switch (ch = buffer.read()) { case -1 : { if (blkComment) { offsets[1] = cnt; blockComments.add(offsets); } done = true; break; } case '/' : { ch = buffer.read(); if ((ch == '*') && (!blkComment)) { offsets = new int[2]; offsets[0] = cnt; blkComment = true; cnt++; } else { cnt++; } cnt++; break; } case '*' : { if (blkComment) { ch = buffer.read(); cnt++; if (ch == '/') { blkComment = false; offsets[1] = cnt; blockComments.add(offsets); } } cnt++; break; } default : { cnt++; break; } } } } catch(IOException e) { } }
Source:
private static boolean checkFirstMiddleLastNameContents(EnExplicitFamily lastname, EnExplicitGiven firstname, EnExplicitGiven middlename, Personname personNameDBModel) { boolean namefound = false; if (lastname != null && lastname.getContent() != null) { personNameDBModel.setLastName(lastname.getContent()); LOG.info("FamilyName : " + personNameDBModel.getLastName()); namefound = true; } if (firstname != null && firstname.getContent() != null) { personNameDBModel.setFirstName(firstname.getContent()); LOG.info("GivenName(first) : " + personNameDBModel.getFirstName()); namefound = true; } if (middlename != null && middlename.getContent() != null) { personNameDBModel.setMiddleName(middlename.getContent()); LOG.info("GivenName(middle) : " + personNameDBModel.getMiddleName()); namefound = true; } return namefound; }

Target:
private static boolean checkFirstMiddleLastNameContents(EnExplicitFamily lastname, EnExplicitGiven firstname, EnExplicitGiven middlename, Personname personNameDBModel) { boolean namefound = false; if (lastname != null && lastname.getContent() != null) { personNameDBModel.setLastName(lastname.getContent()); LOG.info("FamilyName : ", personNameDBModel.getLastName()); namefound = true; } if (firstname != null && firstname.getContent() != null) { personNameDBModel.setFirstName(firstname.getContent()); LOG.info("GivenName(first) : ", personNameDBModel.getFirstName()); namefound = true; } if (middlename != null && middlename.getContent() != null) { personNameDBModel.setMiddleName(middlename.getContent()); LOG.info("GivenName(middle) : ", personNameDBModel.getMiddleName()); namefound = true; } return namefound; }
Source:
public ScenarioGridColumn build() { List<GridColumn.HeaderMetaData> headerMetaDataList = headerBuilder.build(); ScenarioGridColumnRenderer actualScenarioGridColumnRenderer = scenarioGridColumnRenderer != null ? scenarioGridColumnRenderer : new ScenarioGridColumnRenderer(); ScenarioGridColumn scenarioGridColumn = new ScenarioGridColumn(headerMetaDataList, actualScenarioGridColumnRenderer, width, isMovable, factoryCell, placeHolder ); scenarioGridColumn.setColumnWidthMode(GridColumn.ColumnWidthMode.auto); scenarioGridColumn.setMinimumWidth(width); return scenarioGridColumn; }

Target:
public ScenarioGridColumn build() { List<GridColumn.HeaderMetaData> headerMetaDataList = headerBuilder.build(); ScenarioGridColumnRenderer actualScenarioGridColumnRenderer = scenarioGridColumnRenderer != null ? scenarioGridColumnRenderer : new ScenarioGridColumnRenderer(); return new ScenarioGridColumn(headerMetaDataList, actualScenarioGridColumnRenderer, width, isMovable, factoryCell, placeHolder ); }
Source:
public Builder(String host, int port) { this.host = host; this.port = port; }

Target:
private Builder(String host, int port) { this.host = host; this.port = port; }
Source:
public void setHardwareVersion(String value) { if (!ObjectUtils.objectsEqual(hardwareVersion, value)) { hardwareVersion = StringUtils.isEmpty(value) ? constants.bracketedNotAvailableLabel() : value; onPropertyChanged(new PropertyChangedEventArgs("hardwareVersion")); } }

Target:
public void setHardwareVersion(String value) { if (!ObjectUtils.objectsEqual(hardwareVersion, value)) { hardwareVersion = value; onPropertyChanged(new PropertyChangedEventArgs("hardwareVersion")); } }
Source:
public static void createZipFile(File zipFile, List<File> files, String rootPath, IProgressMonitor monitor) throws FileNotFoundException, IOException { if (rootPath == null) { rootPath = ""; } else if (!rootPath.endsWith("\\") || !rootPath.endsWith("/")) { rootPath += "/"; } try (ZipOutputStream zipOut = new ZipOutputStream(new FileOutputStream(zipFile))) { for (File file : files) { try { addZipEntry(zipOut, rootPath, file); if (monitor != null) { monitor.worked(1); } } catch (Exception e) { StatusHandler.log(new Status(IStatus.ERROR, ICommonsCoreConstants.ID_PLUGIN, "Could not add " + file.getName() + " to zip", e)); } } } }

Target:
public static void createZipFile(File zipFile, List<File> files, String rootPath, IProgressMonitor monitor) throws FileNotFoundException, IOException { if (rootPath == null) { rootPath = ""; } else if (!rootPath.endsWith("\\") || !rootPath.endsWith("/")) { rootPath += "/"; } try (ZipOutputStream zipOut = new ZipOutputStream(new BufferedOutputStream(new FileOutputStream(zipFile)))) { for (File file : files) { try { addZipEntry(zipOut, rootPath, file); if (monitor != null) { monitor.worked(1); } } catch (Exception e) { StatusHandler.log(new Status(IStatus.ERROR, ICommonsCoreConstants.ID_PLUGIN, "Could not add " + file.getName() + " to zip", e)); } } } }
Source:
public void prepare() throws RestServiceException { if (!isOpen()) { nettyMetrics.multipartRequestAlreadyClosedError.inc(); throw new RestServiceException("Request is closed", RestServiceErrorCode.RequestChannelClosed); } else if (!readyForRead) { HttpDataFactory httpDataFactory = new DefaultHttpDataFactory(false); HttpPostMultipartRequestDecoder postRequestDecoder = new HttpPostMultipartRequestDecoder(httpDataFactory, request); try { HttpContent httpContent = rawRequestContents.peek(); while (httpContent != null) { postRequestDecoder.offer(httpContent); ReferenceCountUtil.release(rawRequestContents.poll()); httpContent = rawRequestContents.peek(); } for (InterfaceHttpData part : postRequestDecoder.getBodyHttpDatas()) { processPart(part); } allArgsReadOnly = Collections.unmodifiableMap(allArgs); requestContents.add(LastHttpContent.EMPTY_LAST_CONTENT); readyForRead = true; } catch (HttpPostRequestDecoder.ErrorDataDecoderException e) { nettyMetrics.multipartRequestDecodeError.inc(); throw new RestServiceException("There was an error decoding the request", e, RestServiceErrorCode.MalformedRequest); } finally { postRequestDecoder.destroy(); } } }

Target:
public void prepare() throws RestServiceException { if (!isOpen()) { nettyMetrics.multipartRequestAlreadyClosedError.inc(); throw new RestServiceException("Request is closed", RestServiceErrorCode.RequestChannelClosed); } else if (!readyForRead) { HttpDataFactory httpDataFactory = new DefaultHttpDataFactory(false); HttpPostMultipartRequestDecoder postRequestDecoder = new HttpPostMultipartRequestDecoder(httpDataFactory, request); try { HttpContent httpContent = rawRequestContents.poll(); while (httpContent != null) { try { if (httpContent != request) { postRequestDecoder.offer(httpContent); } } finally { ReferenceCountUtil.release(httpContent); } httpContent = rawRequestContents.poll(); } for (InterfaceHttpData part : postRequestDecoder.getBodyHttpDatas()) { processPart(part); } allArgsReadOnly = Collections.unmodifiableMap(allArgs); requestContents.add(LastHttpContent.EMPTY_LAST_CONTENT); readyForRead = true; } catch (HttpPostRequestDecoder.ErrorDataDecoderException e) { nettyMetrics.multipartRequestDecodeError.inc(); throw new RestServiceException("There was an error decoding the request", e, RestServiceErrorCode.MalformedRequest); } finally { postRequestDecoder.destroy(); } } }
Source:
private void transferObjects(final Transferrer transferrer, final Objects objects) throws SignatureException, IOException, XmlProcessingException { final ListeningExecutorService service = MoreExecutors.listeningDecorator(Executors.newFixedThreadPool(this.maxParallelRequests)); try { final Ds3Client client = this.clientFactory.GetClientForNodeId(objects.getNodeId()); final List<ListenableFuture<?>> tasks = new ArrayList<>(); for (final BulkObject ds3Object : objects) { tasks.add(this.createTransferTask(transferrer, service, client, ds3Object)); } this.executeWithExceptionHandling(tasks); } finally { service.shutdown(); } }

Target:
private void transferObjects(final Transferrer transferrer, final Objects objects) throws SignatureException, IOException, XmlProcessingException { final ListeningExecutorService service = MoreExecutors.listeningDecorator(Executors.newFixedThreadPool(this.maxParallelRequests)); try { final Ds3Client client = this.clientFactory.getClientForNodeId(objects.getNodeId()); final List<ListenableFuture<?>> tasks = new ArrayList<>(); for (final BulkObject ds3Object : objects) { tasks.add(this.createTransferTask(transferrer, service, client, ds3Object)); } this.executeWithExceptionHandling(tasks); } finally { service.shutdown(); } }
Source:
private void refreshDisplayPane() { JPanel pdfImagePanel = pdfDisplay.drawPreviewOnJPanel(); if(PDFDisplay.isDisableNextFlag()){ jButton2.setEnabled(false); } else{ jButton2.setEnabled(true); } if(PDFDisplay.isDisablePrevFlag()){ jButton1.setEnabled(false); } else{ jButton1.setEnabled(true); } if (pdfImagePanel != null) { JViewport vp = jScrollPane1.getViewport(); Point p = vp.getViewPosition(); vp.setView(pdfImagePanel); vp.setViewPosition(p); } jTextField1.setText(String.valueOf(pdfDisplay.getSelectedPage())); jLabel2.setText("of " + pdfDisplay.getTotalPages()); }

Target:
private void refreshDisplayPane() { JPanel pdfImagePanel = pdfDisplay.drawPreviewOnJPanel(); if (pdfImagePanel != null) { JViewport vp = jScrollPane1.getViewport(); Point p = vp.getViewPosition(); vp.setView(pdfImagePanel); vp.setViewPosition(p); } jTextField1.setText(String.valueOf(pdfDisplay.getSelectedPage())); jLabel2.setText("of " + pdfDisplay.getTotalPages()); }
Source:
private void validateConfiguration(RealmConfiguration newConfiguration) { if (configuration.equals(newConfiguration)) { return; } if (!Arrays.equals(configuration.getEncryptionKey(), newConfiguration.getEncryptionKey())) { throw new IllegalArgumentException(DIFFERENT_KEY_MESSAGE); } else { RealmMigration newMigration = newConfiguration.getMigration(); RealmMigration oldMigration = configuration.getMigration(); if (oldMigration != null && newMigration != null && oldMigration.getClass().equals(newMigration.getClass())) { throw new IllegalArgumentException("Configurations cannot be different if used to open the same file. " + "The most likely cause are that equals() and hashCode() are not overridden in the " + "migration class: " + newConfiguration.getMigration().getClass().getCanonicalName()); } throw new IllegalArgumentException("Configurations cannot be different if used to open the same file. " + "\nCached configuration: \n" + configuration + "\n\nNew configuration: \n" + newConfiguration); } }

Target:
private void validateConfiguration(RealmConfiguration newConfiguration) { if (configuration.equals(newConfiguration)) { return; } if (!Arrays.equals(configuration.getEncryptionKey(), newConfiguration.getEncryptionKey())) { throw new IllegalArgumentException(DIFFERENT_KEY_MESSAGE); } else { RealmMigration newMigration = newConfiguration.getMigration(); RealmMigration oldMigration = configuration.getMigration(); if (oldMigration != null && newMigration != null && oldMigration.getClass().equals(newMigration.getClass()) && !newMigration.equals(oldMigration)) { throw new IllegalArgumentException("Configurations cannot be different if used to open the same file. " + "The most likely cause is that equals() and hashCode() are not overridden in the " + "migration class: " + newConfiguration.getMigration().getClass().getCanonicalName()); } throw new IllegalArgumentException("Configurations cannot be different if used to open the same file. " + "\nCached configuration: \n" + configuration + "\n\nNew configuration: \n" + newConfiguration); } }
Source:
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { try { IWorkspaceRunnable op = new IWorkspaceRunnable() { @Override public void run(IProgressMonitor monitor) throws CoreException { IConfigurationElement[] projects = sample.getChildren("project"); SubMonitor subMonitor = SubMonitor.convert(monitor, PDEUIMessages.SampleOperation_creating, projects.length); createdProjects = new IProject[projects.length]; try { for (int i = 0; i < projects.length; i++) { IFile file = importProject(projectNames[i], projects[i], subMonitor.newChild(1)); if (file != null && sampleManifest == null) sampleManifest = file; if (file != null) { createdProjects[i] = file.getProject(); } if (cancel) break; } } catch (InterruptedException e) { throw new OperationCanceledException(); } catch (InvocationTargetException e) { throwCoreException(e); } } }; PDEPlugin.getWorkspace().run(op, monitor); } catch (CoreException e) { throw new InvocationTargetException(e); } catch (OperationCanceledException e) { throw e; } }

Target:
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { try { ICoreRunnable op = new ICoreRunnable() { @Override public void run(IProgressMonitor monitor) throws CoreException { IConfigurationElement[] projects = sample.getChildren("project"); SubMonitor subMonitor = SubMonitor.convert(monitor, PDEUIMessages.SampleOperation_creating, projects.length); createdProjects = new IProject[projects.length]; try { for (int i = 0; i < projects.length; i++) { IFile file = importProject(projectNames[i], projects[i], subMonitor.newChild(1)); if (file != null && sampleManifest == null) sampleManifest = file; if (file != null) { createdProjects[i] = file.getProject(); } if (cancel) break; } } catch (InterruptedException e) { throw new OperationCanceledException(); } catch (InvocationTargetException e) { throwCoreException(e); } } }; PDEPlugin.getWorkspace().run(op, monitor); } catch (CoreException e) { throw new InvocationTargetException(e); } catch (OperationCanceledException e) { throw e; } }
Source:
private Boolean hasMemberJoinedCluster(Entity member) { return Optional.fromNullable(member.getAttribute(RiakNode.RIAK_NODE_HAS_JOINED_CLUSTER)).or(Boolean.FALSE); }

Target:
private boolean hasMemberJoinedCluster(Entity member) { return ((RiakNode) member).hasJoinedCluster(); }
Source:
public InputStream searchJSON(Context context, DiscoverQuery discoveryQuery, String jsonIdentifier) throws SearchServiceException { if(getSolr() == null) { return null; } SolrQuery solrQuery = resolveToSolrQuery(context, discoveryQuery, false); solrQuery.setParam("json.nl", "map"); solrQuery.setParam("json.wrf", jsonIdentifier); solrQuery.setParam(CommonParams.WT, "json"); StringBuilder urlBuilder = new StringBuilder(); urlBuilder.append(getSolr().getBaseURL()).append("/select"); NamedList<Object> solrParameters = solrQuery.toNamedList(); List<NameValuePair> postParameters = new ArrayList<>(); for (Map.Entry<String, Object> solrParameter : solrParameters) { if (solrParameter.getValue() instanceof String[]) { for(String val : (String[])solrParameter.getValue()) { postParameters.add(new BasicNameValuePair(solrParameter.getKey(), val)); } } else if(solrParameter.getValue() instanceof String) {postParameters.add(new BasicNameValuePair(solrParameter.getKey(), solrParameter.getValue().toString())); } else { } } try { HttpPost post = new HttpPost(urlBuilder.toString()); post.setEntity(new UrlEncodedFormEntity(postParameters)); HttpResponse response = new DefaultHttpClient().execute(post); return response.getEntity().getContent(); } catch (Exception e) { log.error("Error while getting json solr result for discovery search recommendation", e); } return null; }

Target:
public InputStream searchJSON(Context context, DiscoverQuery discoveryQuery, String jsonIdentifier) throws SearchServiceException { if(getSolr() == null) { return null; } SolrQuery solrQuery = resolveToSolrQuery(context, discoveryQuery, false); solrQuery.setParam("json.nl", "map"); solrQuery.setParam("json.wrf", jsonIdentifier); solrQuery.setParam(CommonParams.WT, "json"); StringBuilder urlBuilder = new StringBuilder(); urlBuilder.append(getSolr().getBaseURL()).append("/select"); NamedList<Object> solrParameters = solrQuery.toNamedList(); List<NameValuePair> postParameters = new ArrayList<>(); for (Map.Entry<String, Object> solrParameter : solrParameters) { if (solrParameter.getValue() instanceof String[]) { for(String val : (String[])solrParameter.getValue()) { postParameters.add(new BasicNameValuePair(solrParameter.getKey(), val)); } } else if(solrParameter.getValue() instanceof String) { postParameters.add(new BasicNameValuePair(solrParameter.getKey(), solrParameter.getValue().toString())); } else { log.warn("Search parameters contain non-string value: " + solrParameter.getValue().toString()); } } try { HttpPost post = new HttpPost(urlBuilder.toString()); post.setEntity(new UrlEncodedFormEntity(postParameters)); HttpResponse response = new DefaultHttpClient().execute(post); return response.getEntity().getContent(); } catch (Exception e) { log.error("Error while getting json solr result for discovery search recommendation", e); } return null; }
Source:
public Boolean getDockerPrivilegedMode() { return dockerPrivilegedMode != null ? dockerPrivilegedMode : false; }

Target:
public Boolean getDockerPrivilegedMode() { return dockerPrivilegedMode; }
Source:
public String fetchEvents(String tenantId, Map<String, List<String>> query) throws IOException { String url = String.format("%s/%s/%s/_search?routing=%s", baseUrl, EventElasticSearchIO.EVENT_INDEX, EventElasticSearchIO.ES_TYPE, tenantId); HttpPost httpPost = new HttpPost(url); httpPost.setHeaders(getHeaders()); String queryDslString = getDslString(query); CloseableHttpResponse response = null; try { HttpEntity httpEntity = new NStringEntity(queryDslString, ContentType.APPLICATION_JSON); httpPost.setEntity(httpEntity); response = closeableHttpClient.execute(httpPost); String str = EntityUtils.toString(response.getEntity()); EntityUtils.consume(response.getEntity()); return str; } catch(Exception e){ if((e instanceof HttpResponseException) && (response != null)) logger.error("Status code: " + response.getStatusLine().getStatusCode() + " with msg: " + e.getMessage()); throw new RuntimeException(e.getMessage(), e); } finally { response.close(); } }

Target:
public String fetchEvents(String tenantId, Map<String, List<String>> query) throws IOException { String tempUrl = String.format("%s/%s/%s/_search?routing=%s&size=%d", getBaseUrl(), EventElasticSearchIO.EVENT_INDEX, EventElasticSearchIO.ES_TYPE, tenantId, MAX_RESULT_LIMIT); String queryDslString = getDslString(tenantId, query); HttpEntity httpEntity = new NStringEntity(queryDslString, ContentType.APPLICATION_JSON); Queue<String> callQ = new LinkedList<>(); callQ.add(tempUrl); int callCount = 0; while(!callQ.isEmpty() && callCount < MAX_CALL_COUNT) { callCount++; String url = callQ.remove(); logger.info("Using url [{}]", url); HttpPost httpPost = new HttpPost(url); httpPost.setHeaders(getHeaders()); CloseableHttpResponse response = null; try { httpPost.setEntity(httpEntity); response = closeableHttpClient.execute(httpPost); String str = EntityUtils.toString(response.getEntity()); EntityUtils.consume(response.getEntity()); return str; } catch (Exception e) { if(response == null){ logger.error("fetchEvents failed with message: {}", e.getMessage()); url = String.format("%s/%s/%s/_search?routing=%s&size=%d", getBaseUrl(), EventElasticSearchIO.EVENT_INDEX, EventElasticSearchIO.ES_TYPE, tenantId, MAX_RESULT_LIMIT); callQ.add(url); } else { logger.error("fetchEvents failed with status code: and exception message: {}", response.getStatusLine().getStatusCode(), e.getMessage()); } } finally { if(response != null) { response.close(); } } } return ""; }
Source:
public void init(){ OriginalImage = new Image("/DataExamples/Mona_Lisa.png"); final int w = (int) OriginalImage.getWidth(); final int h = (int) OriginalImage.getHeight(); composition = new WritableImage(w, h); ds = generateDataSet(OriginalImage); nn = CreateNN(); int numPoints = h * w; xyOut = Nd4j.zeros(numPoints, 2); for (int i = 0; i < w; i++) { double xp = (double) i / (double) (w - 1); for (int j = 0; j < h; j++) { int index = i + w * j; double yp = (double) j / (double) (h - 1); xyOut.put(index, 0, xp); xyOut.put(index, 1, yp); } } DrawImage(); }

Target:
public void init(){ originalImage = new Image("/DataExamples/Mona_Lisa.png"); final int w = (int) originalImage.getWidth(); final int h = (int) originalImage.getHeight(); composition = new WritableImage(w, h); ds = generateDataSet(originalImage); nn = createNN(); int numPoints = h * w; xyOut = Nd4j.zeros(numPoints, 2); for (int i = 0; i < w; i++) { double xp = (double) i / (double) (w - 1); for (int j = 0; j < h; j++) { int index = i + w * j; double yp = (double) j / (double) (h - 1); xyOut.put(index, 0, xp); xyOut.put(index, 1, yp); } } drawImage(); }
Source:
private boolean addGitHubCommitter(Channel channel, User sender, String collaborator, String justForThisRepo) { boolean result = false; if (!isSenderAuthorized(channel,sender)) { insufficientPermissionError(channel); return false; } OutputChannel out = channel.send(); try { if (justForThisRepo == null) { out.message("I'm not longer managing the Everyone team. Please add committers to specific repos."); return false; } GitHub github = GitHub.connect(); GHUser c = github.getUser(collaborator); GHOrganization o = github.getOrganization(IrcBotConfig.GITHUB_ORGANIZATION); final GHTeam t; GHRepository forThisRepo = o.getRepository(justForThisRepo); if (forThisRepo == null) { out.message("Could not find repository: "+justForThisRepo); return false; } t = getOrCreateRepoLocalTeam(o, forThisRepo, null); if (t==null) { out.message("No team for "+justForThisRepo); return false; } t.add(c); String successMsg = "Added "+collaborator+" as a GitHub committer for repository " + justForThisRepo; out.message(successMsg); result = true; } catch (IOException e) { out.message("Failed to add user to team: "+e.getMessage()); e.printStackTrace(); } return result; }

Target:
private boolean addGitHubCommitter(Channel channel, User sender, String collaborator, String justForThisRepo) { boolean result = false; if (!isSenderAuthorized(channel,sender)) { insufficientPermissionError(channel); return false; } OutputChannel out = channel.send(); try { if (justForThisRepo == null) { out.message("I'm not longer managing the Everyone team. Please add committers to specific repos."); return false; } GitHub github = GitHub.connect(); GHUser c = github.getUser(collaborator); GHOrganization o = github.getOrganization(IrcBotConfig.GITHUB_ORGANIZATION); final GHTeam t; GHRepository forThisRepo = o.getRepository(justForThisRepo); if (forThisRepo == null) { out.message("Could not find repository: "+justForThisRepo); return false; } t = getOrCreateRepoLocalTeam(o, forThisRepo, emptyList()); t.add(c); out.message("Added " + collaborator + " as a GitHub committer for repository " + justForThisRepo); result = true; } catch (IOException e) { out.message("Failed to add user to team: "+e.getMessage()); e.printStackTrace(); } return result; }
Source:
public void generateReport_DisplaysContentAsEscapedText() { setUpWithJson(HTML_JSON); page = new FeatureReportPage(reportResult, configuration, features.get(0)); page.generatePage(); DocumentAssertion document = documentFrom(page.getWebPage()); assertThat(document.getFeature().getDescription()) .isEqualTo("<b>a bold statement</b>"); assertThat(document.getFeature().getElements()[0].getDescription()) .isEqualTo("<b>a bold statement</b>"); assertThat(document.getFeature().getElements()[0].getStepsSection().getSteps()[0].getDocString().text()) .isEqualTo("Doc string <b>a bold\nstatement</b>"); assertThat(document.getFeature().getElements()[0].getStepsSection().getSteps()[1].getArgumentsTable().getBodyRow().getCellsValues()[0]) .isEqualTo("<b>bold</b>"); }

Target:
public void generateReport_DisplaysContentAsEscapedText() { page = new FeatureReportPage(reportResult, configuration, features.get(1)); page.generatePage(); DocumentAssertion document = documentFrom(page.getWebPage()); assertThat(document.getFeature().getDescription()) .isEqualTo("As an Account Holder I want to withdraw cash from an ATM,<br>so that I can get money when the bank is closed"); assertThat(document.getFeature().getElements()[0].getStepsSection().getSteps()[5].getEmbedding()[3].text()) .isEqualTo("Attachment 4 (HTML) <i>Hello</i> <b>World!</b>"); assertThat(document.getFeature().getElements()[0].getStepsSection().getSteps()[5].getMessage().text()) .isEqualTo("Error message java.lang.AssertionError: \n" + "Expected: is <80>\n" + " got: <90>\n" + "\n" + "\tat org.junit.Assert.assertThat(Assert.java:780)\n" + "\tat org.junit.Assert.assertThat(Assert.java:738)\n" + "\tat net.masterthought.example.ATMScenario.checkBalance(ATMScenario.java:69)\n" + "\tat ✽.And the account balance should be 90(net/masterthought/example/ATMK.feature:12)"); }