auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public Map<String, MetricPlotDTO> createTaskPlots() { String sessionId = getSessionIdProvider().getSessionId(); List<MetricDetails> metricDetails= getHibernateTemplate().find( "select m from MetricDetails m where m.taskData.sessionId=? and m.metric=?", sessionId, metricName); Map<String, List<MetricDetails>> aggregatedByTasks = Maps.newLinkedHashMap(); for (MetricDetails detail : metricDetails) { List<MetricDetails> taskData = aggregatedByTasks.get(detail.getTaskData().getTaskId()); if (taskData == null) { taskData = new LinkedList<MetricDetails>(); aggregatedByTasks.put(detail.getTaskData().getTaskId(),taskData); } taskData.add(detail); } Map<String, MetricPlotDTO> taskPlots = Maps.newHashMap(); for (String taskId : aggregatedByTasks.keySet()) { MetricPlotDTO taskPlot = new MetricPlotDTO(); List<MetricDetails> taskStats = aggregatedByTasks.get(taskId); XYSeries plotEntry = new XYSeries(metricName); <START> String taskName = null; <END> for (MetricDetails stat : taskStats) { if (taskName == null) { taskName = stat.getTaskData().getTaskName(); } plotEntry.add(stat.getTime(), stat.getValue()); } XYSeriesCollection plotCollection = new XYSeriesCollection(); plotCollection.addSeries(plotEntry); Pair<String, XYSeriesCollection> pair = ChartHelper.adjustTime(plotCollection, null); plotCollection = pair.getSecond(); JFreeChart chartMetric = ChartHelper.createXYChart(null, plotCollection, "Time (" + pair.getFirst() + ")", metricName, 2, 2, ChartHelper.ColorTheme.LIGHT); taskPlot.setPlot(new JCommonDrawableRenderer(chartMetric)); taskPlots.put(taskId, taskPlot); } return taskPlots; }</code><technical_language>do need String taskName</technical_language>

Target:
public Map<String, MetricPlotDTO> createTaskPlots() { String sessionId = getSessionIdProvider().getSessionId(); List<MetricDetails> metricDetails= getHibernateTemplate().find( "select m from MetricDetails m where m.taskData.sessionId=? and m.metric=?", sessionId, metricName); Map<String, List<MetricDetails>> aggregatedByTasks = Maps.newLinkedHashMap(); for (MetricDetails detail : metricDetails) { List<MetricDetails> taskData = aggregatedByTasks.get(detail.getTaskData().getTaskId()); if (taskData == null) { taskData = new LinkedList<MetricDetails>(); aggregatedByTasks.put(detail.getTaskData().getTaskId(),taskData); } taskData.add(detail); } Map<String, MetricPlotDTO> taskPlots = Maps.newHashMap(); for (String taskId : aggregatedByTasks.keySet()) { MetricPlotDTO taskPlot = new MetricPlotDTO(); List<MetricDetails> taskStats = aggregatedByTasks.get(taskId); XYSeries plotEntry = new XYSeries(metricName); for (MetricDetails stat : taskStats) { plotEntry.add(stat.getTime(), stat.getValue()); } XYSeriesCollection plotCollection = new XYSeriesCollection(); plotCollection.addSeries(plotEntry); Pair<String, XYSeriesCollection> pair = ChartHelper.adjustTime(plotCollection, null); plotCollection = pair.getSecond(); JFreeChart chartMetric = ChartHelper.createXYChart(null, plotCollection, "Time (" + pair.getFirst() + ")", metricName, 2, 2, ChartHelper.ColorTheme.LIGHT); taskPlot.setPlot(new JCommonDrawableRenderer(chartMetric)); taskPlots.put(taskId, taskPlot); } return taskPlots; }
Source:
<code>public ListFactoryBean pooledLdapConnectionFactoryHealthIndicatorListFactoryBean() { val list = new ListFactoryBean() { @Override protected void destroyInstance(final List list) { list.forEach(connectionFactory -> { ((ConnectionFactory) connectionFactory).close(); }); } }; <START> list.setSourceList(new ArrayList()); <END> return list; }</code><technical_language>suggestion list.setSourceList(new ArrayList<>());</technical_language>

Target:
public ListFactoryBean pooledLdapConnectionFactoryHealthIndicatorListFactoryBean() { val list = new ListFactoryBean() { @Override protected void destroyInstance(final List list) { list.forEach(connectionFactory -> ((ConnectionFactory) connectionFactory).close() ); } }; list.setSourceList(new ArrayList<>()); return list; }
Source:
<code>public RealtimeTableDataManager(Semaphore segmentBuildSemaphore) { _segmentBuildSemaphore = segmentBuildSemaphore; <START> _upsertMetadataTableManager = new UpsertMetadataTableManager(); <END> }</code><technical_language>This initialized upsert is enabled, addSegment() pass non-null UpsertMetadataTableManager, enable upsert for segments</technical_language>

Target:
public RealtimeTableDataManager(Semaphore segmentBuildSemaphore) { _segmentBuildSemaphore = segmentBuildSemaphore; }
Source:
<code><START> public boolean belowMemThreshold() { <END> if (mDatabaseFile.exists()) { return Math.min(mDatabaseFile.getUsableSpace(), 20 * 1024 * 1024) >= mDatabaseFile.length(); } return true; }</code><technical_language>I this logic, I wish MPDbAdapter responsible for knowing is much? provide MPDbAdapter.getUsableSpace MPDbAdapter.fileSize, comparison logic in AnalyticsMessages</technical_language>

Target:
public boolean belowMemThreshold() { if (mDatabaseFile.exists()) { return Math.max(mDatabaseFile.getUsableSpace(), mConfig.getMinimumDatabaseLimit()) >= mDatabaseFile.length(); } return true; }
Source:
<code>public void testMapFunctionWithNumberItemAndCountFunction() { NumberItem item1 = new NumberItem("item1"); GroupFunctionDTO gFuncDTO = new GroupFunctionDTO(); gFuncDTO.name = "COUNT"; gFuncDTO.params = new String[] { ".*hello.*" }; GroupFunction gFunc = ItemDTOMapper.mapFunction(item1, gFuncDTO); <START> assertThat(gFunc, instanceOf(ArithmeticGroupFunction.Count.class)); <END> }</code><technical_language>key change in this PR is create a StringType parameter for count function check this gFunc#getParameters</technical_language>

Target:
public void testMapFunctionWithNumberItemAndCountFunction() { NumberItem item1 = new NumberItem("item1"); GroupFunctionDTO gFuncDTO = new GroupFunctionDTO(); gFuncDTO.name = "COUNT"; gFuncDTO.params = new String[] { ".*hello.*" }; GroupFunction gFunc = ItemDTOMapper.mapFunction(item1, gFuncDTO); assertThat(gFunc, instanceOf(ArithmeticGroupFunction.Count.class)); assertThat(gFunc.getParameters().length, is(1)); assertThat(gFunc.getParameters()[0], instanceOf(StringType.class)); }
Source:
<code>void onBind(DriveListItem item) { String dateModified = null; if (item.getDate() != null) { try { dateModified = new SimpleDateFormat(getContext().getString( R.string.modified_on_date_at_time), Locale.getDefault()) .format(new Date(item.getDate().getValue())); } catch (IllegalArgumentException e) { Timber.e(e); } } if (item.getType() == DriveListItem.FILE) { Drawable d = ContextCompat.getDrawable(getContext(), R.drawable.form_state_blank); imageView.setImageDrawable(d); checkBox.setVisibility(View.VISIBLE); if (isNewVersion(item)) { <START> formUpdateAlert.setVisibility(View.VISIBLE); <END> } else { formUpdateAlert.setVisibility(View.GONE); } } else { Drawable d = ContextCompat.getDrawable(getContext(), R.drawable.ic_folder); imageView.setImageDrawable(d); checkBox.setVisibility(View.GONE); formUpdateAlert.setVisibility(View.GONE); } formTitle.setText(item.getName()); formSubtitle.setText(dateModified); checkBox.setChecked(item.isSelected()); }</code><technical_language>view is default need set avoid problem while scrolling elements reused I right</technical_language>

Target:
void onBind(DriveListItem item) { String dateModified = null; if (item.getDate() != null) { try { dateModified = new SimpleDateFormat(getContext().getString( R.string.modified_on_date_at_time), Locale.getDefault()) .format(new Date(item.getDate().getValue())); } catch (IllegalArgumentException e) { Timber.e(e); } } if (item.getType() == DriveListItem.FILE) { Drawable d = ContextCompat.getDrawable(getContext(), R.drawable.form_state_blank); imageView.setImageDrawable(d); checkBox.setVisibility(View.VISIBLE); formUpdateAlert.setVisibility(item.isNewerVersion() ? View.VISIBLE : View.GONE); } else { Drawable d = ContextCompat.getDrawable(getContext(), R.drawable.ic_folder); imageView.setImageDrawable(d); checkBox.setVisibility(View.GONE); formUpdateAlert.setVisibility(View.GONE); } formTitle.setText(item.getName()); formSubtitle.setText(dateModified); checkBox.setChecked(item.isSelected()); }
Source:
<code>public static Double lineLocatePoint(@SqlType(GEOMETRY_TYPE_NAME) Slice lineSlice, @SqlType(GEOMETRY_TYPE_NAME) Slice pointSlice) { Geometry line = JtsGeometrySerde.deserialize(lineSlice); Geometry point = JtsGeometrySerde.deserialize(pointSlice); if (line.isEmpty() || point.isEmpty()) { return null; } <START> GeometrySerializationType lineType = getForJtsGeometryType(line.getGeometryType()); <END> if (lineType != LINE_STRING && lineType != MULTI_LINE_STRING) { throw new PrestoException(INVALID_FUNCTION_ARGUMENT, format("First argument to line_locate_point must be a LineString or a MultiLineString. Got: %s", line.getGeometryType())); } GeometrySerializationType pointType = getForJtsGeometryType(point.getGeometryType()); if (pointType != POINT) { throw new PrestoException(INVALID_FUNCTION_ARGUMENT, format("Second argument to line_locate_point must be a Point. Got: %s", point.getGeometryType())); } return new LengthIndexedLine(line).indexOf(point.getCoordinate()); }</code><technical_language>ditto, in this file</technical_language>

Target:
public static Double lineLocatePoint(@SqlType(GEOMETRY_TYPE_NAME) Slice lineSlice, @SqlType(GEOMETRY_TYPE_NAME) Slice pointSlice) { Geometry line = JtsGeometrySerde.deserialize(lineSlice); Geometry point = JtsGeometrySerde.deserialize(pointSlice); if (line.isEmpty() || point.isEmpty()) { return null; } GeometryType lineType = GeometryType.getForJtsGeometryType(line.getGeometryType()); if (lineType != GeometryType.LINE_STRING && lineType != GeometryType.MULTI_LINE_STRING) { throw new PrestoException(INVALID_FUNCTION_ARGUMENT, format("First argument to line_locate_point must be a LineString or a MultiLineString. Got: %s", line.getGeometryType())); } GeometryType pointType = GeometryType.getForJtsGeometryType(point.getGeometryType()); if (pointType != GeometryType.POINT) { throw new PrestoException(INVALID_FUNCTION_ARGUMENT, format("Second argument to line_locate_point must be a Point. Got: %s", point.getGeometryType())); } return new LengthIndexedLine(line).indexOf(point.getCoordinate()); }
Source:
<code>public void handleColumnMultiEdit(TreeColumn treeColumn, Collection<TreeItem> treeItems) { super.handleColumnMultiEdit(treeColumn, treeItems); String colName = treeColumn.getText(); if (EXTRA_COLUMNS.contains(colName)) { AWorkbench.popup("ERROR", "Can't change the field " + colName); <START> } <END> try { IAttributeType attributeType = null; try { attributeType = AttributeTypeManager.getType(colName); } catch (OseeTypeDoesNotExist ex) { } if (attributeType != null) { Set<Artifact> artifacts = new HashSet<>(); for (TreeItem item : treeItems) { artifacts.add((Artifact) item.getData()); } if (ArtifactPromptChange.promptChangeAttribute(attributeType, artifacts, false)) { refresh(); editor.onDirtied(); } } } catch (OseeCoreException ex) { OseeLog.log(Activator.class, OseeLevel.SEVERE_POPUP, ex); } }</code><technical_language>avoid "flow-control exception" typeExists: try { if (AttributeTypeManager.typeExists(colName)) { Set<Artifact> artifacts = new HashSet<>(); for (TreeItem item : treeItems) { artifacts.add((Artifact) item.getData()); } if (ArtifactPromptChange.promptChangeAttribute(AttributeTypeManager.getType(colName), artifacts, false)) { refresh(); editor.onDirtied(); } } }</technical_language>

Target:
public void handleColumnMultiEdit(TreeColumn treeColumn, Collection<TreeItem> treeItems) { super.handleColumnMultiEdit(treeColumn, treeItems); String colName = treeColumn.getText(); if (EXTRA_COLUMNS.contains(colName)) { AWorkbench.popup("ERROR", "Can't change the field " + colName); } try { if (AttributeTypeManager.typeExists(colName)) { IAttributeType attributeType = AttributeTypeManager.getType(colName); Set<Artifact> artifacts = new HashSet<>(); for (TreeItem item : treeItems) { artifacts.add((Artifact) item.getData()); } if (ArtifactPromptChange.promptChangeAttribute(attributeType, artifacts, false)) { refresh(); editor.onDirtied(); } } } catch (OseeCoreException ex) { OseeLog.log(Activator.class, OseeLevel.SEVERE_POPUP, ex); } }
Source:
<code>public List<StoredWorkflowDefinition> insertWorkflowDefinitions( StoredRevision revision, List<WorkflowDefinition> defs, SchedulerManager srm, Instant currentTime) throws ResourceConflictException { List<StoredWorkflowDefinition> list = insertWorkflowDefinitionsWithoutSchedules(revision, defs); updateSchedules(revision, list, srm, currentTime); <START> validateSla(defs); <END> return list; }</code><technical_language>in case, if validation fail, updateSchedules() cancelled ? If this method is called in transaction updateSchedules() side effect Pg, I guess is OK</technical_language>

Target:
public List<StoredWorkflowDefinition> insertWorkflowDefinitions( StoredRevision revision, List<WorkflowDefinition> defs, SchedulerManager srm, Instant currentTime) throws ResourceConflictException { validateSla(defs); List<StoredWorkflowDefinition> list = insertWorkflowDefinitionsWithoutSchedules(revision, defs); updateSchedules(revision, list, srm, currentTime); return list; }
Source:
<code>static LabelTypes getLegacyTypes(ReviewDb db) throws SQLException { List<LabelType> types = Lists.newArrayListWithCapacity(2); Statement catStmt = null; PreparedStatement valStmt = null; ResultSet catRs = null; try { catStmt = ((JdbcSchema) db).getConnection().createStatement(); catRs = catStmt.executeQuery( "SELECT category_id, name, abbreviated_name, function_name, " + " copy_min_score" + " FROM approval_categories" + " ORDER BY position, name"); valStmt = ((JdbcSchema) db).getConnection().prepareStatement( <START> "SELECT name, value" <END> + " FROM approval_category_values" + " WHERE category_id = ?"); while (catRs.next()) { String id = catRs.getString("category_id"); valStmt.setString(1, id); List<LabelValue> values = Lists.newArrayListWithCapacity(5); ResultSet valRs = valStmt.executeQuery(); try { while (valRs.next()) { values.add(new LabelValue( valRs.getShort("value"), valRs.getString("name"))); } } finally { valRs.close(); } LabelType type = new LabelType(getLabelName(catRs.getString("name")), values); type.setId(id); type.setAbbreviatedName(catRs.getString("abbreviated_name")); type.setFunctionName(catRs.getString("function_name")); type.setCopyMinScore(catRs.getBoolean("copy_min_score")); types.add(type); } } finally { if (valStmt != null) { valStmt.close(); } if (catRs != null) { catRs.close(); } if (catStmt != null) { catStmt.close(); } } return new LabelTypes(types); }</code><technical_language>Some JDBC drivers funny. Try name columns in select statement in order consume in, value, name</technical_language>

Target:
static LabelTypes getLegacyTypes(ReviewDb db) throws SQLException { List<LabelType> types = Lists.newArrayListWithCapacity(2); Statement catStmt = null; PreparedStatement valStmt = null; ResultSet catRs = null; try { catStmt = ((JdbcSchema) db).getConnection().createStatement(); catRs = catStmt.executeQuery( "SELECT category_id, name, abbreviated_name, function_name, " + " copy_min_score" + " FROM approval_categories" + " ORDER BY position, name"); valStmt = ((JdbcSchema) db).getConnection().prepareStatement( "SELECT value, name" + " FROM approval_category_values" + " WHERE category_id = ?"); while (catRs.next()) { String id = catRs.getString("category_id"); valStmt.setString(1, id); List<LabelValue> values = Lists.newArrayListWithCapacity(5); ResultSet valRs = valStmt.executeQuery(); try { while (valRs.next()) { values.add(new LabelValue( valRs.getShort("value"), valRs.getString("name"))); } } finally { valRs.close(); } LabelType type = new LabelType(getLabelName(catRs.getString("name")), values); type.setId(id); type.setAbbreviatedName(catRs.getString("abbreviated_name")); type.setFunctionName(catRs.getString("function_name")); type.setCopyMinScore("Y".equals(catRs.getString("copy_min_score"))); types.add(type); } } finally { if (valStmt != null) { valStmt.close(); } if (catRs != null) { catRs.close(); } if (catStmt != null) { catStmt.close(); } } return new LabelTypes(types); }
Source:
<code>public Response ticket(Action action) { GraphicsType graphicsType = deriveGraphicsType(); if (graphicsType == null) { Fault fault = new Fault(); fault.setReason("Operation Failed"); fault.setDetail(localize(Messages.CANNOT_GET_TICKET_FOR_DOWN_VM)); return Response.status(Response.Status.CONFLICT).entity(fault).build(); <START> } <END> String consoleId = BackendGraphicsConsoleHelper.asConsoleId(graphicsType); return getGraphicsConsolesResource().getConsoleResource(consoleId).ticket(action); }</code><technical_language>I this validation belong API. suggest modify this 'ticket' method works similar 'ticket' method in 'BackendVmGraphicsConsoleResource'. If 'graphicsType' is null, pass null 'SetVmTicket' command. command implementation check if is null, generate message. check if VM is down</technical_language>

Target:
public Response ticket(Action action) { return getTicketer(action).setTicket(deriveGraphicsType()); }
Source:
<code>public void testComputeConcurrencyFactor() { <START> int maxConccurrentRangeRequest = 32; <END> int cf = StorageProxy.RangeCommandIterator.computeConcurrencyFactor(100, 30, maxConccurrentRangeRequest, 500, 0); assertEquals(maxConccurrentRangeRequest, cf); cf = StorageProxy.RangeCommandIterator.computeConcurrencyFactor(100, 80, maxConccurrentRangeRequest, 500, 0); assertEquals(20, cf); cf = StorageProxy.RangeCommandIterator.computeConcurrencyFactor(100, 60, maxConccurrentRangeRequest, 480, 240); assertEquals(maxConccurrentRangeRequest, cf); cf = StorageProxy.RangeCommandIterator.computeConcurrencyFactor(100, 30, maxConccurrentRangeRequest, 480, 240); assertEquals(30, cf); cf = StorageProxy.RangeCommandIterator.computeConcurrencyFactor(100, 1, maxConccurrentRangeRequest, 480, 479); assertEquals(1, cf); }</code><technical_language>suggestion int maxConcurrentRangeRequest = 32;</technical_language>

Target:
public void testComputeConcurrencyFactor() { int maxConcurrentRangeRequest = 32; int cf = StorageProxy.RangeCommandIterator.computeConcurrencyFactor(100, 30, maxConcurrentRangeRequest, 500, 0); assertEquals(maxConcurrentRangeRequest, cf); cf = StorageProxy.RangeCommandIterator.computeConcurrencyFactor(100, 80, maxConcurrentRangeRequest, 500, 0); assertEquals(20, cf); cf = StorageProxy.RangeCommandIterator.computeConcurrencyFactor(100, 60, maxConcurrentRangeRequest, 480, 240); assertEquals(maxConcurrentRangeRequest, cf); cf = StorageProxy.RangeCommandIterator.computeConcurrencyFactor(100, 30, maxConcurrentRangeRequest, 480, 240); assertEquals(30, cf); cf = StorageProxy.RangeCommandIterator.computeConcurrencyFactor(100, 1, maxConcurrentRangeRequest, 480, 479); assertEquals(1, cf); }
Source:
<code>private boolean addPriorityBuffer(SequenceBuffer sequenceBuffer) throws IOException { receivedBuffers.addPriorityElement(sequenceBuffer); if (channelStatePersister.checkForBarrier(sequenceBuffer.buffer)) { <START> lastOvertakenSequenceNumber = sequenceBuffer.sequenceNumber; <END> } return receivedBuffers.getNumPriorityElements() == 1; }</code><technical_language>wrote in PR description this PR avoid numBuffersOvertaken overwritten, I a specific change in regard here. I assuming of earlier PRs helped fixing checkForBarrier</technical_language>

Target:
private boolean addPriorityBuffer(SequenceBuffer sequenceBuffer) throws IOException { receivedBuffers.addPriorityElement(sequenceBuffer); channelStatePersister .checkForBarrier(sequenceBuffer.buffer) .filter(id -> id > lastBarrierId) .ifPresent(id -> { lastBarrierId = id; lastBarrierSequenceNumber = sequenceBuffer.sequenceNumber; }); return receivedBuffers.getNumPriorityElements() == 1; }
Source:
<code>public void run() { MessageWrapper messageWrap; WebSocketPassiveScannerPlugin currentPassiveScanner; WebSocketMessageDTO currentMessage; Iterator<WebSocketPassiveScanner> iterator; while (isPassiveScannerActive){ if (messagesBuffer.isEmpty() || tableWebSocket == null) { try { Thread.sleep(SLEEP_TIME); } catch (InterruptedException e) { LOGGER.info("Sleeping was interrupted",e); } if (!isPassiveScannerActive) { <START> break; <END> } }else{ messageWrap = messagesBuffer.poll(); try { currentMessage = tableWebSocket.getMessage(messageWrap.messageId, messageWrap.channelId); iterator = passiveScannerManager.getIterator(); while (iterator.hasNext()) { currentPassiveScanner = (WebSocketPassiveScannerPlugin) iterator.next(); if (currentPassiveScanner.isEnabled()) { currentPassiveScanner.scanMessage(this, currentMessage); } } } catch (DatabaseException e) { LOGGER.warn("Could not get messages from database", e); } } } }</code><technical_language>this moved a level? this encountered</technical_language>

Target:
public void run() { MessageWrapper messageWrap; WebSocketPassiveScannerDecorator currentPassiveScanner; WebSocketMessageDTO currentMessage; Iterator<WebSocketPassiveScannerDecorator> iterator; WebSocketScanHelperImpl helper = new WebSocketScanHelperImpl(this); while (isActive) { if (messagesBuffer.isEmpty() || tableWebSocket == null) { try { Thread.sleep(SLEEP_TIME); } catch (InterruptedException e) { LOGGER.info("Sleeping was interrupted", e); } if (!isActive) { break; } } else { messageWrap = messagesBuffer.poll(); try { currentMessage = tableWebSocket.getMessage(messageWrap.messageId, messageWrap.channelId); iterator = passiveScannerManager.getIterator(); while (iterator.hasNext()) { if ((currentPassiveScanner = iterator.next()).isEnabled()) { currentPassiveScanner.scanMessage( helper.getWebSocketScanHelper( currentPassiveScanner.getId(), currentMessage), currentMessage); } } } catch (DatabaseException e) { LOGGER.warn("Could not get messages from database", e); } } } }
Source:
<code>private void writeNamedFactory(Transport transport, String factoryName, byte[][] params) { if (factoryName.isEmpty()) { <START> transport.writeByte((short) 0); <END> } else { transport.writeString(factoryName); if (params != null) { transport.writeByte((short) params.length); for (byte[] param : params) transport.writeArray(param); } else { transport.writeByte((short) 0); } } }</code><technical_language>I familiar serialization process in hotrod, pass string way? error case is if is null, right</technical_language>

Target:
private void writeNamedFactory(Transport transport, String factoryName, byte[][] params) { transport.writeString(factoryName); if (!factoryName.isEmpty()) { if (params != null) { transport.writeByte((short) params.length); for (byte[] param : params) transport.writeArray(param); } else { transport.writeByte((short) 0); } } }
Source:
<code>public void startTimer() throws ExchangeSchedulerException { m_bRunnable = true; try { getInstance().initialize(); getInstance().setName("ExchangeScheduler Thread"); getInstance().setDaemon(true); getInstance().start(); } catch (Exception e) { String sErrorMessage = "Failed to start the Exchange Scheduler. Error: " + e.getMessage(); <START> LOG.error(sErrorMessage, e); <END> throw new ExchangeSchedulerException(sErrorMessage, e); } LOG.info("ExchangeScheduler has just been started now."); }</code><technical_language>need log wrap e exception ExchangeScheduleException</technical_language>

Target:
public void startTimer() throws ExchangeSchedulerException { m_bRunnable = true; try { getInstance().initialize(); getInstance().setName("ExchangeScheduler Thread"); getInstance().setDaemon(true); getInstance().start(); } catch (Exception e) { throw new ExchangeSchedulerException("Failed to start the Exchange Scheduler: " + e.getLocalizedMessage(), e); } LOG.info("ExchangeScheduler has just been started now."); }
Source:
<code>public DataContainer toContainer() { <START> return new MemoryDataContainer().set(Keys.STATISTICS.getQuery(), this.getValue()); <END> }</code><technical_language>supposed call super.toContainer() retain necessary information data version of this manipulator</technical_language>

Target:
public DataContainer toContainer() { return super.toContainer().set(Keys.STATISTICS.getQuery(), this.getValue()); }
Source:
<code>public WhereHaving visitNotExpression(NotFilterExpression expression) { FilterExpression normalized = getNormalizationVisitor().visitNotExpression(expression); if (normalized instanceof AndFilterExpression) { return visitAndExpression((AndFilterExpression) normalized); } else if (normalized instanceof OrFilterExpression) { return visitOrExpression((OrFilterExpression) normalized); } else if (normalized instanceof NotFilterExpression) { normalized = ((NotFilterExpression) normalized).getNegated(); <START> return visitNotExpression((NotFilterExpression) normalized); <END> } else { return visitPredicate((FilterPredicate) normalized); } }</code><technical_language>This effectively drop Not. a test case for this</technical_language>

Target:
public FilterConstraints visitNotExpression(NotFilterExpression expression) { FilterExpression normalized = getNormalizationVisitor().visitNotExpression(expression); if (normalized instanceof AndFilterExpression) { return visitAndExpression((AndFilterExpression) normalized); } else if (normalized instanceof OrFilterExpression) { return visitOrExpression((OrFilterExpression) normalized); } else if (normalized instanceof NotFilterExpression) { FilterConstraints negatedConstraint = visitNotExpression((NotFilterExpression) normalized); if (negatedConstraint.isPureWhere()) { return FilterConstraints.pureWhere(new NotFilterExpression(negatedConstraint.getWhereExpression())); } else { return FilterConstraints.pureHaving(new NotFilterExpression(negatedConstraint.getHavingExpression())); } } else { return visitPredicate((FilterPredicate) normalized); } }
Source:
<code>public void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.fragment_web_dialog); final ProgressBar progress = (ProgressBar) findViewById(R.id.loading_indicator); progress.setVisibility(View.GONE); webView = (WebView) findViewById(R.id.eula_webView); final URLInterceptorWebViewClient client = new URLInterceptorWebViewClient(this, webView); client.setPageStatusListener(new URLInterceptorWebViewClient.IPageStatusListener() { @Override public void onPageStarted() { progress.setVisibility(View.VISIBLE); } @Override public void onPageFinished() { progress.setVisibility(View.GONE); } @Override public void onPageLoadError() { progress.setVisibility(View.GONE); } @Override public void onPagePartiallyLoaded() { progress.setVisibility(View.GONE); } }); webView.loadUrl(getIntent().getStringExtra(ARG_URL)); final String title = getIntent().getStringExtra(ARG_TITLE); if (!TextUtils.isEmpty(title)) { getSupportActionBar().setDisplayHomeAsUpEnabled(true); setTitle(title); } else { <START> getSupportActionBar().hide(); <END> } }</code><technical_language>want hide action bar? user navigate back</technical_language>

Target:
public void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_webview); final ProgressBar progress = (ProgressBar) findViewById(R.id.loading_indicator); progress.setVisibility(View.GONE); webView = (WebView) findViewById(R.id.eula_webView); final URLInterceptorWebViewClient client = new URLInterceptorWebViewClient(this, webView); client.setPageStatusListener(new URLInterceptorWebViewClient.IPageStatusListener() { @Override public void onPageStarted() { progress.setVisibility(View.VISIBLE); } @Override public void onPageFinished() { progress.setVisibility(View.GONE); } @Override public void onPageLoadError() { progress.setVisibility(View.GONE); } @Override public void onPagePartiallyLoaded() { progress.setVisibility(View.GONE); } }); webView.loadUrl(getIntent().getStringExtra(ARG_URL)); final String title = getIntent().getStringExtra(ARG_TITLE); if (!TextUtils.isEmpty(title)) { getSupportActionBar().setDisplayHomeAsUpEnabled(true); setTitle(title); } }
Source:
<code>public boolean update(final String key, final String rangeKey,final Map<String,byte[]> payloadByColumn) { final Map<String, AttributeValueUpdate> itemsToUpdate = new HashMap<>(); for (final String payloadColumnName : payloadByColumn.keySet()) { itemsToUpdate.put(payloadColumnName, new AttributeValueUpdate() .withValue(new AttributeValue().withB(ByteBuffer.wrap(payloadByColumn.get(payloadColumnName)))) .withAction(AttributeAction.PUT) ); } final Map<String, AttributeValue> keys = Maps.newHashMap(); keys.put(hashKeyColumnName, new AttributeValue(key)); if (rangeKeyColumnName.isPresent()) { keys.put(rangeKeyColumnName.get(),new AttributeValue(rangeKey)); } final UpdateItemRequest request = new UpdateItemRequest() .withTableName(this.tableName) .withKey(keys) .withAttributeUpdates(itemsToUpdate); try { final UpdateItemResult result = this.dynamoDBClient.updateItem(request); <START> <END> } catch (AmazonServiceException awsException) { logger.error("Server exception result for key {}, rangekey {}", awsException.getMessage(), key, rangeKey); return false; } catch (AmazonClientException acExp) { logger.error("AmazonClientException exception result for key {}, rangekey {}", acExp.getMessage(), key, rangeKey); return false; } return true; }</code><technical_language>return true a default return false for unhandled cases</technical_language>

Target:
public boolean update(final String key, final String rangeKey,final Map<String,byte[]> payloadByColumn) { final Map<String, AttributeValueUpdate> itemsToUpdate = new HashMap<>(); for (final String payloadColumnName : payloadByColumn.keySet()) { itemsToUpdate.put(payloadColumnName, new AttributeValueUpdate() .withValue(new AttributeValue().withB(ByteBuffer.wrap(payloadByColumn.get(payloadColumnName)))) .withAction(AttributeAction.PUT) ); } final Map<String, AttributeValue> keys = Maps.newHashMap(); keys.put(hashKeyColumnName, new AttributeValue(key)); if (rangeKeyColumnName.isPresent()) { keys.put(rangeKeyColumnName.get(),new AttributeValue(rangeKey)); } final UpdateItemRequest request = new UpdateItemRequest() .withTableName(this.tableName) .withKey(keys) .withAttributeUpdates(itemsToUpdate); try { final UpdateItemResult result = this.dynamoDBClient.updateItem(request); return true; } catch (AmazonServiceException awsException) { logger.error("Server exception result for key {}, rangekey {}", awsException.getMessage(), key, rangeKey); } catch (AmazonClientException acExp) { logger.error("AmazonClientException exception result for key {}, rangekey {}", acExp.getMessage(), key, rangeKey); } return false; }
Source:
<code>public void canRemoveAllBricksFromSubVolume() { <START> GlusterVolumeEntity volumeEntity = getDistributedReplacatedVolume(volumeId1, 9, 3); <END> List<GlusterBrickEntity> bricksToRemove = new ArrayList<GlusterBrickEntity>(); bricksToRemove.add(volumeEntity.getBricks().get(6)); bricksToRemove.add(volumeEntity.getBricks().get(7)); bricksToRemove.add(volumeEntity.getBricks().get(8)); ValidationResult validationResult = brickValidator.canRemoveBrick(bricksToRemove, volumeEntity, 3, false); assertTrue(validationResult.isValid()); }</code><technical_language>typo - getDistributedReplicatedVolume</technical_language>

Target:
public void canRemoveAllBricksFromSubVolume() { GlusterVolumeEntity volumeEntity = getDistributedReplicatedVolume(volumeId1, 9, 3); List<GlusterBrickEntity> bricksToRemove = new ArrayList<GlusterBrickEntity>(); bricksToRemove.add(volumeEntity.getBricks().get(6)); bricksToRemove.add(volumeEntity.getBricks().get(7)); bricksToRemove.add(volumeEntity.getBricks().get(8)); ValidationResult validationResult = brickValidator.canRemoveBrick(bricksToRemove, volumeEntity, 3, false); assertTrue(validationResult.isValid()); }
Source:
<code>public List<Project> GetProjectItems() throws ReleaseManagementException { String url = this.accountUrl + "/_apis/projects?api-version=1.0"; String response = this.ExecuteGetMethod(url); <START> TeamProject teamProject = new Gson().fromJson(response, TeamProject.class); <END> return teamProject.getValue(); }</code><technical_language>do like, values = new JSONObject(response).getString("value"); List<Project> projects = new Gson().fromJson(values, TeamProject[].class); teamproject object is representing teamproject. api returns a list of teamproject a count. want intermediate object represent that, final outcome is List<Project>. parsing field is good enough</technical_language>

Target:
public List<Project> GetProjectItems() throws ReleaseManagementException { String url = this.accountUrl + "/_apis/projects?api-version=1.0"; String response = this.ExecuteGetMethod(url); try { String values = new JSONObject(response).getString("value"); return Arrays.asList(new Gson().fromJson(values, Project[].class)); } catch (JSONException ex) { throw new ReleaseManagementException(ex); } }
Source:
<code>public EventHubClientBuilder proxyConfiguration(ProxyConfiguration proxyConfiguration) { this.proxyConfiguration = proxyConfiguration; if (proxyConfiguration != null && proxyConfiguration.isProxyAddressConfigured()) { this.transport = TransportType.AMQP_WEB_SOCKETS; <START> } <END> return this; }</code><technical_language>is a weird a side-effect this. I if do validation build time throw exception then..</technical_language>

Target:
public EventHubClientBuilder proxyConfiguration(ProxyConfiguration proxyConfiguration) { this.proxyConfiguration = proxyConfiguration; return this; }
Source:
<code>public LegacyXaDataSourceImp buildCommonPool(Integer minPoolSize, Integer initialPoolSize, Integer maxPoolSize, Boolean prefill, Boolean useStrictMin, FlushStrategy flushStrategy, Boolean isSameRmOverride, Boolean interleaving, Boolean padXid, Boolean wrapXaResource, Boolean noTxSeparatePool) throws Exception { xaPool = new DsXaPoolImpl(minPoolSize, initialPoolSize, maxPoolSize, prefill, useStrictMin, flushStrategy, isSameRmOverride, interleaving, padXid, <START> wrapXaResource, noTxSeparatePool, false, null, Defaults.FAIR, null); <END> return this; }</code><technical_language>right</technical_language>

Target:
public LegacyXaDataSourceImp buildCommonPool(Integer minPoolSize, Integer initialPoolSize, Integer maxPoolSize, Boolean prefill, Boolean useStrictMin, FlushStrategy flushStrategy, Boolean isSameRmOverride, Boolean interleaving, Boolean padXid, Boolean wrapXaResource, Boolean noTxSeparatePool) throws Exception { xaPool = new DsXaPoolImpl(minPoolSize, initialPoolSize, maxPoolSize, prefill, useStrictMin, flushStrategy, isSameRmOverride, interleaving, padXid, wrapXaResource, noTxSeparatePool, false, null, null, null); return this; }
Source:
<code>public AttributeType guessAttributeType(List<Object> dataValues) { boolean guessCompleted = false; int rowCount = dataValues.size(); int currentRowIndex = 0; AttributeType guess = getBasicAttributeType(dataValues.get(0)); while (currentRowIndex < rowCount && !guessCompleted) { Object value = dataValues.get(currentRowIndex); AttributeType basicType = getBasicAttributeType(value); guess = getCommonType(guess, basicType); <START> guess = getEnrichedType(guess, value); <END> if (guess.equals(STRING) || guess.equals(TEXT)) { guessCompleted = true; } currentRowIndex++; } return guess; }</code><technical_language>create a new var enrichedGuess reusing var lead problems moving lines</technical_language>

Target:
public AttributeType guessAttributeType(List<Object> dataValues) { boolean guessCompleted = false; int rowCount = dataValues.size(); int currentRowIndex = 0; AttributeType guess = getBasicAttributeType(dataValues.get(0)); while (currentRowIndex < rowCount && !guessCompleted) { Object value = dataValues.get(currentRowIndex); AttributeType basicType = getBasicAttributeType(value); guess = getCommonType(guess, basicType); guess = getEnrichedType(guess, value); if (TEXT.equals(guess)) { guessCompleted = true; } currentRowIndex++; } if (guess == null) { guess = STRING; } return guess; }
Source:
<code>public static void tearDown() throws IOException, OperationException, CommandFailedException, TimeoutException, InterruptedException { client.apply(snapshotBackup.restore()); administration.reloadIfRequired(); <START> client.close(); <END> }</code><technical_language>I suggest clean client in class is created - in parent AbstractMessagingTestCase</technical_language>

Target:
public static void tearDown() throws InterruptedException, TimeoutException, IOException, CommandFailedException { client.apply(snapshotBackup.restore()); administration.reloadIfRequired(); }
Source:
<code>public void testInvalidPasswordValidate() throws BugzillaRestException { RepositoryLocation location = new RepositoryLocation(); location.setUrl(actualFixture.getRepositoryUrl()); location.setProxy(null); location.setCredentialsStore(new InMemoryCredentialsStore()); location.setCredentials(AuthenticationType.REPOSITORY, new UserCredentials("tests@mylyn.eclipse.org", "wrong")); thrown.expect(BugzillaRestException.class); <START> thrown.expectMessage("Unauthorized"); <END> BugzillaRestClient client; client = new BugzillaRestClient(location, connector); assertNotNull(client.getClient()); client.validate(new NullOperationMonitor()); }</code><technical_language>thrown configured right client.validate() is called</technical_language>

Target:
public void testInvalidPasswordValidate() throws BugzillaRestException { RepositoryLocation location = new RepositoryLocation(); location.setUrl(actualFixture.getRepositoryUrl()); location.setProxy(null); location.setCredentialsStore(new InMemoryCredentialsStore()); location.setCredentials(AuthenticationType.REPOSITORY, new UserCredentials("tests@mylyn.eclipse.org", "wrong")); BugzillaRestClient client; client = new BugzillaRestClient(location, connector); assertNotNull(client.getClient()); thrown.expect(BugzillaRestException.class); thrown.expectMessage("Unauthorized"); client.validate(new NullOperationMonitor()); }
Source:
<code>private void matchIndexesToNode( NodeRecord record, CheckerEngine<NodeRecord, ConsistencyReport.NodeConsistencyReport> engine, RecordAccess records, Collection<PropertyRecord> propertyRecs ) { Set<Long> labels = NodeLabelReader.getListOfLabels( record, records, engine ); List<PropertyBlock> properties = null; PrimitiveIntSet nodePropertyIds = null; for ( IndexRule indexRule : indexes.rules() ) { long labelId = indexRule.schema().getLabelId(); if ( labels.contains( labelId ) ) { if ( properties == null ) { properties = propertyReader.propertyBlocks( propertyRecs ); nodePropertyIds = propertyIds( properties ); } int[] indexPropertyIds = indexRule.schema().getPropertyIds(); if ( nodeHasSchemaProperties( nodePropertyIds, indexPropertyIds, NO_SUCH_PROPERTY_KEY ) ) { <START> Object[] values = getPropertyValues( properties, indexPropertyIds ); <END> try ( IndexReader reader = indexes.accessorFor( indexRule ).newReader() ) { long nodeId = record.getId(); if ( indexRule.canSupportUniqueConstraint() ) { verifyNodeCorrectlyIndexedUniquely( nodeId, values, engine, indexRule, reader ); } else { long count = reader.countIndexedNodes( nodeId, values ); reportIncorrectIndexCount( values, engine, indexRule, count ); } } } } } }</code><technical_language>if properties map instead (id -> block) avoid searching property block ids extracted check</technical_language>

Target:
private void matchIndexesToNode( NodeRecord record, CheckerEngine<NodeRecord, ConsistencyReport.NodeConsistencyReport> engine, RecordAccess records, Collection<PropertyRecord> propertyRecs ) { Set<Long> labels = NodeLabelReader.getListOfLabels( record, records, engine ); PrimitiveIntObjectMap<PropertyBlock> nodePropertyMap = null; for ( IndexRule indexRule : indexes.rules() ) { long labelId = indexRule.schema().getLabelId(); if ( labels.contains( labelId ) ) { if ( nodePropertyMap == null ) { nodePropertyMap = properties( propertyReader.propertyBlocks( propertyRecs ) ); } int[] indexPropertyIds = indexRule.schema().getPropertyIds(); if ( nodeHasSchemaProperties( nodePropertyMap, indexPropertyIds ) ) { Object[] values = getPropertyValues( nodePropertyMap, indexPropertyIds ); try ( IndexReader reader = indexes.accessorFor( indexRule ).newReader() ) { long nodeId = record.getId(); if ( indexRule.canSupportUniqueConstraint() ) { verifyNodeCorrectlyIndexedUniquely( nodeId, values, engine, indexRule, reader ); } else { long count = reader.countIndexedNodes( nodeId, values ); reportIncorrectIndexCount( values, engine, indexRule, count ); } } } } } }
Source:
<code><START> MemcachedMetadata(long flags, long lifespan, EntryVersion version) { <END> super(lifespan, version); this.flags = flags; }</code><technical_language>This private before</technical_language>

Target:
private MemcachedMetadata(long flags, long lifespan, EntryVersion version) { super(lifespan, version); this.flags = flags; }
Source:
<code>public void open() throws Exception { super.open(); timestampAssigner = watermarkStrategy.createTimestampAssigner(this::getMetricGroup); watermarkGenerator = new NoOpWatermarkGenerator<>( watermarkStrategy.createWatermarkGenerator(this::getMetricGroup), emitProgressiveWatermarks); wmOutput = new WatermarkEmitter(output, getContainingTask().getStreamStatusMaintainer()); watermarkInterval = getExecutionConfig().getAutoWatermarkInterval(); <START> if (watermarkInterval > 0) { <END> final long now = getProcessingTimeService().getCurrentProcessingTime(); getProcessingTimeService().registerTimer(now + watermarkInterval, this); } }</code><technical_language>This check valid do want register timers, if need to</technical_language>

Target:
public void open() throws Exception { super.open(); timestampAssigner = watermarkStrategy.createTimestampAssigner(this::getMetricGroup); watermarkGenerator = emitProgressiveWatermarks ? watermarkStrategy.createWatermarkGenerator(this::getMetricGroup) : new NoWatermarksGenerator<>(); wmOutput = new WatermarkEmitter(output, getContainingTask().getStreamStatusMaintainer()); watermarkInterval = getExecutionConfig().getAutoWatermarkInterval(); if (watermarkInterval > 0 && emitProgressiveWatermarks) { final long now = getProcessingTimeService().getCurrentProcessingTime(); getProcessingTimeService().registerTimer(now + watermarkInterval, this); } }
Source:
<code>public BaseLease(String partitionId) { <START> Objects.requireNonNull(partitionId, "'patitionId' cannot be null."); <END> if (partitionId.isEmpty()) { throw new IllegalArgumentException("partitionId is Empty"); } this.partitionId = partitionId; }</code><technical_language>suggestion Objects.requireNonNull(partitionId, "'partitionId' null.");</technical_language>

Target:
public BaseLease(String partitionId) { Objects.requireNonNull(partitionId, "'partitionId' cannot be null."); if (partitionId.isEmpty()) { throw new IllegalArgumentException("partitionId is Empty"); } this.partitionId = partitionId; }
Source:
<code>protected List<String> parseToUrlList(String responseBody) throws ParseUrlException { try { XPathFactory xPathFactory = XPathFactory.newInstance(); XPath xPath = xPathFactory.newXPath(); SimpleNamespaceContext namespaces = new SimpleNamespaceContext(); <START> Map<String, String> namespaceMap = new HashMap<String, String>(); <END> namespaceMap.put("x", "<LINK_0>"); namespaces.setBindings(namespaceMap); xPath.setNamespaceContext(namespaces); InputSource inputSource = new InputSource(new ByteArrayInputStream(responseBody.getBytes())); NodeList nodeList = (NodeList) xPath.compile("/x:xforms/x:xform/x:downloadUrl").evaluate(inputSource, XPathConstants.NODESET); List<String> urls = new ArrayList<>(); for (int i = 0; i < nodeList.getLength(); i++) { Node node = nodeList.item(i).getFirstChild(); urls.add(node.getNodeValue()); } return urls; } catch (XPathExpressionException e) { throw new ParseUrlException(e); } }</code><technical_language><> for constructor</technical_language>

Target:
protected List<String> parseToUrlList(String responseBody) throws ParseUrlException { try { XPathFactory xPathFactory = XPathFactory.newInstance(); XPath xPath = xPathFactory.newXPath(); SimpleNamespaceContext namespaces = new SimpleNamespaceContext(); Map<String, String> namespaceMap = new HashMap<>(); namespaceMap.put("x", "<LINK_0>"); namespaces.setBindings(namespaceMap); xPath.setNamespaceContext(namespaces); InputSource inputSource = new InputSource(new ByteArrayInputStream(responseBody.getBytes())); NodeList nodeList = (NodeList) xPath.compile("/x:xforms/x:xform/x:downloadUrl").evaluate(inputSource, XPathConstants.NODESET); List<String> urls = new ArrayList<>(); for (int i = 0; i < nodeList.getLength(); i++) { Node node = nodeList.item(i).getFirstChild(); urls.add(node.getNodeValue()); } return urls; } catch (XPathExpressionException e) { throw new ParseUrlException(e); } }
Source:
<code>public MLModel retrieveModel(long modelId) throws MLModelHandlerException { InputStream in = null; ObjectInputStream ois = null; String storageLocation = null; try { MLStorage storage = databaseService.getModelStorage(modelId); if (storage == null) { throw new MLModelHandlerException("Invalid model ID: " + modelId); } String storageType = storage.getType(); storageLocation = storage.getLocation(); MLIOFactory ioFactory = new MLIOFactory(mlProperties); MLInputAdapter inputAdapter = ioFactory.getInputAdapter(storageType + MLConstants.IN_SUFFIX); in = inputAdapter.read(storageLocation); ois = new ObjectInputStream(in); MLModel model = (MLModel) ois.readObject(); <START> log.info("Successfully retrieved model"); <END> return model; } catch (Exception e) { throw new MLModelHandlerException("Failed to retrieve the model [id] " + modelId, e); } finally { if (in != null) { try { in.close(); } catch (IOException ignore) { } } if (ois != null) { try { ois.close(); } catch (IOException ignore) { } } } }</code><technical_language>this a debug log. if (log.isDebugEnabled) ..</technical_language>

Target:
public MLModel retrieveModel(long modelId) throws MLModelHandlerException { InputStream in = null; ObjectInputStream ois = null; String storageLocation = null; try { MLStorage storage = databaseService.getModelStorage(modelId); if (storage == null) { throw new MLModelHandlerException("Invalid model ID: " + modelId); } String storageType = storage.getType(); storageLocation = storage.getLocation(); MLIOFactory ioFactory = new MLIOFactory(mlProperties); MLInputAdapter inputAdapter = ioFactory.getInputAdapter(storageType + MLConstants.IN_SUFFIX); in = inputAdapter.read(storageLocation); ois = new ObjectInputStream(in); MLModel model = (MLModel) ois.readObject(); if (log.isDebugEnabled()) { log.debug("Successfully retrieved model"); } return model; } catch (Exception e) { throw new MLModelHandlerException("Failed to retrieve the model [id] " + modelId, e); } finally { if (in != null) { try { in.close(); } catch (IOException ignore) { } } if (ois != null) { try { ois.close(); } catch (IOException ignore) { } } } }
Source:
<code>public void testEgality() { ToolTipString fromHtml = ToolTipString.fromHtml("<div>1</div>"); ToolTipString fromHtmlString = ToolTipString.fromString("<div>1</div>"); ToolTipString fromString = ToolTipString.fromString("1"); ToolTipString fromInt = ToolTipString.fromDecimal(1); ToolTipString fromLong = ToolTipString.fromDecimal(1L); assertNotEquals(fromInt, null); assertNotEquals(fromInt, new Object()); assertEquals(fromInt, fromInt); assertEquals(fromInt.hashCode(), fromLong.hashCode()); assertEquals(fromInt, fromLong); assertNotEquals(fromInt, fromHtml); assertNotEquals(fromHtmlString, fromHtml); assertEquals(fromString.hashCode(), fromLong.hashCode()); <START> assertEquals(fromString, fromLong); <END> }</code><technical_language>I test inequality of fromHtml() plain text html string</technical_language>

Target:
public void testEgality() { ToolTipString fromHtml = ToolTipString.fromHtml("<div>1</div>"); ToolTipString fromHtmlString = ToolTipString.fromString("<div>1</div>"); ToolTipString fromString = ToolTipString.fromString("1"); ToolTipString fromInt = ToolTipString.fromDecimal(1); ToolTipString fromLong = ToolTipString.fromDecimal(1L); assertNotEquals(fromInt, null); assertNotEquals(fromInt, new Object()); assertEquals(fromInt, fromInt); assertEquals(fromInt.hashCode(), fromLong.hashCode()); assertEquals(fromInt, fromLong); assertNotEquals(fromInt, fromHtml); assertNotEquals(fromHtmlString, fromHtml); assertNotEquals(fromHtml, ToolTipString.fromHtml("<a>1</a>")); assertEquals(fromString.hashCode(), fromLong.hashCode()); assertEquals(fromString, fromLong); }